1
0

fix zip file pattern

Signed-off-by: Peter Siegmund <developer@mars3142.org>
This commit is contained in:
2026-01-17 15:52:36 +01:00
parent 45f5069cdd
commit 721fe8fcf0

View File

@@ -21,8 +21,8 @@ log "Starting update check..."
# The updater downloads files like "2026-01-17-abcdef.zip"
./hytale-downloader-linux-amd64 2>&1 | tee -a "$LOG_FILE"
# 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)
# 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)
if [ -z "$NEWEST_ZIP" ]; then
log "No update zip found. Nothing to do."
@@ -61,6 +61,6 @@ systemctl start hytale.service
# Cleanup: keep only the 3 newest zip files
log "Cleaning up old zip files..."
ls -t [0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]-*.zip 2>/dev/null | tail -n +4 | xargs -r rm -f
ls -t [0-9][0-9][0-9][0-9].[0-9][0-9].[0-9][0-9]-*.zip 2>/dev/null | tail -n +4 | xargs -r rm -f
log "Update complete!"