-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathstartSunkenland.sh
47 lines (37 loc) · 1.26 KB
/
startSunkenland.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
#!/usr/bin/env bash
set -e
# Check if .X1-lock file exists and remove. Otherwise Xvfb cannot start.
if test -f /tmp/.X1-lock; then
rm /tmp/.X1-lock
fi
_terminate() {
echo "Caught signal!"
/etc/init.d/xvfb stop
}
trap _terminate HUP INT QUIT TERM
if [ -z "${GAME_WORLD_GUID}" ]; then
echo "Please set environment variable 'GAME_WORLD_GUID', game cannot start otherwise."
exit 1
fi
if [ -z "${GAME_REGION}" ]; then
GAME_REGION=eu
fi
if [[ ${GAME_MAX_PLAYER} =~ ^[0-9]+$ ]]; then
MAX_PLAYER_PARAM="-maxPlayerCapacity ${GAME_MAX_PLAYER}"
fi
if ${GAME_SESSION_INVISIBLE} = true; then
SESSION_INVISIBLE="-makeSessionInvisible true"
fi
if ${GAME_UPDATE} = true; then
if [ -n "${GAME_BETA_VERSION}" ]; then
BETA_VERSION="-beta ${GAME_BETA_VERSION}"
echo "Updating to beta version ${GAME_BETA_VERSION}"
fi
echo "Start game update..."
steamcmd +force_install_dir /${USER_NAME} +login anonymous +@sSteamCmdForcePlatformType windows +app_update ${APP_ID} "${BETA_VERSION}" validate +quit
echo "Game update done"
fi
/etc/init.d/xvfb start
exec wine Sunkenland-DedicatedServer.exe -nographics -batchmode -worldGuid "${GAME_WORLD_GUID}" ${SESSION_INVISIBLE} \
-password "${GAME_PASSWORD}" ${MAX_PLAYER_PARAM} -region "${GAME_REGION}" &
wait