diff options
author | Max Krasnyansky <maxk@qualcomm.com> | 2002-03-08 21:12:35 +0000 |
---|---|---|
committer | Max Krasnyansky <maxk@qualcomm.com> | 2002-03-08 21:12:35 +0000 |
commit | c98b2f82a4e532ca61592b08e3ad60749eb9f8d7 (patch) | |
tree | 19a3df72d2cd6a8d64b7d98473261c7e07e306a0 /scripts/bluetooth.rc.rh |
Initial revision
Diffstat (limited to 'scripts/bluetooth.rc.rh')
-rwxr-xr-x | scripts/bluetooth.rc.rh | 72 |
1 files changed, 72 insertions, 0 deletions
diff --git a/scripts/bluetooth.rc.rh b/scripts/bluetooth.rc.rh new file mode 100755 index 00000000..f0586788 --- /dev/null +++ b/scripts/bluetooth.rc.rh @@ -0,0 +1,72 @@ +#!/bin/sh +# +# bluetooth Bluetooth subsystem starting and stopping +# +# chkconfig: 345 25 90 +# description: Bluetooth subsystem +# + +# Source function library. +. /etc/rc.d/init.d/functions + +# Source Bluetooth configuration. +#. /etc/sysconfig/bluetooth + +prog="Bluetooth" + +UART_CONF="/etc/bluetooth/uart" + +start_uarts() +{ + [ -f /sbin/hciattach -a -f $UART_CONF ] || return + grep -v '^#' $UART_CONF | while read i; do + /sbin/hciattach $i + done +} + +stop_uarts() +{ + killproc hciattach > /dev/null 2>&1 +} + +start() +{ + echo -n $"Starting $prog: " + daemon /sbin/hcid + start_uarts + touch /var/lock/subsys/bluetooth + echo +} + +stop() +{ + echo -n $"Shutting down $prog: " + stop_uarts + killproc hcid + rm -f /var/lock/subsys/bluetooth + echo +} + +[ -f /sbin/hcid ] || exit 0 + +# See how we were called. +case "$1" in + start) + start + ;; + stop) + stop + ;; + restart|reload) + stop + start + ;; + condrestart) + [ -e /var/lock/subsys/bluetooth ] && (stop; start) + ;; + *) + echo $"Usage: $0 {start|stop|restart|reload|condrestart}" + exit 1 +esac + +exit 0 |