updated on Fri Jan 13 08:00:32 UTC 2012
[aur-mirror.git] / clamfs / clamfs.rc.d
blobf5853c64ca6645698cb5cea1cc5b334504fe8bcd
1 #!/bin/bash
3 . /etc/rc.conf
4 . /etc/rc.d/functions
6 PID=`pidof -o %PPID /usr/bin/clamfs`
8 case "$1" in
9 start)
10 # if clamd isn't started first, notifyclamd fails at times
11 stat_busy "Starting ClamFS"
12 [ -z "$PID" ] && /usr/bin/clamfs /etc/clamav/clamfs.xml > /dev/null
14 if [ $? -gt 0 ]; then
15 stat_fail
16 else
17 add_daemon clamfs
18 stat_done
22 stop)
23 stat_busy "Stopping ClamFS"
24 [ -n "$PID" ] && kill $PID &> /dev/null
26 if [ $? -gt 0 ]; then
27 stat_fail
28 else
29 rm_daemon clamfs
30 stat_done
34 restart)
35 $0 stop
36 sleep 3
37 $0 start
40 status)
41 stat_busy "Checking ClamFS status";
42 ck_status clamfs
46 echo "usage: $0 {start|stop|restart|status}"
47 esac
49 exit 0
51 # vim:set ts=2 sw=2 et: