2012-05-30 00:39:15 +08:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
2013-10-15 03:46:40 +08:00
|
|
|
# Copyright (C) 2012-2013 OpenWrt.org
|
2012-05-30 00:39:15 +08:00
|
|
|
#
|
|
|
|
|
|
|
|
[ -e /etc/config/network ] && exit 0
|
|
|
|
|
2013-10-15 03:46:40 +08:00
|
|
|
touch /etc/config/network
|
|
|
|
|
2012-05-30 00:39:15 +08: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 16:03:08 +08:00
|
|
|
set network.lan6='interface'
|
|
|
|
set network.lan6.ifname='@lan'
|
|
|
|
set network.lan6.proto='dhcpv6'
|
|
|
|
set network.lan6.reqprefix='no'
|
2012-05-30 00:39:15 +08:00
|
|
|
EOF
|
|
|
|
}
|
|
|
|
|
|
|
|
. /lib/functions/uci-defaults.sh
|
|
|
|
|
|
|
|
ucidef_set_interface_loopback
|
|
|
|
|
2013-10-15 03:46:40 +08:00
|
|
|
case "`cat /proc/device-tree/model`" in
|
|
|
|
"Seagate FreeAgent Dockstar")
|
2012-05-30 00:39:15 +08:00
|
|
|
set_lan_dhcp "eth0"
|
|
|
|
;;
|
2014-02-16 07:53:08 +08:00
|
|
|
"Iomega Iconnect")
|
|
|
|
set_lan_dhcp "eth0"
|
|
|
|
;;
|
2013-10-15 03:46:40 +08:00
|
|
|
"RaidSonic ICY BOX IB-NAS62x0 (Rev B)")
|
2012-05-30 00:39:15 +08:00
|
|
|
set_lan_dhcp "eth0"
|
|
|
|
;;
|
2013-10-31 20:04:04 +08:00
|
|
|
"Cloud Engines Pogoplug E02")
|
|
|
|
set_lan_dhcp "eth0"
|
|
|
|
;;
|
2012-05-30 00:39:15 +08:00
|
|
|
*)
|
|
|
|
ucidef_set_interface_lan "eth0"
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
uci commit network
|
|
|
|
|
|
|
|
exit 0
|