Browse Source

Merge pull request #13045 from EricLuehrsen/unbound_20200806

unbound: follow resolv.conf.auto to new location
lilik-openwrt-22.03
Rosen Penev 4 years ago
committed by GitHub
parent
commit
7d2f49239d
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 16 additions and 10 deletions
  1. +1
    -1
      net/unbound/Makefile
  2. +8
    -2
      net/unbound/files/defaults.sh
  3. +3
    -3
      net/unbound/files/stopping.sh
  4. +4
    -4
      net/unbound/files/unbound.sh

+ 1
- 1
net/unbound/Makefile View 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


+ 8
- 2
net/unbound/files/defaults.sh View 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"


+ 3
- 3
net/unbound/files/stopping.sh View 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
}


+ 4
- 4
net/unbound/files/unbound.sh View 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
}


Loading…
Cancel
Save