Don't store future passwords after store
This commit is contained in:
parent
bb7f71eedc
commit
5ff2e50dfe
|
@ -50,6 +50,9 @@ REMOVE_APP=
|
||||||
CURR_PASSWORD=""
|
CURR_PASSWORD=""
|
||||||
TESTS=
|
TESTS=
|
||||||
|
|
||||||
|
# If this file is present then don't store passwords
|
||||||
|
NO_PASSWORD_STORE_FILE=~/.nostore
|
||||||
|
|
||||||
function get_backup_key_id {
|
function get_backup_key_id {
|
||||||
MY_BACKUP_KEY_ID=$(gpg --list-keys "(backup key)" | \
|
MY_BACKUP_KEY_ID=$(gpg --list-keys "(backup key)" | \
|
||||||
grep 'pub ' | awk -F ' ' '{print $2}' | \
|
grep 'pub ' | awk -F ' ' '{print $2}' | \
|
||||||
|
@ -135,7 +138,10 @@ function clear_passwords {
|
||||||
rm -rf /root/.passwords/$USERNAME
|
rm -rf /root/.passwords/$USERNAME
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
echo $'Passwords cleared'
|
if [ ! -f $NO_PASSWORD_STORE_FILE ]; then
|
||||||
|
touch $NO_PASSWORD_STORE_FILE
|
||||||
|
fi
|
||||||
|
echo $'Passwords cleared. Future passwords will not be stored.'
|
||||||
exit 0
|
exit 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -233,6 +239,9 @@ if [ ${#CURR_PASSWORD} -eq 0 ]; then
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
# store password
|
# store password
|
||||||
|
if [ -f $NO_PASSWORD_STORE_FILE ]; then
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
if [ ! -d ~/.passwords/$CURR_USERNAME ]; then
|
if [ ! -d ~/.passwords/$CURR_USERNAME ]; then
|
||||||
mkdir -p ~/.passwords/$CURR_USERNAME
|
mkdir -p ~/.passwords/$CURR_USERNAME
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in New Issue