#!/usr/bin/env bash set -euo pipefail smoke_url="${1:-}" [[ "${smoke_url}" =~ ^https?:// ]] || { printf 'a complete http(s) smoke URL is required\n' >&2 exit 1 } for attempt in $(seq 1 24); do if curl --fail --silent \ --connect-timeout 5 \ --max-time 15 \ --output /dev/null \ "${smoke_url}"; then printf 'Smoke check passed.\n' exit 0 fi printf 'Smoke attempt %s/24 failed; retrying in 5 seconds.\n' "${attempt}" >&2 sleep 5 done printf 'Smoke check failed after 24 attempts.\n' >&2 exit 1