]> git.pld-linux.org Git - packages/spamassassin.git/commitdiff
- script to run from cron (based on fc one)
authorElan Ruusamäe <glen@pld-linux.org>
Mon, 18 Jun 2007 07:40:50 +0000 (07:40 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    sa-update.sh -> 1.1

sa-update.sh [new file with mode: 0644]

diff --git a/sa-update.sh b/sa-update.sh
new file mode 100644 (file)
index 0000000..fbc97c1
--- /dev/null
@@ -0,0 +1,18 @@
+#!/bin/sh
+
+sleep $(expr $RANDOM % 7200)
+# Only restart spamd if sa-update returns 0, meaning it updated the rules
+/usr/bin/sa-update || exit $?
+
+if [ -x /usr/bin/sa-compile ]; then
+       out=$(/usr/bin/sa-compile 2>&1)
+       rc=$?
+       if [ $rc -gt 0 ]; then
+               echo >&2 "$out"
+               exit $rc
+       fi
+fi
+
+if [ -x /etc/rc.d/init.d/spamd ]; then
+       /sbin/service spamd restart > /dev/null
+fi
This page took 0.035544 seconds and 4 git commands to generate.