MFC if_aue.c rev1.39:
[dragonfly.git] / etc / rc.d / btconfig
blob7c8509872e6e10faad999f9d058ebf13f87355fa
1 #!/bin/sh
3 # $NetBSD: btconfig,v 1.1 2006/06/19 15:44:36 gdamore Exp $
4 # $DragonFly: src/etc/rc.d/btconfig,v 1.1 2008/01/06 21:51:30 hasso Exp $
6 # PROVIDE: bluetooth
7 # REQUIRE: DAEMON
8 # BEFORE: LOGIN
10 $_rc_subr_loaded . /etc/rc.subr
12 name="btconfig"
13 rcvar=${name}
14 command="/usr/sbin/${name}"
15 start_cmd="btconfig_start"
16 stop_cmd="btconfig_stop"
17 status_cmd="btconfig_status"
19 btconfig_start()
21 echo -n 'Configuring Bluetooth controllers:'
24 # Configure Bluetooth controllers.
26 # If ${btconfig_devices} is set, it should be a list of devices to
27 # configure. Otherwise, all available devices will be configured.
29 # If ${btconfig_<dev>} is set, it will be used as the parameter
30 # list for btconfig. Otherwise ${btconfig_args} will be used or
31 # if that is not set, the default string "enable" will be used.
34 devs="${btconfig_devices:-$(${command} -l)}"
35 for dev in ${devs}; do
36 eval args="\$btconfig_${dev}"
37 if [ -z "${args}" ]; then
38 args="${btconfig_args:-enable}"
41 echo -n " ${dev}"
42 ${command} ${dev} ${args}
43 done
45 echo '.'
48 btconfig_stop()
50 echo -n 'Disabling Bluetooth controllers:'
52 devs="${btconfig_devices:-$(${command} -l)}"
53 for dev in ${devs}; do
54 echo -n " ${dev}"
55 ${command} ${dev} disable
56 done
58 echo '.'
61 btconfig_status()
63 ${command}
66 load_rc_config ${name}
67 run_rc_command "$1"