mirror of
https://gh.catmak.name/https://github.com/mihomo-party-org/mihomo-party
synced 2025-12-27 05:00:30 +08:00
27 lines
578 B
Bash
27 lines
578 B
Bash
#!/bin/sh
|
|
set -e
|
|
|
|
# 检查 root 权限
|
|
if [ "$EUID" -ne 0 ]; then
|
|
echo "Please run as root"
|
|
exit 1
|
|
fi
|
|
|
|
HELPER_PATH="/Library/PrivilegedHelperTools/party.mihomo.helper"
|
|
LAUNCH_DAEMON="/Library/LaunchDaemons/party.mihomo.helper.plist"
|
|
|
|
# 停止并卸载现有的 LaunchDaemon
|
|
if [ -f "$LAUNCH_DAEMON" ]; then
|
|
launchctl unload "$LAUNCH_DAEMON" 2>/dev/null || true
|
|
rm -f "$LAUNCH_DAEMON"
|
|
fi
|
|
|
|
# 移除 helper 工具
|
|
rm -f "$HELPER_PATH"
|
|
|
|
# 清理可能存在的旧版本文件
|
|
rm -rf "/Applications/Mihomo Party.app"
|
|
rm -rf "/Applications/Mihomo\\ Party.app"
|
|
|
|
exit 0
|