mirror of
https://git.hardenedbsd.org/hardenedbsd/HardenedBSD.git
synced 2024-11-15 14:56:13 +01:00
b11974c250
PR: 237172 Approved by: jilles Differential Revision: https://reviews.freebsd.org/D18670
55 lines
928 B
Bash
Executable File
55 lines
928 B
Bash
Executable File
#!/bin/sh
|
|
#
|
|
# $FreeBSD$
|
|
#
|
|
|
|
# PROVIDE: bthidd
|
|
# REQUIRE: DAEMON hcsecd
|
|
# BEFORE: LOGIN
|
|
# KEYWORD: nojail shutdown
|
|
|
|
. /etc/rc.subr
|
|
|
|
name="bthidd"
|
|
desc="Bluetooth HID daemon"
|
|
rcvar="bthidd_enable"
|
|
command="/usr/sbin/${name}"
|
|
pidfile="/var/run/${name}.pid"
|
|
start_precmd="bthidd_prestart"
|
|
|
|
evdev_enabled()
|
|
{
|
|
case ${bthidd_evdev_support} in
|
|
[Aa][Uu][Tt][Oo])
|
|
check_kern_features evdev_support
|
|
return $?
|
|
;;
|
|
*)
|
|
checkyesno bthidd_evdev_support
|
|
return $?
|
|
;;
|
|
esac
|
|
}
|
|
|
|
bthidd_prestart()
|
|
{
|
|
if evdev_enabled; then
|
|
load_kld -m uinput uinput
|
|
fi
|
|
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}"
|
|
if evdev_enabled; then
|
|
command_args="$command_args -u"
|
|
fi
|
|
required_files="${config}"
|
|
|
|
run_rc_command "$1"
|