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

Fix and add huawei signal power

This commit is contained in:
Ycarus (Yannick Chabanois) 2020-02-21 09:30:43 +01:00
parent 59f8161292
commit 1274791cc1
5 changed files with 53 additions and 14 deletions

View file

@ -1001,14 +1001,20 @@ function interfaces_status()
end
end
end
if gateway ~= "" and uci:get("openmptcprouter", "settings", "disablegwping") ~= "1" and connectivity ~= "ERROR" then
local gw_ping_test = ut.trim(sys.exec("ping -w 1 -c 1 " .. gateway .. " | grep '100% packet loss'"))
if gw_ping_test ~= "" then
gw_ping = "DOWN"
if connectivity == "OK" then
connectivity = "WARNING"
local signal = ""
if gateway ~= "" then
if uci:get("openmptcprouter", "settings", "disablegwping") ~= "1" and connectivity ~= "ERROR" then
local gw_ping_test = ut.trim(sys.exec("ping -w 1 -c 1 " .. gateway .. " | grep '100% packet loss'"))
if gw_ping_test ~= "" then
gw_ping = "DOWN"
if connectivity == "OK" then
connectivity = "WARNING"
end
end
end
if uci:get("openmptcprouter", interface, "manufacturer") ~= "huawei" then
signal = sys.exec("omr-huawei " .. gateway)
end
elseif gateway == "" then
gw_ping = "DOWN"
connectivity = "ERROR"
@ -1150,6 +1156,7 @@ function interfaces_status()
multipath_available = multipath_available,
multipath_state = current_multipath_state,
duplicateif = duplicateif,
signal = signal,
}
if ifname ~= nil and ifname:match("^tun.*") then
table.insert(mArray.tunnels, data);