|
#!/bin/bash |
|
|
|
DRY_RUN=true |
|
RESET='\033[0m' |
|
GREEN='\033[0;32m' |
|
YELLOW='\033[0;33m' |
|
RED='\033[0;31m' |
|
|
|
remove_file() { |
|
echo "Checking ${1} existence..." |
|
if [ -f "$1" ] || [ -d "$1" ]; then |
|
echo -e "${GREEN}Found ${1} ${RESET}" |
|
if [ "$DRY_RUN" = true ]; then |
|
echo -e "${YELLOW}Would run: rm -rf $1 ${RESET}" |
|
else |
|
rm -rf "$1" |
|
retVal=$? |
|
if [ $retVal -ne 0 ]; then |
|
echo -e "${RED}Couldn't remove $1, please do it manually ${RESET}" |
|
fi |
|
fi |
|
fi |
|
} |
|
|
|
kill_process() { |
|
echo "Checking for $1 process existence..." |
|
pgrep $1 | while read x; do |
|
echo -e "${GREEN}Found process with PID: $x and Command: $(ps -p $x -o comm=) ${RESET}" |
|
if [ "$DRY_RUN" = true ]; then |
|
echo -e "${YELLOW}Would run: kill -9 $x ${RESET}" |
|
else |
|
kill -9 "$x" |
|
fi |
|
done |
|
} |
|
|
|
remove_kext() { |
|
echo "Checking for $1 kext existence..." |
|
if kextstat | grep "$1" ; then |
|
if [ "$DRY_RUN" = true ]; then |
|
echo -e "${YELLOW}Would run: kextunload -b $1 ${RESET}" |
|
else |
|
kextunload -b "$1" |
|
fi |
|
fi |
|
} |
|
|
|
inoculate_vaccine () { |
|
if [ "$DRY_RUN" = true ] ; then |
|
echo -e "${YELLOW}Dry-run in progress...${RESET}" |
|
fi |
|
|
|
kill_process "zoom.us" |
|
kill_process "ZoomOpener" |
|
remove_file "$HOME/.zoomus" |
|
remove_file "/Applications/zoom.us.app" |
|
remove_file "$HOME/Applications/zoom.us.app" |
|
|
|
remove_file "$HOME/Library/Application Support/zoom.us" |
|
remove_file "$HOME/Library/Preferences/us.zoom.xos.plist" |
|
remove_file "$HOME/Library/Preferences/ZoomChat.plist" |
|
remove_file "$HOME/Library/Saved Application State/us.zoom.xos.savedState" |
|
remove_file "$HOME/Library/Cookies/us.zoom.xos.binarycookies" |
|
remove_file "$HOME/Library/Internet Plug-Ins/ZoomUsPlugIn.plugin" |
|
remove_file "$HOME/Library/Caches/us.zoom.xos" |
|
remove_file "$HOME/Library/Logs/zoom.us" |
|
remove_file "$HOME/Library/Logs/zoominstall.log" |
|
|
|
remove_kext "zoom.us.ZoomAudioDevice" |
|
remove_file "/System/Library/Extensions/ZoomAudioDevice.kext" |
|
|
|
if [ "$DRY_RUN" = false ] ; then |
|
echo -e "${GREEN}Your are now vaccinated for Zoom.us${RESET}" |
|
fi |
|
} |
|
|
|
if [[ $UID != 0 ]]; then |
|
echo "Please run this script with sudo:" |
|
echo "sudo $0 $*" |
|
exit 1 |
|
fi |
|
|
|
echo "This script will vaccinate you for Zoom.us removing it completely from your system, are you sure you want to run it?" |
|
select yn in "Yes" "No"; do |
|
case $yn in |
|
Yes ) break;; |
|
No ) exit;; |
|
esac |
|
done |
|
|
|
echo "Do you want to do a dry-run?" |
|
select yn in "Yes" "No"; do |
|
case $yn in |
|
Yes ) DRY_RUN=true; break;; |
|
No ) DRY_RUN=false; break;; |
|
esac |
|
done |
|
|
|
inoculate_vaccine |
Great job!
Instead of blindly kill a local ws @ 19421 I'd check if zoom locally exists; something like:
if [ -e $HOME/.zoomus ] killserver
Probability of a port overlap are looow, but we all know that s**t happens :D