applications/luci-ffwizard-leipzig: use luci.sys.hostname() to update hostname
[project/luci.git] / applications / luci-ffwizard-leipzig / luasrc / model / cbi / ffwizard.lua
index af67881d06fc5286add10e8706b1a94dc99c7694..526913c07a9a165e3356a303ba78c104c63dbd08 100644 (file)
@@ -245,7 +245,7 @@ function main.write(self, section, value)
                                uci:set("system", s['.name'], "hostname", new_hostname)
                        end)
 
-               luci.fs.writefile( "/proc/sys/kernel/hostname", new_hostname.."\n" )
+               sys.hostname(new_hostname)
                uci:save("system")
        end
 end
@@ -296,11 +296,14 @@ end
 
 function share.write(self, section, value)
        uci:delete_all("firewall", "forwarding", {src="freifunk", dest="wan"})
+       uci:delete_all("olsrd", "LoadPlugin", {library="olsrd_dyn_gw_plain.so.0.4"})
 
        if value == "1" then
                uci:section("firewall", "forwarding", nil, {src="freifunk", dest="wan"})
+               uci:section("olsrd", "LoadPlugin", nil, {library="olsrd_dyn_gw_plain.so.0.4"})
        end
        uci:save("firewall")
+       uci:save("olsrd")
 end