diff options
author | Peter Wagner <tripolar@gmx.at> | 2018-05-01 13:56:26 +0200 |
---|---|---|
committer | Peter Wagner <tripolar@gmx.at> | 2018-05-01 14:05:30 +0200 |
commit | 14bc5b015a406943ad0b5cb678d9772419d1b780 (patch) | |
tree | d2c36e91208c0e11efef926f979e1d4d46518ee0 /net/unbound/files | |
parent | 3c7d2ae182e4e7c8ae782c850c9b63d70c79ca14 (diff) |
unbound: don't use unitialised vars when UNBOUND_D_DHCP_LINK != odhcpd
Signed-off-by: Peter Wagner <tripolar@gmx.at>
Diffstat (limited to 'net/unbound/files')
-rw-r--r-- | net/unbound/files/unbound.sh | 14 |
1 files changed, 8 insertions, 6 deletions
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 ) |