Bluetooth suspend recover script
This commit is contained in:
28
scripts/bluetooth-suspend.sh
Executable file
28
scripts/bluetooth-suspend.sh
Executable 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"
|
||||
Reference in New Issue
Block a user