XGuru's Blog

技术,是一种态度。关注:高性能后端技术/服务器架构/C++/C/LAMP

   :: 首页 :: 联系 :: 聚合  :: 管理
  20 Posts :: 0 Stories :: 93 Comments :: 0 Trackbacks

公告





twitter / xoXGuru

feedsky
抓虾
google reader
鲜果
QQ邮箱
九点

常用链接

留言簿(12)

搜索

  •  

最新评论

阅读排行榜

2010-12-29-update:找到一个最新的版本,由jason提供,地址在这


上网找了几个版本在ubuntu下都用不了
于是就自己重新修改了jackbillow的版本,用起来感觉还不错.



Usage: nginx.sh {start|stop|conf|restart}
//开始|停止|配置|重启

注:需要以管理员身份运行


################################################
#!/bin/bash
# v.0.0.3
# create by jackbillow at 2007.10.15
# redevelop by XGuru at 2010.6.28
# On Ubuntu 10.04
# nginx - This shell script takes care of starting and stopping nginx.
#
# description: nginx [engine x] is light http web/proxy server
# that answers incoming ftp service requests.
###############################################


nginx_path
="/usr/local/nginx"
nginx_pid
="/usr/local/nginx/logs/nginx.pid"
prog="nginx"

RETVAL=0


start() {
# Start daemons.
        if [ -$nginx_path/conf/nginx.conf ];then
          echo 
-n $"Starting $prog: "
          
$nginx_path/sbin/nginx -$nginx_path/conf/nginx.conf &
          RETVAL
=$?
        [ 
$RETVAL -eq 0 ] && {
        echo Start 
"$prog" successfully!
        }
        
else
        RETVAL
=1
        fi
        
return $RETVAL
}
# Stop daemons.
stop() {
        echo 
-n $"Stopping $prog\n"
        sudo killall 
-9 nginx
        RETVAL
=$?
}
# See how we were called.

conf(){
        gvim 
"$nginx_path/conf/nginx.conf"
}
case 
"$1" in
start)
        start
        ;;
stop)
        stop
        ;;
conf)
        conf
        ;;        
restart)
        stop
        start
        ;;

*)
        echo $
"Usage: $0 {start|stop|conf|restart}"
        echo $
"Your may need root privilege to execute this script!"
        
exit 1
esac
exit $RETVAL

--EOF--
posted on 2010-06-28 16:43 XGuru 阅读(918) 评论(0)  编辑 收藏 引用

只有注册用户登录后才能发表评论。
网站导航: 博客园   IT新闻   BlogJava   知识库   博问   管理