mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-06-12 20:45:20 +02:00
feat(docker): add interactive Watchtower update preference to installation scripts
This commit is contained in:
parent
f56e2325b0
commit
4bfa04ed57
3 changed files with 48 additions and 3 deletions
|
|
@ -64,6 +64,28 @@ function Invoke-NativeSafe {
|
|||
}
|
||||
}
|
||||
|
||||
function Resolve-WatchtowerPreference {
|
||||
if ($NoWatchtower -or $Quiet -or -not [Environment]::UserInteractive) {
|
||||
return
|
||||
}
|
||||
|
||||
Write-Host ""
|
||||
Write-Host "Automatic updates" -ForegroundColor Cyan
|
||||
$choice = Read-Host "Enable automatic daily updates with Watchtower? (may download several GB in the background) [Y/n]"
|
||||
|
||||
switch ($choice) {
|
||||
"" { $script:SetupWatchtower = $true }
|
||||
{ $_ -match '^(?i)y(es)?$' } { $script:SetupWatchtower = $true }
|
||||
{ $_ -match '^(?i)n(o)?$' } { $script:SetupWatchtower = $false }
|
||||
default {
|
||||
Write-Warn "Unrecognized choice '$choice'; enabling Watchtower by default. Use -NoWatchtower to skip it."
|
||||
$script:SetupWatchtower = $true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Resolve-WatchtowerPreference
|
||||
|
||||
# ── Pre-flight checks ──────────────────────────────────────────────────────
|
||||
|
||||
Write-Step "Checking prerequisites"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue