]> git.pld-linux.org Git - packages/clamav.git/commitdiff
- drop dependency on bc
authorElan Ruusamäe <glen@pld-linux.org>
Mon, 14 Sep 2009 17:19:34 +0000 (17:19 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    clamav-cron-updatedb -> 1.8
    clamav.spec -> 1.272

clamav-cron-updatedb
clamav.spec

index 995468e8b5ee79bbeafaf181b96b26cc8e85c6a6..402c5b6f23a7c9c9f2d55c806eb0ae1daf0bf105 100644 (file)
@@ -1,18 +1,24 @@
 #!/bin/sh
 
-[ -f /etc/sysconfig/clamd ] && . /etc/sysconfig/clamd
+# default as often as two hours
+UPDATE_HOUR=2
 
-[ -z "$UPDATE_HOUR" ] && UPDATE_HOUR=2
-DIV="$(echo "$(LC_ALL=C date "+%H % ${UPDATE_HOUR}")" | bc)"
-[ "$DIV" = "0" ] || exit 0
+if [ -f /etc/sysconfig/clamd ]; then
+       . /etc/sysconfig/clamd
+fi
+
+hour=$(LC_ALL=C date '+%H')
+
+div=$((hour % $UPDATE_HOUR))
+[ "$div" = "0" ] || exit 0
 
 # sleep random amount to avoid all servers hitting clamav servers at same time
 # but at most 1800 seconds (half hour)
 rand=${RANDOM:-$$}
-rand="$(echo "$rand % 1800" | bc)"
+rand=$((rand % 1800))
 sleep $rand
 
-[ -z "$UPDATE_MAIL_MESSAGES" ] && UPDATE_MAIL_MESSAGES="errors"
+[ "$UPDATE_MAIL_MESSAGES" ] || UPDATE_MAIL_MESSAGES="errors"
 [ "$UPDATE_MAIL_MESSAGES" = "errors" ] && freshclamopt="--quiet"
 
 notify=
index d2f493158174982b45db8d7de514c1bb91acfc67..5180151e9ebccd11bf51d9fe4cd4b956e3a653b9 100644 (file)
@@ -46,7 +46,6 @@ Requires(pre):        /usr/sbin/useradd
 Requires(triggerpostun):       sed >= 4.0
 Requires:      %{name}-libs = %{epoch}:%{version}-%{release}
 Requires:      /usr/sbin/usermod
-Requires:      bc
 Requires:      rc-scripts >= 0.4.1.23
 Provides:      group(clamav)
 Provides:      user(clamav)
This page took 0.156086 seconds and 4 git commands to generate.