Created
February 19, 2017 10:36
-
-
Save thbkrkr/b37da91bd81a159eeec2445a1f8eb99e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash -eu | |
| until_ready() { | |
| declare try=${1:-10} sleepTime=${2:-1} | |
| _is_ready() { | |
| test $try -eq 0 | |
| is_ready | |
| } | |
| until _is_ready ; do | |
| echo "try $try" | |
| sleep $sleepTime | |
| let try-=1 | |
| done | |
| } | |
| is_ready() { | |
| test -f top | |
| } | |
| until_ready 20 0.2 | |
| echo "ok" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment