#!/sbin/runscript #BTSCO init script - Written By Peter Johansson BTSCO_PID="/var/run/btsco.pid" BTSCO_CONF="/etc/conf.d/btsco.conf" BDADDR=`sed 's/BDADDR=//' /etc/conf.d/btsco.conf` checkconfig() { if [[ ! -e ${BTSCO_CONF} ]] ; then eerror Couldnt find ${BTSCO_CONF} Please create the config file eerror and add the following line: BDADDR=XX:XX:XX:XX:XX:XX return 1 fi return 0 } start() { checkconfig || return $? ebegin "Connecting the bluetooth headset" start-stop-daemon --start --exec /usr/bin/btsco ${BDADDR} \ --background --make-pidfile --pidfile "${BTSCO_PID}" eend $? "Failed to connect the bluetooth headset" } stop() { ebegin "Disconnecting the bluetooth headset" start-stop-daemon --stop --quiet --exec /usr/bin/btsco \ --pidfile "${BTSCO_PID}" eend $? }