diff options
author | Steven Barth <steven@midlink.org> | 2008-06-29 14:42:53 +0000 |
---|---|---|
committer | Steven Barth <steven@midlink.org> | 2008-06-29 14:42:53 +0000 |
commit | ee324cb3a70d39dc9522a1ee63af12137d433533 (patch) | |
tree | 564544d3e6bff5e916d77a427bba6b1536ba7c94 /applications/luci-splash/root/usr/bin/luci-splashd | |
parent | 4c7df626b2a27e9bea4793c96929de17f38e7bd2 (diff) |
* applications/luci-splash: Rewrote luci-splash using an own daemon implementation
* Minor tweaks in luci.dispatcher
Diffstat (limited to 'applications/luci-splash/root/usr/bin/luci-splashd')
-rwxr-xr-x | applications/luci-splash/root/usr/bin/luci-splashd | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/applications/luci-splash/root/usr/bin/luci-splashd b/applications/luci-splash/root/usr/bin/luci-splashd new file mode 100755 index 0000000000..33391cc5bb --- /dev/null +++ b/applications/luci-splash/root/usr/bin/luci-splashd @@ -0,0 +1,20 @@ +#!/usr/bin/lua +require("socket") + +local server = socket.bind("0.0.0.0", arg[1] or 8082) +server:settimeout(0, "t") + +while true do + local client = server:accept() + + if client then + client:settimeout(1) + local srv = client:getsockname() + client:receive() + client:send("HTTP/1.0 302 Found\r\nLocation: http://" .. srv .. + (arg[2] or "/luci/splash") .. "\r\n\r\n") + client:close() + else + socket.sleep(0.1) + end +end |