diff options
author | Mika Havela <mika.havela@gmail.com> | 2007-11-23 10:43:49 +0000 |
---|---|---|
committer | Mika Havela <mika.havela@gmail.com> | 2007-11-23 10:43:49 +0000 |
commit | c6ceb72038d970ba894b4d54cd76e157715a07c4 (patch) | |
tree | 61caee9ec17001678d9bea4ee72436b22c2897bb /openvpn-model.lua | |
parent | 16f826ca681da9f026c5fa8e9cf5347d28bd062c (diff) | |
download | acf-openvpn-c6ceb72038d970ba894b4d54cd76e157715a07c4.tar.bz2 acf-openvpn-c6ceb72038d970ba894b4d54cd76e157715a07c4.tar.xz |
Hmm...
git-svn-id: svn://svn.alpinelinux.org/acf/openvpn/trunk@360 ab2d0c66-481e-0410-8bed-d214d4d58bed
Diffstat (limited to 'openvpn-model.lua')
-rw-r--r-- | openvpn-model.lua | 18 |
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 |