Created
March 13, 2011 02:22
-
-
Save csanz/867810 to your computer and use it in GitHub Desktop.
stops a single node.js instance
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
| #!/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