~ubuntu-branches/ubuntu/wily/bluez/wily

« back to all changes in this revision

Viewing changes to scripts/bluetooth_serial

  • Committer: Bazaar Package Importer
  • Author(s): Mario Limonciello
  • Date: 2008-10-07 12:10:29 UTC
  • Revision ID: james.westby@ubuntu.com-20081007121029-4gup4fmmh2vfo5nh
Tags: upstream-4.12
ImportĀ upstreamĀ versionĀ 4.12

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/sh
 
2
#
 
3
# bluetooth_serial
 
4
#
 
5
# Bluetooth serial PCMCIA card initialization
 
6
#
 
7
 
 
8
start_serial()
 
9
{
 
10
        if [ ! -x /bin/setserial -o ! -x /usr/sbin/hciattach ]; then
 
11
                logger "$0: setserial or hciattach not executable, cannot start $DEVNAME"
 
12
                return 1
 
13
        fi
 
14
 
 
15
        if [ "$BAUDBASE" != "" ]; then
 
16
                /bin/setserial $DEVNAME baud_base $BAUDBASE
 
17
        fi
 
18
 
 
19
        /usr/sbin/hciattach $DEVNAME $HCIOPTS 2>&1 | logger -t hciattach
 
20
}
 
21
 
 
22
stop_serial()
 
23
{
 
24
        [ -x /bin/fuser ] || return 1 
 
25
 
 
26
        /bin/fuser -k -HUP $DEVNAME > /dev/null
 
27
}
 
28
 
 
29
case "$ACTION" in
 
30
   add)
 
31
        start_serial
 
32
        ;;
 
33
   remove)
 
34
        stop_serial
 
35
        ;;
 
36
   *)
 
37
        logger "Unknown action received $0: $ACTION"
 
38
        ;;
 
39
esac