Advertisement
sergio_educacionit

conn_monitor.sh

Apr 29th, 2025
10
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3.  
  4. # bucle infinito
  5.  
  6. while :;do
  7.  
  8. msg=$(netstat -tun | grep -E '(:80|:443)\s')
  9. echo $msg
  10. sleep 0.5
  11. clear
  12.  
  13. if ! echo ${msg:-null} | grep ESTABLISHED > /dev/null; then
  14.  
  15. echo "No hay ninguna conexion."
  16. break # rompe el bucle
  17. fi
  18. done
  19.  
  20.  
  21. echo "se continua con el resto del script..."
  22.  
  23. read -p "presiene entre para contnuar"
  24.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement