X-Git-Url: http://git.archive.openwrt.org/?p=project%2Fluci.git;a=blobdiff_plain;f=modules%2Fluci-base%2Fluasrc%2Fsys.lua;h=ae3565245d7cf99ce65297847a27beeba75b8935;hp=a1b5b8f645660388aa04c8da5f1c594b26c58eed;hb=f779b00d883f965e405944f3c872b5ee763836e7;hpb=63d70daae1921d9f5a92cf2221ca4f1601c78ef5 diff --git a/modules/luci-base/luasrc/sys.lua b/modules/luci-base/luasrc/sys.lua index a1b5b8f64..ae3565245 100644 --- a/modules/luci-base/luasrc/sys.lua +++ b/modules/luci-base/luasrc/sys.lua @@ -185,14 +185,18 @@ local function _nethints(what, callback) end end - if fs.access("/var/dhcp.leases") then - for e in io.lines("/var/dhcp.leases") do - mac, ip, name = e:match("^%d+ (%S+) (%S+) (%S+)") - if mac and ip then - _add(what, mac:upper(), ip, nil, name ~= "*" and name) + cur:foreach("dhcp", "dnsmasq", + function(s) + if s.leasefile and fs.access(s.leasefile) then + for e in io.lines(s.leasefile) do + mac, ip, name = e:match("^%d+ (%S+) (%S+) (%S+)") + if mac and ip then + _add(what, mac:upper(), ip, nil, name ~= "*" and name) + end + end end end - end + ) cur:foreach("dhcp", "host", function(s)