kirkwood: remove redundant code in etc/board.d/02_network
[openwrt/openwrt.git] / target / linux / kirkwood / base-files / etc / board.d / 02_network
index eb091745aff4127b4f23401fecec1e17a12f9f96..f91e8a3252260ec61a71c731bbe316ecf2cf4202 100755 (executable)
@@ -3,46 +3,26 @@
 # Copyright (C) 2012-2015 OpenWrt.org
 #
 
-[ -e /etc/config/network ] && exit 0
-
-touch /etc/config/network
-
-set_lan_dhcp() {
-       local ifname=$1
-       uci batch <<EOF
-set network.lan='interface'
-set network.lan.ifname='$ifname'
-set network.lan.proto='dhcp'
-set network.lan6='interface'
-set network.lan6.ifname='@lan'
-set network.lan6.proto='dhcpv6'
-set network.lan6.reqprefix='no'
-EOF
-}
-
-. /lib/functions/uci-defaults-new.sh
+. /lib/functions/uci-defaults.sh
 . /lib/kirkwood.sh
 
 board_config_update
 
-ucidef_set_interface_loopback
-
 board=$(kirkwood_board_name)
 
 case "$board" in
 "dockstar"|\
 "goflexhome"|\
 "goflexnet"|\
-"iconnect"|\
 "ib62x0"|\
+"iconnect"|\
 "nsa310s"|\
-"pogo_e02")
+"pogo_e02"|\
+"sheevaplug"|\
+"sheevaplug-esata")
        ucidef_set_interface_lan "eth0" "dhcp"
        ;;
-"linksys-audi")
-       ucidef_add_switch "switch0" \
-               "0:lan" "1:lan" "2:lan" "3:lan" "4:wan" "5@eth0" "6@eth1"
-       ;;
+"linksys-audi"|\
 "linksys-viper")
        ucidef_add_switch "switch0" \
                "0:lan" "1:lan" "2:lan" "3:lan" "4:wan" "5@eth0" "6@eth1"
@@ -50,15 +30,11 @@ case "$board" in
 "guruplug-server-plus")
        ucidef_set_interface_lan "eth0 eth1" "dhcp"
        ;;
-"sheevaplug" | \
-"sheevaplug-esata")
-       ucidef_set_interface_lan "eth0" "dhcp"
-       ;;
 *)
-       ucidef_set_interface_lan "eth0" "static"
+       ucidef_set_interface_lan "eth0"
        ;;
 esac
 
-uci commit network
+board_config_flush
 
 exit 0