| 1 | #!/bin/bash |
| 2 | # |
| 3 | # Loops with 5 second intervals to Wait for hawkbit server to be ready to |
| 4 | # accept connections. |
| 5 | # This should be run once before continuing with tests and scripts that |
| 6 | # interact with hawkbit. |
| 7 | |
| 8 | printf "Waiting for hawkbit to come up " |
| 9 | cycles=0 |
| 10 | until $(curl --output /dev/null --silent --head --fail http://localhost:8080); do |
| 11 | printf '.' |
| 12 | [ $((cycles++)) -gt 10 ] && printf " failed\n" && exit 1 |
| 13 | sleep 5 |
| 14 | done |
| 15 | |
| 16 | printf '\n' |