#!/bin/bash
#Startup script for the nginx Web Server
# chkconfig: 2345 99 01
#
#
### BEGIN INIT INFO
# Provides: nginx
# Provides: nginx
# Required-Start: $local_fs $network $syslog
# Required-Stop: $local_fs $network $syslog
# Short-Description: Starts nginx
# Description: Starts nginx.
### END INIT INFO

nginx=/usr/local/nginxd/sbin/nginx
case $1 in
    start)
        echo -n "Starting Nginx"
        $nginx
        echo " done."
        ;;
    stop)
        echo -n "Stopping Nginx"
        $nginx -s stop
        echo " done."
        ;;
    test)
        $nginx -t
        echo "Success."
        ;;
    reload)
        echo -n "Reloading Nginx"
        $nginx -s reload
        echo " done."
        ;;
    restart)
        $nginx -s reload
        echo "reload done."
        ;;
    *)
        echo "Usage: $0 {start|restart|reload|stop|test|show}"
    ;;
esac

