summaryrefslogtreecommitdiffstats
path: root/openvpn-model.lua
diff options
context:
space:
mode:
Diffstat (limited to 'openvpn-model.lua')
-rw-r--r--openvpn-model.lua15
1 files changed, 15 insertions, 0 deletions
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