NetBSD/etc/rc.d/btconfig
gdamore a5c89047c0 Initial import of bluetooth stack on behalf of Iain Hibbert. (plunky@,
NetBSD Foundation Membership still pending.)  This stack was written by
Iain under sponsorship from Itronix Inc.

The stack includes support for rfcomm networking (networking via your
bluetooth enabled cell phone), hid devices (keyboards/mice), and headsets.

Drivers for both PCMCIA and USB bluetooth controllers are included.
2006-06-19 15:44:33 +00:00

68 lines
1.2 KiB
Bash

#!/bin/sh
#
# $NetBSD: btconfig,v 1.1 2006/06/19 15:44:36 gdamore Exp $
#
# PROVIDE: bluetooth
# REQUIRE: DAEMON
# BEFORE: LOGIN
$_rc_subr_loaded . /etc/rc.subr
name="btconfig"
rcvar=${name}
command="/usr/sbin/${name}"
start_cmd="btconfig_start"
stop_cmd="btconfig_stop"
status_cmd="btconfig_status"
btconfig_start()
{
echo -n 'Configuring Bluetooth controllers:'
#
# Configure Bluetooth controllers.
#
# If ${btconfig_devices} is set, it should be a list of devices to
# configure. Otherwise, all available devices will be configured.
#
# If ${btconfig_<dev>} is set, it will be used as the parameter
# list for btconfig. Otherwise ${btconfig_args} will be used or
# if that is not set, the default string "enable" will be used.
#
devs="${btconfig_devices:-$(${command} -l)}"
for dev in ${devs}; do
eval args="\$btconfig_${dev}"
if [ -z "${args}" ]; then
args="${btconfig_args:-enable}"
fi
echo -n " ${dev}"
${command} ${dev} ${args}
done
echo '.'
}
btconfig_stop()
{
echo -n 'Disabling Bluetooth controllers:'
devs="${btconfig_devices:-$(${command} -l)}"
for dev in ${devs}; do
echo -n " ${dev}"
${command} ${dev} disable
done
echo '.'
}
btconfig_status()
{
${command}
}
load_rc_config ${name}
run_rc_command "$1"