Last active
August 29, 2015 14:13
-
-
Save wcypierre/24dece267ae424ac8453 to your computer and use it in GitHub Desktop.
Revisions
-
wcypierre revised this gist
Jan 8, 2015 . 1 changed file with 0 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -48,6 +48,3 @@ else # logger "$INTERFACE is up" rm -f $FFLAG 2>/dev/null fi -
wcypierre revised this gist
Jan 8, 2015 . 1 changed file with 4 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -47,4 +47,7 @@ else # logger "$INTERFACE is up" rm -f $FFLAG 2>/dev/null fi echo "17" > /sys/class/gpio/unexport echo "22" > /sys/class/gpio/unexport -
wcypierre revised this gist
Jan 8, 2015 . 1 changed file with 0 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -36,9 +36,6 @@ then rm -f $FFLAG 2>/dev/null sudo reboot else touch $FFLAG logger $(sudo $IFDOWN $INTERFACE) sleep 10 -
wcypierre created this gist
Jan 8, 2015 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,53 @@ #!/bin/sh # cron script for checking wlan connectivity # change xxx to whatever IP you want to check. IP_FOR_TEST="xxx" PING_COUNT=1 PING="/bin/ping" IFUP="/sbin/ifup" IFDOWN="/sbin/ifdown --force" INTERFACE="wimax0" FFLAG="/opt/check_lan/stuck.fflg" # Red LED - uses GPIO17 echo "17" > /sys/class/gpio/export echo "out" > /sys/class/gpio/gpio17/direction # Green LED - uses GPIO22 echo "22" > /sys/class/gpio/export echo "out" > /sys/class/gpio/gpio22/direction # ping test $PING -c $PING_COUNT $IP_FOR_TEST > /dev/null 2> /dev/null if [ $? -ge 1 ] then logger "$INTERFACE seems to be down, trying to bring it up..." echo "1" > /sys/class/gpio/gpio17/value # lit the red led since the interface is down echo "0" > /sys/class/gpio/gpio22/value if [ -e $FFLAG ] then logger "$INTERFACE is still down, REBOOT to recover ..." rm -f $FFLAG 2>/dev/null sudo reboot else echo "0" > /sys/class/gpio/gpio17/value echo "1" > /sys/class/gpio/gpio22/value touch $FFLAG logger $(sudo $IFDOWN $INTERFACE) sleep 10 logger $(sudo $IFUP $INTERFACE) fi else echo "0" > /sys/class/gpio/gpio17/value echo "1" > /sys/class/gpio/gpio22/value # logger "$INTERFACE is up" rm -f $FFLAG 2>/dev/null fi