diff options
author | Ted Trask <ttrask01@yahoo.com> | 2009-03-17 20:39:56 +0000 |
---|---|---|
committer | Ted Trask <ttrask01@yahoo.com> | 2009-03-17 20:39:56 +0000 |
commit | 0900531c71a3aa57b5e8aca2ce16e2ea7ba4c1f9 (patch) | |
tree | e37af184120a9b8ba4b8f7790f40c8b69530991f /asterisk-model.lua | |
parent | 187fb74ab5b33fe2a510a122274fa7c47939d485 (diff) | |
download | acf-asterisk-0900531c71a3aa57b5e8aca2ce16e2ea7ba4c1f9.tar.bz2 acf-asterisk-0900531c71a3aa57b5e8aca2ce16e2ea7ba4c1f9.tar.xz |
Changed the way startstop works in core to add a list of allowed actions. Modified all ACFs that don't use the standard functions to work with new library method.
git-svn-id: svn://svn.alpinelinux.org/acf/asterisk/trunk@1730 ab2d0c66-481e-0410-8bed-d214d4d58bed
Diffstat (limited to 'asterisk-model.lua')
-rw-r--r-- | asterisk-model.lua | 16 |
1 files changed, 1 insertions, 15 deletions
diff --git a/asterisk-model.lua b/asterisk-model.lua index 297656e..4aa9f6e 100644 --- a/asterisk-model.lua +++ b/asterisk-model.lua @@ -28,22 +28,8 @@ get_status = function() return modelfunctions.getstatus(processname, packagename, "Asterisk Status") end --- local implementation to add reload actions function startstop_service(action) - local cmdresult = cfe({ label="Start/Stop result" }) - - if (string.lower(action) == "start") or (string.lower(action) == "stop") or (string.lower(action) == "restart") or (string.lower(action) == "reload") then - local file = io.popen( "PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin /etc/init.d/" .. - processname .. " " .. string.lower(action) .. " 2>&1" ) - if file ~= nil then - cmdresult.value = file:read( "*a" ) - file:close() - end - posix.sleep(2) -- Wait for the process to start|stop - else - cmdresult.errtxt = "Unknown command!" - end - return cmdresult + return modelfunctions.startstop_service(processname, action, {"start", "stop", "restart", "reload"}) end get_file = function(filename) |