Skip to content

Instantly share code, notes, and snippets.

@Miserlou
Created January 12, 2012 04:11
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save Miserlou/1598648 to your computer and use it in GitHub Desktop.
Save Miserlou/1598648 to your computer and use it in GitHub Desktop.
/etc/init.d/http-proxy
#!/bin/bash
DIR=/var/www/YOUR_APP_NAME
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
NODE_PATH=/usr/local/lib/node_modules
case $1 in
start)
nohup "node" "$DIR/proxy.js" 1>>"$DIR/logs/proxy.log" 2>&1 &
echo $! > "$DIR/pids/proxy.pid";
;;
stop)
kill `cat $DIR/pids/proxy.pid` ;;
*)
echo "usage: /etc/init.d/http-proxy {start|stop}" ;;
esac
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment