]> git.pld-linux.org Git - packages/clamav.git/commitdiff
- use functions
authorElan Ruusamäe <glen@pld-linux.org>
Sun, 5 Nov 2006 16:31:16 +0000 (16:31 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    clamav.init -> 1.12

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.075727 seconds and 4 git commands to generate.