-
Notifications
You must be signed in to change notification settings - Fork 0
/
entry.sh
73 lines (62 loc) · 2 KB
/
entry.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
70
71
mkdir -p "${STEAMAPPDIR}" || true
if [[ ! -d "${HOMEDIR}/css" ]]
then
echo "CSS and TF2 not installed, installing"
# CSS
bash "${STEAMCMDDIR}/steamcmd.sh" +login anonymous \
+force_install_dir "${HOMEDIR}/css" \
+app_update "232330" \
+quit
# TF2
bash "${STEAMCMDDIR}/steamcmd.sh" +login anonymous \
+force_install_dir "${HOMEDIR}/tf2" \
+app_update "232250" \
+quit
fi
# GMOD
bash "${STEAMCMDDIR}/steamcmd.sh" +login anonymous \
+force_install_dir "${STEAMAPPDIR}" \
+app_update "${STEAMAPPID}" \
+quit
# Mount CSS and TF2
cp "${HOMEDIR}/mount.cfg" "${STEAMAPPDIR}/garrysmod/cfg/"
cd ${STEAMAPPDIR}
case "$GAMETYPE" in
"TTT")
echo "Configuring TTT Server"
game_type="terrortown"
workshop_collection="2372649360"
default_map="ttt_minecraftcity_v4" ;;
"Prop")
echo "Configuring PropHunt Server"
game_type="prophunters"
workshop_collection="2372656179"
default_map="ph_lotparking" ;;
# Needs adding
"Murder")
echo "Configuring Murder Server"
game_type="murder"
workshop_collection="2120021421"
default_map="ttt_Clue_se" ;;
"Homicide")
echo "Configuring Homicide Server"
game_type="homicide"
workshop_collection="2372659912"
default_map="ttt_Clue_se" ;;
*)
echo "No gametype was set so running sandbox"
game_type="sandbox"
workshop_collection=""
default_map="gm_flatgrass" ;;
esac
# Run GMOD
bash "${STEAMAPPDIR}/srcds_run" -game "${STEAMAPP}" -console -autoupdate \
-steam_dir "${STEAMCMDDIR}" \
-steamcmd_script "${HOMEDIR}/${STEAMAPP}_update.txt" \
-usercon \
-port "${SRCDS_PORT}" \
+gamemode "$game_type" \
+map "$default_map" \
+host_workshop_collection "$workshop_collection" \
+rcon_password "${RCON_PWD}"
+sv_setsteamaccount "${SRCDS_TOKEN}"