diff options
author | Jo-Philipp Wich <jow@openwrt.org> | 2008-09-14 00:34:39 +0000 |
---|---|---|
committer | Jo-Philipp Wich <jow@openwrt.org> | 2008-09-14 00:34:39 +0000 |
commit | 95c444c539e787a218c85df1ee95a1a5508b8e84 (patch) | |
tree | e285137ffb6ca51f50a8f93b87fca6813a878f4a /applications/luci-ffwizard-leipzig/luasrc/tools/ffwizard.lua | |
parent | b3cab35609ebf400f9741bf44764cc7019fb3556 (diff) |
* luci/app/ffwizard: sync olsr configuration
Diffstat (limited to 'applications/luci-ffwizard-leipzig/luasrc/tools/ffwizard.lua')
-rw-r--r-- | applications/luci-ffwizard-leipzig/luasrc/tools/ffwizard.lua | 32 |
1 files changed, 16 insertions, 16 deletions
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 |