Author: blogic
Date: 2014-09-01 15:22:08 +0200 (Mon, 01 Sep 2014)
New Revision: 42390

Modified:
   branches/barrier_breaker/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]>

Backport of r42320

Modified: 
branches/barrier_breaker/package/network/services/dnsmasq/files/dnsmasq.init
===================================================================
--- 
branches/barrier_breaker/package/network/services/dnsmasq/files/dnsmasq.init    
    2014-09-01 13:22:06 UTC (rev 42389)
+++ 
branches/barrier_breaker/package/network/services/dnsmasq/files/dnsmasq.init    
    2014-09-01 13:22:08 UTC (rev 42390)
@@ -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

Reply via email to