X-Git-Url: https://git.archive.openwrt.org/?p=project%2Fluci.git;a=blobdiff_plain;f=applications%2Fluci-vnstat%2Fluasrc%2Fmodel%2Fcbi%2Fvnstat.lua;h=5c5e8f7aa21cac1ea085f05d6da139211d81e0a9;hp=9161ec6a67364ea6e04ccdab6d8f505b4392584d;hb=8879c55bb39b31a03de5d798a436d73b30a011d6;hpb=c75eeab65b703aff68119e561d34e88fe4964585 diff --git a/applications/luci-vnstat/luasrc/model/cbi/vnstat.lua b/applications/luci-vnstat/luasrc/model/cbi/vnstat.lua index 9161ec6a6..5c5e8f7aa 100644 --- a/applications/luci-vnstat/luasrc/model/cbi/vnstat.lua +++ b/applications/luci-vnstat/luasrc/model/cbi/vnstat.lua @@ -37,10 +37,12 @@ local ifaces = { } local enabled = { } local iface -for iface in fs.dir(dbdir) do - if iface:sub(1,1) ~= '.' then - ifaces[iface] = iface - enabled[iface] = iface +if fs.access(dbdir) then + for iface in fs.dir(dbdir) do + if iface:sub(1,1) ~= '.' then + ifaces[iface] = iface + enabled[iface] = iface + end end end