kirkwood: update support for iconnect
[openwrt/openwrt.git] / target / linux / kirkwood / base-files / etc / uci-defaults / 02_network
1 #!/bin/sh
2 #
3 # Copyright (C) 2012-2013 OpenWrt.org
4 #
5
6 [ -e /etc/config/network ] && exit 0
7
8 touch /etc/config/network
9
10 set_lan_dhcp() {
11 local ifname=$1
12 uci batch <<EOF
13 set network.lan='interface'
14 set network.lan.ifname='$ifname'
15 set network.lan.proto='dhcp'
16 set network.lan6='interface'
17 set network.lan6.ifname='@lan'
18 set network.lan6.proto='dhcpv6'
19 set network.lan6.reqprefix='no'
20 EOF
21 }
22
23 . /lib/functions/uci-defaults.sh
24
25 ucidef_set_interface_loopback
26
27 case "`cat /proc/device-tree/model`" in
28 "Seagate FreeAgent Dockstar")
29 set_lan_dhcp "eth0"
30 ;;
31 "Iomega Iconnect")
32 set_lan_dhcp "eth0"
33 ;;
34 "RaidSonic ICY BOX IB-NAS62x0 (Rev B)")
35 set_lan_dhcp "eth0"
36 ;;
37 "Cloud Engines Pogoplug E02")
38 set_lan_dhcp "eth0"
39 ;;
40 *)
41 ucidef_set_interface_lan "eth0"
42 ;;
43 esac
44
45 uci commit network
46
47 exit 0