Pixiv-Nginx/5.调试工具(这个功能全).bat

165 lines
3.2 KiB
Batchfile
Raw Normal View History

2019-06-27 20:45:44 +08:00
@echo off
rem <20>ṩWindows<77><73>nginx<6E><78><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>رչ<D8B1><D5B9><EFBFBD>
echo ==================begin========================
cls
::ngxin <20><><EFBFBD>ڵ<EFBFBD><DAB5>̷<EFBFBD>
set NGINX_PATH=%~d0
::nginx <20><><EFBFBD><EFBFBD>Ŀ¼
set NGINX_DIR=%~dp0
::color 0a
TITLE Nginx <20><><EFBFBD><EFBFBD><EFBFBD>ű<EFBFBD> v1.0
CLS
echo.
echo. ***************************
echo. ***************************
echo. *** Nginx <20><><EFBFBD><EFBFBD><EFBFBD>ű<EFBFBD> v1.0 ***
echo. *** Mashiro ***
echo. *** https://2heng.xin ***
echo. ***************************
echo. ***************************
echo.
:MENU
echo. ***** nginx <20><><EFBFBD><EFBFBD>list ******
::tasklist|findstr /i "nginx.exe"
tasklist /fi "imagename eq nginx.exe"
echo.
if ERRORLEVEL 1 (
echo nginx.exe<78><65><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
) else (
echo nginx.exe<78><65><EFBFBD><EFBFBD>
)
echo.
::*************************************************************************************************************
echo.
echo. [1] <20><><EFBFBD><EFBFBD>Nginx
echo. [2] <20>ر<EFBFBD>Nginx
echo. [3] <20><><EFBFBD><EFBFBD>Nginx
echo. [4] ˢ<>¿<EFBFBD><C2BF><EFBFBD>̨
echo. [5] <20><><EFBFBD>¼<EFBFBD><C2BC><EFBFBD>Nginx<6E><78><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD>
echo. [6] <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>nginx<6E><78><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD>
echo. [7] <20>鿴nginx version
echo. [0] <20><> <20><>
echo.
echo.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѡ<EFBFBD><D1A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:
set /p ID=
IF "%id%"=="1" GOTO start
IF "%id%"=="2" GOTO stop
IF "%id%"=="3" GOTO restart
IF "%id%"=="4" GOTO MENU
IF "%id%"=="5" GOTO reloadConf
IF "%id%"=="6" GOTO checkConf
IF "%id%"=="7" GOTO showVersion
IF "%id%"=="0" EXIT
PAUSE
::*************************************************************************************************************
::<3A><><EFBFBD><EFBFBD>
:start
call :startNginx
GOTO MENU
::ֹͣ
:stop
call :shutdownNginx
GOTO MENU
::<3A><><EFBFBD><EFBFBD>
:restart
call :shutdownNginx
call :startNginx
GOTO MENU
::<3A><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD>
:checkConf
call :checkConfNginx
GOTO MENU
::<3A><><EFBFBD>¼<EFBFBD><C2BC><EFBFBD>Nginx<6E><78><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD>
:reloadConf
call :checkConfNginx
call :reloadConfNginx
GOTO MENU
::<3A><>ʾnginx<6E>
:showVersion
call :showVersionNginx
GOTO MENU
::*************************************************************************************
::<3A>ײ<EFBFBD>
::*************************************************************************************
:shutdownNginx
echo.
echo.<2E>ر<EFBFBD>Nginx......
taskkill /F /IM nginx.exe > nul
echo.OK,<2C>ر<EFBFBD><D8B1><EFBFBD><EFBFBD><EFBFBD>nginx <20><><EFBFBD><EFBFBD>
goto :eof
:startNginx
echo.
echo.<2E><><EFBFBD><EFBFBD>Nginx......
IF NOT EXIST "%NGINX_DIR%nginx.exe" (
echo "%NGINX_DIR%nginx.exe"<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
goto :eof
)
%NGINX_PATH%
cd "%NGINX_DIR%"
IF EXIST "%NGINX_DIR%nginx.exe" (
echo "start '' nginx.exe"
start "" nginx.exe
)
echo.OK
goto :eof
:checkConfNginx
echo.
echo.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> nginx <20><><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD>......
IF NOT EXIST "%NGINX_DIR%nginx.exe" (
echo "%NGINX_DIR%nginx.exe"<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
goto :eof
)
%NGINX_PATH%
cd "%NGINX_DIR%"
nginx -t -c conf/nginx.conf
goto :eof
::<3A><><EFBFBD>¼<EFBFBD><C2BC><EFBFBD> nginx <20><><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD>
:reloadConfNginx
echo.
echo.<2E><><EFBFBD>¼<EFBFBD><C2BC><EFBFBD> nginx <20><><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD>......
IF NOT EXIST "%NGINX_DIR%nginx.exe" (
echo "%NGINX_DIR%nginx.exe"<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
goto :eof
)
%NGINX_PATH%
cd "%NGINX_DIR%"
nginx -s reload
goto :eof
::<3A><>ʾnginx<6E>
:showVersionNginx
echo.
%NGINX_PATH%
cd "%NGINX_DIR%"
nginx -V
2018-09-17 18:29:24 +08:00
goto :eof