@echo off
@rem 
@rem ------------------------------------------------------------------------------
@rem Company: Software- und Organisations-Service GmbH
@rem Date   : 2022-05-13
@rem Purpose: Anonymize log files
@rem ------------------------------------------------------------------------------
SETLOCAL DISABLEDELAYEDEXPANSION

set JS7_CONTROLLER_LIBDIR=%~dp0../lib
set JS7_CONTROLLER_LIBDIR=%JS7_CONTROLLER_LIBDIR:\=/%


set /A RETURNCODE=0
set JAVA_BIN=%JAVA_HOME%\bin\java.exe

if not exist "%JAVA_BIN%" set JAVA_BIN=java.exe

@rem set classpath
set CALLARGS=-classpath "%JS7_CONTROLLER_LIBDIR%/stdout;%JS7_CONTROLLER_LIBDIR%/patches/*;%JS7_CONTROLLER_LIBDIR%/user_lib/*;%JS7_CONTROLLER_LIBDIR%/ext/3rd-party/*;%JS7_CONTROLLER_LIBDIR%/ext/sos/*"

if defined JAVA_OPTIONS set CALLARGS=%JAVA_OPTIONS% %CALLARGS%

@echo ... executing
"%JAVA_BIN%" %CALLARGS% com.sos.loganonymizer.SOSLogAnonymizer %* 
set /A RETURNCODE=%ERRORLEVEL%
@echo ... done

ENDLOCAL&set /A RETURNCODE=%RETURNCODE%
exit /b %RETURNCODE%
