From 7aa30b2e27a01fc408dcef9255e70fed5ee034d1 Mon Sep 17 00:00:00 2001 From: Zertrin Date: Thu, 10 May 2012 20:56:55 +0200 Subject: [PATCH] Added support for including the config file (if specified and existing) in the encrypted tarball when backuping the script --- duplicity-backup.sh | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/duplicity-backup.sh b/duplicity-backup.sh index 851128f..4a851ff 100755 --- a/duplicity-backup.sh +++ b/duplicity-backup.sh @@ -394,7 +394,13 @@ backup_this_script() echo "You are backing up: " echo " 1. ${SCRIPTPATH}" echo " 2. GPG Secret Key: ${GPG_KEY}" - echo "Backup will be saved to: `pwd`/${TMPFILENAME}" + + if [ ! -z "$CONFIG" -a -f "$CONFIG" ]; + then + echo " 3. Config file: ${CONFIG}" + fi + + echo "Backup tarball will be encrypted and saved to: `pwd`/${TMPFILENAME}" echo echo ">> Are you sure you want to do that ('yes' to continue)?" read ANSWER @@ -405,6 +411,12 @@ backup_this_script() mkdir -p ${TMPDIR} cp $SCRIPTPATH ${TMPDIR}/ + + if [ ! -z "$CONFIG" -a -f "$CONFIG" ]; + then + cp $CONFIG ${TMPDIR}/ + fi + gpg -a --export-secret-keys ${GPG_KEY} > ${TMPDIR}/duplicity-backup-secret.key.txt echo -e ${README_TXT} > ${README} echo "Encrypting tarball, choose a password you'll remember..."