Skip to content

Instantly share code, notes, and snippets.

@DarrylDias
Last active January 2, 2016 23:08
Show Gist options
  • Save DarrylDias/8374151 to your computer and use it in GitHub Desktop.
Save DarrylDias/8374151 to your computer and use it in GitHub Desktop.
Ghost starter script.
#!/usr/bin/bash
if [ $(ps aux | grep node | grep -v grep | wc -l | tr -s "\n") -eq 0 ]
then
export PATH=/usr/bin:$PATH
#export PATH=/usr/local/bin:$PATH # If Node.js is source complied.
export NODE_ENV=production
NODE_ENV=production forever start --sourceDir /path/to/your/ghost index.js >> /var/log/nodelog.log 2>&1
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment