addded unisntall script
This commit is contained in:
parent
0a3e744ca9
commit
e68e4c01fa
37
uninstall.sh
Executable file
37
uninstall.sh
Executable file
|
|
@ -0,0 +1,37 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# --- Configuration ---
|
||||||
|
COMPOSE_FILE="docker-compose.yml"
|
||||||
|
DATA_DIRS=("db_data" "filerun_html" "user_data")
|
||||||
|
# ---------------------
|
||||||
|
|
||||||
|
echo "🛑 Stopping and removing all services defined in ${COMPOSE_FILE}..."
|
||||||
|
# docker compose down: Stops containers, removes containers, and removes networks
|
||||||
|
# --volumes: Removes anonymous volumes, though we are using named directories.
|
||||||
|
docker compose -f "${COMPOSE_FILE}" down --volumes
|
||||||
|
|
||||||
|
if [ $? -ne 0 ]; then
|
||||||
|
echo "❌ Docker Compose failed to stop and remove services. Aborting data removal."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "---"
|
||||||
|
echo "🗑️ Removing persistent data directories..."
|
||||||
|
|
||||||
|
for dir in "${DATA_DIRS[@]}"; do
|
||||||
|
if [ -d "$dir" ]; then
|
||||||
|
echo " -> Removing directory: ${dir}/"
|
||||||
|
# The 'rm -rf' command deletes the directory and all its contents
|
||||||
|
sudo rm -rf "$dir"
|
||||||
|
if [ $? -eq 0 ]; then
|
||||||
|
echo " [SUCCESS]"
|
||||||
|
else
|
||||||
|
echo " [FAILED] Could not remove ${dir}. Manual intervention may be required."
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
echo " -> Directory not found: ${dir}/ (Skipping)"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
echo "---"
|
||||||
|
echo "✅ Uninstallation complete. All data and services have been removed."
|
||||||
Loading…
Reference in a new issue