1 local cursor = require "luci.model.uci".cursor()
7 d:add("general1", load("niu/system/general1"))
14 local pw1 = cursor:get("luci", "main", "_pw1")
15 if pw1 and pw1 ~= "**********" then
16 cursor:delete("luci", "main", "_pw1")
17 require "luci.sys".user.setpasswd("root", pw1)
20 local hn = cursor:get("luci", "main", "_uniquename")
22 cursor:foreach("system", "system", function(s)
23 cursor:set("system", s[".name"], "hostname", hn)
25 cursor:commit("system")
27 require "nixio.fs".writefile("/proc/sys/kernel/hostname", hn)
28 cursor:delete("luci", "main", "_uniquename")