Skip to content

Instantly share code, notes, and snippets.

@brunerd
Last active August 8, 2019 23:07
Show Gist options
  • Save brunerd/beaa0c384939a507200fd663530b3c4f to your computer and use it in GitHub Desktop.
Save brunerd/beaa0c384939a507200fd663530b3c4f to your computer and use it in GitHub Desktop.
Removes all the ZoomOpener variants for all users
#!/bin/bash
#Joel Bruner - removes all ZoomOpener variants for all users
#############
# VARIABLES #
#############
#folder names where lurking webservers live
folderNames=".ringcentralopener
.zoomus
.telusmeetingsopener
.btcloudphonemeetingsopener
.officesuitehdmeetingopener
.attvideomeetingsopener
.bizconfopener
.huihuiopener
.umeetingopener
.zhumuopener
.zoomcnopener
.accessionmeetingopener
.videoconferenciatelmexopener
.earthlinkmeetingroomopener"
#process names of those webservers
processNames="ZoomOpener
RingCentralOpener
TelusMeetingsOpener
BTCloudPhoneMeetingsOpener
OfficeSuiteHDMeetingOpener
ATTVideoMeetingsOpener
BizConfOpener
HuihuiOpener
UMeetingOpener
ZhumuOpener
ZoomCNOpener
AccessionMeetingOpener
VideoConferenciaTelmexOpener
EarthLinkMeetingRoomOpener"
#############
# FUNCTIONS #
#############
function removeFolderFromAllUsers
{
local folderName="${1}"
#double single quote to allow variable inside literal '' gets both home folder or if in .Trash
find /Users -name ''${folderName}'' -type d -maxdepth 3 -exec rm -rf "{}" \;
}
function killallProcs
{
local processName="${1}"
#if you find any proc with this name kill it
[ -n "$(pgrep ${processName})" ] && killall "${processName}"
}
function systemCheck
{
if [ "${UID}" -ne "0" ]; then
echo "Please run as root, exiting"
exit
fi
}
########
# MAIN #
########
systemCheck
#remove all the folders
for folder in ${folderNames}; do
removeFolderFromAllUsers "${folder}"
done
#kill all the processes
for process in ${processNames}; do
killallProcs "${process}"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment