Skip to content

Instantly share code, notes, and snippets.

@sohailalam2
Forked from danro/starter.sh
Last active August 29, 2015 14:10
Show Gist options
  • Select an option

  • Save sohailalam2/cd3c0f0232641ef28516 to your computer and use it in GitHub Desktop.

Select an option

Save sohailalam2/cd3c0f0232641ef28516 to your computer and use it in GitHub Desktop.
#!/bin/sh
if [ $(ps aux | grep $USER | grep node | grep -v grep | wc -l | tr -s "\n") -eq 0 ]
then
export PATH=/usr/local/bin:$PATH
export NODE_ENV=production
cd /path/to/app && forever --spinSleepTime 10000 start server.js >> forever.log 2>&1
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment