Shell-nginx Startup scripts

Source: Internet
Author: User

########################################################################## file name: nginx.sh#  Author: dty# mail: [email protected]# Created Time: Sun 09  aug 2015 06:02:17 pm cst################################################################## ########!/bin/bash. /etc/rc.d/init.d/functionsnginx=/usr/local/nginx/sbin/nginxpid=/usr/local/nginx/logs/ Nginx.pidprog=nginxretval=0start () {    echo -n  "Starting  $prog        $nginx  -t &> /dev/null    if [  "$?"  -eq 0 ];then         $nginx  &>/dev/null  && success | |  failure    fi    echo    RETVAL=$?     return  $RETVAL}stop () {    echo -n  "Stopping  $prog: "     $nginx  -s stop &> /dev/null & & success | | failure    echo    retval=$?    return $ Retval}reload () {    echo -n  "stopping  $prog:"      $nginx  -s reload &> /dev/null && success | | failure    echo    retval=?    return  $RETVAL }case $1 in    start)         start;;     stop)         stop;;     restart)         stop         start;;     reload)         reload         ;;     status)         status -p ${pid}   $nginx         RETVAL=$?         ;;     HELP)          $nginx  -h         retval=$?         ;;         *)              echo usage (start|stop|restart|help|reload|);     esac    exit  $RETVAL


Shell-nginx Startup scripts

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.