summaryrefslogtreecommitdiffstats
path: root/shorewall-controller.lua
diff options
context:
space:
mode:
authorMika Havela <mika.havela@gmail.com>2007-11-30 16:41:55 +0000
committerMika Havela <mika.havela@gmail.com>2007-11-30 16:41:55 +0000
commit2beb00dd81c1f2dceeef0e62cf89d2d1b1109b6a (patch)
tree01f636fa19ea255f602bdb4d622e9078f74beeb7 /shorewall-controller.lua
parent3a4f180a70063a185a8eab0e1409b255f0762861 (diff)
downloadacf-shorewall-2beb00dd81c1f2dceeef0e62cf89d2d1b1109b6a.tar.bz2
acf-shorewall-2beb00dd81c1f2dceeef0e62cf89d2d1b1109b6a.tar.xz
Check and restart is now working!
git-svn-id: svn://svn.alpinelinux.org/acf/shorewall/trunk@396 ab2d0c66-481e-0410-8bed-d214d4d58bed
Diffstat (limited to 'shorewall-controller.lua')
-rw-r--r--shorewall-controller.lua17
1 files changed, 16 insertions, 1 deletions
diff --git a/shorewall-controller.lua b/shorewall-controller.lua
index 094dcf9..07ec0b7 100644
--- a/shorewall-controller.lua
+++ b/shorewall-controller.lua
@@ -17,8 +17,23 @@ mvc.on_load = function(self, parent)
end
+check = function(self)
+ if self.clientdata.cmd == "restart" then
+ return ( {programstats = self.model:restart_service(), url = ENV["SCRIPT_NAME"] .. self.conf.prefix .. self.conf.controller } )
+ end
+ return ( {check = self.model:check_config(), url = ENV["SCRIPT_NAME"] .. self.conf.prefix .. self.conf.controller } )
+end
+
read = function(self)
+ if self.clientdata.cmd == "check" then
+ self.conf.action = "check"
+ self.conf.type = "redir"
+ error (self.conf)
+ end
+ if self.clientdata.cmd == "restart" then
+ return ( {programstats = self.model:restart_service(), url = ENV["SCRIPT_NAME"] .. self.conf.prefix .. self.conf.controller } )
+ end
return ( {programstats = self.model:get_status(), url = ENV["SCRIPT_NAME"] .. self.conf.prefix .. self.conf.controller } )
end
@@ -29,7 +44,7 @@ end
edit = function (self)
local filename = self.clientdata.name or ""
local filecontent = self.clientdata.modifications or ""
- if self.clientdata.cmd == "update" then
+ if ( filecontent ~= "") then
local me = ( {filecontent = self.model:update_filecontent(filename,filecontent), url = ENV["SCRIPT_NAME"] .. self.conf.prefix .. self.conf.controller } )
if ( me.filecontent == nil ) then
list_redir(self)