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

IPv6 disabled by default, display server error each times

This commit is contained in:
Ycarus 2019-01-03 15:54:10 +01:00
parent 9f2887c225
commit 121758afc6
3 changed files with 32 additions and 27 deletions

View file

@ -702,7 +702,7 @@ function interfaces_status()
-- Get VPS info
ucic:foreach("openmptcprouter", "server", function(s)
local serverip = uci:get("openmptcprouter",s[".name"],"ip")
if serverip ~= "" and (mArray.openmptcprouter["service_addr"] == serverip or serverip == mArray.openmptcprouter["wan_addr"]) then
if serverip ~= "" then
mArray.openmptcprouter["vps_omr_version"] = uci:get("openmptcprouter", s[".name"], "omr_version") or ""
mArray.openmptcprouter["vps_kernel"] = uci:get("openmptcprouter",s[".name"],"kernel") or ""
mArray.openmptcprouter["vps_machine"] = uci:get("openmptcprouter",s[".name"],"machine") or ""
@ -894,7 +894,7 @@ function interfaces_status()
if gateway == "" then
gateway = get_gateway(interface)
end
if connectivity ~= "ERROR" and gateway == "" and ifname ~= nil then
if gateway == "" and ifname ~= nil then
if fs.access("/sys/class/net/" .. ifname) then
gateway = ut.trim(sys.exec("ip -4 r list dev " .. ifname .. " | grep kernel | awk '/proto kernel/ {print $1}' | grep -v / | tr -d '\n'"))
if gateway == "" then
@ -902,7 +902,7 @@ function interfaces_status()
end
end
end
if connectivity ~= "ERROR" and gateway ~= "" then
if gateway ~= "" 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"

View file

@ -210,7 +210,7 @@
{
statusMessageClass = "error";
statusIcon = "<%=resource%>/openmptcprouter/images/statusError.png";
} else {
}
if (mArray.openmptcprouter.vps_status == "DOWN")
{
statusMessage += 'Can\'t ping server<br/>';
@ -229,12 +229,11 @@
{
statusMessage += 'MPTCP is not enabled on the server<br/>';
}
if (statusMessage !== "")
if (statusMessage !== "" && statusMessageClass !== "error")
{
statusMessageClass = "warning";
statusIcon = "<%=resource%>/openmptcprouter/images/statusWarning.png";
}
}
if (mArray.openmptcprouter.vps_omr_version)
{
content += "Version " + mArray.openmptcprouter.vps_omr_version;

View file

@ -52,4 +52,10 @@ if [ "$(uci -q get openmptcprouter.vps.port)" = "" ]; then
commit openmptcprouter
EOF
fi
if [ "$(uci -q get openmptcprouter.settings.disable_ipv6)" = "" ]; then
uci -q batch <<-EOF
set openmptcprouter.settings.disable_ipv6='1'
commit openmptcprouter
EOF
fi
exit 0