seperate functions:
1 writing hostapd conf 2 changing wifi country 3 checking wifi chennel
This commit is contained in:
parent
289910709d
commit
c1dcfba83c
|
@ -1517,15 +1517,6 @@ decide_subnet_interface() {
|
||||||
}
|
}
|
||||||
|
|
||||||
write_hostapd_conf() {
|
write_hostapd_conf() {
|
||||||
if [[ -n "$COUNTRY" && $USE_IWCONFIG -eq 0 ]]; then
|
|
||||||
iw reg set "$COUNTRY"
|
|
||||||
fi
|
|
||||||
|
|
||||||
can_transmit_to_channel ${AP_IFACE} ${CHANNEL} || die "Your adapter can not transmit to channel ${CHANNEL}, frequency band ${FREQ_BAND}GHz."
|
|
||||||
|
|
||||||
# TODO: move above code
|
|
||||||
|
|
||||||
# hostapd config
|
|
||||||
cat <<- EOF > "$CONFDIR/hostapd.conf"
|
cat <<- EOF > "$CONFDIR/hostapd.conf"
|
||||||
beacon_int=100
|
beacon_int=100
|
||||||
ssid=${SSID}
|
ssid=${SSID}
|
||||||
|
@ -1816,6 +1807,14 @@ decide_subnet_interface
|
||||||
|
|
||||||
echo "$SUBNET_IFACE" > "$CONFDIR/subn_iface"
|
echo "$SUBNET_IFACE" > "$CONFDIR/subn_iface"
|
||||||
|
|
||||||
|
if [[ $WIFI_IFACE && -n "$COUNTRY" && $USE_IWCONFIG -eq 0 ]]; then
|
||||||
|
iw reg set "$COUNTRY" || die "Failed setting country code"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ $WIFI_IFACE ]] ; then
|
||||||
|
can_transmit_to_channel ${AP_IFACE} ${CHANNEL} || die "Your adapter can not transmit to channel ${CHANNEL}, frequency band ${FREQ_BAND}GHz."
|
||||||
|
fi
|
||||||
|
|
||||||
[[ $WIFI_IFACE ]] && write_hostapd_conf
|
[[ $WIFI_IFACE ]] && write_hostapd_conf
|
||||||
#===================================================
|
#===================================================
|
||||||
#===================================================
|
#===================================================
|
||||||
|
|
Loading…
Reference in New Issue