Teamspeak init.d script to automatic start ts3 server on boot as diferent user.
##Requirements
- debian based OS
- sudoers (
apt-get install sudo
) - nano editor (
sudo apt-get install nano
) - create folder (
mkdir /opt/ts3server/
) - go to (
cd /opt/ts3server/
) í downloaded latest version of teamspeak3server - download (
wget https://files.teamspeak-services.com/releases/server/3.12.0/teamspeak3-server_linux_amd64-3.12.0.tar.bz2
) - extract (
tar xvf teamspeak3-server_linux_amd64-3.12.0.tar.bz2
) - remove archive (
rm teamspeak3-server_linux_amd64-3.12.0.tar.bz2
) - move to head folder (
mv -v /opt/ts3server/teamspeak3-server_linux_amd64/* /opt/ts3server/
) - create accept license (
touch .ts3server_license_accepted
) after read LICENSE file - create user teamspeak (
sudo adduser --disabled-login teamspeak
) - change folder permissions (
sudo chown teamspeak:teamspeak -R /opt/ts3server
) - login teamspeak (
su teamspeak
) - start ts3server (
sh ts3server_startscript.sh start
) - (copy topken and serveradmin pass)
- login root and continue to create autostart script... (
su root
)
##How to build
-
Terminal/Console:
cd /etc/init.d
nano ts3server
-
paste/rewrite code from ts3server file ts3server
-
CTRL+X
-
Y (name:ts3server)
-
ENTER
-
Terminal/Console:
sudo chmod 755 /etc/init.d/ts3server
-
Terminal/Console:
sudo update-rc.d ts3server defaults
-
Terminal/Console:
systemctl reboot
##Commands
stop TeamSpeak 3 Server : systectl stop ts3server
start TeamSpeak 3 Server : systectl start ts3server
If you change /etc/init.d/ts3server file ---> systemctl daemon-reload
& sudo update-rc.d ts3server defaults
if not work: change file permission /chmod/ to 777 ts3server_startscript.sh & ts3server_minimal_runscript.sh