deploy script: abort if daemon already running

This commit is contained in:
Damocles 2026-05-01 14:52:31 +02:00
parent 548f70ba72
commit 4c19a4b0e9

View file

@ -8,6 +8,14 @@ REPO="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
TARGET=/persist/damocles-lab
STATE="$TARGET/state"
echo "==> checking for running daemon in lab"
if RUNNING=$(~/lab.sh "pgrep -af damocles-daemon" 2>/dev/null); then
echo "ERROR: daemon is running in lab - won't overwrite live binary." >&2
echo "$RUNNING" >&2
echo "Stop it first: ~/lab.sh \"pkill damocles-daemon\"" >&2
exit 1
fi
echo "==> building"
cd "$REPO"
nix develop --command cargo build --bin damocles-daemon --bin damocles-mcp 2>&1 | tail -3