forked from opensearch-project/security
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds temp scripts to test the new java tool
Signed-off-by: Darshit Chanpura <[email protected]>
- Loading branch information
1 parent
69cfc4e
commit 14d4a8f
Showing
2 changed files
with
44 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
@echo off | ||
set DIR=%~dp0 | ||
|
||
if defined OPENSEARCH_JAVA_HOME ( | ||
set BIN_PATH="%OPENSEARCH_JAVA_HOME%\bin\java.exe" | ||
) else if defined JAVA_HOME ( | ||
set BIN_PATH="%JAVA_HOME%\bin\java.exe" | ||
) else ( | ||
echo Unable to find java runtime | ||
echo OPENSEARCH_JAVA_HOME or JAVA_HOME must be defined | ||
exit /b 1 | ||
) | ||
|
||
%BIN_PATH% -Dorg.apache.logging.log4j.simplelog.StatusLogger.level=OFF -cp "%DIR%\..\*;%DIR%\..\..\..\lib\*;%DIR%\..\deps\*" org.opensearch.security.tools.InstallDemoConfiguration %* 2> nul |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#!/bin/bash | ||
#install_demo_configuration.sh [-y] | ||
|
||
SCRIPT_PATH="${BASH_SOURCE[0]}" | ||
if ! [ -x "$(command -v realpath)" ]; then | ||
if [ -L "$SCRIPT_PATH" ]; then | ||
|
||
[ -x "$(command -v readlink)" ] || { echo "Not able to resolve symlink. Install realpath or readlink.";exit 1; } | ||
|
||
# try readlink (-f not needed because we know its a symlink) | ||
DIR="$( cd "$( dirname $(readlink "$SCRIPT_PATH") )" && pwd -P)" | ||
else | ||
DIR="$( cd "$( dirname "$SCRIPT_PATH" )" && pwd -P)" | ||
fi | ||
else | ||
DIR="$( cd "$( dirname "$(realpath "$SCRIPT_PATH")" )" && pwd -P)" | ||
fi | ||
|
||
BIN_PATH="java" | ||
|
||
# now set the path to java: first OPENSEARCH_JAVA_HOME, then JAVA_HOME | ||
if [ ! -z "$OPENSEARCH_JAVA_HOME" ]; then | ||
BIN_PATH="$OPENSEARCH_JAVA_HOME/bin/java" | ||
elif [ ! -z "$JAVA_HOME" ]; then | ||
BIN_PATH="$JAVA_HOME/bin/java" | ||
else | ||
echo "WARNING: nor OPENSEARCH_JAVA_HOME nor JAVA_HOME is set, will use $(which $BIN_PATH)" | ||
fi | ||
|
||
"$BIN_PATH" $JAVA_OPTS -Dorg.apache.logging.log4j.simplelog.StatusLogger.level=OFF -cp "$DIR/../*:$DIR/../../../lib/*:$DIR/../deps/*" org.opensearch.security.tools.InstallDemoConfiguration "$@" 2>/dev/null |