Skip to content

Commit 8b7d89b

Browse files
committed
🔖 bat script for nginx
1 parent 60dcfff commit 8b7d89b

2 files changed

Lines changed: 17 additions & 4 deletions

File tree

demos/nginx-1.14.0/nginx-start.bat

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
11
@echo off
2-
nginx.exe -c conf/nginx.conf
3-
pause
2+
3+
rem 1. 如果目录不存在 logs 目录,则创建
4+
if not exist %~dp0logs (
5+
echo %~dp0logs is not exists, create it.
6+
md %~dp0logs
7+
)
8+
9+
rem 2. 如果目录不存在 temp 目录,则创建
10+
if not exist %~dp0temp (
11+
echo %~dp0temp is not exists, create it.
12+
md %~dp0temp
13+
)
14+
15+
rem 3. 指定 conf/nginx.conf ,启动 nginx
16+
nginx.exe -t -c conf/nginx.conf
17+
start nginx

demos/nginx-1.14.0/nginx-stop.bat

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
@echo off
2-
rem 如果启动前已经启动nginx并记录下pid文件,会kill指定进程
2+
33
nginx.exe -s stop
4-
pause

0 commit comments

Comments
 (0)