2006-09-07 22:25:08 +00:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
|
|
|
# $FreeBSD$
|
|
|
|
#
|
|
|
|
|
|
|
|
# PROVIDE: bthidd
|
|
|
|
# REQUIRE: DAEMON hcsecd
|
|
|
|
# BEFORE: LOGIN
|
2008-07-16 19:50:29 +00:00
|
|
|
# KEYWORD: nojail shutdown
|
2006-09-07 22:25:08 +00:00
|
|
|
|
|
|
|
. /etc/rc.subr
|
|
|
|
|
|
|
|
name="bthidd"
|
2016-04-23 16:10:54 +00:00
|
|
|
desc="Bluetooth HID daemon"
|
2012-01-14 02:18:41 +00:00
|
|
|
rcvar="bthidd_enable"
|
2006-09-07 22:25:08 +00:00
|
|
|
command="/usr/sbin/${name}"
|
|
|
|
pidfile="/var/run/${name}.pid"
|
|
|
|
start_precmd="bthidd_prestart"
|
|
|
|
|
2018-04-30 12:16:54 +00:00
|
|
|
evdev_enabled()
|
|
|
|
{
|
|
|
|
case ${bthidd_evdev_support} in
|
|
|
|
[Aa][Uu][Tt][Oo])
|
|
|
|
check_kern_features evdev_support
|
|
|
|
return $?
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
checkyesno bthidd_evdev_support
|
|
|
|
return $?
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
}
|
|
|
|
|
2006-09-07 22:25:08 +00:00
|
|
|
bthidd_prestart()
|
|
|
|
{
|
2018-04-30 12:16:54 +00:00
|
|
|
if evdev_enabled; then
|
|
|
|
load_kld -m uinput uinput
|
|
|
|
fi
|
2006-09-07 22:25:08 +00:00
|
|
|
load_kld -m kbdmux kbdmux
|
|
|
|
load_kld -m vkbd vkbd
|
|
|
|
load_kld -m ng_btsocket ng_btsocket
|
|
|
|
return 0
|
|
|
|
}
|
|
|
|
|
|
|
|
load_rc_config $name
|
|
|
|
config="${bthidd_config:-/etc/bluetooth/${name}.conf}"
|
|
|
|
hids="${bthidd_hids:-/var/db/${name}.hids}"
|
|
|
|
command_args="-c ${config} -H ${hids} -p ${pidfile}"
|
2018-04-30 12:16:54 +00:00
|
|
|
if evdev_enabled; then
|
|
|
|
command_args="$command_args -u"
|
|
|
|
fi
|
2006-09-07 22:25:08 +00:00
|
|
|
required_files="${config}"
|
|
|
|
|
|
|
|
run_rc_command "$1"
|