#!/bin/bash

# Check for root privileges
if [[ $EUID -ne 0 ]]; then
  echo "This script requires root privileges. Please run with sudo."
  exit 1
fi

echo "Stopping and disabling kjv-api service..."
systemctl stop kjv-api.service
systemctl disable kjv-api.service

echo "Removing kjv-api systemd service file..."
rm /etc/systemd/system/kjv-api.service

echo "Removing kjv-api directory and user..."
rm -rf /opt/kjv-api
userdel kjv

echo "Uninstall complete."
echo "Be sure to remove your webserver configuration file."
