all targets: use numerically prefixed uci-defaults file names to better control order...
[openwrt.git] / target / linux / kirkwood / base-files / etc / uci-defaults / 02_network
1 #!/bin/sh
2 #
3 # Copyright (C) 2012 OpenWrt.org
4 #
5
6 [ -e /etc/config/network ] && exit 0
7
8 set_lan_dhcp() {
9         local ifname=$1
10         uci batch <<EOF
11 set network.lan='interface'
12 set network.lan.ifname='$ifname'
13 set network.lan.proto='dhcp'
14 EOF
15 }
16
17 . /lib/functions/uci-defaults.sh
18 . /lib/kirkwood.sh
19
20 touch /etc/config/network
21
22 ucidef_set_interface_loopback
23
24 hardware=$(kirkwood_hardware_name)
25
26 case "$hardware" in
27 "Seagate FreeAgent DockStar")
28         set_lan_dhcp "eth0"
29         ;;
30
31 "RaidSonic ICY BOX IB-NAS6210")
32         set_lan_dhcp "eth0"
33         ;;
34
35 *)
36         ucidef_set_interface_lan "eth0"
37         ;;
38 esac
39
40 uci commit network
41
42 exit 0