]> git.ipfire.org Git - ipfire-2.x.git/blobdiff - src/initscripts/system/unbound
unbound: Drop certificates for local control connection
[ipfire-2.x.git] / src / initscripts / system / unbound
index 9082c2d4c3fce1646ef16a251446eec97aa4ee5c..2ef994e963cc1629f5d4ece415f80c036277b2d7 100644 (file)
@@ -216,7 +216,11 @@ write_forward_conf() {
                                        echo "stub-zone:"
                                        echo "  name: ${zone}"
                                        for server in ${servers//|/ }; do
-                                               echo "  stub-addr: ${server}"
+                                               if [[ ${server} =~ ^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
+                                                       echo "  stub-addr: ${server}"
+                                               else
+                                                       echo "  stub-host: ${server}"
+                                               fi
                                        done
                                        echo
                                        echo "server:"
@@ -227,7 +231,11 @@ write_forward_conf() {
                                        echo "forward-zone:"
                                        echo "  name: ${zone}"
                                        for server in ${servers//|/ }; do
-                                               echo "  forward-addr: ${server}"
+                                               if [[ ${server} =~ ^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
+                                                       echo "  forward-addr: ${server}"
+                                               else
+                                                       echo "  forward-host: ${server}"
+                                               fi
                                        done
                                        echo
                                        ;;
@@ -499,11 +507,6 @@ case "$1" in
 
                eval $(/usr/local/bin/readhash /var/ipfire/ethernet/settings)
 
-               # Create control keys at first run
-               if [ ! -r "/etc/unbound/unbound_control.key" ]; then
-                       unbound-control-setup -d /etc/unbound &>/dev/null
-               fi
-
                # Update configuration files
                write_tuning_conf
                write_forward_conf