From 14bc5b015a406943ad0b5cb678d9772419d1b780 Mon Sep 17 00:00:00 2001 From: Peter Wagner Date: Tue, 1 May 2018 13:56:26 +0200 Subject: [PATCH] unbound: don't use unitialised vars when UNBOUND_D_DHCP_LINK != odhcpd Signed-off-by: Peter Wagner --- net/unbound/Makefile | 2 +- net/unbound/files/unbound.sh | 14 ++++++++------ 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/net/unbound/Makefile b/net/unbound/Makefile index 3e59c4c6e..92cd648cd 100644 --- a/net/unbound/Makefile +++ b/net/unbound/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=unbound PKG_VERSION:=1.7.0 -PKG_RELEASE:=2 +PKG_RELEASE:=3 PKG_LICENSE:=BSD-3-Clause PKG_LICENSE_FILES:=LICENSE diff --git a/net/unbound/files/unbound.sh b/net/unbound/files/unbound.sh index 4b472ec34..002ce9fa4 100644 --- a/net/unbound/files/unbound.sh +++ b/net/unbound/files/unbound.sh @@ -408,16 +408,18 @@ bundle_private_interface() { ############################################################################## unbound_mkdir() { - local dhcp_origin=$( uci_get dhcp.@odhcpd[0].leasefile ) - local dhcp_dir=$( dirname $dhcp_origin ) local filestuff + if [ "$UNBOUND_D_DHCP_LINK" = "odhcpd" ] ; then + local dhcp_origin=$( uci_get dhcp.@odhcpd[0].leasefile ) + local dhcp_dir=$( dirname $dhcp_origin ) - if [ "$UNBOUND_D_DHCP_LINK" = "odhcpd" -a ! -d "$dhcp_dir" ] ; then - # make sure odhcpd has a directory to write (not done itself, yet) - mkdir -p "$dhcp_dir" - fi + if [ ! -d "$dhcp_dir" ] ; then + # make sure odhcpd has a directory to write (not done itself, yet) + mkdir -p "$dhcp_dir" + fi + fi if [ -f $UNBOUND_KEYFILE ] ; then filestuff=$( cat $UNBOUND_KEYFILE )