#!/usr/bin/env bash main() { local quiet= local json= for arg in "$@"; do if [ "$arg" = --help ]; then printf 'Usage: %s [--quiet]\n\n' "${0##*/}" printf 'Healthcheck script for Orchestra E2E tests.\n' printf 'Exits 0 with a success message if all checks pass.\n' printf ' --quiet Suppress the success message; still exits 0.\n' exit 0 elif [ "$arg" = --quiet ]; then quiet=1 elif [ "$arg" = --json ]; then json=1 fi done if [ -n "$json" ]; then printf '{"status":"ok","checks":1}\n' exit 0 fi [ -n "$quiet" ] || printf 'OK - all healthchecks passed\n' exit 0 } main "$@"