Initial resurrection kit — 81 scripts, 62 references, configs, systemd units, crons, Docker compose files, Caddy config, master README
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
#!/bin/bash
|
||||
# restarts Anita's Hermes gateway to pick up new config
|
||||
|
||||
PID_FILE="$HOME/.hermes/profiles/anita/gateway.pid"
|
||||
|
||||
if [ -f "$PID_FILE" ]; then
|
||||
OLD_PID=$(python3 -c "import json; print(json.load(open('$PID_FILE'))['pid'])" 2>/dev/null)
|
||||
if [ -n "$OLD_PID" ] && kill -0 "$OLD_PID" 2>/dev/null; then
|
||||
kill -15 "$OLD_PID"
|
||||
sleep 3
|
||||
kill -0 "$OLD_PID" 2>/dev/null && kill -9 "$OLD_PID" 2>/dev/null
|
||||
sleep 1
|
||||
fi
|
||||
fi
|
||||
|
||||
# Start gateway
|
||||
cd "$HOME" && nohup /usr/local/lib/hermes-agent/venv/bin/python -m hermes_cli.main --profile anita gateway run > /dev/null 2>&1 &
|
||||
echo "Anita's gateway restarted"
|
||||
Reference in New Issue
Block a user