-
Notifications
You must be signed in to change notification settings - Fork 8
/
entrypoint.sh
executable file
·64 lines (51 loc) · 1.53 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
57
58
59
60
61
62
63
64
#!/bin/bash
# Auto update flag not working on L4D
if [ "${INSTALL_DIR}" = "l4d" ]; then
./steamcmd.sh +runscript update.txt
fi
cd "${INSTALL_DIR}" || exit 50
if [ $# -gt 0 ]; then
./srcds_run "$@"
else
STARTUP=("./srcds_run")
if [ "${INSTALL_DIR}" = "l4d2" ]; then
STARTUP+=("-autoupdate -steam_dir $HOME -steamcmd_script $HOME/update.txt")
fi
STARTUP+=("+sv_logecho 1")
STARTUP+=("+motd_enabled 0")
STARTUP+=("+hostname \"${HOSTNAME}\"")
STARTUP+=("+sv_region ${REGION}")
if [ "${STEAM_GROUP}" -gt 0 ]; then
STARTUP+=("+sv_steamgroup ${STEAM_GROUP}")
if [ "${STEAM_GROUP_EXCLUSIVE}" ] ; then
STARTUP+=("+sv_steamgroup_exclusive 1")
fi
fi
STARTUP+=("+map \"$DEFAULT_MAP $DEFAULT_MODE\"")
if [ -n "${GAME_TYPES}" ]; then
STARTUP+=("+sv_gametypes \"${GAME_TYPES}\"")
fi
if [ "${FORK:-0}" -gt 0 ]; then
STARTUP+=("-fork ${FORK} +exec server##.cfg")
else
if [ "${PORT:-0}" -gt 0 ]; then
STARTUP+=("-port $PORT")
fi
fi
if [ "${LAN}" ] ; then
STARTUP+=("+sv_lan 1")
fi
if [ -n "${RCON_PASSWORD}" ]; then
STARTUP+=("+rcon_password \"${RCON_PASSWORD}\"")
fi
if [ "${NET_CON_PORT:-0}" -gt 0 ]; then
STARTUP+=("-netconport ${NET_CON_PORT}")
if [ -n "${NET_CON_PASSWORD}" ]; then
STARTUP+=("-netconpassword \"${NET_CON_PASSWORD}\"")
fi
fi
if [ -n "${EXTRA_ARGS}" ]; then
STARTUP+=("${EXTRA_ARGS}")
fi
${STARTUP[*]}
fi