Fixes related to new warnings coming from the new version of shellcheck

This commit is contained in:
zertrin 2016-08-31 23:02:45 +02:00
parent f4c999b2c5
commit 73adf5dc99
2 changed files with 7 additions and 7 deletions

View file

@ -11,7 +11,7 @@ addons:
- shellcheck - shellcheck
script: script:
- shellcheck -e SC2153 duplicity-backup.sh - shellcheck -e SC2153 -e SC2166 -e SC1090 duplicity-backup.sh
- shellcheck -e SC2034 duplicity-backup.conf.example - shellcheck -e SC2034 duplicity-backup.conf.example
matrix: matrix:

View file

@ -724,7 +724,7 @@ backup_this_script()
echo "Backup tarball will be encrypted and saved to: $(pwd)/${TMPFILENAME}" echo "Backup tarball will be encrypted and saved to: $(pwd)/${TMPFILENAME}"
echo echo
echo ">> Are you sure you want to do that ('yes' to continue)?" echo ">> Are you sure you want to do that ('yes' to continue)?"
read ANSWER read -r ANSWER
if [ "${ANSWER}" != "yes" ]; then if [ "${ANSWER}" != "yes" ]; then
echo "You said << ${ANSWER} >> so I am exiting now." echo "You said << ${ANSWER} >> so I am exiting now."
exit 1 exit 1
@ -833,11 +833,11 @@ case "${COMMAND}" in
if [[ ! "${RESTORE_DEST}" ]]; then if [[ ! "${RESTORE_DEST}" ]]; then
echo "Please provide a destination path (eg, /home/user/dir):" echo "Please provide a destination path (eg, /home/user/dir):"
read -e NEWDESTINATION read -r -e NEWDESTINATION
DEST=${NEWDESTINATION} DEST=${NEWDESTINATION}
echo ">> You will restore from ${ROOT} to ${DEST}" echo ">> You will restore from ${ROOT} to ${DEST}"
echo "Are you sure you want to do that ('yes' to continue)?" echo "Are you sure you want to do that ('yes' to continue)?"
read ANSWER read -r ANSWER
if [[ "${ANSWER}" != "yes" ]]; then if [[ "${ANSWER}" != "yes" ]]; then
echo "You said << ${ANSWER} >> so I am exiting now." echo "You said << ${ANSWER} >> so I am exiting now."
echo -e "User aborted restore process ...\n" >> "${LOGFILE}" echo -e "User aborted restore process ...\n" >> "${LOGFILE}"
@ -863,7 +863,7 @@ case "${COMMAND}" in
if [[ ! "${FILE_TO_RESTORE}" ]]; then if [[ ! "${FILE_TO_RESTORE}" ]]; then
echo "Which file or directory do you want to restore?" 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):" 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 echo
fi fi
@ -877,7 +877,7 @@ case "${COMMAND}" in
echo -e ">> RESTORE: ${FILE_TO_RESTORE}" echo -e ">> RESTORE: ${FILE_TO_RESTORE}"
echo -e ">> TO: ${DEST}" echo -e ">> TO: ${DEST}"
echo -e "\nAre you sure you want to do that ('yes' to continue)?" echo -e "\nAre you sure you want to do that ('yes' to continue)?"
read ANSWER read -r ANSWER
if [ "${ANSWER}" != "yes" ]; then if [ "${ANSWER}" != "yes" ]; then
echo "You said << ${ANSWER} >> so I am exiting now." echo "You said << ${ANSWER} >> so I am exiting now."
echo -e "--------------------- END ---------------------\n" >> "${LOGFILE}" echo -e "--------------------- END ---------------------\n" >> "${LOGFILE}"