SOURCES: sensors_modules.init - use functions

glen glen at pld-linux.org
Wed Nov 15 16:59:08 CET 2006


Author: glen                         Date: Wed Nov 15 15:59:08 2006 GMT
Module: SOURCES                       Tag: HEAD
---- Log message:
- use functions

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

---- Diffs:

================================================================
Index: SOURCES/sensors_modules.init
diff -u SOURCES/sensors_modules.init:1.2 SOURCES/sensors_modules.init:1.3
--- SOURCES/sensors_modules.init:1.2	Wed Nov 15 16:58:10 2006
+++ SOURCES/sensors_modules.init	Wed Nov 15 16:59:02 2006
@@ -15,10 +15,7 @@
 	. /etc/sysconfig/sensors_modules
 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/sensors_modules ]; then
 		if [ -z "$BUS" ] || [ -z "$CHIP" ]; then
@@ -42,8 +39,9 @@
 	else
 		msg_already_running "sensors modules"
 	fi
-	;;
-  stop)
+}
+
+stop() {
 	if [ -f /var/lock/subsys/sensors_modules ]; then
 		msg_stopping "sensors modules"
 
@@ -59,14 +57,23 @@
 	else
 		msg_not_running "sensors modules"
 	fi
+}
+
+RETVAL=0
+# See how we were called.
+case "$1" in
+  start)
+  	start
+	;;
+  stop)
+  	stop
 	;;
   status)
 	sensors
 	;;
   restart|force-reload)
-	$0 stop
-	$0 start
-	exit $?
+	stop
+	start
 	;;
   *)
 	msg_usage "$0 {start|stop|restart|force-reload|status}"
================================================================

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



More information about the pld-cvs-commit mailing list