create_ap

create a nat-ed wifi ap
git clone git://git.2f30.org/create_ap
Log | Files | Refs | README | LICENSE

commit ddd6bfad458080748d529658e7c9ca0b579d7166
parent 488f84e14fd4115b1a9a77f3f190c9e75203d2a5
Author: oblique <psyberbits@gmail.com>
Date:   Thu, 18 Sep 2014 05:50:46 +0000

Merge pull request #48 from blucell/patch-1
Diffstat:
Mcreate_ap | 13++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/create_ap b/create_ap @@ -196,6 +196,17 @@ get_avail_bridge() { done } +get_virt_iface_name() { + i=0 + while :; do + if [[ ! -d /sys/class/net/ap${i} ]]; then + echo ap${i} + break + fi + i=$((i+1)) + done +} + get_new_macaddr() { OLDMAC=$(get_macaddr "$1") for i in {20..255}; do @@ -654,7 +665,7 @@ CONFDIR=$(mktemp -d /tmp/create_ap.${WIFI_IFACE}.conf.XXXXXXXX) echo "Config dir: $CONFDIR" if [[ $NO_VIRT -eq 0 ]]; then - VWIFI_IFACE=${WIFI_IFACE}ap + VWIFI_IFACE=$(get_virt_iface_name) # in NetworkManager 0.9.10 and above we can set the interface as unmanaged without # the need of MAC address, so we set it before we create the virtual interface.