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
22 # See how we were called.
25 # Check if the service is already running?
26 if [ ! -f /var/lock/subsys/bluetooth ]; then
27 # show "Starting %s service" Bluetooth
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 # show "%s service is already running." Bluetooth
52 msg_already_running Bluetooth
57 if [ -f /var/lock/subsys/bluetooth ]; then
58 if [ -x /usr/sbin/sdpd ]; then
59 msg_stopping "Bluetooth SDP"
62 # show "Stopping %s service" Bluetooth
63 msg_stopping Bluetooth
66 if [ "$UART_CONF" != "no" ]; then
67 killproc hciattach >/dev/null 2>&1
69 rm -f /var/lock/subsys/bluetooth
71 # show "%s service is not running." Bluetooth
72 msg_not_running Bluetooth
81 if [ -f /var/lock/subsys/bluetooth ]; then
82 # show "Reload %s service" Bluetooth
83 msg_reloading Bluetooth
87 # show "%s service is not running." Bluetooth
88 msg_not_running Bluetooth
93 # if program allows reloading without stopping
101 # show "Usage: %s {start|stop|restart|reload|force-reload|status}"
102 msg_usage "$0 {start|stop|restart|reload|force-reload|status}"
108 # This must be last line !
109 # vi:syntax=sh:tw=78:ts=8:sw=4