[PHP-FPM] Fix lookup of Postfix container when SQL applied an update
parent
4a8edd5b88
commit
c9fb2517a2
|
@ -58,8 +58,8 @@ done
|
||||||
|
|
||||||
# doing post-installation stuff, if SQL was upgraded (master and slave)
|
# doing post-installation stuff, if SQL was upgraded (master and slave)
|
||||||
if [ ${SQL_CHANGED} -eq 1 ]; then
|
if [ ${SQL_CHANGED} -eq 1 ]; then
|
||||||
POSTFIX=($(curl --silent --insecure https://dockerapi/containers/json | jq -r '.[] | {name: .Config.Labels["com.docker.compose.service"], project: .Config.Labels[\"com.docker.compose.project\"], id: .Id}' | jq -rc 'select( .name | tostring | contains("postfix-mailcow")) | select( .project | tostring | contains(\"${COMPOSE_PROJECT_NAME}\")) | .id' | tr "\n" " "))
|
POSTFIX=$(curl --silent --insecure https://dockerapi/containers/json | jq -r ".[] | {name: .Config.Labels[\"com.docker.compose.service\"], project: .Config.Labels[\"com.docker.compose.project\"], id: .Id}" 2> /dev/null | jq -rc "select( .name | tostring | contains(\"postfix-mailcow\")) | select( .project | tostring | contains(\"${COMPOSE_PROJECT_NAME}\")) | .id" 2> /dev/null)
|
||||||
if [[ -z ${POSTFIX} ]]; then
|
if [[ -z "${POSTFIX}" ]] || ! [[ "${POSTFIX}" =~ ^[[:alnum:]]*$ ]]; then
|
||||||
echo "Could not determine Postfix container ID, skipping Postfix restart."
|
echo "Could not determine Postfix container ID, skipping Postfix restart."
|
||||||
else
|
else
|
||||||
echo "Restarting Postfix"
|
echo "Restarting Postfix"
|
||||||
|
|
Loading…
Reference in New Issue