Update start.sh

This commit is contained in:
wnlen
2026-01-18 20:54:17 +08:00
parent 18652f294c
commit 01e1a5d832

View File

@ -524,12 +524,17 @@ if [ "$SKIP_CONFIG_REBUILD" != "true" ]; then
echo "[INFO] Runtime config generated: $CONFIG_FILE (size=$(wc -c <"$CONFIG_FILE" 2>/dev/null || echo 0))" echo "[INFO] Runtime config generated: $CONFIG_FILE (size=$(wc -c <"$CONFIG_FILE" 2>/dev/null || echo 0))"
# Optional: Fix group 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
# only replace " url: 'http://...'" or 'url: "http://..."' patterns # 1) proxy-groups url-test / fallback url
sed -i -E \ sed -i -E \
"s#(url:[[:space:]]*['\"])http://#\1https://#g" \ "s#(url:[[:space:]]*['\"])http://#\1https://#g" \
"$CONFIG_FILE" 2>/dev/null || true "$CONFIG_FILE" 2>/dev/null || true
# 2) cfw-latency-url (used by some dashboards / generators)
sed -i -E \
"s#(cfw-latency-url:[[:space:]]*['\"])http://#\1https://#g" \
"$CONFIG_FILE" 2>/dev/null || true
fi fi
else else
echo "[WARN] Download did not produce clash.yaml (rc=$ReturnStatus), skip runtime config generation" >&2 echo "[WARN] Download did not produce clash.yaml (rc=$ReturnStatus), skip runtime config generation" >&2