[fix] Disable/stop previous email services only if we are forcing conf regeneration

This commit is contained in:
kload 2015-10-31 19:38:08 +01:00
parent 12127d1a71
commit 0bbff4a416

View file

@ -1,6 +1,9 @@
#!/bin/bash #!/bin/bash
set -e set -e
# Execute this hook only if we force the configuration regeneration
if [[ "$1" == "True" ]]; then
# Add new email services # Add new email services
sudo yunohost service add rspamd -l /var/log/mail.log \ sudo yunohost service add rspamd -l /var/log/mail.log \
|| echo "Rspamd is already listed in services" || echo "Rspamd is already listed in services"
@ -23,3 +26,8 @@ sudo yunohost service remove amavis \
sudo yunohost service remove postgrey \ sudo yunohost service remove postgrey \
|| echo "Postgrey is already removed" \ || echo "Postgrey is already removed" \
&& sudo systemctl disable postgrey || true && sudo systemctl disable postgrey || true
systemctl stop spamassassin
systemctl stop amavis
systemctl stop postgrey
fi