From f46f3e512436dd3a7ddd694dc7eca8b844b5e696 Mon Sep 17 00:00:00 2001 From: Dirk Brenken Date: Sat, 9 Sep 2017 17:28:27 +0200 Subject: luci-app-adblock: sync with adblock 3.0.0 Signed-off-by: Dirk Brenken --- .../luci-app-adblock/luasrc/controller/adblock.lua | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'applications/luci-app-adblock/luasrc/controller/adblock.lua') diff --git a/applications/luci-app-adblock/luasrc/controller/adblock.lua b/applications/luci-app-adblock/luasrc/controller/adblock.lua index efa99b5b89..b74858400b 100644 --- a/applications/luci-app-adblock/luasrc/controller/adblock.lua +++ b/applications/luci-app-adblock/luasrc/controller/adblock.lua @@ -3,10 +3,10 @@ module("luci.controller.adblock", package.seeall) -local fs = require("nixio.fs") -local util = require("luci.util") +local fs = require("nixio.fs") +local util = require("luci.util") local templ = require("luci.template") -local i18n = require("luci.i18n") +local i18n = require("luci.i18n") function index() if not nixio.fs.access("/etc/config/adblock") then @@ -24,7 +24,13 @@ function index() end function logread() - local logfile = util.trim(util.exec("logread -e 'adblock'")) + local logfile + + if nixio.fs.access("/var/log/messages") then + logfile = util.trim(util.exec("cat /var/log/messages | grep 'adblock'")) + else + logfile = util.trim(util.exec("logread -e 'adblock'")) + end templ.render("adblock/logread", {title = i18n.translate("Adblock Logfile"), content = logfile}) end -- cgit v1.2.3