blob: 465acb851e4de015f9074f9781fb7063c803e781 (
plain)
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
31
32
33
34
35
36
37
38
39
40
41
|
--- ../MailScanner-install-4.53.7.orig/bin/cron/sa-update.cron Thu May 4 07:40:53 2006
+++ bin/cron/sa-update.cron Thu May 4 07:42:12 2006
@@ -1,22 +1,27 @@
#!/bin/bash
-# Insert a random delay up to this value, to spread virus updates round
-# the clock. 1800 seconds = 30 minutes.
-# Set this to 0 to disable it.
-UPDATEMAXDELAY=3600
+# Add the following line to /etc/rc.conf to configure a maximum delay in
+# order to spread virus updates round the clock. 1800 seconds = 30 minutes.
+# Set this to 0 to disable it
+
+. %%RC_SUBR%%
+
+name="mailscanner"
+rcvar=`set_rcvar`
+
+load_rc_config $name
+
+: ${mailscanner_updatemaxdelay="600"}
+
SAUPDATE=/usr/bin/sa-update
-if [ -f /etc/sysconfig/MailScanner ] ; then
- . /etc/sysconfig/MailScanner
-fi
-export UPDATEMAXDELAY
export SAUPDATE
[ -x $SAUPDATE ] || exit 0
-if [ "x$UPDATEMAXDELAY" = "x0" ]; then
+if [ "x${mailscanner_updatemaxdelay}" = "x0" ]; then
:
else
- logger -p mail.info -t sa-update Delaying cron job up to $UPDATEMAXDELAY seconds
- perl -e "sleep int(rand($UPDATEMAXDELAY));"
+ logger -p mail.info -t sa-update Delaying cron job up to ${mailscanner_updatemaxdelay} seconds
+ perl -e "sleep int(rand(${mailscanner_updatemaxdelay}));"
fi
exec $SAUPDATE
exit 0
|