Advertisement
Sergio_Istea

pint-test.sh

May 17th, 2021
269
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3.  
  4. if [ -z $1 ]; then
  5. echo "Uso: $0 <ip>|<hostname>"
  6. exit
  7. fi
  8.  
  9. if [ $1 = "--help" ]; then
  10. echo ""
  11. echo "Ping test version 1"
  12. echo "Uso: $0 <ip>|<hostaname>"
  13. echo ""
  14. exit
  15. fi
  16.  
  17. while true; do
  18. clear
  19. ping -c 1 $1 &> /dev/null
  20.  
  21. if [ $? != 0 ];then
  22.  
  23. echo "conexion interrumpida"
  24. break
  25. fi
  26. done
  27.  
  28. echo "se interrumpio la conexion, contacte con el administrador"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement