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