summaryrefslogtreecommitdiffhomepage
path: root/applications/luci-app-adblock/luasrc/controller/adblock.lua
diff options
context:
space:
mode:
authorDirk Brenken <dev@brenken.org>2017-09-09 17:28:27 +0200
committerDirk Brenken <dev@brenken.org>2017-09-09 21:09:28 +0200
commitf46f3e512436dd3a7ddd694dc7eca8b844b5e696 (patch)
tree4611e5a959278dcb68472ef4d1fc9daf4ba56dd5 /applications/luci-app-adblock/luasrc/controller/adblock.lua
parentad81dc1889843ef295984a7d0ad714f154eaed9c (diff)
luci-app-adblock: sync with adblock 3.0.0
Signed-off-by: Dirk Brenken <dev@brenken.org>
Diffstat (limited to 'applications/luci-app-adblock/luasrc/controller/adblock.lua')
-rw-r--r--applications/luci-app-adblock/luasrc/controller/adblock.lua14
1 files changed, 10 insertions, 4 deletions
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