nix/scripts/bin/pass-migrate-to-pass-otp
2023-09-05 15:15:43 -05:00

7 lines
231 B
Fish
Executable file

#!/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