diff --git a/alpine/files/Install_Script.sh b/alpine/files/Install_Script.sh index 2a7a03d..a038ab1 100644 --- a/alpine/files/Install_Script.sh +++ b/alpine/files/Install_Script.sh @@ -44,7 +44,7 @@ if [ -e /ts3server/ts3server_minimal_runscript.sh ] else echo " " echo "WARNING ! ts3server_minimal_runscript.sh not found ... will download now." - wget --no-cache https://raw.githubusercontent.com/fithwum/files-for-dockers/master/scripts/ts3server_minimal_runscript.sh -O /ts3temp/inifiles/ts3server_minimal_runscript.sh + wget --no-cache https://raw.githubusercontent.com/fithwum/teamspeak-server/master/files/ts3server_minimal_runscript.sh -O /ts3temp/inifiles/ts3server_minimal_runscript.sh cp /ts3temp/inifiles/ts3server_minimal_runscript.sh /ts3server/ rm -fr /ts3temp/ts3server_minimal_runscript.sh fi @@ -54,7 +54,7 @@ if [ -e /ts3server/ts3db_mariadb.ini ] else echo " " echo "WARNING ! ts3db_mariadb.ini not found ... will download now." - wget --no-cache https://raw.githubusercontent.com/fithwum/files-for-dockers/master/files/ts3db_mariadb.ini -O /ts3temp/inifiles/ts3db_mariadb.ini + wget --no-cache https://raw.githubusercontent.com/fithwum/teamspeak-server/master/files/ts3db_mariadb.ini -O /ts3temp/inifiles/ts3db_mariadb.ini cp /ts3temp/inifiles/ts3db_mariadb.ini /ts3server/ rm -fr /ts3temp/inifiles/ts3db_mariadb.ini fi @@ -64,10 +64,20 @@ if [ -e /ts3server/ts3server.ini ] else echo " " echo "WARNING ! ts3server.ini not found ... will download now." - wget --no-cache https://raw.githubusercontent.com/fithwum/files-for-dockers/master/files/ts3server.ini -O /ts3temp/inifiles/ts3server.ini + wget --no-cache https://raw.githubusercontent.com/fithwum/teamspeak-server/master/files/ts3server.ini -O /ts3temp/inifiles/ts3server.ini cp /ts3temp/inifiles/ts3server.ini /ts3server/ rm -fr /ts3temp/inifiles/ts3server.ini fi +if [ -e /ts3server/.ts3server_license_accepted ] + then + echo "INFO ! .ts3server_license_accepted found ... will not download." + else + echo " " + echo "WARNING ! .ts3server_license_accepted not found ... will download now." + wget --no-cache https://raw.githubusercontent.com/fithwum/teamspeak-server/master/files/.ts3server_license_accepted -O /ts3temp/.ts3server_license_accepted + cp /ts3temp/.ts3server_license_accepted /ts3server/ + rm -fr /ts3temp/.ts3server_license_accepted +fi sleep 1 diff --git a/basic/files/Install_Script.sh b/basic/files/Install_Script.sh index 6723d7f..445052b 100644 --- a/basic/files/Install_Script.sh +++ b/basic/files/Install_Script.sh @@ -44,7 +44,7 @@ if [ -e /ts3server/ts3server_minimal_runscript.sh ] else echo " " echo "WARNING ! ts3server_minimal_runscript.sh not found ... will download now." - wget --no-cache https://raw.githubusercontent.com/fithwum/files-for-dockers/master/scripts/ts3server_minimal_runscript.sh -O /ts3temp/inifiles/ts3server_minimal_runscript.sh + wget --no-cache https://raw.githubusercontent.com/fithwum/teamspeak-server/master/files/ts3server_minimal_runscript.sh -O /ts3temp/inifiles/ts3server_minimal_runscript.sh cp /ts3temp/inifiles/ts3server_minimal_runscript.sh /ts3server/ rm -fr /ts3temp/ts3server_minimal_runscript.sh fi @@ -54,10 +54,20 @@ if [ -e /ts3server/ts3server.ini ] else echo " " echo "WARNING ! ts3server.ini not found ... will download now." - wget --no-cache https://raw.githubusercontent.com/fithwum/teamspeak3/master/files/ts3server.ini -O /ts3temp/inifiles/ts3server.ini + wget --no-cache https://raw.githubusercontent.com/fithwum/teamspeak-server/master/basic/files/ts3server.ini -O /ts3temp/inifiles/ts3server.ini cp /ts3temp/inifiles/ts3server.ini /ts3server/ rm -fr /ts3temp/inifiles/ts3server.ini fi +if [ -e /ts3server/.ts3server_license_accepted ] + then + echo "INFO ! .ts3server_license_accepted found ... will not download." + else + echo " " + echo "WARNING ! .ts3server_license_accepted not found ... will download now." + wget --no-cache https://raw.githubusercontent.com/fithwum/teamspeak-server/master/files/.ts3server_license_accepted -O /ts3temp/.ts3server_license_accepted + cp /ts3temp/.ts3server_license_accepted /ts3server/ + rm -fr /ts3temp/.ts3server_license_accepted +fi sleep 1 diff --git a/debian/files/Install_Script.sh b/debian/files/Install_Script.sh index de704f9..329c9a8 100644 --- a/debian/files/Install_Script.sh +++ b/debian/files/Install_Script.sh @@ -44,7 +44,7 @@ if [ -e /ts3server/ts3server_minimal_runscript.sh ] else echo " " echo "WARNING ! ts3server_minimal_runscript.sh not found ... will download now." - wget --no-cache https://raw.githubusercontent.com/fithwum/files-for-dockers/master/scripts/ts3server_minimal_runscript.sh -O /ts3temp/inifiles/ts3server_minimal_runscript.sh + wget --no-cache https://raw.githubusercontent.com/fithwum/teamspeak-server/master/files/ts3server_minimal_runscript.sh -O /ts3temp/inifiles/ts3server_minimal_runscript.sh cp /ts3temp/inifiles/ts3server_minimal_runscript.sh /ts3server/ rm -fr /ts3temp/ts3server_minimal_runscript.sh fi @@ -54,7 +54,7 @@ if [ -e /ts3server/ts3db_mariadb.ini ] else echo " " echo "WARNING ! ts3db_mariadb.ini not found ... will download now." - wget --no-cache https://raw.githubusercontent.com/fithwum/files-for-dockers/master/files/ts3db_mariadb.ini -O /ts3temp/inifiles/ts3db_mariadb.ini + wget --no-cache https://raw.githubusercontent.com/fithwum/teamspeak-server/master/files/ts3db_mariadb.ini -O /ts3temp/inifiles/ts3db_mariadb.ini cp /ts3temp/inifiles/ts3db_mariadb.ini /ts3server/ rm -fr /ts3temp/inifiles/ts3db_mariadb.ini fi @@ -64,10 +64,20 @@ if [ -e /ts3server/ts3server.ini ] else echo " " echo "WARNING ! ts3server.ini not found ... will download now." - wget --no-cache https://raw.githubusercontent.com/fithwum/files-for-dockers/master/files/ts3server.ini -O /ts3temp/inifiles/ts3server.ini + wget --no-cache https://raw.githubusercontent.com/fithwum/teamspeak-server/master/files/ts3server.ini -O /ts3temp/inifiles/ts3server.ini cp /ts3temp/inifiles/ts3server.ini /ts3server/ rm -fr /ts3temp/inifiles/ts3server.ini fi +if [ -e /ts3server/.ts3server_license_accepted ] + then + echo "INFO ! .ts3server_license_accepted found ... will not download." + else + echo " " + echo "WARNING ! .ts3server_license_accepted not found ... will download now." + wget --no-cache https://raw.githubusercontent.com/fithwum/teamspeak-server/master/files/.ts3server_license_accepted -O /ts3temp/.ts3server_license_accepted + cp /ts3temp/.ts3server_license_accepted /ts3server/ + rm -fr /ts3temp/.ts3server_license_accepted +fi sleep 1 diff --git a/files/.ts3server_license_accepted b/files/.ts3server_license_accepted new file mode 100644 index 0000000..005d253 --- /dev/null +++ b/files/.ts3server_license_accepted @@ -0,0 +1 @@ +license_accepted=1 \ No newline at end of file diff --git a/files/ts3db_mariadb.ini b/files/ts3db_mariadb.ini new file mode 100644 index 0000000..867b0fd --- /dev/null +++ b/files/ts3db_mariadb.ini @@ -0,0 +1,6 @@ +[config] +host=0.0.0.0 +port=3306 +username=tsdbuser +password=tsdbpassword +database=tsdatabase diff --git a/files/ts3server.ini b/files/ts3server.ini new file mode 100644 index 0000000..0afab2b --- /dev/null +++ b/files/ts3server.ini @@ -0,0 +1,30 @@ +machine_id= +default_voice_port=9987 +voice_ip= +licensepath= +filetransfer_port=30033 +filetransfer_ip= +query_port=10011 +query_ip=0.0.0.0, :: +query_ip_allowlist=query_ip_whitelist.txt +query_ip_denylist=query_ip_blacklist.txt +dbplugin=ts3db_mariadb +dbpluginparameter=ts3db_mariadb.ini +dbsqlpath=sql/ +dbsqlcreatepath=create_mariadb/ +dbconnections=10 +logpath=logs/ +logquerycommands=1 +dbclientkeepdays=30 +logappend=1 +query_skipbruteforcecheck=0 +query_buffer_mb=20 +http_proxy= +license_accepted=1 +serverquerydocs_path=serverquerydocs/ +query_ssh_ip=0.0.0.0, :: +query_ssh_port=10022 +query_protocols=raw +query_ssh_rsa_host_key=ssh_host_rsa_key +query_timeout=300 +crashdumps_path=crashdumps/ diff --git a/files/ts3server_minimal_runscript.sh b/files/ts3server_minimal_runscript.sh new file mode 100644 index 0000000..804493a --- /dev/null +++ b/files/ts3server_minimal_runscript.sh @@ -0,0 +1,8 @@ +#!/bin/sh + +export LD_LIBRARY_PATH=".:$LD_LIBRARY_PATH" + +D1=$(readlink -f "$0") +D2=$(dirname "${D1}") +cd "${D2}" +exec ./ts3server $@ diff --git a/files/ts3server_start.sh b/files/ts3server_start.sh new file mode 100644 index 0000000..e7e47c7 --- /dev/null +++ b/files/ts3server_start.sh @@ -0,0 +1,6 @@ +#!/bin/bash +# Copyright (c) 2018 fithwum +# All rights reserved + +# run teamspeak server +exec ../ts3server/ts3server inifile=ts3server.ini start diff --git a/files/ts3server_startscript.sh b/files/ts3server_startscript.sh new file mode 100644 index 0000000..835f4bb --- /dev/null +++ b/files/ts3server_startscript.sh @@ -0,0 +1,102 @@ +#!/bin/bash +# Copyright (c) 2010 TeamSpeak Systems GmbH +# All rights reserved + +COMMANDLINE_PARAMETERS="inifile=ts3server.ini" #add any command line parameters you want to pass here +LIBRARYPATH="$(pwd)" +BINARYNAME="ts3server" + +case "$1" in + start) + if [ -e ts3server.pid ]; then + if ( kill -0 $(cat ts3server.pid) 2> /dev/null ); then + echo "The server is already running, try restart or stop" + exit 1 + else + echo "ts3server.pid found, but no server running. Possibly your previously started server crashed" + echo "Please view the logfile for details." + rm ts3server.pid + fi + fi + if [ "${UID}" = "0" ]; then + echo WARNING ! For security reasons we advise: DO NOT RUN THE SERVER AS ROOT + c=1 + while [ "$c" -le 10 ]; do + echo -n "!" + sleep 1 + c=$(($c+1)) + done + echo "!" + fi + echo "Starting the TeamSpeak 3 server" + if [ -e "$BINARYNAME" ]; then + if [ ! -x "$BINARYNAME" ]; then + echo "${BINARYNAME} is not executable, trying to set it" + chmod u+x "${BINARYNAME}" + fi + if [ -x "$BINARYNAME" ]; then + export LD_LIBRARY_PATH="${LIBRARYPATH}:${LD_LIBRARY_PATH}" + "./${BINARYNAME}" ${COMMANDLINE_PARAMETERS} > /dev/null & + PID=$! + ps -p ${PID} > /dev/null 2>&1 + if [ "$?" -ne "0" ]; then + echo "TeamSpeak 3 server could not start" + else + echo $PID > ts3server.pid + echo "TeamSpeak 3 server started, for details please view the log file" + fi + else + echo "${BINARNAME} is not exectuable, cannot start TeamSpeak 3 server" + fi + else + echo "Could not find binary, aborting" + exit 5 + fi + ;; + stop) + if [ -e ts3server.pid ]; then + echo -n "Stopping the TeamSpeak 3 server" + if ( kill -TERM $(cat ts3server.pid) 2> /dev/null ); then + c=1 + while [ "$c" -le 300 ]; do + if ( kill -0 $(cat ts3server.pid) 2> /dev/null ); then + echo -n "." + sleep 1 + else + break + fi + c=$(($c+1)) + done + fi + if ( kill -0 $(cat ts3server.pid) 2> /dev/null ); then + echo "Server is not shutting down cleanly - killing" + kill -KILL $(cat ts3server.pid) + else + echo "done" + fi + rm ts3server.pid + else + echo "No server running (ts3server.pid is missing)" + exit 7 + fi + ;; + restart) + $0 stop && $0 start ${COMMANDLINE_PARAMETERS} || exit 1 + ;; + status) + if [ -e ts3server.pid ]; then + if ( kill -0 $(cat ts3server.pid) 2> /dev/null ); then + echo "Server is running" + else + echo "Server seems to have died" + fi + else + echo "No server running (ts3server.pid is missing)" + fi + ;; + *) + echo "Usage: ${0} {start|stop|restart|status}" + exit 2 +esac +exit 0 +