diff options
-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() |