diff options
author | Steven Barth <steven@midlink.org> | 2008-11-30 13:19:45 +0000 |
---|---|---|
committer | Steven Barth <steven@midlink.org> | 2008-11-30 13:19:45 +0000 |
commit | b33943a6e8596c1ddfc1b771a995d3cf21e81cd6 (patch) | |
tree | 6f67cdea044e708a599a06712491b5c60db6f954 /libs/sgi-luci/root | |
parent | a7e7c31f8c659b55c1adb0863a8f2f66d3452d2b (diff) |
Merge LuCIttpd
Diffstat (limited to 'libs/sgi-luci/root')
-rwxr-xr-x | libs/sgi-luci/root/etc/init.d/luci-httpd | 22 | ||||
-rwxr-xr-x | libs/sgi-luci/root/usr/bin/luci-httpd | 31 | ||||
-rw-r--r-- | libs/sgi-luci/root/usr/lib/lucittpd/plugins/luci-webui.lua | 16 |
3 files changed, 16 insertions, 53 deletions
diff --git a/libs/sgi-luci/root/etc/init.d/luci-httpd b/libs/sgi-luci/root/etc/init.d/luci-httpd deleted file mode 100755 index ef61d7bac..000000000 --- a/libs/sgi-luci/root/etc/init.d/luci-httpd +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/sh /etc/rc.common -PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin -DAEMON=/usr/bin/luci-httpd -NAME=luci-httpd -DESC="HTTP server" -START=49 - -test -x $DAEMON || exit 0 - -set -e - -start() { - echo -n "Starting $DESC: $NAME" - start-stop-daemon -S -b -q -x $DAEMON - echo "." -} - -stop() { - echo -n "Stopping $DESC: $NAME" - start-stop-daemon -K -q -x $DAEMON - echo "." -} diff --git a/libs/sgi-luci/root/usr/bin/luci-httpd b/libs/sgi-luci/root/usr/bin/luci-httpd deleted file mode 100755 index 091e38b21..000000000 --- a/libs/sgi-luci/root/usr/bin/luci-httpd +++ /dev/null @@ -1,31 +0,0 @@ -#!/usr/bin/lua -require("luci.httpd") -require("luci.httpd.server") -require("luci.httpd.handler.file") -require("luci.httpd.handler.luci") - -DOCROOT = "/www" -PORT = 8080 - -collectgarbage("setpause", 150) - -serversocket = luci.httpd.Socket("0.0.0.0", PORT) - - -server = luci.httpd.server.Server() -vhost = luci.httpd.server.VHost() - -server:set_default_vhost(vhost) - - -filehandler = luci.httpd.handler.file.Simple(DOCROOT) -vhost:set_default_handler(filehandler) - -lucihandler = luci.httpd.handler.luci.Luci() -vhost:set_handler("/luci", lucihandler) - -io.stderr:write("Starting LuCI HTTPD on port " .. PORT .. "...\n") -io.stderr:write("Point your browser to http://localhost:" .. PORT .. "/luci\n") - -luci.httpd.register(serversocket, server:create_daemon_handlers()) -luci.httpd.run() diff --git a/libs/sgi-luci/root/usr/lib/lucittpd/plugins/luci-webui.lua b/libs/sgi-luci/root/usr/lib/lucittpd/plugins/luci-webui.lua new file mode 100644 index 000000000..f237b8538 --- /dev/null +++ b/libs/sgi-luci/root/usr/lib/lucittpd/plugins/luci-webui.lua @@ -0,0 +1,16 @@ +-- Initialize LuCI +function initialize() + pcall(function() + require "luci.dispatcher" + require "luci.uvl" + require "luci.cbi" + require "luci.template" + require "luci.json" + end) +end + +-- Register luci +function register() + local lucihnd = require "luci.ttpd.handler.luci" + httpd.server:get_default_vhost():set_handler("/luci", lucihnd.Luci()) +end
\ No newline at end of file |