#!/bin/sh # # clamd clamd (antivirus daemon) # # chkconfig: 345 60 40 # # description: clamd is a virus scanner. # Source function library . /etc/rc.d/init.d/functions # Get network config . /etc/sysconfig/network # Get service config [ -f /etc/sysconfig/clamd ] && . /etc/sysconfig/clamd # See how we were called. case "$1" in start) # Check if the service is already running? if [ ! -f /var/lock/subsys/clamd ]; then echo -n "Starting Clam Antivirus daemon: " daemon /usr/sbin/clamd RETVAL=$? [ $RETVAL -eq 0 ] && touch /var/lock/subsys/clamd echo else echo -n "Clam Antivirus daemon already running" echo fi ;; stop) if [ -f /var/lock/subsys/clamd ]; then echo -n "Shutting down Clam Antivirus daemon: " killproc clamd rm -f /var/run/clamd.pid /var/lock/subsys/clamd >/dev/null 2>&1 echo else echo -n $"Clam Antivirus daemon not running" echo exit 1 fi ;; restart) $0 stop $0 start ;; status) status clamd exit $? ;; reload) echo -n $"Reloading Clam Antivirus daemon: " killproc clamd -HUP echo ;; *) msg_usage "$0 {start|stop|init|status|restart|reload}" exit 1 esac exit $RETVAL