Do not allow user to use `phyX' of the interface

This commit is contained in:
oblique 2014-08-28 08:40:15 +03:00
parent 3f49258758
commit fd75f56635

View File

@ -364,7 +364,7 @@ fi
WIFI_IFACE=$1
if ! iw ${WIFI_IFACE} info > /dev/null 2>&1; then
if ! iw dev ${WIFI_IFACE} info > /dev/null 2>&1; then
echo "ERROR: ${WIFI_IFACE} is not a WiFi interface" >&2
exit 1
fi
@ -442,7 +442,7 @@ echo "Config dir: $CONFDIR"
if [[ $NO_VIRT -eq 0 ]]; then
VWIFI_IFACE=${WIFI_IFACE}ap
WIFI_IFACE_CHANNEL=$(iw ${WIFI_IFACE} info | grep channel | awk '{print $2}')
WIFI_IFACE_CHANNEL=$(iw dev ${WIFI_IFACE} info | grep channel | awk '{print $2}')
if [[ -n $WIFI_IFACE_CHANNEL && $WIFI_IFACE_CHANNEL -ne $CHANNEL ]]; then
echo "hostapd will fail to use channel $CHANNEL because $WIFI_IFACE is already set to channel $WIFI_IFACE_CHANNEL, fallback to channel $WIFI_IFACE_CHANNEL."