
/etc/rc.d/clamfs
By: a guest on
Apr 15th, 2010 | syntax:
Bash | size: 0.86 KB | hits: 389 | expires: Never
#!/bin/bash
. /etc/rc.conf
. /etc/rc.d/functions
# source application-specific settings
PID=`pidof -o %PPID /usr/bin/clamfs`
case "$1" in
start)
# if clamd isn't started first, notifyclamd fails at times
stat_busy "Starting ClamFS"
[ -z "$PID" ] && /usr/bin/clamfs /etc/clamav/clamfs.xml > /dev/null
if [ $? -gt 0 ]; then
stat_fail
else
add_daemon clamfs
stat_done
fi
;;
stop)
stat_busy "Stopping ClamFS"
[ -n "$PID" ] && kill $PID &> /dev/null
if [ $? -gt 0 ]; then
stat_fail
else
rm_daemon clamfs
stat_done
fi
;;
restart)
$0 stop
# will not start if not fully stopped, so sleep
sleep 2
$0 start
;;
*)
echo "usage: $0 {start|stop|restart}"
esac
exit 0