Created
February 12, 2016 13:49
-
-
Save pauloconnor/4ee6bbd6569cf27b853a to your computer and use it in GitHub Desktop.
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_daemon() { | |
local DAEMON="$1" | |
ps axo pid,command | grep -i "$DAEMON" | |
find /Library/LaunchAgents | grep -i "$DAEMON" | while read -sr f; do | |
echo "launchctl unload $f" | |
done | |
find /Library/LaunchDaemons | grep -i "$DAEMON" | while read -sr f; do | |
echo "launchctl unload $f" | |
done | |
find /Library/LaunchAgents | grep -i "$DAEMON" | while read -sr f; do | |
echo "rm $f" | |
done | |
find /Library/LaunchDaemons | grep -i "$DAEMON" | while read -sr f; do | |
echo "rm $f" | |
done | |
} | |
WHAT=jamf | |
echo "----- Checking: $WHAT" | |
check_daemon "$WHAT" | |
echo "-----" | |
echo "----- Remove Sophos (might want to reboot afterwards)" | |
ps axo pid,command | grep -i sophos | |
kextstat | grep -i sophos | |
echo "open \"/Library/Sophos Anti-Virus/Remove Sophos Anti-Virus.app\"" | |
echo "-----" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment