Created
November 29, 2024 12:12
-
-
Save dp-singh/237ac86d2cad9ab6851a15a0c201380d to your computer and use it in GitHub Desktop.
Arctic Wolf Agent Uninstallation Script
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Check if the uninstall script exists | |
if [ -f /Library/ArcticWolfNetworks/Agent/uninstall.sh ]; then | |
echo "Uninstall script found. Proceeding with uninstallation." | |
# Check if the Arctic Wolf Agent is running | |
if pgrep -f "ArcticWolfNetworks" > /dev/null; then | |
echo "Arctic Wolf Agent is running. Stopping the service..." | |
# Attempt to stop the service | |
sudo launchctl unload /Library/LaunchDaemons/com.arcticwolf.agent.plist 2>/dev/null | |
if [ $? -eq 0 ]; then | |
echo "Service stopped successfully." | |
else | |
echo "Failed to stop the service. Proceeding with uninstallation anyway." | |
fi | |
else | |
echo "Arctic Wolf Agent is not running." | |
fi | |
# Run the uninstall script | |
sudo /Library/ArcticWolfNetworks/Agent/uninstall.sh | |
if [ $? -eq 0 ]; then | |
echo "Arctic Wolf Agent uninstalled successfully." | |
exit 0 | |
else | |
echo "Uninstallation script encountered an error." | |
exit 1 | |
fi | |
else | |
echo "Uninstall script not found. Arctic Wolf Agent may not be installed." | |
exit 1 | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Script Name: Arctic Wolf Agent Uninstallation Script
Description:
This script is designed to uninstall the Arctic Wolf Agent from macOS devices. It performs the following actions:
exit 0
) or failure (exit 1
).Use Case:
This script is intended for use in environments where the Arctic Wolf Agent needs to be removed from managed macOS devices, such as through an MDM platform like Kandji. It ensures a clean and graceful uninstallation process, even if the agent is actively running.
Key Features:
Requirements:
/Library/ArcticWolfNetworks/Agent/uninstall.sh
.Exit Codes:
0
: Uninstallation completed successfully.1
: Uninstallation failed (e.g., uninstall script not found, service stop failed, or uninstall script error).Notes:
com.arcticwolf.agent.plist
). Update the script if the service name differs.