SOURCES: dkfilter.init - use functions - proagate status of both p...

glen glen at pld-linux.org
Wed Dec 6 09:42:38 CET 2006


Author: glen                         Date: Wed Dec  6 08:42:38 2006 GMT
Module: SOURCES                       Tag: HEAD
---- Log message:
- use functions
- proagate status of both processes in status()

---- Files affected:
SOURCES:
   dkfilter.init (1.2 -> 1.3) 

---- Diffs:

================================================================
Index: SOURCES/dkfilter.init
diff -u SOURCES/dkfilter.init:1.2 SOURCES/dkfilter.init:1.3
--- SOURCES/dkfilter.init:1.2	Wed Dec  6 09:36:20 2006
+++ SOURCES/dkfilter.init	Wed Dec  6 09:42:33 2006
@@ -28,10 +28,7 @@
 	exit 0
 fi
 
-RETVAL=0
-# See how we were called.
-case "$1" in
-  start)
+start() {
 	if [ $START_INBOUND = "yes" ]; then
 		# Check if the service is already running?
 		if [ ! -f /var/lock/subsys/dkfilter.in ]; then
@@ -69,8 +66,9 @@
 			msg_already_running dkfilter.out
 		fi
 	fi
-	;;
-  stop)
+}
+
+stop() {
 	# Stop daemons.
 	if [ $START_INBOUND = "yes" ]; then
 		if [ -f /var/lock/subsys/dkfilter.in ]; then
@@ -94,16 +92,27 @@
 			msg_not_running dkfilter.out
 		fi
 	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 dkfilter.in
+	RETVAL=$?
 	status dkfilter.out
-	exit $?
+	RET=$?
+	[ $RET -ne 0 ] && RETVAL=$RET
 	;;
   *)
 	msg_usage "$0 {start|stop|restart|status}"
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/SOURCES/dkfilter.init?r1=1.2&r2=1.3&f=u



More information about the pld-cvs-commit mailing list