9489adc9d4306cb0a461087ac99ad3c7f53a6a0b

Author
zertrin <zrk951@gmail.com>
Committer
zertrin <zrk951@gmail.com>
Date

Message

Merge pull request #4 from puredoze/master

Support for using only GPG passphrase

Diff

 1diff --git a/duplicity-backup.sh b/duplicity-backup.sh
 2index f2a4d61e2b57f87faa9b2f8aa610be4e00771d9b..ed385c00ffca2d39f231c8302290d55c9b656ce1 100755
 3--- a/duplicity-backup.sh
 4+++ b/duplicity-backup.sh
 5@@ -39,14 +39,15 @@ AWS_SECRET_ACCESS_KEY="foobar_aws_access_key"
 6 # ENCRYPTION INFORMATION
 7 # If you aren't running this from a cron, comment this line out
 8 # and duplicity should prompt you for your password.
 9-# Comment out if you're not using encryption
10+# Comment out if you're using only GPG_KEY or not using encryption
11 PASSPHRASE="foobar_gpg_passphrase"
12 
13 # Specify which GPG key you would like to use (even if you have only one).
14-# Comment out if you're not using encryption
15+# Comment out if you're using only PASSPHRASE or not using encryption
16 GPG_KEY="foobar_gpg_key"
17 
18 # Do you want your backup to be encrypted? yes/no
19+# If yes, please make sure you specify either PASSPHRASE OR GPG_KEY
20 ENCRYPTION='yes'
21 
22 # BACKUP SOURCE INFORMATION
23@@ -174,7 +175,11 @@ S3CMD="$(which s3cmd)"
24 LOCKFILE=${LOGDIR}backup.lock
25 
26 if [ $ENCRYPTION = "yes" ]; then
27-  ENCRYPT="--encrypt-key=${GPG_KEY} --sign-key=${GPG_KEY}"
28+  if [ ! -z "$GPG_KEY" ]; then
29+    ENCRYPT="--encrypt-key=${GPG_KEY} --sign-key=${GPG_KEY}"
30+  elif [ ! -z "$PASSPHRASE" ]; then
31+    ENCRYPT=""
32+  fi
33 elif [ $ENCRYPTION = "no" ]; then
34   ENCRYPT="--no-encryption"
35 fi