1
0
mirror of https://github.com/mailcow/mailcow-dockerized.git synced 2024-12-12 10:45:14 +02:00

[PHP-FPM] Plan a Postfix restart, when a MariaDB upgrade was applied

This commit is contained in:
andryyy 2019-09-02 09:28:13 +02:00
parent 9c714b34a4
commit 49c7a2cbc7
No known key found for this signature in database
GPG Key ID: 8EC34FF2794E25EF

View File

@ -39,7 +39,17 @@ SQL_UPGRADE_RETURN=$(curl --silent --insecure -XPOST https://dockerapi/container
if [[ ${SQL_UPGRADE_RETURN} == 'warning' ]]; then
if [ -z ${SQL_LOOP_C} ]; then
echo 1 > /mysql_upgrade_loop
echo "MySQL applied an upgrade, restarting PHP-FPM..."
echo "MySQL applied an upgrade"
POSTFIX=($(curl --silent --insecure https://dockerapi/containers/json | jq -r '.[] | {name: .Config.Labels["com.docker.compose.service"], id: .Id}' | jq -rc 'select( .name | tostring | contains("postfix-mailcow")) | .id' | tr "\n" " "))
if [[ -z ${POSTFIX} ]]; then
echo "Could not determine Postfix container ID, skipping Postfix restart."
else
echo "Restarting Postfix"
curl -X POST --silent --insecure https://dockerapi/containers/${POSTFIX}/restart | jq -r '.msg'
echo "Sleeping 10 seconds..."
sleep 10
fi
echo "Restarting PHP-FPM, bye"
exit 1
else
rm /mysql_upgrade_loop