]>
Commit | Line | Data |
---|---|---|
4f43e117 ER |
1 | #!/bin/sh |
2 | ||
aac421e4 AM |
3 | OPT="" |
4 | ||
5 | [ -f /etc/mail/spamassassin/channels ] && OPT="$OPT --channelfile /etc/mail/spamassassin/channels" | |
6 | ||
4f43e117 ER |
7 | sleep $(expr $RANDOM % 7200) |
8 | # Only restart spamd if sa-update returns 0, meaning it updated the rules | |
aac421e4 | 9 | /usr/bin/sa-update $OPT || exit $? |
4f43e117 ER |
10 | |
11 | if [ -x /usr/bin/sa-compile ]; then | |
12 | out=$(/usr/bin/sa-compile 2>&1) | |
13 | rc=$? | |
14 | if [ $rc -gt 0 ]; then | |
15 | echo >&2 "$out" | |
16 | exit $rc | |
17 | fi | |
18 | fi | |
19 | ||
aac421e4 | 20 | if [ -x /etc/rc.d/init.d/spamd -a -e /var/lock/subsys/spamd ]; then |
4f43e117 ER |
21 | /sbin/service spamd restart > /dev/null |
22 | fi |