if readethers is set to true make sure /etc/ethers exists, closes #6740
[openwrt.git] / package / dnsmasq / files / dnsmasq.init
index 0c038b7..d796f22 100644 (file)
@@ -90,6 +90,9 @@ dnsmasq() {
 
        config_get DOMAIN "$cfg" domain
 
+       config_get_bool readethers "$cfg" readethers
+       [ "$readethers" = "1" ] && [ -e "/etc/ethers" ] || touch /etc/ethers
+
        config_get leasefile $cfg leasefile
        [ -e "$leasefile" ] || touch "$leasefile"
        config_get_bool cachelocal "$cfg" cachelocal 1
@@ -176,13 +179,15 @@ dhcp_host_add() {
        config_get networkid "$cfg" networkid
        [ -n "$networkid" ] && dhcp_option_add "$cfg" "$networkid"
 
-       config_get mac "$cfg" mac
-       [ -n "$mac" ] || return 0
-
        config_get ip "$cfg" ip
        [ -n "$ip" ] || return 0
 
-       append args "--dhcp-host=$mac,${networkid:+net:$networkid,}$ip${name:+,$name}"
+       macs=""
+       config_get mac "$cfg" mac
+       for m in $mac; do append macs "$m" ","; done
+       [ -n "$macs" ] || return 0
+
+       append args "--dhcp-host=$macs,${networkid:+net:$networkid,}$ip${name:+,$name}"
 }
 
 dhcp_mac_add() {
This page took 0.02766 seconds and 4 git commands to generate.