From 8cbc788fa83b225e7fd72f38b248a50a1e21e616 Mon Sep 17 00:00:00 2001 From: Philippe Chaintreuil Date: Fri, 24 Nov 2023 13:19:30 -0500 Subject: mail-filter/spamassassin: Fix script output when amavisd is disabled Because bash scripts exit with the status of the last command. If systemctl is installed but amavisd is not active the script returns with the value 4. This causes cron to send an email. Switching from "&&" to an if fixes this. Signed-off-by: Philippe Chaintreuil Closes: https://bugs.gentoo.org/681872 Closes: https://github.com/gentoo/gentoo/pull/33969 Signed-off-by: Joonas Niilola --- mail-filter/spamassassin/files/update-spamassassin-rules-r1.cron | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'mail-filter') diff --git a/mail-filter/spamassassin/files/update-spamassassin-rules-r1.cron b/mail-filter/spamassassin/files/update-spamassassin-rules-r1.cron index edac381b5de4..37c04f5b6ad8 100644 --- a/mail-filter/spamassassin/files/update-spamassassin-rules-r1.cron +++ b/mail-filter/spamassassin/files/update-spamassassin-rules-r1.cron @@ -35,7 +35,8 @@ if (( $? == 0 || $? == 3 )); then # check is to keep systemctl from outputting warnings if # amavisd is not installed (bug #681872). systemctl try-restart spamassassin - systemctl is-active --quiet amavisd \ - && systemctl try-reload-or-restart amavisd + if ( systemctl is-active --quiet amavisd ); then + systemctl try-reload-or-restart amavisd + fi fi fi -- cgit v1.2.3-65-gdbad