Created
December 17, 2020 11:59
-
-
Save rammanokar/03b631d17bb6cb84bc62001294eb69c2 to your computer and use it in GitHub Desktop.
WAN LED script for TP-Link Archer C5 V4
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 characters
# save this script in /lib/wan_check.sh | |
# and add | |
# /lib/wan_check.sh & | |
# in /etc/rc.local | |
while true ; do | |
Status=$(ping -q -c 2 -W 1 1.1.1.1 > /dev/null 2>&1 && echo "ok" || echo "FAIL") | |
if [ "$Status" = "ok" ]; then | |
on="green"; off="orange" | |
else | |
on="orange"; off="green" | |
fi | |
echo 0 > /sys/class/leds/archer-c5-v4:$off:wan/brightness | |
echo 255 > /sys/class/leds/archer-c5-v4:$on:wan/brightness | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment