* Fixed a bug in CBI throwing an error if a config section gets deleted
authorSteven Barth <steven@midlink.org>
Tue, 22 Apr 2008 14:37:20 +0000 (14:37 +0000)
committerSteven Barth <steven@midlink.org>
Tue, 22 Apr 2008 14:37:20 +0000 (14:37 +0000)
* Fixed automatic restart of olsrd while applying OLSR configuration

core/contrib/uci/luci
core/src/ffluci/cbi.lua

index 7cc08215af230a3834bfcc2a4da45f08b3a58af6..10a05bdeeaf5810a3d76dfa846cb515d74b336bf 100644 (file)
@@ -17,7 +17,7 @@ config extern flash_keep
 config event uci_oncommit
         option network "/etc/init.d/network restart"
         option wireless        "/etc/init.d/network restart"
-        option olsrd   "/etc/init.d/olsrd restart"
+        option olsr            "/etc/init.d/olsrd restart"
         option dhcp            "/etc/init.d/dnsmasq restart"
         option luci_fw  "/etc/init.d/luci_fw restart"
         option dropbear "/etc/init.d/dropbear restart"
index 435977a1720e50c92ce0de0cfa4219f292e6fd42..f09d48ad7a27c3eab7c02a645f8e5a6e5da55096 100644 (file)
@@ -178,6 +178,11 @@ function Map.del(self, section, option)
                        self.ucidata[section][option] = nil
                else
                        self.ucidata[section] = nil
+                       for i, k in ipairs(self.ucidata[".order"]) do
+                               if section == k then
+                                       table.remove(self.ucidata[".order"], i)
+                               end
+                       end
                end
        end
        return stat