Last active
January 21, 2024 21:43
-
-
Save bdd/4505e368c3240d86e3227df78b704d46 to your computer and use it in GitHub Desktop.
PC Engines apu2 LEDs
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
#!/usr/bin/env bash | |
set -euo pipefail | |
ltab=( | |
1/brightness=1 | |
2/trigger=disk-activity | |
3/trigger=netdev | |
3/device_name=enp1s0 | |
3/link=1 | |
3/tx=1 | |
3/rx=1 | |
) | |
sysfs_prefix=/sys/class/leds/apu2:green:led | |
sudo modprobe ledtrig-netdev | |
for ent in "${ltab[@]}"; do | |
read -r attr val <<<"${ent/=/ }" | |
echo -n "$attr = " | |
echo "${val}" | sudo tee "${sysfs_prefix}${attr}" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment