1#!/bin/sh 2# 3# 4 5# PROVIDE: ubthidhci 6# REQUIRE: DAEMON 7# BEFORE: bluetooth 8# KEYWORD: nojail shutdown 9 10. /etc/rc.subr 11 12name="ubthidhci" 13rcvar="ubthidhci_enable" 14command="/usr/sbin/usbconfig" 15start_precmd="ubthidhci_prestart" 16 17ubthidhci_prestart() 18{ 19 20 if [ -z ${ubthidhci_busnum} ]; then 21 warn ubthidhci_busnum is not set 22 return 1 23 fi 24 if [ -z ${ubthidhci_addr} ]; then 25 warn ubthidhci_addr is not set 26 return 1 27 fi 28} 29 30load_rc_config $name 31 32# doesn't make sense to run in a svcj: nojail keyword 33ubthidhci_svcj="NO" 34 35# 36# We discard the output because: 37# 1) we don't want it to show up during boot; and 38# 2) the request usually returns an error, but that doesn't mean it failed 39# 40# NB: 0x40 is UT_VENDOR 41command_args="-u ${ubthidhci_busnum} -a ${ubthidhci_addr} do_request 0x40 0 0 0 0 > /dev/null 2>&1" 42 43run_rc_command "$1" 44