mirror of
https://github.com/Ysurac/openmptcprouter-feeds.git
synced 2025-03-09 15:40:03 +00:00
Fix when resolveip doesn't work in API
This commit is contained in:
parent
85c74d6aaa
commit
65a10f0910
1 changed files with 3 additions and 0 deletions
|
@ -1501,6 +1501,9 @@ function interfaces_status()
|
|||
elseif gateway6 ~= "" then
|
||||
serverip = sys.exec('resolveip -6 ' .. value .. ' | head -n 1')
|
||||
end
|
||||
if serverip == "" then
|
||||
serverip = value
|
||||
end
|
||||
if serverip ~= "" then
|
||||
local server_ping_test = sys.exec("ping -B -w 1 -c 1 -I " .. ifname .. " " .. serverip)
|
||||
local server_ping_result = ut.trim(sys.exec("echo '" .. server_ping_test .. "' | grep '100% packet loss'"))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue