izbacivanje spamassassin.heinlein-support.de
[spamassassin-cn.git] / debian / cron.daily
1 #!/bin/sh
2 # Dinko Korunic <kreator@carnet.hr>
3
4 exec 1>> /var/log/sa-update.log
5 exec 2>&1
6
7 # announce
8 echo "$(date +'%d-%m-%Y %T'): Fetching new SA rules..."
9
10 # update SA
11 if [ -e /etc/spamassassin/sa-update.channels ]; then
12     sa-update \
13         --channelfile /etc/spamassassin/sa-update.channels \
14         --allowplugins \
15         --gpghomedir /etc/spamassassin/sa-update-keys || \
16     ( echo "$(date +'%d-%m-%Y %T'): No new rules. Exiting now."; exit )
17 fi
18
19 # restart of services
20 echo "$(date +'%d-%m-%Y %T'): Will restart services due to updated rules..."
21
22 if [ -x /etc/init.d/spamassassin ]; then
23   service spamassassin restart
24 fi
25
26 if [ -x /etc/init.d/amavis ]; then
27   service amavis restart
28 fi
29
30 if [ -x /etc/init.d/postfix ]; then
31   service postfix restart
32 fi