Browse Source

Remove bluetooth

Bob Mottram 8 years ago
parent
commit
cb87c06f90
1 changed files with 26 additions and 0 deletions
  1. 26
    0
      src/freedombone-utils-setup

+ 26
- 0
src/freedombone-utils-setup View File

@@ -113,6 +113,29 @@ function detect_usb_drive {
113 113
     write_config_param USB_DRIVE "$USB_DRIVE"
114 114
 }
115 115
 
116
+function remove_bluetooth {
117
+    rmmod -f bnep
118
+    rmmod -f bluetooth
119
+    if [ -f /etc/default/bluetooth ]; then
120
+        if grep "BLUETOOTH_ENABLED=" /etc/default/bluetooth; then
121
+            sed -i 's|BLUETOOTH_ENABLED=.*|BLUETOOTH_ENABLED=0|g' /etc/default/bluetooth
122
+        else
123
+            echo "BLUETOOTH_ENABLED=0" >> /etc/default/bluetooth
124
+        fi
125
+    fi
126
+    if ! grep 'blacklist bnep' /etc/modprobe.d/bluetooth.conf; then
127
+        echo 'blacklist bnep' >> /etc/modprobe.d/bluetooth.conf
128
+    fi
129
+    if ! grep 'blacklist btusb' /etc/modprobe.d/bluetooth.conf; then
130
+        echo 'blacklist btusb' >> /etc/modprobe.d/bluetooth.conf
131
+    fi
132
+    if ! grep 'blacklist bluetooth' /etc/modprobe.d/bluetooth.conf; then
133
+        echo 'blacklist bluetooth' >> /etc/modprobe.d/bluetooth.conf
134
+    fi
135
+    update-initramfs -u -k `uname -r` -v
136
+    update-rc.d bluetooth remove
137
+}
138
+
116 139
 function running_as_root {
117 140
     if [[ $EUID != 0 ]] ; then
118 141
         echo "0"
@@ -353,6 +376,9 @@ function setup_utils {
353 376
     read_config_param "PROJECT_REPO"
354 377
     write_config_param "PROJECT_REPO" "$PROJECT_REPO"
355 378
 
379
+    function_check remove_bluetooth
380
+    remove_bluetooth
381
+
356 382
     function_check turn_off_rsys_logging
357 383
     turn_off_rsys_logging
358 384