summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRené 'Necoro' Neumann <necoro@necoro.eu>2020-04-12 17:29:42 +0200
committerRené 'Necoro' Neumann <necoro@necoro.eu>2021-06-24 00:01:22 +0200
commit3d7e7b011996345b1c57e8759e47a0a47f4a41ac (patch)
tree5e5c5e0eb5f9bc757cc4a6c56492e565b8432fd3 /src
parent4ff04feaa454b05efb6fe4e2ac1c436ee2bdfa6d (diff)
downloadpass-necoro.tar.gz
pass-necoro.tar.bz2
pass-necoro.zip
Fix order of conditionsnecoro
Diffstat (limited to 'src')
-rwxr-xr-xsrc/password-store.sh8
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 $?