summaryrefslogtreecommitdiff
path: root/contrib
diff options
context:
space:
mode:
Diffstat (limited to 'contrib')
-rwxr-xr-xcontrib/unbind-bluetooth-driver.sh14
1 files changed, 14 insertions, 0 deletions
diff --git a/contrib/unbind-bluetooth-driver.sh b/contrib/unbind-bluetooth-driver.sh
new file mode 100755
index 00000000..fcf02858
--- /dev/null
+++ b/contrib/unbind-bluetooth-driver.sh
@@ -0,0 +1,14 @@
+#!/bin/sh
+
+ADAPTER_TO_DISABLE=${1:-hci0}
+SYSFS_PATH=/sys/class/bluetooth/$ADAPTER_TO_DISABLE
+
+if [ ! -h $SYSFS_PATH ] ; then
+ echo "Could not find adapter $ADAPTER_TO_DISABLE"
+ echo "Usage: $0 [hciX]"
+ exit 1
+fi
+
+USB_DEVICE_PATH=`realpath $SYSFS_PATH/device`
+USB_DEVICE=`basename $USB_DEVICE_PATH`
+echo $USB_DEVICE > $SYSFS_PATH/device/driver/unbind