From e0f553335f4c4a3bed2a1c6a8fcfc4b5d01216b7 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Arkadiusz=20Mi=C5=9Bkiewicz?= Date: Sat, 8 Aug 2009 11:33:22 +0000 Subject: [PATCH] - use udev for starting stuff Changed files: bluez.init -> 1.6 --- bluez.init | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/bluez.init b/bluez.init index 7fdee49..2329281 100644 --- a/bluez.init +++ b/bluez.init @@ -1,6 +1,6 @@ #!/bin/sh # -# bluetooth Bluetooth subsystem starting and stopping +# bluetooth Bluetooth subsystem starting and stopping. Turn HID adapters into Bluetooth ones. # # chkconfig: 345 50 83 # @@ -17,11 +17,12 @@ start() { # Check if the service is already running? if [ ! -f /var/lock/subsys/bluetooth ]; then - msg_starting hid2hci - daemon /usr/sbin/hid2hci -q -r hci - RETVAL=$? - /bin/sleep 1 # delay for hid's to be detected by hotplug - touch /var/lock/subsys/bluetooth + if [ -x /sbin/udevadm ]; then + msg_starting "Bluetooth devices" + daemon /sbin/udevadm trigger --subsystem-match=bluetooth + RETVAL=$? + touch /var/lock/subsys/bluetooth + fi else msg_already_running bluetooth fi @@ -29,8 +30,7 @@ start() { stop() { if [ -f /var/lock/subsys/bluetooth ]; then - msg_stopping hid2hci - daemon /usr/sbin/hid2hci -q -r hid + # nothing needed to stop it rm -f /var/lock/subsys/bluetooth else msg_not_running bluetooth -- 2.44.0