Trust bluetooth devices before connecting

master
Hektor Misplon 2023-06-14 20:26:33 +02:00
parent ac3e2317f8
commit 12b1ad09f8
1 changed files with 4 additions and 4 deletions

View File

@ -2,10 +2,10 @@
status="$(bluetoothctl info "$1" | grep Connected | cut -f 2 -d ':' | cut -f 2 -d ' ')" status="$(bluetoothctl info "$1" | grep Connected | cut -f 2 -d ':' | cut -f 2 -d ' ')"
if [ "$status" == "no" ] if [ "$status" == "yes" ]
then
bluetoothctl connect "$1"
elif [ "$status" == "yes" ]
then then
bluetoothctl disconnect "$1" bluetoothctl disconnect "$1"
else
trust "$1"
bluetoothctl connect "$1"
fi fi