xgqfrms™, xgqfrms® : xgqfrms's offical website of GitHub!

nginx & restart

https://www.cyberciti.biz/faq/nginx-linux-restart/


https://stackoverflow.com/a/39802422/5934465

You can using start.bat and stop.bat to realize the same effect.

start.bat

@ECHO OFF
REM Start Nginx
tasklist /FI "IMAGENAME eq nginx.exe" 2>NUL | find /I /N "nginx.exe">NUL
IF NOT "%ERRORLEVEL%"=="0" (
   REM Nginx is NOT running, so start it
   c:
   cd 
ginx
   start nginx.exe
   ECHO Nginx started.
) else (
   ECHO Nginx is already running.
)

stop.bat

@ECHO OFF
REM Stop Nginx
tasklist /FI "IMAGENAME eq nginx.exe" 2>NUL | find /I /N "nginx.exe">NUL
IF "%ERRORLEVEL%"=="0" (
   REM Nginx is currently running, so quit it
   c:
   cd 
ginx
   nginx.exe -s quit
   ECHO Nginx quit issued.
) else (
   ECHO Nginx is not currently running.
)


原文地址:https://www.cnblogs.com/xgqfrms/p/10267964.html