applications/luci-wol: cope with host entries that have multiple MACs assigned
This commit is contained in:
parent
390da8e4b1
commit
224dc2daa2
1 changed files with 8 additions and 1 deletions
|
@ -72,8 +72,15 @@ end
|
||||||
uci:foreach("dhcp", "host",
|
uci:foreach("dhcp", "host",
|
||||||
function(s)
|
function(s)
|
||||||
if s.mac and s.ip then
|
if s.mac and s.ip then
|
||||||
|
if type(s.mac) == "table" then
|
||||||
|
local m
|
||||||
|
for _, m in ipairs(s.mac) do
|
||||||
|
arp[m:upper()] = { s.ip, s.name }
|
||||||
|
end
|
||||||
|
else
|
||||||
arp[s.mac:upper()] = { s.ip, s.name }
|
arp[s.mac:upper()] = { s.ip, s.name }
|
||||||
end
|
end
|
||||||
|
end
|
||||||
end)
|
end)
|
||||||
|
|
||||||
host = s:option(Value, "mac", translate("Host to wake up"),
|
host = s:option(Value, "mac", translate("Host to wake up"),
|
||||||
|
|
Loading…
Reference in a new issue