From 4c19a4b0e9f87ce7f0f47cda871d305a9ae36cd4 Mon Sep 17 00:00:00 2001 From: Damocles Date: Fri, 1 May 2026 14:52:31 +0200 Subject: [PATCH] deploy script: abort if daemon already running --- scripts/deploy.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/scripts/deploy.sh b/scripts/deploy.sh index 119db3e..b1c189f 100755 --- a/scripts/deploy.sh +++ b/scripts/deploy.sh @@ -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