mirror of
https://github.com/Ysurac/openmptcprouter-feeds.git
synced 2025-03-09 15:40:03 +00:00
Add option to disable gateway and server ping check for status page
This commit is contained in:
parent
c9327c9214
commit
5a644babf8
3 changed files with 32 additions and 5 deletions
|
@ -457,7 +457,7 @@ end
|
|||
function savevnstat(savevnstat)
|
||||
-- Enable/disable save vnstat
|
||||
luci.sys.exec("uci -q set vnstat.@vnstat[0].backup=%s" % savevnstat)
|
||||
ucic:commit("openmptcprouter")
|
||||
ucic:commit("vnstat")
|
||||
end
|
||||
|
||||
function disablefastopen(disablefastopen)
|
||||
|
@ -964,7 +964,7 @@ function interfaces_status()
|
|||
end
|
||||
end
|
||||
end
|
||||
if gateway ~= "" then
|
||||
if gateway ~= "" and uci:get("openmptcprouter", "settings", "disablegwping") ~= "1" 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"
|
||||
|
@ -984,7 +984,7 @@ function interfaces_status()
|
|||
if serverip == "127.0.0.1" then
|
||||
serverip = mArray.openmptcprouter["wan_addr"]
|
||||
end
|
||||
if serverip ~= "" then
|
||||
if serverip ~= "" and uci:get("openmptcprouter", "settings", "disableserverping") ~= "1" then
|
||||
local server_ping_test = sys.exec("ping -w 1 -c 1 -I " .. ifname .. " " .. serverip)
|
||||
local server_ping_result = ut.trim(sys.exec("echo '" .. server_ping_test .. "' | grep '100% packet loss'"))
|
||||
if server_ping_result ~= "" then
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue