aboutsummaryrefslogtreecommitdiffstats
path: root/package/base-files/files/lib/functions/uci-defaults.sh
diff options
context:
space:
mode:
authorJohn Crispin <john@openwrt.org>2015-02-14 20:47:58 +0000
committerJohn Crispin <john@openwrt.org>2015-02-14 20:47:58 +0000
commiteea462106f20fbd90acc6cfba21c73b9677b2752 (patch)
tree6c748ec62fc428d7c851659aed9b04b8fc73cadf /package/base-files/files/lib/functions/uci-defaults.sh
parentd0cf5a05304e53600fd60ebce27ce83d9c350675 (diff)
downloadupstream-eea462106f20fbd90acc6cfba21c73b9677b2752.tar.gz
upstream-eea462106f20fbd90acc6cfba21c73b9677b2752.tar.bz2
upstream-eea462106f20fbd90acc6cfba21c73b9677b2752.zip
uci-defaults: add ucidef_set_led_mmc
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com> SVN-Revision: 44446
Diffstat (limited to 'package/base-files/files/lib/functions/uci-defaults.sh')
-rw-r--r--package/base-files/files/lib/functions/uci-defaults.sh17
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"