Last active
August 8, 2019 23:07
-
-
Save brunerd/beaa0c384939a507200fd663530b3c4f to your computer and use it in GitHub Desktop.
Removes all the ZoomOpener variants for all users
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 | |
#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