base-files: add new application led trigger backend
For now we have only kernel LED trigger support. With this change it is now possible to use application triggers. If we configure a LED with a non kernel trigger, then we check on every restart and boot of the LED service if we have this trigger as an application in "/usr/libexec/led-trigger". If this file with the name is found, then we execute this to init the LED. Possible use cases are: - Start/Stop/Restart an application led trigger service for this led - Init a LED that is configured by a hotplug script (VPN tunnel established) Signed-off-by: Florian Eckert <fe@dev.tdt.de>
This commit is contained in:
parent
58ad113087
commit
dec14ac436
@ -31,10 +31,11 @@ load_led() {
|
|||||||
config_get gpio $1 gpio "0"
|
config_get gpio $1 gpio "0"
|
||||||
config_get inverted $1 inverted "0"
|
config_get inverted $1 inverted "0"
|
||||||
|
|
||||||
if [ "$trigger" = "rssi" ]; then
|
# execute application led trigger
|
||||||
# handled by rssileds userspace process
|
[ -f "/usr/libexec/led-trigger/${trigger}" ] && {
|
||||||
return
|
. "/usr/libexec/led-trigger/${trigger}"
|
||||||
fi
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
[ "$trigger" = "usbdev" ] && {
|
[ "$trigger" = "usbdev" ] && {
|
||||||
# Backward compatibility: translate to the new trigger
|
# Backward compatibility: translate to the new trigger
|
||||||
|
Loading…
Reference in New Issue
Block a user