jellyfin-install.sh 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  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 gnupg
  17. $STD apt-get install -y mc
  18. msg_ok "Installed Dependencies"
  19. if [[ "$CTTYPE" == "0" ]]; then
  20. msg_info "Setting Up Hardware Acceleration"
  21. $STD apt-get -y install \
  22. va-driver-all \
  23. ocl-icd-libopencl1
  24. if [[ ${PCT_OSVERSION} == "20.04" ]]; then
  25. $STD apt-get install -y beignet-opencl-icd
  26. else
  27. $STD apt-get install -y intel-opencl-icd
  28. fi
  29. /bin/chgrp video /dev/dri
  30. /bin/chmod 755 /dev/dri
  31. /bin/chmod 660 /dev/dri/*
  32. msg_ok "Set Up Hardware Acceleration"
  33. fi
  34. msg_info "Installing Jellyfin"
  35. VERSION="$( awk -F'=' '/^VERSION_CODENAME=/{ print $NF }' /etc/os-release )"
  36. # If the keyring directory is absent, create it
  37. if [[ ! -d /etc/apt/keyrings ]]; then
  38. mkdir -p /etc/apt/keyrings
  39. fi
  40. # Download the repository signing key and install it to the keyring directory
  41. curl -fsSL https://repo.jellyfin.org/jellyfin_team.gpg.key | gpg --dearmor --yes --output /etc/apt/keyrings/jellyfin.gpg
  42. # Install the Deb822 format jellyfin.sources entry
  43. cat <<EOF >/etc/apt/sources.list.d/jellyfin.sources
  44. Types: deb
  45. URIs: https://repo.jellyfin.org/${PCT_OSTYPE}
  46. Suites: ${VERSION}
  47. Components: main
  48. Architectures: amd64
  49. Signed-By: /etc/apt/keyrings/jellyfin.gpg
  50. EOF
  51. # Install Jellyfin using the metapackage (which will fetch jellyfin-server, jellyfin-web, and jellyfin-ffmpeg5)
  52. $STD apt-get update
  53. $STD apt-get install -y jellyfin
  54. msg_ok "Installed Jellyfin"
  55. motd_ssh
  56. customize
  57. msg_info "Cleaning up"
  58. $STD apt-get autoremove
  59. $STD apt-get autoclean
  60. msg_ok "Cleaned"