mirror of
https://github.com/octoleo/Purse.git
synced 2024-12-29 12:32:39 +00:00
BSD-compatible grep flags. Match username to EOL.
This commit is contained in:
parent
0efd10110b
commit
42f664e920
6
pwd.sh
6
pwd.sh
@ -1,12 +1,12 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
#
|
#
|
||||||
# Script for managing passwords in a GunPG symmetrically encrypted file.
|
# Script for managing passwords in a GnuPG symmetrically encrypted file.
|
||||||
|
|
||||||
set -o errtrace
|
set -o errtrace
|
||||||
set -o nounset
|
set -o nounset
|
||||||
set -o pipefail
|
set -o pipefail
|
||||||
|
|
||||||
filter="$(command -v grep) --invert-match --regexp"
|
filter="$(command -v grep) -v --regexp"
|
||||||
gpg="$(command -v gpg || command -v gpg2)"
|
gpg="$(command -v gpg || command -v gpg2)"
|
||||||
safe="${PWDSH_SAFE:=pwd.sh.safe}"
|
safe="${PWDSH_SAFE:=pwd.sh.safe}"
|
||||||
|
|
||||||
@ -87,7 +87,7 @@ read_pass () {
|
|||||||
get_pass "
|
get_pass "
|
||||||
Enter password to unlock ${safe}: "
|
Enter password to unlock ${safe}: "
|
||||||
printf "\n\n"
|
printf "\n\n"
|
||||||
decrypt ${password} ${safe} | grep " ${username}" || fail "Decryption failed"
|
decrypt ${password} ${safe} | grep " ${username}$" || fail "Decryption failed"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user