mirror of
				https://github.com/Ysurac/openmptcprouter-feeds.git
				synced 2025-03-09 15:40:03 +00:00 
			
		
		
		
	Fix display multipath state
This commit is contained in:
		
							parent
							
								
									f8181f687c
								
							
						
					
					
						commit
						1732e66a16
					
				
					 2 changed files with 12 additions and 1 deletions
				
			
		| 
						 | 
				
			
			@ -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'"))
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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";
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue