#!/bin/sh # This script will unbind the bt driver (built in the kernel), and bind the SS1 BT USB Driver DRIVER_PATH="/lib/modules/`uname -r`/SS1BTUSBM.ko" # Make sure the module is loaded if lsmod | grep SS1BTUSBM > /dev/null 2>&1 then echo "Driver already loaded." else echo "Loading driver..." insmod "$DRIVER_PATH"/SS1BTUSBM.ko fi # Go through the btusb directory and find the devices DEVICES=$(ls /sys/bus/usb/drivers/btusb/ | grep '[0-9]') echo "Rebinding existing Bluetooth devices:" if [ -n "$DEVICES" ] ; then for dir in $DEVICES; do # unbind the current btdevice echo " $dir" if [ -d /sys/bus/usb/drivers/btusb/"$dir" ] ; then echo "$dir" > /sys/bus/usb/drivers/btusb/unbind sleep 1 fi # now bind the current to the SS1BTUSB driver if [ ! -d /sys/bus/usb/drivers/SS1BTUSB/"$dir" ] ; then echo "$dir" > /sys/bus/usb/drivers/SS1BTUSB/bind fi done else echo " None" fi