diff --git a/hytale-update.sh b/hytale-update.sh index 7736b11..d8c1caa 100644 --- a/hytale-update.sh +++ b/hytale-update.sh @@ -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!"