Advertisement
Sergio_Istea

monitor-internet.sh

Sep 27th, 2021
184
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.36 KB | None | 0 0
  1. # Bucle infinito
  2. # ':' siginifica 'true'
  3. while :;do
  4.     clear
  5.     echo "Estado de conexion"
  6.    
  7.     if ping -c1 google.com > /dev/null 2>&1; then
  8.         PING=$(ping -c 1 google.com)
  9.         LAG=$(echo $PING | cut -d "=" -f 3 | cut -d " " -f 1)
  10.         echo "Conexion a internet: ok"
  11.         echo "LAG: $LAG"
  12.         sleep 1
  13.     else
  14.         echo "Caonexion a internet: fail"
  15.         sleep 1
  16.     fi
  17.  
  18.  
  19. done
  20.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement