3 require("luci.model.uci")
5 luci.model.uci.set_savedir(luci.model.uci.savedir_state)
7 local server = socket.bind("0.0.0.0", arg[1] or 8082)
8 server:settimeout(0, "t")
11 local client = server:accept()
15 local ip = client:getpeername()
17 luci.model.uci.foreach("network", "interface",
19 if section.ipaddr then
20 local p = luci.sys.net.mask4prefix(section.netmask)
21 if luci.sys.net.belongs(ip, section.ipaddr, p) then
29 client:send("HTTP/1.0 302 Found\r\nLocation: http://" .. srv ..
30 (arg[2] or "/luci/splash") .. "\r\n\r\n")