Skip to content

Commit

Permalink
Change the .bat too
Browse files Browse the repository at this point in the history
Signed-off-by: Ryan Liang <[email protected]>
  • Loading branch information
RyanL1997 committed Oct 4, 2023
1 parent 91726a3 commit 4ae0900
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions tools/install_demo_configuration.bat
Original file line number Diff line number Diff line change
Expand Up @@ -359,17 +359,16 @@ if errorlevel 1 (
exit /b 1
)

set "default_line= hash: "$2a$12$VcCDgh2NDk07JGN0rjGbM.Ad41qVR/YFJcgHp0UGns5JDymv..TOG""
set "search=%default_line%"
set "replace= hash: "%HASHED_ADMIN_PASSWORD%""

setlocal enableextensions
for /f "delims=" %%i in ('type "%INTERNAL_USERS_FILE%" ^& break ^> "%INTERNAL_USERS_FILE%" ') do (
set "line=%%i"
setlocal enabledelayedexpansion
>>"%INTERNAL_USERS_FILE%" echo(!line:%search%=%replace%!
endlocal
)
:: Append the admin credential to the end of the internal_users.yml file
echo admin: >> !INTERNAL_USERS_FILE!
echo hash: "!HASHED_ADMIN_PASSWORD!" >> !INTERNAL_USERS_FILE!
echo reserved: true >> !INTERNAL_USERS_FILE!
echo backend_roles: >> !INTERNAL_USERS_FILE!
echo - "admin" >> !INTERNAL_USERS_FILE!
echo description: "Demo admin user" >> !INTERNAL_USERS_FILE!

echo Content appended to !INTERNAL_USERS_FILE!
endlocal

:: network.host
>nul findstr /b /c:"network.host" "%OPENSEARCH_CONF_FILE%" && (
Expand Down

0 comments on commit 4ae0900

Please sign in to comment.