Skip to content

Instantly share code, notes, and snippets.

@susomena
Last active August 29, 2015 14:16
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 susomena/5575419213994e731cc9 to your computer and use it in GitHub Desktop.
Save susomena/5575419213994e731cc9 to your computer and use it in GitHub Desktop.
Script to wake up WiFi

Network wakeup script

By Jesús Mena.

This simple script wakes up WiFi in a Linux system which is power-saving, like Raspberry Pi (Raspberry Pi turns off WiFi adapters to save energy when WiFi signal is weak).

If you want this script to execute periodically add it to your crontab.

#!/bin/bash
if ! ifconfig wlan0 | grep -q "inet addr:" ; then
ifup --force wlan0
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment