From 872cbfb521e1b97826cc65eb669b16a8c3a871af Mon Sep 17 00:00:00 2001
From: nbd <nbd@3c298f89-4303-0410-b956-a3cf2f4a3e73>
Date: Wed, 11 Nov 2009 05:15:55 +0000
Subject: hostapd: automatically add wds sta interfaces of an ap to the right
 bridge

git-svn-id: svn://svn.openwrt.org/openwrt/trunk@18365 3c298f89-4303-0410-b956-a3cf2f4a3e73
---
 package/hostapd/Makefile              |  2 ++
 package/hostapd/files/hostapd.hotplug | 12 ++++++++++++
 2 files changed, 14 insertions(+)
 create mode 100644 package/hostapd/files/hostapd.hotplug

(limited to 'package')

diff --git a/package/hostapd/Makefile b/package/hostapd/Makefile
index 606ec6736..a39b0e243 100644
--- a/package/hostapd/Makefile
+++ b/package/hostapd/Makefile
@@ -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
index 000000000..296422428
--- /dev/null
+++ b/package/hostapd/files/hostapd.hotplug
@@ -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
-- 
cgit v1.2.3