mirror of
https://github.com/Ysurac/openmptcprouter-feeds.git
synced 2025-03-09 15:40:03 +00:00
Fix for IP display
This commit is contained in:
parent
3c46973feb
commit
b7b01b9eb9
3 changed files with 13 additions and 3 deletions
|
@ -968,10 +968,10 @@ function interfaces_status()
|
|||
if enabled == "0" then return end
|
||||
|
||||
local connectivity
|
||||
|
||||
local multipath_state = ""
|
||||
if ifname ~= "" and ifname ~= nil then
|
||||
if fs.access("/sys/class/net/" .. ifname) then
|
||||
local multipath_state = ut.trim(sys.exec("multipath " .. ifname .. " | grep deactivated"))
|
||||
multipath_state = ut.trim(sys.exec("multipath " .. ifname .. " | grep deactivated"))
|
||||
if multipath_state == "" then
|
||||
connectivity = "OK"
|
||||
else
|
||||
|
@ -1140,6 +1140,7 @@ function interfaces_status()
|
|||
server_ping = server_ping,
|
||||
ipv6_discover = ipv6_discover,
|
||||
multipath_available = multipath_available,
|
||||
multipath_state = multipath_state,
|
||||
duplicateif = duplicateif,
|
||||
}
|
||||
|
||||
|
|
|
@ -346,6 +346,7 @@
|
|||
var server_ping = mArray.wans[i].server_ping;
|
||||
var ipv6_discover = mArray.wans[i].ipv6_discover;
|
||||
var multipath_available = mArray.wans[i].multipath_available;
|
||||
var multipath_state = mArray.wans[i].multipath_state;
|
||||
var duplicateif = mArray.wans[i].duplicateif;
|
||||
// Generate template
|
||||
if(mArray.openmptcprouter.remote_from_lease == true && mArray.wans.length == 1)
|
||||
|
@ -412,6 +413,11 @@
|
|||
statusMessage += 'Multipath master already defined<br />';
|
||||
statusMessageClass = "error";
|
||||
}
|
||||
if(multipath !== multipath_state)
|
||||
{
|
||||
statusMessage += 'Multipath current state is ' + multipath_state + '<br />';
|
||||
statusMessageClass = "error";
|
||||
}
|
||||
if(duplicateif)
|
||||
{
|
||||
statusMessage += 'Network interface duplicated<br />';
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
#!/bin/sh
|
||||
checkip=$(dig +short A ip.openmptcprouter.com | tr -d "\n")
|
||||
ipset add ss_rules_dst_bypass_all $checkip > /dev/null 2>&1
|
||||
curl -s -4 -m 3 --interface $1 http://ip.openmptcprouter.com
|
||||
ip="$(curl -s -4 -m 3 --interface $1 http://ip.openmptcprouter.com)"
|
||||
ipset del ss_rules_dst_bypass_all $checkip > /dev/null 2>&1
|
||||
if expr "$ip" : '[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*$' >/dev/null; then
|
||||
echo $ip
|
||||
fi
|
Loading…
Add table
Add a link
Reference in a new issue