#!/bin/bash ################################################################################ ### ############### function to disable Raspberry Pi onboard bluetooth ############# ### ################################################################################ function disable-onboard-bluetooth() { info "Disabling onboard bluetooth" isInFile=$(cat /etc/modprobe.d/raspi-blacklist.conf | grep -c "blacklist btbcm") if [ $isInFile -eq 0 ]; then sudo bash -c 'echo "blacklist btbcm" >> /etc/modprobe.d/raspi-blacklist.conf' fi isInFile=$(cat /etc/modprobe.d/raspi-blacklist.conf | grep -c "blacklist hci_uart") if [ $isInFile -eq 0 ]; then sudo bash -c 'echo "blacklist hci_uart" >> /etc/modprobe.d/raspi-blacklist.conf' fi } disable_onboard_bluetooth