Skip to content

Instantly share code, notes, and snippets.

@recyclerobot
Created March 27, 2014 12:39
Show Gist options
  • Save recyclerobot/9806639 to your computer and use it in GitHub Desktop.
Save recyclerobot/9806639 to your computer and use it in GitHub Desktop.
Restart network raspberry pi
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