Update start.sh

This commit is contained in:
wnlen
2026-01-15 19:50:04 +08:00
parent a4c2b21df5
commit 22453d7ee0

View File

@ -369,6 +369,19 @@ if [ "$SKIP_CONFIG_REBUILD" != "true" ]; then
done done
fi fi
# --- GUARANTEE: make sure runtime config exists after download ---
CONFIG_FILE="${CONFIG_FILE:-$Temp_Dir/config.yaml}"
mkdir -p "$Temp_Dir" || true
if [ "$ReturnStatus" -eq 0 ] && [ -s "$Temp_Dir/clash.yaml" ]; then
# 默认将订阅当作完整配置写入运行态 config
cp -f "$Temp_Dir/clash.yaml" "$CONFIG_FILE"
force_write_secret "$CONFIG_FILE" || true
echo "[INFO] Runtime config generated: $CONFIG_FILE (size=$(wc -c <"$CONFIG_FILE" 2>/dev/null || echo 0))"
else
echo "[WARN] Download did not produce clash.yaml (rc=$ReturnStatus), skip runtime config generation" >&2
fi
if [ "$ReturnStatus" -eq 0 ]; then if [ "$ReturnStatus" -eq 0 ]; then
action "$Text3" /bin/true || true action "$Text3" /bin/true || true
else else