2012-05-29 16:39:15 +00:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
2014-05-28 21:43:39 +00:00
|
|
|
# Copyright (C) 2012-2014 OpenWrt.org
|
2012-05-29 16:39:15 +00:00
|
|
|
#
|
|
|
|
|
|
|
|
[ -e /etc/config/network ] && exit 0
|
|
|
|
|
2013-10-14 19:46:40 +00:00
|
|
|
touch /etc/config/network
|
|
|
|
|
2012-05-29 16:39:15 +00:00
|
|
|
set_lan_dhcp() {
|
|
|
|
local ifname=$1
|
|
|
|
uci batch <<EOF
|
|
|
|
set network.lan='interface'
|
|
|
|
set network.lan.ifname='$ifname'
|
|
|
|
set network.lan.proto='dhcp'
|
2013-04-09 08:03:08 +00:00
|
|
|
set network.lan6='interface'
|
|
|
|
set network.lan6.ifname='@lan'
|
|
|
|
set network.lan6.proto='dhcpv6'
|
|
|
|
set network.lan6.reqprefix='no'
|
2012-05-29 16:39:15 +00:00
|
|
|
EOF
|
|
|
|
}
|
|
|
|
|
|
|
|
. /lib/functions/uci-defaults.sh
|
2014-06-24 18:18:53 +00:00
|
|
|
. /lib/functions/kirkwood.sh
|
|
|
|
|
|
|
|
board=$(kirkwood_board_name)
|
2012-05-29 16:39:15 +00:00
|
|
|
|
|
|
|
ucidef_set_interface_loopback
|
|
|
|
|
2014-06-24 18:18:53 +00:00
|
|
|
case "$board" in
|
|
|
|
"dockstar")
|
2012-05-29 16:39:15 +00:00
|
|
|
set_lan_dhcp "eth0"
|
|
|
|
;;
|
2014-06-24 18:18:53 +00:00
|
|
|
"iconnect")
|
2014-02-15 23:53:08 +00:00
|
|
|
set_lan_dhcp "eth0"
|
|
|
|
;;
|
2014-06-24 18:18:53 +00:00
|
|
|
"ib62x0")
|
2012-05-29 16:39:15 +00:00
|
|
|
set_lan_dhcp "eth0"
|
|
|
|
;;
|
2014-06-24 18:18:53 +00:00
|
|
|
"pogo_e02")
|
2013-10-31 12:04:04 +00:00
|
|
|
set_lan_dhcp "eth0"
|
|
|
|
;;
|
2014-06-24 18:18:53 +00:00
|
|
|
"ea4500")
|
2014-05-28 21:43:39 +00:00
|
|
|
ucidef_set_interfaces_lan_wan "eth0" "eth1"
|
|
|
|
;;
|
2012-05-29 16:39:15 +00:00
|
|
|
*)
|
|
|
|
ucidef_set_interface_lan "eth0"
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
uci commit network
|
|
|
|
|
|
|
|
exit 0
|