Created
April 20, 2015 20:35
-
-
Save florianbeer/8c1e0a56bc306d603987 to your computer and use it in GitHub Desktop.
Alert if host is back up
This file contains 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
hostup() { | |
if (( $# != 1 )); then | |
echo "Usage: hostup HOSTNAME" | |
else | |
until $(which ping) -W1 -c1 ${1} > /dev/null; do sleep 5; done && $(which say) "${1} is up" | |
fi | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment