]> git.ipfire.org Git - people/teissler/ipfire-2.x.git/blob - src/initscripts/init.d/clamav
core81: set need reboot flag and restart apache.
[people/teissler/ipfire-2.x.git] / src / initscripts / init.d / clamav
1 #!/bin/sh
2 # Begin $rc_base/init.d/clamav
3
4 . /etc/sysconfig/rc
5 . $rc_functions
6
7 case "$1" in
8 start)
9 if [ $(basename $0) == "clamav" ]; then
10 boot_mesg "Starting Clamav Definition Updater..."
11 loadproc /usr/bin/freshclam -d -c 10
12
13 boot_mesg "Starting Clamav Daemon..."
14 COUNTER=0
15 while [ "$COUNTER" -lt "30" ]; do
16 [ -e "/usr/share/clamav/main.cvd" ] && \
17 [ -e "/usr/share/clamav/daily.cvd" ] || \
18 [ -e "/usr/share/clamav/daily.cld" ] && \
19 break
20 sleep 5
21 COUNTER=$(($COUNTER + 1))
22 done
23 loadproc /usr/sbin/clamd
24 else
25 boot_mesg "Starting Clamav in background..."
26 /etc/init.d/clamav start > /dev/tty12 < /dev/tty12 &
27 echo_ok;
28 exit 0;
29 fi
30 ;;
31
32 stop)
33 boot_mesg "Stopping Clamav Definition Updater..."
34 killproc /usr/bin/freshclam
35
36 boot_mesg "Stopping Clamav Daemon..."
37 killproc /usr/sbin/clamd
38 ;;
39
40 restart)
41 $0 stop
42 sleep 1
43 $0 start
44 ;;
45
46 status)
47 statusproc /usr/sbin/clamd
48 statusproc /usr/bin/freshclam
49 ;;
50
51 *)
52 echo "Usage: $0 {start|stop|restart|status}"
53 exit 1
54 ;;
55 esac
56
57 # End $rc_base/init.d/clamav