-
Notifications
You must be signed in to change notification settings - Fork 12
/
startup.sh
executable file
·69 lines (59 loc) · 1.92 KB
/
startup.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
65
66
67
68
69
#!/bin/bash
PUID=${PUID:-911}
PGID=${PGID:-911}
groupmod -o -g "$PGID" steam
usermod -o -u "$PUID" steam
echo "
-------------------------------------
GID/UID
-------------------------------------
User uid: $(id -u steam)
User gid: $(id -g steam)
-------------------------------------
"
chown steam:steam -R /home/steam
echo "
-------------------------------------
Updating application
-------------------------------------
"
set -x
su steam -c "${STEAMCMDDIR}/steamcmd.sh +@sSteamCmdForcePlatformType windows +force_install_dir ${STEAMAPPDIR} +login anonymous +app_update ${STEAMAPPID} validate +quit"
echo "
------------------------------------
Updating mods
------------------------------------
"
STEAMSERVERID=440900
GAMEMODDIR=${STEAMAPPDIR}/ConanSandbox/Mods
GAMEMODLIST=${GAMEMODDIR}/modlist.txt
if [ ! -f ${STEAMAPPDIR}/modlist.txt ]; then
echo "No modlist, creating empty ${STEAMAPPDIR}/modlist.txt"
touch ${STEAMAPPDIR}/modlist.txt
fi
# Clear server modlist so we don't end up with duplicates
echo "" > ${GAMEMODLIST}
MODS=$(awk '{print $1}' ${STEAMAPPDIR}/modlist.txt)
MODCMD="${STEAMCMDDIR}/steamcmd.sh +@sSteamCmdForcePlatformType windows +login anonymous"
for MODID in ${MODS}
do
echo "Adding $MODID to update list..."
MODCMD="${MODCMD} +workshop_download_item ${STEAMSERVERID} ${MODID}"
done
MODCMD="${MODCMD} +quit"
su steam -c "${MODCMD}"
echo "Linking mods..."
mkdir -p ${GAMEMODDIR}
for MODID in ${MODS}
do
echo "Linking $MODID..."
MODDIR=/home/steam/Steam/steamapps/workshop/content/${STEAMSERVERID}/${MODID}/
find "${MODDIR}" -iname '*.pak' >> ${GAMEMODLIST}
done
echo "
-------------------------------------
Starting server
-------------------------------------
"
# su steam -c "xvfb-run --auto-servernum --server-args='-screen 0 640x480x24:32' wine ${STEAMAPPDIR}/ConanSandboxServer.exe -log -nosteam"
su steam -c "xvfb-run --auto-servernum wine ${STEAMAPPDIR}/ConanSandboxServer.exe ${CONAN_ARGS}"