From b437cd58826ebb97ea127febfad6eed7eaa897f3 Mon Sep 17 00:00:00 2001 From: Mika Havela Date: Fri, 25 Jan 2008 07:34:08 +0000 Subject: More bugfixes caused by a missing or empty config-file git-svn-id: svn://svn.alpinelinux.org/acf/alpine-baselayout/trunk@646 ab2d0c66-481e-0410-8bed-d214d4d58bed --- syslog-controller.lua | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) (limited to 'syslog-controller.lua') diff --git a/syslog-controller.lua b/syslog-controller.lua index 77cd0ab..05ed0d3 100644 --- a/syslog-controller.lua +++ b/syslog-controller.lua @@ -18,23 +18,18 @@ function status(self) end function config(self) --- local srvcmdresult = nil --- local srvcmd = self.clientdata.srvcmd --- if (srvcmd ~= nil) then --- srvcmdresult = self.model:service_control(srvcmd) --- if (srvcmd == "stop") or (srvcmd == "restart") then --- posix.sleep(3) -- Wait for the process to start|stop --- else --- posix.sleep(1) -- Wait for the process to start|stop --- end --- end + + if ( self.clientdata.cmddaemon) then + startstop = self.model:startstop_service( self.clientdata.cmddaemon ) + end + local status = self.model.getstatus() local config, errors = self.model.getconfig() local url = ENV["SCRIPT_NAME"] .. self.conf.prefix .. self.conf.controller return { status = status, --- srvcmdresult = srvcmdresult, + startstop = startstop, config = config, errors = errors, url = url, } @@ -42,15 +37,21 @@ end function expert(self) local modifications = self.clientdata.modifications or "" - if ( modifications ~= "") then + if ( self.clientdata.cmdsave) then modifications = self.model:update_filecontent(modifications) end + if ( self.clientdata.cmddaemon) then + startstop = self.model:startstop_service( self.clientdata.cmddaemon ) + end + local status = self.model.getstatus() local url = ENV["SCRIPT_NAME"] .. self.conf.prefix .. self.conf.controller return { file = self.model:get_filedetails(), status = status, + startstop = startstop, + clientdata = self.clientdata, url = url, } end -- cgit v1.2.3