• Be part of the TeaParty!
    Click here for more information

Server TeaSpeak Server autostart Skript – Debian / Ubuntu Linux

BIOS

TeaSpeak Team
Staff member
TeaTeam
Teaspeak Create a start / stop script

Create / fill in /etc/init.d/teaspeak with your favorite editor. The path and the user must be adjusted accordingly. Since I have taken from the comments that not everyone here with vi experiences, you should perhaps use a different editor (joe or nano). Short vi instructions: (with "i" you get into the insert mode, because the script can be copied in, with "ESC: q" the VI is stopped and saved)


Code:
vi /etc/init.d/teaspeak
insert

Code:
#!/bin/sh
### BEGIN INIT INFO
# Provides:         teaspeak
# Required-Start:     $local_fs $network
# Required-Stop:    $local_fs $network
# Default-Start:     2 3 4 5
# Default-Stop:     0 1 6
# Description:         Teaspeak Server
### END INIT INFO


# INIT Script by BIOS
######################################
# Customize values for your needs: "User"; "DIR"

USER="yourusername"
DIR="pfadtoteaspeakdir"

###### Teaspeak server start/stop script ######

case "$1" in
start)
su $USER -c "${DIR}/teastart_minimal.sh start"
;;
stop)
su $USER -c "${DIR}/teastart_minimal.sh stop"
;;
restart)
su $USER -c "${DIR}/teastart_minimal.sh restart"
;;
*)
echo "Usage: {start|stop|restart}" >&2
exit 1
;;
esac
exit 0
Make script executable:

Code:
chmod 755 /etc/init.d/teaspeak
The script is ready and needs to be defined as an autostart:

Code:
update-rc.d teaspeak defaults
The next reboot will start the Teaspeak server automatically.

Options of the script start / stop / restart:

Teaspeak Server start:

Code:
/etc/init.d/teaspeak start
Teaspeak Server stop:

Code:
/etc/init.d/teaspeak  stop
Teaspeak Server restart:

Code:
/etc/init.d/teaspeak  restart
 
Last edited:

WolverinDEV

TeaSpeak Team
Staff member
Administrator
Well, nice script but you've several flaws:
1. Title
2. "${DIR}/teastart_minimal.sh status" will not work