contrib/meshwizard: Allow to setup a VAP in ap-mode on ath5k and ath9k too
authorManuel Munz <freifunk@somakoma.de>
Sat, 12 Jan 2013 18:19:43 +0000 (18:19 +0000)
committerManuel Munz <freifunk@somakoma.de>
Sat, 12 Jan 2013 18:19:43 +0000 (18:19 +0000)
contrib/package/meshwizard/Makefile
contrib/package/meshwizard/files/usr/bin/meshwizard/helpers/setup_wifi.sh

index a9a1a0b..a88113a 100644 (file)
@@ -4,7 +4,7 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=meshwizard
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=meshwizard
-PKG_RELEASE:=0.0.8-1
+PKG_RELEASE:=0.0.8-2
 
 PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
 
 
 PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
 
index 84c5438..001754c 100755 (executable)
@@ -79,7 +79,20 @@ uci_commitverbose "Setup wifi interface for $netrenamed" wireless
 
 ## VAP
 ip4addr="$(uci get meshwizard.netconfig.$net\_ip4addr)"
 
 ## VAP
 ip4addr="$(uci get meshwizard.netconfig.$net\_ip4addr)"
-if [ "$type" == "atheros" -a "$vap" == 1 ]; then
+
+supports_vap="0"
+if [ "$type" = "atheros" ]; then
+        supports_vap="1"
+elif [ "$type" = "mac80211" ]; then
+       # get driver in use
+       netindex="$(echo $net |sed 's/[a-zA-z]*//')"
+       driver="$(basename $(ls -l /sys/class/net/wlan${netindex}/device/driver/module | sed -ne 's/.* -> //p'))"
+       if [ "$driver" = "ath9k" -o  "$driver" = "ath5k" ]; then
+               supports_vap="1"
+       fi
+fi
+
+if [ "$supports_vap" == "1" -a "$vap" == 1 ]; then
        uci batch <<- EOF
                set wireless.$net\_iface_dhcp="wifi-iface"
                set wireless.$net\_iface_dhcp.device="$net"
        uci batch <<- EOF
                set wireless.$net\_iface_dhcp="wifi-iface"
                set wireless.$net\_iface_dhcp.device="$net"