Posted By

jonathanbp on 05/05/11


Tagged


Versions (?)

check if a machine is responding on a given port - try until it is responding then say something


 / Published in: Bash
 

  1. #!/bin/bash
  2.  
  3. while true; do
  4. if nc -w 1 -z $1 $2; then
  5. say "server $1 is responding on port $2"
  6. exit
  7. else
  8. echo -n "#"
  9. sleep 5
  10. fi
  11. done

Report this snippet  

You need to login to post a comment.