Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save marcos-alexandre82/eb9b2dfa4dce804068df42ee2086041a to your computer and use it in GitHub Desktop.
Save marcos-alexandre82/eb9b2dfa4dce804068df42ee2086041a to your computer and use it in GitHub Desktop.
Stop Adobe Creative Cloud daemons (background processes) in their tracks
#!/bin/bash
if [ "$1" = "-s" ] || [ "$1" = "--show" ]; then
show=true
else
show=false
fi
if $show || [ "$1" = "-v" ] || [ "$1" = "--verbose" ]; then
verbose=true
else
verbose=false
fi
kill_list=""
for i in $(pgrep -i adobe); do
if $verbose; then
echo -n "PID $i -- "
ps -p "$i" -o command $($show || echo -c) | awk 'ORS=""; NR==2'
fi
ps -p "$i" -o command | awk 'NR==2' | grep -E '^/Applications/Adobe XD/Adobe XD\.app/Contents/MacOS/Adobe XD$' > /dev/null
if [ $? -eq 1 ] ; then
$verbose && echo " -- KILL"
kill_list="$kill_list $i"
else
$verbose && echo " -- KEEP ALIVE"
fi
done
if [ -z "$kill_list" ] ; then
$verbose && echo "Nothing to kill"
else
if $verbose; then
echo "KILL_LIST = $kill_list"
set -x
fi
$show || sudo kill -TERM $kill_list
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment