Retry template installation a few times
This commit is contained in:
@ -16,11 +16,17 @@ until curl -s "$elasticsearch_url/_cluster/health?pretty" | grep '"status"' | gr
|
|||||||
sleep 5
|
sleep 5
|
||||||
done
|
done
|
||||||
|
|
||||||
echo "Loading VulnWhisperer index template"
|
count=0
|
||||||
if curl -s --fail -XPUT "http://$elasticsearch_url/_template/vulnwhisperer" -H 'Content-Type: application/json' -d '@/opt/index-template.json'; then
|
until curl -s --fail -XPUT "http://$elasticsearch_url/_template/vulnwhisperer" -H 'Content-Type: application/json' -d '@/opt/index-template.json'; do
|
||||||
echo -e "\nVulnWhisperer index template loaded successfully!"
|
echo "Loading VulnWhisperer index template..."
|
||||||
|
((count++)) && ((count==60)) && break
|
||||||
|
sleep 1
|
||||||
|
done
|
||||||
|
|
||||||
|
if [[ count -le 60 && $(curl -s -I http://$elasticsearch_url/_template/vulnwhisperer | head -n1 |cut -d$' ' -f2) == "200" ]]; then
|
||||||
|
echo -e "\n✅ VulnWhisperer index template loaded"
|
||||||
else
|
else
|
||||||
echo -e "\nFAILED to load VulnWhisperer index template"
|
echo -e "\n❌ VulnWhisperer index template failed to load"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
until [ "`curl -s -I "$kibana_url"/status | head -n1 |cut -d$' ' -f2`" == "200" ]; do
|
until [ "`curl -s -I "$kibana_url"/status | head -n1 |cut -d$' ' -f2`" == "200" ]; do
|
||||||
|
Reference in New Issue
Block a user