From fc93201313590e15c0bd03466476a5e686daf9e6 Mon Sep 17 00:00:00 2001 From: cclohmar Date: Sat, 11 Jul 2026 08:57:36 +0100 Subject: [PATCH] install mode: detect existing install and deflect to --update or --destroy --- tools/nextwks.sh | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/tools/nextwks.sh b/tools/nextwks.sh index 75adc56..cf013b6 100755 --- a/tools/nextwks.sh +++ b/tools/nextwks.sh @@ -45,9 +45,21 @@ DOMAIN="${DOMAIN:-nextwks.eu}" echo "=== NextWorkspace ${MODE} ===" # ============================================================ -# 1. INSTALL MODE — first-time setup +# 1. INSTALL MODE — first-time setup (only on bare VM) # ============================================================ if [ "$MODE" = "install" ]; then + if [ -f "$TARGET_DIR/nextworkspace" ]; then + echo "=================================================================" + echo " NextWorkspace is already installed at $TARGET_DIR" + echo "" + echo " Use --update to rebuild and restart:" + echo " ./nextwks.sh --update" + echo "" + echo " Use --destroy for a full greenfield redeploy:" + echo " ./nextwks.sh --destroy" + echo "=================================================================" + exit 0 + fi echo "[*] Installing system dependencies..." maybe_sudo apt-get update -qq maybe_sudo apt-get install -y -qq git build-essential curl podman podman-compose iptables-persistent