]> git.pld-linux.org Git - packages/stunnel.git/commitdiff
- use functions
authorElan Ruusamäe <glen@pld-linux.org>
Mon, 4 Dec 2006 12:58:44 +0000 (12:58 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    stunnel.init -> 1.7

stunnel.init

index af984d1afef6439bb981d6dcb914710f04af7b5c..82a75cb66a94eeab5cf2c850abd2c841eeefc344 100644 (file)
@@ -34,10 +34,7 @@ if [ ! -f "$STUNNEL_CONFIG" ]; then
        exit 1
 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/stunnel ]; then
                msg_starting stunnel; busy
@@ -47,8 +44,9 @@ case "$1" in
        else
                msg_already_running stunnel
        fi
-       ;;
-  stop)
+}
+
+stop() {
        if [ -f /var/lock/subsys/stunnel ]; then
                msg_stopping stunnel
                killproc stunnel
@@ -56,11 +54,20 @@ case "$1" in
        else
                msg_not_running stunnel
        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 stunnel
This page took 0.030419 seconds and 4 git commands to generate.