Skip to content

Instantly share code, notes, and snippets.

@thbkrkr
Created February 19, 2017 10:36
Show Gist options
  • Select an option

  • Save thbkrkr/b37da91bd81a159eeec2445a1f8eb99e to your computer and use it in GitHub Desktop.

Select an option

Save thbkrkr/b37da91bd81a159eeec2445a1f8eb99e to your computer and use it in GitHub Desktop.
#!/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