Fix redirector
authorSteven Barth <steven@midlink.org>
Tue, 26 May 2009 17:44:27 +0000 (17:44 +0000)
committerSteven Barth <steven@midlink.org>
Tue, 26 May 2009 17:44:27 +0000 (17:44 +0000)
libs/lucid-http/luasrc/lucid/http/handler/catchall.lua
libs/lucid/hostfiles/etc/config/lucid
libs/lucid/luasrc/lucid.lua

index 0523751bc1c5a152ad48f84c360382097489a529..3b2c2b0a0cab11fb8a57269ca8c8d0c1521a95fe 100644 (file)
@@ -13,6 +13,7 @@ $Id$
 
 local srv = require "luci.lucid.http.server"
 local proto = require "luci.http.protocol"
+local util = require "luci.util"
 
 module "luci.lucid.http.handler.catchall"
 
index 5a732ac530788860cffd9e2a730638f6b72a7237..934faa10ed7016658df33e8352163cd25edb4a7f 100644 (file)
@@ -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
index 62741e79f5a3217a4e5f2ac1e9cb2dff8c5bd801..d72bf25ef9c6007f94c8067fe6adee506a2e6045 100644 (file)
@@ -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")))