fix(core): 替换容灾多宿主 IP 弹匣的拼接符(从逗号改为下划线),彻底解决因 Telegram 客户端及 API 特殊字符截断导致的多 IP 粘连失效问题

This commit is contained in:
hotyue
2026-06-01 12:27:00 +00:00
parent f57a4cd9e0
commit 56dc23009b
2 changed files with 9 additions and 9 deletions

View File

@@ -497,18 +497,18 @@ if [ "$UPGRADE_MODE" == "false" ]; then
# 注入次发弹药 (可用 IPv4)
if [[ -n "$DETECT_V4" ]] && [[ "$DETECT_V4" != "$PUBLIC_IP" ]]; then
COMM_IP="${COMM_IP},${DETECT_V4}"
COMM_IP="${COMM_IP}_${DETECT_V4}"
fi
# 注入保底弹药 (可用 IPv6带括号保护)
if [[ -n "$DETECT_V6" ]] && [[ "$DETECT_V6" != "$PUBLIC_IP" ]]; then
[[ "$DETECT_V6" != *"["* ]] && SAFE_V6="[${DETECT_V6}]" || SAFE_V6="$DETECT_V6"
COMM_IP="${COMM_IP},${SAFE_V6}"
COMM_IP="${COMM_IP}_${SAFE_V6}"
fi
SAFE_COMM_IP="$COMM_IP"
if [[ "$COMM_IP" == *","* ]]; then
if [[ "$COMM_IP" == *"_"* ]]; then
echo -e " \033[32m✅ 成功组装多宿主容灾通讯专线: $SAFE_COMM_IP\033[0m"
else
echo -e " \033[33m⚠ 本机仅有单一出口,建立单轨通讯模式: $SAFE_COMM_IP\033[0m"
@@ -659,14 +659,14 @@ if [ "$UPGRADE_MODE" == "true" ]; then
# 追加 V4 容灾备弹
if [[ -n "$RAW_V4" ]] && [[ "$NEW_COMM_IP" != *"$RAW_V4"* ]]; then
NEW_COMM_IP="${NEW_COMM_IP},${RAW_V4}"
NEW_COMM_IP="${NEW_COMM_IP}_${RAW_V4}"
fi
# 追加 V6 容灾备弹
if [[ -n "$RAW_V6" ]]; then
[[ "$RAW_V6" != *"["* ]] && SAFE_V6="[${RAW_V6}]" || SAFE_V6="$RAW_V6"
if [[ "$NEW_COMM_IP" != *"$SAFE_V6"* ]]; then
NEW_COMM_IP="${NEW_COMM_IP},${SAFE_V6}"
NEW_COMM_IP="${NEW_COMM_IP}_${SAFE_V6}"
fi
fi