Skip to content

Instantly share code, notes, and snippets.

@RGreinacher
Last active August 29, 2015 14:24
Show Gist options
  • Save RGreinacher/4ac7ef19f55ac60d69c9 to your computer and use it in GitHub Desktop.
Save RGreinacher/4ac7ef19f55ac60d69c9 to your computer and use it in GitHub Desktop.
Reup Linux WiFi connection
#!/bin/bash
# inspired by MrEngman; https://www.raspberrypi.org/forums/viewtopic.php?t=16054
# set `sudo chmod +x ./network-manager.sh` and call it in `/etc/rc.local`
while true ; do
if ifconfig wlan0 | grep -q "inet addr:" ; then
sleep 60
else
echo "Network connection down! Attempting reconnection."
ifup --force wlan0
sleep 10
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment