]> git.pld-linux.org Git - packages/clamav.git/blobdiff - clamav.init
- security note
[packages/clamav.git] / clamav.init
index a699cbd328e6fa6f6a5e2c3402579734c61bdeae..28b863266efd1c5365c74998cec9a364c3890efc 100644 (file)
 # 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
@@ -30,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
@@ -39,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
This page took 0.088537 seconds and 4 git commands to generate.