-3

Lots of cloud providers (AWS, GCE, etc) allow you to start up a machine instance, and then start billing you immediately. It can take anywhere from minutes to tens of minutes for the server to come up though. Is there a way to know (ideally from a script) the instant that sshd becomes available on the server?

1 Answers1

2
until nmap example.com -p 22 | grep -q open ; do sleep 1 ; done
tylerl
  • 15,055
  • 7
  • 51
  • 72