Skip to content

Instantly share code, notes, and snippets.

@lttlrck
Created March 18, 2016 17:17
Show Gist options
  • Save lttlrck/8454c05e90bb1084c4eb to your computer and use it in GitHub Desktop.
Save lttlrck/8454c05e90bb1084c4eb to your computer and use it in GitHub Desktop.
// e.g. ssh 1.2.3.4, will probe until server is ready, useful when waiting for reboot
sp()
{
echo "Probing..." ; (while ! nc -z -v -w1 $1 22 > /dev/null 2>&1 ; do :; done) ; echo "Connecting..."; ssh -o StrictHostKeyChecking=no "$1"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment