steam-dontstarve/entrypoint.sh

40 lines
1,022 B
Bash
Raw Normal View History

2018-04-15 21:40:50 +02:00
#!/bin/bash
# what are we trying to install?
game_nm="DST"
game_id=343050
cluster_name="Zom.bi"
dontstarve_dir="$HOME/.klei/DoNotStarveTogether"
# install game to this directory
installdir=/home/steam/games/$game_nm
# if path does not exist, create it
mkdir -p $installdir
if [[ -w $installdir ]] # can we write into the directory?
then
# Install or update the game in /home/steam/games/[game name]
/opt/steamcmd/steamcmd.sh \
+login anonymous \
+force_install_dir $installdir \
+app_update $game_id validate \
+quit
else
# install dir maybe mounted read-only, simply
# skip installing/updating and inform the user.
echo "Skipped game installation."
fi
# run the next commands from the installdir
cd $installdir/bin
2018-04-15 21:59:10 +02:00
run_shared=(screen -S DST ./dontstarve_dedicated_server_nullrenderer)
2018-04-15 21:40:50 +02:00
run_shared+=(-console)
run_shared+=(-cluster "$cluster_name")
run_shared+=(-monitor_parent_process $$)
"${run_shared[@]}" -shard Caves | sed 's/^/Caves: /' &
"${run_shared[@]}" -shard Master | sed 's/^/Master: /'