diff options
author | Marcel Holtmann <marcel@holtmann.org> | 2008-07-26 19:00:53 +0200 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2008-07-26 19:00:53 +0200 |
commit | d6ae1c3f777832f8e32702f81fe64e33a1396928 (patch) | |
tree | 159a1e59f3929c9d795dbd1f3edd84d9dccba048 /scripts/bluetooth_serial | |
parent | b8e5fea8d31fbcd3d1c044385f8217dbf39892bb (diff) | |
parent | 3382af9114a9b2e657c7ddd0a5511edda6a37a90 (diff) |
Import bluez-utils-3.36 revision history
Diffstat (limited to 'scripts/bluetooth_serial')
-rw-r--r-- | scripts/bluetooth_serial | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/scripts/bluetooth_serial b/scripts/bluetooth_serial new file mode 100644 index 000000000..e5be6c2ee --- /dev/null +++ b/scripts/bluetooth_serial @@ -0,0 +1,39 @@ +#!/bin/sh +# +# bluetooth_serial +# +# Bluetooth serial PCMCIA card initialization +# + +start_serial() +{ + if [ ! -x /bin/setserial -o ! -x /usr/sbin/hciattach ]; then + logger "$0: setserial or hciattach not executable, cannot start $DEVNAME" + return 1 + fi + + if [ "$BAUDBASE" != "" ]; then + /bin/setserial $DEVNAME baud_base $BAUDBASE + fi + + /usr/sbin/hciattach $DEVNAME $HCIOPTS 2>&1 | logger -t hciattach +} + +stop_serial() +{ + [ -x /bin/fuser ] || return 1 + + /bin/fuser -k -HUP $DEVNAME > /dev/null +} + +case "$ACTION" in + add) + start_serial + ;; + remove) + stop_serial + ;; + *) + logger "Unknown action received $0: $ACTION" + ;; +esac |