Bluetooth suspend recover script

This commit is contained in:
Martin Blazik
2021-03-18 05:48:22 +01:00
parent 2b25472e8c
commit d6edfb6436

28
scripts/bluetooth-suspend.sh Executable file
View File

@@ -0,0 +1,28 @@
#!/bin/bash
BT_SCRIPT=/etc/pm/sleep.d/10_bluetooth
cat > "$BT_SCRIPT" <<EOT
#!/bin/bash
# Code from http://ubuntuforums.org/showthread.php?t=1387211
. /usr/lib/pm-utils/functions
case "$1" in
hibernate|suspend)
rfkill block bluetooth
;;
thaw|resume)
rfkill unblock bluetooth
;;
*)
;;
esac
exit
EOT
chmod 0755 "$BT_SCRIPT"