Skip to content

Instantly share code, notes, and snippets.

@florianbeer
Created April 20, 2015 20:35
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save florianbeer/8c1e0a56bc306d603987 to your computer and use it in GitHub Desktop.
Save florianbeer/8c1e0a56bc306d603987 to your computer and use it in GitHub Desktop.
Alert if host is back up
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