#!/usr/bin/env bash

# If the healthcheck port is overridden from the default, use that instead
HEALTHCHECK_PORT="${HEALTHCHECK_PORT:-8080}"

if [ "$(curl -s http://localhost:${HEALTHCHECK_PORT}/healthcheck | jq '.MaxwellHealth.healthy')" = 'true' ]; then 
  exit 0
else
  exit 1
fi
