From 73adf5dc99f98c0129d1c12a155187a13e36541a Mon Sep 17 00:00:00 2001 From: zertrin Date: Wed, 31 Aug 2016 23:02:45 +0200 Subject: [PATCH] Fixes related to new warnings coming from the new version of shellcheck --- .travis.yml | 4 ++-- duplicity-backup.sh | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.travis.yml b/.travis.yml index 875f889..26d3e16 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,8 +11,8 @@ addons: - shellcheck script: - - shellcheck -e SC2153 duplicity-backup.sh - - shellcheck -e SC2034 duplicity-backup.conf.example + - shellcheck -e SC2153 -e SC2166 -e SC1090 duplicity-backup.sh + - shellcheck -e SC2034 duplicity-backup.conf.example matrix: fast_finish: true diff --git a/duplicity-backup.sh b/duplicity-backup.sh index c911657..b37b76a 100755 --- a/duplicity-backup.sh +++ b/duplicity-backup.sh @@ -724,7 +724,7 @@ backup_this_script() 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 + read -r ANSWER if [ "${ANSWER}" != "yes" ]; then echo "You said << ${ANSWER} >> so I am exiting now." exit 1 @@ -833,11 +833,11 @@ case "${COMMAND}" in if [[ ! "${RESTORE_DEST}" ]]; then echo "Please provide a destination path (eg, /home/user/dir):" - read -e NEWDESTINATION + read -r -e NEWDESTINATION DEST=${NEWDESTINATION} echo ">> You will restore from ${ROOT} to ${DEST}" echo "Are you sure you want to do that ('yes' to continue)?" - read ANSWER + read -r ANSWER if [[ "${ANSWER}" != "yes" ]]; then echo "You said << ${ANSWER} >> so I am exiting now." echo -e "User aborted restore process ...\n" >> "${LOGFILE}" @@ -863,7 +863,7 @@ case "${COMMAND}" in if [[ ! "${FILE_TO_RESTORE}" ]]; then echo "Which file or directory do you want to restore?" echo "(give the path relative to the root of the backup eg, mail/letter.txt):" - read -e FILE_TO_RESTORE + read -r -e FILE_TO_RESTORE echo fi @@ -877,7 +877,7 @@ case "${COMMAND}" in echo -e ">> RESTORE: ${FILE_TO_RESTORE}" echo -e ">> TO: ${DEST}" echo -e "\nAre you sure you want to do that ('yes' to continue)?" - read ANSWER + read -r ANSWER if [ "${ANSWER}" != "yes" ]; then echo "You said << ${ANSWER} >> so I am exiting now." echo -e "--------------------- END ---------------------\n" >> "${LOGFILE}"