Commit 5273f6b4 authored by Jan-Tarek Butt's avatar Jan-Tarek Butt

ffnw-banner: fix nil index acess in case of unknown bssid

parent 52daa706
......@@ -33,7 +33,7 @@ local openwrtRelease = io.open("/etc/openwrt_release", "r")
local gluonVersion = io.open("/lib/gluon/gluon-version", "r")
local gluonRelease = io.open("/lib/gluon/release", "r")
local infoHeader = {}
infoHeader["openwrtRelease"] = ""
infoHeader["ledeRelease"] = ""
infoHeader["revision"] = ""
infoHeader["gluonVersion"] = ""
infoHeader["gluonRelease"] = ""
......@@ -46,7 +46,9 @@ if hoodbssid ~= nil and hoodfile ~= nil then
local jhood = readHoodfile(hoodfile)
if jhood ~= nil then
local hood = gethoodByBssid(jhood, hoodbssid)
infoHeader["hoodname"] = hood.name
if hood ~= nil then
infoHeader["hoodname"] = hood.name
end
end
end
......@@ -56,7 +58,7 @@ if openwrtRelease~=nil then
if line:match("DISTRIB_DESCRIPTION") then
for v in string.gmatch(line, "([^=]+)") do
if not v:match("DISTRIB_DESCRIPTION") then
infoHeader["openwrtRelease"] = string.gsub(v,"'","")
infoHeader["ledeRelease"] = string.gsub(v,"'","")
end
end
end
......@@ -87,7 +89,7 @@ if gluonRelease~=nil then
end
end
local firstLine ="OpenWRT Version: " .. infoHeader["openwrtRelease"].. " (" .. infoHeader["revision"] .. ")"
local firstLine ="LEDE Version: " .. infoHeader["ledeRelease"].. " (" .. infoHeader["revision"] .. ")"
local secondLine ="Gluon Version: " .. infoHeader["gluonVersion"] .. " Gluon Release: " .. infoHeader["gluonRelease"]
local thirdLine = "Selected Hood: " .. infoHeader["hoodname"]
os.execute('sed -i \'/%A/c\\' .. firstLine .. '\' ' .. desFile)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment