From: Michael Tremer Date: Mon, 13 Jan 2020 20:19:22 +0000 (+0100) Subject: unbound: Drop function to reload forwarders on the fly X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=24a694d425b3036a3334ded8a39b74833c7ab05d;p=people%2Fstevee%2Fipfire-2.x.git unbound: Drop function to reload forwarders on the fly This is now being done by updating and re-reading forward.conf. Signed-off-by: Michael Tremer --- diff --git a/src/initscripts/system/unbound b/src/initscripts/system/unbound index 5fb1d68d79..c680e58759 100644 --- a/src/initscripts/system/unbound +++ b/src/initscripts/system/unbound @@ -291,23 +291,6 @@ resolve() { done } -update_forwarders() { - # Do nothing when we do not use the ISP name servers - [ "${USE_ISP_NAMESERVERS}" != "on" ] && return 0 - - # We cannot update anything when using TLS - # Unbound will then try to connect to the servers using UDP on port 853 - [ "${PROTO}" = "TLS" ] && return 0 - - # Update unbound about the new servers - local nameservers=( $(read_name_servers) ) - if [ -n "${nameservers[*]}" ]; then - unbound-control -q forward "${nameservers[@]}" - else - unbound-control -q forward off - fi -} - # Sets up Safe Search for various search engines update_safe_search() { local google_tlds=( @@ -593,7 +576,7 @@ case "$1" in sleep 1 $0 start ;; - reload) + reload|remove-forwarders) # Update configuration files write_forward_conf write_hosts_conf @@ -612,17 +595,10 @@ case "$1" in ;; update-forwarders) - update_forwarders + $0 reload # Make sure DNS works at this point fix_time_if_dns_fails - - # Update Safe Search settings - update_safe_search - ;; - - remove-forwarders) - update_forwarders ;; resolve)