Last active
June 8, 2019 17:45
-
-
Save arudmin/d4111dd5d47120ff4a2e to your computer and use it in GitHub Desktop.
Reset wlan0 nttwork interface on Raspberry Pi
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/bash | |
ping -W 2 -c 1 8.8.8.8 > /dev/null | |
if [ $? -eq 0 ]; then | |
echo "online" | |
else | |
echo "offline" | |
logger -t [warn] “Internet connection lost. Trying to reload network interface” | |
sudo ifdown wlan0 | |
sleep 3 | |
sudo ifup wlan0 | |
fi |
Ralink RT5370 Driver for MacOS
http://www.mediatek.com/en/downloads/usb-rt2870rt2770rt3x7xrt537xrt5572/
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
$ nano /home/pi/.check_network.sh
$ chmod +x /home/pi/.check_network.sh
$ sudo crontab -e
*/2 * * * * /home/pi/.check_network.sh > /dev/null 2>&1