summaryrefslogtreecommitdiffhomepage
path: root/libs/lucid
diff options
context:
space:
mode:
authorSteven Barth <steven@midlink.org>2009-05-26 17:44:27 +0000
committerSteven Barth <steven@midlink.org>2009-05-26 17:44:27 +0000
commit73eae62580d4f78ade009415ba6533f502f29e5e (patch)
treedcde6a5b74330a44176fdb7d7436488ebf3caba3 /libs/lucid
parentf7deae100d6d36c1e8d6fef17316ca03aaf7214c (diff)
Fix redirector
Diffstat (limited to 'libs/lucid')
-rw-r--r--libs/lucid/hostfiles/etc/config/lucid15
-rw-r--r--libs/lucid/luasrc/lucid.lua11
2 files changed, 25 insertions, 1 deletions
diff --git a/libs/lucid/hostfiles/etc/config/lucid b/libs/lucid/hostfiles/etc/config/lucid
index 5a732ac530..934faa10ed 100644
--- a/libs/lucid/hostfiles/etc/config/lucid
+++ b/libs/lucid/hostfiles/etc/config/lucid
@@ -58,4 +58,17 @@ config daemon rpc
option slave rpcd
list address 12900
list publisher mainrpc
- option enabled 1 \ No newline at end of file
+ option enabled 1
+
+config 'daemon' 'splashr'
+ option 'slave' 'httpd'
+ list 'address' '8082'
+ list 'publisher' 'splashredir'
+ option 'enabled' '1'
+
+config 'Redirector' 'splashredir'
+ option 'name' 'Splashd'
+ option 'virtual' '/'
+ option 'physical' ':80/luci/splash'
+
+ \ No newline at end of file
diff --git a/libs/lucid/luasrc/lucid.lua b/libs/lucid/luasrc/lucid.lua
index 62741e79f5..d72bf25ef9 100644
--- a/libs/lucid/luasrc/lucid.lua
+++ b/libs/lucid/luasrc/lucid.lua
@@ -54,9 +54,20 @@ function start()
end
end
+ state:set(UCINAME, "main", "pid", nixio.getpid())
+ state:save(UCINAME)
+
run()
end
+function stop()
+ local pid = tonumber(state:get(UCINAME, "main", "pid"))
+ if pid then
+ return nixio.kill(pid, nixio.const.SIGTERM)
+ end
+ return false
+end
+
function prepare()
local debug = tonumber((cursor:get(UCINAME, "main", "debug")))