summaryrefslogtreecommitdiff
path: root/pm/sleep.d/49bluetooth
diff options
context:
space:
mode:
authorVictor Lowther <victor.lowther@gmail.com>2008-03-13 17:22:00 -0500
committerVictor Lowther <victor.lowther@gmail.com>2008-03-20 18:49:30 -0500
commit6ae1dd2b1f0ab8f9e7f63e38473f109bafc8106b (patch)
treea21ec32bd85cf8308b81cd5463774b622a54b82c /pm/sleep.d/49bluetooth
parent23bc36cba4c017f70198ce3278db5597183f1e41 (diff)
Simplified implementation of 49bluetooth.
No need for awk or for case statements.
Diffstat (limited to 'pm/sleep.d/49bluetooth')
-rwxr-xr-xpm/sleep.d/49bluetooth18
1 files changed, 8 insertions, 10 deletions
diff --git a/pm/sleep.d/49bluetooth b/pm/sleep.d/49bluetooth
index 5fcb04c..dcc792d 100755
--- a/pm/sleep.d/49bluetooth
+++ b/pm/sleep.d/49bluetooth
@@ -6,20 +6,18 @@
suspend_bluetooth()
{
- savestate ibm_bluetooth "$(awk '{ print $2 ; exit; }' /proc/acpi/ibm/bluetooth)"
- echo disable > /proc/acpi/ibm/bluetooth
+ if grep -q enabled /proc/acpi/ibm/bluetooth; then
+ savestate ibm_bluetooth enable
+ echo disable > /proc/acpi/ibm/bluetooth
+ else
+ savestate ibm_bluetooth disable
+ fi
}
resume_bluetooth()
{
- case "$(restorestate ibm_bluetooth)" in
- enabled)
- echo enable > /proc/acpi/ibm/bluetooth
- ;;
- disabled)
- echo disable > /proc/acpi/ibm/bluetooth
- ;;
- esac
+ state_exists ibm_bluetooth || return
+ restorestate ibm_bluetooth > /proc/acpi/ibm/bluetooth
}
case "$1" in