Initial code import
[msb/apigateway.git] / openresty-ext / src / assembly / resources / openresty / run.bat
1 @REM\r
2 @REM Copyright (C) 2016 ZTE, Inc. and others. All rights reserved. (ZTE)\r
3 @REM\r
4 @REM Licensed under the Apache License, Version 2.0 (the "License");\r
5 @REM you may not use this file except in compliance with the License.\r
6 @REM You may obtain a copy of the License at\r
7 @REM\r
8 @REM         http://www.apache.org/licenses/LICENSE-2.0\r
9 @REM\r
10 @REM Unless required by applicable law or agreed to in writing, software\r
11 @REM distributed under the License is distributed on an "AS IS" BASIS,\r
12 @REM WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
13 @REM See the License for the specific language governing permissions and\r
14 @REM limitations under the License.\r
15 @REM\r
16 \r
17 @echo off\r
18 title openresty-server\r
19 @if not "%ECHO%" == ""  echo %ECHO%\r
20 @if "%OS%" == "Windows_NT"  setlocal\r
21 \r
22 set DIRNAME=.\r
23 \r
24 if "%OS%" == "Windows_NT" set DIRNAME=%~dp0%\r
25 \r
26 set ARGS=\r
27 :loop\r
28 if [%1] == [] goto endloop\r
29         set ARGS=%ARGS% %1\r
30         shift\r
31         goto loop\r
32 :endloop\r
33 \r
34 set HOME=%DIRNAME%nginx\r
35 set _NGINXCMD=%HOME%\nginx.exe\r
36 \r
37 echo =========== openresty config info  ============================================\r
38 echo HOME=%HOME%\r
39 echo _NGINXCMD=%_NGINXCMD%\r
40 echo ===============================================================================\r
41 \r
42 cd /d "%HOME%"\r
43 echo @WORK_DIR@%HOME%\r
44 echo @C_CMD@ "%_NGINXCMD%"\r
45 %_NGINXCMD%\r
46 IF ERRORLEVEL 1 goto showerror\r
47 exit\r
48 :showerror\r
49 echo WARNING: Error occurred during startup or Server abnormally stopped by way of killing the process,Please check!\r
50 echo After checking, press any key to close \r
51 pause\r
52 exit