Files
gniza4cp/scripts/uninstall.sh
shuki 1459bd1b8b Initial commit: gniza backup & disaster recovery CLI + WHM plugin
Full-featured cPanel backup tool with SSH, S3, and Google Drive support.
Includes WHM plugin with Tailwind/DaisyUI UI, multi-remote management,
decoupled schedules, and account restore workflows.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-04 02:39:39 +02:00

46 lines
1.3 KiB
Bash
Executable File

#!/usr/bin/env bash
# gniza uninstall script
set -euo pipefail
INSTALL_DIR="/usr/local/gniza"
BIN_LINK="/usr/local/bin/gniza"
if [[ $EUID -ne 0 ]]; then
echo "Error: uninstall.sh must be run as root" >&2
exit 1
fi
echo "Uninstalling gniza..."
# Remove symlink
if [[ -L "$BIN_LINK" ]]; then
rm -f "$BIN_LINK"
echo "Removed $BIN_LINK"
fi
# Remove install directory
if [[ -d "$INSTALL_DIR" ]]; then
rm -rf "$INSTALL_DIR"
echo "Removed $INSTALL_DIR"
fi
# ── WHM Plugin ────────────────────────────────────────────────
WHM_CGI_DIR="/usr/local/cpanel/whostmgr/docroot/cgi"
if [[ -d "$WHM_CGI_DIR/gniza-whm" ]]; then
echo "Removing WHM plugin..."
/usr/local/cpanel/bin/unregister_appconfig gniza-whm 2>/dev/null || true
rm -rf "$WHM_CGI_DIR/gniza-whm"
echo "WHM plugin removed."
fi
echo ""
echo "gniza uninstalled."
echo ""
echo "The following were NOT removed (manual cleanup if desired):"
echo " /etc/gniza/ (configuration + remotes.d/)"
echo " /var/log/gniza/ (log files)"
echo " /var/run/gniza.lock (lock file)"
echo ""
echo "To remove gniza cron entries: crontab -l | grep -v '# gniza:' | grep -v '/usr/local/bin/gniza' | crontab -"