Skip to content

Commit

Permalink
Allow setting KEYSTORE_PASSWORD through env variable
Browse files Browse the repository at this point in the history
Signed-off-by: Craig Perkins <[email protected]>
  • Loading branch information
cwperks committed Mar 22, 2024
1 parent 13604c8 commit 55b5cfd
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions distribution/src/bin/opensearch
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,16 @@ fi

# get keystore password before setting java options to avoid
# conflicting GC configurations for the keystore tools
unset KEYSTORE_PASSWORD
KEYSTORE_PASSWORD=
if [[ $CHECK_KEYSTORE = true ]] \
&& bin/opensearch-keystore has-passwd --silent
then
if ! read -s -r -p "OpenSearch keystore password: " KEYSTORE_PASSWORD ; then
echo "Failed to read keystore password on console" 1>&2
exit 1
if [[ ! -z "${KEYSTORE_PASSWORD}" ]]; then
echo "Using value of KEYSTORE_PASSWORD from the environment"
else
if ! read -s -r -p "OpenSearch keystore password: " KEYSTORE_PASSWORD ; then
echo "Failed to read keystore password on console" 1>&2
exit 1
fi
fi
fi

Expand Down

0 comments on commit 55b5cfd

Please sign in to comment.