diff options
author | John Crispin <john@openwrt.org> | 2015-02-14 20:47:58 +0000 |
---|---|---|
committer | John Crispin <john@openwrt.org> | 2015-02-14 20:47:58 +0000 |
commit | eea462106f20fbd90acc6cfba21c73b9677b2752 (patch) | |
tree | 6c748ec62fc428d7c851659aed9b04b8fc73cadf /package/base-files | |
parent | d0cf5a05304e53600fd60ebce27ce83d9c350675 (diff) | |
download | mtk-20170518-eea462106f20fbd90acc6cfba21c73b9677b2752.zip mtk-20170518-eea462106f20fbd90acc6cfba21c73b9677b2752.tar.gz mtk-20170518-eea462106f20fbd90acc6cfba21c73b9677b2752.tar.bz2 |
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')
-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 eb5b240..5a8809d 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" |