Fix issue #16
This commit is contained in:
parent
12f9b93b12
commit
449c26d596
1 changed files with 15 additions and 0 deletions
|
|
@ -359,6 +359,18 @@ duplicity_backup()
|
||||||
>> ${LOGFILE}
|
>> ${LOGFILE}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
setup_passphrases_for_restore()
|
||||||
|
{
|
||||||
|
if [ ! -z "$GPG_ENC_KEY" -a ! -z "$GPG_SIGN_KEY" -a "$GPG_ENC_KEY" != "$GPG_SIGN_KEY" ]; then
|
||||||
|
SIGN_PASSPHRASE=$PASSPHRASE
|
||||||
|
echo "Please provide the passphrase for decryption (GPG key 0x${GPG_ENC_KEY}):"
|
||||||
|
read -e ENCPASSPHRASE
|
||||||
|
PASSPHRASE=$ENCPASSPHRASE
|
||||||
|
export SIGN_PASSPHRASE
|
||||||
|
export PASSPHRASE
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
get_file_sizes()
|
get_file_sizes()
|
||||||
{
|
{
|
||||||
get_source_file_size
|
get_source_file_size
|
||||||
|
|
@ -495,6 +507,7 @@ case "$COMMAND" in
|
||||||
DEST=$RESTORE_DEST
|
DEST=$RESTORE_DEST
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
setup_passphrases_for_restore
|
||||||
echo "Attempting to restore now ..."
|
echo "Attempting to restore now ..."
|
||||||
duplicity_backup
|
duplicity_backup
|
||||||
;;
|
;;
|
||||||
|
|
@ -532,6 +545,7 @@ case "$COMMAND" in
|
||||||
FILE_TO_RESTORE="'"$FILE_TO_RESTORE"'"
|
FILE_TO_RESTORE="'"$FILE_TO_RESTORE"'"
|
||||||
DEST="'"$DEST"'"
|
DEST="'"$DEST"'"
|
||||||
|
|
||||||
|
setup_passphrases_for_restore
|
||||||
echo "Restoring now ..."
|
echo "Restoring now ..."
|
||||||
#use INCLUDE variable without create another one
|
#use INCLUDE variable without create another one
|
||||||
INCLUDE="--file-to-restore ${FILE_TO_RESTORE}"
|
INCLUDE="--file-to-restore ${FILE_TO_RESTORE}"
|
||||||
|
|
@ -578,5 +592,6 @@ fi
|
||||||
unset AWS_ACCESS_KEY_ID
|
unset AWS_ACCESS_KEY_ID
|
||||||
unset AWS_SECRET_ACCESS_KEY
|
unset AWS_SECRET_ACCESS_KEY
|
||||||
unset PASSPHRASE
|
unset PASSPHRASE
|
||||||
|
unset SIGN_PASSPHRASE
|
||||||
|
|
||||||
# vim: set tabstop=2 shiftwidth=2 sts=2 autoindent smartindent:
|
# vim: set tabstop=2 shiftwidth=2 sts=2 autoindent smartindent:
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue