Remove bluetooth

This commit is contained in:
Bob Mottram 2016-11-29 13:01:00 +00:00
parent bc6f387506
commit cb87c06f90
1 changed files with 26 additions and 0 deletions

View File

@ -113,6 +113,29 @@ function detect_usb_drive {
write_config_param USB_DRIVE "$USB_DRIVE"
}
function remove_bluetooth {
rmmod -f bnep
rmmod -f bluetooth
if [ -f /etc/default/bluetooth ]; then
if grep "BLUETOOTH_ENABLED=" /etc/default/bluetooth; then
sed -i 's|BLUETOOTH_ENABLED=.*|BLUETOOTH_ENABLED=0|g' /etc/default/bluetooth
else
echo "BLUETOOTH_ENABLED=0" >> /etc/default/bluetooth
fi
fi
if ! grep 'blacklist bnep' /etc/modprobe.d/bluetooth.conf; then
echo 'blacklist bnep' >> /etc/modprobe.d/bluetooth.conf
fi
if ! grep 'blacklist btusb' /etc/modprobe.d/bluetooth.conf; then
echo 'blacklist btusb' >> /etc/modprobe.d/bluetooth.conf
fi
if ! grep 'blacklist bluetooth' /etc/modprobe.d/bluetooth.conf; then
echo 'blacklist bluetooth' >> /etc/modprobe.d/bluetooth.conf
fi
update-initramfs -u -k `uname -r` -v
update-rc.d bluetooth remove
}
function running_as_root {
if [[ $EUID != 0 ]] ; then
echo "0"
@ -353,6 +376,9 @@ function setup_utils {
read_config_param "PROJECT_REPO"
write_config_param "PROJECT_REPO" "$PROJECT_REPO"
function_check remove_bluetooth
remove_bluetooth
function_check turn_off_rsys_logging
turn_off_rsys_logging