lantiq: make leds and network work on VG3503J
[openwrt/openwrt.git] / target / linux / lantiq / base-files / etc / uci-defaults / 01_leds
1 #!/bin/sh
2 #
3 # Copyright (C) 2011 OpenWrt.org
4 # based on ar71xx
5 #
6
7 . /lib/functions/uci-defaults.sh
8 . /lib/functions/lantiq.sh
9
10 [ -e "/sys/class/leds/wifi" ] && ucidef_set_led_wlan "wifi" "wifi" "wifi" "phy0tpt"
11 [ -e "/sys/class/leds/usb" ] && ucidef_set_led_usbdev "usb" "usb" "usb" "1-1"
12 [ -e "/sys/class/leds/dsl" ] && ucidef_set_led_netdev "dsl" "dsl" "dsl" "pppoe-wan"
13
14 for a in `ls /sys/class/leds/`; do
15 grep -q "\[none\]" /sys/class/leds/$a/trigger
16 [ $? -eq 0 ] && ucidef_set_led_default $a $a $a `cat /sys/class/leds/$a/brightness`
17 done
18
19 board=$(lantiq_board_id)
20
21 case "$board" in
22 VG3503J)
23 ucidef_set_led_netdev "lan1" "lan1" "bt:green:lan1" "eth0"
24 ucidef_set_led_netdev "lan2" "lan2" "bt:green:lan2" "eth1"
25 ucidef_set_led_netdev "port1" "port1" "bt:green:port1" "eth0"
26 ucidef_set_led_netdev "port2" "port2" "bt:green:port2" "eth1"
27 ucidef_set_led_netdev "vdsl" "vdsl" "bt:green:dsl" "ptm0"
28 ;;
29 *)
30 ;;
31 esac
32
33 ucidef_commit_leds
34
35 exit 0