Skip to content

Commit 98ed85c

Browse files
committed
Moved start.sh copying to later state of the entry
Moved token exporting inside the if statments
1 parent 30284d1 commit 98ed85c

File tree

2 files changed

+16
-10
lines changed

2 files changed

+16
-10
lines changed

entrypoint.sh

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,6 @@ echo " "
2121
detect_architecture
2222
setup_environment
2323

24-
# Copy start.sh template to /home/container
25-
logger info "Copying start.sh template to /home/container..."
26-
cp -f /usr/local/bin/start.sh start.sh
27-
chmod 755 start.sh
28-
2924
setup_backup_directory
3025
ensure_downloader
3126

@@ -43,6 +38,11 @@ if [ -n "$OVERRIDE_SESSION_TOKEN" ] && [ -n "$OVERRIDE_IDENTITY_TOKEN" ]; then
4338
logger info "Using provided session and identity tokens..."
4439
SESSION_TOKEN="$OVERRIDE_SESSION_TOKEN"
4540
IDENTITY_TOKEN="$OVERRIDE_IDENTITY_TOKEN"
41+
42+
# Export the session tokens so they're available to start.sh
43+
export SESSION_TOKEN
44+
export IDENTITY_TOKEN
45+
4646
else
4747
# Default to persistent authentication if not specified, this is needed for backwards combability
4848
if [ -z "$USE_PERSISTENT_AUTHENTICATION" ]; then
@@ -70,16 +70,22 @@ else
7070
# Perform full authentication if no valid cache exists
7171
perform_authentication
7272
fi
73+
74+
# Export the session tokens so they're available to start.sh
75+
export SESSION_TOKEN
76+
export IDENTITY_TOKEN
77+
7378
fi
7479
fi
7580

76-
# Export the session tokens so they're available to start.sh
77-
export SESSION_TOKEN
78-
export IDENTITY_TOKEN
79-
8081
# Enforce file and folder permissions if enabled
8182
enforce_permissions
8283

84+
# Copy start.sh template to /home/container
85+
logger info "Copying start.sh template to /home/container..."
86+
cp -f /usr/local/bin/start.sh start.sh
87+
chmod 755 start.sh
88+
8389
logger info "Starting Hytale server..."
8490

8591
# Convert startup variables to from {{VARIABLE}} to ${VARIABLE} for the evaluating

start.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,5 +103,5 @@ fi
103103
JAVA_CMD="${JAVA_CMD} --bind 0.0.0.0:${SERVER_PORT}"
104104

105105
# Execute the command
106-
#echo $JAVA_CMD
106+
#echo "$JAVA_CMD"
107107
eval $JAVA_CMD

0 commit comments

Comments
 (0)