Skip to content
Snippets Groups Projects
Commit 90dc589e authored by Bob Mottram's avatar Bob Mottram
Browse files

Removing of bluetooth kernel module

parent 8c5aaedd
No related branches found
No related tags found
No related merge requests found
......@@ -151,26 +151,41 @@ function proc_filesystem_settings {
}
function remove_bluetooth {
rmmod -f bnep
rmmod -f bluetooth
bluetooth_changed=
bnep_exists=$(lsmod | grep bnep)
if [[ "$bnep_exists" == "bnep"* ]]; then
rmmod -f bnep
bluetooth_changed=1
fi
bluetooth_exists=$(lsmod | grep bluetooth)
if [[ "$bluetooth_exists" == "bluetooth"* ]]; then
rmmod -f bluetooth
bluetooth_changed=1
fi
if [ -f /etc/default/bluetooth ]; then
if grep -q "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
bluetooth_changed=1
fi
if ! grep -q 'blacklist bnep' /etc/modprobe.d/bluetooth.conf; then
echo 'blacklist bnep' >> /etc/modprobe.d/bluetooth.conf
bluetooth_changed=1
fi
if ! grep -q 'blacklist btusb' /etc/modprobe.d/bluetooth.conf; then
echo 'blacklist btusb' >> /etc/modprobe.d/bluetooth.conf
bluetooth_changed=1
fi
if ! grep -q 'blacklist bluetooth' /etc/modprobe.d/bluetooth.conf; then
echo 'blacklist bluetooth' >> /etc/modprobe.d/bluetooth.conf
bluetooth_changed=1
fi
if [ $bluetooth_changed ]; then
update-initramfs -u -k `uname -r` -v
update-rc.d bluetooth remove
fi
update-initramfs -u -k `uname -r` -v
update-rc.d bluetooth remove
}
function running_as_root {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment