Skip to content

Instantly share code, notes, and snippets.

@mttjohnson
Created July 3, 2018 18:41
Show Gist options
  • Select an option

  • Save mttjohnson/192b827c3f1b8f9dfdd3ffc259a01300 to your computer and use it in GitHub Desktop.

Select an option

Save mttjohnson/192b827c3f1b8f9dfdd3ffc259a01300 to your computer and use it in GitHub Desktop.
David's waitforssh shell script
#!/bin/sh
ssh $1
while test $? -gt 0
do
sleep 5 # highly recommended - if it's in your local network, it can try an awful lot pretty quick...
echo "Trying again..."
ssh $1
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment