Created
December 1, 2015 18:14
-
-
Save negatronGister/74f03c80420bb1788423 to your computer and use it in GitHub Desktop.
Webfaction default node bin/stop
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
| mkdir -p /home/USERNAME/webapps/APPNAME/run | |
| pid=$(/sbin/pidof /home/USERNAME/webapps/APPNAME/bin/node) | |
| if echo "$pid" | grep -q " "; then | |
| pid="" | |
| fi | |
| if [ -n "$pid" ]; then | |
| user=$(ps -p $pid -o user | tail -n 1) | |
| if [ $user = "USERNAME" ]; then | |
| kill "$pid" | |
| rm -f /home/USERNAME/webapps/APPNAME/run/node.pid | |
| fi | |
| fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment