diff options
author | Dirk Brenken <dev@brenken.org> | 2019-02-02 07:49:12 +0100 |
---|---|---|
committer | Dirk Brenken <dev@brenken.org> | 2019-02-02 08:47:40 +0100 |
commit | 09ea2573ff32571f8670bfc197b3f947abaf46b2 (patch) | |
tree | 9a3e6498e25136bcb31569e46f6d53c09b8c08a7 /applications/luci-app-adblock | |
parent | 68d3351d36752cd111ea7059505fc9dfc71d32fb (diff) |
luci-app-adblock: small controller changes
- show 'DNS Query Report' tab only when tcpdump was found
- remove needless Turris Omnia logread workaround, due to changes in
latest syslog-ng package
Signed-off-by: Dirk Brenken <dev@brenken.org>
Diffstat (limited to 'applications/luci-app-adblock')
-rw-r--r-- | applications/luci-app-adblock/luasrc/controller/adblock.lua | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/applications/luci-app-adblock/luasrc/controller/adblock.lua b/applications/luci-app-adblock/luasrc/controller/adblock.lua index 4641ac93b..d75296275 100644 --- a/applications/luci-app-adblock/luasrc/controller/adblock.lua +++ b/applications/luci-app-adblock/luasrc/controller/adblock.lua @@ -16,7 +16,9 @@ function index() end entry({"admin", "services", "adblock"}, firstchild(), _("Adblock"), 30).dependent = false entry({"admin", "services", "adblock", "tab_from_cbi"}, cbi("adblock/overview_tab", {hideresetbtn=true, hidesavebtn=true}), _("Overview"), 10).leaf = true - entry({"admin", "services", "adblock", "report"}, template("adblock/report"), _("DNS Query Report"), 20).leaf = true + if nixio.fs.access("/usr/sbin/tcpdump") then + entry({"admin", "services", "adblock", "report"}, template("adblock/report"), _("DNS Query Report"), 20).leaf = true + end entry({"admin", "services", "adblock", "log"}, template("adblock/logread"), _("Logfile"), 30).leaf = true entry({"admin", "services", "adblock", "advanced"}, firstchild(), _("Advanced"), 100) entry({"admin", "services", "adblock", "advanced", "blacklist"}, form("adblock/blacklist_tab"), _("Edit Blacklist"), 110).leaf = true @@ -143,14 +145,8 @@ function report_text() end function logread() - local content + local content = util.trim(util.exec("logread -e 'adblock-'")) or "" - if nixio.fs.access("/var/log/messages") then - content = util.trim(util.exec("grep -F 'adblock-' /var/log/messages")) - else - content = util.trim(util.exec("logread -e 'adblock-'")) - end - if content == "" then content = "No adblock related logs yet!" end |