#!/bin/sh

. /lib/functions/network.sh

[ "$INTERFACE" = wan -a x"$(uci -q get system.board.type)" != x"router" ] && {
	if [ "re" = "$(uci -q get system.board.type)" ]; then
		ubus call wireless cleanup '{"iface":"wlan00"}'
		ubus call wireless cleanup '{"iface":"wlan10"}'
	else
		ubus call wireless cleanup
	fi

        [ "$ACTION" = ifup ] && {
		/etc/init.d/dnsmasq stop
		echo "" > /proc/net/mcore/br
	}

	[ "$ACTION" = ifdown ] && {
		/etc/init.d/dnsmasq restart
		echo "br-lan" > /proc/net/mcore/br
		/etc/init.d/hyfibrd reload
        }
}
