diff options
author | Andreas Brodmann <andreas.brodmann@gmail.com> | 2008-03-05 10:32:31 +0000 |
---|---|---|
committer | Andreas Brodmann <andreas.brodmann@gmail.com> | 2008-03-05 10:32:31 +0000 |
commit | 35163d653d56ee868d6b520c899aa04104537e26 (patch) | |
tree | 4c683428355f1a88727b7dff28b01d1b788f3c9b | |
parent | 5efdb63c96edeebcc4accd7d34c5b7b7d2b8bd1d (diff) | |
download | acf-dhcp-35163d653d56ee868d6b520c899aa04104537e26.tar.bz2 acf-dhcp-35163d653d56ee868d6b520c899aa04104537e26.tar.xz |
migrated service control to mhavela's daemoncontrol
git-svn-id: svn://svn.alpinelinux.org/acf/dhcp/trunk@815 ab2d0c66-481e-0410-8bed-d214d4d58bed
-rw-r--r-- | dhcp-model.lua | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/dhcp-model.lua b/dhcp-model.lua index 04186f5..9709e0a 100644 --- a/dhcp-model.lua +++ b/dhcp-model.lua @@ -5,6 +5,7 @@ module (..., package.seeall) --- get additional libraries require("procps") require("validator") +require("daemoncontrol") local subnet = {} local cfgdir = "/etc/dhcp/" @@ -783,17 +784,12 @@ end service_control = function ( command ) local retval = "" - local line = "" - local file = io.popen( "/etc/init.d/dhcpd " .. command .. " 2>&1" ) - if file ~= nil then - line = file:read( "*l" ) - while line ~= nil do - retval = retval .. "\n" .. line - line = file:read( "*l" ) - end - file:close() - end - + local code = false + local x + local y + + code, retval, x, y = daemoncontrol.daemoncontrol ( "dhcpd", command ) + return retval end |