summaryrefslogtreecommitdiffstats
path: root/etc/rc.d
diff options
context:
space:
mode:
authordes <des@FreeBSD.org>2014-09-08 09:33:43 +0000
committerdes <des@FreeBSD.org>2014-09-08 09:33:43 +0000
commit6224f5c9f14f60cc6203ad68f112f57f4a9eedbf (patch)
treee00add3a5f0765284699ad22d14bbfe8a6ff798a /etc/rc.d
parentb5f87ea11c1944c18b6a1f1f4a06b1198aeebd98 (diff)
downloadFreeBSD-src-6224f5c9f14f60cc6203ad68f112f57f4a9eedbf.zip
FreeBSD-src-6224f5c9f14f60cc6203ad68f112f57f4a9eedbf.tar.gz
Use the correct idiom for default values, and ensure that the script
works correctly if the user overrides them. PR: 193255 Submitted by: hrs@ MFC after: 3 days
Diffstat (limited to 'etc/rc.d')
-rwxr-xr-xetc/rc.d/local_unbound20
1 files changed, 6 insertions, 14 deletions
diff --git a/etc/rc.d/local_unbound b/etc/rc.d/local_unbound
index ed69c19..9a7e191 100755
--- a/etc/rc.d/local_unbound
+++ b/etc/rc.d/local_unbound
@@ -13,7 +13,6 @@ name="local_unbound"
desc="local caching forwarding resolver"
rcvar="local_unbound_enable"
-command="/usr/sbin/unbound"
extra_commands="anchor configtest reload setup"
start_precmd="local_unbound_prestart"
reload_precmd="local_unbound_configtest"
@@ -22,18 +21,9 @@ configtest_cmd="local_unbound_configtest"
setup_cmd="local_unbound_setup"
pidfile="/var/run/${name}.pid"
-: ${local_unbound_workdir:=/var/unbound}
-: ${local_unbound_config:=${local_unbound_workdir}/unbound.conf}
-: ${local_unbound_flags:=-c${local_unbound_config}}
-: ${local_unbound_forwardconf:=${local_unbound_workdir}/forward.conf}
-: ${local_unbound_anchor:=${local_unbound_workdir}/root.key}
-: ${local_unbound_forwarders:=}
-
-load_rc_config $name
-
do_as_unbound()
{
- echo "$@" | su -m unbound
+ echo "$@" | /usr/bin/su -m unbound
}
#
@@ -41,7 +31,8 @@ do_as_unbound()
#
local_unbound_anchor()
{
- do_as_unbound /usr/sbin/unbound-anchor -a ${local_unbound_anchor}
+ do_as_unbound ${local_unbound_program%/*}/unbound-anchor \
+ -a ${local_unbound_anchor}
# we can't trust the exit code - check if the file exists
[ -f ${local_unbound_anchor} ]
}
@@ -51,7 +42,8 @@ local_unbound_anchor()
#
local_unbound_configtest()
{
- do_as_unbound /usr/sbin/unbound-checkconf ${local_unbound_config}
+ do_as_unbound ${local_unbound_program%/*}/unbound-checkconf \
+ ${local_unbound_config}
}
#
@@ -61,7 +53,7 @@ local_unbound_configtest()
local_unbound_setup()
{
echo "Performing initial setup."
- /usr/sbin/local-unbound-setup -n \
+ ${local_unbound_program%/*}/local-unbound-setup -n \
-u unbound \
-w ${local_unbound_workdir} \
-c ${local_unbound_config} \
OpenPOWER on IntegriCloud