2334d6c25b49ed2b242fbbf14e4eaf066b3a5109
[oweals/openwrt.git] / target / linux / lantiq / ase / base-files / etc / board.d / 02_network
1 #!/bin/sh
2 #
3 # Copyright (C) 2011-2015 OpenWrt.org
4 #
5
6 . /lib/functions/uci-defaults.sh
7 . /lib/functions/system.sh
8 . /lib/functions/lantiq.sh
9
10 board_config_update
11
12 annex="a"
13
14 lan_mac=""
15 wan_mac=""
16
17 board=$(board_name)
18
19 case "$board" in
20 allnet,all0333cj)
21         annex="b"
22         lan_mac=$(mtd_get_mac_ascii uboot_env ethaddr)
23         wan_mac=$(macaddr_add "$lan_mac" 1)
24         ucidef_set_interface_lan 'eth0'
25         ;;
26 netgear,dgn1000b)
27         annex="b"
28         ucidef_set_interface_lan 'eth0'
29         ;;
30 *)
31         ucidef_set_interface_lan 'eth0'
32         ;;
33 esac
34
35 lantiq_setup_dsl_helper "$annex"
36
37 [ -n "$lan_mac" ] && ucidef_set_interface_macaddr "lan" "$lan_mac"
38 [ -n "$wan_mac" ] && ucidef_set_interface_macaddr "wan" "$wan_mac"
39
40 board_config_flush
41
42 exit 0
43