@echo off
call "%FIORANO_HOME%\fiorano_vars.bat"
if %ERRORLEVEL% == 99 exit /b 99
rem For backward compatibility. This will be set if called from fes/fps scripts.
if defined PROFILES goto conf
set PROFILES=..\profiles
:conf
call "%FIORANO_HOME%\launcher\serverArgs.bat" %*
if "%HELP%" == "" call :noHelp
IF NOT "%APP%" == "fmq" goto ESB
if exist "%PROFILES%\%PROFILE%\restart" del "%PROFILES%\%PROFILE%\restart"
call "%FIORANO_HOME%\launcher\app.bat" %*
if not exist "%PROFILES%\%PROFILE%\restart" goto end
:restart
echo.
echo ------------------------------------------------------
echo.
del "%PROFILES%\%PROFILE%\restart"
%CMD% %*
if exist "%PROFILES%\%PROFILE%\restart" goto restart
pause
goto end
:ESB
if exist "%PROFILES%\%PROFILE%\%MODE%\restart" del "%PROFILES%\%PROFILE%\%MODE%\restart"
call "%FIORANO_HOME%\launcher\app.bat" %*
if not exist "%PROFILES%\%PROFILE%\%MODE%\restart" goto end
:restartESB
echo.
echo ------------------------------------------------------
echo.
del "%PROFILES%\%PROFILE%\%MODE%\restart"
%CMD% %*
if exist "%PROFILES%\%PROFILE%\%MODE%\restart" goto restartESB
pause
goto end
:noHelp
echo.
call :absolute "%FIORANO_HOME%"
echo Fiorano Home : %ABSOLUTE%
call :absolute "%JAVA_HOME%"
echo Java Home : %ABSOLUTE%
call :absolute "%PROFILES%\%PROFILE%"
echo Profile : %ABSOLUTE%
echo.
goto end
:absolute
set ABSOLUTE=%~f1%
:end