
. /lib/functions.sh
. /lib/functions/uci-defaults.sh
. /lib/functions/system.sh

mediatek_setup_interfaces()
{
	local board="$1"

	case $board in
	bananapi,bpi-r64|\
	linksys,e8450|\
	linksys,e8450-ubi|\
	mediatek,mt7622-rfb1)
		ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 lan4" wan
		;;
	buffalo,wsr-2533dhp2)
		ucidef_add_switch "switch0" \
			"0:lan" "1:lan" "2:lan" "3:lan" "4:wan" "6@eth0"
		;;
	ubnt,unifi-6-lr|\
	ubnt,unifi-6-lr-ubootmod)
		ucidef_set_interfaces_lan "eth0"
		;;
	*)
		ucidef_add_switch "switch0" \
				  "0:lan" "1:lan" "2:lan" "3:lan" "4:wan" "6u@eth0" "5u@eth1"
		;;
	esac
}

board_config_update
board=$(board_name)
mediatek_setup_interfaces $board
board_config_flush

exit 0
