2N/Arem CDDL HEADER START
2N/Arem The contents of this file are subject to the terms of the
2N/Arem Common Development and Distribution License, Version 1.0 only
2N/Arem (the "License"). You may not use this file except in compliance
2N/Arem with the License.
2N/Arem You can obtain a copy of the license at
2N/Arem See the License for the specific language governing permissions
2N/Arem and limitations under the License.
2N/Arem When distributing Covered Code, include this CDDL HEADER in each
2N/Arem file and include the License file at
2N/Arem add the following below this CDDL HEADER, with the fields enclosed
2N/Arem by brackets "[]" replaced with your own identifying information:
2N/Arem Portions Copyright [yyyy] [name of copyright owner]
2N/Arem Portions Copyright 2006-2007 Sun Microsystems, Inc.
2N/Aset PATH=%SystemRoot%
2N/Afor %%i in (%~sf0) do set DIR_HOME=%%~dPsi..
2N/Aset INSTANCE_ROOT=%DIR_HOME%
2N/Arem This is the template to use for logging. Make sure to use >>
2N/Arem echo %SCRIPT%: your-message-here >> %LOG%
2N/Aecho %SCRIPT%: invoked >> %LOG%
2N/Aset SCRIPT_NAME=start-ds
2N/Arem Set environment variables
2N/Aset SCRIPT_UTIL_CMD=set-full-environment-and-test-java
2N/Aif NOT %errorlevel% == 0 exit /B %errorlevel%
2N/Aecho %SCRIPT%: CLASSPATH=%CLASSPATH% >> %LOG%
2N/Aif %errorlevel% == 98 goto serverAlreadyStopped
2N/Aif %errorlevel% == 99 goto startUsingSystemCall
2N/Aif %errorlevel% == 100 goto stopUsingSystemCall
2N/Aif %errorlevel% == 101 goto restartUsingSystemCall
2N/Aif %errorlevel% == 102 goto stopUsingProtocol
2N/Aif %errorlevel% == 103 goto stopAsWindowsService
2N/Aif %errorlevel% == 104 goto restartAsWindowsService
2N/Arem An error or we display usage
2N/A:serverAlreadyStopped
2N/Aecho %SCRIPT%: server already stopped >> %LOG%
2N/A:startUsingSystemCall
2N/Aecho %SCRIPT%: start using system call >> %LOG%
2N/Aecho %SCRIPT%: stop using system call >> %LOG%
2N/A:restartUsingSystemCall
2N/Aecho %SCRIPT%: restart using system call >> %LOG%
2N/Aif not %errorlevel% == 0 goto end
2N/Agoto startUsingSystemCall
2N/Aecho %SCRIPT%: stop using protocol >> %LOG%
2N/A:stopAsWindowsService
2N/Aecho %SCRIPT%: stop as windows service >> %LOG%
2N/A:restartAsWindowsService
2N/Aecho %SCRIPT%: restart as windows service, stopping >> %LOG%
2N/Aif not %errorlevel% == 0 goto end
2N/Aecho %SCRIPT%: restart as windows service, starting >> %LOG%
2N/Aecho %SCRIPT%: finished >> %LOG%