SOURCES: hotplug.init - use functions

glen glen at pld-linux.org
Sun Oct 1 23:37:18 CEST 2006


Author: glen                         Date: Sun Oct  1 21:37:18 2006 GMT
Module: SOURCES                       Tag: HEAD
---- Log message:
- use functions

---- Files affected:
SOURCES:
   hotplug.init (1.8 -> 1.9) 

---- Diffs:

================================================================
Index: SOURCES/hotplug.init
diff -u SOURCES/hotplug.init:1.8 SOURCES/hotplug.init:1.9
--- SOURCES/hotplug.init:1.8	Tue Sep 23 13:27:08 2003
+++ SOURCES/hotplug.init	Sun Oct  1 23:37:13 2006
@@ -14,10 +14,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/hotplug ]; then
 		msg_starting "hotplug"
@@ -32,8 +29,9 @@
 	else
 		msg_already_running "hotplug"
 	fi
-	;;
-  stop)
+}
+
+stop() {
 	if [ -f /var/lock/subsys/hotplug ]; then
 		msg_stopping "hotplug"
 		busy
@@ -45,6 +43,16 @@
 	else
 		msg_not_running "hotplug"
 	fi
+}
+
+RETVAL=0
+# See how we were called.
+case "$1" in
+  start)
+  	start
+	;;
+  stop)
+  	stop
 	;;
   status)
   	for RC in /etc/hotplug/*.rc; do
@@ -54,9 +62,8 @@
 	done
 	;;
   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/hotplug.init?r1=1.8&r2=1.9&f=u



More information about the pld-cvs-commit mailing list