From e37c61d437f1f3640dfd7f8196e51576e3ef088d Mon Sep 17 00:00:00 2001 From: svefnz Date: Wed, 8 Jul 2026 01:10:20 +0800 Subject: [PATCH] fix: replace recursive ask call with direct read to fix variable scope pollution --- src/core.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/core.sh b/src/core.sh index 83bd116..82aba9f 100644 --- a/src/core.sh +++ b/src/core.sh @@ -309,7 +309,8 @@ ask() { else msg "检测到 443 端口当前空闲(可能是已转移到了 4443 端口)。" fi - ask string is_enable_fallback "是否启用 Caddy 回落分流?(y/n):" + echo -ne "是否启用 Caddy 回落分流?(y/n):" + read is_enable_fallback if [[ $is_enable_fallback =~ ^[Yy]$ ]]; then is_reality_fallback=1 export $is_ask_set=$REPLY @@ -978,7 +979,8 @@ add() { else msg "检测到 443 端口当前空闲(可能是已转移到了 4443 端口)。" fi - ask string is_enable_fallback "是否启用 Caddy 回落分流?(y/n):" + echo -ne "是否启用 Caddy 回落分流?(y/n):" + read is_enable_fallback if [[ $is_enable_fallback =~ ^[Yy]$ ]]; then is_reality_fallback=1 fi