OpenWrt and LED settings

  1. Delete WAN LED setting in System-LED
  2. create 3 scripts in /usr/bin

check.sh

#!/bin/sh
#
ping -q -w 4 -c 1 8.8.8.8 && /usr/bin/internet-on.sh || /usr/bin/internet-off.sh

internet-on.sh

#!/bin/sh
#

/bin/echo "255" > /sys/class/leds/tp-link:green:wan/brightness
/bin/echo "0" > /sys/class/leds/tp-link:orange:wan/brightness

internet-off.sh

#!/bin/sh
#

/bin/echo "0" > /sys/class/leds/tp-link:green:wan/brightness
/bin/echo "255" > /sys/class/leds/tp-link:orange:wan/brightness
  1. Create following task in cron:

*/1 * * * Mon,Tue,Wed,Thu,Fri,Sat,Sun /usr/bin/check.sh

Solution based on info from there: [How To] Switch on a led when internet connection is available