hostapd: Use network_get_device instead of uci_get_state
[openwrt.git] / package / network / services / hostapd / files / wps-hotplug.sh
index b5376cc..24af80e 100644 (file)
@@ -1,6 +1,11 @@
+#!/bin/sh
+
 if [ "$ACTION" = "pressed" -a "$BUTTON" = "wps" ]; then
-       for dir in /var/run/hostapd-*; do
-               [ -d "$dir" ] || continue
-               hostapd_cli -p "$dir" wps_pbc
+       cd /var/run/hostapd
+       for socket in *; do
+               [ -S "$socket" ] || continue
+               hostapd_cli -i "$socket" wps_pbc
        done
 fi
+
+return 0