A lightweight script to install or update a TeamSpeak 3 server on Linux or FreeBSD. Should also work on macOS (currently untested).
- jq 1.4 or newer (https://stedolan.github.io/jq/download/)
- curl
- shasum, sha256, or sha256sum
- tar
- bzip2
All other dependencies (basename, cd, command, cut, dirname, echo, grep, mktemp, printf, read, sed, test, touch, uname, wc, and an sh-compatible shell) are installed by default on most systems.
Place the script where you want to install the TS server, make it executable with chmod +x ts3updater.sh
and run it with ./ts3updater.sh
. After the installation, the script moves itself into the installation folder. Run it from there whenever you want to update the server.
Place the script in the directory of your existing TS installation. This means, the script has to be in the same directory as for example the file ts3server_startscript.sh
. Make it executable with chmod +x ts3updater.sh
and run it with ./ts3updater.sh
.
If you use TSDNS, make sure the service is stopped before you execute this script.
As the server is only updated if a new version is available, you can also use the script to automate updates. Simply create a cronjob which executes the script for instance hourly or daily.
A crontab entry to run ts3updater daily at 13:28 could look like this: 28 13 * * * /home/ts/teamspeak3-server_linux_amd64/ts3updater.sh
. Append >/dev/null 2>&1
if you don't want to get a mail each time the script is run.
You must accept the server license agreement before you create the cronjob. To do so, go to the directory of your TS installation, read the file LICENSE
and create a file called .ts3server_license_accepted
.
All parameters are passed to ts3server_startscript.sh
when the server is started. If you don't want to start the server after installing or updating, use the parameter --dont-start
.
- Determine the OS and CPU architecture
- Check if there is an existing installation and determine its version
- Check for newer versions
- If there is a newer version:
- Download the new version
- Check whether the checksum is correct
- Stop the server
- Extract the updated files into the server directory
- Start the server