Skip to content

Instantly share code, notes, and snippets.

@128keaton
Created January 31, 2020 04:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save 128keaton/e2ec37b322c2c61f48c71ef9e3374fbf to your computer and use it in GitHub Desktop.
Save 128keaton/e2ec37b322c2c61f48c71ef9e3374fbf to your computer and use it in GitHub Desktop.
# vi /sbin/led-tool
#!/bin/bash
# Shamelessly stolen from https://community.ui.com/stories/Repurposing-a-second-UniFi-Cloud-Key-as-a-DNS-Recursor-Radius-and-NTP-server/56605e0f-401f-4397-8c05-5b1cbe118bf6
if [ "$1" == "blue" ]; then
echo "Enabling steady blue LED"
echo 0 > /sys/class/leds/ubnt:white:dome/brightness
cat /sys/class/leds/ubnt:blue:dome/max_brightness > /sys/class/leds/ubnt:blue:dome/brightness
elif [ "$1" == "white" ]; then
echo "Enabling flashing white LED"
echo 0 > /sys/class/leds/ubnt:blue:dome/brightness
echo timer > /sys/class/leds/ubnt:white:dome/trigger
echo 750 > /sys/class/leds/ubnt:white:dome/delay_off
echo 750 > /sys/class/leds/ubnt:white:dome/delay_on
else
echo "ERROR: Unrecognized led $1"
exit 3
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment