-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathentrypoint.sh
56 lines (46 loc) · 1.42 KB
/
entrypoint.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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#!/bin/bash
##
#
# Variables
# GAME_PATH - Root game path
# STEAMCMD_PATH - SteamCMD path
# USE_SYS_LIBS - Use system libraries instead of the ones created by steamcmd
#
##
# CLI
if [ -z ${GAME_PATH} ];
then
export GAME_PATH=/home/container;
fi
if [ -z ${STEAMCMD_PATH} ];
then
export STEAMCMD_PATH="${GAME_PATH}/steamcmd";
fi
if [ -z ${USE_SYS_LIBS} ];
then
export USE_SYS_LIBS="true"
fi
cd "$GAME_PATH"
sleep 1
# Make internal Docker IP address available to processes.
export INTERNAL_IP=`ip route get 1 | awk '{print $NF;exit}'`
# Update Source Server
if [ ! -z ${SRCDS_APPID} ]; then
if [ ! -z ${SRCDS_BETAID} ]; then
if [ ! -z ${SRCDS_BETAPASS} ]; then
$STEAMCMD_PATH/./steamcmd.sh +login anonymous +force_install_dir "$GAME_PATH" +app_update ${SRCDS_APPID} -beta ${SRCDS_BETAID} -betapassword ${SRCDS_BETAPASS} +quit
else
$STEAMCMD_PATH/./steamcmd.sh +login anonymous +force_install_dir "$GAME_PATH" +app_update ${SRCDS_APPID} -beta ${SRCDS_BETAID} +quit
fi
else
$STEAMCMD_PATH/./steamcmd.sh +login anonymous +force_install_dir "$GAME_PATH" +app_update ${SRCDS_APPID} +quit
fi
fi
if [ "$USE_SYS_LIBS" = "true" ]; then
rm "${GAME_PATH}/bin/libstdc++.so.6" | true
fi
# Replace Startup Variables
MODIFIED_STARTUP=`eval echo $(echo ${STARTUP} | sed -e 's/{{/${/g' -e 's/}}/}/g')`
echo ":$GAME_PATH$ ${MODIFIED_STARTUP}"
# Run the Server
eval ${MODIFIED_STARTUP}