#!/bin/bash
#
# Health check script for sample-python-service (check_command mode).
# Runs a custom health check command.

set -euo pipefail

SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
MONITORING_DIR="$(dirname "$SCRIPT_DIR")"
SERVICE_DIR="$(dirname "$MONITORING_DIR")"
DIST_ROOT="$(dirname "$SERVICE_DIR")"

cd "$DIST_ROOT"
exec curl -sf http://localhost:8080/health
