Skip to content

Commit

Permalink
Fix set
Browse files Browse the repository at this point in the history
Signed-off-by: Stephen Crawford <[email protected]>
  • Loading branch information
stephen-crawford committed Sep 22, 2023
1 parent 12b45f9 commit 595a82b
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions tools/install_demo_configuration.bat
Original file line number Diff line number Diff line change
Expand Up @@ -345,16 +345,19 @@ if not defined ADMIN_PASSWORD (

echo ADMIN PASSWORD SET TO: !ADMIN_PASSWORD!

echo Use the Hasher script to hash the admin password
for /f %%b in ('"%OPENSEARCH_PLUGINS_DIR%\opensearch-security\tools\hash.bat" -p "!ADMIN_PASSWORD!"') do set "HASHED_ADMIN_PASSWORD=%%b"
REM Run the command and capture its output
for /f %%a in ('"%OPENSEARCH_PLUGINS_DIR%opensearch-security\tools\hash.bat" -p "!ADMIN_PASSWORD!"') do (
set "HASHED_ADMIN_PASSWORD=%%a"
)

REM Display the value of the variable
echo HASHED_ADMIN_PASSWORD is !HASHED_ADMIN_PASSWORD!

if errorlevel 1 (
echo Failed to hash the admin password
exit /b 1
)

echo HASHED PASSWORD SET TO: !HASHED_ADMIN_PASSWORD!

echo Clear the ADMIN_PASSWORD variable
set "ADMIN_PASSWORD="

Expand Down

0 comments on commit 595a82b

Please sign in to comment.