From 339e5c5ea693902c4af80103c565a97cc0675450 Mon Sep 17 00:00:00 2001 From: Christopher Date: Tue, 21 Nov 2023 13:49:24 -0600 Subject: [PATCH] Add uninstall-dockge script and README.md --- uninstall-dockge/README.md | 9 +++++++++ uninstall-dockge/run.sh | 27 +++++++++++++++++++++++++++ 2 files changed, 36 insertions(+) create mode 100644 uninstall-dockge/README.md create mode 100644 uninstall-dockge/run.sh diff --git a/uninstall-dockge/README.md b/uninstall-dockge/README.md new file mode 100644 index 0000000..baa449c --- /dev/null +++ b/uninstall-dockge/README.md @@ -0,0 +1,9 @@ +## Why? + +The script is a Bash script designed to facilitate the uninstallation of Dockge, a containerized application. + +## How to use? + +```bash +bash -c "$(wget -qLO - https://raw.githubusercontent.com/bigbeartechworld/big-bear-scripts/master/uninstall-dockge/run.sh)" +``` diff --git a/uninstall-dockge/run.sh b/uninstall-dockge/run.sh new file mode 100644 index 0000000..4490763 --- /dev/null +++ b/uninstall-dockge/run.sh @@ -0,0 +1,27 @@ +#!/bin/bash + +# Check if the script is run as root +if [[ $EUID -ne 0 ]]; then + echo "This script must be run as root." + exit 1 +fi + +# Stop and remove the Dockge containers +if command -v docker &> /dev/null; then + # Using Docker CE + echo "Stopping and removing Dockge containers with Docker CE..." + docker compose -f /opt/dockge/compose.yaml -p dockge down +elif command -v podman &> /dev/null; then + # Using Podman + echo "Stopping and removing Dockge containers with Podman..." + podman-compose -f /opt/dockge/compose.yaml down +else + echo "Neither Docker CE nor Podman is installed. Nothing to uninstall." + exit 1 +fi + +# Remove the Dockge directories +echo "Removing Dockge directories..." +rm -rf /opt/stacks /opt/dockge + +echo "Dockge has been uninstalled."