Created
October 15, 2017 17:17
-
-
Save brossetti1/406ed1987c36d9438ec1c90dc9acbcef to your computer and use it in GitHub Desktop.
This file contains hidden or 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
export PROCESSES_TO_QUIT='bpos puma rake sidekiq spring rails$ ruby-debug phantomjs zeus passenger guard resque "node server.js" ruby$ node foreman fsevent_wat' | |
pgr() { | |
echo "Finding processes in list: $PROCESSES_TO_QUIT" | |
echo $PROCESSES_TO_QUIT | xargs -n 1 pgrep -l | |
} | |
pgk() { | |
echo "Killing processes in list: $PROCESSES_TO_QUIT" | |
echo $PROCESSES_TO_QUIT | xargs -n 1 pkill -l | |
} | |
ZEUS_SOCK=/Users/justin/clients/blink/bpos/.zeus.sock | |
pgkk() { | |
echo "Killing -9 processes in list: $PROCESSES_TO_QUIT" | |
echo "Also removing $ZEUS_SOCK if existing" | |
echo $PROCESSES_TO_QUIT | xargs -n 1 pkill -9 -l | |
if [[ -a ${ZEUS_SOCK} ]]; then | |
rm ${ZEUS_SOCK} | |
echo Removed ${ZEUS_SOCK} | |
else | |
echo ${ZEUS_SOCK} does not exist | |
fi | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment