plex-install.sh 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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. source /dev/stdin <<< "$FUNCTIONS_FILE_PATH"
  7. color
  8. verb_ip6
  9. catch_errors
  10. setting_up_container
  11. network_check
  12. update_os
  13. msg_info "Installing Dependencies"
  14. $STD apt-get install -y curl
  15. $STD apt-get install -y sudo
  16. $STD apt-get install -y mc
  17. msg_ok "Installed Dependencies"
  18. if [[ "$CTTYPE" == "0" ]]; then
  19. msg_info "Setting Up Hardware Acceleration"
  20. $STD apt-get -y install \
  21. va-driver-all \
  22. ocl-icd-libopencl1
  23. if [[ ${PCT_OSVERSION} == "20.04" ]]; then
  24. $STD apt-get install -y beignet-opencl-icd
  25. else
  26. $STD apt-get install -y intel-opencl-icd
  27. fi
  28. chgrp video /dev/dri
  29. chmod 755 /dev/dri
  30. chmod 660 /dev/dri/*
  31. $STD adduser $(id -u -n) video
  32. $STD adduser $(id -u -n) render
  33. msg_ok "Set Up Hardware Acceleration"
  34. fi
  35. msg_info "Setting Up Plex Media Server Repository"
  36. wget -qO- https://downloads.plex.tv/plex-keys/PlexSign.key >/etc/apt/trusted.gpg.d/PlexSign.asc
  37. echo "deb [arch=$(dpkg --print-architecture)] https://downloads.plex.tv/repo/deb/ public main" >/etc/apt/sources.list.d/plexmediaserver.list
  38. msg_ok "Set Up Plex Media Server Repository"
  39. msg_info "Installing Plex Media Server"
  40. $STD apt-get update
  41. $STD apt-get -o Dpkg::Options::="--force-confold" install -y plexmediaserver
  42. msg_ok "Installed Plex Media Server"
  43. motd_ssh
  44. customize
  45. msg_info "Cleaning up"
  46. $STD apt-get autoremove
  47. $STD apt-get autoclean
  48. msg_ok "Cleaned"