Skip to content
This repository has been archived by the owner on Mar 30, 2023. It is now read-only.

wait_for_green_security_index: add echo commands to parse response #373

Merged
merged 1 commit into from
Dec 3, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/scripts/elasticsearch-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -538,10 +538,10 @@ wait_for_green_security_index()
local response=$(curl -XGET -u "elastic:$USER_ADMIN_PWD" -H 'Content-Type: application/json' --write-out '\n%{http_code}\n' \
"$PROTOCOL://localhost:9200/_cluster/health/.security?wait_for_status=green&timeout=5m&filter_path=status" $CURL_SWITCH | tee /dev/fd/17)
local curl_error_code=$?
local http_code=$($response | tail -n 1)
local http_code=$(echo "$response" | tail -n 1)
exec 17>&-
if [[ $http_code -eq 200 ]]; then
local body=$($response | head -n -1)
local body=$(echo "$response" | head -n -1)
local status=$(jq -r .status <<< $body)
if [[ $status -eq "green" ]]; then
return 0
Expand Down