base-files: Add ucidef_set_led_timer to uci-defaults.sh

Signed-off-by: Gerald Kerma <dreagle@doukki.net>

git-svn-id: svn://svn.openwrt.org/openwrt/trunk@44000 3c298f89-4303-0410-b956-a3cf2f4a3e73
master
John Crispin 2015-01-17 13:58:14 +00:00
parent 513e3dad01
commit 1f0e7b1205
1 changed files with 20 additions and 0 deletions

View File

@ -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"