Skip to content

Instantly share code, notes, and snippets.

@wuputah
Created June 8, 2012 07:26
Show Gist options
  • Save wuputah/2894214 to your computer and use it in GitHub Desktop.
Save wuputah/2894214 to your computer and use it in GitHub Desktop.
#!/bin/sh
trap 15 terminate
terminate()
{
echo "!! Received sigterm, letting node cleanup before we exit"
sleep 5
echo "!! Exiting"
exit 0
}
while true; do
node index.js
echo "!! Program crashed, restarting..."
done
web: bin/run
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment