Created
February 8, 2016 17:50
-
-
Save xperimental/885d5c97f96236e2b2f3 to your computer and use it in GitHub Desktop.
Script to show client state on router led (for TP-Link WDR4300)
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/sh | |
readonly _on=default-on # can also be "timer" when you want it to blink | |
readonly _led=/sys/devices/platform/leds-gpio/leds/tp-link:blue:qss/trigger | |
readonly _counter=$(cat /sys/kernel/debug/batman_adv/bat0/transtable_local 2> /dev/null | grep -c 'W') | |
if [ "${_counter}" = "0" ]; then | |
echo "none" > ${_led} | |
else | |
echo "${_on}" > ${_led} | |
fi |
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
#show client status on led | |
*/1 * * * * /usr/sbin/counter-led.sh |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment