Implement -D option to set configuration directory; fai.conf: don't set variables...
[grml-live.git] / etc / grml / fai / config / scripts / GRMLBASE / 92-update-freshclam
1 #!/bin/bash
2 # Filename:      ${GRML_FAI_CONFIG}/config/scripts/GRMLBASE/92-update-freshclam
3 # Purpose:       update freshclam database
4 # Authors:       (c) Michael Prokop <mika@grml.org>
5 # Bug-Reports:   see http://grml.org/bugs/
6 # License:       This file is licensed under the GPL v2.
7 ################################################################################
8
9 if ifclass NO_ONLINE ; then
10   echo "Ignoring script 91-update-pciids as NO_ONLINE is set."
11   exit 0
12 fi
13
14 set -u
15 set -e
16
17 [ -x $target/usr/bin/timeout ] && TIMEOUT="10" || TIMEOUT=""
18
19 if ! [ -x $target/usr/bin/freshclam ] ; then
20   echo "freshclam not installed"
21 else
22   echo "Updating clamav database via running freshclam"
23   if [ -n "$TIMEOUT" ] ; then
24      $ROOTCMD timeout $TIMEOUT /usr/bin/freshclam
25   else
26      $ROOTCMD /usr/bin/freshclam
27   fi
28 fi
29
30 ## END OF FILE #################################################################
31 # vim:ft=sh expandtab ai tw=80 tabstop=4 shiftwidth=2