aboutsummaryrefslogtreecommitdiffstats
path: root/package/base-files/files/lib/functions/uci-defaults.sh
diff options
context:
space:
mode:
authorJohn Crispin <john@openwrt.org>2015-01-17 13:58:14 +0000
committerJohn Crispin <john@openwrt.org>2015-01-17 13:58:14 +0000
commit744298b8a0dc363a802634b5ac5d08e861e65d12 (patch)
tree26965944c121f12def9c657b34951f51b06bc9b6 /package/base-files/files/lib/functions/uci-defaults.sh
parent5010e2d2dde47b90c71e865c85625862e6bef422 (diff)
downloadupstream-744298b8a0dc363a802634b5ac5d08e861e65d12.tar.gz
upstream-744298b8a0dc363a802634b5ac5d08e861e65d12.tar.bz2
upstream-744298b8a0dc363a802634b5ac5d08e861e65d12.zip
base-files: Add ucidef_set_led_timer to uci-defaults.sh
Signed-off-by: Gerald Kerma <dreagle@doukki.net> SVN-Revision: 44000
Diffstat (limited to 'package/base-files/files/lib/functions/uci-defaults.sh')
-rw-r--r--package/base-files/files/lib/functions/uci-defaults.sh20
1 files changed, 20 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 6ed0bf1176..eb5b240ee3 100644
--- a/package/base-files/files/lib/functions/uci-defaults.sh
+++ b/package/base-files/files/lib/functions/uci-defaults.sh
@@ -120,6 +120,26 @@ EOF
UCIDEF_LEDS_CHANGED=1
}
+ucidef_set_led_timer() {
+ local cfg="led_$1"
+ local name=$2
+ local sysfs=$3
+ local delayon=$4
+ local delayoff=$5
+
+ 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='timer'
+set system.$cfg.delayon='$delayon'
+set system.$cfg.delayoff='$delayoff'
+EOF
+ UCIDEF_LEDS_CHANGED=1
+}
+
ucidef_set_rssimon() {
local dev="$1"
local refresh="$2"