From 7384e0e6b77518efa4d113ede46f8c107de6f604 Mon Sep 17 00:00:00 2001 From: Steven Barth Date: Thu, 24 Jul 2008 13:55:11 +0000 Subject: Rewrote host environment targets to work out of the box --- libs/httpd/host/runluci | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'libs/httpd/host') diff --git a/libs/httpd/host/runluci b/libs/httpd/host/runluci index 1d5812679e..6f6cdde3df 100755 --- a/libs/httpd/host/runluci +++ b/libs/httpd/host/runluci @@ -4,19 +4,25 @@ require("luci.httpd.server") require("luci.httpd.handler.file") require("luci.httpd.handler.luci") -DOCROOT = arg[1] +SYSROOT = arg[1] +DOCROOT = SYSROOT .. arg[2] 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) +if pcall(require, "uci") and pcall(require, "luci.model.uci") then + luci.model.uci.confdir_default = SYSROOT .. luci.model.uci.confdir_default + luci.model.uci.savedir_state = SYSROOT .. luci.model.uci.savedir_state + luci.model.uci.set_confdir(luci.model.uci.confdir_default) +end + filehandler = luci.httpd.handler.file.Simple(DOCROOT) vhost:set_default_handler(filehandler) -- cgit v1.2.3