SickBeard - Additional installer code

- Complete uninstall script undoes configuration changes to SABNzbd
 - Use new WaitForSuccess helper
 - Wait for SickBeard to be accepting reqs before modifying config.ini
 - PATH and PYTHONHOME need to be set for MACHINE so that SABNzbd
can find python.exe as SYSTEM to call sabToSickBeard.py
 - Config files should always be written as UTF8 (not Unicode or ASCII),
 - However, AutoProcess.cfg cannot have UTF8 BOM, so saving as ASCII
 - Replacing 0.0.0.0 with localhost
 - Support cloning into an empty Sick-Beard dir under site-packages
 - Minor logging tweaks
 - Use Season folders when sorting files
 - Make sure to trash processed files
This commit is contained in:
Iristyle
2012-10-16 01:44:06 -04:00
committed by Iristyle
parent f4084e7689
commit dd0265e871
5 changed files with 232 additions and 49 deletions

View File

@@ -0,0 +1,24 @@
function WaitForSuccess([ScriptBlock] $script, [int]$seconds = 10,
[string]$description = 'operation to complete')
{
$skip = $false
Write-Host "Waiting up to $($seconds)s for $description..."
$result = 0..($seconds * 2) |
% {
if ($skip) { return $true }
$status = &$script
if ($status -eq $true)
{
$skip = $true
return $true
}
else
{
Start-Sleep -Milliseconds 500
}
return $false
} |
Select -Last 1
return $result
}