5 if [ "`/bin/hciconfig`" != "" ]; then
6 #If hciconfig outputs anything then there's probably a Bluetooth
7 # CF card in the slot so shut it down.
8 hcitool dc `hcitool con | grep ACL | sed 's/^.*\([0-9A-F]\{2\}\(:[0-9A-F]\{2\}\)\{5\}\).*$/\1/'`
10 killall hciattach > /dev/null 2>&1
15 #check for kernel version
16 if [ "`uname -r | grep 2.4.`" != "" ]; then
18 elif [ "`uname -r | grep 2.6.`" != "" ]; then
24 if test -e /sbin/cardctl; then
26 elif test -e /sbin/pccardctl; then
27 CARDCTL=/sbin/pccardctl
32 if [ "`lsmod | grep hci_uart`" != "" ]; then
33 #If the hci_usb module is still loaded then there's a serial based
34 # Bluetooth CF card in the slot, which only needs a resume to get it going
40 # only works for nokia dtl1 cards
41 for f in /lib/modules/`uname -r`/kernel/drivers/bluetooth/dtl1_cs.$k
43 #Enumerate all the self-contained Bluetooth CF card drivers
44 f=`echo $f | sed 's/\.'$k'$//'`
46 if [ "`lsmod | grep $f`" != "" ]; then
47 #If one of these drivers is still loaded, then there is probably
48 #a non-serial based Bluetooth CF card in the slot that needs
49 #ejecting and reinserting to get it going again