#!/sbin/runscript # Copyright 1999-2004 Gentoo Technologies, Inc. # Distributed under the terms of the GNU General Public License v2 # $Header: /home/cvsroot/gentoo-x86/net-wireless/bluez-utils/files/bluetooth.rc,v 1.3 2004/03/06 03:52:52 vapier Exp $ UART_CONF="/etc/bluetooth/uart" depend() { after hotplug } start_uarts() { [ -f /usr/sbin/hciattach -a -f ${UART_CONF} ] || return grep -v '^#' $UART_CONF | while read i; do /usr/sbin/hciattach $i done } stop_uarts() { killall hciattach > /dev/null 2>&1 } start() { local RETVAL ebegin "Starting Bluetooth" [ -x /usr/sbin/hcid ] && \ start-stop-daemon --start --quiet --exec /usr/sbin/hcid RETVAL=$? [ $RETVAL -a -x /usr/sbin/sdpd ] && \ start-stop-daemon --start --quiet --exec /usr/sbin/sdpd RETVAL=$? start_uarts eend ${RETVAL} } stop() { local RETVAL ebegin "Shutting down Bluetooth" [ -x /usr/sbin/hcid ] && \ start-stop-daemon --stop --quiet --exec /usr/sbin/hcid RETVAL=$? [ -x /usr/sbin/sdpd ] && \ start-stop-daemon --stop --quiet --exec /usr/sbin/sdpd RETVAL=$? stop_uarts eend ${RETVAL} }