mirror of
https://git.FreeBSD.org/ports.git
synced 2025-01-14 07:43:06 +00:00
1e92898cab
- Remove trailing space PR: ports/189818 Submitted by: zi
48 lines
1.2 KiB
Bash
48 lines
1.2 KiB
Bash
#!/bin/sh
|
|
#
|
|
# $FreeBSD$
|
|
#
|
|
# unbound freebsd startup rc.d script, modified from the named script.
|
|
# uses the default unbound installation path and pidfile location.
|
|
# copy this to /etc/rc.d/unbound
|
|
# and put unbound_enable="YES" into rc.conf
|
|
#
|
|
# unbound_anchorflags can be used to allow you to pass a custom flags to
|
|
# unbound-anchor. Examples include a custom resolv.conf (-f) or a custom
|
|
# root.hints (-r). Useful for when /etc/resolv.conf only contains 127.0.0.1
|
|
|
|
# PROVIDE: unbound
|
|
# REQUIRE: SERVERS cleanvar
|
|
# KEYWORD: shutdown
|
|
|
|
. /etc/rc.subr
|
|
|
|
name="unbound"
|
|
rcvar=unbound_enable
|
|
|
|
command="%%PREFIX%%/sbin/unbound"
|
|
extra_commands="reload"
|
|
start_precmd="start_precmd"
|
|
reload_precmd="%%PREFIX%%/sbin/unbound-checkconf >/dev/null"
|
|
|
|
load_rc_config $name
|
|
|
|
pidfile=${unbound_pidfile:-"%%PREFIX%%/etc/unbound/unbound.pid"}
|
|
unbound_enable=${unbound_enable:-"NO"}
|
|
unbound_anchorflags=${unbound_anchorflags:-""}
|
|
|
|
start_precmd()
|
|
{
|
|
%%PREFIX%%/sbin/unbound-checkconf > /dev/null && \
|
|
echo -n "Obtaining a trust anchor:" && \
|
|
if [ "${unbound_anchorflags}T" = "T" ]; then \
|
|
su -m unbound -c %%PREFIX%%/sbin/unbound-anchor; \
|
|
else
|
|
su -m unbound -c "%%PREFIX%%/sbin/unbound-anchor ${unbound_anchorflags}"; \
|
|
fi &&
|
|
echo .
|
|
return 0
|
|
}
|
|
|
|
run_rc_command "$1"
|