1
0
Fork 0
mirror of https://github.com/Ysurac/openmptcprouter-feeds.git synced 2025-03-09 15:40:03 +00:00

Fix link status in status page

This commit is contained in:
Ycarus (Yannick Chabanois) 2021-03-25 16:36:28 +01:00
parent f943f64d14
commit 8b5816e4f9
2 changed files with 19 additions and 18 deletions

View file

@ -1121,7 +1121,7 @@ function interfaces_status()
local ipv6 = section["ipv6"] or "0"
local mac = section ["macaddr"] or ""
local itype = section ["type"] or ""
local state = section ["state"] or ""
local state = uci:get("openmptcprouter", interface, "state") or ""
--if not ipaddr or not gateway then return end
-- Don't show if0 in the overview
@ -1358,28 +1358,17 @@ function interfaces_status()
if mArray.openmptcprouter["service_addr_ip"] ~= "" then
server_http_test = sys.exec("httping -l " .. mArray.openmptcprouter["service_addr_ip"] .. ":" .. adminport .. " -y " .. ipaddr .. " -t 1 -c 1")
server_http_result = ut.trim(sys.exec("echo '" .. server_http_test .. "' | grep '100.00% failed'"))
if server_http_result ~= "" then
server_http = "DOWN"
if connectivity == "OK" then
connectivity = "WARNING"
end
end
end
if mArray.openmptcprouter["service_addr_ip6"] ~= "" then
elseif mArray.openmptcprouter["service_addr_ip6"] ~= "" then
server_http_test = sys.exec("httping -l [" .. mArray.openmptcprouter["service_addr_ip6"] .. "]:" .. adminport .. " -y " .. ipaddr .. " -t 1 -c 1")
server_http_result = ut.trim(sys.exec("echo '" .. server_http_test .. "' | grep '100.00% failed'"))
if server_http_result ~= "" then
server_http = "DOWN"
if connectivity == "OK" then
connectivity = "WARNING"
end
end
end
if server_http_result ~= "" then
server_http = "DOWN"
if connectivity == "OK" then
connectivity = "WARNING"
end
else
server_http = "UP"
end
end
end
@ -1401,7 +1390,7 @@ function interfaces_status()
end
local zonewan = "NO"
if ut.trim(sys.exec("uci -q get firewall.zone_wan.networks | grep '" .. interface .. "'")) ~= "" then
if ut.trim(sys.exec("uci -q get firewall.zone_wan.network | grep '" .. interface .. "'")) ~= "" then
zonewan = "OK"
end