From 05fe04e63873127c6c72ebc5d67ac4957227e695 Mon Sep 17 00:00:00 2001 From: Alexander Bocken Date: Tue, 28 Jul 2020 21:39:21 +0200 Subject: [PATCH] only list successfully paired devices --- bt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bt b/bt index f6227b0..496e092 100755 --- a/bt +++ b/bt @@ -148,7 +148,7 @@ pair(){ bluetoothctl trust "$dev_id" fi #if device is not already hard coded as paired, add to paired devices list - if [ "$( grep "$dev_id" "$PAIRLIST")" = "" ] || [ "$(wc -l "$PAIRLIST")" -eq 0 ] && $pair_succesful + if $pair_succesful && [ "$( grep "$dev_id" "$PAIRLIST")" = "" ] || [ "$(wc -l "$PAIRLIST")" -eq 0 ] then echo to be added to "$PAIRLIST": echo Device "$dev_id" "$choice"