Skip to content

Instantly share code, notes, and snippets.

@rammanokar
Created December 17, 2020 11:59
Show Gist options
  • Save rammanokar/03b631d17bb6cb84bc62001294eb69c2 to your computer and use it in GitHub Desktop.
Save rammanokar/03b631d17bb6cb84bc62001294eb69c2 to your computer and use it in GitHub Desktop.
WAN LED script for TP-Link Archer C5 V4
# 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