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()
18 local ip = luci.ip.IPv4(client:getpeername())
19 luci.model.uci.foreach("network", "interface",
21 if section.ipaddr then
22 local net = luci.ip.IPv4(section.ipaddr, section.netmask)
23 if ip and net and net:contains(ip) then
31 client:send("HTTP/1.0 302 Found\r\nLocation: http://" .. srv ..
32 (arg[2] or "/luci/splash") .. "\r\n\r\n")