mirror of
https://github.com/Finesssee/ProxyPilot.git
synced 2026-11-18 18:04:20 +00:00
21 lines
454 B
Bash
21 lines
454 B
Bash
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
|
|
if [[ "$(uname -s)" != "Darwin" ]]; then
|
|
echo "launchd autostart is macOS-only." >&2
|
|
exit 1
|
|
fi
|
|
|
|
label="com.cliproxyapi"
|
|
plist_path="$HOME/Library/LaunchAgents/${label}.plist"
|
|
uid="$(id -u)"
|
|
|
|
if [[ -f "$plist_path" ]]; then
|
|
launchctl bootout "gui/${uid}" "$plist_path" >/dev/null 2>&1 || true
|
|
rm -f "$plist_path"
|
|
echo "Removed LaunchAgent: $plist_path"
|
|
else
|
|
echo "LaunchAgent not found: $plist_path"
|
|
fi
|
|
|