mirror of
https://github.com/octoleo/Purse.git
synced 2024-12-29 12:32:39 +00:00
Fast fail if password file is missing.
This commit is contained in:
parent
f42437388d
commit
09adcb0b95
@ -36,7 +36,9 @@ The script and `pwd.sh.safe` encrypted file can be safely shared between machine
|
||||
|
||||
A sample `gpg.conf` configuration file is provided for your consideration.
|
||||
|
||||
# Alternatives
|
||||
# Recommended software
|
||||
|
||||
[Pass: the standard unix password manager](http://www.passwordstore.org/)
|
||||
|
||||
[sf-pwgen: generates passwords using OS X Security framework](https://github.com/anders/pwgen)
|
||||
|
||||
|
8
pwd.sh
8
pwd.sh
@ -68,6 +68,10 @@ encrypt () {
|
||||
read_pass () {
|
||||
# Read a password from safe.
|
||||
|
||||
if [[ ! -s ${safe} ]] ; then
|
||||
fail "No passwords found"
|
||||
fi
|
||||
|
||||
if [[ -z "${2+x}" ]] ; then
|
||||
read -p "
|
||||
Username to read? (default: all) " username
|
||||
@ -79,14 +83,10 @@ read_pass () {
|
||||
username=""
|
||||
fi
|
||||
|
||||
if [[ ! -s ${safe} ]] ; then
|
||||
fail "No passwords found"
|
||||
else
|
||||
get_pass "
|
||||
Enter password to unlock ${safe}: "
|
||||
printf "\n\n"
|
||||
decrypt ${password} ${safe} | grep " ${username}" || fail "Decryption failed"
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user