Last active
October 6, 2022 02:47
-
-
Save marcoarment/a78962943e7e59c67da7ff7a379f3b1d to your computer and use it in GitHub Desktop.
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 | |
shopt -s nullglob | |
LOCALUSER=marco # Change this for you, obviously | |
DISABLED_FILES_DIR=/Users/$LOCALUSER/.quit-adobe | |
# Are any Adobe user-facing apps running? Assuming they begin with "Adobe ", e.g. "Adobe Audition 2022" | |
ps ax -c -o 'command=' | egrep '^Adobe ' | fgrep -v 'Adobe Desktop Service' | fgrep -v 'Adobe Installer' > /dev/null | |
if [ $? -eq 1 ] ; then | |
# No Adobe user-facing apps running | |
if [ -e "/Applications/Utilities/Adobe Sync/CoreSync/Core Sync.app/Contents/PlugIns/ACCFinderSync.appex" ] ; then | |
mkdir -p $DISABLED_FILES_DIR | |
sudo mv -f "/Applications/Utilities/Adobe Sync/CoreSync/Core Sync.app/Contents/PlugIns/ACCFinderSync.appex" $DISABLED_FILES_DIR/ACCFinderSync.DISABLED-appex | |
sudo killall -q -9 ACCFinderSync | |
fi | |
for B in `launchctl list | egrep -v '^-' | fgrep -i adobe | awk '{ print $3 }'` ; do | |
echo "launchctl stopping: $B" | |
sudo launchctl stop "$B" | |
echo "launchctl booting out: $B" | |
sudo launchctl bootout gui/`id -u`/"$B" | |
done | |
for i in /Library/LaunchDaemons/com.adobe.* ; do | |
echo "launchctl unloading: $i" | |
sudo launchctl unload "$i" | |
mkdir -p $DISABLED_FILES_DIR/Library/LaunchDaemons | |
sudo mv -f /Library/LaunchDaemons/com.adobe.* $DISABLED_FILES_DIR/Library/LaunchDaemons/ 2>&1 | |
done | |
for i in /Library/LaunchAgents/com.adobe.* ; do | |
echo "launchctl unloading: $i" | |
launchctl unload "$i" | |
mkdir -p $DISABLED_FILES_DIR/Library/LaunchAgents | |
sudo mv -f /Library/LaunchAgents/com.adobe.* $DISABLED_FILES_DIR/Library/LaunchAgents/ 2>&1 | |
done | |
BADPROCS="AdobeIPCBroker AdobeCRDaemon 'Adobe Desktop Service' 'Adobe Installer' Adobe_CCXProcess.node com.adobe.acc.installer.v2 AdobeExtensionsService 'Creative Cloud Helper' crashpad_handler" | |
for PNAME in `sudo killall -qdv -9 $BADPROCS | fgrep 'cmd:' | awk '{ print $2}' | sed 's/^cmd://g' | sed 's/,$//g'` ; do | |
echo "killing: $PNAME" | |
sudo killall -q -9 $PNAME | |
done | |
else | |
echo "Adobe apps still running:" | |
ps ax -c -o 'command=' | egrep '^Adobe ' | fgrep -v 'Adobe Desktop Service' | fgrep -v 'Adobe Installer' | |
fi | |
# How to move Adobe crap back if you need it: | |
# sudo mv $DISABLED_FILES_DIR/Library/LaunchAgents/com.adobe.* /Library/LaunchAgents/ | |
# sudo mv $DISABLED_FILES_DIR/Library/LaunchDaemons/com.adobe.* /Library/LaunchDaemons/ | |
# sudo mv $DISABLED_FILES_DIR/ACCFinderSync.DISABLED-appex "/Applications/Utilities/Adobe Sync/CoreSync/Core Sync.app/Contents/PlugIns/ACCFinderSync.appex" | |
# Check for Adobe processes | |
# ps ax -c -o 'command=' | fgrep -i adobe |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Shellcheck fixes are here. Feel free to steal if you want.
Only thing I left out were instances of SC2009, which shows up in a few places - not sure it matters though.