From b2e4ce7261e4de360b7be86b47b8e2cc91d09b8d Mon Sep 17 00:00:00 2001 From: Jake Turner Date: Wed, 18 Feb 2026 20:44:58 +0000 Subject: [PATCH] ops: add optional storage dir removal to uninstall script --- README.md | 6 +----- install/uninstall_nomad.sh | 21 +++++++++++++++++++-- 2 files changed, 20 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 89a2c78..5925c6b 100644 --- a/README.md +++ b/README.md @@ -160,9 +160,5 @@ sudo bash /opt/project-nomad/update_nomad.sh ###### Uninstall Script - Need to start fresh? Use the uninstall script to make your life easy. Note: this cannot be undone! ```bash -curl -fsSL https://raw.githubusercontent.com/Crosstalk-Solutions/project-nomad/refs/heads/master/install/uninstall_nomad.sh -o uninstall_nomad.sh -``` - -```bash -sudo bash uninstall_nomad.sh +curl -fsSL https://raw.githubusercontent.com/Crosstalk-Solutions/project-nomad/refs/heads/master/install/uninstall_nomad.sh -o uninstall_nomad.sh && sudo bash uninstall_nomad.sh ``` \ No newline at end of file diff --git a/install/uninstall_nomad.sh b/install/uninstall_nomad.sh index 7db9fac..dcadf48 100644 --- a/install/uninstall_nomad.sh +++ b/install/uninstall_nomad.sh @@ -95,6 +95,23 @@ try_remove_disk_info_file() { fi } +storage_cleanup() { + read -p "Do you want to delete the Project N.O.M.A.D. storage directory (${NOMAD_DIR})? This is best if you want to start a completely fresh install. This will PERMANENTLY DELETE all stored Nomad data and can't be undone! (y/N): " delete_dir_choice + case "$delete_dir_choice" in + y|Y ) + echo "Removing Project N.O.M.A.D. files..." + if rm -rf "${NOMAD_DIR}"; then + echo "Project N.O.M.A.D. files removed." + else + echo "Warning: Failed to fully remove ${NOMAD_DIR}. You may need to remove it manually." + fi + ;; + * ) + echo "Skipping removal of ${NOMAD_DIR}." + ;; + esac +} + uninstall_nomad() { echo "Stopping and removing Project N.O.M.A.D. management containers..." docker compose -p project-nomad -f "${MANAGEMENT_COMPOSE_FILE}" down @@ -124,8 +141,8 @@ uninstall_nomad() { # Try to remove the disk info file if it exists try_remove_disk_info_file - echo "Removing Project N.O.M.A.D. files..." - rm -rf "${NOMAD_DIR}" + # Prompt user for storage cleanup and handle it if so + storage_cleanup echo "Project N.O.M.A.D. has been uninstalled. We hope to see you again soon!" }