summaryrefslogtreecommitdiffhomepage
path: root/applications/luci-app-travelmate/luasrc/controller/travelmate.lua
diff options
context:
space:
mode:
Diffstat (limited to 'applications/luci-app-travelmate/luasrc/controller/travelmate.lua')
-rw-r--r--applications/luci-app-travelmate/luasrc/controller/travelmate.lua14
1 files changed, 10 insertions, 4 deletions
diff --git a/applications/luci-app-travelmate/luasrc/controller/travelmate.lua b/applications/luci-app-travelmate/luasrc/controller/travelmate.lua
index a418a8ec61..efbe619a43 100644
--- a/applications/luci-app-travelmate/luasrc/controller/travelmate.lua
+++ b/applications/luci-app-travelmate/luasrc/controller/travelmate.lua
@@ -3,9 +3,9 @@
module("luci.controller.travelmate", package.seeall)
-local fs = require("nixio.fs")
-local util = require("luci.util")
-local i18n = require("luci.i18n")
+local fs = require("nixio.fs")
+local util = require("luci.util")
+local i18n = require("luci.i18n")
local templ = require("luci.template")
function index()
@@ -30,6 +30,12 @@ function index()
end
function logread()
- local logfile = util.trim(util.exec("logread -e 'travelmate'"))
+ local logfile
+
+ if nixio.fs.access("/var/log/messages") then
+ logfile = util.trim(util.exec("cat /var/log/messages | grep 'travelmate'"))
+ else
+ logfile = util.trim(util.exec("logread -e 'travelmate'"))
+ end
templ.render("travelmate/logread", {title = i18n.translate("Travelmate Logfile"), content = logfile})
end