diff options
author | Gabor Juhos <juhosg@openwrt.org> | 2012-05-29 16:39:18 +0000 |
---|---|---|
committer | Gabor Juhos <juhosg@openwrt.org> | 2012-05-29 16:39:18 +0000 |
commit | 32b2b8607668f737019dcf45809abdfb41c8a4e2 (patch) | |
tree | b0fac94393195fe40f8aa5122a4114f5fb115ce8 /target/linux/ramips/base-files | |
parent | cceb4f9eb6ba72923cc729c754881e7c8137cab1 (diff) | |
download | upstream-32b2b8607668f737019dcf45809abdfb41c8a4e2.tar.gz upstream-32b2b8607668f737019dcf45809abdfb41c8a4e2.tar.bz2 upstream-32b2b8607668f737019dcf45809abdfb41c8a4e2.zip |
ramips: use the generic uci-default functions for initial LED setup
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@31993 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux/ramips/base-files')
-rwxr-xr-x | target/linux/ramips/base-files/etc/uci-defaults/leds | 49 |
1 files changed, 8 insertions, 41 deletions
diff --git a/target/linux/ramips/base-files/etc/uci-defaults/leds b/target/linux/ramips/base-files/etc/uci-defaults/leds index f87a64faef..fdfce39e8a 100755 --- a/target/linux/ramips/base-files/etc/uci-defaults/leds +++ b/target/linux/ramips/base-files/etc/uci-defaults/leds @@ -1,51 +1,14 @@ #!/bin/sh +. /lib/functions/uci-defaults.sh . /lib/ramips.sh set_usb_led() { - local sysfs="$1" - - uci batch <<EOF -set system.usb_led=led -set system.usb_led.name='usb' -set system.usb_led.sysfs='$sysfs' -set system.usb_led.trigger='usbdev' -set system.usb_led.dev='1-1' -set system.usb_led.interval='50' -commit system -EOF + ucidef_set_led_usbdev "usb" "USB" "$1" "1-1" } set_wifi_led() { - local sysfs="$1" - - uci batch <<EOF -set system.wifi_led=led -set system.wifi_led.name='wifi' -set system.wifi_led.sysfs='$sysfs' -set system.wifi_led.trigger='netdev' -set system.wifi_led.dev='wlan0' -set system.wifi_led.mode='link rx tx' -commit system -EOF -} - -set_wan_led() { - local sysfs="$1" - local name="$2" - local trigger="$3" - local dev="$4" - local mode="$5" - - uci batch <<EOF -set system.${name}_led=led -set system.${name}_led.name='$name' -set system.${name}_led.sysfs='$sysfs' -set system.${name}_led.trigger='$trigger' -set system.${name}_led.dev='$dev' -set system.${name}_led.mode='$mode' -commit system -EOF + ucidef_set_led_netdev "wifi_led" "wifi" "$1" "wlan0" } board=$(ramips_board_name) @@ -61,7 +24,7 @@ case $board in dir-600-b1|\ dir-600-b2) # ANDed with vlan switch port 4 led state - set_wan_led "d-link:amber:wan" wan_switch default-on + ucidef_set_led_default "wan" "WAN LED (amber)" "d-link:amber:wan" "1" ;; esr-9753) set_wifi_led "rt2800pci-phy0::radio" @@ -101,3 +64,7 @@ case $board in set_usb_led "wcr150gn:amber:user" ;; esac + +ucidef_commit_leds + +exit 0 |