#!/bin/bash # Health check script for Gitea MCP Remote # # Used by Docker healthcheck and monitoring systems. # Returns exit code 0 if healthy, 1 if unhealthy. set -e HOST="${HTTP_HOST:-localhost}" PORT="${HTTP_PORT:-8080}" ENDPOINT="http://${HOST}:${PORT}/health" # Make request and check response response=$(curl -sf "$ENDPOINT" 2>/dev/null) || exit 1 # Verify JSON response contains status: ok if echo "$response" | grep -q '"status".*"ok"'; then exit 0 else exit 1 fi