Skip to content

Helper scripts to run and manage Don't Starve Together dedicated servers

Notifications You must be signed in to change notification settings

suppaduppax/dst-dedicated-server-scripts

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 

Repository files navigation

dst-dedicated-server-scripts

A collection of scripts to run and manage Don't Starve Together dedicated servers. This was created to have only a single server active at a time but be able to easily start a server, stop it, and run a different one. This also allows automatic detection and installation of DST updates.

Features:

  • Start/stop DST servers from a menu
  • Automatic DST patch updates
  • Discord notifications

Quick start guide

Prerequisites

This guide does not cover these two steps and assumes it has already been done.

Installation and Setup

Clone the repo to your system. All directories in these instructions will be in the users home directory.

git clone https://github.com/suppaduppax/dst-dedicated-server-scripts

Now go into that directory

cd dst-dedicated-server-scripts

First thing that needs to be done is the settings.conf file needs to be created. Copy the settings.conf.template file as a starting point

cp settings.conf.template settings.conf

Edit the settings to match your environment. For this example we will be using nano but use whichever editor you want to.

nano settings.conf

Here is an example of a working settings file:

/home/user/dst-dedicated-server-scripts/settings.conf

# Do not put anything in quotes
# Do not put any spaces before or after the equals sign
# See http://github.com/suppaduppax/dst-dedicated-server-scripts/ for details

klei_dst_path=/home/user/.klei/DoNotStarveTogether
steamcmd_path=/home/user/steamcmd
dst_bin_path=/home/user/steam/steamapps/common/Don't Starve Together Dedicated Server/bin
discord_webhook=https://discord.com/api/webhooks/ajnddkdibneoekdbbdkeinrmpdojmekediod111dmmwosodb32beoejapqkenn1

# delay the shutdown and announce a warning when a new update is detected (in minutes)
update_shutdown_delay=15
update_shutdown_warning=5

# other settings
log_enabled=true
log_file=dst.log
log_file_max_lines=500
release_file=current-server-version.txt
builds_url=https://s3.amazonaws.com/dstbuilds/builds.json

Variable Description
klei_dst_path The path to the actual server files. Usually found in ~/.klei/DoNotStarveTogether
steamcmd_path The path to the steamcmd file.
dst_bin_path The path to the DST bin directory. By default should be inside the steamcmd folder <steamcmd_path>/steamapps/common/Don't Starve Together/bin
discord_webhook If you want to have discord notifications fill this in. To disable, leave blank discord_webhook=

The other settings are more or less optional so we will skip them for now.

Commands

Command Description
dst-start-server Start a server. This will display a menu of any servers extracted to the klei dst directory. Select the one you want to start
dst-shutdown-server Shutdown the currently running server. Does nothing if there isn't a server that is running
dst-update-server Checks to see if there are any new server updates. If there is a new update detected, it will wait a few minutes (default: 15 min) before shutting the server down. If there are any players logged in, it will display a warning. Once the new update is installed, the server will be started again.
dst-list-servers List all the servers found in the klei dst directory. If any servers are running, it will display a [running] tag beside that server
dst-logs Show the logs of the current running server. A menu will be displayed asking which Shard you want.

To run these commands, go into the bin directory

cd /home/user/dst-dedicated-server-scripts

And run a command. For example to start a server:

./dst-start-server

Note: If you want to run these commands from anywhere or without prefixing with ./ see below.

(Optional) Add scripts bin to user PATH environment

If you want to be able to run the scripts from anywhere, add this line in your ~/.bashrc file:

export PATH="$HOME/dst-dedicated-server-scripts/bin:$PATH"

Make sure to replace $HOME/ with the correct path.

(Optional) Automatic update checking

If you want to check for updates automatically, go into your crontab:

crontab -e

And add the following line:

*/20 * * * * /bin/bash "/home/user/dst-dedicated-server-scripts/bin/dst-check-for-updates"

This checks for updates every 20 minutes. To change the interval simply change */20 to whatever you want. For example if you wanted to check every 40 min, change to */40. Also make sure to change the path to the correct one.

The update script will give a warning in game in case any players are logged in. This is set to a 15 min warning by default and can be changed in the settings.conf file.

About

Helper scripts to run and manage Don't Starve Together dedicated servers

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages