diff options
author | Hannu Nyman <hannu.nyman@iki.fi> | 2017-09-10 18:54:53 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-09-10 18:54:53 +0300 |
commit | b86ed10f849c442cc57e531dd75e87e4499a1118 (patch) | |
tree | c7010f0b220418dfb90e841eb6d1f9c1e33cb4c7 /applications/luci-app-adblock/luasrc/controller/adblock.lua | |
parent | 25b5d8830998b823bae0ae6f3394c57fec2aa378 (diff) | |
parent | f46f3e512436dd3a7ddd694dc7eca8b844b5e696 (diff) |
Merge pull request #1359 from dibdot/adblock
luci-app-adblock: sync with adblock 3.0.0
Diffstat (limited to 'applications/luci-app-adblock/luasrc/controller/adblock.lua')
-rw-r--r-- | applications/luci-app-adblock/luasrc/controller/adblock.lua | 14 |
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 |