Created
September 11, 2019 20:02
-
-
Save rianby64/991f38902d52115c0ff2321f8508309e to your computer and use it in GitHub Desktop.
Esperar una conexion
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
i=0 | |
while [ true ] | |
do | |
echo "testing connection localhost:2345" | |
(echo >/dev/tcp/localhost/2345) &>/dev/null && i=0 || i=-1 | |
if [ $i -eq 0 ]; then | |
echo "ready" | |
break | |
fi | |
sleep 0.5 | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment