Skip to content

Instantly share code, notes, and snippets.

@dubs3c
Created October 12, 2015 19:14
Show Gist options
  • Save dubs3c/0ccc5fbec963cd04f952 to your computer and use it in GitHub Desktop.
Save dubs3c/0ccc5fbec963cd04f952 to your computer and use it in GitHub Desktop.
Teamspeak 3 install
#!/bin/bash
# Make sure only root can run our script
if [[ $EUID -ne 0 ]]; then
echo "[-] This script must be run as root"
exit 1
fi
# Download teamspeak
wget http://dl.4players.de/ts/releases/3.0.11.4/teamspeak3-server_linux-amd64-3.0.11.4.tar.gz
# Add a teamspeak user that will run the software
adduser --quiet --disabled-login teamspeak3
# Unpack the tar file
tar xzf teamspeak3-server_linux-amd64-3.0.11.4.tar.gz
mv teamspeak3-server_linux-amd64 /usr/local/teamspeak3
INIT_SCRIPT=/etc/init.d/teamspeak3
touch $INIT_SCRIPT
cat > $INIT_SCRIPT <<- EOM
#!/bin/sh
su -c "/usr/local/teamspeak3/ts3server_startscript.sh $@" teamspeak3
EOM
chown -R teamspeak3 /usr/local/teamspeak3
chmod u+x /etc/init.d/teamspeak3
update-rc.d teamspeak3 defaults
service teamspeak3 start
rm -rf teamspeak3-server_linux-amd64-3.0.11.4.tar.gz
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment