diff --git a/.travis.yml b/.travis.yml index a60bd5a1..29584554 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,7 +9,7 @@ sudo: required env: global: - HADOLINT_VERSION=1.17.1 - - SHELLCHECK_VERSION=latest + - SHELLCHECK_VERSION=0.7.1 addons: apt: @@ -22,7 +22,7 @@ services: before_install: - sudo curl -L https://github.com/hadolint/hadolint/releases/download/v$HADOLINT_VERSION/hadolint-$(uname -s)-$(uname -m) -o /usr/local/bin/hadolint - sudo chmod +rx /usr/local/bin/hadolint - - sudo wget -qO- "https://github.com/koalaman/shellcheck/releases/download/${SHELLCHECK_VERSION}/shellcheck-${SHELLCHECK_VERSION}.linux.x86_64.tar.xz" | tar -xJv + - sudo wget -qO- "https://github.com/koalaman/shellcheck/releases/download/v${SHELLCHECK_VERSION}/shellcheck-v${SHELLCHECK_VERSION}.linux.x86_64.tar.xz" | tar -xJv - sudo cp "shellcheck-${SHELLCHECK_VERSION}/shellcheck" /usr/bin/ install: diff --git a/Makefile b/Makefile index e0c638c2..89df1121 100644 --- a/Makefile +++ b/Makefile @@ -168,9 +168,10 @@ shellcheck: @ shellcheck --version @ echo '' # currently without `start-mailserver` as this is to be merged separately - @ if find -iname "*.sh" -not -path "./test/*" -not -path "./target/docker-configomat/*" -not -wholename ./target/start-mailserver.sh -exec shellcheck -S style -Cauto -e SC2250,SC2154 -W 50 {} \; | grep .; then\ + @ if find -iname "*.sh" -not -path "./test/*" -not -path "./target/docker-configomat/*" -not -wholename ./target/start-mailserver.sh -exec shellcheck -S style -Cauto -o all -e SC2250,SC2154 -W 50 {} \; | grep .; then\ echo -e "\nError" ;\ exit 1 ;\ else\ echo -e '\nSuccess' ;\ fi + diff --git a/setup.sh b/setup.sh index 1ed8e0a7..31386d26 100755 --- a/setup.sh +++ b/setup.sh @@ -30,7 +30,9 @@ function _get_current_directory() fi } -CDIR="$(pwd)" ; _get_current_directory +CDIR="$(pwd)" +_get_current_directory + CRI= INFO= IMAGE_NAME= diff --git a/target/check-for-changes.sh b/target/check-for-changes.sh index 5e4e1cbd..daf9be79 100755 --- a/target/check-for-changes.sh +++ b/target/check-for-changes.sh @@ -149,11 +149,11 @@ do # test if user has a defined quota if [[ -f /tmp/docker-mailserver/dovecot-quotas.cf ]] then - IFS=':' - read -r -a user_quota < <(grep "${user}@${domain}:" -i /tmp/docker-mailserver/dovecot-quotas.cf) + declare -a USER_QUOTA + IFS=':' ; read -r -a USER_QUOTA < <(grep "${user}@${domain}:" -i /tmp/docker-mailserver/dovecot-quotas.cf) unset IFS - [[ ${#user_quota[@]} -eq 2 ]] && user_attributes="${user_attributes}userdb_quota_rule=*:bytes=${user_quota[1]}" + [[ ${#USER_QUOTA[@]} -eq 2 ]] && user_attributes="${user_attributes}userdb_quota_rule=*:bytes=${USER_QUOTA[1]}" fi echo "${login} ${domain}/${user}/" >>/etc/postfix/vmailbox diff --git a/target/helper_functions.sh b/target/helper_functions.sh index 361f41ae..36d50644 100644 --- a/target/helper_functions.sh +++ b/target/helper_functions.sh @@ -145,7 +145,7 @@ function _notify() * ) options="-e" ;; esac - [[ -n "${msg}" ]] && echo ${options} "${msg}" + [[ -n "${msg}" ]] && echo "${options}" "${msg}" } export -f _notify