From 73eae62580d4f78ade009415ba6533f502f29e5e Mon Sep 17 00:00:00 2001 From: Steven Barth Date: Tue, 26 May 2009 17:44:27 +0000 Subject: [PATCH] Fix redirector --- .../luasrc/lucid/http/handler/catchall.lua | 1 + libs/lucid/hostfiles/etc/config/lucid | 15 ++++++++++++++- libs/lucid/luasrc/lucid.lua | 11 +++++++++++ 3 files changed, 26 insertions(+), 1 deletion(-) diff --git a/libs/lucid-http/luasrc/lucid/http/handler/catchall.lua b/libs/lucid-http/luasrc/lucid/http/handler/catchall.lua index 0523751bc..3b2c2b0a0 100644 --- a/libs/lucid-http/luasrc/lucid/http/handler/catchall.lua +++ b/libs/lucid-http/luasrc/lucid/http/handler/catchall.lua @@ -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" diff --git a/libs/lucid/hostfiles/etc/config/lucid b/libs/lucid/hostfiles/etc/config/lucid index 5a732ac53..934faa10e 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 62741e79f..d72bf25ef 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"))) -- 2.25.1