Files

25 lines
738 B
Bash
Executable File

#!/bin/bash
# Dashboard systemd wrapper — kills stale processes before starting
# to prevent "address already in use" crash loops after updates.
HERMES_HOME="${HERMES_HOME:-$HOME/.hermes}"
VENV_PYTHON="$HERMES_HOME/hermes-agent/venv/bin/python"
# Kill any dashboard processes OTHER than ourselves
MY_PID=$$
for pid in $(ps -A -o pid=,command= 2>/dev/null | grep -E "hermes.*dashboard" | grep -v grep | awk '{print $1}'); do
[ "$pid" = "$MY_PID" ] && continue
echo "→ killing stale dashboard PID $pid"
kill "$pid" 2>/dev/null
done
# Give ports time to release
sleep 2
exec "$VENV_PYTHON" -m hermes_cli.main dashboard \
--host 0.0.0.0 \
--port 9119 \
--insecure \
--no-open \
--skip-build \
--tui