Implement reversible Sentinel beta foundation
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
[CmdletBinding()]
|
||||
param(
|
||||
[string]$ManifestUrl = "https://gitea.officecom.cloud/officecom/oc-sentinel/raw/main/release/stable/version.json",
|
||||
[string]$ManifestUrl = "",
|
||||
[ValidateSet("stable", "beta")]
|
||||
[string]$ReleaseChannel = "stable",
|
||||
[string]$WebhookUrl = "",
|
||||
[string]$SecretValue = "",
|
||||
[switch]$RunInitialStatusScan
|
||||
@@ -112,6 +114,20 @@ function Get-OCSentinelArtifact {
|
||||
|
||||
Initialize-OCSentinelTls
|
||||
|
||||
if ($ReleaseChannel -eq "stable" -and -not [string]::IsNullOrWhiteSpace($env:ReleaseChannel)) {
|
||||
$requestedChannel = $env:ReleaseChannel.Trim().ToLowerInvariant()
|
||||
if ($requestedChannel -notin @("stable", "beta")) {
|
||||
throw "ReleaseChannel must be stable or beta."
|
||||
}
|
||||
$ReleaseChannel = $requestedChannel
|
||||
}
|
||||
|
||||
if ([string]::IsNullOrWhiteSpace($ManifestUrl)) {
|
||||
$ManifestUrl = "https://gitea.officecom.cloud/officecom/oc-sentinel/raw/main/release/$ReleaseChannel/version.json"
|
||||
}
|
||||
|
||||
Write-Host "OCSentinel release channel: $ReleaseChannel"
|
||||
|
||||
$installRoot = Join-Path $env:ProgramFiles "OCSentinel"
|
||||
$updaterPath = Join-Path $installRoot "scripts\update-ocsentinel.ps1"
|
||||
$monitorPath = Join-Path $installRoot "scripts\run-ocsentinel-monitor.ps1"
|
||||
|
||||
Reference in New Issue
Block a user