#!/usr/bin/env bash
set -Eeuo pipefail

# ADDR='00:02:BF:03:B8:9A'
ADDR='41:42:00:00:03:05'

yellow "Removing the device..."
bluetoothctl -- remove "$ADDR" ||:
yellow "Scanning available devices..."
bluetoothctl --timeout 10 -- scan on
yellow "Pairing device..."
bluetoothctl -- pair "$ADDR"
yellow "Configuring device..."
bluetoothctl -- trust "$ADDR"
yellow "Connecting to the device..."
bluetoothctl -- connect "$ADDR"
green "Done!"
