I have a script which creates a virtual machine and gives me back an IP address. Then I would like to do something like this:
waitforssh 192.168.2.38 && ssh 192.168.2.38
And it will wait for the machine to be up and ssh to be responding, then ssh into it.
waitforssh is the command I need to find.
Would nmap, netcat, fping or ping do the job? I tried netcat but it gives up in just a couple of seconds if the host is unreachable.
It needs to handle the fact that the machine itself is booting and might take some time to respond to network packets.