tdarr-install.sh 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  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. intel-opencl-icd
  24. chgrp video /dev/dri
  25. chmod 755 /dev/dri
  26. chmod 660 /dev/dri/*
  27. $STD adduser $(id -u -n) video
  28. $STD adduser $(id -u -n) render
  29. msg_ok "Set Up Hardware Acceleration"
  30. fi
  31. msg_info "Installing Tdarr"
  32. mkdir -p /opt/tdarr
  33. cd /opt/tdarr
  34. wget -q https://f000.backblazeb2.com/file/tdarrs/versions/2.00.15/linux_x64/Tdarr_Updater.zip
  35. $STD unzip Tdarr_Updater.zip
  36. rm -rf Tdarr_Updater.zip
  37. chmod +x Tdarr_Updater
  38. ./Tdarr_Updater &>/dev/null
  39. msg_ok "Installed Tdarr"
  40. msg_info "Creating Service"
  41. service_path="/etc/systemd/system/tdarr-server.service"
  42. echo "[Unit]
  43. Description=Tdarr Server Daemon
  44. After=network.target
  45. # Enable if using ZFS, edit and enable if other FS mounting is required to access directory
  46. #Requires=zfs-mount.service
  47. [Service]
  48. User=root
  49. Group=root
  50. Type=simple
  51. WorkingDirectory=/opt/tdarr/Tdarr_Server
  52. ExecStartPre=/opt/tdarr/Tdarr_Updater
  53. ExecStart=/opt/tdarr/Tdarr_Server/Tdarr_Server
  54. TimeoutStopSec=20
  55. KillMode=process
  56. Restart=on-failure
  57. [Install]
  58. WantedBy=multi-user.target" >$service_path
  59. service_path="/etc/systemd/system/tdarr-node.service"
  60. echo "[Unit]
  61. Description=Tdarr Node Daemon
  62. After=network.target
  63. Requires=tdarr-server.service
  64. [Service]
  65. User=root
  66. Group=root
  67. Type=simple
  68. WorkingDirectory=/opt/tdarr/Tdarr_Node
  69. ExecStart=/opt/tdarr/Tdarr_Node/Tdarr_Node
  70. TimeoutStopSec=20
  71. KillMode=process
  72. Restart=on-failure
  73. [Install]
  74. WantedBy=multi-user.target" >$service_path
  75. systemctl enable --now -q tdarr-server.service
  76. systemctl enable --now -q tdarr-node.service
  77. msg_ok "Created Service"
  78. motd_ssh
  79. customize
  80. msg_info "Cleaning up"
  81. rm -rf Tdarr_Updater.zip
  82. $STD apt-get autoremove
  83. $STD apt-get autoclean
  84. msg_ok "Cleaned"