diff options
author | Natanael Copa <natanael.copa@gmail.com> | 2008-01-11 10:00:15 +0000 |
---|---|---|
committer | Natanael Copa <natanael.copa@gmail.com> | 2008-01-11 10:00:15 +0000 |
commit | 00ee16959c032373d3c6bbad8ec5e0361ed9e03b (patch) | |
tree | 77fef72eec058248de0f5de9a6c5e44db1bed12d /dhcp-model.lua | |
parent | d65a5dad8a44bc9395465efad4702fa5037b7a25 (diff) | |
download | acf-dhcp-00ee16959c032373d3c6bbad8ec5e0361ed9e03b.tar.bz2 acf-dhcp-00ee16959c032373d3c6bbad8ec5e0361ed9e03b.tar.xz |
use procps.pidof
git-svn-id: svn://svn.alpinelinux.org/acf/dhcp/trunk@552 ab2d0c66-481e-0410-8bed-d214d4d58bed
Diffstat (limited to 'dhcp-model.lua')
-rw-r--r-- | dhcp-model.lua | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/dhcp-model.lua b/dhcp-model.lua index 858f3f0..04186f5 100644 --- a/dhcp-model.lua +++ b/dhcp-model.lua @@ -3,6 +3,7 @@ module (..., package.seeall) --- get additional libraries +require("procps") require("validator") local subnet = {} @@ -762,17 +763,7 @@ read_file = function ( filename ) end is_running = function( process ) - local retval = false - local file = io.popen("pidof " .. process) - if file ~= nil then - local line = file:read( "*l" ) - file:close() - if #line > 0 then - retval = true - end - end - - return retval + return procps.pidof(process) ~= nil end get_dhcpd_version = function() |