#!/bin/sh

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

ath79_setup_interfaces()
{
	local board="$1"

	case "$board" in
	octogate,ac-1000)
		ucidef_set_interface_lan "eth0"
		;;
	octogate,ac-2000)
		ucidef_add_switch "switch0" \
			"0@eth0" "2:lan" "1:wan" "6@eth1"
		;;
	*)
		ucidef_set_interfaces_lan_wan "eth0" "eth1"
		;;
	esac
}

board_config_update
board=$(board_name)
ath79_setup_interfaces $board
board_config_flush

exit 0
