From aa8f6a9bb719259c5d557ebbf0d1cf4ef79f0a2f Mon Sep 17 00:00:00 2001 From: Ted Trask Date: Wed, 18 Apr 2012 16:33:11 +0000 Subject: Fixed startstop to match new method --- fetchmail-model.lua | 17 ++++++++++------- fetchmail-startstop-html.lsp | 1 - 2 files changed, 10 insertions(+), 8 deletions(-) delete mode 120000 fetchmail-startstop-html.lsp 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 -- cgit v1.2.3