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()
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
-%>
<%-
- local write = io.write
- local uci = require("luci.model.uci").cursor()
+ local write = io.write
+ local uci = require("luci.model.uci").cursor()
local trmiface = uci:get("travelmate", "global", "trm_iface") or "trm_wwan"
-%>
local iface = s.network or ""
if iface == trmiface then
local section = s['.name'] or ""
- local device = s.device or ""
- local ssid = s.ssid or ""
- local bssid = s.bssid or ""
- local encryption = s.encryption or ""
+ local device = s.device or "-"
+ local ssid = s.ssid or "-"
+ local bssid = s.bssid or "-"
+ local encryption = s.encryption or "-"
local disabled = s.disabled or ""
local style = "color:#000000"
if disabled == "0" then