Browse Source

init

Support for MariaDB/MySQL
pull/578/head
PhilPhonic 9 years ago
parent
commit
d52a343e25
  1. 20
      TeamSpeak3/cfg/lgsm-default.ini
  2. 1
      TeamSpeak3/ts3server
  3. 5
      functions/fn_functions
  4. 2
      functions/fn_install
  5. 15
      functions/fn_install_config
  6. 12
      functions/fn_install_ts3
  7. 52
      functions/fn_install_ts3db

20
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

1
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

5
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

2
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

15
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

12
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

52
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
Loading…
Cancel
Save