From: Jo-Philipp Wich Date: Sat, 9 May 2009 15:53:09 +0000 (+0000) Subject: luci-0.8: merge r4493 X-Git-Tag: 0.8.7~42 X-Git-Url: http://git.openwrt.org/?p=project%2Fluci.git;a=commitdiff_plain;h=ef4275b89bedf6c6ec3872a5462c5c0876c3afb0 luci-0.8: merge r4493 --- diff --git a/applications/luci-ffwizard-leipzig/luasrc/model/cbi/ffwizard.lua b/applications/luci-ffwizard-leipzig/luasrc/model/cbi/ffwizard.lua index fe5a009a5f..fa88f01507 100644 --- a/applications/luci-ffwizard-leipzig/luasrc/model/cbi/ffwizard.lua +++ b/applications/luci-ffwizard-leipzig/luasrc/model/cbi/ffwizard.lua @@ -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) - luci.fs.writefile( "/proc/sys/kernel/hostname", new_hostname.."\n" ) - uci:save("system") - end + uci:save("system") end