Skip to content

Instantly share code, notes, and snippets.

@rianby64
Created September 11, 2019 20:02
Show Gist options
  • Save rianby64/991f38902d52115c0ff2321f8508309e to your computer and use it in GitHub Desktop.
Save rianby64/991f38902d52115c0ff2321f8508309e to your computer and use it in GitHub Desktop.
Esperar una conexion
#!/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