Fixed a few FF-Wizard issues
authorSteven Barth <steven@midlink.org>
Fri, 5 Sep 2008 23:43:18 +0000 (23:43 +0000)
committerSteven Barth <steven@midlink.org>
Fri, 5 Sep 2008 23:43:18 +0000 (23:43 +0000)
applications/luci-ffwizard-leipzig/luasrc/model/cbi/ffwizard.lua
applications/luci-ffwizard-leipzig/luasrc/tools/ffwizard.lua

index cd737c9854478b41add76e564fbb4f9f0d530d6a..5245a92f150537d75e6224e1ba47069ac2854299 100644 (file)
@@ -141,8 +141,11 @@ function main.write(self, section, value)
        
        
        -- Cleanup
+       luci.util.perror("1")
        tools.wifi_delete_ifaces(device)
+       luci.util.perror("2")
        tools.network_remove_interface(device)
+       luci.util.perror("3")
        tools.firewall_zone_remove_interface("freifunk", device)
                
        
index d679cc93edfae5c637a2fa598160ce32e7dda7d4..bb7cbb83454d8839e864acb9197afcb7b8a4c50f 100644 (file)
@@ -18,6 +18,7 @@ local uci = require "luci.model.uci"
 local util = require "luci.util"
 local table = require "table"
 
+local type = type
 
 module "luci.tools.ffwizard"
 
@@ -39,11 +40,14 @@ function network_remove_interface(iface)
        local aliases = {iface}
        cursor:foreach("network", "alias", 
                function(section)
-                       table.insert(aliases, section[".name"])
+                       if section.interface == iface then
+                               table.insert(aliases, section[".name"])
+                       end
                end)
        
        -- Delete Aliases and Routes
-       cursor:delete_all("network", nil, {interface=iface})
+       cursor:delete_all("network", "route", {interface=iface})
+       cursor:delete_all("network", "alias", {interface=iface})
        
        -- Delete DHCP sections
        cursor:delete_all("dhcp", "dhcp",