Advertisement
fplanzer

ping dominios

Jan 18th, 2019
210
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.36 KB | None | 0 0
  1. #!/bin/bash
  2. # Program name: pingall.sh
  3. date
  4. cat ./dominios.txt |  while read output
  5. do
  6.     ping -c 3 "$output" >> resultado.txt
  7.     if [ $? -eq 0 ]; then
  8.     echo "node $output is up"
  9.     else
  10.     echo "node $output is down"
  11.     fi
  12. done
  13.  
  14.  
  15.  
  16. -----------
  17.  
  18.  
  19. cat resultado.txt | grep IP >> final.txt
  20.  
  21. ---------------
  22.  
  23. cat final.txt | grep PING | wc -l
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement