# 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
-RETVAL=0
-# See how we were called.
-case "$1" in
- start)
+start() {
# Check if the service is already running?
if [ ! -f /var/lock/subsys/clamd ]; then
msg_starting clamd
else
msg_already_running clamd
fi
- ;;
- stop)
+}
+
+stop() {
if [ -f /var/lock/subsys/clamd ]; then
msg_stopping clamd
killproc --pidfile clamav/clamd.pid clamd
else
msg_not_running clamd
fi
+}
+
+RETVAL=0
+# See how we were called.
+case "$1" in
+ start)
+ start
+ ;;
+ stop)
+ stop
;;
restart)
- $0 stop
- $0 start
- exit $?
+ stop
+ start
;;
status)
status clamd
killproc clamd -HUP
RETVAL=$?
else
- msg_not_running clamd >&2
+ msg_not_running clamd
RETVAL=7
fi
;;