unbound: follow resolv.conf.auto to new location
authorEric Luehrsen <ericluehrsen@gmail.com>
Fri, 7 Aug 2020 04:03:36 +0000 (00:03 -0400)
committerEric Luehrsen <ericluehrsen@gmail.com>
Fri, 7 Aug 2020 05:30:52 +0000 (01:30 -0400)
Signed-off-by: Eric Luehrsen <ericluehrsen@gmail.com>
net/unbound/Makefile
net/unbound/files/defaults.sh
net/unbound/files/stopping.sh
net/unbound/files/unbound.sh

index fb773bdd07dce5a74991cb2954d2612dcb0e2091..f4f1cbae8214a7c2f2c46a0a37463134c6e64d01 100644 (file)
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=unbound
 PKG_VERSION:=1.11.0
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=https://nlnetlabs.nl/downloads/unbound
index c26511941d33e9b63da0ebefe331b00ed9f257f0..785631e3dd902eda7a88d2183b5c060e0c8d64cb 100644 (file)
@@ -20,17 +20,23 @@ UB_VARDIR=/var/lib/unbound
 UB_PIDFILE=/var/run/unbound.pid
 
 # conf deconstructed
-UB_TOTAL_CONF=$UB_VARDIR/unbound.conf
 UB_CORE_CONF=$UB_VARDIR/server.conf.tmp
 UB_HOST_CONF=$UB_VARDIR/host.conf.tmp
-UB_DHCP_CONF=$UB_VARDIR/dhcp.conf
 UB_ZONE_CONF=$UB_VARDIR/zone.conf.tmp
 UB_CTRL_CONF=$UB_VARDIR/ctrl.conf.tmp
 UB_SRVMASQ_CONF=$UB_VARDIR/dnsmasq_srv.conf.tmp
 UB_EXTMASQ_CONF=$UB_VARDIR/dnsmasq_ext.conf.tmp
+
+# conf as found
+UB_TOTAL_CONF=$UB_VARDIR/unbound.conf
+UB_DHCP_CONF=$UB_VARDIR/dhcp.conf
 UB_SRV_CONF=$UB_VARDIR/unbound_srv.conf
 UB_EXT_CONF=$UB_VARDIR/unbound_ext.conf
 
+# resolver file complex
+UB_RESOLV_CONF=/tmp/resolv.conf
+UB_RESOLV_AUTO=/tmp/resolv.conf.d/resolv.conf.auto
+
 # TLS keys
 UB_TLS_KEY_FILE="TLS server UCI not implemented"
 UB_TLS_PEM_FILE="TLS server UCI not implemented"
index 826a40ac668555d6feca3f368302ee4a337496ad..c3f27ecacbc22e8a1cdb00afae60e484c3e58193 100644 (file)
@@ -106,11 +106,11 @@ rootkey_update() {
 ##############################################################################
 
 resolv_teardown() {
-  case $( cat /tmp/resolv.conf ) in
+  case $( cat $UB_RESOLV_CONF ) in
     *"generated by Unbound UCI"*)
       # our resolver file, reset to auto resolver file.
-      rm -f /tmp/resolv.conf
-      ln -s /tmp/resolv.conf.auto /tmp/resolv.conf
+      rm -f $UB_RESOLV_CONF
+      ln -s $UB_RESOLV_AUTO $UB_RESOLV_CONF
       ;;
   esac
 }
index 788aa5dd95116c141ac40b9a81da13c68fbc27d6..0e2ebaf4dedcdc7116dad40c5ecee46da6620129 100644 (file)
@@ -161,7 +161,7 @@ bundle_wan_networks() {
 ##############################################################################
 
 bundle_resolv_conf_servers() {
-  local resolvers=$( awk '/nameserver/ { print $2 }' /tmp/resolv.conf.auto )
+  local resolvers=$( awk '/nameserver/ { print $2 }' $UB_RESOLV_AUTO )
   UB_LIST_ZONE_SERVERS="$UB_LIST_ZONE_SERVERS $resolvers"
 }
 
@@ -1527,14 +1527,14 @@ resolv_setup() {
 
   else
     # unbound listens on 127.0.0.1#53 so set resolver file to local.
-    rm -f /tmp/resolv.conf
+    rm -f $UB_RESOLV_CONF
 
     {
-      echo "# /tmp/resolv.conf generated by Unbound UCI $( date -Is )"
+      echo "# $UB_RESOLV_CONF generated by Unbound UCI $( date -Is )"
       echo "nameserver 127.0.0.1"
       echo "nameserver ::1"
       echo "search $UB_TXT_DOMAIN."
-    } > /tmp/resolv.conf
+    } > $UB_RESOLV_CONF
   fi
 }