fully operational
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -6,7 +6,10 @@ function Show-Header {
|
||||
Write-Host
|
||||
}
|
||||
|
||||
$SheepItJarUrl = 'https://www.sheepit-renderfarm.com/media/applet/client-latest.jar'
|
||||
$SheepItJarUrls = @(
|
||||
'https://www.sheepit-renderfarm.com/media/applet/client-latest.php',
|
||||
'https://www.sheepit-renderfarm.com/media/applet/client-latest.jar'
|
||||
)
|
||||
$script:SheepItUsername = $null
|
||||
$script:SheepItRenderKey = $null
|
||||
|
||||
@@ -43,6 +46,8 @@ function Get-RemoteSheepItCommand {
|
||||
" Write-Host 'Authenticating as ${safeUser} via render key.' -ForegroundColor Yellow`n"
|
||||
}
|
||||
|
||||
$urlLiteral = '@(' + (($SheepItJarUrls | ForEach-Object { "'$_'" }) -join ', ') + ')'
|
||||
|
||||
@"
|
||||
`$ErrorActionPreference = 'Stop'
|
||||
|
||||
@@ -54,16 +59,39 @@ try {
|
||||
}
|
||||
|
||||
`$jarPath = Join-Path `$sheepDir 'sheepit-client.jar'
|
||||
Write-Host "Downloading SheepIt client..." -ForegroundColor Cyan
|
||||
Invoke-WebRequest -Uri '$SheepItJarUrl' -OutFile `$jarPath -UseBasicParsing
|
||||
Write-Host "Download complete." -ForegroundColor Green
|
||||
`$urls = $urlLiteral
|
||||
`$headers = @{ 'User-Agent' = 'Mozilla/5.0' }
|
||||
|
||||
if (Test-Path `$jarPath) {
|
||||
Write-Host "SheepIt client already present at `$jarPath. Skipping download." -ForegroundColor Green
|
||||
}
|
||||
else {
|
||||
`$downloaded = `$false
|
||||
|
||||
foreach (`$url in `$urls) {
|
||||
Write-Host "Downloading SheepIt client from `$url..." -ForegroundColor Cyan
|
||||
try {
|
||||
Invoke-WebRequest -Uri `$url -OutFile `$jarPath -UseBasicParsing -Headers `$headers
|
||||
`$downloaded = `$true
|
||||
Write-Host "Download complete." -ForegroundColor Green
|
||||
break
|
||||
}
|
||||
catch {
|
||||
Write-Host ("Download failed from {0}: {1}" -f `$url, `$_.Exception.Message) -ForegroundColor Yellow
|
||||
}
|
||||
}
|
||||
|
||||
if (-not `$downloaded) {
|
||||
throw 'Unable to download SheepIt client from any known URL.'
|
||||
}
|
||||
}
|
||||
|
||||
Write-Host "Starting SheepIt client..." -ForegroundColor Cyan
|
||||
${userLine} Set-Location `$sheepDir
|
||||
& java -jar `$jarPath --ui text --stdout --verbose -gpu optix 0 --renderkey '${safeKey}'
|
||||
& java -jar `$jarPath -ui text --log-stdout --verbose -gpu OPTIX_0 -login '${safeUser}' -password '${safeKey}'
|
||||
}
|
||||
catch {
|
||||
Write-Host "Error: `$($_.Exception.Message)" -ForegroundColor Red
|
||||
Write-Host ('Error: {0}' -f `$_.Exception.Message) -ForegroundColor Red
|
||||
}
|
||||
"@
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user