2976N/A
2976N/A@echo off
2976N/Arem CDDL HEADER START
2976N/Arem
2976N/Arem The contents of this file are subject to the terms of the
2976N/Arem Common Development and Distribution License, Version 1.0 only
2976N/Arem (the "License"). You may not use this file except in compliance
2976N/Arem with the License.
2976N/Arem
2976N/Arem You can obtain a copy of the license at
2976N/Arem trunk/opends/resource/legal-notices/OpenDS.LICENSE
2976N/Arem or https://OpenDS.dev.java.net/OpenDS.LICENSE.
2976N/Arem See the License for the specific language governing permissions
2976N/Arem and limitations under the License.
2976N/Arem
2976N/Arem When distributing Covered Code, include this CDDL HEADER in each
2976N/Arem file and include the License file at
2976N/Arem trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable,
2976N/Arem add the following below this CDDL HEADER, with the fields enclosed
2976N/Arem by brackets "[]" replaced with your own identifying information:
2976N/Arem Portions Copyright [yyyy] [name of copyright owner]
2976N/Arem
2976N/Arem CDDL HEADER END
2976N/Arem
2976N/Arem
5236N/Arem Copyright 2006-2010 Sun Microsystems, Inc.
5728N/Arem Portions Copyright 2011-2012 ForgeRock AS
2976N/A
2976N/Arem This script is used to invoke various server-side processes. It should not
2976N/Arem be invoked directly by end users.
2976N/A
2976N/Asetlocal
2976N/Afor %%i in (%~sf0) do set DIR_HOME=%%~dPsi..
3824N/Aset INSTALL_ROOT=%DIR_HOME%
3824N/A
3824N/Aset INSTANCE_DIR=
3824N/Afor /f "delims=" %%a in (%INSTALL_ROOT%\instance.loc) do (
3824N/A set INSTANCE_DIR=%%a
3824N/A)
5728N/Aset CUR_DIR=%CD%
3842N/Acd /d %INSTALL_ROOT%
3842N/Acd /d %INSTANCE_DIR%
3824N/Aset INSTANCE_ROOT=%CD%
3842N/Acd /d %CUR_DIR%
2976N/A
5636N/Aif "%OPENDJ_INVOKE_CLASS%" == "" goto noInvokeClass
2976N/A
2976N/Aset OLD_SCRIPT_NAME=%SCRIPT_NAME%
2976N/Aset SCRIPT_NAME=%OLD_SCRIPT_NAME%.online
2976N/A
3262N/Arem We keep this values to reset the environment before calling _script-util.bat.
5636N/Aset ORIGINAL_JAVA_ARGS=%OPENDJ_JAVA_ARGS%
5636N/Aset ORIGINAL_JAVA_HOME=%OPENDJ_JAVA_HOME%
5636N/Aset ORIGINAL_JAVA_BIN=%OPENDJ_JAVA_BIN%
3262N/A
2976N/Aset SCRIPT_UTIL_CMD=set-full-environment
5173N/Acall "%INSTALL_ROOT%\lib\_script-util.bat" %*
2976N/Aif NOT %errorlevel% == 0 exit /B %errorlevel%
2976N/A
2976N/Aset SCRIPT_NAME_ARG="-Dorg.opends.server.scriptName=%OLD_SCRIPT_NAME%"
2976N/A
2976N/Arem Check whether is local or remote
5636N/A"%OPENDJ_JAVA_BIN%" %OPENDJ_JAVA_ARGS% %SCRIPT_NAME_ARG% %OPENDJ_INVOKE_CLASS% --configClass org.opends.server.extensions.ConfigFileHandler --configFile "%INSTANCE_ROOT%\config\config.ldif" --testIfOffline %*
2976N/Aif %errorlevel% == 51 goto launchoffline
2976N/Aif %errorlevel% == 52 goto launchonline
2976N/Aexit /B %errorlevel%
2976N/A
2976N/A:noInvokeClass
5636N/Aecho Error: OPENDJ_INVOKE_CLASS environment variable is not set.
2976N/Apause
2976N/Agoto end
2976N/A
2976N/A:launchonline
2976N/A
5636N/A"%OPENDJ_JAVA_BIN%" %OPENDJ_JAVA_ARGS% %SCRIPT_NAME_ARG% %OPENDJ_INVOKE_CLASS% --configClass org.opends.server.extensions.ConfigFileHandler --configFile "%INSTANCE_ROOT%\config\config.ldif" %*
2976N/A
2976N/Agoto end
2976N/A
2976N/A:launchoffline
2976N/Aset SCRIPT_NAME=%OLD_SCRIPT_NAME%.offline
2976N/A
3262N/Arem Set the original values that the user had on the environment in order to be
3262N/Arem sure that the script works with the proper arguments (in particular
3262N/Arem if the user specified not to overwrite the environment).
5636N/Aset OPENDJ_JAVA_ARGS=%ORIGINAL_JAVA_ARGS%
5636N/Aset OPENDJ_JAVA_HOME=%ORIGINAL_JAVA_HOME%
5636N/Aset OPENDJ_JAVA_BIN=%ORIGINAL_JAVA_BIN%
3262N/A
2976N/Aset SCRIPT_UTIL_CMD=set-full-environment
5173N/Acall "%INSTALL_ROOT%\lib\_script-util.bat" %*
2976N/Aif NOT %errorlevel% == 0 exit /B %errorlevel%
2976N/Aset SCRIPT_NAME_ARG="-Dorg.opends.server.scriptName=%OLD_SCRIPT_NAME%"
2976N/A
5636N/A"%OPENDJ_JAVA_BIN%" %OPENDJ_JAVA_ARGS% %SCRIPT_ARGS% %SCRIPT_NAME_ARG% %OPENDJ_INVOKE_CLASS% --configClass org.opends.server.extensions.ConfigFileHandler --configFile "%INSTANCE_ROOT%\config\config.ldif" %*
2976N/A
2976N/Agoto end
2976N/A
2976N/A:end
2976N/A