Skip to content

Commit

Permalink
Merge pull request #356 from wazuh/bugfix-355-http-auth-curl
Browse files Browse the repository at this point in the history
Add HTTP auth to curl when required
  • Loading branch information
Manuel J. Bernal authored Jun 18, 2020
2 parents 146dbff + 9536ff5 commit edb1c69
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion kibana/config/kibana_settings.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,12 @@ else
kibana_ip="kibana"
fi

while [[ "$(curl -XGET -I -s -o /dev/null -w ''%{http_code}'' $kibana_ip:5601/status)" != "200" ]]; do
# Add auth headers if required
if [ "$ELASTICSEARCH_USERNAME" != "" ] && [ "$ELASTICSEARCH_PASSWORD" != "" ]; then
curl_auth="-u $ELASTICSEARCH_USERNAME:$ELASTICSEARCH_PASSWORD"
fi

while [[ "$(curl $curl_auth -XGET -I -s -o /dev/null -w ''%{http_code}'' $kibana_ip:5601/status)" != "200" ]]; do
echo "Waiting for Kibana API. Sleeping 5 seconds"
sleep 5
done
Expand Down

0 comments on commit edb1c69

Please sign in to comment.