mirror of
				https://github.com/Ysurac/openmptcprouter-feeds.git
				synced 2025-03-09 15:40:03 +00:00 
			
		
		
		
	Fix omr-6in4 msg command failed in log
This commit is contained in:
		
							parent
							
								
									5b0097bef8
								
							
						
					
					
						commit
						1bf6799321
					
				
					 2 changed files with 12 additions and 9 deletions
				
			
		| 
						 | 
				
			
			@ -30,16 +30,19 @@ while true; do
 | 
			
		|||
					ifup omr6in4 > /dev/null 2>&1
 | 
			
		||||
				fi
 | 
			
		||||
				sleep 5
 | 
			
		||||
				ipv6_gw=$(ubus call network.interface.6in4-omr6in4 status | jsonfilter -q -l 1 -e '@.route[@.target="::"].nexthop' | tr -d "\n")
 | 
			
		||||
				ipv6_gw=$(ubus call network.interface.omr6in4 status | jsonfilter -q -l 1 -e '@.route[@.target="::"].nexthop' | tr -d "\n")
 | 
			
		||||
				[ "$ipv6_gw" = "::" ] && ipv6_gw='fe80::a00:1'
 | 
			
		||||
				[ -z "$ipv6_gw" ] && ipv6_gw='fe80::a00:1'
 | 
			
		||||
				ip -6 route replace default via ${ipv6_gw} dev 6in4-omr6in4 > /dev/null 2>&1
 | 
			
		||||
				uci -q batch <<-EOF
 | 
			
		||||
					set network.omr6in4_route6_default=route6
 | 
			
		||||
					set network.omr6in4_route6_default.interface=omr6in4
 | 
			
		||||
					set network.omr6in4_route6_default.target='::'
 | 
			
		||||
					set network.omr6in4_route6_default.gateway=$ipv6_gw
 | 
			
		||||
					commit network
 | 
			
		||||
				EOF
 | 
			
		||||
				if [ "$(uci -q get openmptcprouter.settings.uci_route)" = "1" ]; then
 | 
			
		||||
					uci -q batch <<-EOF
 | 
			
		||||
						set network.omr6in4_route6_default=route6
 | 
			
		||||
						set network.omr6in4_route6_default.interface=omr6in4
 | 
			
		||||
						set network.omr6in4_route6_default.target='::'
 | 
			
		||||
						set network.omr6in4_route6_default.gateway=$ipv6_gw
 | 
			
		||||
						commit network
 | 
			
		||||
					EOF
 | 
			
		||||
				fi
 | 
			
		||||
			fi
 | 
			
		||||
		}
 | 
			
		||||
	fi
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -12,7 +12,7 @@
 | 
			
		|||
 | 
			
		||||
 | 
			
		||||
start_service() {
 | 
			
		||||
	[ "$(sysctl -n net.ipv6.conf.all.disable_ipv6 | tr -d '\n')" = "1" ] && return
 | 
			
		||||
	[ "$(uci -q get openmptcprouter.settings.disable_ipv6)" = "1" ] && return
 | 
			
		||||
	procd_open_instance
 | 
			
		||||
	# shellcheck disable=SC2086
 | 
			
		||||
	procd_set_param command /bin/omr-6in4
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue