#!/usr/bin/env bash set -e # ------------------------------- # DockShip Uninstaller # ------------------------------- echo "\x1b[31mDockShip Uninstaller\x1b[0m" echo "This will stop and remove DockShip from your system." echo "" # Confirm uninstall read -p "Are you sure you want to uninstall DockShip? [y/N]: " confirm if [[ ! "$confirm" =~ ^([yY][eE][sS]|[yY])$ ]]; then echo "Aborting uninstall." exit fi # Stop and disable systemd service echo "" echo "Stopping DockShip service..." sudo systemctl stop dockship || true sudo systemctl disable dockship || true # Remove systemd service file SERVICE_FILE="/etc/systemd/system/dockship.service" if [ -f "$SERVICE_FILE" ]; then echo "Removing systemd service file..." sudo rm -f "$SERVICE_FILE" sudo systemctl daemon-reload sudo systemctl reset-failed fi # Remove local files INSTALL_DIR=$(pwd) echo "" echo "Cleaning DockShip files in $INSTALL_DIR..." rm -f "$INSTALL_DIR/.env" rm -rf "$INSTALL_DIR/node_modules" rm -rf "$INSTALL_DIR/.next" # Optional: remove other DockShip data directories (like logs or uploaded files) # rm -rf "$INSTALL_DIR/data" echo "" echo "DockShip has been uninstalled." echo "You may also want to remove the DockShip directory if desired."