From 1f800423ecadf80c7935deb2fd7d6fa664fc1e74 Mon Sep 17 00:00:00 2001 From: shibao Date: Thu, 25 Apr 2024 10:59:08 -0400 Subject: [PATCH] improve bluetooth restart script --- home/default/scripts/restart-bluetooth | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/home/default/scripts/restart-bluetooth b/home/default/scripts/restart-bluetooth index 24c8ec1..1951078 100755 --- a/home/default/scripts/restart-bluetooth +++ b/home/default/scripts/restart-bluetooth @@ -1,12 +1,13 @@ #!/usr/bin/env bash -set -euo pipefail +set -euox pipefail + +pkill -f blueman-manager || true echo stopping bluetooth... -sudo systemctl stop bluetooth-autoconnect sudo systemctl stop bluetooth -sudo rmmod btusb +sudo modprobe -r btusb echo starting bluetooth... sudo modprobe btusb sudo systemctl start bluetooth -sudo systemctl start bluetooth-autoconnect +sudo rfkill unblock bluetooth