From 6f1cb45f70e64fb21de4544c1b6aa7ce77116d75 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=94=AC=E5=93=A5=E4=BE=83=E4=BE=83=E4=BE=83ygkkk?= <121604513+yonggekkk@users.noreply.github.com> Date: Sat, 11 Apr 2026 15:42:31 +0800 Subject: [PATCH 1/9] Add maxhy2ports function to sb.sh --- sb.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/sb.sh b/sb.sh index 758f761..1b7cd3b 100644 --- a/sb.sh +++ b/sb.sh @@ -1198,6 +1198,15 @@ echo } sb_client(){ + +maxhy2ports(){ +if [[ -n $hy2_ports ]]; then + cat < Date: Sat, 11 Apr 2026 16:05:37 +0800 Subject: [PATCH 2/9] Update sb.sh --- sb.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sb.sh b/sb.sh index 1b7cd3b..d25aaae 100644 --- a/sb.sh +++ b/sb.sh @@ -1328,8 +1328,7 @@ cat < Date: Sat, 11 Apr 2026 16:39:56 +0800 Subject: [PATCH 3/9] Update sb.sh --- sb.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/sb.sh b/sb.sh index d25aaae..bcbf4cf 100644 --- a/sb.sh +++ b/sb.sh @@ -1026,7 +1026,8 @@ 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 +hyps=$hy2ports +sbhy2pt=(echo "$hy2_ports" | grep -o '[0-9]\+:[0-9]\+' | sed 's/.*/"&"/' | paste -sd,) else hyps= fi @@ -1199,10 +1200,10 @@ echo sb_client(){ -maxhy2ports(){ +sbhy2ports(){ if [[ -n $hy2_ports ]]; then cat < Date: Sat, 11 Apr 2026 16:58:51 +0800 Subject: [PATCH 4/9] Update sb.sh --- sb.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/sb.sh b/sb.sh index bcbf4cf..0669a3d 100644 --- a/sb.sh +++ b/sb.sh @@ -1025,9 +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=$hy2ports -sbhy2pt=(echo "$hy2_ports" | grep -o '[0-9]\+:[0-9]\+' | sed 's/.*/"&"/' | paste -sd,) +cmhy2pt=$(echo $hy2_ports | tr ':' '-') +hyps=$cmhy2pt +sbhy2pt=$(echo "$hy2_ports" | grep -o '[0-9]\+:[0-9]\+' | sed 's/.*/"&"/' | paste -sd,) else hyps= fi @@ -1576,7 +1576,8 @@ proxies: - name: hysteria2-$hostname type: hysteria2 server: $cl_hy2_ip - port: $hy2_port + port: $hy2_port + ports: $cmhy2pt password: $uuid alpn: - h3 From 13c58baedd74ef3c219e7ffb097cd37de558d6ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=94=AC=E5=93=A5=E4=BE=83=E4=BE=83=E4=BE=83ygkkk?= <121604513+yonggekkk@users.noreply.github.com> Date: Sat, 11 Apr 2026 18:24:48 +0800 Subject: [PATCH 5/9] Update sb.sh --- sb.sh | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/sb.sh b/sb.sh index 0669a3d..b344fe9 100644 --- a/sb.sh +++ b/sb.sh @@ -1463,7 +1463,7 @@ cat < Date: Sat, 11 Apr 2026 19:52:02 +0800 Subject: [PATCH 6/9] Update sb.sh --- sb.sh | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/sb.sh b/sb.sh index b344fe9..ad3fbe6 100644 --- a/sb.sh +++ b/sb.sh @@ -1152,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 @@ -1169,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 @@ -1185,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 From 5e6641382c406700f6f8016507e1090c60c9be86 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=94=AC=E5=93=A5=E4=BE=83=E4=BE=83=E4=BE=83ygkkk?= <121604513+yonggekkk@users.noreply.github.com> Date: Sat, 11 Apr 2026 19:59:13 +0800 Subject: [PATCH 7/9] Update sb.sh --- sb.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sb.sh b/sb.sh index ad3fbe6..5af73ba 100644 --- a/sb.sh +++ b/sb.sh @@ -2267,7 +2267,7 @@ $(sbany2) "outbounds": [ "auto", "vless-$hostname", - $(sbany1) +$(sbany1) "vmess-$hostname", "hy2-$hostname", "tuic5-$hostname" @@ -2278,7 +2278,7 @@ $(sbany2) "type": "urltest", "outbounds": [ "vless-$hostname", - $(sbany1) +$(sbany1) "vmess-$hostname", "hy2-$hostname", "tuic5-$hostname" From d9c7a592e3f80ae71202fabd74eb6e4828db8b12 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=94=AC=E5=93=A5=E4=BE=83=E4=BE=83=E4=BE=83ygkkk?= <121604513+yonggekkk@users.noreply.github.com> Date: Sat, 11 Apr 2026 20:11:22 +0800 Subject: [PATCH 8/9] Update sb.sh --- sb.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sb.sh b/sb.sh index 5af73ba..acb478d 100644 --- a/sb.sh +++ b/sb.sh @@ -2785,7 +2785,7 @@ green "3:重置删除Hysteria2多端口" green "0:返回上层" readp "请选择【0-3】:" menu if [ "$menu" = "1" ]; then -if [ -n $hy2_ports ]; then +if [ -n "$hy2_ports" ]; then hy2deports hy2port echo $sbfiles | xargs -n1 sed -i "67s/$hy2_port/$port_hy2/" @@ -2810,7 +2810,7 @@ else changeport fi elif [ "$menu" = "3" ]; then -if [ -n $hy2_ports ]; then +if [ -n "$hy2_ports" ]; then hy2deports && sbshare > /dev/null 2>&1 && changeport else yellow "Hysteria2未设置多端口" && changeport @@ -2826,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/" @@ -2851,7 +2851,7 @@ 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 From 58fada492da23bf912cdca9bb5834ec1dacb7477 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=94=AC=E5=93=A5=E4=BE=83=E4=BE=83=E4=BE=83ygkkk?= <121604513+yonggekkk@users.noreply.github.com> Date: Sat, 11 Apr 2026 20:21:19 +0800 Subject: [PATCH 9/9] Update sb.sh --- sb.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sb.sh b/sb.sh index acb478d..b1d6cfe 100644 --- a/sb.sh +++ b/sb.sh @@ -2813,7 +2813,7 @@ elif [ "$menu" = "3" ]; then if [ -n "$hy2_ports" ]; then hy2deports && sbshare > /dev/null 2>&1 && changeport else -yellow "Hysteria2未设置多端口" && changeport +sbshare > /dev/null 2>&1 && yellow "Hysteria2未设置多端口" && changeport fi else changeport @@ -2854,7 +2854,7 @@ elif [ "$menu" = "3" ]; 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