only list successfully paired devices

This commit is contained in:
Alexander Bocken 2020-07-28 21:39:21 +02:00
parent dfac83a064
commit 05fe04e638

2
bt
View File

@ -148,7 +148,7 @@ pair(){
bluetoothctl trust "$dev_id" bluetoothctl trust "$dev_id"
fi fi
#if device is not already hard coded as paired, add to paired devices list #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 then
echo to be added to "$PAIRLIST": echo to be added to "$PAIRLIST":
echo Device "$dev_id" "$choice" echo Device "$dev_id" "$choice"