mirror of
https://github.com/Ysurac/openmptcprouter-feeds.git
synced 2025-03-09 15:40:03 +00:00
Fix ping server when no ifname or no server
This commit is contained in:
parent
efe7a7faa4
commit
d82c349743
1 changed files with 6 additions and 6 deletions
|
@ -618,7 +618,7 @@ function interfaces_status()
|
||||||
|
|
||||||
local latency = ""
|
local latency = ""
|
||||||
local server_ping = ''
|
local server_ping = ''
|
||||||
if connectivity ~= "ERROR" then
|
if connectivity ~= "ERROR" and ifname ~= "" and ifname ~= nil and mArray.openmptcprouter["wan_addr"] ~= "" then
|
||||||
local server_ping_test = sys.exec("ping -W 1 -c 1 -I " .. ifname .. " " .. mArray.openmptcprouter["wan_addr"])
|
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'"))
|
local server_ping_result = ut.trim(sys.exec("echo '" .. server_ping_test .. "' | grep '100% packet loss'"))
|
||||||
if server_ping_result ~= "" then
|
if server_ping_result ~= "" then
|
||||||
|
@ -632,9 +632,9 @@ function interfaces_status()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
if mArray.openmptcprouter["dns"] == true and ifname ~= nil and gateway ~= "" and gw_ping == "UP" then
|
|
||||||
-- Test if multipath can work on the connection
|
|
||||||
local multipath_available
|
local multipath_available
|
||||||
|
if mArray.openmptcprouter["dns"] == true and ifname ~= nil and ifname ~= "" and gateway ~= "" and gw_ping == "UP" then
|
||||||
|
-- Test if multipath can work on the connection
|
||||||
local multipath_available_state = ut.trim(sys.exec("omr-mptcp-intf " .. ifname .. " | grep 'Nay, Nay, Nay'"))
|
local multipath_available_state = ut.trim(sys.exec("omr-mptcp-intf " .. ifname .. " | grep 'Nay, Nay, Nay'"))
|
||||||
if multipath_available_state == "" then
|
if multipath_available_state == "" then
|
||||||
multipath_available = 'OK'
|
multipath_available = 'OK'
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue