Friday 15 January 2010

linux - Use nc on TCP port tell is a service is up? -


Can I use the following trick on any TCP port to wait for a service to arrive?

  is correct; Do nc-i1 10.10.10.10 3306 & gt; / Dev / null & amp; Amp; To break  

Your loop waits for a connection to be available, but it Also, the connection to shut down by successful servers (which may never have) is an optional version here, which is waiting for the port to close:

  until nc -z 10.10 10.10 3306 Sleep 5  

No comments:

Post a Comment