X-Git-Url: https://git.grml.org/?a=blobdiff_plain;f=etc%2Fgrml%2Ffai%2Fconfig%2Fscripts%2FGRMLBASE%2F92-update-freshclam;h=2996c20ab090a0b1f13566c0bea461c7a9f754f7;hb=6e778099;hp=e34a7079787a36aff3a7ba30b1258f25faf311b9;hpb=f3b335ea5c94d5cf24ec6b9184106b298849f311;p=grml-live.git diff --git a/etc/grml/fai/config/scripts/GRMLBASE/92-update-freshclam b/etc/grml/fai/config/scripts/GRMLBASE/92-update-freshclam index e34a707..2996c20 100755 --- a/etc/grml/fai/config/scripts/GRMLBASE/92-update-freshclam +++ b/etc/grml/fai/config/scripts/GRMLBASE/92-update-freshclam @@ -7,24 +7,44 @@ ################################################################################ if ifclass NO_ONLINE ; then - echo "Ignoring script 91-update-pciids as NO_ONLINE is set." + echo "Ignoring script 92-update-freshclam as NO_ONLINE is set." exit 0 fi set -u -set -e + +bailout() { + if [ "${1:-}" = "124" ] ; then + echo "Warning: freshclam returned with exit code 124." >&2 + + # be verbose in logs + echo "Warning: freshclam returned with exit code 124." + echo "-> This might happen when the incremental daily update failed to run, and" + echo " retrieving the full daily.cvd failed as well." + echo " This is known to be a problem in automated builds causing build errors." + echo " Therefore we are ignoring this issue." + echo " If a fresh clamav database is important for you, execute freshclam in the chroot." + + exit 0 + fi + + exit "${1:-0}" +} [ -x $target/usr/bin/timeout ] && TIMEOUT="10" || TIMEOUT="" if ! [ -x $target/usr/bin/freshclam ] ; then echo "freshclam not installed" + exit 0 +fi + +echo "Updating clamav database via running freshclam" +if [ -n "$TIMEOUT" ] ; then + $ROOTCMD timeout $TIMEOUT /usr/bin/freshclam + bailout $? else - echo "Updating clamav database via running freshclam" - if [ -n "$TIMEOUT" ] ; then - $ROOTCMD timeout $TIMEOUT /usr/bin/freshclam - else - $ROOTCMD /usr/bin/freshclam - fi + $ROOTCMD /usr/bin/freshclam + bailout $? fi ## END OF FILE #################################################################