From 42bc8f91ce2969b94ec11fef027cef4f31a6a53a Mon Sep 17 00:00:00 2001 From: Sukru Senli Date: Tue, 22 Dec 2020 16:24:07 +0100 Subject: [PATCH] wifimngr: start WPS in client mode correctly --- wifimngr/files/etc/hotplug.d/button/05-wifi | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/wifimngr/files/etc/hotplug.d/button/05-wifi b/wifimngr/files/etc/hotplug.d/button/05-wifi index 37f7c5a90..74529600b 100644 --- a/wifimngr/files/etc/hotplug.d/button/05-wifi +++ b/wifimngr/files/etc/hotplug.d/button/05-wifi @@ -32,12 +32,12 @@ case "$ACTION" in echo "WPS button is pressed" > /dev/console # TODO: Proper implementation #ubus call wifi.wps start - devsta="$(uci show wireless | grep 'apsta=.1' | head -1 | cut -d '.' -f2)" - if [ -n "$devsta" ]; then - ubus -t 1 call hostapd.$devsta wps_start + wpasupp="$(ubus list wpa_supplicant.* | head -1)" + if [ -n "$wpasupp" ]; then + ubus -t 1 call $wpasupp wps_start else dev5g="$(uci show wireless | grep 'hwmode=.11a' | head -1 | cut -d '.' -f2)" - ubus -t 1 call hostapd.$dev5g wps_start + [ -n "$dev5g" ] && ubus -t 1 call hostapd.$dev5g wps_start fi } ;;