tdarr-install.sh 2.2 KB

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