install mode: detect existing install and deflect to --update or --destroy

This commit is contained in:
Claus Lohmar 2026-07-11 08:57:36 +01:00
parent fc1a98cbfe
commit fc93201313

View file

@ -45,9 +45,21 @@ DOMAIN="${DOMAIN:-nextwks.eu}"
echo "=== NextWorkspace ${MODE} ===" echo "=== NextWorkspace ${MODE} ==="
# ============================================================ # ============================================================
# 1. INSTALL MODE — first-time setup # 1. INSTALL MODE — first-time setup (only on bare VM)
# ============================================================ # ============================================================
if [ "$MODE" = "install" ]; then 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..." echo "[*] Installing system dependencies..."
maybe_sudo apt-get update -qq maybe_sudo apt-get update -qq
maybe_sudo apt-get install -y -qq git build-essential curl podman podman-compose iptables-persistent maybe_sudo apt-get install -y -qq git build-essential curl podman podman-compose iptables-persistent