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