summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--scripts/bts14
1 files changed, 10 insertions, 4 deletions
diff --git a/scripts/bts b/scripts/bts
index 2900ef9..0acdefd 100644
--- a/scripts/bts
+++ b/scripts/bts
@@ -1,4 +1,10 @@
-bluetoothctl power on
-bluetoothctl connect A1:B3:EC:B1:53:60
-bluetoothctl connect A1:B3:EC:B1:53:60
-
+status=$(systemctl status bluetooth | grep active | cut -d " " -f 7)
+case $status in
+ "active")
+ bluetoothctl power on
+ bluetoothctl connect A1:B3:EC:B1:53:60 ;;
+ "inactive")
+ sudo systemctl start bluetooth
+ bluetoothctl power on
+ bluetoothctl connect A1:B3:EC:B1:53:60;;
+esac