fix: correct protocol variable check inside port validation to support interactive menu
Main / build (push) Waiting to run

This commit is contained in:
2026-07-08 00:51:08 +08:00
parent 7549097b3f
commit 1f62620be3
+2 -2
View File
@@ -281,7 +281,7 @@ ask() {
continue continue
} }
if [[ $(is_test port_used $REPLY) && $is_ask_set != 'door_port' ]]; then if [[ $(is_test port_used $REPLY) && $is_ask_set != 'door_port' ]]; then
if [[ $REPLY == 443 && $is_caddy && $is_lower =~ "reality" ]]; then if [[ $REPLY == 443 && $is_caddy && ${is_new_protocol,,} =~ "reality" ]]; then
msg "\n检测到 443 端口已被 Caddy 占用。" msg "\n检测到 443 端口已被 Caddy 占用。"
msg "你可以选择启用 REALITY 回落分流功能,将非科学上网流量转发给本地 Caddy (4443 端口)。" msg "你可以选择启用 REALITY 回落分流功能,将非科学上网流量转发给本地 Caddy (4443 端口)。"
msg "这需要你后续手动将 Caddyfile 中的默认 https 端口修改为 4443 并重启 Caddy。" msg "这需要你后续手动将 Caddyfile 中的默认 https 端口修改为 4443 并重启 Caddy。"
@@ -937,7 +937,7 @@ add() {
err "($is_use_port) 不是一个有效的端口. $is_err_tips" err "($is_use_port) 不是一个有效的端口. $is_err_tips"
} }
[[ $(is_test port_used $is_use_port) && ! $is_gen ]] && { [[ $(is_test port_used $is_use_port) && ! $is_gen ]] && {
if [[ $is_use_port == 443 && $is_caddy && $is_lower =~ "reality" ]]; then if [[ $is_use_port == 443 && $is_caddy && ${is_new_protocol,,} =~ "reality" ]]; then
msg "\n检测到 443 端口已被 Caddy 占用。" msg "\n检测到 443 端口已被 Caddy 占用。"
msg "你可以选择启用 REALITY 回落分流功能,将非科学上网流量转发给本地 Caddy (4443 端口)。" msg "你可以选择启用 REALITY 回落分流功能,将非科学上网流量转发给本地 Caddy (4443 端口)。"
msg "这需要你后续手动将 Caddyfile 中的默认 https 端口修改为 4443 并重启 Caddy。" msg "这需要你后续手动将 Caddyfile 中的默认 https 端口修改为 4443 并重启 Caddy。"