SOURCES: bluez-utils.init - use functions

glen glen at pld-linux.org
Thu Nov 30 17:36:51 CET 2006


Author: glen                         Date: Thu Nov 30 16:36:51 2006 GMT
Module: SOURCES                       Tag: HEAD
---- Log message:
- use functions

---- Files affected:
SOURCES:
   bluez-utils.init (1.9 -> 1.10) 

---- Diffs:

================================================================
Index: SOURCES/bluez-utils.init
diff -u SOURCES/bluez-utils.init:1.9 SOURCES/bluez-utils.init:1.10
--- SOURCES/bluez-utils.init:1.9	Fri Apr 28 20:38:39 2006
+++ SOURCES/bluez-utils.init	Thu Nov 30 17:36:46 2006
@@ -19,10 +19,7 @@
 	UART_CONF="no"
 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/bluetooth ]; then
 		msg_starting bluetooth; started
@@ -78,8 +75,9 @@
 	else
 		msg_already_running bluetooth
 	fi
-	;;
-  stop)
+}
+
+stop() {
 	if [ -f /var/lock/subsys/bluetooth ]; then
 		if is_yes "${PAND_ENABLE}" && [ -x /usr/bin/pand ]; then
 			msg_stopping pand
@@ -118,11 +116,20 @@
 	else
 		msg_not_running bluetooth
 	fi
+}
+
+RETVAL=0
+# See how we were called.
+case "$1" in
+  start)
+  	start
+	;;
+  stop)
+  	stop
 	;;
   restart)
-	$0 stop
-	$0 start
-	exit $?
+	stop
+	start
 	;;
   reload|force-reload)
 	if [ -f /var/lock/subsys/bluetooth ]; then
@@ -130,7 +137,7 @@
 		killproc hcid -HUP
 		RETVAL=$?
 	else
-		msg_not_running bluetooth >&2
+		msg_not_running bluetooth
 		exit 7
 	fi
 	;;
@@ -148,6 +155,3 @@
 esac
 
 exit $RETVAL
-
-# This must be last line !
-# vi:syntax=sh:tw=78:ts=8:sw=4
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/SOURCES/bluez-utils.init?r1=1.9&r2=1.10&f=u



More information about the pld-cvs-commit mailing list