From 95c444c539e787a218c85df1ee95a1a5508b8e84 Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Sun, 14 Sep 2008 00:34:39 +0000 Subject: * luci/app/ffwizard: sync olsr configuration --- .../luasrc/tools/ffwizard.lua | 32 +++++++++++----------- 1 file changed, 16 insertions(+), 16 deletions(-) (limited to 'applications/luci-ffwizard-leipzig/luasrc/tools/ffwizard.lua') diff --git a/applications/luci-ffwizard-leipzig/luasrc/tools/ffwizard.lua b/applications/luci-ffwizard-leipzig/luasrc/tools/ffwizard.lua index 60a240bf0..217cd44bb 100644 --- a/applications/luci-ffwizard-leipzig/luasrc/tools/ffwizard.lua +++ b/applications/luci-ffwizard-leipzig/luasrc/tools/ffwizard.lua @@ -32,35 +32,35 @@ end -- Deletes a network interface and all occurences of it in firewall zones and dhcp function network_remove_interface(iface) local cursor = uci.cursor() - + if not cursor:delete("network", iface) then return false end local aliases = {iface} - cursor:foreach("network", "alias", + cursor:foreach("network", "alias", function(section) if section.interface == iface then table.insert(aliases, section[".name"]) end end) - + -- Delete Aliases and Routes cursor:delete_all("network", "route", {interface=iface}) cursor:delete_all("network", "alias", {interface=iface}) - + -- Delete DHCP sections cursor:delete_all("dhcp", "dhcp", function(section) return util.contains(aliases, section.interface) end) - + -- Remove OLSR sections - cursor:delete_all("olsr", "Interface", {Interface=iface}) - + cursor:delete_all("olsrd", "Interface", {Interface=iface}) + -- Remove Splash sections cursor:delete_all("luci-splash", "iface", {network=iface}) - + cursor:save("network") cursor:save("olsr") cursor:save("dhcp") @@ -115,14 +115,14 @@ end -- Finds the firewall zone with given name function firewall_find_zone(name) local find - - uci.cursor():foreach("firewall", "zone", + + uci.cursor():foreach("firewall", "zone", function (section) if section.name == name then find = section[".name"] end end) - + return find end @@ -135,15 +135,15 @@ function remove_list_entry(value, entry) if type(value) == "nil" then return nil end - + local result = type(value) == "table" and value or util.split(value, " ") local key = util.contains(result, entry) - + while key do table.remove(result, key) key = util.contains(result, entry) end - + result = type(value) == "table" and result or table.concat(result, " ") - return result ~= value and result -end \ No newline at end of file + return result ~= value and result +end -- cgit v1.2.3