mirror of
				https://github.com/Ysurac/openmptcprouter-feeds.git
				synced 2025-03-09 15:40:03 +00:00 
			
		
		
		
	Fix when gateway is empty
This commit is contained in:
		
							parent
							
								
									0ff97fb541
								
							
						
					
					
						commit
						9103688982
					
				
					 1 changed files with 2 additions and 2 deletions
				
			
		| 
						 | 
				
			
			@ -269,7 +269,7 @@ if [ "$OMR_TRACKER_STATUS" = "ERROR" ]; then
 | 
			
		|||
fi
 | 
			
		||||
 | 
			
		||||
if [ "$OMR_TRACKER_INTERFACE" = "glorytun" ] || [ "$OMR_TRACKER_INTERFACE" = "omrvpn" ]; then
 | 
			
		||||
	if [ "$default_gw" != "$OMR_TRACKER_DEVICE_GATEWAY" ] || [ "$default_gw" = "" ]; then
 | 
			
		||||
	if ([ "$default_gw" != "$OMR_TRACKER_DEVICE_GATEWAY" ] || [ "$default_gw" = "" ]) && [ "$OMR_TRACKER_DEVICE_GATEWAY" != "" ]; then
 | 
			
		||||
		_log "Tunnel up : Replace default route by $OMR_TRACKER_DEVICE_GATEWAY dev $OMR_TRACKER_DEVICE"
 | 
			
		||||
		ip route replace default scope global nexthop via $OMR_TRACKER_DEVICE_GATEWAY dev $OMR_TRACKER_DEVICE
 | 
			
		||||
	fi
 | 
			
		||||
| 
						 | 
				
			
			@ -339,7 +339,7 @@ fi
 | 
			
		|||
multipath_config=$(uci -q get "network.$OMR_TRACKER_INTERFACE.multipath")
 | 
			
		||||
[ -z "$multipath_config" ] && multipath_config=$(uci -q get "openmptcprouter.$OMR_TRACKER_INTERFACE.multipath" || echo "off")
 | 
			
		||||
if [ "$multipath_config" = "master" ]; then
 | 
			
		||||
	if [ "$default_gw" != "$OMR_TRACKER_DEVICE_GATEWAY" ] || [ "$default_gw" = "" ]; then
 | 
			
		||||
	if ([ "$default_gw" != "$OMR_TRACKER_DEVICE_GATEWAY" ] || [ "$default_gw" = "" ]) && [ "$OMR_TRACKER_DEVICE_GATEWAY" != "" ]; then
 | 
			
		||||
		omrvpn_intf=$(uci -q get "network.omrvpn.ifname" || echo "tun")
 | 
			
		||||
		if [ -n "$omrvpn_intf" ] && [ "$(ip route show default | awk '/default/ {print $5}' | grep $omrvpn_intf)" = "" ]; then
 | 
			
		||||
			_log "Master up : Replace default route by $OMR_TRACKER_DEVICE_GATEWAY dev $OMR_TRACKER_DEVICE"
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue