forked from TrueOsiris/docker-vrising
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstart.sh
executable file
·51 lines (50 loc) · 1.82 KB
/
start.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
#!/bin/bash
s=/mnt/vrising/server
p=/mnt/vrising/persistentdata
echo "Setting timezone to $TZ"
echo "$TZ" > /etc/timezone 2>&1
ln -snf /usr/share/zoneinfo/"$TZ" /etc/localtime 2>&1
dpkg-reconfigure -f noninteractive tzdata 2>&1
#What is this supposed to do?
if [ -z "$SERVERNAME" ]; then
SERVERNAME="VRising Dedicated Server - Docker"
fi
if [ -z "$WORLDNAME" ]; then
WORLDNAME="world1"
fi
game_port=""
if [ -n "$GAMEPORT" ]; then
game_port=" -gamePort $GAMEPORT"
fi
query_port=""
if [ -n "$QUERYPORT" ]; then
query_port=" -queryPort $QUERYPORT"
fi
mkdir -p /root/.steam 2>/dev/null
chmod -R 777 /root/.steam 2>/dev/null
echo " "
echo "Updating V-Rising Dedicated Server files..."
echo " "
/usr/bin/steamcmd +force_install_dir "$s" +login anonymous +app_update 1829350 +quit
echo "steam_appid: $(cat $s/steam_appid.txt)"
echo " "
mkdir "$p/Settings" 2>/dev/null
if [ ! -f "$p/Settings/ServerGameSettings.json" ]; then
echo "$p/Settings/ServerGameSettings.json not found. Copying default file."
cp "$s/VRisingServer_Data/StreamingAssets/Settings/ServerGameSettings.json" "$p/Settings/" 2>&1
fi
if [ ! -f "$p/Settings/ServerHostSettings.json" ]; then
echo "$p/Settings/ServerHostSettings.json not found. Copying default file."
cp "$s/VRisingServer_Data/StreamingAssets/Settings/ServerHostSettings.json" "$p/Settings/" 2>&1
fi
cd "$s" || return
echo "Starting V Rising Dedicated Server with name $SERVERNAME"
echo "Trying to remove /tmp/.X0-lock"
rm /tmp/.X0-lock 2>&1
echo " "
echo "Starting Xvfb"
Xvfb :0 -screen 0 1024x768x16 &
echo "Launching wine64 V Rising"
echo " "
DISPLAY=:0.0 wine64 /mnt/vrising/server/VRisingServer.exe -persistentDataPath $p -serverName "$SERVERNAME" -saveName "$WORLDNAME" -logFile "$p/VRisingServer.log" "$game_port" "$query_port" 2>&1
/usr/bin/tail -f /mnt/vrising/persistentdata/VRisingServer.log