Compare commits
2 Commits
5f0eddf22a
...
b5247a085e
Author | SHA1 | Date | |
---|---|---|---|
|
b5247a085e | ||
|
2432139f3d |
@ -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" --env-path "$mcConfig" stop --timeout "$dockerStopTimeout" "$2-mailcow" 2>> "$logFile"
|
docker-compose -f "$mcDockerCompose" 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" --env-path "$mcConfig" start "$2-mailcow" 2>> "$logFile"
|
docker-compose -f "$mcDockerCompose" 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,10 +391,7 @@ 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
|
||||||
@ -595,6 +592,8 @@ 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
|
||||||
@ -766,6 +765,7 @@ 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
|
||||||
|
Loading…
Reference in New Issue
Block a user