SOURCES: conmand.init - use functions

glen glen at pld-linux.org
Fri Jan 19 11:20:36 CET 2007


Author: glen                         Date: Fri Jan 19 10:20:36 2007 GMT
Module: SOURCES                       Tag: HEAD
---- Log message:
- use functions

---- Files affected:
SOURCES:
   conmand.init (1.1 -> 1.2) 

---- Diffs:

================================================================
Index: SOURCES/conmand.init
diff -u SOURCES/conmand.init:1.1 SOURCES/conmand.init:1.2
--- SOURCES/conmand.init:1.1	Fri Jan 19 11:13:48 2007
+++ SOURCES/conmand.init	Fri Jan 19 11:20:30 2007
@@ -26,10 +26,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/conmand ]; then
 		msg_starting conmand
@@ -39,20 +36,30 @@
 	else
 		msg_already_running conmand
 	fi
-	;;
-  stop)
+}
+
+stop() {
 	if [ -f /var/lock/subsys/conmand ]; then
 		msg_stopping conmand
 		killproc conmand
-		rm -f /var/lock/subsys/conmand >/dev/null 2>&1
+		rm -f /var/lock/subsys/conmand >/dev/null
 	else
 		msg_not_running conmand
 	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 conmand
================================================================

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



More information about the pld-cvs-commit mailing list