diff options
author | Mika Havela <mika.havela@gmail.com> | 2008-01-25 07:34:08 +0000 |
---|---|---|
committer | Mika Havela <mika.havela@gmail.com> | 2008-01-25 07:34:08 +0000 |
commit | b437cd58826ebb97ea127febfad6eed7eaa897f3 (patch) | |
tree | d3824268010ff56532a35723519a2f7ed3efadf5 /syslog-controller.lua | |
parent | 0f852344dc6758605321bccec501d0c26c6e4c6f (diff) | |
download | acf-alpine-baselayout-b437cd58826ebb97ea127febfad6eed7eaa897f3.tar.bz2 acf-alpine-baselayout-b437cd58826ebb97ea127febfad6eed7eaa897f3.tar.xz |
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
Diffstat (limited to 'syslog-controller.lua')
-rw-r--r-- | syslog-controller.lua | 25 |
1 files changed, 13 insertions, 12 deletions
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 |