3 # bluetooth Bluetooth subsystem starting and stopping
7 # description: Bluetooth subsystem
12 # Source function library
13 . /etc/rc.d/init.d/functions
15 UART_CONF="/etc/bluetooth/uart"
16 [ -f /etc/sysconfig/bluetooth ] && . /etc/sysconfig/bluetooth
18 if [ "$UART_CONF" != "no" -a ! -f "$UART_CONF" ]; then
23 # See how we were called.
26 # Check if the service is already running?
27 if [ ! -f /var/lock/subsys/bluetooth ]; then
28 msg_starting Bluetooth
29 if [ -f /usr/sbin/hciattach -a "$UART_CONF" != "no" ]; then
30 grep -v '^#' $UART_CONF | while read i; do
31 /usr/sbin/hciattach $i
34 daemon /usr/sbin/hcid -f /etc/bluetooth/hcid.conf
36 if [ $RETVAL -ne 0 ]; then
37 killproc hciattach >/dev/null 2>&1
38 elif [ -x /usr/sbin/sdpd ]; then
39 msg_starting "Bluetooth SDP"
42 if [ $RETVAL -ne 0 ]; then
43 killproc hcid >/dev/null 2>&1
44 if [ "$UART_CONF" != "no" ]; then
45 killproc hciattach >/dev/null 2>&1
49 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/bluetooth
51 msg_already_running Bluetooth
55 if [ -f /var/lock/subsys/bluetooth ]; then
56 if [ -x /usr/sbin/sdpd ]; then
57 msg_stopping "Bluetooth SDP"
60 msg_stopping Bluetooth
62 if [ "$UART_CONF" != "no" ]; then
63 killproc hciattach >/dev/null 2>&1
65 rm -f /var/lock/subsys/bluetooth
67 msg_not_running Bluetooth
76 if [ -f /var/lock/subsys/bluetooth ]; then
77 msg_reloading Bluetooth
81 msg_not_running Bluetooth >&2
90 msg_usage "$0 {start|stop|restart|reload|force-reload|status}"
96 # This must be last line !
97 # vi:syntax=sh:tw=78:ts=8:sw=4