summaryrefslogtreecommitdiffstats
path: root/syslog-controller.lua
diff options
context:
space:
mode:
authorMika Havela <mika.havela@gmail.com>2008-01-24 16:48:28 +0000
committerMika Havela <mika.havela@gmail.com>2008-01-24 16:48:28 +0000
commit7b5422d3943e6243d3b48da4f24cc024c01e49bb (patch)
tree1deb2b2e9d47a3f43a54f7b0140baa6cb8958315 /syslog-controller.lua
parent4aaf7226430f480eb75e3653958d2f1f448fc186 (diff)
downloadacf-alpine-baselayout-7b5422d3943e6243d3b48da4f24cc024c01e49bb.tar.bz2
acf-alpine-baselayout-7b5422d3943e6243d3b48da4f24cc024c01e49bb.tar.xz
Fixed so that acf doesnt brake if the confi-file is missing or is empty
git-svn-id: svn://svn.alpinelinux.org/acf/alpine-baselayout/trunk@641 ab2d0c66-481e-0410-8bed-d214d4d58bed
Diffstat (limited to 'syslog-controller.lua')
-rw-r--r--syslog-controller.lua12
1 files changed, 10 insertions, 2 deletions
diff --git a/syslog-controller.lua b/syslog-controller.lua
index 288ae7b..77cd0ab 100644
--- a/syslog-controller.lua
+++ b/syslog-controller.lua
@@ -1,9 +1,17 @@
module(..., package.seeall)
-mvc = {}
-function mvc.on_load(self)
+local list_redir = function (self)
+ self.conf.action = "status"
+ self.conf.type = "redir"
+ error (self.conf)
end
+mvc = {}
+mvc.on_load = function(self, parent)
+ if (self.worker[self.conf.action] == nil ) or ( self.conf.action == "init" ) then
+ self.worker[self.conf.action] = list_redir(self)
+ end
+end
function status(self)
return { status=self.model.getstatus() }