SOURCES: laptop-mode-tools.init - functions

glen glen at pld-linux.org
Wed Jan 9 00:07:51 CET 2008


Author: glen                         Date: Tue Jan  8 23:07:51 2008 GMT
Module: SOURCES                       Tag: HEAD
---- Log message:
- functions

---- Files affected:
SOURCES:
   laptop-mode-tools.init (1.2 -> 1.3) 

---- Diffs:

================================================================
Index: SOURCES/laptop-mode-tools.init
diff -u SOURCES/laptop-mode-tools.init:1.2 SOURCES/laptop-mode-tools.init:1.3
--- SOURCES/laptop-mode-tools.init:1.2	Wed Feb  8 20:04:56 2006
+++ SOURCES/laptop-mode-tools.init	Wed Jan  9 00:07:46 2008
@@ -7,10 +7,7 @@
 # Source function library
 . /etc/rc.d/init.d/functions
 
-RETVAL=0
-# See how we were called.
-case "$1" in
-  start)
+start() {
 	# Check if the service is already running?
 	if [ ! -f /var/lock/subsys/laptop-mode-tools ]; then
 		msg_starting "laptop mode"
@@ -21,8 +18,9 @@
 	else
 		msg_already_running "laptop mode"
 	fi
-	;;
-  stop)
+}
+
+stop() {
 	if [ -f /var/lock/subsys/laptop-mode-tools ]; then
 		msg_stopping "laptop mode"
 		daemon /usr/sbin/laptop_mode stop
@@ -30,11 +28,20 @@
 	else
 		msg_not_running "laptop mode"
 	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)
   	/usr/sbin/laptop_mode status
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/SOURCES/laptop-mode-tools.init?r1=1.2&r2=1.3&f=u



More information about the pld-cvs-commit mailing list