diff options
author | Luke Smith <luke@lukesmith.xyz> | 2023-07-26 12:01:04 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-07-26 12:01:04 +0000 |
commit | a46fd7f9d21b2f47af98df5e13d7d652df946159 (patch) | |
tree | 676655817567e0cdd086f525ad86398e78c8fa61 /emailwiz.sh | |
parent | 84876971de75b1948d7ba1afd148be0b1c3bca58 (diff) | |
parent | 3474cb609db473466294f7a1c3f036b34f6d58be (diff) |
Merge pull request #286 from andrewrunxiyu/master
Make it work with Debian 12: spamassassin -> spamd
Diffstat (limited to 'emailwiz.sh')
-rw-r--r-- | emailwiz.sh | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/emailwiz.sh b/emailwiz.sh index ebc8e6b..f938f65 100644 --- a/emailwiz.sh +++ b/emailwiz.sh @@ -323,9 +323,23 @@ enabled = true enabled = true" > /etc/fail2ban/jail.d/emailwiz.local # Enable SpamAssassin update cronjob. -sed -i "s|^CRON=0|CRON=1|" /etc/default/spamassassin - -for x in spamassassin opendkim dovecot postfix fail2ban; do +if [ -f /etc/default/spamassassin ] +then + sed -i "s|^CRON=0|CRON=1|" /etc/default/spamassassin + printf "Restarting spamassassin..." + service spamassassin restart && printf " ...done\\n" + systemctl enable spamassassin +elif [ -f /etc/default/spamd ] +then + sed -i "s|^CRON=0|CRON=1|" /etc/default/spamd + printf "Restarting spamd..." + service spamd restart && printf " ...done\\n" + systemctl enable spamd +else + printf "!!! Neither /etc/default/spamassassin or /etc/default/spamd exists, this is unexpected and needs to be investigated" +fi + +for x in opendkim dovecot postfix fail2ban; do printf "Restarting %s..." "$x" service "$x" restart && printf " ...done\\n" systemctl enable "$x" |