feat: make uninstall prompts before wiping data
Shows a warning then asks: y = full wipe, n/Enter = stop+remove images only (keep config/data), anything else = cancel. Updates help + README. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -35,7 +35,7 @@ help:
|
||||
@echo "Updates & reinstall:"
|
||||
@echo " update - git pull + rebuild + restart (deploy latest code)"
|
||||
@echo " reinstall - Full wipe and fresh install from current git checkout"
|
||||
@echo " uninstall - Remove containers, images, and all data (keeps git repo)"
|
||||
@echo " uninstall - Stop + remove images; prompts whether to also wipe data"
|
||||
@echo ""
|
||||
@echo "Build:"
|
||||
@echo " build - Rebuild API image"
|
||||
@@ -133,10 +133,28 @@ reinstall:
|
||||
@echo "Reinstall complete."
|
||||
|
||||
uninstall:
|
||||
@echo "Uninstalling Personal Internet Cell..."
|
||||
PUID=$$(id -u) PGID=$$(id -g) $(DC) down -v --rmi all 2>/dev/null || true
|
||||
@sudo rm -rf config/ data/
|
||||
@echo "Uninstall complete. Git repo and scripts remain."
|
||||
@echo ""
|
||||
@echo "WARNING: This will stop all containers and remove all Docker images."
|
||||
@echo ""
|
||||
@printf "Also wipe all data and config? This cannot be undone. [y/N/cancel]: "; \
|
||||
read ans; \
|
||||
case "$$ans" in \
|
||||
y|Y) \
|
||||
echo "Stopping containers and removing images..."; \
|
||||
PUID=$$(id -u) PGID=$$(id -g) $(DC) down -v --rmi all 2>/dev/null || true; \
|
||||
echo "Wiping config/ and data/..."; \
|
||||
sudo rm -rf config/ data/; \
|
||||
echo "Uninstall complete. Git repo and scripts remain."; \
|
||||
;; \
|
||||
n|N|"") \
|
||||
echo "Stopping containers and removing images (keeping data)..."; \
|
||||
PUID=$$(id -u) PGID=$$(id -g) $(DC) down --rmi all 2>/dev/null || true; \
|
||||
echo "Done. config/ and data/ are untouched. Run 'make setup && make start' to reinstall."; \
|
||||
;; \
|
||||
*) \
|
||||
echo "Cancelled."; \
|
||||
;; \
|
||||
esac
|
||||
|
||||
# ── Build ─────────────────────────────────────────────────────────────────────
|
||||
|
||||
|
||||
@@ -130,7 +130,7 @@ make update # git pull + rebuild + restart
|
||||
make reinstall # stop, wipe config/data, setup, start fresh
|
||||
|
||||
# Remove everything
|
||||
make uninstall # stop containers, remove images and all data
|
||||
make uninstall # stop + remove images; prompts whether to also wipe config/data
|
||||
|
||||
# Maintenance
|
||||
make backup # tar config/ + data/ into backups/
|
||||
|
||||
Reference in New Issue
Block a user