diff options
Diffstat (limited to 'main/clamav/clamd.initd')
-rwxr-xr-x | main/clamav/clamd.initd | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/main/clamav/clamd.initd b/main/clamav/clamd.initd index 03f44c943f..d8c8f4549d 100755 --- a/main/clamav/clamd.initd +++ b/main/clamav/clamd.initd @@ -23,21 +23,23 @@ start() { local dbdir=$(awk '$1 == "DatabaseDirectory" { print $2 }' $CONF) local timeout=${FRESHCLAM_TIMEOUT:-120} - local cvd="${dbdir:-/var/lib/clamav}"/main.cld + local cvd="${dbdir:-/var/lib/clamav}"/main.cvd + local cld="${dbdir:-/var/lib/clamav}"/main.cld - if ! [ -e "$cvd" ]; then - ebegin "Waiting for clamav database download" - while ! [ -e "$cvd" ]; do - timeout=$(( $timeout - 1 )) - if [ $timeout -eq 0 ]; then - eend 1 "Timed out" - return 1 - fi - sleep 1 - done - eend 0 + if ! [ -e "$cld" ]; then + if ! [ -e "$cvd" ]; then + ebegin "Waiting for clamav database download" + while ! [ -e "$cvd" ]; do + timeout=$(( $timeout - 1 )) + if [ $timeout -eq 0 ]; then + eend 1 "Timed out" + return 1 + fi + sleep 1 + done + eend 0 + fi fi - ebegin "Starting ${NAME}" start-stop-daemon --start --quiet \ --nicelevel ${CLAMD_NICELEVEL:-0} \ |