From a29e969eed6de788e6160b3a974830f0d963c767 Mon Sep 17 00:00:00 2001 From: hardy Date: Fri, 9 Jun 2023 20:06:36 +0800 Subject: [PATCH] fix agent service check --- config/install_agent.tpl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/config/install_agent.tpl b/config/install_agent.tpl index 47c365f8..b4fca796 100644 --- a/config/install_agent.tpl +++ b/config/install_agent.tpl @@ -213,7 +213,9 @@ fi $sudo_cmd chmod +x $agent_exc #try to stop and uninstall service -if [[ -e /etc/systemd/system/agent.service ]]; then +macos=/Library/LaunchDaemons/agent.plist +linux=/etc/systemd/system/agent.service +if [[ -f "$linux" || -f "$macos" ]]; then printf "\n* stop && uninstall service\n" $sudo_cmd $agent_exc -service stop &>/dev/null $sudo_cmd $agent_exc -service uninstall &>/dev/null