Files
CoreInject/res/uninstall_daemon.sh
2025-11-16 05:39:11 +08:00

33 lines
771 B
Bash
Executable File

#!/bin/bash
# Hayaku HTTP守护进程卸载脚本
set -e
echo "卸载Hayaku HTTP守护进程..."
# 检查是否以root权限运行
if [ "$EUID" -ne 0 ]; then
echo "请使用sudo运行此脚本"
exit 1
fi
PLIST_NAME="com.qiuchenly.hayaku.daemon.plist"
INSTALL_DIR="/Library/Application Support/Hayaku"
# 停止并卸载服务
echo "停止服务..."
launchctl stop "com.qiuchenly.hayaku.daemon" 2>/dev/null || true
launchctl unload "/Library/LaunchDaemons/$PLIST_NAME" 2>/dev/null || true
# 删除文件
echo "删除文件..."
rm -rf "$INSTALL_DIR/HayakuDaemon.app"
rm -rf "$INSTALL_DIR/tool"
rm -rf "$INSTALL_DIR"
rm -f "/Library/LaunchDaemons/$PLIST_NAME"
rm -f "/var/log/hayaku_daemon.log"
rm -f "/var/log/hayaku_daemon_error.log"
echo "卸载完成!"