#!/bin/bash

# remove old connection 
echo -e 'power on\ndisconnect EB:06:BF:0A:13:6F\nremove EB:06:BF:0A:13:6F\nquit' | bluetoothctl
# scan bluetooth devices for 20 s
timeout -k 20 15 bt-adapter --discover
# create a new pairing and connection
bt-device --connect EB:06:BF:0A:13:6F
# the command above does not connect audio, so do again a connection with bluetoothctl
echo -e 'trust EB:06:BF:0A:13:6F\nconnect EB:06:BF:0A:13:6F\ninfo EB:06:BF:0A:13:6F\nquit' | bluetoothctl
