orion: convert initial network configuration to board.d

Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>

SVN-Revision: 47759
lede-17.01
Jo-Philipp Wich 2015-12-04 14:39:14 +00:00
parent b6a9c5c400
commit 2f042b452e
2 changed files with 15 additions and 53 deletions

View File

@ -0,0 +1,15 @@
#!/bin/sh
. /lib/functions/uci-defaults-new.sh
board_config_update
if grep -q lan1 /proc/net/dev; then
ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 lan4" "wan"
else
ucidef_set_interface_lan "eth0"
fi
board_config_flush
exit 0

View File

@ -1,53 +0,0 @@
config_simple() {
cat >> /etc/config/network <<EOF
config interface lan
option ifname eth0
option type bridge
option proto static
option ipaddr 192.168.1.1
option netmask 255.255.255.0
option ip6assign 60
EOF
}
config_dsa() {
cat >> /etc/config/network <<EOF
config interface eth0
option ifname eth0
config interface wan
option ifname wan
option proto dhcp
option hostname openwrt
config interface lan
option ifname "lan1 lan2 lan3 lan4"
option type bridge
option proto static
option ipaddr 192.168.1.1
option netmask 255.255.255.0
option ip6assign 60
config interface wan6
option ifname wan
option proto dhcpv6
config globals globals
option ula_prefix auto
EOF
}
cat > /etc/config/network <<EOF
config interface loopback
option ifname lo
option proto static
option ipaddr 127.0.0.1
option netmask 255.0.0.0
EOF
if grep -q lan /proc/net/dev; then
config_dsa
else
config_simple
fi