From f2f2a49a56a1a5a140d170500bbd1dce165ebaac Mon Sep 17 00:00:00 2001 From: Zertrin Date: Sat, 4 Aug 2012 23:13:31 +0200 Subject: [PATCH] Added missing quotes to fix unary operator expected warning in rare occasions (inspired from [MafiaInc]) --- duplicity-backup.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/duplicity-backup.sh b/duplicity-backup.sh index 3c60d76..c8c957e 100755 --- a/duplicity-backup.sh +++ b/duplicity-backup.sh @@ -56,13 +56,13 @@ S3CMD="$(which s3cmd)" # the script is running at a time. LOCKFILE=${LOGDIR}backup.lock -if [ $ENCRYPTION = "yes" ]; then +if [ "$ENCRYPTION" = "yes" ]; then if [ ! -z "$GPG_KEY" ]; then ENCRYPT="--encrypt-key=${GPG_KEY} --sign-key=${GPG_KEY}" elif [ ! -z "$PASSPHRASE" ]; then ENCRYPT="" fi -elif [ $ENCRYPTION = "no" ]; then +elif [ "$ENCRYPTION" = "no" ]; then ENCRYPT="--no-encryption" fi @@ -79,7 +79,7 @@ if [ ! -x "$DUPLICITY" ]; then exit 1 fi -if [ `echo ${DEST} | cut -c 1,2` = "s3" ]; then +if [ "`echo ${DEST} | cut -c 1,2`" = "s3" ]; then DEST_IS_S3=true if [ ! -x "$S3CMD" ]; then echo $NO_S3CMD; S3CMD_AVAIL=false