f2f2a49a56a1a5a140d170500bbd1dce165ebaac

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

Message

Added missing quotes to fix unary operator expected warning in rare occasions (inspired from [MafiaInc])

Diff

 1diff --git a/duplicity-backup.sh b/duplicity-backup.sh
 2index 3c60d76af61f5980dbc34551e46bb31e5e8969c6..c8c957eaf5ab3bbdbb92f7664a57a2efeebe7d0b 100755
 3--- a/duplicity-backup.sh
 4+++ b/duplicity-backup.sh
 5@@ -56,13 +56,13 @@ S3CMD="$(which s3cmd)"
 6 # the script is running at a time.
 7 LOCKFILE=${LOGDIR}backup.lock
 8 
 9-if [ $ENCRYPTION = "yes" ]; then
10+if [ "$ENCRYPTION" = "yes" ]; then
11   if [ ! -z "$GPG_KEY" ]; then
12     ENCRYPT="--encrypt-key=${GPG_KEY} --sign-key=${GPG_KEY}"
13   elif [ ! -z "$PASSPHRASE" ]; then
14     ENCRYPT=""
15   fi
16-elif [ $ENCRYPTION = "no" ]; then
17+elif [ "$ENCRYPTION" = "no" ]; then
18   ENCRYPT="--no-encryption"
19 fi
20 
21@@ -79,7 +79,7 @@ if [ ! -x "$DUPLICITY" ]; then
22   exit 1
23 fi
24 
25-if  [ `echo ${DEST} | cut -c 1,2` = "s3" ]; then
26+if  [ "`echo ${DEST} | cut -c 1,2`" = "s3" ]; then
27   DEST_IS_S3=true
28   if [ ! -x "$S3CMD" ]; then
29     echo $NO_S3CMD; S3CMD_AVAIL=false