feat(functions/bluetooth): number of attemts if connect errors

This commit is contained in:
TheK4n 2022-11-16 15:55:01 +03:00
parent 93f606cbed
commit ce3d6a6ed4

View File

@ -1,4 +1,16 @@
#!/bin/sh #!/bin/sh
bssid="$(bluetoothctl devices | dmenu -p "Devices: " -l 20 | cut -d' ' -f2)" bssid="$(bluetoothctl devices | dmenu -p "Devices: " -l 20 | cut -d' ' -f2)"
bluetoothctl connect "$bssid"
exit_counter=0
until bluetoothctl connect "$bssid"
do
((exit_counter+=1))
if [ "$exit_counter" -gt 3 ]; then
break
else
echo ...
sleep 1
fi
done