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]
This commit is contained in:
ensc 2005-07-28 12:06:36 +00:00
parent 07f7b7b9b3
commit 21bb824baf
1 changed files with 2 additions and 1 deletions

View File

@ -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