Fix detection of local elasticsearch service

If elasticsearch is local and the URL was set via rake cli to "localhost" instead of "127.0.0.1", the service is not restarted.
This results in a broken state (search does not work, background tasks fail, etc.) if zammad is updated together with elasticsearch.
This commit is contained in:
Kevin Olbrich 2018-12-13 11:05:07 +01:00 committed by GitHub
parent ad19b532a9
commit fb8f02fa61
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -248,7 +248,7 @@ function setup_elasticsearch () {
yes | /usr/share/elasticsearch/bin/elasticsearch-plugin -s install ingest-attachment yes | /usr/share/elasticsearch/bin/elasticsearch-plugin -s install ingest-attachment
if [ "${ES_CONNECTION}" == "http://127.0.0.1:9200" ]; then if [ "${ES_CONNECTION}" == "http://127.0.0.1:9200" ] || [ "${ES_CONNECTION}" == "http://localhost:9200" ]; then
${INIT_CMD} restart elasticsearch ${INIT_CMD} restart elasticsearch
else else
echo -e "\n It seems you're running an external Elasticsearch server on ${ES_CONNECTION}" echo -e "\n It seems you're running an external Elasticsearch server on ${ES_CONNECTION}"