summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Brodmann <andreas.brodmann@gmail.com>2008-03-05 10:32:31 +0000
committerAndreas Brodmann <andreas.brodmann@gmail.com>2008-03-05 10:32:31 +0000
commit35163d653d56ee868d6b520c899aa04104537e26 (patch)
tree4c683428355f1a88727b7dff28b01d1b788f3c9b
parent5efdb63c96edeebcc4accd7d34c5b7b7d2b8bd1d (diff)
downloadacf-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.lua18
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