X-Git-Url: http://git.grml.org/?a=blobdiff_plain;f=etc%2Fgrml%2Ffai%2Fgrml%2Fgrml_cleanup_chroot.online;h=25f67f6671a1d30bd680894e3d10e42ecbdf479a;hb=9d16d7a6c9686f80a18e70bc8b5e67193dc0ffba;hp=7d277eb2d057f981b5c25388e249a8f417a179c4;hpb=06335ed6cf5e6dad2ba8d056540957a3b3fde8e3;p=grml-live.git diff --git a/etc/grml/fai/grml/grml_cleanup_chroot.online b/etc/grml/fai/grml/grml_cleanup_chroot.online index 7d277eb..25f67f6 100755 --- a/etc/grml/fai/grml/grml_cleanup_chroot.online +++ b/etc/grml/fai/grml/grml_cleanup_chroot.online @@ -4,24 +4,33 @@ # Authors: (c) Michael Prokop # Bug-Reports: see http://grml.org/bugs/ # License: This file is licensed under the GPL v2. -# Latest change: Wed Sep 19 20:07:43 CEST 2007 [mika] ################################################################################ # misc stuff umask 022 . /etc/grml/lsb-functions || exit 6 + [ -x /usr/bin/timeout ] && TIMEOUT="10" || TIMEOUT="" if [ -x /usr/bin/freshclam ] ; then einfo "Updating clamav database via running freshclam" - /usr/bin/freshclam ; eend $? + if [ -n "$TIMEOUT" ] ; then + timeout $TIMEOUT /usr/bin/freshclam ; eend $? + else + /usr/bin/freshclam ; eend $? + fi else ewarn "freshclam not installed" ; eend 0 fi if [ -x /usr/bin/update-pciids ] ; then einfo "Updating PCI- and USB-ids" - update-pciids || echo "Warning: update-pciids was not successfull">&2 - update-usbids || echo "Warning: update-usbids was not successfull">&2 + if [ -n "$TIMEOUT" ] ; then + timeout $TIMEOUT update-pciids || echo "Warning: update-pciids was not successfull">&2 + timeout $TIMEOUT update-usbids || echo "Warning: update-usbids was not successfull">&2 + else + update-pciids || echo "Warning: update-pciids was not successfull">&2 + update-usbids || echo "Warning: update-usbids was not successfull">&2 + fi eend $? else ewarn "update-pciids/update-usbids not installed" ; eend 0 @@ -29,7 +38,11 @@ fi if [ -x /usr/sbin/nessus-update-plugins ] ; then einfo "Updating nessus-plugins" - nessus-update-plugins || echo "Warning: nessus-update-plugins was not successfull">&2 + if [ -n "$TIMEOUT" ] ; then + timeout $TIMEOUT nessus-update-plugins || echo "Warning: nessus-update-plugins was not successfull">&2 + else + nessus-update-plugins || echo "Warning: nessus-update-plugins was not successfull">&2 + fi eend $? else ewarn "nessus-update-plugins not installed" ; eend 0