Handle unconfigured interfaces for dhcp-all-ifaces

On ubuntu, if an interface exists but is unconfigured then ifquery
$iface will return 0 but no output. This will cause dhcp-all-interfaces
to not attempt to dhcp on that interface.

Change-Id: Ic1532728ae9ca6d759714392f727d25b814ef336
This commit is contained in:
Gregory Haynes 2016-03-23 06:00:49 +00:00
parent 4f4fab979e
commit 6bdb810f38

View File

@ -56,7 +56,15 @@ function config_exists() {
return 0
fi
else
ifquery $interface >/dev/null 2>&1 && return 0 || return 1
if ifquery $interface >/dev/null 2>&1; then
if [ -z "$(ifquery $interface 2>&1)" ]; then
return 1
else
return 0
fi
else
return 1
fi
fi
return 1
}