rogerfar / rdt-client

Real-Debrid Client Proxy
MIT License
853 stars 110 forks source link

Updating Proxmox LXC Container #451

Closed Drknz056 closed 5 months ago

Drknz056 commented 5 months ago

What version are you using? 2.0.63

Wat OS are you running? Proxmox LXC Are you using Docker or as a service? Service Which debrid provider are you using? Real Debrid Which downloader are you using? Internal Please attach a log file here with the log setting set to debug

Hey guys, quick question! I see a new release 2.0.64. Just just wondering how I can update to this version running RDT Client as a LXC container via Proxmox.

GameEnder commented 5 months ago

Install Powershell in the Container and update the Update.ps1 script to this version that is Linux compatible.

$currentDirectory = $PSScriptRoot

Write-Host "Starting update script in $currentDirectory"

if ($PSVersionTable.Platform -eq "Unix") {
    if ((id -u) -eq 0) {

Write-Host "Stopping ReadDebridClient..."

systemctl stop rdtc.service

Write-Host "Stopped ReadDebridClient"

$releasesUri = "https://api.github.com/repos/rogerfar/rdt-client/releases/latest"
$downloadUri = ((Invoke-RestMethod -Method GET -Uri $releasesUri).assets | Where-Object name -like "*.zip").browser_download_url

Write-Host "Downloading $downloadUri"

$pathZip = Join-Path -Path $([System.IO.Path]::GetTempPath()) -ChildPath $(Split-Path -Path $downloadUri -Leaf)

Invoke-WebRequest -Uri $downloadUri -Out $pathZip

$tempExtract = Join-Path -Path $([System.IO.Path]::GetTempPath()) -ChildPath $((New-Guid).Guid)

Write-Host "Extracting to $tempExtract"

Expand-Archive -Path $pathZip -DestinationPath $tempExtract -Force

Write-Host "Backing up appsettings.json"

Copy-Item -Path "$currentDirectory\appsettings.json" -Destination $tempExtract -Force 

Write-Host "Moving new files"

Move-Item -Path "$tempExtract\*" -Destination $currentDirectory -Force

Write-Host "Removing temp files"

Remove-Item -Path $tempExtract -Force -Recurse -ErrorAction SilentlyContinue

Remove-Item $pathZip -Force

Write-Host "Starting ReadDebridClient..."

systemctl start rdtc.service

Write-Host "Started ReadDebridClient"

    }

    else {
        exit
    }
}
GameEnder commented 5 months ago

Better option use the update command in the console. That really needs to be documented somewhere.

https://github.com/tteck/Proxmox/discussions/2761#discussioncomment-9051896