lantiq: fix VG3503J ethernet/gphy led support
[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/usb2" ] && ucidef_set_led_usbdev "usb2" "usb2" "usb2" "2-1"
13 [ -e "/sys/class/leds/internet" ] && ucidef_set_led_netdev "internet" "internet" "internet" "pppoe-wan"
14
15 for a in `ls /sys/class/leds/`; do
16 grep -q "\[none\]" /sys/class/leds/$a/trigger
17 [ $? -eq 0 ] && ucidef_set_led_default $a $a $a `cat /sys/class/leds/$a/brightness`
18 done
19
20 board=$(lantiq_board_id)
21
22 case "$board" in
23 VG3503J)
24 ucidef_set_led_netdev "vdsl" "vdsl" "bt:green:dsl" "ptm0"
25 ;;
26 *)
27 ;;
28 esac
29
30 ucidef_commit_leds
31
32 exit 0