diff --git a/deploy/scripts/gateway-entrypoint.sh b/deploy/scripts/gateway-entrypoint.sh index 867c987..1c964ee 100644 --- a/deploy/scripts/gateway-entrypoint.sh +++ b/deploy/scripts/gateway-entrypoint.sh @@ -57,12 +57,18 @@ NFT_CONF="/var/lib/nexavpn/nftables.generated.conf" mkdir -p /etc/wireguard wait_for_backend_dns() { - if getent hosts "${BACKEND_HOST}" >/dev/null 2>&1; then - return 0 + if command -v getent >/dev/null 2>&1; then + if getent hosts "${BACKEND_HOST}" >/dev/null 2>&1; then + return 0 + fi + + echo "Backend host ${BACKEND_HOST} is not resolvable yet." + return 1 fi - echo "Backend host ${BACKEND_HOST} is not resolvable yet." - return 1 + # Alpine-based images may not ship getent. In that case let curl be the + # source of truth for connectivity and retry in the main loop on failure. + return 0 } apply_bundle() {