summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTed Trask <ttrask01@yahoo.com>2012-04-18 16:33:11 +0000
committerTed Trask <ttrask01@yahoo.com>2012-04-18 16:33:11 +0000
commitaa8f6a9bb719259c5d557ebbf0d1cf4ef79f0a2f (patch)
tree35de3361d1c27e27c37cc2036db976ef84ae92ec
parent80f25c722a6ad2a9fe3932a6a7a1aa63169ddf33 (diff)
downloadacf-fetchmail-aa8f6a9bb719259c5d557ebbf0d1cf4ef79f0a2f.tar.bz2
acf-fetchmail-aa8f6a9bb719259c5d557ebbf0d1cf4ef79f0a2f.tar.xz
Fixed startstop to match new method
-rw-r--r--fetchmail-model.lua17
l---------fetchmail-startstop-html.lsp1
2 files changed, 10 insertions, 8 deletions
diff --git a/fetchmail-model.lua b/fetchmail-model.lua
index fbd63ad..16992d1 100644
--- a/fetchmail-model.lua
+++ b/fetchmail-model.lua
@@ -388,12 +388,13 @@ end
-- ################################################################################
-- PUBLIC FUNCTIONS
-function startstop_service(action)
- local result = modelfunctions.startstop_service(processname, action)
- table.insert(result.value.actions.value, "Run")
- table.insert(result.value.actions.value, "Test")
+function get_startstop(clientdata)
+ local actions = {"Run", "Test"}
+ return cfe({ type="group", label="Management", value={}, option=actions })
+end
+
+function startstop_service(startstop, action)
if action and (action:lower() == "run" or action:lower() == "test") then
- result.value.result.errtxt = nil
local cmd
if action:lower() == "run" then
cmd = 'su -s /bin/sh -c "/usr/bin/fetchmail -d0 -v --nosyslog -f '..configfile..' 2>&1" - fetchmail'
@@ -401,10 +402,12 @@ function startstop_service(action)
cmd = 'su -s /bin/sh -c "/usr/bin/fetchmail -d0 -v -k --nosyslog -f '..configfile..' 2>&1" - fetchmail'
end
local f = io.popen(cmd)
- result.value.result.value = f:read("*a")
+ startstop.descr = f:read("*a")
f:close()
+ else
+ startstop.errtxt = "Invalid action"
end
- return result
+ return startstop
end
function getstatus()
diff --git a/fetchmail-startstop-html.lsp b/fetchmail-startstop-html.lsp
deleted file mode 120000
index 0ea2627..0000000
--- a/fetchmail-startstop-html.lsp
+++ /dev/null
@@ -1 +0,0 @@
-../startstop-html.lsp \ No newline at end of file