# WAN is not link
WANP=$(uci -q get network.wan.proto)
VDSL=$(ls /dev/vdsl > /dev/null 2>&1 && echo 1 || echo 0)
if [ "$INTERFACE" == "wan" -a "$WANP" != "3g" -a "$VDSL" != "1" ]; then
	/sbin/rapi_client -p | grep -E -q "1.*Auto.*Down" && exit
fi

[ ifup = "$ACTION" ] && {
	uci_set_state network "$INTERFACE" up 1 
    WANUP=$(cat /proc/uptime | awk '{print $1}')
	uci_revert_state network "$INTERFACE" uptime
    uci_set_state network "$INTERFACE" uptime "$WANUP"
	if [ "$INTERFACE" == "wan" ]; then
		uci revert -P /var/state/ network.ifup_running
	fi
	if [ "$INTERFACE" == "3gwan" ]; then
		cp /var/run/ppp1.pid /var/run/ppp1-3g.pid 2>/dev/null
	fi
}
