#!/usr/bin/env bash set -euo pipefail # Trace probe script for Restreamer Core # Usage: ./scripts/trace_probe.sh # Reads REACT_APP_CORE_URL from .env if present. Optionally set API_TOKEN env var. # load .env if exists (simple parser) if [ -f .env ]; then export $(grep -v '^#' .env | xargs) fi CORE_URL=${REACT_APP_CORE_URL:-http://localhost:8080} API_TOKEN=${API_TOKEN:-} if [ "$#" -lt 2 ]; then echo "Usage: $0 " echo "Example: $0 channel1 http://example.com/stream.m3u8" exit 2 fi CHANNEL_ID=$1 SOURCE_URL=$2 PROBE_ID="${CHANNEL_ID}_probe_$(date +%s)" # Build JSON payload for the probe process read -r -d '' PAYLOAD </report if you need more details."