function checkWifiWan() {
	var pre_mode = uci.network.wan.type;
	var new_mode = 'bridge';

	if (countWifi('wan', 'sta')) {
		if ((countWifi('wan') + countOther('wan')) > 1) {
			return false;
		}
		new_mode = 'static';
	}

	if (pre_mode !== new_mode) {
		uci.network.wan.type = new_mode;
		uci.network.pchanged = true;
	}

	return true;
}
/*
 * WAN over wifi works only if the wifi interface
 * is not in a bridge. Switch to static in this case.
 * Also check if there are other WAN interfaces
 *since only a bridge would support that.
 */
WAN over wifi works only if the wifi interface
is not in a bridge. Switch to static in this case.
Also check if there are other WAN interfaces
since only a bridge would support that.
WAN over wifi works only if the wifi interface is not in a bridge . Switch to static in this case . Also check if there are other WAN interfaces since only a bridge would support that .
function checkWifiWan() {
	var pre_mode = uci.network.wan.type;
	var new_mode = 'bridge';
	if (countWifi('wan', 'sta')) {
		if ((countWifi('wan') + countOther('wan')) > 1) {
			return false;
		}
		new_mode = 'static';
	}
	if (pre_mode !== new_mode) {
		uci.network.wan.type = new_mode;
		uci.network.pchanged = true;
	}
	return true;
}
function checkWifiWan ( ) { var pre_mode = uci . network . wan . type ; var new_mode = 'bridge' ; if ( countWifi ( 'wan' , 'sta' ) ) { if ( ( countWifi ( 'wan' ) + countOther ( 'wan' ) ) > 1 ) { return false ; } new_mode = 'static' ; } if ( pre_mode !== new_mode ) { uci . network . wan . type = new_mode ; uci . network . pchanged = true ; } return true ; }
WAN over wifi works only if the wifi interface
 is not in a bridge.
WAN over wifi works only if the wifi interface is not in a bridge .