local type, pairs, ipairs, table, luci, math
= type, pairs, ipairs, table, luci, math
-local lmo = require "lmo"
+local tpl = require "luci.template.parser"
local utl = require "luci.util"
local uci = require "luci.model.uci"
if uci_r:get("firewall", n) == "zone" then
local z = uci_r:get("firewall", n, "name")
- r = uci_r:delete("firwall", n)
+ r = uci_r:delete("firewall", n)
n = z
else
uci_r:foreach("firewall", "zone",
uci_r:foreach("firewall", "redirect",
function(s)
- if s.src == n then
+ if s.src == n or s.dest == n then
uci_r:delete("firewall", s['.name'])
end
end)
uci_r:foreach("firewall", "forwarding",
function(s)
- if s.src == n then
+ if s.src == n or s.dest == n then
uci_r:delete("firewall", s['.name'])
end
end)
elseif self and self:name() == "wan" then
return "#f09090"
elseif self then
- math.randomseed(lmo.hash(self:name()))
+ math.randomseed(tpl.hash(self:name()))
local r = math.random(128)
local g = math.random(128)