misc/debian/bullseye/notes/rpi-ping-leds.md

493 B
Executable File

Use LEDs on Raspberry Pi as status for network based on ping/dns. The /sys/class/leds/<led>/<file(s)>' must exist!

As root.

crontab -e

Add the following lines.

*/5 * * * * ping -I wlan0 -c5 one.one.one.one && sh -c 'echo 0 | tee /sys/class/leds/ACT/brightness' || sh -c 'echo 1 | tee /sys/class/leds/ACT/brightness'
*/5 * * * * ping -I wwan0 -c5 one.one.one.one && sh -c 'echo 0 | tee /sys/class/leds/PWR/brightness' || sh -c 'echo 1 | tee /sys/class/leds/PWR/brightness'