Compare commits

..

No commits in common. "b5247a085ebb9e0b79bf3ce5e289a83f7cabad2f" and "5f0eddf22a5abd90a804a87565596d8f7bb56e5c" have entirely different histories.

View File

@ -119,14 +119,14 @@ doDocker() {
if [ "$1" = "stop" ]; then if [ "$1" = "stop" ]; then
printf "%s[%s] -- [INFO] Stopping %s-mailcow container --%s\n" \ printf "%s[%s] -- [INFO] Stopping %s-mailcow container --%s\n" \
"$cyan" "$(stamp)" "$2" "$norm" >> "$logFile" "$cyan" "$(stamp)" "$2" "$norm" >> "$logFile"
docker-compose -f "$mcDockerCompose" stop --timeout "$dockerStopTimeout" "$2-mailcow" 2>> "$logFile" docker-compose -f "$mcDockerCompose" --env-path "$mcConfig" stop --timeout "$dockerStopTimeout" "$2-mailcow" 2>> "$logFile"
# set result vars # set result vars
dockerResultState="$( docker inspect -f '{{ .State.Running }}' $containerName )" dockerResultState="$( docker inspect -f '{{ .State.Running }}' $containerName )"
dockerResultExit="$( docker inspect -f '{{ .State.ExitCode }}' $containerName )" dockerResultExit="$( docker inspect -f '{{ .State.ExitCode }}' $containerName )"
elif [ "$1" = "start" ]; then elif [ "$1" = "start" ]; then
printf "%s[%s] -- [INFO] Starting %s-mailcow container --%s\n" \ printf "%s[%s] -- [INFO] Starting %s-mailcow container --%s\n" \
"$cyan" "$(stamp)" "$2" "$norm" >> "$logFile" "$cyan" "$(stamp)" "$2" "$norm" >> "$logFile"
docker-compose -f "$mcDockerCompose" start "$2-mailcow" 2>> "$logFile" docker-compose -f "$mcDockerCompose" --env-path "$mcConfig" start "$2-mailcow" 2>> "$logFile"
# set result vars # set result vars
dockerResultState="$( docker inspect -f '{{ .State.Running }}' $containerName )" dockerResultState="$( docker inspect -f '{{ .State.Running }}' $containerName )"
fi fi
@ -391,7 +391,10 @@ if [ "$use503" -eq 1 ]; then
fi fi
fi fi
# verify mailcow.conf location and extract path # verify mailcow.conf location and extract path
if [ ! -f "$mcConfig" ]; then if [ -f "$mcConfig" ]; then
# strip filename and get path
mcPath=${mcConfig%/*/}
else
badParam dne "(--mailcow-config)" "$mcConfig" badParam dne "(--mailcow-config)" "$mcConfig"
fi fi
# verify docker-compose file exists # verify docker-compose file exists
@ -592,8 +595,6 @@ if [ "$use503" -eq 1 ]; then
fi fi
fi fi
### change to mailcow directory so docker commands execute properly
cd "${mcConfig%/*}" || exitError 100 'Could not change to mailcow directory.'
### stop postfix and dovecot mail containers to prevent mailflow during backup ### stop postfix and dovecot mail containers to prevent mailflow during backup
doDocker stop postfix doDocker stop postfix
@ -765,7 +766,6 @@ exit 0
# 2: not run as root # 2: not run as root
# 3: borg not installed # 3: borg not installed
# 99: TERM signal trapped # 99: TERM signal trapped
# 100: could not change to mailcow-dockerized directory
# 101: could not stop container(s) # 101: could not stop container(s)
# 102: could not start container(s) # 102: could not start container(s)
# 115: unable to create temp dir for SQL dump # 115: unable to create temp dir for SQL dump