1
0
mirror of https://github.com/mail-in-a-box/mailinabox.git synced 2025-04-06 00:37:06 +00:00
mailinabox/ehdd/shutdown.sh

26 lines
546 B
Bash
Executable File

#!/bin/bash
if [ -s /etc/mailinabox.conf ]; then
systemctl stop mailinabox
systemctl stop nginx
systemctl stop php8.0-fpm
systemctl stop postfix
systemctl stop dovecot
systemctl stop cron
#systemctl stop nsd
[ -x /usr/sbin/slapd ] && systemctl stop slapd
systemctl stop fail2ban
systemctl stop miabldap-capture
fi
ehdd/umount.sh
code=$?
tries=1
while [ $code -eq 2 -a $tries -le 3 ]; do
echo "Trying again in 10 seconds..."
sleep 10
ehdd/umount.sh
code=$?
let tries+=1
done
exit $code