unbound: don't use unitialised vars when UNBOUND_D_DHCP_LINK != odhcpd 5990/head
authorPeter Wagner <tripolar@gmx.at>
Tue, 1 May 2018 11:56:26 +0000 (13:56 +0200)
committerPeter Wagner <tripolar@gmx.at>
Tue, 1 May 2018 12:05:30 +0000 (14:05 +0200)
Signed-off-by: Peter Wagner <tripolar@gmx.at>
net/unbound/Makefile
net/unbound/files/unbound.sh

index 3e59c4c6e46185a5918f36b444645dd9432cb5aa..92cd648cd8f7dec24c8f4736526e649221d1648a 100644 (file)
@@ -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
index 4b472ec3416dd1fe8cf8d0faeb5cefe40d4c7ded..002ce9fa48549360da79609d99f9e36e1ec2b949 100644 (file)
@@ -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 )