]> git.pld-linux.org Git - packages/bluez-utils.git/blobdiff - bluez-utils.init
Typo
[packages/bluez-utils.git] / bluez-utils.init
index ec15b0f1634fa985a9e1a39a7441056d7ab87c28..e4716e387455be028b1701a5ce858dbd36874436 100644 (file)
@@ -19,10 +19,7 @@ if [ "$UART_CONF" != "no" -a ! -f "$UART_CONF" ]; then
        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 @@ case "$1" in
        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
@@ -108,7 +106,7 @@ case "$1" in
        
                if is_yes "${HCID_ENABLE}" && [ -x /usr/sbin/hcid ]; then
                        msg_stopping hcid
-                       daemon /usr/sbin/hcid
+                       killproc /usr/sbin/hcid
                fi
 
                if [ "$UART_CONF" != "no" ]; then
@@ -118,11 +116,20 @@ case "$1" in
        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 @@ case "$1" in
                killproc hcid -HUP
                RETVAL=$?
        else
-               msg_not_running bluetooth >&2
+               msg_not_running bluetooth
                exit 7
        fi
        ;;
@@ -148,6 +155,3 @@ case "$1" in
 esac
 
 exit $RETVAL
-
-# This must be last line !
-# vi:syntax=sh:tw=78:ts=8:sw=4
This page took 0.06276 seconds and 4 git commands to generate.