]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/commitdiff
unbound: Drop function to reload forwarders on the fly
authorMichael Tremer <michael.tremer@ipfire.org>
Mon, 13 Jan 2020 20:19:22 +0000 (21:19 +0100)
committerMichael Tremer <michael.tremer@ipfire.org>
Mon, 13 Jan 2020 20:19:22 +0000 (21:19 +0100)
This is now being done by updating and re-reading forward.conf.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/initscripts/system/unbound

index 5fb1d68d795ea47e848a23b58043e09a9f045ca6..c680e58759f0147f790af7c4ab812b4e877ea9fe 100644 (file)
@@ -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)