2008-05-27 00:36:56 +02:00
|
|
|
#!@RCD_SCRIPTS_SHELL@
|
|
|
|
#
|
2015-12-28 14:48:30 +01:00
|
|
|
# $NetBSD: unbound.sh,v 1.5 2015/12/28 13:48:30 bsiegert Exp $
|
2008-05-27 00:36:56 +02:00
|
|
|
#
|
|
|
|
# PROVIDE: unbound
|
|
|
|
# REQUIRE: DAEMON
|
|
|
|
#
|
|
|
|
|
|
|
|
. /etc/rc.subr
|
|
|
|
|
|
|
|
name="unbound"
|
|
|
|
rcvar=${name}
|
|
|
|
|
|
|
|
command=@PREFIX@/sbin/${name}
|
2015-03-19 23:37:06 +01:00
|
|
|
pidfile=/var/run/${name}/${name}.pid
|
2015-03-09 12:59:26 +01:00
|
|
|
required_files="@PKG_SYSCONFDIR@/unbound.conf"
|
2009-11-24 02:08:06 +01:00
|
|
|
extra_commands="reload"
|
2015-03-09 12:59:26 +01:00
|
|
|
start_precmd="unbound_precmd"
|
2008-05-27 00:36:56 +02:00
|
|
|
|
2015-03-09 12:59:26 +01:00
|
|
|
unbound_precmd()
|
|
|
|
{
|
|
|
|
if [ ! -d @VARBASE@/run/unbound ]; then
|
|
|
|
@MKDIR@ @VARBASE@/run/unbound
|
|
|
|
@CHMOD@ 0750 @VARBASE@/run/unbound
|
|
|
|
@CHOWN@ @UNBOUND_USER@:@UNBOUND_GROUP@ @VARBASE@/run/unbound
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
unbound_flags=${unbound_flags:-""}
|
|
|
|
|
|
|
|
if [ -f /etc/rc.subr ]; then
|
|
|
|
load_rc_config ${name}
|
|
|
|
run_rc_command "$1"
|
|
|
|
else
|
|
|
|
echo -n " ${name}"
|
2015-12-28 14:48:30 +01:00
|
|
|
${command} ${unbound_flags}
|
2015-03-09 12:59:26 +01:00
|
|
|
fi
|