diff options
author | Jonas Gorski <jogo@openwrt.org> | 2015-09-04 14:45:45 +0000 |
---|---|---|
committer | Jonas Gorski <jogo@openwrt.org> | 2015-09-04 14:45:45 +0000 |
commit | e1824f2543eb49a6d0bbc242f8a2f9809593a404 (patch) | |
tree | 9a7a17fb6edfdc1da3cf28b9d2b8f203525d3657 /package/base-files/files/lib/functions | |
parent | 05e4d736d1ededa779ce12946bedb20e003eeaa1 (diff) | |
download | upstream-e1824f2543eb49a6d0bbc242f8a2f9809593a404.tar.gz upstream-e1824f2543eb49a6d0bbc242f8a2f9809593a404.tar.bz2 upstream-e1824f2543eb49a6d0bbc242f8a2f9809593a404.zip |
base-files: allow setting ide-disk led trigger
Signed-off-by: Jonas Gorski <jogo@openwrt.org>
SVN-Revision: 46794
Diffstat (limited to 'package/base-files/files/lib/functions')
-rw-r--r-- | package/base-files/files/lib/functions/uci-defaults.sh | 16 |
1 files changed, 16 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 8ba95a22ff..2658d439ac 100644 --- a/package/base-files/files/lib/functions/uci-defaults.sh +++ b/package/base-files/files/lib/functions/uci-defaults.sh @@ -178,6 +178,22 @@ EOF UCIDEF_LEDS_CHANGED=1 } +ucidef_set_led_ide_disk() { + local cfg="led_$1" + local name=$2 + local sysfs=$3 + + 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='ide-disk' +EOF + UCIDEF_LEDS_CHANGED=1 +} + ucidef_set_rssimon() { local dev="$1" local refresh="$2" |