#!/sbin/runscript # Copyright 1999-2005 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ depend() { need bluetooth alsasound } checkconfig() { # check that the configuration file has been configured. if [ -z "$BDADDR" ]; then eerror "You should setup BDADDR in /etc/conf.d/headset." return 1 fi if ! [ -d /sys/module/snd_bt_sco ]; then ebegin "Loading bluetooth-alsa kernel module (snd_bt_sco)." /sbin/modprobe snd-bt-sco eend $? || return 1 fi } start() { checkconfig || return 1 ebegin "Connecting to headset" start-stop-daemon --start \ --make-pidfile --pidfile /var/run/btsco2 \ --background --exec /usr/bin/btsco2 -- $BDADDR sleep 1 ps -C btsco2 >/dev/null eend $? } stop() { ebegin "Stopping btsco2 daemon" start-stop-daemon --stop --quiet --pidfile /var/run/btsco2 eend ${?} }