aboutsummaryrefslogtreecommitdiff
path: root/otp.bash
diff options
context:
space:
mode:
Diffstat (limited to 'otp.bash')
-rwxr-xr-xotp.bash8
1 files changed, 6 insertions, 2 deletions
diff --git a/otp.bash b/otp.bash
index f0f4d0d..447af1e 100755
--- a/otp.bash
+++ b/otp.bash
@@ -304,7 +304,7 @@ cmd_otp_code() {
local path="${1%/}"
local passfile="$PREFIX/$path.gpg"
check_sneaky_paths "$path"
- [[ ! -f $passfile ]] && die "Passfile not found"
+ [[ ! -f $passfile ]] && die "$path: passfile not found."
contents=$($GPG -d "${GPG_OPTS[@]}" "$passfile")
while read -r -a line; do
@@ -330,9 +330,13 @@ cmd_otp_code() {
[[ -n "$otp_digits" ]] && cmd+=" --digits=$otp_digits"
cmd+=" $otp_secret"
;;
+
+ *)
+ die "$path: OTP secret not found."
+ ;;
esac
- local out; out=$($cmd) || die "Failed to generate OTP code for $path"
+ local out; out=$($cmd) || die "$path: failed to generate OTP code."
if [[ "$otp_type" == "hotp" ]]; then
# Increment HOTP counter in-place