diff options
Diffstat (limited to 'shorewall-model.lua')
-rw-r--r-- | shorewall-model.lua | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/shorewall-model.lua b/shorewall-model.lua index d7682ab..694bb56 100644 --- a/shorewall-model.lua +++ b/shorewall-model.lua @@ -182,7 +182,7 @@ function getstatus() end function getstatusdetails() - local f = io.popen("/sbin/shorewall status") + local f = io.popen("/sbin/shorewall status 2>%1") local programstate = f:read("*a") or "" f:close() return cfe({ value=programstate, label="Shorewall status report" }) @@ -207,10 +207,12 @@ end function getfilelist () local listed_files = {} - for name in posix.files(baseurl) do - if not string.match(name, "^%.") and not string.match(name, "^Makefile") then - local filedetails = fs.stat(baseurl .. name) - table.insert ( listed_files , {filename=baseurl..name, mtime=filedetails.mtime, filesize=filedetails.size} ) + if fs.is_dir(baseurl) then + for name in posix.files(baseurl) do + if not string.match(name, "^%.") and not string.match(name, "^Makefile") then + local filedetails = fs.stat(baseurl .. name) + table.insert ( listed_files , {filename=baseurl..name, mtime=filedetails.mtime, filesize=filedetails.size} ) + end end end |