SOURCES: stunnel.init - use functions

glen glen at pld-linux.org
Mon Dec 4 13:58:50 CET 2006


Author: glen                         Date: Mon Dec  4 12:58:50 2006 GMT
Module: SOURCES                       Tag: HEAD
---- Log message:
- use functions

---- Files affected:
SOURCES:
   stunnel.init (1.6 -> 1.7) 

---- Diffs:

================================================================
Index: SOURCES/stunnel.init
diff -u SOURCES/stunnel.init:1.6 SOURCES/stunnel.init:1.7
--- SOURCES/stunnel.init:1.6	Thu Dec  8 02:02:49 2005
+++ SOURCES/stunnel.init	Mon Dec  4 13:58:44 2006
@@ -34,10 +34,7 @@
 	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 @@
 	else
 		msg_already_running stunnel
 	fi
-	;;
-  stop)
+}
+
+stop() {
 	if [ -f /var/lock/subsys/stunnel ]; then
 		msg_stopping stunnel
 		killproc stunnel
@@ -56,11 +54,20 @@
 	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
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/SOURCES/stunnel.init?r1=1.6&r2=1.7&f=u



More information about the pld-cvs-commit mailing list