summaryrefslogtreecommitdiffstats
path: root/usr.sbin
diff options
context:
space:
mode:
authordes <des@FreeBSD.org>2015-12-04 13:26:12 +0000
committerdes <des@FreeBSD.org>2015-12-04 13:26:12 +0000
commit72c7e45913048bf7a7a9f4f898363ea802ba3ab7 (patch)
tree658b312c2da2a4079aee851908bd5b4bd805ab2b /usr.sbin
parentfc230dcf447eb45f054aa940c35313f825b926df (diff)
downloadFreeBSD-src-72c7e45913048bf7a7a9f4f898363ea802ba3ab7.zip
FreeBSD-src-72c7e45913048bf7a7a9f4f898363ea802ba3ab7.tar.gz
MFH (r287917, r287918, r289063): upgrade to latest Unbound
MFH (r283301, r289592, r291582): rc script improvements MFH (r287880): respect manually configured forwarders when using DHCP MFH (r289321): deconfuse man page PR: 184047 203580 204931
Diffstat (limited to 'usr.sbin')
-rwxr-xr-xusr.sbin/unbound/local-setup/local-unbound-setup.sh20
1 files changed, 14 insertions, 6 deletions
diff --git a/usr.sbin/unbound/local-setup/local-unbound-setup.sh b/usr.sbin/unbound/local-setup/local-unbound-setup.sh
index 4c464d1..5df4760 100755
--- a/usr.sbin/unbound/local-setup/local-unbound-setup.sh
+++ b/usr.sbin/unbound/local-setup/local-unbound-setup.sh
@@ -172,13 +172,18 @@ do_not_edit() {
# the libc resolver will try unbound first.
#
gen_resolvconf_conf() {
+ local style="$1"
do_not_edit
echo "resolv_conf=\"/dev/null\" # prevent updating ${resolv_conf}"
- echo "unbound_conf=\"${forward_conf}\""
- echo "unbound_pid=\"${pidfile}\""
- echo "unbound_service=\"${service}\""
- # resolvconf(8) likes to restart rather than reload
- echo "unbound_restart=\"service ${service} reload\""
+ if [ "${style}" = "dynamic" ] ; then
+ echo "unbound_conf=\"${forward_conf}\""
+ echo "unbound_pid=\"${pidfile}\""
+ echo "unbound_service=\"${service}\""
+ # resolvconf(8) likes to restart rather than reload
+ echo "unbound_restart=\"service ${service} reload\""
+ else
+ echo "# Static DNS configuration"
+ fi
}
#
@@ -379,6 +384,9 @@ main() {
if [ -z "$forwarders" ] ; then
echo "Extracting forwarders from ${resolv_conf}."
forwarders=$(get_nameservers <"${resolv_conf}")
+ style=dynamic
+ else
+ style=static
fi
#
@@ -440,7 +448,7 @@ main() {
# instead of resolv.conf.
#
local tmp_resolvconf_conf=$(mktemp -u "${resolvconf_conf}.XXXXX")
- gen_resolvconf_conf | unexpand >"${tmp_resolvconf_conf}"
+ gen_resolvconf_conf "${style}" | unexpand >"${tmp_resolvconf_conf}"
replace "${resolvconf_conf}" "${tmp_resolvconf_conf}"
#
OpenPOWER on IntegriCloud