Skip to content

Instantly share code, notes, and snippets.

@iwarshak
Created December 12, 2011 15:31
Show Gist options
  • Save iwarshak/1467866 to your computer and use it in GitHub Desktop.
Save iwarshak/1467866 to your computer and use it in GitHub Desktop.
nginx init script
#!/bin/bash
case "${1:-''}" in
'start')
# start commands here
/opt/nginx/sbin/nginx
;;
'stop')
# stop commands here
kill `cat /opt/nginx/logs/nginx.pid`
;;
'restart')
# restart commands here
kill `cat /opt/nginx/logs/nginx.pid`
/opt/nginx/sbin/nginx
;;
*) # no parameter specified
echo "Usage: $SELF start|stop|restart|reload|force-reload|status"
exit 1
;;
esac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment