From ef59bac72de6a0a4a4cee5c7a477ee7695dcb76a Mon Sep 17 00:00:00 2001 From: Mika Havela Date: Fri, 23 Nov 2007 08:49:55 +0000 Subject: Assume some files is missing git-svn-id: svn://svn.alpinelinux.org/acf/openvpn/trunk@358 ab2d0c66-481e-0410-8bed-d214d4d58bed --- openvpn-model.lua | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'openvpn-model.lua') diff --git a/openvpn-model.lua b/openvpn-model.lua index 0f3627b..719cf13 100644 --- a/openvpn-model.lua +++ b/openvpn-model.lua @@ -54,7 +54,9 @@ local function config_content( f ) -- Filter out commented lines if not string.find ( l, "^[;#].*" ) then local a,b = string.match ( l, "^%s*(%S*)%s+(%S*).*$" ) - config[a]=b + if (a) then + config[a]=b + end end end if not ( config.log ) then @@ -86,9 +88,11 @@ local is_running = function( process, parameters ) for k,v in pairs(pidofs) do local path = string.gsub("/proc/".. v .. "/cmdline", "%s", "") local f = io.open(path) - local file_resultx = f:read("*a") - local file_result = string.match(file_resultx, parameters) + if (f) then + local file_resultx = f:read("*a") + local file_result = string.match(file_resultx, parameters) f:close() + end if ( file_result ) then retval = "Running" end -- cgit v1.2.3