14 lines
230 B
Bash
14 lines
230 B
Bash
#!/bin/bash
|
|
|
|
elastic_pass=$1
|
|
|
|
response="$(curl -u "elastic:${elastic_pass}" http://localhost:9200/_cluster/health)"
|
|
|
|
health="$(echo "${response}" | jq -r '.status')"
|
|
|
|
if [ "${health}" == "green" ]; then
|
|
exit 0
|
|
else
|
|
exit 1
|
|
fi
|