#!/bin/sh
# chkconfig : 345 86 14
# description:
NGINX_DIR=/usr/local/nginx
export NGINX_DIR
case $1 in
'start')
echo "start nginx...."
$NGINX_DIR/sbin/nginx
;;
'reload')
echo "Reload nginx configuration...."
kill -HUP `cat $NGINX_DIR/logs/nginx.pid`
;;
'stop')
echo "stopping nginx...."
kill -15 `cat $NGINX_DIR/logs/nginx.pid`
;;
'list')
ps aux | egrep '(PID|nginx)'
;;
'testconfig')
$NGINX_DIR/sbin/nginx -t
;;
'version')
$NGINX_DIR/sbin/nginx -v
;;
'tailLog')
tail -f $NGINX_DIR/logs/error.log
;;
'catLog')
cat $NGINX_DIR/logs/error.log
;;
*)
echo "usage: `basename $0` {start | reload | stop | list | testconfig | version | tailLog | catLog}"
esac