SOURCES: daemontools.init - use functions

glen glen at pld-linux.org
Sun Apr 27 02:22:22 CEST 2008


Author: glen                         Date: Sun Apr 27 00:22:22 2008 GMT
Module: SOURCES                       Tag: HEAD
---- Log message:
- use functions

---- Files affected:
SOURCES:
   daemontools.init (1.15 -> 1.16) 

---- Diffs:

================================================================
Index: SOURCES/daemontools.init
diff -u SOURCES/daemontools.init:1.15 SOURCES/daemontools.init:1.16
--- SOURCES/daemontools.init:1.15	Sun Apr 27 02:21:37 2008
+++ SOURCES/daemontools.init	Sun Apr 27 02:22:17 2008
@@ -28,10 +28,7 @@
 	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 @@
 	else
 		msg_already_running svscan
 	fi
-	;;
-  stop)
+}
+
+stop() {
 	if [ -f /var/lock/subsys/svscan ]; then
 		msg_stopping svscan
 		killproc svscan
@@ -65,11 +63,20 @@
 	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
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/SOURCES/daemontools.init?r1=1.15&r2=1.16&f=u



More information about the pld-cvs-commit mailing list