Skip to content

Instantly share code, notes, and snippets.

@Regenhardt
Last active February 3, 2021 14:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Regenhardt/a36cfda257d47d59940ab4ce85c377d4 to your computer and use it in GitHub Desktop.
Save Regenhardt/a36cfda257d47d59940ab4ce85c377d4 to your computer and use it in GitHub Desktop.
Bash script to automatically update a teamspeak server in a given directory
echo 'Download latest server version'
wget https://teamspeak.com/versions/server.json -qO - | jq '.linux.x86_64.mirrors["teamspeak.com"]' | xargs wget
# unpack
echo 'Unpack'
tar -xjvf teamspeak3-server_linux*.tar.bz2
# backup ts3.sqlitedb
echo "Backup data from $1"
cp $1/ts3server.sqlitedb $1/ts3server.sqlitedb.bak -f
# copy over new stuff
echo "Updating $1"
cp -rf teamspeak3-server_linux_amd64/* $1
# delete unpacked folder and tar
echo 'Removing temporary data'
rm teamspeak3-server_linux* -rf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment