Răsfoiți Sursa

Changed Teamspeak to TeamSpeak

- added fix for TeamSpeak 3 scripts using gamename="Teamspeak 3"
(core_functions.sh)
Marvin Lehmann 9 ani în urmă
părinte
comite
6b26e2437d

+ 4 - 4
TeamSpeak3/ts3server

@@ -1,5 +1,5 @@
 #!/bin/bash
-# Teamspeak 3
+# TeamSpeak 3
 # Server Management Script
 # Author: Daniel Gibbs
 # Website: https://gameservermanagers.com
@@ -9,7 +9,7 @@ if [ -f ".dev-debug" ]; then
 	set -x
 fi
 
-version="210516"
+version="290716"
 
 #### Variables ####
 
@@ -29,8 +29,8 @@ pushbullettoken="accesstoken"
 updateonstart="off"
 
 # Server Details
-gamename="Teamspeak 3"
-servername="Teamspeak 3 Server"
+gamename="TeamSpeak 3"
+servername="TeamSpeak 3 Server"
 servicename="ts3-server"
 
 # Directories

+ 1 - 1
lgsm/functions/alert_email.sh

@@ -153,7 +153,7 @@ fn_details_gameserver(){
 			echo -e "Tick rate: ${tickrate}"
 		fi
 
-		# Teamspeak dbplugin
+		# TeamSpeak dbplugin
 		if [ -n "${dbplugin}" ]; then
 			echo -e "dbplugin: ${dbplugin}"
 		fi

+ 1 - 1
lgsm/functions/check.sh

@@ -62,7 +62,7 @@ done
 local allowed_commands_array=( command_console.sh command_start.sh )
 for allowed_command in "${allowed_commands_array[@]}"
 do
-	if [ "${allowed_command}" == "${function_selfname}" ]||[ "${gamename}" != "Teamspeak 3" ]; then
+	if [ "${allowed_command}" == "${function_selfname}" ]||[ "${gamename}" != "TeamSpeak 3" ]; then
 		check_tmux.sh
 	fi
 done

+ 1 - 1
lgsm/functions/check_ip.sh

@@ -8,7 +8,7 @@
 local commandname="CHECK"
 local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
 
-if [ "${gamename}" != "Teamspeak 3" ]; then
+if [ "${gamename}" != "TeamSpeak 3" ]; then
 	if [ ! -f "/bin/ip" ]; then
 		ipcommand="/sbin/ip"
 	else

+ 1 - 1
lgsm/functions/check_logs.sh

@@ -8,7 +8,7 @@ local commandname="CHECK"
 local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
 
 # Create directories for the script and console logs
-if [ ! -d "${scriptlogdir}" ]||[ ! -d "${consolelogdir}" ]&&[ "${gamename}" != "Teamspeak 3" ]; then
+if [ ! -d "${scriptlogdir}" ]||[ ! -d "${consolelogdir}" ]&&[ "${gamename}" != "TeamSpeak 3" ]; then
 	fn_print_dots "Checking for log files"
 	sleep 0.5
 	fn_print_info_nl "Checking for log files: Creating log files"

+ 1 - 1
lgsm/functions/check_status.sh

@@ -7,7 +7,7 @@
 local commandname="CHECK"
 local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
 
-if [ "${gamename}" == "Teamspeak 3" ]; then
+if [ "${gamename}" == "TeamSpeak 3" ]; then
 	# 1: Server is running
 	# 0: Server seems to have died
 	# 0: No server running (ts3server.pid is missing)

+ 4 - 4
lgsm/functions/command_details.sh

@@ -150,7 +150,7 @@ fn_details_gameserver(){
 			echo -e "${blue}Tick rate:\t${default}${tickrate}"
 		fi
 
-		# Teamspeak dbplugin
+		# TeamSpeak dbplugin
 		if [ -n "${dbplugin}" ]; then
 			echo -e "${blue}dbplugin:\t${default}${dbplugin}"
 		fi
@@ -286,7 +286,7 @@ fn_details_ports(){
 	echo -e "Change ports by editing the parameters in:"
 
 	parmslocation="${red}UNKNOWN${default}"
-	local ports_edit_array=( "avalanche" "dontstarve" "projectzomboid" "idtech3" "realvirtuality" "seriousengine35" "teeworlds" "terraria" "unreal" "unreal2" "Teamspeak 3" "7 Days To Die" )
+	local ports_edit_array=( "avalanche" "dontstarve" "projectzomboid" "idtech3" "realvirtuality" "seriousengine35" "teeworlds" "terraria" "unreal" "unreal2" "TeamSpeak 3" "7 Days To Die" )
 	for port_edit in "${ports_edit_array[@]}"
 	do
 		if [ "${engine}" == "${port_edit}" ]||[ "${gamename}" == "${port_edit}" ]; then
@@ -569,7 +569,7 @@ fn_details_gameserver
 fn_details_script
 fn_details_backup
 # Some game servers do not have parms.
-if [ "${gamename}" != "Teamspeak 3" ]&&[ "${engine}" != "avalanche" ]&&[ "${engine}" != "dontstarve" ]&&[ "${engine}" != "projectzomboid" ]; then
+if [ "${gamename}" != "TeamSpeak 3" ]&&[ "${engine}" != "avalanche" ]&&[ "${engine}" != "dontstarve" ]&&[ "${engine}" != "projectzomboid" ]; then
 	fn_parms
 	fn_details_commandlineparms
 fi
@@ -606,7 +606,7 @@ elif [ "${gamename}" == "Hurtworld" ]; then
 	fn_details_hurtworld
 elif [ "${gamename}" == "7 Days To Die" ]; then
 	fn_details_sdtd
-elif [ "${gamename}" == "Teamspeak 3" ]; then
+elif [ "${gamename}" == "TeamSpeak 3" ]; then
 	fn_details_teamspeak3
 elif [ "${gamename}" == "Rust" ]; then
 	fn_details_rust

+ 2 - 2
lgsm/functions/command_install.sh

@@ -17,7 +17,7 @@ check_deps.sh
 if [ "${gamename}" == "Unreal Tournament 2004" ]; then
 	install_server_files.sh
 	install_ut2k4_key.sh
-elif [ "${gamename}" == "Unreal Tournament 99" ]||[ "${gamename}" == "Teamspeak 3" ]; then
+elif [ "${gamename}" == "Unreal Tournament 99" ]||[ "${gamename}" == "TeamSpeak 3" ]; then
 	installer=1
 	install_server_files.sh
 elif [ -n "${appid}" ]; then
@@ -29,7 +29,7 @@ fi
 install_config.sh
 if [ "${gamename}" == "Counter Strike: Global Offensive" ]||[ "${gamename}" == "Team Fortress 2" ]||[ "${gamename}" == "BrainBread 2" ]; then
 	install_gslt.sh
-elif [ "${gamename}" == "Teamspeak 3" ]; then
+elif [ "${gamename}" == "TeamSpeak 3" ]; then
 	install_ts3db.sh
 fi
 

+ 1 - 1
lgsm/functions/command_monitor.sh

@@ -90,7 +90,7 @@ info_config.sh
 fn_monitor_check_lockfile
 fn_monitor_check_update
 fn_monitor_msg_checking
-if [ "${gamename}" == "Teamspeak 3" ]; then
+if [ "${gamename}" == "TeamSpeak 3" ]; then
 	fn_monitor_teamspeak3
 else
 	fn_monitor_tmux

+ 1 - 1
lgsm/functions/command_start.sh

@@ -177,7 +177,7 @@ if [ "${status}" == "0" ]; then
 	fi
 fi
 
-if [ "${gamename}" == "Teamspeak 3" ]; then
+if [ "${gamename}" == "TeamSpeak 3" ]; then
 	fn_start_teamspeak3
 else
 	fn_start_tmux

+ 1 - 1
lgsm/functions/command_stop.sh

@@ -239,7 +239,7 @@ fn_stop_tmux(){
 
 # checks if the server is already stopped before trying to stop.
 fn_stop_pre_check(){
-	if [ "${gamename}" == "Teamspeak 3" ]; then
+	if [ "${gamename}" == "TeamSpeak 3" ]; then
 		check_status.sh
 		if [ "${status}" == "0" ]; then
 			fn_print_info_nl "${servername} is already stopped"

+ 1 - 1
lgsm/functions/command_update.sh

@@ -13,7 +13,7 @@ sleep 0.5
 check.sh
 
 
-if [ "${gamename}" == "Teamspeak 3" ]; then
+if [ "${gamename}" == "TeamSpeak 3" ]; then
 	update_ts3.sh
 else
 	update_steamcmd.sh

+ 5 - 2
lgsm/functions/core_functions.sh

@@ -5,8 +5,12 @@
 # Description: Defines all functions to allow download and execution of functions using fn_fetch_function.
 # This function is called first before any other function. Without this file other functions will not load.
 
-# Code/functions for legacy servers
+# Fix for TeamSpeak 3 scripts using gamename="Teamspeak 3"
+if [ "${gamename}" == "Teamspeak 3" ]; then 
+	gamename="TeamSpeak 3" 
+fi
 
+# Code/functions for legacy servers
 fn_functions(){
 functionfile="${FUNCNAME}"
 fn_fetch_function
@@ -17,7 +21,6 @@ functionfile="${FUNCNAME}"
 fn_fetch_function
 }
 
-
 # fn_fetch_core_dl also placed here to allow legacy servers to still download core functions
 if [ -z "${lgsmdir}" ]; then
 	lgsmdir="${rootdir}/lgsm"

+ 1 - 1
lgsm/functions/core_getopt.sh

@@ -445,7 +445,7 @@ case "${getopt}" in
 
 if [ "${gamename}" == "Mumble" ]; then
 	fn_getopt_mumble
-elif [ "${gamename}" == "Teamspeak 3" ]; then
+elif [ "${gamename}" == "TeamSpeak 3" ]; then
 	fn_getopt_teamspeak3
 elif [ "${gamename}" == "Garry's Mod" ]; then
 	fn_getopt_gmodserver

+ 1 - 1
lgsm/functions/fix.sh

@@ -45,7 +45,7 @@ if [ "${function_selfname}" != "command_install.sh" ]; then
 		fix_arma3.sh
 	fi
 
-	if [ "${gamename}" != "Teamspeak 3" ]; then
+	if [ "${gamename}" != "TeamSpeak 3" ]; then
 		fix_glibc.sh
 	fi
 fi

+ 1 - 1
lgsm/functions/info_config.sh

@@ -376,7 +376,7 @@ elif [ "${engine}" == "source" ]||[ "${engine}" == "goldsource" ]; then
 elif [ "${engine}" == "starbound" ]; then
 	fn_info_config_starbound
 # TeamSpeak 3
-elif [ "${gamename}" == "Teamspeak 3" ]; then
+elif [ "${gamename}" == "TeamSpeak 3" ]; then
 	fn_info_config_teamspeak3
 # Teeworlds
 elif [ "${engine}" == "teeworlds" ]; then

+ 1 - 1
lgsm/functions/info_glibc.sh

@@ -68,7 +68,7 @@ elif [ "${engine}" == "unreal4" ]; then
 elif [ "${engine}" == "unity3d" ]; then
 	glibcrequired="2.15"
 	glibcfix="no"
-elif [ "${gamename}" == "Teamspeak 3" ]; then
+elif [ "${gamename}" == "TeamSpeak 3" ]; then
 	glibcrequired="NOT REQUIRED"
 	glibcfix="no"
 else

+ 1 - 1
lgsm/functions/install_config.sh

@@ -342,7 +342,7 @@ elif [ "${gamename}" == "Starbound" ]; then
 	sleep 1
 	fn_defaultconfig
 	fn_userinputconfig
-elif [ "${gamename}" == "Teamspeak 3" ]; then
+elif [ "${gamename}" == "TeamSpeak 3" ]; then
 	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

+ 2 - 2
lgsm/functions/install_logs.sh

@@ -23,8 +23,8 @@ if [ -n "${consolelogdir}" ]; then
 	touch "${consolelog}"
 fi
 
-# If a server is source or goldsource, Teamspeak 3, Starbound, Project Zomhoid create a symbolic link to the game server logs.
-if [ "${engine}" == "source" ]||[ "${engine}" == "goldsource" ]||[ "${gamename}" == "Teamspeak 3" ]||[ "${engine}" == "starbound" ]||[ "${engine}" == "projectzomboid" ]||[ "${engine}" == "unreal" ]; then
+# If a server is source or goldsource, TeamSpeak 3, Starbound, Project Zomhoid create a symbolic link to the game server logs.
+if [ "${engine}" == "source" ]||[ "${engine}" == "goldsource" ]||[ "${gamename}" == "TeamSpeak 3" ]||[ "${engine}" == "starbound" ]||[ "${engine}" == "projectzomboid" ]||[ "${engine}" == "unreal" ]; then
 	if [ ! -h "${rootdir}/log/server" ]; then
 		ln -nfsv "${gamelogdir}" "${rootdir}/log/server"
 	fi

+ 1 - 1
lgsm/functions/install_server_files.sh

@@ -93,7 +93,7 @@ echo "Installing ${gamename} Server"
 echo "================================="
 sleep 1
 
-if [ "${gamename}" == "Teamspeak 3" ]; then
+if [ "${gamename}" == "TeamSpeak 3" ]; then
 	update_ts3.sh
 elif [ -z "${appid}" ]||[ "${gamename}" == "GoldenEye: Source" ]; then
 	fn_install_server_files