parent
1eb11077d3
commit
ed78f36f41
31
create_ap
31
create_ap
@ -118,23 +118,6 @@ get_phy_device() {
|
||||
return 1
|
||||
}
|
||||
|
||||
get_virt_interfaces() {
|
||||
PHY=$(get_phy_device "$1")
|
||||
|
||||
if [[ -e "/sys/class/ieee80211/${PHY}/device/net/" ]]; then
|
||||
for x in /sys/class/ieee80211/${PHY}/device/net/*; do
|
||||
[[ ! -e "$x" ]] && continue
|
||||
echo ${x##*/}
|
||||
done
|
||||
return
|
||||
fi
|
||||
|
||||
for x in /sys/class/ieee80211/${PHY}/device/net:*; do
|
||||
[[ ! -e "$x" ]] && continue
|
||||
echo ${x##*:}
|
||||
done
|
||||
}
|
||||
|
||||
get_adapter_info() {
|
||||
PHY=$(get_phy_device "$1")
|
||||
[[ $? -ne 0 ]] && return 1
|
||||
@ -691,21 +674,7 @@ if [[ $NO_VIRT -eq 0 ]]; then
|
||||
Try again with --no-virt."
|
||||
echo -n "Creating a virtual WiFi interface... "
|
||||
|
||||
VIRT_IFACES=" $(get_virt_interfaces ${WIFI_IFACE}) "
|
||||
if iw dev ${WIFI_IFACE} interface add ${VWIFI_IFACE} type __ap; then
|
||||
# some distributions (such as Ubuntu) have udev rules that they rename
|
||||
# the new virtual interface. in this case, forcefully rename it back
|
||||
# to the name we want
|
||||
if ! is_wifi_interface ${VWIFI_IFACE}; then
|
||||
for x in $(get_virt_interfaces ${WIFI_IFACE}); do
|
||||
if [[ "$VIRT_IFACES" != *\ ${x}\ * ]]; then
|
||||
ip link set dev $x down || die
|
||||
ip link set dev $x name $VWIFI_IFACE || die
|
||||
break
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
# now we can call networkmanager_wait_until_unmanaged
|
||||
networkmanager_is_running && [[ $NM_OLDER_VERSION -eq 0 ]] && networkmanager_wait_until_unmanaged ${VWIFI_IFACE}
|
||||
echo "${VWIFI_IFACE} created."
|
||||
|
Loading…
Reference in New Issue
Block a user