diff --git a/scripts/remote_restart.sh b/scripts/remote_restart.sh index 3125976..b7f6240 100755 --- a/scripts/remote_restart.sh +++ b/scripts/remote_restart.sh @@ -72,11 +72,19 @@ fi echo "==> 启动 vite preview @ ${WEB_HOST}:${PORT} (base=${BASE_PATH})..." nohup npx vite preview --config scripts/vite-preview.config.mjs >>"${LOG}" 2>&1 & echo $! >"${PID_FILE}" -sleep 2 +sleep 3 preview_url="http://127.0.0.1:${PORT}${BASE_PATH}" login_probe="http://127.0.0.1:${PORT}/auth/status" -if curl -sf "${preview_url}" >/dev/null && curl -sf "${login_probe}" >/dev/null; then +auth_ok=0 +for _ in 1 2 3 4 5; do + if curl -sf "${preview_url}" >/dev/null && curl -sf "${login_probe}" >/dev/null; then + auth_ok=1 + break + fi + sleep 2 +done +if [[ "${auth_ok}" -eq 1 ]]; then echo "✅ memind_adm 已就绪: ${preview_url}" curl -sf "${preview_url}" >/dev/null && echo " 首页 OK" echo " /auth 反代 OK"