#!/bin/bash # Uninstall script for absRecommend systemd service set -e # Exit on error SERVICE_NAME="absrecommend" echo "=========================================" echo "absRecommend Service Removal" echo "=========================================" echo "" # Check if running as root if [ "$EUID" -eq 0 ]; then echo "ERROR: Please run this script as a regular user (not root/sudo)" echo "The script will prompt for sudo password when needed" exit 1 fi # Stop service echo "Stopping service..." sudo systemctl stop $SERVICE_NAME || true # Disable service echo "Disabling service..." sudo systemctl disable $SERVICE_NAME || true # Remove service file echo "Removing service file..." sudo rm -f /etc/systemd/system/${SERVICE_NAME}.service # Reload systemd echo "Reloading systemd..." sudo systemctl daemon-reload # Reset failed state sudo systemctl reset-failed || true echo "" echo "=========================================" echo "Service Removed Successfully" echo "=========================================" echo "" echo "The service has been stopped, disabled, and removed." echo "You can now run the application manually with:" echo " ./venv/bin/python main.py" echo ""