Created
February 1, 2022 13:33
-
-
Save Gibby/bf459d5d60a679bbe93fd3bfcac23b6c to your computer and use it in GitHub Desktop.
Simple Script to Disable and Enable Sophos On MAC - Needs Root Access
This file contains 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 | |
enable() { | |
sudo mv "/Library/Sophos Anti-Virus.disabled" "/Library/Sophos Anti-Virus" | |
sudo mv "/Library/SophosCBR.disabled" "/Library/SophosCBR" | |
sudo mv "/Applications/Sophos.disabled" "/Applications/Sophos" | |
} | |
disable() { | |
sudo mv "/Library/Sophos Anti-Virus" "/Library/Sophos Anti-Virus.disabled" | |
sudo mv "/Library/SophosCBR" "/Library/SophosCBR.disabled" | |
sudo mv "/Applications/Sophos" "/Applications/Sophos.disabled" | |
} | |
kill() { | |
sudo kill -9 `ps -ef|grep -i sophos|grep -v grep|awk '{print $2}'` > /dev/null 2>&1 | |
} | |
## Decide what to do | |
while [[ $# -gt 0 ]] ; do | |
opt="$1"; | |
shift; | |
case "$opt" in | |
"enable" ) | |
enable | |
;; | |
"disable" ) | |
disable | |
kill | |
;; | |
"kill" ) | |
kill | |
;; | |
* ) | |
echo "Invalid option: $opt" | |
help | |
;; | |
esac | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment