|  | @@ -409,13 +409,9 @@ start_shunt() {
 | 
	
		
			
				|  |  |  		echolog "shunt:$(get_name $type) Started!"
 | 
	
		
			
				|  |  |  		;;
 | 
	
		
			
				|  |  |  	v2ray)
 | 
	
		
			
				|  |  | -		if [ -n "$tmp_local_port" ]; then
 | 
	
		
			
				|  |  | -			local tmp_port=$tmp_local_port
 | 
	
		
			
				|  |  | -		else
 | 
	
		
			
				|  |  | -			local tmp_port=$tmp_shunt_local_port
 | 
	
		
			
				|  |  | -			gen_config_file $SHUNT_SERVER $type 3 $tmp_shunt_port $tmp_port
 | 
	
		
			
				|  |  | -			ln_start_bin $(first_type xray v2ray) v2ray -config $shunt_config_file
 | 
	
		
			
				|  |  | -		fi
 | 
	
		
			
				|  |  | +		local tmp_port=${tmp_local_port:-$tmp_shunt_local_port}
 | 
	
		
			
				|  |  | +		gen_config_file $SHUNT_SERVER $type 3 $tmp_shunt_port $tmp_port
 | 
	
		
			
				|  |  | +		ln_start_bin $(first_type xray v2ray) v2ray -config $shunt_config_file
 | 
	
		
			
				|  |  |  		ln_start_bin $(first_type dns2socks) dns2socks 127.0.0.1:$tmp_port 8.8.8.8:53 127.0.0.1:$tmp_shunt_dns_port -q
 | 
	
		
			
				|  |  |  		echolog "shunt:$($(first_type xray v2ray) -version | head -1) Started!"
 | 
	
		
			
				|  |  |  		;;
 | 
	
	
		
			
				|  | @@ -492,8 +488,8 @@ start_local() {
 | 
	
		
			
				|  |  |  		if [ "$_local" == "2" ]; then
 | 
	
		
			
				|  |  |  			gen_config_file $LOCAL_SERVER $type 4 0 $local_port
 | 
	
		
			
				|  |  |  			ln_start_bin $(first_type xray v2ray) v2ray -config $local_config_file
 | 
	
		
			
				|  |  | -			echolog "Global_Socks5:$($(first_type "xray" "v2ray") -version | head -1) Started!"
 | 
	
		
			
				|  |  |  		fi
 | 
	
		
			
				|  |  | +		echolog "Global_Socks5:$($(first_type "xray" "v2ray") -version | head -1) Started!"
 | 
	
		
			
				|  |  |  		;;
 | 
	
		
			
				|  |  |  	trojan) #client
 | 
	
		
			
				|  |  |  		gen_config_file $LOCAL_SERVER $type 4 $local_port
 | 
	
	
		
			
				|  | @@ -638,6 +634,11 @@ load_config() {
 | 
	
		
			
				|  |  |  		start_local
 | 
	
		
			
				|  |  |  		local_enable=0
 | 
	
		
			
				|  |  |  		;;
 | 
	
		
			
				|  |  | +	$SHUNT_SERVER)
 | 
	
		
			
				|  |  | +		_local="3"
 | 
	
		
			
				|  |  | +		local_config_file=$TMP_PATH/tcp-udp-ssr-local.json
 | 
	
		
			
				|  |  | +		start_local
 | 
	
		
			
				|  |  | +		;;
 | 
	
		
			
				|  |  |  	*)
 | 
	
		
			
				|  |  |  		_local="2"
 | 
	
		
			
				|  |  |  		local_config_file=$TMP_PATH/tcp-udp-ssr-local.json
 | 
	
	
		
			
				|  | @@ -652,6 +653,12 @@ load_config() {
 | 
	
		
			
				|  |  |  		shunt="1"
 | 
	
		
			
				|  |  |  		SHUNT_SERVER=$GLOBAL_SERVER
 | 
	
		
			
				|  |  |  		;;
 | 
	
		
			
				|  |  | +	$LOCAL_SERVER)
 | 
	
		
			
				|  |  | +		shunt="$tmp_shunt_port"
 | 
	
		
			
				|  |  | +		shunt_config_file=$TMP_PATH/tcp-udp-ssr-local.json
 | 
	
		
			
				|  |  | +		shunt_dns_config_file=$TMP_PATH/shunt-dns-ssr-plus.json
 | 
	
		
			
				|  |  | +		start_shunt
 | 
	
		
			
				|  |  | +		;;
 | 
	
		
			
				|  |  |  	*)
 | 
	
		
			
				|  |  |  		shunt="$tmp_shunt_port"
 | 
	
		
			
				|  |  |  		shunt_config_file=$TMP_PATH/shunt-ssr-retcp.json
 |