diff --git a/ct/tdarr.sh b/ct/tdarr.sh index b955e7439..61f7cb042 100644 --- a/ct/tdarr.sh +++ b/ct/tdarr.sh @@ -20,18 +20,30 @@ color catch_errors function update_script() { - header_info - check_container_storage - check_container_resources - if [[ ! -d /opt/tdarr ]]; then - msg_error "No ${APP} Installation Found!" - exit - fi - msg_info "Updating $APP LXC" - $STD apt-get update - $STD apt-get -y upgrade - msg_ok "Updated $APP LXC" + header_info + check_container_storage + check_container_resources + if [[ ! -d /opt/tdarr ]]; then + msg_error "No ${APP} Installation Found!" exit + fi + msg_info "Updating $APP LXC" + $STD apt-get update + $STD apt-get -y upgrade + rm -rf /opt/tdarr/Tdarr_Updater + cd /opt/tdarr + RELEASE=$(curl -fsSL https://f000.backblazeb2.com/file/tdarrs/versions.json | grep -oP '(?<="Tdarr_Updater": ")[^"]+' | grep linux_x64 | head -n 1) + curl -fsSL "$RELEASE" -o Tdarr_Updater.zip + $STD unzip Tdarr_Updater.zip + chmod +x Tdarr_Updater + $STD ./Tdarr_Updater + msg_ok "Updated $APP LXC" + + msg_info "Cleaning up" + rm -rf /opt/tdarr/Tdarr_Updater.zip + msg_ok "Cleaned" + msg_ok "$APP has been successfully updated!" + exit } start @@ -41,4 +53,4 @@ description msg_ok "Completed Successfully!\n" echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}" echo -e "${INFO}${YW} Access it using the following URL:${CL}" -echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:8265${CL}" \ No newline at end of file +echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:8265${CL}" diff --git a/frontend/public/json/tdarr.json b/frontend/public/json/tdarr.json index fb7326c50..79b83dd3d 100644 --- a/frontend/public/json/tdarr.json +++ b/frontend/public/json/tdarr.json @@ -6,7 +6,7 @@ ], "date_created": "2024-05-02", "type": "ct", - "updateable": false, + "updateable": true, "privileged": false, "interface_port": 8265, "documentation": null, diff --git a/install/tdarr-install.sh b/install/tdarr-install.sh index cc16b657f..ff5e428cd 100644 --- a/install/tdarr-install.sh +++ b/install/tdarr-install.sh @@ -17,6 +17,16 @@ msg_info "Installing Dependencies" $STD apt-get install -y handbrake-cli msg_ok "Installed Dependencies" +msg_info "Installing Tdarr" +mkdir -p /opt/tdarr +cd /opt/tdarr +RELEASE=$(curl -fsSL https://f000.backblazeb2.com/file/tdarrs/versions.json | grep -oP '(?<="Tdarr_Updater": ")[^"]+' | grep linux_x64 | head -n 1) +curl -fsSL "$RELEASE" -o Tdarr_Updater.zip +$STD unzip Tdarr_Updater.zip +chmod +x Tdarr_Updater +$STD ./Tdarr_Updater +msg_ok "Installed Tdarr" + msg_info "Setting Up Hardware Acceleration" $STD apt-get -y install {va-driver-all,ocl-icd-libopencl1,intel-opencl-icd,vainfo,intel-gpu-tools} if [[ "$CTTYPE" == "0" ]]; then @@ -25,29 +35,14 @@ if [[ "$CTTYPE" == "0" ]]; then chmod 660 /dev/dri/* $STD adduser $(id -u -n) video $STD adduser $(id -u -n) render -fi -msg_ok "Set Up Hardware Acceleration" - -msg_info "Installing Tdarr" -mkdir -p /opt/tdarr -cd /opt/tdarr -RELEASE=$(curl -fsSL https://f000.backblazeb2.com/file/tdarrs/versions.json | grep -oP '(?<="Tdarr_Updater": ")[^"]+' | grep linux_x64 | head -n 1) -curl -fsSL "$RELEASE" -o $(basename "$RELEASE") -$STD unzip Tdarr_Updater.zip -rm -rf Tdarr_Updater.zip -chmod +x Tdarr_Updater -./Tdarr_Updater &>/dev/null -if [[ "$CTTYPE" == "0" ]]; then sed -i -e 's/^sgx:x:104:$/render:x:104:root/' -e 's/^render:x:106:root$/sgx:x:106:/' /etc/group else sed -i -e 's/^sgx:x:104:$/render:x:104:/' -e 's/^render:x:106:$/sgx:x:106:/' /etc/group fi +msg_ok "Set Up Hardware Acceleration" -msg_ok "Installed Tdarr" - -msg_info "Creating Service" -service_path="/etc/systemd/system/tdarr-server.service" -echo "[Unit] +cat </etc/systemd/system/tdarr-server.service +[Unit] Description=Tdarr Server Daemon After=network.target # Enable if using ZFS, edit and enable if other FS mounting is required to access directory @@ -56,20 +51,20 @@ After=network.target [Service] User=root Group=root - Type=simple WorkingDirectory=/opt/tdarr/Tdarr_Server -ExecStartPre=/opt/tdarr/Tdarr_Updater +ExecStartPre=/opt/tdarr/Tdarr_Updater ExecStart=/opt/tdarr/Tdarr_Server/Tdarr_Server TimeoutStopSec=20 KillMode=process Restart=on-failure [Install] -WantedBy=multi-user.target" >$service_path +WantedBy=multi-user.target +EOF -service_path="/etc/systemd/system/tdarr-node.service" -echo "[Unit] +cat </etc/systemd/system/tdarr-node.service +[Unit] Description=Tdarr Node Daemon After=network.target Requires=tdarr-server.service @@ -77,7 +72,6 @@ Requires=tdarr-server.service [Service] User=root Group=root - Type=simple WorkingDirectory=/opt/tdarr/Tdarr_Node ExecStart=/opt/tdarr/Tdarr_Node/Tdarr_Node @@ -86,16 +80,16 @@ KillMode=process Restart=on-failure [Install] -WantedBy=multi-user.target" >$service_path -systemctl enable --now -q tdarr-server.service -systemctl enable --now -q tdarr-node.service +WantedBy=multi-user.target +EOF +systemctl enable --now -q tdarr-server tdarr-node msg_ok "Created Service" motd_ssh customize msg_info "Cleaning up" -rm -rf Tdarr_Updater.zip +rm -rf /opt/tdarr/Tdarr_Updater.zip $STD apt-get -y autoremove $STD apt-get -y autoclean msg_ok "Cleaned"