mirror of
				https://github.com/Ysurac/openmptcprouter-feeds.git
				synced 2025-03-09 15:40:03 +00:00 
			
		
		
		
	Fix multipath status display
This commit is contained in:
		
							parent
							
								
									ee769a4eca
								
							
						
					
					
						commit
						46903d6b6a
					
				
					 2 changed files with 21 additions and 12 deletions
				
			
		| 
						 | 
				
			
			@ -997,13 +997,13 @@ 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
 | 
			
		||||
	    if string.find(test_current_multipath_state,"deactivated") then
 | 
			
		||||
		    current_multipath_state = "off"
 | 
			
		||||
	    elseif test_current_multipath_state == ifname .. " is in default mode" then
 | 
			
		||||
	    elseif string.find(test_current_multipath_state,"default") then
 | 
			
		||||
		    current_multipath_state = "on"
 | 
			
		||||
	    elseif test_current_multipath_state == ifname .. " is in backup mode" then
 | 
			
		||||
	    elseif string.find(test_current_multipath_state,"backup") then
 | 
			
		||||
		    current_multipath_state = "backup"
 | 
			
		||||
	    elseif test_current_multipath_state == ifname .. " is in handover mode" then
 | 
			
		||||
	    elseif string.find(test_current_multipath_state,"handover") then
 | 
			
		||||
		    current_multipath_state = "handover"
 | 
			
		||||
	    else
 | 
			
		||||
		    current_multipath_state = ""
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -408,15 +408,24 @@
 | 
			
		|||
						statusMessage += 'Wan IP and gateway are identical<br />';
 | 
			
		||||
						statusMessageClass = "error";
 | 
			
		||||
					}
 | 
			
		||||
					if(multipath == 'master' && master > 1)
 | 
			
		||||
					if(multipath == 'master') 
 | 
			
		||||
					{
 | 
			
		||||
						statusMessage += 'Multipath master already defined<br />';
 | 
			
		||||
						statusMessageClass = "error";
 | 
			
		||||
					}
 | 
			
		||||
					if(multipath !== multipath_state && multipath !== 'master' && multipath_state !== 'on')
 | 
			
		||||
					{
 | 
			
		||||
						statusMessage += 'Multipath current state is ' + multipath_state + '<br />';
 | 
			
		||||
						statusMessageClass = "error";
 | 
			
		||||
						if (master > 1)
 | 
			
		||||
						{
 | 
			
		||||
							statusMessage += 'Multipath master already defined<br />';
 | 
			
		||||
							statusMessageClass = "error";
 | 
			
		||||
						}
 | 
			
		||||
						if(multipath_state !== 'on' && multipath_state !== '')
 | 
			
		||||
						{
 | 
			
		||||
							statusMessage += 'Multipath current state is ' + multipath_state + '<br />';
 | 
			
		||||
							statusMessageClass = "error";
 | 
			
		||||
						}
 | 
			
		||||
					} else {
 | 
			
		||||
						if(multipath !== multipath_state && multipath_state !== '')
 | 
			
		||||
						{
 | 
			
		||||
							statusMessage += 'Multipath current state is ' + multipath_state + '<br />';
 | 
			
		||||
							statusMessageClass = "error";
 | 
			
		||||
						}
 | 
			
		||||
					}
 | 
			
		||||
					if(duplicateif)
 | 
			
		||||
					{
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue