#!/bin/bash # # pcmcia.bluetooth # # PCMCIA Bluetooth device initialization #DEBUG=yes; export DEBUG SYSFS=/sys cd /etc/hotplug . ./hotplug.functions test -z "$MANFID" && MANFID="bcsp" test "$MANFID" = "0000,0000" && MANFID="bcsp" case $kernel in ttyS*) DEVICE=$kernel ;; *) sleep 2; DEVICE=`ls $SYSFS$DEVPATH | grep tty | cut -d: -f2` ;; esac start_serial() { stop_serial debug_mesg $DEVICE $MANFID /usr/sbin/hciattach -p $DEVICE $MANFID && \ mesg $CARDNAME initialised } stop_serial() { if [ "`/usr/sbin/hciconfig`" != "" ]; then killall -HUP hciattach fuser -k -HUP /dev/$DEVICE > /dev/null fi } case "$ACTION" in "add") start_serial ;; "remove") stop_serial ;; esac