Last active
October 22, 2020 19:01
-
-
Save chockenberry/09c66fd31dec45a708e61f4763e58c22 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/sh | |
# usage: waitfor.sh myserver.example.com | |
ping_func(){ | |
host="$1" | |
$(ping -c 1 -t 1 "$host" &> /dev/null) | |
return $? | |
} | |
result=2 | |
while [[ $result -eq 2 ]]; do | |
echo ".\c" | |
ping_func $1 | |
result=$? | |
done | |
echo "" | |
say "$1 ready" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment