Files
go-alived/deployment/uninstall.sh
loveuer 894ddb53d3 feat: initial VRRP implementation with health checking
- VRRP protocol implementation (RFC 3768/5798)
- Virtual IP management (add/remove VIPs)
- State machine (INIT/BACKUP/MASTER/FAULT)
- Priority-based master election
- Gratuitous ARP for network updates
- Health checking (TCP, HTTP, ICMP, Script)
- Configuration hot-reload (SIGHUP)

🤖 Generated with [Qoder][https://qoder.com]
2026-03-04 00:13:35 -08:00

54 lines
1.2 KiB
Bash
Executable File

#!/bin/bash
set -e
echo "=== Uninstalling go-alived ==="
if [ "$EUID" -ne 0 ]; then
echo "Please run as root (use sudo)"
exit 1
fi
BINARY_PATH="/usr/local/bin/go-alived"
CONFIG_DIR="/etc/go-alived"
SERVICE_FILE="/etc/systemd/system/go-alived.service"
if systemctl is-active --quiet go-alived; then
echo "1. Stopping service..."
systemctl stop go-alived
echo " ✓ Service stopped"
fi
if systemctl is-enabled --quiet go-alived 2>/dev/null; then
echo "2. Disabling service..."
systemctl disable go-alived
echo " ✓ Service disabled"
fi
if [ -f "${SERVICE_FILE}" ]; then
echo "3. Removing service file..."
rm ${SERVICE_FILE}
systemctl daemon-reload
echo " ✓ Service file removed"
fi
if [ -f "${BINARY_PATH}" ]; then
echo "4. Removing binary..."
rm ${BINARY_PATH}
echo " ✓ Binary removed"
fi
echo ""
read -p "Do you want to remove configuration directory ${CONFIG_DIR}? (y/N) " -n 1 -r
echo
if [[ $REPLY =~ ^[Yy]$ ]]; then
if [ -d "${CONFIG_DIR}" ]; then
rm -rf ${CONFIG_DIR}
echo " ✓ Configuration removed"
fi
else
echo " ⚠ Configuration kept at ${CONFIG_DIR}"
fi
echo ""
echo "=== Uninstallation complete ==="