Files
meterbox/scripts/up.sh
T
2026-09-19 02:45:52 +00:00

28 lines
648 B
Bash
Executable File

#!/usr/bin/env bash
set -euo pipefail
ROOT="$(cd "$(dirname "$0")/.." && pwd)"
cd "$ROOT"
DOCKER=(docker)
if ! docker info >/dev/null 2>&1; then
DOCKER=(sudo docker)
fi
echo "==> iptables snapshot (pre)"
sudo iptables -L -n -v | head -40 || true
echo "==> building & starting meterbox (Docker, localhost-only)"
"${DOCKER[@]}" compose up -d --build
echo "==> published / listening check"
ss -tlnp | grep 8787 || true
"${DOCKER[@]}" compose ps
echo "==> health"
sleep 2
curl -sf http://127.0.0.1:8787/api/health
echo
curl -sf http://127.0.0.1:8787/api/health | grep -q '"ok":true'
echo "Meterbox up at http://127.0.0.1:8787 (127.0.0.1 only)"