Skip to content

Instantly share code, notes, and snippets.

@so0k
Created May 11, 2017 10:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save so0k/adbed90e2a8e4fb0664edaa501a0ed3d to your computer and use it in GitHub Desktop.
Save so0k/adbed90e2a8e4fb0664edaa501a0ed3d to your computer and use it in GitHub Desktop.
Wait until a port is up

Use netcat to wait until port 8080 is open

while ! nc -z localhost 8080; do sleep 0.1; done; echo test

in a separate session open port 8080 (using netcat):

nc -l 8080
@so0k
Copy link
Author

so0k commented Sep 6, 2017

if netcat or telnet are not available

https://stackoverflow.com/a/19866239/138469

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment