83eb2c3700
literal name_enable wherever possible, and ${name}_enable when it's not, to prepare for the demise of set_rcvar(). In cases where I had to hand-edit unusual instances also modify formatting slightly to be more uniform (and in some cases, correct). This includes adding some $FreeBSD$ tags, and most importantly moving rcvar= to right after name= so it's clear that one is derived from the other.
38 lines
1.3 KiB
Text
38 lines
1.3 KiB
Text
--- ../MailScanner-install-4.50.15.orig/bin/cron/update_virus_scanners.cron Wed Feb 15 20:02:33 2006
|
|
+++ bin/cron/update_virus_scanners.cron Wed Feb 15 20:11:17 2006
|
|
@@ -1,20 +1,24 @@
|
|
#!/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=600
|
|
-if [ -f /etc/sysconfig/MailScanner ] ; then
|
|
- . /etc/sysconfig/MailScanner
|
|
-fi
|
|
-export UPDATEMAXDELAY
|
|
+# 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
|
|
+
|
|
+. /etc/rc.subr
|
|
+
|
|
+name="mailscanner"
|
|
+rcvar=mailscanner_enable
|
|
+
|
|
+load_rc_config $name
|
|
+
|
|
+: ${mailscanner_updatemaxdelay="600"}
|
|
|
|
[ -x /opt/MailScanner/bin/update_virus_scanners ] || exit 0
|
|
-if [ "x$UPDATEMAXDELAY" = "x0" ]; then
|
|
+if [ "x${mailscanner_updatemaxdelay}" = "x0" ]; then
|
|
:
|
|
else
|
|
- logger -p mail.info -t update.virus.scanners Delaying cron job up to $UPDATEMAXDELAY seconds
|
|
- perl -e "sleep int(rand($UPDATEMAXDELAY));"
|
|
+ logger -p mail.info -t update.virus.scanners Delaying cron job up to ${mailscanner_updatemaxdelay} seconds
|
|
+ perl -e "sleep int(rand(${mailscanner_updatemaxdelay}));"
|
|
fi
|
|
exec /opt/MailScanner/bin/update_virus_scanners
|
|
exit 0
|