From 723453ae5dced317e70f6597efe17b4872ea35a2 Mon Sep 17 00:00:00 2001 From: Mika Havela Date: Mon, 19 Nov 2007 14:43:46 +0000 Subject: Building up ideas on different functions git-svn-id: svn://svn.alpinelinux.org/acf/openvpn/trunk@335 ab2d0c66-481e-0410-8bed-d214d4d58bed --- openvpn-model.lua | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'openvpn-model.lua') diff --git a/openvpn-model.lua b/openvpn-model.lua index c5210b3..4e60764 100644 --- a/openvpn-model.lua +++ b/openvpn-model.lua @@ -21,6 +21,21 @@ local function read_file_as_array ( path ) return f end + +local 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 +end + local function has_init_script ( f ) local initprefix = "/etc/init.d/openvpn" local file = initprefix .. "." .. f -- cgit v1.2.3