Skip to content

Instantly share code, notes, and snippets.

@negatronGister
Created December 1, 2015 18:14
Show Gist options
  • Select an option

  • Save negatronGister/74f03c80420bb1788423 to your computer and use it in GitHub Desktop.

Select an option

Save negatronGister/74f03c80420bb1788423 to your computer and use it in GitHub Desktop.
Webfaction default node bin/stop
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