zoukankan      html  css  js  c++  java
  • nginx启动脚本

    #!/bin/bash
    #chkconfig 2345 99 20
    #2345表示系统运行级别
    #99表示启动优先级
    #20表示关闭的优先级
    nginx=/usr/local/nginx/sbin/nginx
    case $1 in
    start)
    netstat -anptu|grep nginx
    if [ $? -eq 0 ]; then
    echo "nginx server is already running"
    else
    echo "nginx server begin start...."
    $nginx

    fi
    ;;
    stop)
    $nginx -s stop
    if [ $? -eq 0 ]; then
    echo "nginx server is stop"
    else
    echo "nginx server stop fail,try again!"
    fi
    ;;
    status)
    netstat -anptu|grep nginx
    if [ $? -eq 0 ]; then
    echo "nginx server is running"
    else
    echo "nginx server is stoped"
    fi
    ;;
    restart)
    $nginx -s reload
    if [ $? -eq 0 ]; then
    echo "nginx server is begin restart"
    else
    echo "nginx server restart fail!"
    fi
    ;;
    *)
    echo "please enter {start|restart|status|stop}"
    ;;
    esac

  • 相关阅读:
    数组练习
    数组
    表达式和语句
    搜索框制作
    操作DOM
    数据类型
    javascript数组属性及方法
    javascript字符串属性及常用方法总结
    css清除浮动float
    vue项目搭建步骤
  • 原文地址:https://www.cnblogs.com/baby0123/p/11811593.html
Copyright © 2011-2022 走看看