From 2b950cf60df108dfc9856bb9f518a913ff498574 Mon Sep 17 00:00:00 2001 From: Alexander Bocken Date: Tue, 29 Jun 2021 16:33:08 +0200 Subject: [PATCH] more reliable re-pairing --- bt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/bt b/bt index 8a0f7cd..d5aa82b 100755 --- a/bt +++ b/bt @@ -250,7 +250,11 @@ case $choice in then bluetoothctl disconnect "$dev_id" else - bluetoothctl paired-devices | grep -q "$dev_id" || bluetoothctl pair "$dev_id" + if bluetoothctl paired-devices | grep -q "$dev_id"; then + scan on + bluetoothctl pair "$dev_id" + scan off #maybe do not force off? -> implement return codes for scan()? + fi bluetoothctl connect "$dev_id" fi fi;;