Last active
May 14, 2019 22:56
-
-
Save varnav/8a40ce7b4cb9c43033b117929a40f419 to your computer and use it in GitHub Desktop.
Monitor and restart WiFi for Raspbian
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 -c4 192.168.1.1 > /dev/null | |
| if [ $? != 0 ] | |
| then | |
| d=`date` | |
| echo "$d No network connection, restarting wlan0" >> /var/log/wifimon.txt | |
| ifconfig wlan0 down | |
| sleep 5 | |
| ifconfig wlan0 up | |
| # Disable power mgmt | |
| iwconfig wlan0 power off | |
| fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment