diff --git a/data/hooks/conf_regen/22-email-legacy b/data/hooks/conf_regen/22-email-legacy index d17a6dd11..5d67b4638 100644 --- a/data/hooks/conf_regen/22-email-legacy +++ b/data/hooks/conf_regen/22-email-legacy @@ -16,12 +16,15 @@ if [[ "$1" == "True" ]]; then # Remove previous email services systemctl is-enabled spamassassin > /dev/null 2>&1 \ - && { sudo systemctl disable spamassassin || true ; } + && { sudo systemctl disable spamassassin || true ; } \ + || true systemctl is-active spamassassin > /dev/null \ - && { sudo systemctl stop spamassassin || true ; } - sudo rm -f /etc/cron.daily/spamassassin + && { sudo systemctl stop spamassassin || true ; } \ + || true + sudo rm -f /etc/cron.daily/spamassassin || true sudo yunohost service status spamassassin > /dev/null 2>&1 \ - && { sudo yunohost service remove spamassassin || true ; } + && { sudo yunohost service remove spamassassin || true ; } \ + || true # 'systemctl is-enabled' does not work for service with no systemd unit file sudo ls /etc/rc2.d/S??amavis > /dev/null 2>&1 \