applications/luci-ffwizard-leipzig: set crond less verbose
[oweals/luci.git] / applications / luci-ffwizard-leipzig / luasrc / model / cbi / ffwizard.lua
index 4eeb92b01d724f071b1f4b2ea80f24039d26d470..fa88f015070d90f385611e8f7a157ff1055634fe 100644 (file)
@@ -235,19 +235,22 @@ function main.write(self, section, value)
        tools.firewall_zone_add_interface("freifunk", device)
 
 
-       -- Set hostname
        local new_hostname = ip:gsub("%.", "-")
        local old_hostname = sys.hostname()
 
-       if old_hostname == "OpenWrt" or old_hostname:match("^%d+-%d+-%d+-%d+$") then
-               uci:foreach("system", "system",
-                       function(s)
+       uci:foreach("system", "system",
+               function(s)
+                       -- Make crond silent
+                       uci:set("system", s['.name'], "cronloglevel", "10")
+
+                       -- Set hostname
+                       if old_hostname == "OpenWrt" or old_hostname:match("^%d+-%d+-%d+-%d+$") then
                                uci:set("system", s['.name'], "hostname", new_hostname)
-                       end)
+                               sys.hostname(new_hostname)
+                       end
+               end)
 
-               sys.hostname(new_hostname)
-               uci:save("system")
-       end
+       uci:save("system")
 end
 
 
@@ -262,19 +265,6 @@ function olsr.write(self, section, value)
        local community = net:formvalue(section)
        local external  = community and uci:get("freifunk", community, "external") or ""
 
-       -- Configure nameservice
-       local hostname
-       uci:foreach("system", "system", function(s) hostname = s.hostname end)
-
-       if hostname then
-               uci:foreach("olsrd", "LoadPlugin",
-                       function(s)
-                               if s.library == "olsrd_nameservice.so.0.3" then
-                                       uci:set("olsrd", s['.name'], "name", hostname)
-                               end
-                       end)
-       end
-
        -- Delete old interface
        uci:delete_all("olsrd", "Interface", {interface=device})
 
@@ -360,6 +350,7 @@ function client.write(self, section, value)
        dhcpbase.interface = device .. "dhcp"
        dhcpbase.start = dhcpbeg
        dhcpbase.limit = limit
+       dhcpbase.force = 1
 
        uci:section("dhcp", "dhcp", device .. "dhcp", dhcpbase)
        uci:save("dhcp")
@@ -400,7 +391,7 @@ function client.write(self, section, value)
                target="ACCEPT"
        })
 
-
+       uci:save("firewall")
 
        -- Delete old splash
        uci:delete_all("luci_splash", "iface", {network=device.."dhcp", zone="freifunk"})