diff options
author | Dirk Brenken <dev@brenken.org> | 2019-02-02 18:04:01 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-02-02 18:04:01 +0100 |
commit | 8ea0f156abc036812326fa58e27f0c07be7f2105 (patch) | |
tree | c985dbbb8f353afe054307a5231f54fe40ea2ca1 /applications | |
parent | 7efaac523c69da75d9c9678d8310c94dcc7d70cb (diff) | |
parent | c6e3d054358d78496a34c5adc236cdc6750c00e5 (diff) |
Merge pull request #2501 from dibdot/dnscrypt-proxy
luci-app-DNSCrypt-Proxy: small controller changes
Diffstat (limited to 'applications')
-rw-r--r-- | applications/luci-app-dnscrypt-proxy/luasrc/controller/dnscrypt-proxy.lua | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/applications/luci-app-dnscrypt-proxy/luasrc/controller/dnscrypt-proxy.lua b/applications/luci-app-dnscrypt-proxy/luasrc/controller/dnscrypt-proxy.lua index ca078f0cd3..c055945252 100644 --- a/applications/luci-app-dnscrypt-proxy/luasrc/controller/dnscrypt-proxy.lua +++ b/applications/luci-app-dnscrypt-proxy/luasrc/controller/dnscrypt-proxy.lua @@ -1,4 +1,4 @@ --- Copyright 2017 Dirk Brenken (dev@brenken.org) +-- Copyright 2017-2019 Dirk Brenken (dev@brenken.org) -- This is free software, licensed under the Apache License, Version 2.0 module("luci.controller.dnscrypt-proxy", package.seeall) @@ -27,12 +27,10 @@ function view_reslist() end function logread() - local logfile - - if nixio.fs.access("/var/log/messages") then - logfile = util.trim(util.exec("cat /var/log/messages | grep 'dnscrypt-proxy'")) - else - logfile = util.trim(util.exec("logread -e 'dnscrypt-proxy'")) + local logfile = util.trim(util.exec("logread -e 'dnscrypt-proxy' 2>/dev/null")) or "" + + if logfile == "" then + logfile = "No DNSCrypt-Proxy related logs yet!" end templ.render("dnscrypt-proxy/logread", {title = i18n.translate("DNSCrypt-Proxy Logfile"), content = logfile}) end |