@echo off
REM
REM Batch script to install XL Satellite Server as a service
REM

setlocal ENABLEDELAYEDEXPANSION

REM Get XL Deploy server home dir
if "%xl_satellite_home%"=="" (
    cd /d "%~dp0"
    cd ..
    set xl_satellite_home=!CD!
)

call "%xl_satellite_home%\bin\.wrapper-env.cmd"

if %errorLevel% neq 0 ( exit /b %errorLevel% )

If NOT exist "%xl_satellite_home%\conf\satellite.conf" (
    echo The XL Satellite server is not initialized. Please execute the run.cmd script!
    exit /b 1
)

call %java_exe% %wrapper_java_options% -jar %wrapper_jar% -i %conf_file%
call %java_exe% %wrapper_java_options% -jar %wrapper_jar% -t %conf_file%

endlocal
