Files
linux-workspace/scripts/bluetooth-suspend.sh
2021-03-18 05:48:51 +01:00

29 lines
365 B
Bash
Executable File

#!/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"