Skip to content

Instantly share code, notes, and snippets.

@andreagrandi
Last active August 29, 2015 14:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andreagrandi/c703e4e67c38fbecf340 to your computer and use it in GitHub Desktop.
Save andreagrandi/c703e4e67c38fbecf340 to your computer and use it in GitHub Desktop.
keepalive_host='192.168.0.1'
ping -q -c1 $keepalive_host >> /dev/null
if [ "$?" -ne "0" ]; then
echo "`date` WIFI DOWN" >> wifi_log.txt
ifdown wlan0
rmmod 8192cu
modprobe 8192cu
ifup wlan0
echo "`date` WIFI UP" >> wifi_log.txt
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment