#! /bin/bash . /usr/src/m2/framework/bash_functions.sh CURL_TIMEOUT=10 ES_HOST=$(get_elasticsearch_host) DB_NAME=m2 if grep -Fq manager_id /usr/src/m2/elasticsearch/m2_elasticsearch.sh && ! curl --silent --show-error --connect-timeout "$CURL_TIMEOUT" -XGET "$ES_HOST:9200/${DB_NAME}?pretty" | grep -Fq manager_id; then report "Full ES resync is needed. Please arrange with the client ASAP" 6 report "If ES is on different server, update sources on that server before resync" 3 fi