mirror of
https://github.com/Ysurac/openmptcprouter-feeds.git
synced 2025-02-15 03:51:51 +00:00
No server ping if gw down
This commit is contained in:
parent
e781082dbb
commit
17dc28e63c
1 changed files with 14 additions and 10 deletions
|
@ -616,17 +616,21 @@ function interfaces_status()
|
|||
connectivity = 'ERROR'
|
||||
end
|
||||
|
||||
local latency = "-"
|
||||
local server_ping = 'UP'
|
||||
local server_ping_test = sys.exec("ping -W 1 -c 1 -I " .. ifname .. " " .. mArray.openmptcprouter["wan_addr"])
|
||||
local server_ping_result = ut.trim(sys.exec("echo '" .. server_ping_test .. "' | grep '100% packet loss'"))
|
||||
if server_ping_result ~= "" then
|
||||
server_ping = 'DOWN'
|
||||
if connectivity == "OK" then
|
||||
connectivity = 'WARNING'
|
||||
end
|
||||
local latency = ""
|
||||
local server_ping = ''
|
||||
if connectivity ~= "ERROR" then
|
||||
local server_ping_test = sys.exec("ping -W 1 -c 1 -I " .. ifname .. " " .. mArray.openmptcprouter["wan_addr"])
|
||||
local server_ping_result = ut.trim(sys.exec("echo '" .. server_ping_test .. "' | grep '100% packet loss'"))
|
||||
if server_ping_result ~= "" then
|
||||
server_ping = 'DOWN'
|
||||
if connectivity == "OK" then
|
||||
connectivity = 'WARNING'
|
||||
end
|
||||
else
|
||||
server_ping = 'UP'
|
||||
latency = ut.trim(sys.exec("echo '" .. server_ping_test .. "' | cut -d '/' -s -f4 | cut -d '.' -f1"))
|
||||
end
|
||||
end
|
||||
local latency = ut.trim(sys.exec("echo '" .. server_ping_test .. "' | cut -d '/' -s -f4 | cut -d '.' -f1"))
|
||||
|
||||
if mArray.openmptcprouter["dns"] == true and ifname ~= nil and gateway ~= "" and gw_ping == "UP" then
|
||||
-- Test if multipath can work on the connection
|
||||
|
|
Loading…
Reference in a new issue