Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- while true;
- do
- if ! [ "$(ping -c 1 google.com)" ]; then
- echo "no ping,will reset"
- #counter of bad pings here
- count=1
- while [ $count -lt 30 ]
- do
- count=`expr $count + 1`
- echo "$count"
- # insert here: retest for good ping
- sleep 1
- done
- nmcli networking off
- sleep 5
- nmcli networking on
- #sleep for 15sec wait wifi on ssid search
- secs=$((1 * 15))
- while [ $secs -gt 0 ]; do
- echo -ne "$secs 33[0Kr"wifi reactivate in-
- sleep 1
- : $((secs--))
- done
- if ! [ "$(ping -c 1 google.com)" ]; then
- echo "still offline for $count x @ $(date)"
- else
- count=0
- #echo "reconnected at $(date)"
- echo "ON"
- fi
- else
- echo "ONLINE"
- sleep 1
- clear
- fi
- done
Add Comment
Please, Sign In to add comment