2 # Dinko Korunic <kreator@carnet.hr>
4 exec 1>> /var/log/sa-update.log
8 echo "$(date +'%d-%m-%Y %T'): Fetching new SA rules..."
10 # update SA from normal SA updates + SARE channels
11 if [ -e /etc/spamassassin/sa-update.channels ]; then
13 --channelfile /etc/spamassassin/sa-update.channels \
16 --gpgkey BDE9DC10 || \
17 ( echo "$(date +'%d-%m-%Y %T'): No new rules. Exiting now."; exit )
21 echo "$(date +'%d-%m-%Y %T'): Will restart services due to updated rules..."
22 if [ -x /usr/sbin/invoke-rc.d ]; then
23 [ -x /etc/init.d/spamassassin ] && \
24 invoke-rc.d --quiet spamassassin restart
25 [ -x /etc/init.d/amavis ] && \
26 invoke-rc.d --quiet amavis restart
27 [ -x /etc/init.d/postfix ] && \
28 invoke-rc.d --quiet postfix restart
30 [ -x /etc/init.d/spamassassin ] && \
31 /etc/init.d/spamassassin restart
32 [ -x /etc/init.d/amavis ] && \
33 /etc/init.d/amavis restart
34 [ -x /etc/init.d/postfix ] && \
35 /etc/init.d/postfix restart