From 1faa6b83895dba3f275c72635f03518a6dc01007 Mon Sep 17 00:00:00 2001
From: jvergara <jvergara@localhost>
Date: Thu, 22 Feb 2007 09:41:28 +0000
Subject: [PATCH] Fix for Issues #1025 and #1248 ('stop-ds.bat should be able to stop server even if LDAP port' and 'cannot stop server through status panel').
---
opends/resource/bin/statuspanel.bat | 39 +++++++++++++++++++++++++++++++++++----
1 files changed, 35 insertions(+), 4 deletions(-)
diff --git a/opends/resource/bin/statuspanel.bat b/opends/resource/bin/statuspanel.bat
index 8a0e01d..61134c9 100644
--- a/opends/resource/bin/statuspanel.bat
+++ b/opends/resource/bin/statuspanel.bat
@@ -23,10 +23,41 @@
rem CDDL HEADER END
rem
rem
-rem Portions Copyright 2007 Sun Microsystems, Inc.
+rem Portions Copyright 2006-2007 Sun Microsystems, Inc.
setlocal
-set OPENDS_INVOKE_CLASS="org.opends.statuspanel.StatusPanelLauncher"
-set SCRIPT_NAME_ARG="-Dorg.opends.server.scriptName=statuspanel"
-call "%~dP0\_server-script.bat" %*
+set DIR_HOME=%~dP0..
+set INSTANCE_ROOT=%DIR_HOME%
+
+:checkJavaBin
+if "%JAVA_BIN%" == "" goto noJavaBin
+goto setClassPath
+
+:noJavaBin
+if "%JAVA_HOME%" == "" goto noJavaHome
+if not exist "%JAVA_HOME%\bin\java.exe" goto noJavaHome
+set JAVA_BIN=%JAVA_HOME%\bin\java.exe
+goto setClassPath
+
+:noJavaHome
+if not exist "%DIR_HOME%\bin\set-java-home.bat" goto noSetJavaHome
+call "%DIR_HOME%\bin\set-java-home.bat"
+set JAVA_BIN=%JAVA_HOME%\bin\java.exe
+goto setClassPath
+
+:noSetJavaHome
+echo Error: JAVA_HOME environment variable is not set.
+echo Please set it to a valid Java 5 installation.
+goto end
+
+:setClassPath
+FOR %%x in ("%DIR_HOME%\lib\*.jar") DO call "%DIR_HOME%\bin\setcp.bat" %%x
+
+set PATH=%SystemRoot%
+
+"%DIR_HOME%\lib\winlauncher.exe" launch "%DIR_HOME%" "%JAVA_BIN%" %JAVA_ARGS% org.opends.statuspanel.StatusPanelLauncher %*
+goto end
+
+
+:end
--
Gitblit v1.10.0