From 73bdb2f7c7a6bdb77e3fd84931ea5454e5631fa4 Mon Sep 17 00:00:00 2001 From: oblique Date: Fri, 25 Mar 2016 14:46:35 +0200 Subject: [PATCH] Set country code before we call can_transmit_to_channel Fix #148 --- create_ap | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/create_ap b/create_ap index 488fecd..bd7004f 100755 --- a/create_ap +++ b/create_ap @@ -1512,6 +1512,10 @@ echo $WIFI_IFACE > $CONFDIR/wifi_iface chmod 444 $CONFDIR/wifi_iface mutex_unlock +if [[ -n "$COUNTRY" && $USE_IWCONFIG -eq 0 ]]; then + iw reg set "$COUNTRY" +fi + can_transmit_to_channel ${WIFI_IFACE} ${CHANNEL} || die "Your adapter can not transmit to channel ${CHANNEL}, frequency band ${FREQ_BAND}GHz." if networkmanager_exists && ! networkmanager_iface_is_unmanaged ${WIFI_IFACE}; then @@ -1542,8 +1546,7 @@ ignore_broadcast_ssid=$HIDDEN ap_isolate=$ISOLATE_CLIENTS EOF -if [[ -n $COUNTRY ]]; then - [[ $USE_IWCONFIG -eq 0 ]] && iw reg set $COUNTRY +if [[ -n "$COUNTRY" ]]; then echo "country_code=${COUNTRY}" >> $CONFDIR/hostapd.conf fi