Quantcast
Channel: Planet Grep
Viewing all articles
Browse latest Browse all 4959

Sébastien Wains: Bash: loop until a connection is successful

$
0
0

I use Terminator as my terminal app, and use the "watch for activity" feature a lot. With the following command, I'd get notified as soon as the connection is opened.

while ! nc -vz localhost 3306; do sleep 1; done
echo 'Database is available'

Viewing all articles
Browse latest Browse all 4959

Latest Images

Trending Articles



Latest Images