#!/usr/bin/env bash
# Снимает LaunchAgent com.hunab.telegram-socks-via-do.
set -e
PLIST_NAME="com.hunab.telegram-socks-via-do.plist"
DST="$HOME/Library/LaunchAgents/$PLIST_NAME"

GUI_UID=$(id -u)
launchctl bootout "gui/$GUI_UID/com.hunab.telegram-socks-via-do" 2>/dev/null || true
launchctl unload "$DST" 2>/dev/null || true
rm -f "$DST"
rm -f "$HOME/Library/Application Support/hunab/telegram-socks-launch.sh"
echo "Uninstalled: $DST (and launch helper if present)"
