nginx啟動和停止指令碼

2021-05-23 23:31:35 字數 1635 閱讀 4878

#!/bin/sh

nginx_base_dir

="/opt/nginx"

nginx_daemon="$

/sbin/nginx"

nginx_conf="$

/conf/nginx.conf"

__launch_signal(

)

-s $

&>/dev/null

}

__checkconfig(

)

-c $

-t&>/dev/null

}

__start(

)

]

||exit1  

__checkconfig&&$

-c $

&>/dev/null||return

$}

__stop(

)

__reload(

)

}

__restart(

)

__show_usage(

)

"exit

3}

### :: main ::

case"$"

in

start|stop|restart|reload)

[

-x $

]

||exit

2 __$

;;*

)__show_usage

;;

esac

Nginx啟動 重啟 停止指令碼

bin sh 將指令碼儲存為 etc rc.d init.d nginxd,便可以使用service命令啟動 停止 重啟nginx服務。source function library etc rc.d init.d functions source networking configuration....

nginx安裝啟動停止指令碼

目錄前言 一 nginx shell指令碼 nginx安裝啟動 start 停止 stop 獲取狀態 status 指令碼 shell bin env bash 應用名稱 獲取當前shell指令碼路徑 base dir pwd echo base dir nginx檔案所在路徑 nginx dir ...

Nginx 啟動 停止服務的指令碼

php fastcgi setting host 127.0.0.1 port 9000 childs 5 fast cgi threads default 5 check shell if shell bin bash then echo shell isn t the bash script b...