- #!/bin/sh
- # chkconfig: 2345 64 36
- # description: Nginx Server
- nginx="/usr/local/nginx/sbin/nginx"
- prog="nginx"
- start()
- {
- echo -n $"Starting $prog....."
- $nginx
- echo ".........ok"
- netstat -atlpn |grep nginx
- ps -ef|grep nginx:mastar
- }
- stop()
- {
- echo -n $"Stoping $prog......"
- $nginx -s stop
- echo "..........ok"
- }
- reload()
- {
- echo -n $"Reload $prog......"
- $nginx -s reload
- echo "...........ok"
- }
- case "$1" in
- start)
- start
- ;;
- stop)
- stop
- ;;
- restart)
- stop
- start
- ;;
- reload)
- reload
- ;;
- *)
- echo "Usage: $0 {start|stop|restart|reload}"
- exit 2;
- esac