fix zip file pattern
Signed-off-by: Peter Siegmund <developer@mars3142.org>
This commit is contained in:
@@ -21,8 +21,8 @@ log "Starting update check..."
|
|||||||
# The updater downloads files like "2026-01-17-abcdef.zip"
|
# The updater downloads files like "2026-01-17-abcdef.zip"
|
||||||
./hytale-downloader-linux-amd64 2>&1 | tee -a "$LOG_FILE"
|
./hytale-downloader-linux-amd64 2>&1 | tee -a "$LOG_FILE"
|
||||||
|
|
||||||
# Find the newest zip file (pattern: YYYY-MM-DD-*.zip)
|
# 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)
|
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
|
if [ -z "$NEWEST_ZIP" ]; then
|
||||||
log "No update zip found. Nothing to do."
|
log "No update zip found. Nothing to do."
|
||||||
@@ -61,6 +61,6 @@ systemctl start hytale.service
|
|||||||
|
|
||||||
# Cleanup: keep only the 3 newest zip files
|
# Cleanup: keep only the 3 newest zip files
|
||||||
log "Cleaning up old 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!"
|
log "Update complete!"
|
||||||
|
|||||||
Reference in New Issue
Block a user