Skip to content

Instantly share code, notes, and snippets.

@daniel-sc
Last active January 20, 2019 16:30
Show Gist options
  • Save daniel-sc/6cd54a635dda9e4e0571194cc51175f5 to your computer and use it in GitHub Desktop.
Save daniel-sc/6cd54a635dda9e4e0571194cc51175f5 to your computer and use it in GitHub Desktop.
#!/bin/bash
# copy to: /etc/cron.hourly/check-wlan
# test with: sudo run-parts --test /etc/cron.hourly
if ifconfig wlan0 | grep "inet addr:" ; then
logger "wifi ok"
exit
else
logger "Network down! Attempting reconnection."
ifup --force wlan0
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment