]> git.pld-linux.org Git - packages/clamav.git/blobdiff - clamav.init
- security note
[packages/clamav.git] / clamav.init
index 75b5fb07fe120e37d8b7cbb015e7f19400e4c803..28b863266efd1c5365c74998cec9a364c3890efc 100644 (file)
 # 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
@@ -33,8 +27,9 @@ case "$1" in
        else
                msg_already_running clamd
        fi
-       ;;
-  stop)
+}
+
+stop() {
        if [ -f /var/lock/subsys/clamd ]; then
                msg_stopping clamd
                killproc --pidfile clamav/clamd.pid clamd
@@ -42,11 +37,20 @@ case "$1" in
        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
@@ -58,7 +62,7 @@ case "$1" in
                killproc clamd -HUP
                RETVAL=$?
        else
-               msg_not_running clamd >&2
+               msg_not_running clamd
                RETVAL=7
        fi
        ;;
This page took 0.031296 seconds and 4 git commands to generate.