]> git.pld-linux.org Git - packages/daemontools.git/commitdiff
- use functions
authorElan Ruusamäe <glen@pld-linux.org>
Sun, 27 Apr 2008 00:22:17 +0000 (00:22 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    daemontools.init -> 1.16

daemontools.init

index 074a5f0e98b31960c622076517d2e059d29702b0..398f048fb916d58c898d747943098d015c876859 100644 (file)
@@ -28,10 +28,7 @@ else
        exit 0
 fi
 
-RETVAL=0
-# See how we were called.
-case "$1" in
-  start)
+start() {
        # Check if the service is already running?
        if [ ! -f /var/lock/subsys/svscan ]; then
                msg_starting svscan;
@@ -51,8 +48,9 @@ case "$1" in
        else
                msg_already_running svscan
        fi
-       ;;
-  stop)
+}
+
+stop() {
        if [ -f /var/lock/subsys/svscan ]; then
                msg_stopping svscan
                killproc svscan
@@ -65,11 +63,20 @@ case "$1" in
        else
                msg_not_running svscan
        fi
+}
+
+RETVAL=0
+# See how we were called.
+case "$1" in
+  start)
+       start
+       ;;
+  stop)
+       stop
        ;;
   restart|force-reload)
-       $0 stop
-       $0 start
-       exit $?
+       stop
+       start
        ;;
   status)
        status svscan
This page took 0.076477 seconds and 4 git commands to generate.