salix/services/nginx/start.cmd

28 lines
627 B
Batchfile
Raw Normal View History

@echo off
2016-12-28 14:09:02 +00:00
set currentDir=%cd%
set nginxPrefix=%currentDir%\services\nginx
set nginxConf=%nginxPrefix%\conf-dev.conf
if "%1"=="" goto caseStart
if "%1"=="start" goto caseStart
if "%1"=="stop" goto caseStop
goto caseUsage
2016-11-21 07:35:05 +00:00
:caseStart
call "%0" stop
2017-05-18 15:35:07 +00:00
echo Starting nginx.
2016-12-28 14:09:02 +00:00
if not exist "%nginxPrefix%\temp" (mkdir "%nginxPrefix%\temp")
start /I nginx -c "%nginxConf%" -p "%nginxPrefix%"
2017-05-05 10:54:47 +00:00
goto caseEnd
2016-11-21 07:35:05 +00:00
:caseStop
2017-05-18 15:35:07 +00:00
echo Stoping nginx.
2016-12-28 14:09:02 +00:00
if exist "%nginxPrefix%\temp\nginx.pid" (nginx -c "%nginxConf%" -p "%nginxPrefix%" -s stop)
2017-05-05 10:54:47 +00:00
goto caseEnd
2016-11-21 07:35:05 +00:00
:caseUsage
echo "Usage: %0 [start|stop]"
2016-11-21 07:35:05 +00:00
2017-05-05 10:54:47 +00:00
:caseEnd