From 544f84853dba8b477102561cbc970c8f5e636f48 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Bauer?= Date: Mon, 4 Feb 2019 21:47:54 +0100 Subject: [PATCH] more shellcheck fixes --- containers/zammad-memcached/docker-entrypoint.sh | 4 ++-- containers/zammad-postgresql/backup.sh | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/containers/zammad-memcached/docker-entrypoint.sh b/containers/zammad-memcached/docker-entrypoint.sh index 699588c..4143a61 100644 --- a/containers/zammad-memcached/docker-entrypoint.sh +++ b/containers/zammad-memcached/docker-entrypoint.sh @@ -4,6 +4,6 @@ set -e if [ "$1" = 'zammad-memcached' ]; then echo "starting memcached..." - - exec memcached -m ${MEMCACHED_SIZE} + + exec memcached -m "${MEMCACHED_SIZE}" fi diff --git a/containers/zammad-postgresql/backup.sh b/containers/zammad-postgresql/backup.sh index e3fed70..1908dd9 100644 --- a/containers/zammad-postgresql/backup.sh +++ b/containers/zammad-postgresql/backup.sh @@ -22,17 +22,17 @@ function zammad_backup { echo "${TIMESTAMP} - backuping zammad..." # delete old backups - if [ -d "${BACKUP_DIR}" ] && [ -n "$(ls ${BACKUP_DIR})" ]; then - find ${BACKUP_DIR}/*_zammad_*.gz -type f -mtime +${HOLD_DAYS} -exec rm {} \; + if [ -d "${BACKUP_DIR}" ] && [ -n "$(ls "${BACKUP_DIR}")" ]; then + find "${BACKUP_DIR}"/*_zammad_*.gz -type f -mtime +"${HOLD_DAYS}" -exec rm {} \; fi if [ "${NO_FILE_BACKUP}" != "yes" ]; then # tar files - tar -czf ${BACKUP_DIR}/${TIMESTAMP}_zammad_files.tar.gz ${ZAMMAD_DIR} + tar -czf "${BACKUP_DIR}"/"${TIMESTAMP}"_zammad_files.tar.gz "${ZAMMAD_DIR}" fi #db backup - pg_dump --dbname=postgresql://${POSTGRESQL_USER}@${POSTGRESQL_HOST}:${POSTGRESQL_PORT}/${POSTGRESQL_DB} | gzip > ${BACKUP_DIR}/${TIMESTAMP}_zammad_db.psql.gz + pg_dump --dbname=postgresql://"${POSTGRESQL_USER}"@"${POSTGRESQL_HOST}":"${POSTGRESQL_PORT}"/"${POSTGRESQL_DB}" | gzip > "${BACKUP_DIR}"/"${TIMESTAMP}"_zammad_db.psql.gz } if [ "$1" = 'zammad-backup' ]; then @@ -43,7 +43,7 @@ if [ "$1" = 'zammad-backup' ]; then zammad_backup # wait until next backup - sleep ${BACKUP_SLEEP} + sleep "${BACKUP_SLEEP}" done fi