Re: Missing Package - ClamAV
Reply #4 –
I can't remember where I stole my rc script from but this is the one I use pretty successfully:
#!/bin/sh
# clamav Script to start/stop clamd.
#
# chkconfig: - 63 38
# description: clamav antivirus daemon.
#
# processname: clamd
# pidfile: /var/run/clamav/clamd.pid
#
# Source function library
#. /etc/rc.d/init.d/functions
# Get network config
#. /etc/sysconfig/network
###########################################################################
# CONFIGURATION
# Most configuration options are found in the clamd.conf file
# The location of configuration file
config=/etc/clamav/clamd.conf
# The prefix clamd was installed to
prefix=/usr/bin
###########################################################################
# SCRIPT
RETVAL=0
start() {
echo -n $"Starting Clamav: "
/usr/bin/clamd
RETVAL1=$?
echo
[ $RETVAL1 -eq 0 ] && touch /var/lock/clamd
return $RETVAL1
}
stop() {
echo -n $"Stopping Clamav: "
killall clamd
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/clamd
return $RETVAL
}
restart() {
stop
start
}
case "$1" in
start)
start
;;
stop)
stop
;;
# status)
# status clamd
# ;;
restart)
restart
;;
*)
# echo $"Usage: $0 {start|stop|status|restart}"
echo $"Usage: $0 {start|stop|restart}"
exit 1
esac
exit $?