diff --git a/TeamSpeak3/cfg/lgsm-default.ini b/TeamSpeak3/cfg/lgsm-default.ini new file mode 100644 index 000000000..71000a42e --- /dev/null +++ b/TeamSpeak3/cfg/lgsm-default.ini @@ -0,0 +1,20 @@ +machine_id= +default_voice_port=9987 +voice_ip=0.0.0.0 +licensepath= +filetransfer_port=30033 +filetransfer_ip=0.0.0.0 +query_port=10011 +query_ip=0.0.0.0 +query_ip_whitelist=query_ip_whitelist.txt +query_ip_blacklist=query_ip_blacklist.txt +dbplugin=ts3db_sqlite3 +dbpluginparameter= +dbsqlpath=sql/ +dbsqlcreatepath=create_sqlite/ +dbconnections=10 +logpath=logs +logquerycommands=0 +dbclientkeepdays=30 +logappend=0 +query_skipbruteforcecheck=0 \ No newline at end of file diff --git a/TeamSpeak3/ts3server b/TeamSpeak3/ts3server index 215cb2866..a428798e7 100644 --- a/TeamSpeak3/ts3server +++ b/TeamSpeak3/ts3server @@ -37,6 +37,7 @@ executable="./ts3server_startscript.sh" servercfg="${servicename}.ini" servercfgdir="${filesdir}" servercfgfullpath="${servercfgdir}/${servercfg}" +servercfgdefault="${servercfgdir}/lgsm-default.ini" backupdir="${rootdir}/backups" # Logging diff --git a/functions/fn_functions b/functions/fn_functions index 39e3220d6..30d4dfdd8 100644 --- a/functions/fn_functions +++ b/functions/fn_functions @@ -284,6 +284,11 @@ functionfile="${FUNCNAME}" fn_runfunction } +fn_install_ts3db(){ +functionfile="${FUNCNAME}" +fn_runfunction +} + fn_install_ut2k4(){ functionfile="${FUNCNAME}" fn_runfunction diff --git a/functions/fn_install b/functions/fn_install index 0cc9129c4..e6a1a346f 100644 --- a/functions/fn_install +++ b/functions/fn_install @@ -32,6 +32,8 @@ fn_install_config if [ "${gamename}" == "Counter Strike: Global Offensive" ]; then fn_install_gslt fn_csgofix +elif [ "${gamename}" == "Teamspeak 3" ]; then + fn_install_ts3db elif [ "${gamename}" == "Team Fortress 2" ]; then fn_install_gslt elif [ "${gamename}" == "Killing Floor" ]; then diff --git a/functions/fn_install_config b/functions/fn_install_config index 2a0311634..a95d1a652 100644 --- a/functions/fn_install_config +++ b/functions/fn_install_config @@ -102,16 +102,6 @@ fn_userinputconfig echo "" } -fn_ts3config(){ -echo "creating blank ${servercfg} config file." -sleep 1 -echo "${servercfg} can remain blank by default." -sleep 1 -echo "${servercfg} is located in ${servercfgfullpath}." -sleep 1 -touch "${servercfgfullpath}" -} - fn_ut99config(){ echo "${defaultcfg} > ${servercfgfullpath}" tr -d '\r' < "${servercfgdefault}" > "${servercfgfullpath}" @@ -283,7 +273,10 @@ elif [ "${gamename}" == "Serious Sam 3: BFE" ]; then sleep 1 fn_serious3config elif [ "${gamename}" == "Teamspeak 3" ]; then - fn_ts3config + echo -e "downloading lgsm-default.ini...\c" + wget -N /dev/null ${githuburl}/TeamSpeak3/cfg/lgsm-default.ini 2>&1 | grep -F HTTP | cut -c45- | uniq + sleep 1 + fn_defaultconfig elif [ "${gamename}" == "Team Fortress 2" ]; then echo -e "downloading lgsm-default.cfg...\c" wget -N /dev/null ${githuburl}/TeamFortress2/cfg/lgsm-default.cfg 2>&1 | grep -F HTTP | cut -c45- | uniq diff --git a/functions/fn_install_ts3 b/functions/fn_install_ts3 index 26f7a7724..f3fa529ba 100644 --- a/functions/fn_install_ts3 +++ b/functions/fn_install_ts3 @@ -79,15 +79,3 @@ else fi rm -f teamspeak3-server_linux-${ts3arch}-${availablebuild}.tar.gz rm -rf "${rootdir}/teamspeak3-server_linux-${ts3arch}" - -## Get privilege key -echo "" -echo "Getting privilege key" -echo "=================================" -sleep 1 -echo "IMPORANT! Save these details for later." -sleep 1 -cd "${executabledir}" -./ts3server_startscript.sh start -sleep 5 -./ts3server_startscript.sh stop \ No newline at end of file diff --git a/functions/fn_install_ts3db b/functions/fn_install_ts3db new file mode 100644 index 000000000..8216b9df9 --- /dev/null +++ b/functions/fn_install_ts3db @@ -0,0 +1,52 @@ +#!/bin/bash +# LGSM fn_install_ts3_mariadb function +# Author: Daniel Gibbs +# Website: http://gameservermanagers.com +lgsm_version="241215" + +fn_install_ts3db_mariadb(){ + echo "" + echo "Configuring ${gamename} Server for MariaDB" + echo "=================================" + sleep 1 + read -p "Enter MariaDB hostname: " mariahostname + read -p "Enter MariaDB port: " mariaport + read -p "Enter MariaDB username: " mariausername + read -p "Enter MariaDB password: " mariapassword + read -p "Enter MariaDB database name: " mariadbname + echo "updating config." + echo "[config]" >> ${servercfgdir}/ts3db_mariadb.ini + echo "host='${mariahostname}'" >> ${servercfgdir}/ts3db_mariadb.ini + echo "port='${mariaport}'" >> ${servercfgdir}/ts3db_mariadb.ini + echo "username='${mariausername}'" >> ${servercfgdir}/ts3db_mariadb.ini + echo "password='${mariapassword}'" >> ${servercfgdir}/ts3db_mariadb.ini + echo "database='${mariadbname}'" >> ${servercfgdir}/ts3db_mariadb.ini + echo "socket=" >> ${servercfgdir}/ts3db_mariadb.ini + sed -i "s/\"dbplugin=ts3db_sqlite3\"/\"dbplugin=ts3db_mariadb\"/g" "${servercfgfullpath}" + sed -i "s/\"dbpluginparameter=\"/\"dbpluginparameter=ts3db_mariadb.ini\"/g" "${servercfgfullpath}" + sed -i "s/\"dbsqlcreatepath=create_sqlite/\"/\"dbsqlcreatepath=create_mysql/\"/g" "${servercfgfullpath}" + echo "=================================" + sleep 1 +} + +echo "" +while true; do + read -e -i "n" -p "Do you want to use MariaDB/MySQL instead of sqlite (Database Server including user and database already has to be set up!)? [y/N]" yn + case $yn in + [Yy]* ) fn_install_ts3db_mariadb && break;; + [Nn]* ) break;; + * ) echo "Please answer yes or no.";; + esac +done + +## Get privilege key +echo "" +echo "Getting privilege key" +echo "=================================" +sleep 1 +echo "IMPORANT! Save these details for later." +sleep 1 +cd "${executabledir}" +./ts3server_startscript.sh start +sleep 5 +./ts3server_startscript.sh stop