Changeset 42320


Ignore:
Timestamp:
2014-08-28T08:27:57+02:00 (3 years ago)
Author:
blogic
Message:

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@…>

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/package/network/services/dnsmasq/files/dnsmasq.init

    r42319 r42320  
    300300 
    301301        config_get mac "$cfg" mac 
    302         [ -z "$mac" ] && { 
     302        if [ -n "$mac" ]; then 
     303                # --dhcp-host=00:20:e0:3b:13:af,192.168.0.199,lap 
     304                macs="" 
     305                for m in $mac; do append macs "$m" ","; done 
     306        else 
     307                # --dhcp-host=lap,192.168.0.199 
    303308                [ -n "$name" ] || return 0 
    304                 mac="$name" 
     309                macs="$name" 
    305310                name="" 
    306         } 
    307  
    308         macs="" 
    309         for m in $mac; do append macs "$m" ","; done 
     311        fi 
    310312 
    311313        config_get tag "$cfg" tag 
Note: See TracChangeset for help on using the changeset viewer.