diff options
-rw-r--r-- | shorewall-model.lua | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/shorewall-model.lua b/shorewall-model.lua index dd7a864..d7682ab 100644 --- a/shorewall-model.lua +++ b/shorewall-model.lua @@ -21,7 +21,7 @@ local function read_config(file) if not (fs.is_file(path)) then return {} end - local filecontent = fs.read_file_as_array(path) + local filecontent = fs.read_file_as_array(path) or {} local output = {} for k,v in pairs(filecontent) do if not string.find ( v, "^[;#].*" ) and not (string.find (v, "^%s*$")) then @@ -62,7 +62,7 @@ local function addremove_config( addremove, file, value, orgvalue ) }) end - local filecontentarray = fs.read_file_as_array(filepath) + local filecontentarray = fs.read_file_as_array(filepath) or {} if (addremove == "delete" ) then local modifyrow @@ -200,7 +200,7 @@ function configcheck () end function getlogfile () - local logfilepath = format.parse_ini_file(fs.read_file(configfile),"","LOGFILE") or "" + local logfilepath = format.parse_ini_file(fs.read_file(configfile) or "","","LOGFILE") or "" return cfe({ value=logfilepath, label="Shorewall logfile" }) end |