瀏覽代碼

Make it work with Debian 12: spamassassin -> spamd

This commits checks for /etc/default/spamassassin. If it exists, it's
passed through sed to modify the CRON variable as usual, and
spamassassin.service is enabled and restarted.

If /etc/default/spamassassin does not exist, but /etc/default/spamd
exists, we modify /etc/default/spamd instead, and restart and enable
spamd.service.

This has to be done because Debian 12 introduced this breaking change:
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1020859

Apologies for my previous commit which introduced a new "README" file
specifically for my fork of the repository. I've modified my patch to
remove it, please accept this version of the patch instead.

Signed-off-by: Andrew Yu <andrew@andrewyu.org>
pull/286/head
Andrew Yu 1 年之前
父節點
當前提交
3474cb609d
沒有發現已知的金鑰在資料庫的簽署中 GPG Key ID: 545412166A37189B
共有 1 個文件被更改,包括 17 次插入3 次删除
  1. +17
    -3
      emailwiz.sh

+ 17
- 3
emailwiz.sh 查看文件

@@ -318,9 +318,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"


Loading…
取消
儲存