22 lines
358 B
Bash
Executable file
22 lines
358 B
Bash
Executable file
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
|
|
cd "$(dirname "$0")"
|
|
|
|
if [[ -f .env ]]; then
|
|
set -a
|
|
# shellcheck disable=SC1091
|
|
source .env
|
|
set +a
|
|
else
|
|
echo "Missing .env. Copy .env.example to .env and edit it." >&2
|
|
exit 1
|
|
fi
|
|
|
|
if [[ -x .venv/bin/python ]]; then
|
|
PYTHON=.venv/bin/python
|
|
else
|
|
PYTHON=python3
|
|
fi
|
|
|
|
"$PYTHON" ha_observer.py "${1:-collect}"
|