- local lcldata = luci.util.exec("cat /var/lib/unbound/adb_list.overall")
- local lcldesc = luci.i18n.translate("This shows '/var/lib/unbound/adb_list.overall' provided by Adblock script(s).")
- luci.template.render("unbound/show-textbox", {heading = lclhead, description = lcldesc, content = lcldata})
+ local lcldata, lcldesc
+
+
+ if nixio.fs.stat(adblockfile).size > 262144 then
+ lcldesc = luci.i18n.translate("Adblock domain list is too large for LuCI:")
+ lcldesc = lcldesc .. " (" .. adblockfile .. ")"
+ luci.template.render("unbound/show-empty", {heading = lclhead, description = lcldesc})
+
+ else
+ lcldata = nixio.fs.readfile(adblockfile)
+ lcldesc = luci.i18n.translate("This shows blocked domains provided by Adblock scripts:")
+ lcldesc = lcldesc .. " (" .. adblockfile .. ")"
+ luci.template.render("unbound/show-textbox", {heading = lclhead, description = lcldesc, content = lcldata})
+ end