Skip to content

Instantly share code, notes, and snippets.

@maltechx
Created April 9, 2020 10:15
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 maltechx/5cd26ce77d084db1c1d849f31f71f98a to your computer and use it in GitHub Desktop.
Save maltechx/5cd26ce77d084db1c1d849f31f71f98a to your computer and use it in GitHub Desktop.
Short script for creating a backup an updating Teamspeak server automatically.
# Upgrade for Teamspeak Server
# Call this script with eg. bash update-teamspeak.sh 3.12.1
# Please set absolute paths!
# Set here your server directory
TSPATH=/home/teamspeak
# Path where server gets backuped befor upgrade
BACKUPPATH=/backup
if [ -z "$1" ]; then
echo "No version number given."
elif [[ $1 =~ [[:digit:]]{1,2}\.[[:digit:]]{1,2}\.[[:digit:]]{1,2} ]]; then
echo "Start upgrade"
wget -O /tmp/teamspeak3-server_linux-amd64.tar.bz2 https://files.teamspeak-services.com/releases/server/$1/teamspeak3-server_linux_amd64-$1.tar.bz2
systemctl stop teamspeak.service
tar -czvf $BACKUPPATH/ts3_backup_before_$1.tar.gz $TSPATH
tar -xjf /tmp/teamspeak3-server_linux-amd64.tar.bz2 -C $TSPATH/
chown -R teamspeak:teamspeak $TSPATH
systemctl start teamspeak.service
rm -r /tmp/teamspeak3-server_linux-amd64.tar.bz2
else
echo "Invalid version number given"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment