Author: blogic Date: 2014-08-28 08:27:57 +0200 (Thu, 28 Aug 2014) New Revision: 42320
Modified: trunk/package/network/services/dnsmasq/files/dnsmasq.init Log: 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 <[email protected]> Modified: trunk/package/network/services/dnsmasq/files/dnsmasq.init =================================================================== --- trunk/package/network/services/dnsmasq/files/dnsmasq.init 2014-08-28 06:27:53 UTC (rev 42319) +++ trunk/package/network/services/dnsmasq/files/dnsmasq.init 2014-08-28 06:27:57 UTC (rev 42320) @@ -299,15 +299,17 @@ } 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="" - } + fi - macs="" - for m in $mac; do append macs "$m" ","; done - config_get tag "$cfg" tag config_get_bool broadcast "$cfg" broadcast 0 _______________________________________________ openwrt-commits mailing list [email protected] https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-commits
