-
Notifications
You must be signed in to change notification settings - Fork 7
/
startup.sh
executable file
·34 lines (28 loc) · 1.09 KB
/
startup.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/bin/bash
FOXTROT_CONFIG_FILE=/config/docker.yml
if [ -z "${CONFIG_PATH}" ]; then
echo "No CONFIG_PATH defined. We shall be using default config from ${FOXTROT_CONFIG_FILE}"
else
if [ -f ${FOXTROT_CONFIG_FILE} ]; then
FOXTROT_CONFIG_FILE=${CONFIG_PATH}
else
echo "Defined CONFIG_PATH (${CONFIG_PATH}) doesn ot look like a proper file. Using default: ${FOXTROT_CONFIG_FILE}"
fi
fi
if [ -z "${INIT_SLEEP}" ]; then
echo "No initial sleep specified.. Foxtrot will start up immediately"
else
echo -e "Init sleep of ${INIT_SLEEP} seconds specified. Waiting..."
sleep ${INIT_SLEEP}
echo "done"
fi
INIT_COMMAND="java -jar server.jar initialize ${FOXTROT_CONFIG_FILE}"
EXEC_CMD="java -Dfile.encoding=utf-8 -XX:+${GC_ALGO-UseG1GC} -Xms${JAVA_PROCESS_MIN_HEAP-1g} -Xmx${JAVA_PROCESS_MAX_HEAP-1g} ${JAVA_OPTS} -jar server.jar server ${FOXTROT_CONFIG_FILE}"
if [ -z "${SKIP_INIT}" ]; then
echo "Executing Init Command: ${INIT_COMMAND}"
$INIT_COMMAND
else
echo "Skipping Init as $SKIP_INIT was set"
fi
echo "Starting foxtrot with command line: ${EXEC_CMD}"
$EXEC_CMD