Sync usage with man page.
[netbsd-mini2440.git] / etc / rc.d / btdevctl
blobd42d17b88ded51f12643e56614b17c69701afcf9
1 #!/bin/sh
3 # $NetBSD: btdevctl,v 1.3 2006/09/10 15:45:55 plunky Exp $
6 # PROVIDE: btdevctl
7 # REQUIRE: bluetooth bthcid
8 # BEFORE: LOGIN
10 $_rc_subr_loaded . /etc/rc.subr
12 name="btdevctl"
13 rcvar=${name}
14 required_files="/etc/bluetooth/btdevctl.conf"
15 start_cmd='do_btdevctl "-A" "Attaching"'
16 stop_cmd='do_btdevctl "-D" "Detaching"'
18 do_btdevctl()
20 echo "${2} Bluetooth devices:"
22 while read -r service address device junk; do
23 case ${service} in
24 \#*|"")
25 continue
27 esac
29 if [ -z ${device} -o ${junk} ]; then
30 echo "${name}: invalid entry"
31 return 1
34 /usr/sbin/btdevctl ${1} "-a" ${address} "-d" ${device} "-s" ${service}
35 done < /etc/bluetooth/btdevctl.conf
38 load_rc_config ${name}
39 run_rc_command "$1"