-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun.sh
More file actions
48 lines (40 loc) · 1.53 KB
/
run.sh
File metadata and controls
48 lines (40 loc) · 1.53 KB
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
#!/bin/bash
set -e
# change the working directory
cd "${GAMEFILESDIR}"
# construction logic
if ! [[ "${SKIPUPDATE,,}" == "true" ]]; then
if [[ "${STEAMBETA,,}" == "true" ]]; then
printf "Staging flag is set. Staging will be downloaded instead of Main.\\n"
STEAMBETAFLAG=" -beta staging validate"
fi
space=$(stat -f --format="%a*%S" .)
space=$((space/1024/1024/1024))
printf "Checking available space...%sGB detected\\n" "${space}"
if [[ "$space" -lt 5 ]]; then
printf "You have less than 5GB (%sGB detected) of available space to download the game.\\nIf this is a fresh install, it will probably fail.\\n" "${space}"
fi
printf "Downloading the latest version of the game...\\n"
/home/steam/steamcmd/steamcmd.sh +force_install_dir /config/gamefiles +login anonymous +app_update "$STEAMAPPID" $STEAMBETAFLAG +quit
else
printf "Skipping update as flag is set\\n"
fi
# Create variable for log string
now=$(date +"%Y-%m-%d-%H-%M-%S")
# start the server
exec "${GAMEFILESDIR}/RustDedicated" batchmode \
+server.port $SERVERPORT \
+server.worldsize $SERVERWORLDSIZE \
+server.maxplayers $MAXPLAYERS \
+server.hostname "${SERVERHOSTNAME}" \
+server.description "${SERVERDESCRIPTION}" \
+server.saveinterval $SERVERSAVEINTERVAL \
+server.seed $SERVERSEED \
+server.eac $SERVEREAC \
+server.pve $SERVERPVEMODE \
+server.steamgroup $SERVERSTEAMGROUP
+server.identity "docker" \
+rcon.port $RCONSERVERPORT \
+rcon.password "${RCONSERVERPASSWORD}" \
+rcon.web $RCONMODE \
logfile "${GAMELOGDIR}/${now}.txt"