Skip to content

Instantly share code, notes, and snippets.

@bdd
Last active January 21, 2024 21:43
Show Gist options
  • Save bdd/4505e368c3240d86e3227df78b704d46 to your computer and use it in GitHub Desktop.
Save bdd/4505e368c3240d86e3227df78b704d46 to your computer and use it in GitHub Desktop.
PC Engines apu2 LEDs
#!/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