From 58247b3153973c965bdb9503cdf6d40da7a84bad Mon Sep 17 00:00:00 2001 From: NATroutter Date: Wed, 14 Jan 2026 15:53:20 +0200 Subject: [PATCH] Added backup folder creating to entry Added Support for arguments "Boot Command", "Force network flush", "event debug" --- entry.sh | 14 ++++++++++++++ start.sh | 13 +++++++++++++ 2 files changed, 27 insertions(+) diff --git a/entry.sh b/entry.sh index 0690171..9e0a7a8 100644 --- a/entry.sh +++ b/entry.sh @@ -286,6 +286,20 @@ echo "Copying start.sh template to /home/container..." cp /usr/local/bin/start.sh /home/container/start.sh chmod 755 /home/container/start.sh +# Check if the backup directory exists +if [ ! -d "/home/container/backup" ]; then + echo "Backup directory does not exist. Creating it..." + mkdir -p /home/container/backup + + if [ $? -ne 0 ]; then + echo "Failed to create backup directory: /backup" + exit 1 + fi +else + echo "Backup directory already exists." +fi +chmod -R 755 /home/container/backup + # Check if the downloader exists if [ ! -f "$DOWNLOADER" ]; then echo "Error: Hytale downloader not found!" diff --git a/start.sh b/start.sh index fa8ccd1..32b9388 100644 --- a/start.sh +++ b/start.sh @@ -55,6 +55,18 @@ if [ "${DISABLE_SENTRY}" = "1" ]; then JAVA_CMD="${JAVA_CMD} --disable-sentry" fi +if [ -n "${BOOT_COMMANDS}" ]; then + JAVA_CMD="${JAVA_CMD} --boot-command ${BOOT_COMMANDS}" +fi + +if [ "${FORCE_NETWORK_FLUSH}" = "1" ]; then + JAVA_CMD="${JAVA_CMD} --force-network-flush" +fi + +if [ "${EVENT_DEBUG}" = "1" ]; then + JAVA_CMD="${JAVA_CMD} --event-debug" +fi + # Add backup parameters if enabled if [ "${ENABLE_BACKUPS}" = "1" ]; then JAVA_CMD="${JAVA_CMD} --backup --backup-dir ./backup --backup-frequency ${BACKUP_FREQUENCY} --backup-max-count ${MAXIMUM_BACKUPS}" @@ -69,4 +81,5 @@ JAVA_CMD="${JAVA_CMD} --owner-uuid ${PROFILE_UUID}" JAVA_CMD="${JAVA_CMD} --bind 0.0.0.0:${SERVER_PORT}" # Execute the command +echo $JAVA_CMD eval $JAVA_CMD \ No newline at end of file