wifimngr: start WPS in client mode correctly

This commit is contained in:
Sukru Senli 2020-12-22 16:24:07 +01:00
parent 5d16f075ab
commit 42bc8f91ce

View file

@ -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
}
;;