Files
Kao/uninstall.sh
Spencer Grimes 81c23308cc Fix Linux installer ownership and path issues
- Use SCRIPT_DIR to find source files from any directory
- Create venv as target user (sudo -u) for correct ownership
- Add python3 existence check
- Add source file existence check
- Add group to systemd service
- Fix uninstall.sh root check

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-02 23:34:08 -06:00

36 lines
752 B
Bash

#!/bin/bash
# Kao Uninstall Script
set -e
INSTALL_DIR="/opt/kao"
SERVICE_FILE="/etc/systemd/system/kao.service"
echo "===================================="
echo " Kao Uninstaller"
echo "===================================="
# Check if running as root
if [ "$EUID" -ne 0 ]; then
echo "Error: Must run as root"
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."