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