diff --git a/src/freedombone-pass b/src/freedombone-pass index febbb33e..ca606537 100755 --- a/src/freedombone-pass +++ b/src/freedombone-pass @@ -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