#!/sbin/runscript # Copyright 1999-2004 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: /var/cvsroot/gentoo-x86/net-wireless/bluez-utils/files/bluetooth.rc,v 1.5 2004/09/21 23:09:54 liquidx Exp $ UART_CONF="/etc/bluetooth/uart" depend() { after hotplug } start_probe() { /sbin/modprobe bluetooth l2cap rfcomm sdp } 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" start_probe [ -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} }