mirror of
				https://github.com/Ysurac/openmptcprouter-feeds.git
				synced 2025-03-09 15:40:03 +00:00 
			
		
		
		
	Fix client2client routes
This commit is contained in:
		
							parent
							
								
									fdc397de4e
								
							
						
					
					
						commit
						dbeaa8658b
					
				
					 1 changed files with 4 additions and 2 deletions
				
			
		| 
						 | 
				
			
			@ -522,7 +522,7 @@ _set_client2client() {
 | 
			
		|||
	local c2cid=0
 | 
			
		||||
	[ -z "$vps_config" ] && vps_config=$(_get_json "config")
 | 
			
		||||
	[ -z "$vps_config" ] && return
 | 
			
		||||
	c2cips="$(echo "$vps_config" | jsonfilter -q -e '@.client2client.lanips')"
 | 
			
		||||
	c2cips="$(echo "$vps_config" | jsonfilter -q -e '@.client2client.lanips[0]')"
 | 
			
		||||
	vpnifname="$(uci -q get network.omrvpn.ifname)"
 | 
			
		||||
	vpnip_local=$(ip -4 -br addr ls dev ${vpnifname} | awk -F'[ /]+' '{print $3}' | tr -d "\n")
 | 
			
		||||
	for lanip in $c2cips; do
 | 
			
		||||
| 
						 | 
				
			
			@ -537,6 +537,7 @@ _set_client2client() {
 | 
			
		|||
			set network.omr_client2client_${c2cid}.gateway="${vpnip_local}"
 | 
			
		||||
		EOF
 | 
			
		||||
	done
 | 
			
		||||
	uci -q commit network
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
_vps_firewall_redirect_port() {
 | 
			
		||||
| 
						 | 
				
			
			@ -1130,7 +1131,8 @@ _config_service() {
 | 
			
		|||
	[ -n "$wanips" ] && _set_wan_ip
 | 
			
		||||
	_set_lan_ip
 | 
			
		||||
	_set_vpn_ip
 | 
			
		||||
	_delete_client2client
 | 
			
		||||
	config_load network
 | 
			
		||||
	config_foreach _delete_client2client route
 | 
			
		||||
	if [ "$(uci -q get openmptcprouter.settings.vpn)" != "openvpn" ] && [ "$(echo "$vps_config" | jsonfilter -q -e '@.client2client.enabled')" == "true" ]; then
 | 
			
		||||
		_set_client2client
 | 
			
		||||
	fi
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue