diff options
Diffstat (limited to 'src')
-rwxr-xr-x | src/password-store.sh | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/password-store.sh b/src/password-store.sh index 76620cd..35e7a51 100755 --- a/src/password-store.sh +++ b/src/password-store.sh @@ -387,10 +387,7 @@ cmd_show() { local passfile="$PREFIX/$path.gpg" check_sneaky_paths "$path" if [[ -f $passfile ]]; then - if [[ $clip -eq 0 && $qrcode -eq 0 ]]; then - pass="$($GPG -d "${GPG_OPTS[@]}" "$passfile" | $BASE64)" || exit $? - echo "$pass" | $BASE64 -d - elif [[ $user -eq 1 ]]; then + if [[ $user -eq 1 ]]; then local user="$($GPG -d "${GPG_OPTS[@]}" "$passfile" | grep -m 1 "^${USER_STRING}" | sed -e "s/^${USER_STRING}"'\(.*\)/\1/')" [[ -n $user ]] || exit 1 @@ -402,6 +399,9 @@ cmd_show() { else echo "$user" fi + elif [[ $clip -eq 0 && $qrcode -eq 0 ]]; then + pass="$($GPG -d "${GPG_OPTS[@]}" "$passfile" | $BASE64)" || exit $? + echo "$pass" | $BASE64 -d else [[ $selected_line =~ ^[0-9]+$ ]] || die "Clip location '$selected_line' is not a number." pass="$($GPG -d "${GPG_OPTS[@]}" "$passfile" | tail -n +${selected_line} | head -n 1)" || exit $? |