SOURCES: bluez-utils.init - Retval of 'status' case must be objective

adgor adgor at pld-linux.org
Wed Jan 24 19:44:22 CET 2007


Author: adgor                        Date: Wed Jan 24 18:44:22 2007 GMT
Module: SOURCES                       Tag: HEAD
---- Log message:
- Retval of 'status' case must be objective

---- Files affected:
SOURCES:
   bluez-utils.init (1.11 -> 1.12) 

---- Diffs:

================================================================
Index: SOURCES/bluez-utils.init
diff -u SOURCES/bluez-utils.init:1.11 SOURCES/bluez-utils.init:1.12
--- SOURCES/bluez-utils.init:1.11	Wed Jan 24 05:00:36 2007
+++ SOURCES/bluez-utils.init	Wed Jan 24 19:44:17 2007
@@ -19,7 +19,10 @@
 	UART_CONF="no"
 fi
 
-start() {
+RETVAL=0
+# See how we were called.
+case "$1" in
+  start)
 	# Check if the service is already running?
 	if [ ! -f /var/lock/subsys/bluetooth ]; then
 		msg_starting bluetooth; started
@@ -75,9 +78,8 @@
 	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
@@ -116,20 +118,11 @@
 	else
 		msg_not_running bluetooth
 	fi
-}
-
-RETVAL=0
-# See how we were called.
-case "$1" in
-  start)
-  	start
-	;;
-  stop)
-  	stop
 	;;
   restart)
-	stop
-	start
+	$0 stop
+	$0 start
+	exit $?
 	;;
   reload|force-reload)
 	if [ -f /var/lock/subsys/bluetooth ]; then
@@ -137,7 +130,7 @@
 		killproc hcid -HUP
 		RETVAL=$?
 	else
-		msg_not_running bluetooth
+		msg_not_running bluetooth >&2
 		exit 7
 	fi
 	;;
@@ -147,7 +140,11 @@
 	is_yes "${SDPD_ENABLE}" && status sdpd
 	is_yes "${HIDD_ENABLE}" && status hidd
 	is_yes "${DUND_ENABLE}" && status dund
-	exit $?
+	if [ -f /var/lock/subsys/bluetooth ]; then
+		exit 0
+	else
+		exit 1
+	fi		
 	;;
   *)
 	msg_usage "$0 {start|stop|restart|reload|force-reload|status}"
@@ -155,3 +152,6 @@
 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.11&r2=1.12&f=u



More information about the pld-cvs-commit mailing list