Update start.sh

This commit is contained in:
wnlen
2026-01-18 21:11:17 +08:00
parent 69387df0f9
commit 92a259ed5a

View File

@ -507,15 +507,14 @@ if [ "$SKIP_CONFIG_REBUILD" != "true" ]; then
# Optional: Fix test URLs to HTTPS for reliability (safe, narrow scope) # Optional: Fix test URLs to HTTPS for reliability (safe, narrow scope)
if [ "${FIX_TEST_URL_HTTPS:-true}" = "true" ] && [ -s "$CONFIG_FILE" ]; then if [ "${FIX_TEST_URL_HTTPS:-true}" = "true" ] && [ -s "$CONFIG_FILE" ]; then
# 1) proxy-groups url-test / fallback url # 1) proxy-groups: url-test / fallback url
sed -i -E \ sed -i -E "s#(url:[[:space:]]*['\"])http://#\1https://#g" "$CONFIG_FILE" 2>/dev/null || true
"s#(url:[[:space:]]*['\"])http://#\1https://#g" \
"$CONFIG_FILE" 2>/dev/null || true
# 2) cfw-latency-url (used by some dashboards / generators) # 2) cfw-latency-url (some dashboards)
sed -i -E \ sed -i -E "s#(cfw-latency-url:[[:space:]]*['\"])http://#\1https://#g" "$CONFIG_FILE" 2>/dev/null || true
"s#(cfw-latency-url:[[:space:]]*['\"])http://#\1https://#g" \
"$CONFIG_FILE" 2>/dev/null || true # 3) proxy-providers health-check url (mihomo warns about this)
sed -i -E "s#(health-check:[[:space:]]*\n[[:space:]]*url:[[:space:]]*['\"])http://#\1https://#g" "$CONFIG_FILE" 2>/dev/null || true
fi fi
# 5) 自检:失败则回退到旧配置 # 5) 自检:失败则回退到旧配置