#!/usr/bin/env bash set -euo pipefail BASE_URL="${1:-http://127.0.0.1}" TOKEN="${MEDWORK_API_TOKEN:-}" echo "[SMOKE] Base URL: ${BASE_URL}" echo "[SMOKE] Checking /health ..." curl -sS "${BASE_URL}/health" | cat echo echo echo "[SMOKE] Checking /license/status without token (expect 401) ..." code=$(curl -sS -o /dev/null -w "%{http_code}" "${BASE_URL}/license/status" || true) echo "HTTP ${code}" echo if [[ -n "${TOKEN}" ]]; then echo "[SMOKE] Checking /license/status with token ..." curl -sS -H "X-API-Token: ${TOKEN}" -H "X-Device-Id: smoke-device" "${BASE_URL}/license/status" | cat echo echo else echo "[SMOKE] MEDWORK_API_TOKEN not set in environment; skipping authorized call." echo fi echo "[SMOKE] Done."