2021-12-31 16:04:23 +01:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
status="$(bluetoothctl info "$1" | grep Connected | cut -f 2 -d ':' | cut -f 2 -d ' ')"
|
|
|
|
|
2023-06-14 20:26:33 +02:00
|
|
|
if [ "$status" == "yes" ]
|
2021-12-31 16:04:23 +01:00
|
|
|
then
|
|
|
|
bluetoothctl disconnect "$1"
|
2023-06-14 20:26:33 +02:00
|
|
|
else
|
|
|
|
trust "$1"
|
|
|
|
bluetoothctl connect "$1"
|
2021-12-31 16:04:23 +01:00
|
|
|
fi
|