#!/bin/bash power=$(bluetoothctl show | grep Powered) echo "$power" if [[ "$power" = " Powered: no" ]] then bluetoothctl power on sleep 1 bluetoothctl connect 68:D6:ED:28:EB:D9 exit else bluetoothctl power off exit fi