create_ap

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

commit f589df0565b6373a00018648d6f330d4d8c30be2
parent 4516520cf20122c4001b698372de45cf416ce226
Author: Ahmed Mokhtar <mokhtar92@gmail.com>
Date:   Wed, 17 Sep 2014 16:52:37 +0300

Using virtual interface names "ap*"
Diffstat:
Mcreate_ap | 9++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/create_ap b/create_ap @@ -654,7 +654,14 @@ CONFDIR=$(mktemp -d /tmp/create_ap.${WIFI_IFACE}.conf.XXXXXXXX) echo "Config dir: $CONFDIR" if [[ $NO_VIRT -eq 0 ]]; then - VWIFI_IFACE=ap${WIFI_IFACE} + i=0 + while :; do + if [[ ! -d /sys/class/net/ap${i} ]]; then + VWIFI_IFACE=ap${i} + break + fi + i=$((i+1)) + done # 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.