Skip to content

Instantly share code, notes, and snippets.

@pauloconnor
Created February 12, 2016 13:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pauloconnor/4ee6bbd6569cf27b853a to your computer and use it in GitHub Desktop.
Save pauloconnor/4ee6bbd6569cf27b853a to your computer and use it in GitHub Desktop.
#!/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