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

mediatek_setup_interfaces()
{
	local board="$1"

	case $board in
	mediatek,mt7986a-rfb|\
	mediatek,mt7986b-rfb)
		ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 lan4" wan
		;;
	bananapi,bpi-r3)
		ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 lan4 sfp2" "eth1 wan"
		ucidef_set_interface_macaddr "wan" "$(macaddr_add $(cat /sys/class/net/eth0/address) 1)"
		;;
	*)
		ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 lan4" wan
		;;
	esac
}

board_config_update
board=$(board_name)
mediatek_setup_interfaces $board
board_config_flush

exit 0
