Files
ProxmoxVE/install/tdarr-install.sh
T

85 lines
2.0 KiB
Bash
Raw Normal View History

2023-03-22 20:48:20 -04:00
#!/usr/bin/env bash
# Copyright (c) 2021-2026 tteck
2023-03-22 20:48:20 -04:00
# Author: tteck (tteckster)
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
# Source: https://home.tdarr.io/
2023-03-22 20:48:20 -04: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
msg_info "Installing Dependencies"
2025-10-09 19:43:23 +02:00
$STD apt install -y handbrake-cli
2023-03-22 20:48:20 -04:00
msg_ok "Installed Dependencies"
2025-08-19 21:55:42 +02:00
msg_info "Installing Tdarr"
mkdir -p /opt/tdarr
cd /opt/tdarr
RELEASE=$(curl_with_retry "https://f000.backblazeb2.com/file/tdarrs/versions.json" "-" | grep -oP '(?<="Tdarr_Updater": ")[^"]+' | grep "linux_$(arch_resolve "x64" "arm64")" | head -n 1)
curl_with_retry "$RELEASE" "Tdarr_Updater.zip"
$STD unzip -o Tdarr_Updater.zip
2025-08-19 21:55:42 +02:00
chmod +x Tdarr_Updater
$STD ./Tdarr_Updater
rm -rf /opt/tdarr/Tdarr_Updater.zip
[[ -f /opt/tdarr/Tdarr_Server/Tdarr_Server ]] || {
msg_error "Tdarr_Updater failed — tdarr.io may be blocked by local DNS"
exit 250
}
2025-08-19 21:55:42 +02:00
msg_ok "Installed Tdarr"
setup_hwaccel
2024-04-30 05:48:46 -04:00
2025-10-09 19:43:23 +02:00
msg_info "Creating Service"
2025-08-19 21:55:42 +02:00
cat <<EOF >/etc/systemd/system/tdarr-server.service
[Unit]
2023-03-22 20:48:20 -04:00
Description=Tdarr Server Daemon
After=network.target
# Enable if using ZFS, edit and enable if other FS mounting is required to access directory
#Requires=zfs-mount.service
[Service]
User=root
Group=root
Type=simple
WorkingDirectory=/opt/tdarr/Tdarr_Server
2025-08-19 21:55:42 +02:00
ExecStartPre=/opt/tdarr/Tdarr_Updater
2023-03-22 20:48:20 -04:00
ExecStart=/opt/tdarr/Tdarr_Server/Tdarr_Server
TimeoutStopSec=20
KillMode=process
Restart=on-failure
[Install]
2025-08-19 21:55:42 +02:00
WantedBy=multi-user.target
EOF
2023-03-22 20:48:20 -04:00
2025-08-19 21:55:42 +02:00
cat <<EOF >/etc/systemd/system/tdarr-node.service
[Unit]
2023-03-22 20:48:20 -04:00
Description=Tdarr Node Daemon
After=network.target
Requires=tdarr-server.service
[Service]
User=root
Group=root
Type=simple
WorkingDirectory=/opt/tdarr/Tdarr_Node
ExecStart=/opt/tdarr/Tdarr_Node/Tdarr_Node
TimeoutStopSec=20
KillMode=process
Restart=on-failure
[Install]
2025-08-19 21:55:42 +02:00
WantedBy=multi-user.target
EOF
systemctl enable --now -q tdarr-server tdarr-node
2023-03-22 20:48:20 -04:00
msg_ok "Created Service"
motd_ssh
2023-05-15 07:39:30 -04:00
customize
cleanup_lxc