|
32 | 32 | "UpdateSourceArch": "x86_64", |
33 | 33 | "UpdateSource": "Executable", |
34 | 34 | "UpdateSourceData": "/bin/bash", |
35 | | - "UpdateSourceArgs": "-c \"cd \\\"{{$FullRootDir}}\\\" && chmod +x ./hytale-downloader-linux-amd64 && LatestVersion=$(timeout 5 wget -qO- https://maven.hytale.com/{{ServerBuildChannel}}/com/hypixel/hytale/Server/maven-metadata.xml | sed -n \\\"s/.*<latest>\\(.*\\)<\\/latest>.*/\\1/p\\\"); if [[ -n \\\"$LatestVersion\\\" ]] && [[ ! \\\"$LatestVersion\\\" =~ ^[0-9]{4}\\.[0-9]{2}\\.[0-9]{2}-[a-fA-F0-9]+$ ]]; then if [[ \\\"$LatestVersion\\\" =~ oauth2:\\ (\\\\\\\"invalid_(grant|request)\\\\\\\"|token\\ expired\\ and\\ refresh\\ token\\ is\\ not\\ set) ]] && [[ -f ./.hytale-downloader-credentials.json ]]; then rm -f ./.hytale-downloader-credentials.json; fi; LatestVersion=\\\"\\\"; fi; [[ -f ./Server/.installedversion ]] && { InstalledVersion=\\\"$(cat ./Server/.installedversion 2>/dev/null)\\\"; if [[ \\\"$InstalledVersion\\\" =~ ^[0-9]{4}\\.[0-9]{2}\\.[0-9]{2}-[a-fA-F0-9]+$ ]] && [[ \\\"$InstalledVersion\\\" == \\\"$LatestVersion\\\" ]]; then echo \\\"Latest Hytale {{ServerBuildChannel}} version $LatestVersion already installed. Skipping\\\"; exit 0; fi; }; ./hytale-downloader-linux-amd64 -patchline {{ServerBuildChannel}} -download-path ./server.zip || { echo \\\"Download failed from the Hytale CDN. This is a fault with the CDN or the download, not AMP. Aborting\\\"; exit 1; }; sleep 1 && if [[ -f ./server.zip ]]; then [[ -z \\\"${LatestVersion:-}\\\" ]] && LatestVersion=$(timeout 5 wget -qO- https://maven.hytale.com/{{ServerBuildChannel}}/com/hypixel/hytale/Server/maven-metadata.xml | sed -n \\\"s/.*<latest>\\(.*\\)<\\/latest>.*/\\1/p\\\"); unzip -oq ./server.zip && sleep 1 && printf \\\"%s\\\" \\\"$LatestVersion\\\" > ./Server/.installedversion && rm -f ./server.zip >/dev/null 2>&1; fi\"", |
| 35 | + "UpdateSourceArgs": "-c \"cd \\\"{{$FullRootDir}}\\\" && chmod +x ./hytale-downloader-linux-amd64 && LatestVersion=$(timeout 5 wget -qO- https://maven.hytale.com/{{ServerBuildChannel}}/com/hypixel/hytale/Server/maven-metadata.xml | sed -n \\\"s/.*<latest>\\(.*\\)<\\/latest>.*/\\1/p\\\"); if [[ -n \\\"$LatestVersion\\\" ]] && [[ ! \\\"$LatestVersion\\\" =~ ^[0-9]{4}\\.[0-9]{2}\\.[0-9]{2}-[a-fA-F0-9]+$ ]]; then LatestVersion=\\\"\\\"; fi; [[ -f ./Server/.installedversion ]] && { InstalledVersion=\\\"$(cat ./Server/.installedversion 2>/dev/null)\\\"; if [[ \\\"$InstalledVersion\\\" =~ ^[0-9]{4}\\.[0-9]{2}\\.[0-9]{2}-[a-fA-F0-9]+$ ]] && [[ \\\"$InstalledVersion\\\" == \\\"$LatestVersion\\\" ]]; then echo \\\"Latest Hytale {{ServerBuildChannel}} version $LatestVersion already installed. Skipping\\\"; exit 0; fi; }; exec 3>&1; for attempt in 1 2; do err=$(./hytale-downloader-linux-amd64 -patchline {{ServerBuildChannel}} -download-path ./server.zip 2>&1 1>&3) 3>&1; rc=$?; ((rc==0)) && break; ((attempt==1)) && [[ -n \\\"$err\\\" ]] && [[ -f ./.hytale-downloader-credentials.json ]] && rm -f ./.hytale-downloader-credentials.json && continue; break; done; exec 3>&-; ((rc!=0)) && { echo \\\"$err\\\" >&2; echo \\\"Download failed from the Hytale CDN. This is a fault with the CDN or the download, not AMP. Aborting\\\" >&2; exit 1; }; sleep 1 && if [[ -f ./server.zip ]]; then [[ -z \\\"${LatestVersion:-}\\\" ]] && LatestVersion=$(timeout 5 wget -qO- https://maven.hytale.com/{{ServerBuildChannel}}/com/hypixel/hytale/Server/maven-metadata.xml | sed -n \\\"s/.*<latest>\\(.*\\)<\\/latest>.*/\\1/p\\\"); unzip -oq ./server.zip && sleep 1 && printf \\\"%s\\\" \\\"$LatestVersion\\\" > ./Server/.installedversion && rm -f ./server.zip >/dev/null 2>&1; fi\"", |
36 | 36 | "UpdateSourceConditionSetting": "disable-server-download", |
37 | 37 | "UpdateSourceConditionValue": "false", |
38 | 38 | "ProcessToolOutput": true, |
|
44 | 44 | "UpdateSourceArch": "aarch64", |
45 | 45 | "UpdateSource": "Executable", |
46 | 46 | "UpdateSourceData": "/bin/bash", |
47 | | - "UpdateSourceArgs": "-c \"cd \\\"{{$FullRootDir}}\\\" && chmod +x ./hytale-downloader-linux-arm64.sh && LatestVersion=$(timeout 5 wget -qO- https://maven.hytale.com/{{ServerBuildChannel}}/com/hypixel/hytale/Server/maven-metadata.xml | sed -n \\\"s/.*<latest>\\(.*\\)<\\/latest>.*/\\1/p\\\"); if [[ -n \\\"$LatestVersion\\\" ]] && [[ ! \\\"$LatestVersion\\\" =~ ^[0-9]{4}\\.[0-9]{2}\\.[0-9]{2}-[a-fA-F0-9]+$ ]]; then if [[ \\\"$LatestVersion\\\" =~ oauth2:\\ (\\\\\\\"invalid_(grant|request)\\\\\\\"|token\\ expired\\ and\\ refresh\\ token\\ is\\ not\\ set) ]] && [[ -f ./.hytale-downloader-credentials.json ]]; then rm -f ./.hytale-downloader-credentials.json; fi; LatestVersion=\\\"\\\"; fi; [[ -f ./Server/.installedversion ]] && { InstalledVersion=\\\"$(cat ./Server/.installedversion 2>/dev/null)\\\"; if [[ \\\"$InstalledVersion\\\" =~ ^[0-9]{4}\\.[0-9]{2}\\.[0-9]{2}-[a-fA-F0-9]+$ ]] && [[ \\\"$InstalledVersion\\\" == \\\"$LatestVersion\\\" ]]; then echo \\\"Latest Hytale {{ServerBuildChannel}} version $LatestVersion already installed. Skipping\\\"; exit 0; fi; }; ./hytale-downloader-linux-arm64.sh -patchline {{ServerBuildChannel}} -download-path ./server.zip || { echo \\\"Download failed from the Hytale CDN. This is a fault with the CDN or the download, not AMP. Aborting\\\"; exit 1; }; sleep 1 && if [[ -f ./server.zip ]]; then [[ -z \\\"${LatestVersion:-}\\\" ]] && LatestVersion=$(timeout 5 wget -qO- https://maven.hytale.com/{{ServerBuildChannel}}/com/hypixel/hytale/Server/maven-metadata.xml | sed -n \\\"s/.*<latest>\\(.*\\)<\\/latest>.*/\\1/p\\\"); unzip -oq ./server.zip && sleep 1 && printf \\\"%s\\\" \\\"$LatestVersion\\\" > ./Server/.installedversion && rm -f ./server.zip >/dev/null 2>&1; fi\"", |
| 47 | + "UpdateSourceArgs": "-c \"cd \\\"{{$FullRootDir}}\\\" && chmod +x ./hytale-downloader-linux-arm64.sh && LatestVersion=$(timeout 5 wget -qO- https://maven.hytale.com/{{ServerBuildChannel}}/com/hypixel/hytale/Server/maven-metadata.xml | sed -n \\\"s/.*<latest>\\(.*\\)<\\/latest>.*/\\1/p\\\"); if [[ -n \\\"$LatestVersion\\\" ]] && [[ ! \\\"$LatestVersion\\\" =~ ^[0-9]{4}\\.[0-9]{2}\\.[0-9]{2}-[a-fA-F0-9]+$ ]]; then LatestVersion=\\\"\\\"; fi; [[ -f ./Server/.installedversion ]] && { InstalledVersion=\\\"$(cat ./Server/.installedversion 2>/dev/null)\\\"; if [[ \\\"$InstalledVersion\\\" =~ ^[0-9]{4}\\.[0-9]{2}\\.[0-9]{2}-[a-fA-F0-9]+$ ]] && [[ \\\"$InstalledVersion\\\" == \\\"$LatestVersion\\\" ]]; then echo \\\"Latest Hytale {{ServerBuildChannel}} version $LatestVersion already installed. Skipping\\\"; exit 0; fi; }; exec 3>&1; for attempt in 1 2; do err=$(./hytale-downloader-linux-arm64.sh -patchline {{ServerBuildChannel}} -download-path ./server.zip 2>&1 1>&3) 3>&1; rc=$?; ((rc==0)) && break; ((attempt==1)) && [[ -n \\\"$err\\\" ]] && [[ -f ./.hytale-downloader-credentials.json ]] && rm -f ./.hytale-downloader-credentials.json && continue; break; done; exec 3>&-; ((rc!=0)) && { echo \\\"$err\\\" >&2; echo \\\"Download failed from the Hytale CDN. This is a fault with the CDN or the download, not AMP. Aborting\\\" >&2; exit 1; }; sleep 1 && if [[ -f ./server.zip ]]; then [[ -z \\\"${LatestVersion:-}\\\" ]] && LatestVersion=$(timeout 5 wget -qO- https://maven.hytale.com/{{ServerBuildChannel}}/com/hypixel/hytale/Server/maven-metadata.xml | sed -n \\\"s/.*<latest>\\(.*\\)<\\/latest>.*/\\1/p\\\"); unzip -oq ./server.zip && sleep 1 && printf \\\"%s\\\" \\\"$LatestVersion\\\" > ./Server/.installedversion && rm -f ./server.zip >/dev/null 2>&1; fi\"", |
48 | 48 | "UpdateSourceConditionSetting": "disable-server-download", |
49 | 49 | "UpdateSourceConditionValue": "false", |
50 | 50 | "ProcessToolOutput": true, |
|
55 | 55 | "UpdateSourcePlatform": "Windows", |
56 | 56 | "UpdateSource": "Executable", |
57 | 57 | "UpdateSourceData": "powershell.exe", |
58 | | - "UpdateSourceArgs": "-NoProfile -Command \"$ProgressPreference='SilentlyContinue'; [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; Set-Location -Path '{{$FullRootDir}}'; $LatestVersion = (Invoke-RestMethod -UseBasicParsing -TimeoutSec 5 -ErrorAction Stop https://maven.hytale.com/{{ServerBuildChannel}}/com/hypixel/hytale/Server/maven-metadata.xml).metadata.versioning.latest; if (-not [string]::IsNullOrEmpty($LatestVersion) -and $LatestVersion -notmatch '^[0-9]{4}\\.[0-9]{2}\\.[0-9]{2}-[a-fA-F0-9]+$') { if ($LatestVersion -match 'oauth2: (\\\"invalid_(request|grant)\\\"|token expired and refresh token is not set)' -and (Test-Path -LiteralPath './.hytale-downloader-credentials.json' -PathType Leaf)) { Remove-Item -LiteralPath './.hytale-downloader-credentials.json' -Force -ErrorAction SilentlyContinue *> $null }; $LatestVersion = '' }; if (Test-Path -LiteralPath './Server/.installedversion' -PathType Leaf) { $InstalledVersion = Get-Content -LiteralPath './Server/.installedversion' -Raw -ErrorAction SilentlyContinue; if ($InstalledVersion -match '^[0-9]{4}\\.[0-9]{2}\\.[0-9]{2}-[a-fA-F0-9]+$' -and $InstalledVersion -eq $LatestVersion) { Write-Output \\\"Latest Hytale {{ServerBuildChannel}} version $LatestVersion already installed. Skipping\\\"; exit 0 } }; try { & ./hytale-downloader-windows-amd64.exe -patchline {{ServerBuildChannel}} -download-path ./server.zip } catch { Write-Output \\\"Download failed from the Hytale CDN. This is a fault with the CDN or the download, not AMP. Aborting\\\"; exit 1; }; Start-Sleep -Seconds 1; if (Test-Path -LiteralPath './server.zip' -PathType Leaf) { if ([string]::IsNullOrEmpty($LatestVersion)) { $LatestVersion = (Invoke-RestMethod -UseBasicParsing -TimeoutSec 5 -ErrorAction Stop https://maven.hytale.com/{{ServerBuildChannel}}/com/hypixel/hytale/Server/maven-metadata.xml).metadata.versioning.latest }; Expand-Archive -LiteralPath ./server.zip -DestinationPath . -Force 2> $null; Start-Sleep -Seconds 1; Set-Content -LiteralPath './Server/.installedversion' -Value $LatestVersion -Encoding UTF8 -NoNewline -Force; Remove-Item -LiteralPath ./server.zip -Force -ErrorAction SilentlyContinue *> $null }\"", |
| 58 | + "UpdateSourceArgs": "-NoProfile -Command \"$ProgressPreference='SilentlyContinue'; [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; Set-Location -Path '{{$FullRootDir}}'; $LatestVersion = (Invoke-RestMethod -UseBasicParsing -TimeoutSec 5 -ErrorAction Stop https://maven.hytale.com/{{ServerBuildChannel}}/com/hypixel/hytale/Server/maven-metadata.xml).metadata.versioning.latest; if (-not [string]::IsNullOrEmpty($LatestVersion) -and $LatestVersion -notmatch '^[0-9]{4}\\.[0-9]{2}\\.[0-9]{2}-[a-fA-F0-9]+$') { $LatestVersion = '' }; if (Test-Path -LiteralPath './Server/.installedversion' -PathType Leaf) { $InstalledVersion = Get-Content -LiteralPath './Server/.installedversion' -Raw -ErrorAction SilentlyContinue; if ($InstalledVersion -match '^[0-9]{4}\\.[0-9]{2}\\.[0-9]{2}-[a-fA-F0-9]+$' -and $InstalledVersion -eq $LatestVersion) { Write-Output \\\"Latest Hytale {{ServerBuildChannel}} version $LatestVersion already installed. Skipping\\\"; exit 0 } }; $err = ''; $rc = 1; for ($attempt = 1; $attempt -le 2; $attempt++) { $tmp = Join-Path $env:TEMP ([IO.Path]::GetRandomFileName()); $p = Start-Process -FilePath './hytale-downloader-windows-amd64.exe' -ArgumentList @('-patchline','{{ServerBuildChannel}}','-download-path','./server.zip') -NoNewWindow -Wait -PassThru -RedirectStandardError $tmp; $rc = $p.ExitCode; $err = (Get-Content -LiteralPath $tmp -Raw -ErrorAction SilentlyContinue); Remove-Item -LiteralPath $tmp -Force -ErrorAction SilentlyContinue *> $null; if ($rc -eq 0) { break }; if ($attempt -eq 1 -and -not [string]::IsNullOrEmpty($err) -and (Test-Path -LiteralPath './.hytale-downloader-credentials.json' -PathType Leaf)) { Remove-Item -LiteralPath './.hytale-downloader-credentials.json' -Force -ErrorAction SilentlyContinue *> $null; continue }; break }; if ($rc -ne 0) { Write-Output \\\"$err\\\"; Write-Output \\\"Download failed from the Hytale CDN. This is a fault with the CDN or the download, not AMP. Aborting\\\"; exit 1 }; Start-Sleep -Seconds 1; if (Test-Path -LiteralPath './server.zip' -PathType Leaf) { if ([string]::IsNullOrEmpty($LatestVersion)) { $LatestVersion = (Invoke-RestMethod -UseBasicParsing -TimeoutSec 5 -ErrorAction Stop https://maven.hytale.com/{{ServerBuildChannel}}/com/hypixel/hytale/Server/maven-metadata.xml).metadata.versioning.latest }; Expand-Archive -LiteralPath ./server.zip -DestinationPath . -Force 2> $null; Start-Sleep -Seconds 1; Set-Content -LiteralPath './Server/.installedversion' -Value $LatestVersion -Encoding UTF8 -NoNewline -Force; Remove-Item -LiteralPath ./server.zip -Force -ErrorAction SilentlyContinue *> $null }\"", |
59 | 59 | "UpdateSourceConditionSetting": "disable-server-download", |
60 | 60 | "UpdateSourceConditionValue": "false", |
61 | 61 | "ProcessToolOutput": true, |
|
0 commit comments