Added authorization to every Elastic request

This commit is contained in:
manuasir
2019-02-12 17:10:46 +01:00
parent 9a841fdbd3
commit 89e6af0d9a
2 changed files with 11 additions and 5 deletions
+7 -1
View File
@@ -9,7 +9,13 @@ else
el_url="${ELASTICSEARCH_URL}"
fi
until curl -XGET $el_url; do
if [ "x${ELASTICSEARCH_USERNAME}" = "x"]; then
auth=""
else
auth="--user ${ELASTICSEARCH_USERNAME}:${ELASTICSEARCH_PASSWORD}"
fi
until curl -XGET $el_url ${auth}; do
>&2 echo "Elastic is unavailable - sleeping"
sleep 5
done