Last active
August 29, 2015 14:02
-
-
Save raymondbutcher/e27316a6418c361aa565 to your computer and use it in GitHub Desktop.
A shell script that waits until a command returns successfully.
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
| #!/usr/bin/env bash | |
| if [ -z $1 ] | |
| then | |
| script=`basename $0` | |
| echo "Usage: $script <command>" | |
| echo "Example: $script sudo service httpd status" | |
| exit 1 | |
| fi | |
| until status=`$*` | |
| do | |
| echo $status | |
| sleep 1 | |
| done | |
| echo $status |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I'm using this for a release script, to block until things are ready.
Wait until puppet has finished running:
Wait until apache is running: