Last active
February 23, 2017 08:38
-
-
Save Lahorde/e080cb1c55e35e1ab0f6b590bf02de02 to your computer and use it in GitHub Desktop.
Sometimes on Raspberry, wifi connection cannot be reestablished. Check it and restart netctl auto connection to wlan0 all 5 min with a cron job
This file contains hidden or 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/sh | |
timeout 0.4 ping -c1 google.fr > /dev/null | |
if [ $? != 0 ] | |
then | |
echo "not connected to network" | |
if iwconfig 2>/dev/null|grep -q wlan0 | |
then | |
echo 'restart wlan0' | |
systemctl restart [email protected] | |
fi | |
fi |
This file contains hidden or 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
*/5 * * * * /usr/local/bin/check_wifi.sh |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
On archlinux, cronie is not installed by default. Refer this page