1
0

added downloader self check

Signed-off-by: Peter Siegmund <developer@mars3142.org>
This commit is contained in:
2026-01-17 16:10:33 +01:00
parent bdcfc9ab6d
commit bb4fa86a0d

View File

@@ -18,8 +18,18 @@ cd "$HYTALE_DIR"
log "Starting update check..."
# Run the updater to check for and download updates
# The updater downloads files like "2026-01-17-abcdef.zip"
./hytale-downloader-linux-amd64 2>&1 | tee -a "$LOG_FILE"
# The updater downloads files like "2026.01.17-abcdef.zip"
DOWNLOADER_OUTPUT=$(./hytale-downloader-linux-amd64 2>&1 | tee -a "$LOG_FILE")
# Check if the downloader itself needs an update
if echo "$DOWNLOADER_OUTPUT" | grep -q "A new version of hytale-downloader is available"; then
log "Downloading new version of hytale-downloader..."
curl -sL -o hytale-downloader.zip "https://downloader.hytale.com/hytale-downloader.zip"
unzip -o hytale-downloader.zip -d "$HYTALE_DIR"
chmod +x "$HYTALE_DIR/hytale-downloader-linux-amd64"
rm -f hytale-downloader.zip
log "Downloader updated successfully."
fi
# Find the newest zip file (pattern: YYYY.MM.DD-*.zip)
NEWEST_ZIP=$(ls -t [0-9][0-9][0-9][0-9].[0-9][0-9].[0-9][0-9]-*.zip 2>/dev/null | head -n1)