zheng/project-tools/nginx.bat

92 lines
2.2 KiB
Batchfile
Raw Permalink Normal View History

2017-03-23 17:11:30 +08:00
@echo off
rem zheng-tools
rem author: shuzheng http://www.zhangshuzheng.cn
rem GitHub: https://github.com/shuzheng
rem OsChina: http://git.oschina.net/shuzheng/zheng
echo ==================begin========================
cls
SET NGINX_PATH=D:
SET NGINX_DIR=D:\nginx-1.11.11\
color 0a
TITLE zheng-tools Power By shuzheng (http://www.zhangshuzheng.cn)
CLS
ECHO.
ECHO. ********************************************************************
ECHO. * *
ECHO. * *
ECHO. * zheng-tools Power By shuzheng (http://www.zhangshuzheng.cn) *
ECHO. * *
ECHO. * *
ECHO. ********************************************************************
ECHO.
:MENU
2017-03-23 17:34:25 +08:00
ECHO.---------------------------- nginx <20><><EFBFBD><EFBFBD><EFBFBD>б<EFBFBD> --------------------------------
2017-03-23 17:11:30 +08:00
tasklist|findstr /i "nginx.exe"
2017-03-23 17:34:25 +08:00
if ERRORLEVEL 1 (echo nginxδ<78><CEB4><EFBFBD><EFBFBD>) else (echo nginx<6E><78><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)
2017-03-23 17:11:30 +08:00
ECHO.----------------------------------------------------------------------------
ECHO.
2017-03-23 17:34:25 +08:00
ECHO. [1] <20><><EFBFBD><EFBFBD>Nginx
ECHO. [2] <20>ر<EFBFBD>Nginx
ECHO. [3] <20><><EFBFBD><EFBFBD>Nginx
ECHO. [4] <20><> <20><>
2017-03-23 17:11:30 +08:00
ECHO.
2017-03-23 17:34:25 +08:00
ECHO.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѡ<EFBFBD><D1A1><EFBFBD><EFBFBD>Ŀ<EFBFBD><C4BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:
2017-03-23 17:11:30 +08:00
set /p ID=
IF "%id%"=="1" GOTO start
IF "%id%"=="2" GOTO stop
IF "%id%"=="3" GOTO restart
IF "%id%"=="4" EXIT
PAUSE
:start
call :startNginx
ECHO.============================================================================
ECHO.
ECHO.
GOTO MENU
:stop
call :shutdownNginx
ECHO.============================================================================
ECHO.
ECHO.
GOTO MENU
:restart
call :shutdownNginx
call :startNginx
ECHO.============================================================================
ECHO.
ECHO.
GOTO MENU
:shutdownNginx
ECHO.
2017-03-23 17:34:25 +08:00
ECHO.<2E>ر<EFBFBD>Nginx......
2017-03-23 17:11:30 +08:00
taskkill /F /IM nginx.exe > nul
2017-03-23 17:34:25 +08:00
ECHO.OK,<2C>ر<EFBFBD><D8B1><EFBFBD><EFBFBD><EFBFBD>nginx <20><><EFBFBD><EFBFBD>
2017-03-23 17:11:30 +08:00
goto :eof
:startNginx
ECHO.
2017-03-23 17:34:25 +08:00
ECHO.<2E><><EFBFBD><EFBFBD>Nginx......
IF NOT EXIST "%NGINX_DIR%nginx.exe" ECHO "%NGINX_DIR%nginx.exe"<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
2017-03-23 17:11:30 +08:00
%NGINX_PATH%
cd "%NGINX_DIR%"
IF EXIST "%NGINX_DIR%nginx.exe" (
echo "start '' nginx.exe"
start "" nginx.exe
)
ECHO.OK
goto :eof