From 264a35ad5a5c5a22e3cb14190826d200c2b66ab2 Mon Sep 17 00:00:00 2001 From: Mika Havela Date: Wed, 5 Dec 2007 11:06:13 +0000 Subject: Working on start|stop of the service (start|stop doesn't work at this point... And I don't know why) git-svn-id: svn://svn.alpinelinux.org/acf/openntpd/trunk@409 ab2d0c66-481e-0410-8bed-d214d4d58bed --- openntpd-controller.lua | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'openntpd-controller.lua') diff --git a/openntpd-controller.lua b/openntpd-controller.lua index d298b1d..06b53b2 100644 --- a/openntpd-controller.lua +++ b/openntpd-controller.lua @@ -18,7 +18,14 @@ end read = function (self) - return ( {filecontent = self.model:get(), url = ENV["SCRIPT_NAME"] .. self.conf.prefix .. self.conf.controller } ) + local cmd = self.clientdata.cmd + if ( cmd == "start" ) then + return ( {filecontent = self.model:get(), startup = self.model:startstop_service( cmd ), shutdown = "", url = ENV["SCRIPT_NAME"] .. self.conf.prefix .. self.conf.controller } ) + elseif ( cmd == "stop" ) then + return ( {filecontent = self.model:get(), shutdown = self.model:startstop_service( cmd ), startup = "", url = ENV["SCRIPT_NAME"] .. self.conf.prefix .. self.conf.controller } ) + else + return ( {filecontent = self.model:get(), shutdown = "" , startup = "", url = ENV["SCRIPT_NAME"] .. self.conf.prefix .. self.conf.controller } ) + end end advanced = function (self) -- cgit v1.2.3