1
0
Fork 0
mirror of https://github.com/Ysurac/openmptcprouter-feeds.git synced 2025-02-13 02:51:50 +00:00

Fix display multipath state

This commit is contained in:
Ycarus (Yannick Chabanois) 2019-07-07 21:47:00 +02:00
parent f8181f687c
commit 1732e66a16
2 changed files with 12 additions and 1 deletions

View file

@ -990,6 +990,17 @@ function interfaces_status()
connectivity = "ERROR"
end
local current_multipath_state = ut.trim(sys.exec("multipath " .. ifname))
if test_current_multipath_state == ifname .. " is deactivated" then
current_multipath_state = "off"
elseif test_current_multipath_state == ifname .. " is in default mode" then
current_multipath_state = "on"
elseif test_current_multipath_state == ifname .. " is in backup mode" then
current_multipath_state = "backup"
elseif test_current_multipath_state == ifname .. " is in handover mode" then
current_multipath_state = "handover"
else
current_multipath_state = ""
end
if ipaddr == "" and ifname ~= nil then
ipaddr = ut.trim(sys.exec("ip -4 -br addr ls dev " .. ifname .. " | awk -F'[ /]+' '{print $3}' | tr -d '\n'"))

View file

@ -413,7 +413,7 @@
statusMessage += 'Multipath master already defined<br />';
statusMessageClass = "error";
}
if(multipath !== multipath_state)
if(multipath !== multipath_state && multipath !== 'master' && multipath_state !== 'on')
{
statusMessage += 'Multipath current state is ' + multipath_state + '<br />';
statusMessageClass = "error";