nix/bin/pass-migrate-to-pass-otp

7 lines
231 B
Text
Raw Normal View History

2023-09-05 13:52:52 -05:00
#!/usr/bin/env fish
set entry $argv[1]
set otp_secret (pass $entry | awk -F': ' '/^otp/{gsub(/\s/,"",$2);print $2}')
set otp_uri "otpauth://totp/totp-secret?secret=$otp_secret&issuer=$entry"
echo $otp_uri | pass otp append $entry