Guest User

Untitled

a guest
Jul 18th, 2018
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.91 KB | None | 0 0
  1. while true;
  2. do
  3. if ! [ "$(ping -c 1 google.com)" ]; then
  4. echo "no ping,will reset"
  5.  
  6. #counter of bad pings here
  7. count=1
  8. while [ $count -lt 30 ]
  9. do
  10. count=`expr $count + 1`
  11. echo "$count"
  12. # insert here: retest for good ping
  13. sleep 1
  14. done
  15.  
  16.  
  17. nmcli networking off
  18. sleep 5
  19. nmcli networking on
  20.  
  21.  
  22. #sleep for 15sec wait wifi on ssid search
  23. secs=$((1 * 15))
  24. while [ $secs -gt 0 ]; do
  25. echo -ne "$secs33[0Kr"wifi reactivate in-
  26. sleep 1
  27. : $((secs--))
  28. done
  29.  
  30.  
  31. if ! [ "$(ping -c 1 google.com)" ]; then
  32. echo "still offline for $count x @ $(date)"
  33.  
  34. else
  35. count=0
  36. #echo "reconnected at $(date)"
  37. echo "ON"
  38. fi
  39. else
  40.  
  41. echo "ONLINE"
  42. sleep 1
  43. clear
  44. fi
  45. done
Add Comment
Please, Sign In to add comment