diff --git a/bluetooth/drivers/bluetoothctl.c b/bluetooth/drivers/bluetoothctl.c index 20e3919d0e..16d04cc292 100644 --- a/bluetooth/drivers/bluetoothctl.c +++ b/bluetooth/drivers/bluetoothctl.c @@ -225,8 +225,14 @@ static bool bluetoothctl_remove_device(void *data, unsigned idx) string_list_free(list); snprintf(btctl->command, sizeof(btctl->command), "\ - echo -e \"disconnect %s\\nremove %s\\n\" | bluetoothctl", - device, device); + bluetoothctl -- disconnect %s", + device); + + pclose(popen(btctl->command, "r")); + + snprintf(btctl->command, sizeof(btctl->command), "\ + bluetoothctl -- remove %s", + device); pclose(popen(btctl->command, "r"));