#!/bin/sh
# Wrapper for vanguards.
#
# Upstream ships vanguards as ./src/vanguards.py, intended to be run
# directly (no setup.py / pip install). We keep that model: the source
# tree lives in /usr/share/vanguards and we simply exec the entry point.
#
# vanguards must run as the tor user so it can access Tor's control
# socket and write its state file. The init script /etc/rc.d/rc.vanguards
# handles that; for manual invocations use:
#     su -s /bin/sh -c '/usr/local/bin/vanguards ...' tor
#
# PYTHONDONTWRITEBYTECODE avoids __pycache__ writes into the
# root-owned source tree.
PYTHONDONTWRITEBYTECODE=1
export PYTHONDONTWRITEBYTECODE
exec python3 /usr/share/vanguards/src/vanguards.py "$@"
