Skip to content

Instantly share code, notes, and snippets.

@nati
Created April 1, 2016 18:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nati/a09bb353eb44975cd205f787369a91ac to your computer and use it in GitHub Desktop.
Save nati/a09bb353eb44975cd205f787369a91ac to your computer and use it in GitHub Desktop.
waitup bash function
#!/bin/bash
# waitup
#
# A utility function for show notification when a server get ssh ready
#
# install:
# brew installterminal-notifier
#
# usage:
# waitup IP
function waitup() {
while true; do
nc -vz $1 22
if [[ $? == 0 ]]; then
terminal-notifier -message "$1 up"
return
fi
done
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment