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 | 066eae3a6351dcffa465efdb688cf0552b2e3ff3 (patch) | |
tree | fafa4ace96bccc45f65055313ecdfcbbf5107a85 /package/base-files/files | |
parent | 95097939323c17d60496d9d3e5acf079c62f90aa (diff) | |
download | master-187ad058-066eae3a6351dcffa465efdb688cf0552b2e3ff3.tar.gz master-187ad058-066eae3a6351dcffa465efdb688cf0552b2e3ff3.tar.bz2 master-187ad058-066eae3a6351dcffa465efdb688cf0552b2e3ff3.zip |
base-files: allow setting ide-disk led trigger
Signed-off-by: Jonas Gorski <jogo@openwrt.org>
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@46794 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package/base-files/files')
-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" |