mirror of
https://github.com/miskcoo/ugreen_dx4600_leds_controller.git
synced 2025-07-23 04:13:04 +02:00
Some checks failed
Build kernel module for TrueNAS / build-and-run (push) Has been cancelled
* Add support for setting power LED via systemctl * Add documentation for rudimentary ugreen-power-led.service * Add "Type=oneshot" and "RemainAfterExit=true" as suggested
31 lines
891 B
Bash
31 lines
891 B
Bash
#!/usr/bin/bash
|
|
|
|
# use variables from config file (unRAID specific)
|
|
if [[ -f /boot/config/plugins/ugreenleds-driver/settings.cfg ]]; then
|
|
source /boot/config/plugins/ugreenleds-driver/settings.cfg
|
|
fi
|
|
|
|
# load environment variables
|
|
if [[ -f /etc/ugreen-leds.conf ]]; then
|
|
source /etc/ugreen-leds.conf
|
|
fi
|
|
|
|
# Blink settings for the power LED
|
|
# * none: no blinking
|
|
# * breath <delay_on> <delay_off>: breathing blink
|
|
# * blink <delay_on> <delay_off>: blinking
|
|
BLINK_TYPE_POWER=${BLINK_TYPE_POWER:="none"}
|
|
|
|
# brighness of the power LED
|
|
BRIGHTNESS_POWER=${BRIGHTNESS_POWER:=255}
|
|
|
|
# color of the power LED
|
|
COLOR_POWER=${COLOR_POWER:="255 255 255"}
|
|
|
|
# initialize LEDs
|
|
if [[ -d /sys/class/leds/power ]]; then
|
|
echo "$BLINK_TYPE_POWER" > /sys/class/leds/power/blink_type
|
|
echo "$BRIGHTNESS_POWER" > /sys/class/leds/power/brightness
|
|
echo "$COLOR_POWER" > /sys/class/leds/power/color
|
|
fi
|