~ubuntu-branches/debian/squeeze/laptop-mode-tools/squeeze

« back to all changes in this revision

Viewing changes to usr/share/laptop-mode-tools/modules/bluetooth

  • Committer: Bazaar Package Importer
  • Author(s): Bart Samwel
  • Date: 2008-07-15 12:47:01 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20080715124701-kaj9itpwjfpjrr0m
Tags: 1.45-1
* New upstream version 1.45.
* New upstream version 1.44:
  * Strip non-numeric suffixes from kernel minor version number.
    Closes: #488950.
  * Remove spurious error message on machines that don't have 
    /sys/class/power_supply. Closes: #490167.
  * Fix incorrect path to laptop-mode.conf in the laptop-mode.conf(8)
    manual page. Closes: #488261.
  * Add sched-mc-power-savings module. Closes: #490587.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#! /bin/sh
 
2
#
 
3
# Laptop mode tools module: bluetooth
 
4
#
 
5
 
 
6
 
 
7
if [ x$CONTROL_BLUETOOTH = x1 ] ; then
 
8
        ENABLE_BLUETOOTH=$BATT_ENABLE_BLUETOOTH
 
9
        if [ $ON_AC -eq 1 ] ; then
 
10
                ENABLE_BLUETOOTH=$AC_ENABLE_BLUETOOTH
 
11
        fi
 
12
        if [ x$ENABLE_BLUETOOTH = x1 ] ; then
 
13
                $LM_VERBOSE && echo "Enabling bluetooth." >> $OUTPUT
 
14
                modprobe -q hci_usb
 
15
                for INTF in $BLUETOOTH_INTERFACES ; do
 
16
                        [ -d /sys/class/bluetooth/$INTF ] || continue
 
17
                        hciconfig $INTF up 2>&1 >> $OUTPUT
 
18
                done
 
19
        else
 
20
                $LM_VERBOSE && echo "Disabling bluetooth." >> $OUTPUT
 
21
                for INTF in $BLUETOOTH_INTERFACES ; do
 
22
                        [ -d /sys/class/bluetooth/$INTF ] || continue
 
23
                        hciconfig $INTF down 2>&1 >> $OUTPUT
 
24
                done
 
25
                # This may take a while to work because the module may be
 
26
                # temporarily in use; we try three times. We don't use rmmod
 
27
                # --wait, because that might hang!
 
28
                modprobe -rq hci_usb || (sleep 1 ; modprobe -rq hci_usb) || (sleep 1 ; modprobe -rq hci_usb)            
 
29
        fi
 
30
fi