Skip to content

Commit

Permalink
(zabbix-agent) fix zabbix-agent (#210)
Browse files Browse the repository at this point in the history
  • Loading branch information
mkevenaar committed Oct 18, 2023
1 parent e25f744 commit 8ade3d7
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
3 changes: 2 additions & 1 deletion automatic/zabbix-agent.install/update.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ function global:au_GetLatest {
try {
$majVersionFolder = $_.href
$version_download_page = Invoke-WebRequest -UseBasicParsing -Uri "$releases$majVersionFolder"
$version = $version_download_page.Links | Select-Object -ExpandProperty href | ForEach-Object{ Get-Version ($_) -ErrorAction SilentlyContinue } | Sort-Object | Select-Object -Last 1
$majVersion = Get-Version $majVersionFolder
$version = $version_download_page.Links | Where-Object -Property href -Match $majVersion| Select-Object -ExpandProperty href | ForEach-Object{ Get-Version ($_) } | Sort-Object | Select-Object -Last 1

$url32Bit = "${releases}${majVersionFolder}${version}/zabbix_agent-${version}-windows-i386-openssl.msi"
$url64Bit = "${releases}${majVersionFolder}${version}/zabbix_agent-${version}-windows-amd64-openssl.msi"
Expand Down
12 changes: 7 additions & 5 deletions automatic/zabbix-agent/update.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ $releases = 'https://cdn.zabbix.com/zabbix/binaries/stable/'
function global:au_SearchReplace {
@{
".\tools\chocolateyInstall.ps1" = @{
"(?i)(version\s*=\s*)('.*')" = "`$1'$($Latest.Version)'"
"(?i)(version\s*=\s*)('.*')" = "`$1'$($Latest.ChocoVersion)'"
"(?i)(^\s*file\s*=\s*`"[$]toolsDir\\).*" = "`${1}$($Latest.FileName32)`""
"(?i)(^\s*file64\s*=\s*`"[$]toolsDir\\).*" = "`${1}$($Latest.FileName64)`""
}
Expand All @@ -27,9 +27,10 @@ function CreateStream {
param($url32bit, $url64bit, $version)

$Result = @{
Version = $version
URL32 = $url32bit
URL64 = $url64bit
ChocoVersion = $version
Version = $version
URL32 = $url32bit
URL64 = $url64bit
}

return $Result
Expand All @@ -46,7 +47,8 @@ function global:au_GetLatest {
try {
$majVersionFolder = $_.href
$version_download_page = Invoke-WebRequest -UseBasicParsing -Uri "$releases$majVersionFolder"
$version = $version_download_page.Links | Select-Object -ExpandProperty href | ForEach-Object{ Get-Version ($_) -ErrorAction SilentlyContinue } | Sort-Object | Select-Object -Last 1
$majVersion = Get-Version $majVersionFolder
$version = $version_download_page.Links | Where-Object -Property href -Match $majVersion| Select-Object -ExpandProperty href | ForEach-Object{ Get-Version ($_) } | Sort-Object | Select-Object -Last 1

$url32Bit = "${releases}${majVersionFolder}${version}/zabbix_agent-${version}-windows-i386-openssl.zip"
$url64Bit = "${releases}${majVersionFolder}${version}/zabbix_agent-${version}-windows-amd64-openssl.zip"
Expand Down
3 changes: 2 additions & 1 deletion automatic/zabbix-agent2/update.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ function global:au_GetLatest {
try {
$majVersionFolder = $_.href
$version_download_page = Invoke-WebRequest -UseBasicParsing -Uri "$releases$majVersionFolder"
$version = $version_download_page.Links | Select-Object -ExpandProperty href | ForEach-Object{ Get-Version ($_) -ErrorAction SilentlyContinue } | Sort-Object | Select-Object -Last 1
$majVersion = Get-Version $majVersionFolder
$version = $version_download_page.Links | Where-Object -Property href -Match $majVersion| Select-Object -ExpandProperty href | ForEach-Object{ Get-Version ($_) } | Sort-Object | Select-Object -Last 1

$url32Bit = "${releases}${majVersionFolder}${version}/zabbix_agent2-${version}-windows-i386-openssl.msi"
$url64Bit = "${releases}${majVersionFolder}${version}/zabbix_agent2-${version}-windows-amd64-openssl.msi"
Expand Down

0 comments on commit 8ade3d7

Please sign in to comment.