Skip to content

Commit

Permalink
Merge branch 'main' into Change-restore-order
Browse files Browse the repository at this point in the history
  • Loading branch information
thijsvanloef authored Nov 17, 2024
2 parents a6d85fc + 4a7eebc commit ca49475
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.23.2-alpine AS rcon-cli_builder
FROM golang:1.23.3-alpine AS rcon-cli_builder

ARG RCON_VERSION="0.10.3"
ARG RCON_TGZ_SHA1SUM=33ee8077e66bea6ee097db4d9c923b5ed390d583
Expand All @@ -20,7 +20,7 @@ RUN wget -q https://github.com/gorcon/rcon-cli/archive/refs/tags/v${RCON_VERSION
FROM cm2network/steamcmd:root AS base-amd64
# Ignoring --platform=arm64 as this is required for the multi-arch build to continue to work on amd64 hosts
# hadolint ignore=DL3029
FROM --platform=arm64 sonroyaalmerol/steamcmd-arm64:root-2024-10-20 AS base-arm64
FROM --platform=arm64 sonroyaalmerol/steamcmd-arm64:root-2024-11-17 AS base-arm64

ARG TARGETARCH
# Ignoring the lack of a tag here because the tag is defined in the above FROM lines
Expand Down
13 changes: 13 additions & 0 deletions scripts/restore.sh
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,19 @@ if [ -f "$BACKUP_FILE" ]; then
# Decompress the backup file in tmp directory
tar -zxvf "$BACKUP_FILE" -C "$TMP_PATH"

# Find backup folders
mapfile -t backup_folders < <(find "$RESTORE_PATH" -name "backup" -type d | sed "s|^$RESTORE_PATH||")

# Check if backup folder parents exist in restore
for backup_folder in "${backup_folders[@]}"
do
backup_folder_dirname=$( dirname "$backup_folder" )
if [ -d "$TMP_PATH/$backup_folder_dirname" ]; then
# Move backup folder into restore
mv "$RESTORE_PATH/$backup_folder_dirname/backup" "$TMP_PATH/$backup_folder_dirname"
fi
done

# Make sure Saves with a different ID are removed before restoring the save
rm -rf "$RESTORE_PATH/Saved/"

Expand Down

0 comments on commit ca49475

Please sign in to comment.