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

fix(scripts): remove disk info file on uninstall

Jake Turner4bb5dd6a18b4
diff --git a/install/uninstall_nomad.sh b/install/uninstall_nomad.sh
index 836d2573..006f1cd9 100644
--- a/install/uninstall_nomad.sh
+++ b/install/uninstall_nomad.sh
@@ -18,6 +18,7 @@
NOMAD_DIR="/opt/project-nomad"
MANAGEMENT_COMPOSE_FILE="${NOMAD_DIR}/compose.yml"
COLLECT_DISK_INFO_PID="/var/run/nomad-collect-disk-info.pid"
+DISK_INFO_FILE="/tmp/nomad-disk-info.json"
###################################################################################################################################################################################################
# #
@@ -86,6 +87,14 @@ try_remove_disk_info_script() {
fi
}
+try_remove_disk_info_file() {
+ if [ -f "$DISK_INFO_FILE" ]; then
+ echo "Removing disk info file..."
+ rm -f "$DISK_INFO_FILE"
+ echo "Disk info file removed."
+ fi
+}
+
uninstall_nomad() {
echo "Stopping and removing Project N.O.M.A.D. management containers..."
docker compose -f "${MANAGEMENT_COMPOSE_FILE}" down
@@ -104,6 +113,9 @@ uninstall_nomad() {
# Try to stop the collect-disk-info script if it's running
try_remove_disk_info_script
+ # 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}"