From 21bb824bafe08936866df1e56aa02c535f4bfaa4 Mon Sep 17 00:00:00 2001 From: ensc Date: Jul 28 2005 12:06:36 +0000 Subject: Fixed calculation of sleep duration; on some systems/IPs, `hostid` results in a negative number which is retained by the bash modulo-operation. So the sleep may get a negative number of seconds being interpreted as an option. This version makes sure that the module-operations returns a non-negative value. [BZ #164494, James Wilkinson] --- diff --git a/freshclam-sleep b/freshclam-sleep index 25c3067..2cb6bb2 100755 --- a/freshclam-sleep +++ b/freshclam-sleep @@ -44,7 +44,8 @@ WARNING: update of clamav database is disabled; please see ;; (*) - sleep $[ FRESHCLAM_DELAY % (FRESHCLAM_MOD*60) ] + let FRESHCLAM_MOD*=60 + sleep $[ (FRESHCLAM_DELAY % FRESHCLAM_MOD + FRESHCLAM_MOD) % FRESHCLAM_MOD ] ;; esac