- for k, v in pairs(uci:sections("luci_splash")) do
- if v[".type"] == "lease" and v.mac:lower() == mac then
- remove_rule(mac)
- uci:del("luci_splash", k)
- end
+ uci.foreach("luci_splash", "lease",
+ function (section)
+ if section.mac:lower() == mac then
+ table.insert(del, section[".name"])
+ end
+ end)
+
+ for i,j in ipairs(del) do
+ remove_rule(j)
+ uci.delete("luci_splash", j)