* Fixed a bug in Luci-Splash
This commit is contained in:
parent
37caa67aaa
commit
0092df3d17
1 changed files with 7 additions and 2 deletions
|
@ -73,15 +73,20 @@ end
|
||||||
-- Remove a lease from state and invoke remove_rule
|
-- Remove a lease from state and invoke remove_rule
|
||||||
function remove_lease(mac)
|
function remove_lease(mac)
|
||||||
mac = mac:lower()
|
mac = mac:lower()
|
||||||
|
local del = {}
|
||||||
|
|
||||||
uci.foreach("luci_splash", "lease",
|
uci.foreach("luci_splash", "lease",
|
||||||
function (section)
|
function (section)
|
||||||
if section.mac:lower() == mac then
|
if section.mac:lower() == mac then
|
||||||
remove_rule(mac)
|
table.insert(del, section[".name"])
|
||||||
uci.delete("luci_splash", section[".name"])
|
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
for i,j in ipairs(del) do
|
||||||
|
remove_rule(j)
|
||||||
|
uci.delete("luci_splash", j)
|
||||||
|
end
|
||||||
|
|
||||||
uci.save()
|
uci.save()
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue