Prechádzať zdrojové kódy

freshclam(8) returns 0 _and_ 1 for success status and 4x/5x/6x for errors. Hence treat all return codes greater or equal to 10 as errors only. Thanks to Thomas Arendsen Hein for the hint.

Ralf S. Engelschall 19 rokov pred
rodič
commit
37057c4f39
2 zmenil súbory, kde vykonal 8 pridanie a 4 odobranie
  1. 1 1
      clamav/clamav.spec
  2. 7 3
      clamav/rc.clamav

+ 1 - 1
clamav/clamav.spec

@@ -33,7 +33,7 @@ Class:        EVAL
 Group:        AntiVirus
 License:      GPL
 Version:      0.88.5
-Release:      20061016
+Release:      20061020
 
 #   list of sources
 Source0:      http://switch.dl.sourceforge.net/clamav/clamav-%{version}.tar.gz

+ 7 - 3
clamav/rc.clamav

@@ -50,19 +50,18 @@
     rcService clamav enable yes || exit 0
     if [ ".$clamav_update" = .quarterly ]; then
         @l_prefix@/bin/freshclam
+        if [ $? -ge 10 ]; then exit $?; fi
     fi
 
 %hourly -u @l_rusr@
     rcService clamav enable yes || exit 0
     if [ ".$clamav_update" = .hourly ]; then
         @l_prefix@/bin/freshclam
+        if [ $? -ge 10 ]; then exit $?; fi
     fi
 
 %daily -u @l_rusr@
     rcService clamav enable yes || exit 0
-    if [ ".$clamav_update" = .daily ]; then
-        @l_prefix@/bin/freshclam
-    fi
     shtool rotate -f \
         -n ${clamav_log_numfiles} -s ${clamav_log_minsize} -d \
         -z ${clamav_log_complevel} -o @l_rusr@ -g @l_rgrp@ -m 644 \
@@ -75,10 +74,15 @@
         -P "${clamav_log_prolog}" \
         -E "${clamav_log_epilog}; rc clamav restart" \
         @l_prefix@/var/clamav/freshclam.log
+    if [ ".$clamav_update" = .daily ]; then
+        @l_prefix@/bin/freshclam
+        if [ $? -ge 10 ]; then exit $?; fi
+    fi
 
 %weekly -u @l_rusr@
     rcService clamav enable yes || exit 0
     if [ ".$clamav_update" = .weekly ]; then
         @l_prefix@/bin/freshclam
+        if [ $? -ge 10 ]; then exit $?; fi
     fi