Created
March 7, 2015 08:32
-
-
Save stlehmann/7467be97e4c1f13d9da7 to your computer and use it in GitHub Desktop.
Shell script for periodic check if the Wifi adapter is still up
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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