Skip to content

Instantly share code, notes, and snippets.

@reggi
Created February 21, 2014 07:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save reggi/9130144 to your computer and use it in GitHub Desktop.
Save reggi/9130144 to your computer and use it in GitHub Desktop.
#!/bin/bash
echo "The following node processes were found:"
ps aux | grep " node " | grep -v grep
nodepids=$(ps aux | grep " node " | grep -v grep | cut -c10-15)
echo "OK, so we will stop these process/es now..."
for nodepid in ${nodepids[@]}
do
echo "Stopping PID :"$nodepid
kill -9 $nodepid
done
echo "Done"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment