aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn Crispin <john@openwrt.org>2014-08-28 06:27:57 +0000
committerJohn Crispin <john@openwrt.org>2014-08-28 06:27:57 +0000
commitf65ff468f760b982ab2257c7eb4cee3cff05a28e (patch)
treeef5fd136f0343cf69fc365824bad8c5ae8d17705
parent504620931254f4a484b089f593ca631339373152 (diff)
downloadupstream-f65ff468f760b982ab2257c7eb4cee3cff05a28e.tar.gz
upstream-f65ff468f760b982ab2257c7eb4cee3cff05a28e.tar.bz2
upstream-f65ff468f760b982ab2257c7eb4cee3cff05a28e.zip
dnsmasq: Make the --dhcp-host logic easier to understand
Use an if/else statement to cover the two different syntaxes. Add comments explaining what the end results should look like. This patch should not change the script's output. Signed-off-by: Kevin Cernekee <cernekee@gmail.com> SVN-Revision: 42320
-rw-r--r--package/network/services/dnsmasq/files/dnsmasq.init14
1 files changed, 8 insertions, 6 deletions
diff --git a/package/network/services/dnsmasq/files/dnsmasq.init b/package/network/services/dnsmasq/files/dnsmasq.init
index 06d8c840fb..942acd7ada 100644
--- a/package/network/services/dnsmasq/files/dnsmasq.init
+++ b/package/network/services/dnsmasq/files/dnsmasq.init
@@ -299,14 +299,16 @@ dhcp_host_add() {
}
config_get mac "$cfg" mac
- [ -z "$mac" ] && {
+ if [ -n "$mac" ]; then
+ # --dhcp-host=00:20:e0:3b:13:af,192.168.0.199,lap
+ macs=""
+ for m in $mac; do append macs "$m" ","; done
+ else
+ # --dhcp-host=lap,192.168.0.199
[ -n "$name" ] || return 0
- mac="$name"
+ macs="$name"
name=""
- }
-
- macs=""
- for m in $mac; do append macs "$m" ","; done
+ fi
config_get tag "$cfg" tag