Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
#!/bin/bash
while true; do
fails=0
while ! ping -c1 $1 &>/dev/null;do
echo "Ping Fail $fails - `date`"
fails=$(($fails+1))
if [[ $fails > 3 ]]; then
echo "Restarting the Wi-Fi connection"
nmcli c down cqtest
nmcli c up cqtest
sleep 4
break
fi
done
sleep 1
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment