#!/usr/bin/env bash
# Used by systemd ga-monitor-run.service (timer).
set -euo pipefail
ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
cd "$ROOT"
if [[ -x "$ROOT/.venv/bin/python" ]]; then
  exec "$ROOT/.venv/bin/python" "$ROOT/run_monitors.py"
fi
echo "run_monitors.sh: missing $ROOT/.venv/bin/python" >&2
exec /usr/bin/python3 "$ROOT/run_monitors.py"
