tdarr-install.sh 1.9 KB

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