change to try-reload-or-restart
try-reload-or-restart has this logic: Reload service if it supports it. If not, stop and then start instead. Does nothing if the service is not running.
This commit is contained in:
parent
800ffbff8a
commit
b1ea2ee09e
|
@ -64,12 +64,9 @@ elif [[ -z $domains_id ]] ; then
|
|||
cp -a /var/vmail/$domain/.exp/etc/* /etc/
|
||||
# reload dovecot
|
||||
if [[ -f /etc/dovecot/sites.d/mail.$domain.conf ]]; then
|
||||
systemctl --quiet reload dovecot.service
|
||||
fi
|
||||
# reload apache (webmail)
|
||||
if [[ -L /etc/apache2/sites-enabled/mail.$domain.conf ]]; then
|
||||
systemctl --quiet reload apache2.service
|
||||
systemctl --quiet try-reload-or-restart dovecot.service
|
||||
fi
|
||||
# apache reload (webmail) handled by vhost-reload-apache.path
|
||||
fi
|
||||
|
||||
echo
|
||||
|
|
|
@ -31,5 +31,5 @@ fi
|
|||
# disable dovecot for domain
|
||||
if [ -f "/etc/dovecot/sites.d/mail.$domain.conf" ]; then
|
||||
rm /etc/dovecot/sites.d/mail.$domain.conf
|
||||
/usr/bin/systemctl --quiet is-active dovecot && systemctl --quiet reload dovecot
|
||||
systemctl --quiet try-reload-or-restart dovecot
|
||||
fi
|
||||
|
|
|
@ -48,5 +48,5 @@ if [ ! -f "/etc/dovecot/sites.d/$confile" ]; then
|
|||
echo " ssl_cert = </etc/ssl/letsencrypt/$pemfile" >> /etc/dovecot/sites.d/$confile
|
||||
echo " ssl_key = </etc/ssl/letsencrypt/$pemfile" >> /etc/dovecot/sites.d/$confile
|
||||
echo "}" >> /etc/dovecot/sites.d/$confile
|
||||
/usr/bin/systemctl --quiet is-active dovecot && systemctl --quiet reload dovecot
|
||||
systemctl --quiet try-reload-or-restart dovecot
|
||||
fi
|
||||
|
|
|
@ -31,7 +31,6 @@ fi
|
|||
# disable webmail vhost & restart apache
|
||||
if [ -h "/etc/apache2/sites-enabled/mail.$domain.conf" ]; then
|
||||
/usr/sbin/a2dissite --quiet mail.$domain
|
||||
/usr/bin/systemctl --quiet reload apache2
|
||||
fi
|
||||
|
||||
if [ -f "/etc/apache2/sites-available/mail.$domain.conf" ]; then
|
||||
|
|
|
@ -44,5 +44,4 @@ fi
|
|||
|
||||
if [ ! -h "/etc/apache2/sites-enabled/mail.$domain.conf" ]; then
|
||||
/usr/sbin/a2ensite --quiet mail.$domain
|
||||
/usr/bin/systemctl --quiet is-active apache2 && systemctl --quiet reload apache2
|
||||
fi
|
||||
|
|
Loading…
Reference in New Issue
Block a user