From c6ceb72038d970ba894b4d54cd76e157715a07c4 Mon Sep 17 00:00:00 2001 From: Mika Havela Date: Fri, 23 Nov 2007 10:43:49 +0000 Subject: Hmm... git-svn-id: svn://svn.alpinelinux.org/acf/openvpn/trunk@360 ab2d0c66-481e-0410-8bed-d214d4d58bed --- openvpn-model.lua | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'openvpn-model.lua') diff --git a/openvpn-model.lua b/openvpn-model.lua index bcae88c..15c791c 100644 --- a/openvpn-model.lua +++ b/openvpn-model.lua @@ -208,10 +208,24 @@ end function get_logfile( self, path) local logcontent = {} config = config_content ( path ) - local logfilecontent = fs.read_file_as_array ( config.log ) - return logfilecontent + local logfilecontent = fs.read_file ( config.log ) + if not (logfilecontent) then + logfilecontent = "File is empty or missing!" + end + return ( { name = config.log, value = logfilecontent } ) end +function get_config( self, path) + local logcontent = {} + config = config_content ( path ) + local logfilecontent = fs.read_file ( config.name ) + if not (logfilecontent) then + logfilecontent = "File is empty or missing!" + end + return ( { name = config.name, value = logfilecontent } ) +end + + function get_conflist () local configlist = {} for k,v in pairs(list_conffiles()) do -- cgit v1.2.3