Created
April 1, 2016 18:30
-
-
Save nati/a09bb353eb44975cd205f787369a91ac to your computer and use it in GitHub Desktop.
waitup bash function
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
#!/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