Skip to content

Project NOMAD is an offline-first knowledge and education server. Wikipedia, thousands of books, courses, maps, and optional local AI, all running on hardware you own with no internet required.

TypeScript

ops: add optional storage dir removal to uninstall script

Jake Turnerb2e4ce7261e4
diff --git a/README.md b/README.md
index 89a2c782..5925c6ba 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 7db9fac8..dcadf489 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!"
}