Skip to content
Permalink
Browse files

fix(install): Teamspeak3 server installation with MariaDB fixed. (#2261)

Co-authored-by: visdmin vili@kiho.fi

fix(ts3server): can now add socket info to mariadb.ini
feat(ts3server): copy libmariadb.so.2 if not found in serverfiles
feat(install): EULA agreement now handled by install_eula.sh
  • Loading branch information...
Vis25 authored and dgibbs64 committed Apr 7, 2019
1 parent 70edcb2 commit 87b8ed40f703b2b8b995cbae1bc707159d8d64a4
@@ -32,11 +32,7 @@ fn_start_teamspeak3(){
date > "${rootdir}/${lockselfname}"
# Accept license
if [ ! -f "${executabledir}/.ts3server_license_accepted" ]; then
fn_script_log "Accepting ts3server license: ${executabledir}/LICENSE"
fn_print_info_nl "Accepting TeamSpeak license:"
echo " * ${executabledir}/LICENSE"
sleep 3
touch "${executabledir}/.ts3server_license_accepted"
install_eula.sh
fi
cd "${executabledir}"
if [ "${ts3serverpass}" == "1" ]; then
@@ -565,32 +565,27 @@ functionfile="${FUNCNAME}"
fn_fetch_function
}

install_gsquery.sh(){
functionfile="${FUNCNAME}"
fn_fetch_function
}

install_gslt.sh(){
install_eula.sh(){
functionfile="${FUNCNAME}"
fn_fetch_function
}

install_header.sh(){
install_gsquery.sh(){
functionfile="${FUNCNAME}"
fn_fetch_function
}

install_logs.sh(){
install_gslt.sh(){
functionfile="${FUNCNAME}"
fn_fetch_function
}

install_minecraft_eula.sh(){
install_header.sh(){
functionfile="${FUNCNAME}"
fn_fetch_function
}

install_unreal_tournament_eula.sh(){
install_logs.sh(){
functionfile="${FUNCNAME}"
fn_fetch_function
}
@@ -8,11 +8,12 @@ local commandname="INSTALL"
local commandaction="Install"
local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"

echo ""
echo "================================="
echo "Install Complete!"
fn_script_log_info "Install Complete!"
echo ""
echo "To start server type:"
echo "./${selfname} start"
echo ""
core_exit.sh
core_exit.sh
@@ -0,0 +1,45 @@
#!/bin/bash
# LinuxGSM install_eula.sh function
# Author: Daniel Gibbs
# Website: https://linuxgsm.com
# Description: Gets user to accept the EULA.

if [ "${shortname}" == "ts3" ]; then
eulaurl="https://www.teamspeak.com/en/privacy-and-terms"
elif [ "${shortname}" == "mc" ]; then
eulaurl="https://account.mojang.com/documents/minecraft_eula"
elif [ "${shortname}" == "ut" ]; then
eulaurl="https://www.epicgames.com/unrealtournament/unreal-tournament-pre-alpha-test-development-build-eula"
fi

echo ""
echo "Accept ${gamename} EULA"
echo "================================="
sleep 0.5
echo "You are required to accept the EULA:"
echo "${eulaurl}"
echo ""
if [ -z "${autoinstall}" ]; then
echo "By continuing you are indicating your agreement to the EULA."
echo ""
if ! fn_prompt_yn "Continue?" Y; then
core_exit.sh
fi
elif [ "${function_selfname}" == "command_start.sh" ]; then
fn_print_info "By continuing you are indicating your agreement to the EULA."
echo ""
sleep 5
else
echo "By using auto-install you are indicating your agreement to the EULA."
echo ""
sleep 5
fi

if [ "${shortname}" == "ts3" ]; then
touch "${executabledir}/.ts3server_license_accepted"
elif [ "${shortname}" == "mc" ]; then
touch "${serverfiles}/eula.txt"
sed -i "s/eula=false/eula=true/g" "${serverfiles}/eula.txt"
elif [ "${shortname}" == "ut" ]; then
:
fi

This file was deleted.

@@ -137,7 +137,7 @@ fi
if [ "${shortname}" == "ts3" ]; then
update_ts3.sh
elif [ "${shortname}" == "mc" ]; then
install_minecraft_eula.sh
install_eula.sh
update_minecraft.sh
elif [ "${shortname}" == "mumble" ]; then
update_mumble.sh
@@ -148,7 +148,7 @@ elif [ "${shortname}" == "fctr" ]; then
install_factorio_save.sh
elif [ -z "${appid}" ]||[ "${shortname}" == "ges" ]||[ "${shortname}" == "bd" ]||[ "${shortname}" == "bb" ]||[ "${shortname}" == "ns" ]||[ "${shortname}" == "vs" ]; then
if [ "${shortname}" == "ut" ]; then
install_unreal_tournament_eula.sh
install_eula.sh
fi
fn_install_server_files
fi
@@ -10,68 +10,69 @@ local commandaction="Install"
local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"

fn_install_ts3db_mariadb(){
echo ""
echo "checking if libmariadb2 is installed"
echo "================================="
sleep 0.5

if ldd "${serverfiles}/libts3db_mariadb.so" | grep "libmariadb.so.2 => not found"; then
echo "libmariadb2 not installed. Please install it first."
echo "exiting..."
exit
else
echo "libmariadb2 installed."
if [ ! -f "${serverfiles}/libts3db_mariadb.so" ]; then
echo -e "copying libmariadb.so.2...\c"
cp "${serverfiles}/redist/libmariadb.so.2" "${serverfiles}"
local exitcode=$?
if [ "${exitcode}" == "0" ]; then
fn_print_ok_eol_nl
fn_script_log_pass "copying libmariadb.so.2"
else
fn_print_fail_eol_nl
fn_script_log_fatal "copying libmariadb.so.2"
core_exit.sh
fi
fi

echo ""
echo "Configuring ${gamename} Server for MariaDB/MySQL"
echo "Configure ${gamename} Server for MariaDB"
echo "================================="
sleep 0.5
read -rp "Enter MariaDB hostname: " mariahostname
read -rp "Enter MariaDB port: " mariaport
read -rp "Enter MariaDB username: " mariausername
read -rp "Enter MariaDB password: " mariapassword
read -rp "Enter MariaDB database name: " mariadbname
read -rp "Enter MariaDB socket path: " mariadbsocket

{
echo "updating config."
echo "[config]"
echo "host='${mariahostname}'"
echo "port='${mariaport}'"
echo "username='${mariausername}'"
echo "password='${mariapassword}'"
echo "database='${mariadbname}'"
echo "socket="
echo "socket='${mariadbsocket}'"
} >> "${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_mariadb\//g" "${servercfgfullpath}"
echo "================================="
echo "updating ts3db_mariadb.ini."
sleep 0.5
}

echo ""
echo "Select Database"
echo "================================="
sleep 0.5
if [ -z "${autoinstall}" ]; then
echo ""
if fn_prompt_yn "Do you want to use MariaDB/MySQL instead of sqlite? (DB must be pre-configured)" N; then
if fn_prompt_yn "Do you want to use MariaDB instead of sqlite? (MariaDB must be pre-configured)" N; then
fn_install_ts3db_mariadb
fi
else
fn_print_warning_nl "./${selfname} auto-install is uses sqlite. For MariaDB/MySQL use ./${selfname} install"
fn_print_information_nl "./${selfname} auto-install is uses sqlite. For MariaDB use ./${selfname} install"
fi

## License
fn_script_log "Accepting ts3server license: ${executabledir}/LICENSE"
fn_print_information_nl "Accepting TeamSpeak license:"
echo " * ${executabledir}/LICENSE"
sleep 0.5
touch "${executabledir}/.ts3server_license_accepted"
install_eula.sh

## Get privilege key
echo ""
echo "Getting privilege key"
echo "================================="
sleep 0.5
echo "IMPORANT! Save these details for later."
fn_print_information_nl "Save these details for later."
sleep 0.5
cd "${executabledir}" || exit
./ts3server_startscript.sh start inifile=ts3-server.ini
${executable} start inifile=ts3-server.ini
sleep 5
./ts3server_startscript.sh stop
${executable} stop

This file was deleted.

0 comments on commit 87b8ed4

Please sign in to comment.
You can’t perform that action at this time.