2018-09-19 21:16:51 +02:00
|
|
|
#!/bin/bash
|
2018-09-20 00:24:33 +02:00
|
|
|
|
2018-09-25 16:18:01 +02:00
|
|
|
sleep 5s
|
2018-09-19 21:16:51 +02:00
|
|
|
echo "starting entrypoint.sh"
|
|
|
|
set -e
|
|
|
|
|
2018-09-25 16:18:01 +02:00
|
|
|
cd "$STEAM_PATH"
|
2018-09-25 20:15:40 +02:00
|
|
|
#suggested -disableluarefresh -tickrate 66 +host_workshop_collection -port 27015
|
2018-09-26 10:43:56 +02:00
|
|
|
|
2018-09-25 16:18:01 +02:00
|
|
|
if [ -e "${STEAM_PATH}/gmodserver" ]; then
|
|
|
|
./gmodserver update-lgsm
|
|
|
|
./gmodserver update
|
|
|
|
else
|
|
|
|
bash linuxgsm.sh gmodserver
|
|
|
|
./gmodserver auto-install
|
|
|
|
fi
|
|
|
|
|
2018-09-25 20:15:40 +02:00
|
|
|
cd "/home"
|
|
|
|
echo "check various options"
|
|
|
|
./experimental.sh
|
|
|
|
echo "force workshop download"
|
|
|
|
./forceWorkshopDownload.sh
|
|
|
|
echo "install & mount gamefiles"
|
|
|
|
./installAndMountAddons.sh
|
|
|
|
cd "$STEAM_PATH"
|
2018-09-19 21:16:51 +02:00
|
|
|
|
2018-09-28 14:50:39 +02:00
|
|
|
#docker args -> lgsm args
|
2018-09-26 10:43:56 +02:00
|
|
|
export parms="-game garrysmod +gamemode terrortown "$(printf "%s " "$@")
|
|
|
|
if [ -e "${STEAM_PATH}/lgsm/config-lgsm/gmodserver/gmodserver.cfg" ]; then
|
|
|
|
rm -f "${STEAM_PATH}/lgsm/config-lgsm/gmodserver/gmodserver.cfg"
|
|
|
|
fi
|
|
|
|
mkdir -p "${STEAM_PATH}/lgsm/config-lgsm/gmodserver/"
|
|
|
|
touch "${STEAM_PATH}/lgsm/config-lgsm/gmodserver/gmodserver.cfg"
|
|
|
|
echo "fn_parms(){" > "${STEAM_PATH}/lgsm/config-lgsm/gmodserver/gmodserver.cfg"
|
|
|
|
echo "parms="'"'"$parms"'"' >> "${STEAM_PATH}/lgsm/config-lgsm/gmodserver/gmodserver.cfg"
|
|
|
|
echo "}" >> "${STEAM_PATH}/lgsm/config-lgsm/gmodserver/gmodserver.cfg"
|
|
|
|
echo "starting with $parms"
|
|
|
|
|
2018-09-28 14:50:39 +02:00
|
|
|
#force fetch of command_console.sh
|
|
|
|
if [ ! -e "${STEAM_PATH}/lgsm/functions/command_console.sh" ]; then
|
|
|
|
wget -O "${STEAM_PATH}/lgsm/functions/command_console.sh" "https://raw.githubusercontent.com/GameServerManagers/LinuxGSM/master/lgsm/functions/command_console.sh"
|
|
|
|
chmod +x "${STEAM_PATH}/lgsm/functions/command_console.sh"
|
|
|
|
fi
|
|
|
|
#skip confirmation
|
|
|
|
sed -i 's/! fn_prompt_yn "Continue?" Y/[ "1" != "1" ]/' "${STEAM_PATH}/lgsm/functions/command_console.sh"
|
|
|
|
|
|
|
|
#start server
|
2018-09-25 16:18:01 +02:00
|
|
|
./gmodserver start
|
2018-09-28 14:50:39 +02:00
|
|
|
|
|
|
|
#trap & show console
|
|
|
|
trap 'pkill -15 srcds_run' SIGTERM
|
|
|
|
./gmodserver console
|
|
|
|
# If in background created and wait "$!" => terminal never started -> container exit right after
|