bluetooth.sh 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. #!/usr/bin/env bash
  2. # Copyright (c) 2021-2023 tteck
  3. # Author: tteck (tteckster)
  4. # License: MIT
  5. # https://github.com/tteck/Proxmox/raw/main/LICENSE
  6. if command -v pveversion >/dev/null 2>&1; then echo -e "⚠️ Can't Run from the Proxmox Shell"; exit; fi
  7. set -e
  8. clear
  9. while true; do
  10. read -p "Start the Bluetooth Integration Preparation (y/n)?" yn
  11. case $yn in
  12. [Yy]*) break ;;
  13. [Nn]*) exit ;;
  14. *) echo "Please answer yes or no." ;;
  15. esac
  16. done
  17. clear
  18. cat <<"EOF"
  19. __ __ ___ _ __ __
  20. / / / /___ ____ ___ ___ / | __________(_)____/ /_____ _____ / /_
  21. / /_/ / __ \/ __ `__ \/ _ \ / /| | / ___/ ___/ / ___/ __/ __ `/ __ \/ __/
  22. / __ / /_/ / / / / / / __/ / ___ |(__ |__ ) (__ ) /_/ /_/ / / / / /_
  23. /_/ /_/\____/_/ /_/ /_/\___/ /_/ |_/____/____/_/____/\__/\__,_/_/ /_/\__/
  24. / __ )/ /_ _____ / /_____ ____ / /_/ /_
  25. / __ / / / / / _ \/ __/ __ \/ __ \/ __/ __ \
  26. / /_/ / / /_/ / __/ /_/ /_/ / /_/ / /_/ / / /
  27. /_____/_/\__,_/\___/\__/\____/\____/\__/_/_/_/_
  28. / _/___ / /____ ____ __________ _/ /_(_)___ ____
  29. / // __ \/ __/ _ \/ __ `/ ___/ __ `/ __/ / __ \/ __ \
  30. _/ // / / / /_/ __/ /_/ / / / /_/ / /_/ / /_/ / / / /
  31. /___/_/_/_/\__/\___/\__, /_/ \__,_/\__/_/\____/_/ /_/
  32. / __ \________/____/ ____ __________ _/ /_(_)___ ____
  33. / /_/ / ___/ _ \/ __ \/ __ `/ ___/ __ `/ __/ / __ \/ __ \
  34. / ____/ / / __/ /_/ / /_/ / / / /_/ / /_/ / /_/ / / / /
  35. /_/ /_/ \___/ .___/\__,_/_/ \__,_/\__/_/\____/_/ /_/
  36. /_/
  37. EOF
  38. read -r -p "Switch from dbus-daemon to dbus-broker? <y/N> " prompt
  39. if [[ "${prompt,,}" =~ ^(y|yes)$ ]]; then
  40. cat <<EOF >>/etc/apt/sources.list
  41. deb http://deb.debian.org/debian bullseye-backports main contrib non-free
  42. deb-src http://deb.debian.org/debian bullseye-backports main contrib non-free
  43. EOF
  44. apt-get update &>/dev/null
  45. apt-get -t bullseye-backports install -y dbus-broker &>/dev/null
  46. systemctl enable dbus-broker.service &>/dev/null
  47. fi
  48. read -r -p "Install BlueZ? <y/N> " prompt
  49. if [[ "${prompt,,}" =~ ^(y|yes)$ ]]; then
  50. apt-get -t bullseye-backports install -y bluez* &>/dev/null
  51. fi
  52. echo -e "Finished, reboot for changes to take affect"