2023-03-22 20:48:20 -04:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
2025-01-01 13:37:29 +01:00
|
|
|
# Copyright (c) 2021-2025 tteck
|
2023-03-22 20:48:20 -04:00
|
|
|
# Author: tteck (tteckster)
|
2025-03-04 17:54:20 +01:00
|
|
|
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
|
|
|
|
# Source: https://jellyfin.org/
|
2023-03-22 20:48:20 -04:00
|
|
|
|
2025-03-24 14:20:56 +01:00
|
|
|
source /dev/stdin <<<"$FUNCTIONS_FILE_PATH"
|
2023-03-22 20:48:20 -04:00
|
|
|
color
|
|
|
|
|
verb_ip6
|
|
|
|
|
catch_errors
|
|
|
|
|
setting_up_container
|
|
|
|
|
network_check
|
|
|
|
|
update_os
|
|
|
|
|
|
2024-04-25 14:42:39 -04:00
|
|
|
msg_info "Setting Up Hardware Acceleration"
|
2025-10-20 21:00:48 +02:00
|
|
|
if ! grep -qEi 'ubuntu' /etc/os-release; then
|
|
|
|
|
fetch_and_deploy_gh_release "intel-igc-core-2" "intel/intel-graphics-compiler" "binary" "latest" "" "intel-igc-core-2_*_amd64.deb"
|
|
|
|
|
fetch_and_deploy_gh_release "intel-igc-opencl-2" "intel/intel-graphics-compiler" "binary" "latest" "" "intel-igc-opencl-2_*_amd64.deb"
|
|
|
|
|
fetch_and_deploy_gh_release "intel-libgdgmm12" "intel/compute-runtime" "binary" "latest" "" "libigdgmm12_*_amd64.deb"
|
|
|
|
|
fetch_and_deploy_gh_release "intel-opencl-icd" "intel/compute-runtime" "binary" "latest" "" "intel-opencl-icd_*_amd64.deb"
|
|
|
|
|
fi
|
2025-10-20 16:21:31 +02:00
|
|
|
|
2025-10-20 23:33:32 -07:00
|
|
|
$STD apt -y install {va-driver-all,ocl-icd-libopencl1,intel-opencl-icd,vainfo,intel-gpu-tools}
|
2023-05-15 07:39:30 -04:00
|
|
|
if [[ "$CTTYPE" == "0" ]]; then
|
2023-12-03 14:40:39 -05:00
|
|
|
chgrp video /dev/dri
|
|
|
|
|
chmod 755 /dev/dri
|
|
|
|
|
chmod 660 /dev/dri/*
|
|
|
|
|
$STD adduser $(id -u -n) video
|
|
|
|
|
$STD adduser $(id -u -n) render
|
2023-03-22 20:48:20 -04:00
|
|
|
fi
|
2024-04-25 14:42:39 -04:00
|
|
|
msg_ok "Set Up Hardware Acceleration"
|
2023-03-22 20:48:20 -04:00
|
|
|
|
|
|
|
|
msg_info "Installing Jellyfin"
|
2025-03-24 14:20:56 +01:00
|
|
|
VERSION="$(awk -F'=' '/^VERSION_CODENAME=/{ print $NF }' /etc/os-release)"
|
2025-10-20 08:28:22 +02:00
|
|
|
if ! dpkg -s libjemalloc2 >/dev/null 2>&1; then
|
|
|
|
|
$STD apt install -y libjemalloc2
|
|
|
|
|
fi
|
|
|
|
|
if [[ ! -f /usr/lib/libjemalloc.so ]]; then
|
|
|
|
|
ln -sf /usr/lib/x86_64-linux-gnu/libjemalloc.so.2 /usr/lib/libjemalloc.so
|
|
|
|
|
fi
|
2023-04-05 06:41:33 -04:00
|
|
|
if [[ ! -d /etc/apt/keyrings ]]; then
|
2025-03-24 14:20:56 +01:00
|
|
|
mkdir -p /etc/apt/keyrings
|
2023-04-05 06:41:33 -04:00
|
|
|
fi
|
|
|
|
|
curl -fsSL https://repo.jellyfin.org/jellyfin_team.gpg.key | gpg --dearmor --yes --output /etc/apt/keyrings/jellyfin.gpg
|
|
|
|
|
cat <<EOF >/etc/apt/sources.list.d/jellyfin.sources
|
|
|
|
|
Types: deb
|
|
|
|
|
URIs: https://repo.jellyfin.org/${PCT_OSTYPE}
|
|
|
|
|
Suites: ${VERSION}
|
|
|
|
|
Components: main
|
|
|
|
|
Architectures: amd64
|
|
|
|
|
Signed-By: /etc/apt/keyrings/jellyfin.gpg
|
|
|
|
|
EOF
|
2025-10-20 08:28:22 +02:00
|
|
|
|
|
|
|
|
$STD apt update
|
|
|
|
|
$STD apt install -y jellyfin
|
2025-01-26 14:01:31 +01:00
|
|
|
sed -i 's/"MinimumLevel": "Information"/"MinimumLevel": "Error"/g' /etc/jellyfin/logging.json
|
2025-10-20 08:28:22 +02:00
|
|
|
|
2024-08-28 11:28:46 -04:00
|
|
|
chown -R jellyfin:adm /etc/jellyfin
|
2024-08-28 11:42:30 -04:00
|
|
|
sleep 10
|
2024-08-28 11:35:08 -04:00
|
|
|
systemctl restart jellyfin
|
2024-04-25 14:42:39 -04:00
|
|
|
if [[ "$CTTYPE" == "0" ]]; then
|
|
|
|
|
sed -i -e 's/^ssl-cert:x:104:$/render:x:104:root,jellyfin/' -e 's/^render:x:108:root,jellyfin$/ssl-cert:x:108:/' /etc/group
|
|
|
|
|
else
|
|
|
|
|
sed -i -e 's/^ssl-cert:x:104:$/render:x:104:jellyfin/' -e 's/^render:x:108:jellyfin$/ssl-cert:x:108:/' /etc/group
|
|
|
|
|
fi
|
2023-03-22 20:48:20 -04:00
|
|
|
msg_ok "Installed Jellyfin"
|
|
|
|
|
|
|
|
|
|
motd_ssh
|
2023-05-15 07:39:30 -04:00
|
|
|
customize
|
2023-03-22 20:48:20 -04:00
|
|
|
|
|
|
|
|
msg_info "Cleaning up"
|
2025-10-20 08:28:22 +02:00
|
|
|
$STD apt -y autoremove
|
|
|
|
|
$STD apt -y autoclean
|
|
|
|
|
$STD apt -y clean
|
2023-03-22 20:48:20 -04:00
|
|
|
msg_ok "Cleaned"
|