Skip to content

Instantly share code, notes, and snippets.

@stlehmann
Created March 7, 2015 08:32
Show Gist options
  • Save stlehmann/7467be97e4c1f13d9da7 to your computer and use it in GitHub Desktop.
Save stlehmann/7467be97e4c1f13d9da7 to your computer and use it in GitHub Desktop.
Shell script for periodic check if the Wifi adapter is still up
#!/bin/bash
TESTIP=192.168.1.1
ping -c4 ${TESTIP} > /dev/null
if [ $? != 0 ]
then
logger -t $0 "WiFi seems down, restarting"
ifdown --force wlan0
ifup wlan0
else
logger -t $0 "WiFi seems up."
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment