From 19901146278b475d57b21376abea5cc2d6108714 Mon Sep 17 00:00:00 2001 From: goodvin Date: Sat, 21 Mar 2026 10:57:59 +0300 Subject: [PATCH] dns healthcheck --- scripts/deploy-to-gateway.sh | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/scripts/deploy-to-gateway.sh b/scripts/deploy-to-gateway.sh index 3205164..257df44 100644 --- a/scripts/deploy-to-gateway.sh +++ b/scripts/deploy-to-gateway.sh @@ -120,13 +120,23 @@ dns_health_check() { fi } -echo "Running DNS health check ($DNS_CHECK_DOMAIN via $DNS_LISTEN_ADDR)..." -if ! dns_health_check; then - echo "Error: DNS health check failed — Pi-hole not responding on $DNS_LISTEN_ADDR" +echo "Running DNS health check ($DNS_CHECK_DOMAIN via $DNS_LISTEN_ADDR, up to 15 attempts)..." +dns_ok=false +for i in $(seq 1 15); do + if dns_health_check; then + dns_ok=true + echo "DNS health check passed (attempt $i)" + break + fi + echo " attempt $i failed, retrying in 1s..." + sleep 1 +done + +if ! $dns_ok; then + echo "Error: DNS health check failed after 15 attempts — Pi-hole not responding on $DNS_LISTEN_ADDR" rollback exit 1 fi -echo "DNS health check passed" # ============================== # Очистка IPSET