Skip to content
Snippets Groups Projects
Commit ca7b84be authored by Bob Mottram's avatar Bob Mottram
Browse files

Optionally specify master password

parent 807d6055
No related branches found
No related tags found
No related merge requests found
......@@ -51,6 +51,8 @@ CURR_PASSWORD=""
TESTS=
EXPORT_FILENAME=
MASTER_PASSWORD=''
# If this file is present then don't store passwords
NO_PASSWORD_STORE_FILE=~/.nostore
......@@ -224,6 +226,10 @@ do
shift
EXPORT_FILENAME="${1}"
;;
--master)
shift
MASTER_PASSWORD="${1}"
;;
-p|--pass|--password|--passphrase)
shift
CURR_PASSWORD="${1}"
......@@ -244,8 +250,10 @@ fi
get_backup_key_id
# Use the backups private key as a symmetric passphrase
MASTER_PASSWORD=$(gpg -q --armor --export-secret-key $MY_BACKUP_KEY_ID | sed '/---/d' | sed '/Version/d' | sed '/^$/d')
if [ ${#MASTER_PASSWORD} -eq 0 ]; then
# Use the backups private key as a symmetric passphrase
MASTER_PASSWORD=$(gpg -q --armor --export-secret-key $MY_BACKUP_KEY_ID | sed '/---/d' | sed '/Version/d' | sed '/^$/d')
fi
if [ $TESTS ]; then
run_tests
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment