#!/usr/bin/env bash if [ $(bluetoothctl show | grep "Powered: yes" | wc -c) -eq 0 ]; then echo "0" else if [ $(echo info | bluetoothctl | grep 'Device' | wc -c) -eq 0 ]; then echo "1" else echo "2" fi fi