diff options
author | John Crispin <blogic@openwrt.org> | 2015-02-14 20:47:58 +0000 |
---|---|---|
committer | John Crispin <blogic@openwrt.org> | 2015-02-14 20:47:58 +0000 |
commit | 60759662cbc7fbf6f77066e118daa30ba22917ed (patch) | |
tree | bac4247f0c41a8e431d33015e024f6e4259ffc8c /package/base-files/files | |
parent | ed4bc0aec1c5dd43ff354ce22e69254b45f383ce (diff) | |
download | master-187ad058-60759662cbc7fbf6f77066e118daa30ba22917ed.tar.gz master-187ad058-60759662cbc7fbf6f77066e118daa30ba22917ed.tar.bz2 master-187ad058-60759662cbc7fbf6f77066e118daa30ba22917ed.zip |
uci-defaults: add ucidef_set_led_mmc
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@44446 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package/base-files/files')
-rw-r--r-- | package/base-files/files/lib/functions/uci-defaults.sh | 17 |
1 files changed, 17 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 eb5b240ee3..5a8809d68c 100644 --- a/package/base-files/files/lib/functions/uci-defaults.sh +++ b/package/base-files/files/lib/functions/uci-defaults.sh @@ -140,6 +140,23 @@ EOF UCIDEF_LEDS_CHANGED=1 } +ucidef_set_led_mmc() { + local cfg="led_$1" + local name=$2 + local sysfs=$3 + local trigger=$4 + + 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='$trigger' +EOF + UCIDEF_LEDS_CHANGED=1 +} + ucidef_set_rssimon() { local dev="$1" local refresh="$2" |