]> git.pld-linux.org Git - packages/bluez-utils.git/blobdiff - bluez-utils.init
- too many apps starts here so one can fail, another can work, lock file would be...
[packages/bluez-utils.git] / bluez-utils.init
index b624e71bc443780d94416ea85b6c1920fcdfb219..00cacb8da9a01f30048339fd57fe59983045a063 100644 (file)
@@ -31,14 +31,13 @@ start() {
                fi
                
                if is_yes "${HCID_ENABLE}" && [ -x /usr/sbin/hcid ]; then
+                       HCID_FLAGS="-f /etc/bluetooth/hcid.conf"
+
+                       if is_yes "${SDPD_ENABLE}" ; then
+                               HCID_FLAGS="$HCID_FLAGS -s"
+                       fi
                        msg_starting hcid
-                       daemon /usr/sbin/hcid -f /etc/bluetooth/hcid.conf
-                       RETVAL=$?
-               fi
-       
-               if is_yes "${SDPD_ENABLE}" && [ -x /usr/sbin/sdpd ]; then
-                       msg_starting sdpd
-                       daemon /usr/sbin/sdpd
+                       daemon /usr/sbin/hcid $HCID_FLAGS
                        RETVAL=$?
                fi
                
@@ -71,7 +70,7 @@ start() {
                                /usr/sbin/hciattach $i
                        done
                fi
-               [ $RETVAL -eq 0 ] && touch /var/lock/subsys/bluetooth
+               touch /var/lock/subsys/bluetooth
        else
                msg_already_running bluetooth
        fi
@@ -99,14 +98,9 @@ stop() {
                        killproc /usr/bin/hidd
                fi
        
-               if is_yes "${SDPD_ENABLE}" && [ -x /usr/sbin/sdpd ]; then
-                       msg_stopping sdpd
-                       killproc /usr/sbin/sdpd
-               fi
-       
                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
@@ -147,7 +141,11 @@ case "$1" in
        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}"
This page took 0.045274 seconds and 4 git commands to generate.