Skip to content

Instantly share code, notes, and snippets.

@csanz
Created March 13, 2011 02:22
Show Gist options
  • Select an option

  • Save csanz/867810 to your computer and use it in GitHub Desktop.

Select an option

Save csanz/867810 to your computer and use it in GitHub Desktop.
stops a single node.js instance
#!/bin/bash
#author: csanz
pid=`ps afx | grep "node" | grep "$1" | grep "app.js" | awk '{print $1'}`
if [ -z $pid ]
then
echo "the node instance doesn't exists"
fi
if [ "$pid" != '' ]
then
echo "stopping PID $pid..."
kill -9 $pid
echo "node instance killed"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment