diff options
author | xPMo <PMo_@vivaldi.net> | 2018-05-21 17:11:28 -0500 |
---|---|---|
committer | Tad Fisher <tadfisher@gmail.com> | 2018-06-03 18:57:38 -0700 |
commit | cae5d5088ef5056ab3d3e4c144ec1b02d4ee2d3d (patch) | |
tree | bc2d5b918a5f1d33363d7e84db1f3a0fcaf9d4f6 | |
parent | 938f7fd3b6ab4a4c6008ef84e47f9449cc792625 (diff) | |
download | pass-otp-cae5d5088ef5056ab3d3e4c144ec1b02d4ee2d3d.tar.gz pass-otp-cae5d5088ef5056ab3d3e4c144ec1b02d4ee2d3d.zip |
Fix behaviour for otp append as well
-rwxr-xr-x | otp.bash | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -273,7 +273,11 @@ cmd_otp_append() { [[ -n "$existing" ]] && yesno "An OTP secret already exists for $path. Overwrite it?" if [[ $from_secret -eq 1 ]]; then - ([[ -z "$issuer" ]] || [[ -z "$account" ]]) && die "Missing issuer or account" + [ -z "$issuer" ] && issuer=false + [ -z "$account" ] && account=false + + [ "$issuer" = false ] && [ "$account" = false ] && die "Missing one of either '--issuer' or '--account'" + otp_read_secret "$prompt" $echo "$issuer" "$account" else otp_read_uri "$prompt" $echo |