diff --git a/sb.sh b/sb.sh index 758f761..b1d6cfe 100644 --- a/sb.sh +++ b/sb.sh @@ -1025,8 +1025,9 @@ fi hy2_port=$(sed 's://.*::g' /etc/s-box/sb.json | jq -r '.inbounds[2].listen_port') hy2_ports=$(iptables -t nat -nL --line 2>/dev/null | grep -w "$hy2_port" | awk '{print $8}' | sed 's/dpts://; s/dpt://' | tr '\n' ',' | sed 's/,$//') if [[ -n $hy2_ports ]]; then -hy2ports=$(echo $hy2_ports | sed 's/:/-/g') -hyps=$hy2_port,$hy2ports +cmhy2pt=$(echo $hy2_ports | tr ':' '-') +hyps=$cmhy2pt +sbhy2pt=$(echo "$hy2_ports" | grep -o '[0-9]\+:[0-9]\+' | sed 's/.*/"&"/' | paste -sd,) else hyps= fi @@ -1151,8 +1152,7 @@ echo reshy2(){ echo white "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" -hy2_link="hysteria2://$uuid@$sb_hy2_ip:$hy2_port?security=tls&alpn=h3&insecure=$ins_hy2&mport=$hyps&sni=$hy2_name#hy2-$hostname" -#hy2_link="hysteria2://$uuid@$sb_hy2_ip:$hy2_port?security=tls&alpn=h3&insecure=$ins_hy2&sni=$hy2_name#hy2-$hostname" +hy2_link="hysteria2://$uuid@$sb_hy2_ip:$hy2_port?security=tls&alpn=h3&insecure=$ins_hy2&allowInsecure=$ins_hy2&mport=$hyps&sni=$hy2_name#hy2-$hostname" echo "$hy2_link" > /etc/s-box/hy2.txt red "🚀【 Hysteria-2 】节点信息如下:" && sleep 2 echo @@ -1168,7 +1168,7 @@ echo restu5(){ echo white "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" -tuic5_link="tuic://$uuid:$uuid@$sb_tu5_ip:$tu5_port?congestion_control=bbr&udp_relay_mode=native&alpn=h3&sni=$tu5_name&allow_insecure=$ins&allowInsecure=$ins#tu5-$hostname" +tuic5_link="tuic://$uuid:$uuid@$sb_tu5_ip:$tu5_port?congestion_control=bbr&udp_relay_mode=native&alpn=h3&sni=$tu5_name&insecure=$ins&allowInsecure=$ins#tu5-$hostname" echo "$tuic5_link" > /etc/s-box/tuic5.txt red "🚀【 Tuic-v5 】节点信息如下:" && sleep 2 echo @@ -1184,7 +1184,7 @@ echo resan(){ echo white "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" -an_link="anytls://$uuid@$sb_an_ip:$an_port?&sni=$an_name&allowInsecure=$ins_an#anytls-$hostname" +an_link="anytls://$uuid@$sb_an_ip:$an_port?&sni=$an_name&allowInsecure=$ins_an&insecure=$ins_an#anytls-$hostname" echo "$an_link" > /etc/s-box/an.txt red "🚀【 Anytls】节点信息如下:" && sleep 2 echo @@ -1198,6 +1198,15 @@ echo } sb_client(){ + +sbhy2ports(){ +if [[ -n $hy2_ports ]]; then + cat < /dev/null 2>&1 && changeport else -yellow "Hysteria2未设置多端口" && changeport +sbshare > /dev/null 2>&1 && yellow "Hysteria2未设置多端口" && changeport fi else changeport @@ -2816,7 +2826,7 @@ green "3:重置删除Tuic5多端口" green "0:返回上层" readp "请选择【0-3】:" menu if [ "$menu" = "1" ]; then -if [ -n $tu5_ports ]; then +if [ -n "$tu5_ports" ]; then tu5deports tu5port echo $sbfiles | xargs -n1 sed -i "89s/$tu5_port/$port_tu/" @@ -2841,10 +2851,10 @@ else changeport fi elif [ "$menu" = "3" ]; then -if [ -n $tu5_ports ]; then +if [ -n "$tu5_ports" ]; then tu5deports && sbshare > /dev/null 2>&1 && changeport else -yellow "Tuic5未设置多端口" && changeport +sbshare > /dev/null 2>&1 && yellow "Tuic5未设置多端口" && changeport fi else changeport