#!/bin/bash
# chkconfig: 35 55 25
# description: Opennginxd server daemon# processname: nginxdnginx=`netstat -nputl | grep nginx`file=/usr/local/nginx/sbin/nginxa=\\e[32mb=\\e[0mstatus(){
$nginx if [ -z "$nginx" ];then echo -e "nginx is not runging\t......" else echo -e "nginx is runging\t......" fi}stop(){ $file -s stop &> /dev/null $nginx if [ -z "$nginx" ];then echo -e "nginx stop......\t\t${a}[ NO ]${b}" else echo -e "nginx stop......\t\t${a}[ YES ]${b}" fi}start(){ $file &> /dev/null if [ -z "$nginx" ];then echo -e "nginx start......\t\t${a}[ NO]${b}" else echo -e "nginx start......\t\t${a}[ YES ]${b}" fi}
restart(){ stop start}t(){ $file -t}v(){ $file -v}V(){ $file -V} case $1 in"stop") stop;;"start") start;;"restart") restart;;"status") status;;"V") V;;"t") t;;"v") v;;*) echo "Usage: ngxin {start | stop | restart | status | v | V | t}";;esac