From 806c35df368ab90865ced6508f8817bf0b511923 Mon Sep 17 00:00:00 2001 From: kzolotarev95 Date: Tue, 30 Jun 2026 11:19:58 +0400 Subject: [PATCH] Wait for VPS hub health during install --- vps/install-vps.sh | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/vps/install-vps.sh b/vps/install-vps.sh index ddffe00..ee52511 100755 --- a/vps/install-vps.sh +++ b/vps/install-vps.sh @@ -120,12 +120,18 @@ start_hub() { check_hub() { HUB_PORT80_OK=0 - if curl -fsS --max-time 5 http://127.0.0.1/health >/dev/null 2>&1; then - HUB_PORT80_OK=1 - fi - if curl -fsS --max-time 5 http://127.0.0.1:8088/health >/tmp/owrt-remote-health.log 2>&1; then - return 0 - fi + info "Жду запуск Hub..." + i=1 + while [ "$i" -le 20 ]; do + if curl -fsS --max-time 2 http://127.0.0.1:8088/health >/tmp/owrt-remote-health.log 2>&1; then + if curl -fsS --max-time 2 http://127.0.0.1/health >/dev/null 2>&1; then + HUB_PORT80_OK=1 + fi + return 0 + fi + sleep 1 + i=$((i + 1)) + done warn "Hub не ответил на http://127.0.0.1:8088/health" $SUDO systemctl status owrt-remote --no-pager -l || true $SUDO journalctl -u owrt-remote -n 80 --no-pager || true