-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathKAM-update
30 lines (23 loc) · 914 Bytes
/
KAM-update
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/bin/sh
# KatyComputer
#
# Simple script to update KAM rules
SYSLOG_TAG=KAM-update
compile=0
logger -d -t $SYSLOG_TAG "Start KAM-Update"
md5_old=$( md5sum /usr/share/spamassassin-extra/KAM.cf )
wget -q -N -P /usr/share/spamassassin-extra http://www.mcgrail.com/downloads/KAM.cf
md5_new=$( md5sum /usr/share/spamassassin-extra/KAM.cf )
if [ "$md5_old" != "$md5_new" ]; then compile=1; fi
md5_old=$( md5sum /usr/share/spamassassin-extra/nonKAMrules.cf )
wget -q -N -P /usr/share/spamassassin-extra http://www.mcgrail.com/downloads/nonKAMrules.cf
md5_new=$( md5sum /usr/share/spamassassin-extra/nonKAMrules.cf )
if [ "$md5_old" != "$md5_new" ]; then compile=1; fi
if [ $compile -eq 1 ]; then
logger -d -t $SYSLOG_TAG "KAM-Update found"
sa-compile --quiet 2>/dev/null
systemctl restart pmg-smtp-filter
# systemctl restart spamassassin
else
logger -d -t $SYSLOG_TAG "No KAM-Update found"
fi