hostapd: automatically add wds sta interfaces of an ap to the right bridge
authorFelix Fietkau <nbd@openwrt.org>
Wed, 11 Nov 2009 05:15:55 +0000 (05:15 +0000)
committerFelix Fietkau <nbd@openwrt.org>
Wed, 11 Nov 2009 05:15:55 +0000 (05:15 +0000)
SVN-Revision: 18365

package/hostapd/Makefile
package/hostapd/files/hostapd.hotplug [new file with mode: 0644]

index 606ec6736014b1b13521dee54b54b90020eddb13..a39b0e243cdadd4e8913ce4ea537903c38361a1e 100644 (file)
@@ -109,6 +109,8 @@ define Build/Compile
 endef
 
 define Package/InstallTemplate
+       $(INSTALL_DIR) $(1)/etc/hotplug.d/net
+       $(INSTALL_DATA) ./files/hostapd.hotplug $(1)/etc/hotplug.d/net/
        $(INSTALL_DIR) $(1)/lib/wifi
        $(INSTALL_DATA) ./files/hostapd.sh $(1)/lib/wifi/hostapd.sh
        $(INSTALL_DIR) $(1)/usr/sbin
diff --git a/package/hostapd/files/hostapd.hotplug b/package/hostapd/files/hostapd.hotplug
new file mode 100644 (file)
index 0000000..2964224
--- /dev/null
@@ -0,0 +1,12 @@
+if [ "$ACTION" = "add" -o "$ACTION" = "register" ]; then
+       case "$INTERFACE" in
+               wlan*.sta*)
+                       local BASEIF="${INTERFACE%%\.*}"
+
+                       include /lib/network
+                       scan_interfaces
+                       local CONFIG="$(find_config "$BASEIF")" 
+                       [ -n "$CONFIG" ] && setup_interface "$INTERFACE" "$CONFIG"
+               ;;
+       esac
+fi