#!/bin/bash # Kao Uninstall Script set -e INSTALL_DIR="/opt/kao" SERVICE_FILE="/etc/systemd/system/kao.service" echo "====================================" echo " Kao Uninstaller" echo "====================================" # Check permissions if [ ! -w "/opt" ]; then echo "Error: Need write access" echo "Run with: sudo $0" exit 1 fi # Stop and disable service echo "[1/3] Stopping service..." systemctl stop kao.service 2>/dev/null || true systemctl disable kao.service 2>/dev/null || true # Remove service file echo "[2/3] Removing systemd service..." rm -f "$SERVICE_FILE" systemctl daemon-reload # Remove install directory echo "[3/3] Removing files..." rm -rf "$INSTALL_DIR" echo "" echo "Kao has been uninstalled."