diff options
author | John Crispin <john@openwrt.org> | 2015-07-14 07:35:59 +0000 |
---|---|---|
committer | John Crispin <john@openwrt.org> | 2015-07-14 07:35:59 +0000 |
commit | d0d3ca2a1bc5fc61233351e1f5f5cd462e59407b (patch) | |
tree | 9f57ec55f5936263945d198e09fabb715d659ba5 /package/base-files/files/lib/functions/uci-defaults.sh | |
parent | c54b1be7c24eb1248e2df5d9a39bf8c4d7181fa4 (diff) | |
download | upstream-d0d3ca2a1bc5fc61233351e1f5f5cd462e59407b.tar.gz upstream-d0d3ca2a1bc5fc61233351e1f5f5cd462e59407b.tar.bz2 upstream-d0d3ca2a1bc5fc61233351e1f5f5cd462e59407b.zip |
base-files: added option to configure the gpio led trigger in uci-defaults
Signed-off-by: Günther Kelleter <guenther.kelleter@devolo.de>
SVN-Revision: 46341
Diffstat (limited to 'package/base-files/files/lib/functions/uci-defaults.sh')
-rw-r--r-- | package/base-files/files/lib/functions/uci-defaults.sh | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/package/base-files/files/lib/functions/uci-defaults.sh b/package/base-files/files/lib/functions/uci-defaults.sh index 6577ecdcde..8ba95a22ff 100644 --- a/package/base-files/files/lib/functions/uci-defaults.sh +++ b/package/base-files/files/lib/functions/uci-defaults.sh @@ -158,6 +158,26 @@ EOF UCIDEF_LEDS_CHANGED=1 } +ucidef_set_led_trigger_gpio() { + local cfg="led_$1" + local name=$2 + local sysfs=$3 + local gpio=$4 + local inverted=$5 + + uci -q get system.$cfg && return 0 + + uci batch <<EOF +set system.$cfg='led' +set system.$cfg.name='$name' +set system.$cfg.sysfs='$sysfs' +set system.$cfg.trigger='gpio' +set system.$cfg.gpio='$gpio' +set system.$cfg.inverted='$inverted' +EOF + UCIDEF_LEDS_CHANGED=1 +} + ucidef_set_rssimon() { local dev="$1" local refresh="$2" |