Created
March 27, 2014 12:39
-
-
Save recyclerobot/9806639 to your computer and use it in GitHub Desktop.
Restart network raspberry pi
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
ping -c4 192.168.1.1 > /dev/null | |
if [ $? != 0 ] | |
then | |
echo "No network connection, restarting wlan0" | |
/sbin/ifdown 'wlan0' | |
sleep 5 | |
/sbin/ifup --force 'wlan0' | |
fi | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment