freebsd-dev/etc/rc.d/hcsecd
Maksim Yevmenkin e08872c40b Revise hcsecd(8) and sdpd(8) rc.d scripts one more time
- Use _prestart rc.d method to automatically kldload ng_btsocket(4) if needed;

- Rename "sdpd_user" to "sdpd_username" and "sdpd_group" to "sdpd_groupname"
  to avoid collision with "magic" variables;

Inspired by:	yar
MFC after:	3 days
2005-11-22 18:51:43 +00:00

39 lines
636 B
Bash

#!/bin/sh
#
# $FreeBSD$
#
# PROVIDE: hcsecd
# REQUIRE: DAEMON
# BEFORE: LOGIN
# KEYWORD: nojail
. /etc/rc.subr
name="hcsecd"
command="/usr/sbin/${name}"
pidfile="/var/run/${name}.pid"
rcvar=`set_rcvar`
start_precmd="hcsecd_prestart"
hcsecd_prestart()
{
if ! kldstat -q -m ng_btsocket > /dev/null 2>&1 ; then
if kldload ng_btsocket > /dev/null 2>&1 ; then
info 'ng_btsocket module loaded'
else
warn 'ng_btsocket module failed to load'
return 1
fi
fi
return 0
}
load_rc_config $name
config="${hcsecd_config:-/etc/bluetooth/${name}.conf}"
command_args="-f ${config}"
required_files="${config}"
run_rc_command "$1"