#!/usr/bin/env bash
set -euo pipefail

if [ "$(id -u)" -ne 0 ]; then
  echo "Please run as root: sudo ./uninstall.sh"
  exit 1
fi

systemctl stop gal2-timecontract.service 2>/dev/null || true
systemctl disable gal2-timecontract.service 2>/dev/null || true
rm -f /etc/systemd/system/gal2-timecontract.service
systemctl daemon-reload

echo "GAL-2 Time Contract service removed from systemd."
echo "Preserved /opt/gal2 and /etc/gal2 by default."
echo "Remove manually only if you intentionally want to delete local cache/config."
