From 53ce5bc5170af368f730476067c4b74d0bb480d4 Mon Sep 17 00:00:00 2001 From: Edward Date: Sat, 22 Dec 2018 10:50:07 -0200 Subject: [PATCH] =?UTF-8?q?Espera=20at=C3=A9=20que=20Solr=20esteja=20pront?= =?UTF-8?q?o=20para=20requests?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- check_solr.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 check_solr.sh diff --git a/check_solr.sh b/check_solr.sh new file mode 100644 index 000000000..17ce5fe65 --- /dev/null +++ b/check_solr.sh @@ -0,0 +1,14 @@ +#!/bin/bash + +echo "Waiting for solr connection at $SOLR_URL ..." +while true; do + echo "$SOLR_URL/solr/admin/collections?action=LIST" + RESULT=$(curl -s -o /dev/null -I "$SOLR_URL/solr/admin/collections?action=LIST" -w '%{http_code}') + echo $RESULT + if [ "$RESULT" -eq '200' ]; then + echo "Solr server is up!" + break + else + sleep 3 + fi +done