Created
June 6, 2015 18:46
-
-
Save httpsterio/fbe03817c318d679ce4a 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 | |
# change the ip to your default gateway | |
ping -c4 192.168.1.1 > /dev/null | |
#if no ping exits unsuccesfully | |
if [ $? != 0 ] | |
then | |
echo "No connection, restarting wlan0" | |
#restarting wlan | |
/sbin/ifdown 'wlan0' | |
sleep 10 | |
/sbin/ifup --force 'wlan0' | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment