This commit is contained in:
Bob Mottram 2016-11-19 13:38:19 +00:00
parent 5d9b8db783
commit 1c91882710
1 changed files with 6 additions and 6 deletions

View File

@ -118,19 +118,19 @@ fi
if [ ${#CURR_PASSWORD} -eq 0 ]; then
# retrieve password
if [ ! -f ~/.passwords/$CURR_USER/$CURR_APP ]; then
if [ ! -f ~/.passwords/$CURR_USERNAME/$CURR_APP ]; then
echo ""
exit 4
else
gpg -dq --passphrase "$MASTER_PASSWORD" ~/.passwords/$CURR_USER/$CURR_APP
gpg -dq --passphrase "$MASTER_PASSWORD" ~/.passwords/$CURR_USERNAME/$CURR_APP
fi
else
# store password
if [ ! -d ~/.passwords/$CURR_USER ]; then
mkdir -p ~/.passwords/$CURR_USER
if [ ! -d ~/.passwords/$CURR_USERNAME ]; then
mkdir -p ~/.passwords/$CURR_USERNAME
fi
echo “$CURR_PASSWORD” | gpg -ca --cipher-algo AES256 --passphrase "$MASTER_PASSWORD" > ~/.passwords/$CURR_USER/$CURR_APP
if [ ! -f ~/.passwords/$CURR_USER/$CURR_APP ]; then
echo “$CURR_PASSWORD” | gpg -ca --cipher-algo AES256 --passphrase "$MASTER_PASSWORD" > ~/.passwords/$CURR_USERNAME/$CURR_APP
if [ ! -f ~/.passwords/$CURR_USERNAME/$CURR_APP ]; then
exit 5
fi
fi