summaryrefslogtreecommitdiffhomepage
path: root/libs/cbi
diff options
context:
space:
mode:
Diffstat (limited to 'libs/cbi')
-rw-r--r--libs/cbi/luasrc/cbi.lua9
1 files changed, 6 insertions, 3 deletions
diff --git a/libs/cbi/luasrc/cbi.lua b/libs/cbi/luasrc/cbi.lua
index ebca729bb..18d84e52f 100644
--- a/libs/cbi/luasrc/cbi.lua
+++ b/libs/cbi/luasrc/cbi.lua
@@ -59,12 +59,15 @@ function load(cbimap, ...)
local upldir = "/lib/uci/upload/"
local cbidir = luci.util.libpath() .. "/model/cbi/"
- assert(luci.fs.stat(cbimap) or luci.fs.stat(cbidir..cbimap..".lua"),
- "Model not found!")
+ assert(luci.fs.stat(cbimap) or
+ luci.fs.stat(cbidir..cbimap..".lua") or
+ luci.fs.stat(cbidir..cbimap..".lua.gz"),
+ "Model not found!")
local func, err = loadfile(cbimap)
if not func then
- func, err = loadfile(cbidir..cbimap..".lua")
+ func, err = loadfile(cbidir..cbimap..".lua") or
+ loadfile(cbidir..cbimap..".lua.gz")
end
assert(func, err)