Skip Bluetooth startup delay when already powered
This commit is contained in:
@@ -19,6 +19,7 @@ address=${2:-}
|
||||
[[ $address =~ ^([0-9A-Fa-f]{2}:){5}[0-9A-Fa-f]{2}$ ]] || usage
|
||||
|
||||
power_on() {
|
||||
bluetoothctl show | grep -Fq "Powered: yes" && return
|
||||
bluetoothctl power on >/dev/null 2>&1 || true
|
||||
sleep 0.5
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user