Last active
February 3, 2021 14:10
-
-
Save Regenhardt/a36cfda257d47d59940ab4ce85c377d4 to your computer and use it in GitHub Desktop.
Bash script to automatically update a teamspeak server in a given directory
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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