#!/usr/bin/env bash
# Serves root/tools/recon.html + root/tools/pub/* on port 9000 (or $1).
set -euo pipefail
HERE="$(cd "$(dirname "$0")" && pwd)"
cd "$HERE/../tools"
PORT="${1:-9000}"
IP="$(hostname -I 2>/dev/null | awk '{print $1}')"
[ -n "$IP" ] || IP=""
echo "TV URL: http://$IP:$PORT/recon.html"
echo "Pub dir: $(pwd)/pub"
echo "Captures:$(pwd)/captures"
exec python3 server.py "$PORT"