diff --git a/elasticsearch/docker-healthcheck b/elasticsearch/docker-healthcheck index 653a034..755669c 100755 --- a/elasticsearch/docker-healthcheck +++ b/elasticsearch/docker-healthcheck @@ -2,7 +2,8 @@ set -eo pipefail host="$(hostname --ip-address || echo '127.0.0.1')" - +health="$(curl -fsSL "http://$host:9200/_cat/health?h=status")" +echo $health if health="$(curl -fsSL "http://$host:9200/_cat/health?h=status")"; then health="$(echo "$health" | sed -r 's/^[[:space:]]+|[[:space:]]+$//g')" # trim whitespace (otherwise we'll have "green ") if [ "$health" = 'green' ]; then