Skip to content

Instantly share code, notes, and snippets.

View volodymyr-mykhailyk's full-sized avatar

Volodymyr Mykhailyk volodymyr-mykhailyk

View GitHub Profile
@volodymyr-mykhailyk
volodymyr-mykhailyk / wait_for_url.sh
Last active September 9, 2021 07:20
Shell to wait for url to respond
#!/bin/bash
ATTEMPTS_COUNTER=0
URL=$1
MAX_ATTEMPTS=${2:-10}
until $(curl --output /dev/null --silent --head --fail ${URL}); do
if [ ${ATTEMPTS_COUNTER} -eq ${MAX_ATTEMPTS} ];then
echo "Max attempts reached"