feat(mailcow): Add mailcow restart script

This commit is contained in:
hygienic-books 2023-03-25 22:04:02 +01:00
parent 6c09ba8a9c
commit cacb19139e

10
mailcow_reload.sh Executable file
View File

@ -0,0 +1,10 @@
#!/bin/bash
declare mc_compose_project_name="${1:-mailcowdockerized}"
if systemctl --quiet is-active docker.service; then
for prefix in postfix nginx dovecot; do
app="${mc_compose_project_name}"'-'"${prefix}"'-mailcow-1'
if [ "$( docker container inspect -f '{{.State.Running}}' "${app}" 2> /dev/null )" = "true" ]; then
docker restart "$(docker ps -qaf name="${app}")"
fi
done
fi