1@echo off
2rem Licensed to the Apache Software Foundation (ASF) under one or more
3rem contributor license agreements.  See the NOTICE file distributed with
4rem this work for additional information regarding copyright ownership.
5rem The ASF licenses this file to You under the Apache License, Version 2.0
6rem (the "License"); you may not use this file except in compliance with
7rem the License.  You may obtain a copy of the License at
8rem
9rem     http://www.apache.org/licenses/LICENSE-2.0
10rem
11rem Unless required by applicable law or agreed to in writing, software
12rem distributed under the License is distributed on an "AS IS" BASIS,
13rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14rem See the License for the specific language governing permissions and
15rem limitations under the License.
16
17rem ---------------------------------------------------------------------------
18rem Configuration test script for the CATALINA Server
19rem ---------------------------------------------------------------------------
20
21setlocal
22
23rem Guess CATALINA_HOME if not defined
24set "CURRENT_DIR=%cd%"
25if not "%CATALINA_HOME%" == "" goto gotHome
26set "CATALINA_HOME=%CURRENT_DIR%"
27if exist "%CATALINA_HOME%\bin\catalina.bat" goto okHome
28cd ..
29set "CATALINA_HOME=%cd%"
30cd "%CURRENT_DIR%"
31:gotHome
32if exist "%CATALINA_HOME%\bin\catalina.bat" goto okHome
33echo The CATALINA_HOME environment variable is not defined correctly
34echo This environment variable is needed to run this program
35goto end
36:okHome
37
38set "EXECUTABLE=%CATALINA_HOME%\bin\catalina.bat"
39
40rem Check that target executable exists
41if exist "%EXECUTABLE%" goto okExec
42echo Cannot find "%EXECUTABLE%"
43echo This file is needed to run this program
44goto end
45:okExec
46
47rem Get remaining unshifted command line arguments and save them in the
48set CMD_LINE_ARGS=
49:setArgs
50if ""%1""=="""" goto doneSetArgs
51set CMD_LINE_ARGS=%CMD_LINE_ARGS% %1
52shift
53goto setArgs
54:doneSetArgs
55
56call "%EXECUTABLE%" configtest %CMD_LINE_ARGS%
57
58:end
59