+ for _, r in ipairs(ipt:find({table="filter", chain="luci_splash_counter"})) do
+ if r.options and #r.options >= 2 and r.options[1] == "MAC" and
+ r.options[2]:lower() == mac:lower()
+ then
+ os.execute("iptables -D luci_splash_counter -m mac --mac-source %q -j %s"
+ %{ mac, r.target })
+ end
+ end
+
+ for _, r in ipairs(ipt:find({table="nat", chain="luci_splash_leases"})) do
+ if r.options and #r.options >= 2 and r.options[1] == "MAC" and
+ r.options[2]:lower() == mac:lower()
+ then
+ os.execute("iptables -t nat -D luci_splash_leases -m mac --mac-source %q -j %s"
+ %{ mac, r.target })
+ end
+ end
+
+ ipt:resync()