diff options
author | John Crispin <blogic@openwrt.org> | 2014-08-28 06:27:57 +0000 |
---|---|---|
committer | John Crispin <blogic@openwrt.org> | 2014-08-28 06:27:57 +0000 |
commit | 93a958ff1120b82373c3d3d3ee5dc5cc5b1867af (patch) | |
tree | 4299c9dd30404b50b7a79a799faf3a0af8e29ceb /package/network | |
parent | 2abc3f33e5b3e43e526a787f05ecd400af8122e0 (diff) | |
download | master-187ad058-93a958ff1120b82373c3d3d3ee5dc5cc5b1867af.tar.gz master-187ad058-93a958ff1120b82373c3d3d3ee5dc5cc5b1867af.tar.bz2 master-187ad058-93a958ff1120b82373c3d3d3ee5dc5cc5b1867af.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>
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@42320 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package/network')
-rw-r--r-- | package/network/services/dnsmasq/files/dnsmasq.init | 14 |
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 |