Created
September 6, 2020 14:29
-
-
Save z4yx/9596931d528d2ec4c99aaf2368ca5986 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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