2012-05-29 16:39:15 +00:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
2013-10-14 19:46:40 +00:00
|
|
|
# Copyright (C) 2012-2013 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
|
|
|
|
|
|
|
|
ucidef_set_interface_loopback
|
|
|
|
|
2013-10-14 19:46:40 +00:00
|
|
|
case "`cat /proc/device-tree/model`" in
|
|
|
|
"Seagate FreeAgent Dockstar")
|
2012-05-29 16:39:15 +00:00
|
|
|
set_lan_dhcp "eth0"
|
|
|
|
;;
|
|
|
|
|
2013-10-14 19:46:40 +00:00
|
|
|
"RaidSonic ICY BOX IB-NAS62x0 (Rev B)")
|
2012-05-29 16:39:15 +00:00
|
|
|
set_lan_dhcp "eth0"
|
|
|
|
;;
|
2013-10-31 12:04:04 +00:00
|
|
|
"Cloud Engines Pogoplug E02")
|
|
|
|
set_lan_dhcp "eth0"
|
|
|
|
;;
|
2012-05-29 16:39:15 +00:00
|
|
|
*)
|
|
|
|
ucidef_set_interface_lan "eth0"
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
uci commit network
|
|
|
|
|
|
|
|
exit 0
|