Просмотр исходного кода

Merge pull request #1224 from ChaosMTA/mta

Adding Multi Theft Auto Support
Daniel Gibbs 9 лет назад
Родитель
Сommit
a982a969e5

+ 180 - 0
MultiTheftAuto/mtaserver

@@ -0,0 +1,180 @@
+#!/bin/bash
+# Multi Theft Auto
+# Server Management Script
+# Author: Daniel Gibbs
+# Website: https://gameservermanagers.com
+if [ -f ".dev-debug" ]; then
+	exec 5>dev-debug.log
+	BASH_XTRACEFD="5"
+	set -x
+fi
+
+version="170103"
+
+##########################
+######## Settings ########
+##########################
+
+#### Server Settings ####
+
+## Server Start Settings | https://github.com/GameServerManagers/LinuxGSM/wiki/Start-Parameters
+# None Available
+
+## Server Start Command | https://github.com/GameServerManagers/LinuxGSM/wiki/Start-Parameters#additional-parameters
+# Edit with care
+fn_parms(){
+parms=" "
+}
+
+#### LinuxGSM Settings ####
+
+## Notification Alerts
+# (on|off)
+# Email Alerts | https://github.com/GameServerManagers/LinuxGSM/wiki/Email
+emailalert="off"
+email="email@example.com"
+emailfrom=""
+
+# Pushbullet Alerts | https://github.com/GameServerManagers/LinuxGSM/wiki/Pushbullet
+pushbulletalert="off"
+pushbullettoken="accesstoken"
+channeltag=""
+
+## Backup | https://github.com/GameServerManagers/LinuxGSM/wiki/Backup
+maxbackups="4"
+maxbackupdays="30"
+stoponbackup="on"
+
+## Logging | https://github.com/GameServerManagers/LinuxGSM/wiki/Logging
+consolelogging="on"
+logdays="7"
+
+#### LinuxGSM Advanced Settings ####
+
+# Github Branch Select
+# Allows for the use of different function files
+# from a different repo and/or branch.
+githubuser="dgibbs64"
+githubrepo="linuxgsm"
+githubbranch="master"
+
+## LinuxGSM Server Details
+# Do not edit
+gamename="Multi Theft Auto"
+engine="RenderWare"
+
+## Service Name | https://github.com/GameServerManagers/LinuxGSM/wiki/Multiple-Servers
+servicename="mta-server"
+
+#### Directories ####
+# Edit with care
+
+## Work Directories
+rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))"
+selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
+lockselfname=".${servicename}.lock"
+lgsmdir="${rootdir}/lgsm"
+functionsdir="${lgsmdir}/functions"
+libdir="${lgsmdir}/lib"
+tmpdir="${lgsmdir}/tmp"
+filesdir="${rootdir}/serverfiles"
+
+## Server Specific Directories
+systemdir="${filesdir}"
+resourcesdir="${systemdir}/mods/deathmatch/resources"
+executabledir="${systemdir}"
+executable="./mta-server64"
+servercfg="mtaserver.conf"
+servercfgdir="${systemdir}/mods/deathmatch"
+servercfgfullpath="${servercfgdir}/${servercfg}"
+
+## Backup Directory
+backupdir="${rootdir}/backups"
+
+## Logging Directories
+gamelogdir="${filesdir}/mods/deathmatch/logs"
+scriptlogdir="${rootdir}/log/script"
+consolelogdir="${rootdir}/log/console"
+scriptlog="${scriptlogdir}/${servicename}-script.log"
+consolelog="${consolelogdir}/${servicename}-console.log"
+emaillog="${scriptlogdir}/${servicename}-email.log"
+
+## Logs Naming
+scriptlogdate="${scriptlogdir}/${servicename}-script-$(date '+%d-%m-%Y-%H-%M-%S').log"
+consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%d-%m-%Y-%H-%M-%S').log"
+
+########################
+######## Script ########
+###### Do not edit #####
+########################
+
+# Fetches core_dl for file downloads
+fn_fetch_core_dl(){
+github_file_url_dir="lgsm/functions"
+github_file_url_name="${functionfile}"
+filedir="${functionsdir}"
+filename="${github_file_url_name}"
+githuburl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}"
+# If the file is missing, then download
+if [ ! -f "${filedir}/${filename}" ]; then
+	if [ ! -d "${filedir}" ]; then
+		mkdir -p "${filedir}"
+	fi
+	echo -e "    fetching ${filename}...\c"
+	# Check curl exists and use available path
+	curlpaths="$(command -v curl 2>/dev/null) $(which curl >/dev/null 2>&1) /usr/bin/curl /bin/curl /usr/sbin/curl /sbin/curl)"
+	for curlcmd in ${curlpaths}
+	do
+		if [ -x "${curlcmd}" ]; then
+			break
+		fi
+	done
+	# If curl exists download file
+	if [ "$(basename ${curlcmd})" == "curl" ]; then
+		curlfetch=$(${curlcmd} -s --fail -o "${filedir}/${filename}" "${githuburl}" 2>&1)
+		if [ $? -ne 0 ]; then
+			echo -e "\e[0;31mFAIL\e[0m\n"
+			echo "${curlfetch}"
+			echo -e "${githuburl}\n"
+			exit 1
+		else
+			echo -e "\e[0;32mOK\e[0m"
+		fi
+	else
+		echo -e "\e[0;31mFAIL\e[0m\n"
+		echo "Curl is not installed!"
+		echo -e ""
+		exit 1
+	fi
+	chmod +x "${filedir}/${filename}"
+fi
+source "${filedir}/${filename}"
+}
+
+core_dl.sh(){
+# Functions are defined in core_functions.sh.
+functionfile="${FUNCNAME}"
+fn_fetch_core_dl
+}
+
+core_functions.sh(){
+# Functions are defined in core_functions.sh.
+functionfile="${FUNCNAME}"
+fn_fetch_core_dl
+}
+
+# Prevent from running this script as root.
+if [ "$(whoami)" = "root" ]; then
+	if [ ! -f "${functionsdir}/core_functions.sh" ]||[ ! -f "${functionsdir}/check_root.sh" ]||[ ! -f "${functionsdir}/core_messages.sh" ]||[ ! -f "${functionsdir}/core_exit.sh" ]; then
+		echo "[ FAIL ] Do NOT run this script as root!"
+		exit 1
+	else
+		core_functions.sh
+		check_root.sh
+	fi
+fi
+
+core_dl.sh
+core_functions.sh
+getopt=$1
+core_getopt.sh

+ 4 - 4
lgsm/functions/check_deps.sh

@@ -158,8 +158,8 @@ if [ -n "$(command -v dpkg-query)" ]; then
 		fi
 	fi
 
-	# All servers except ts3,mumble and minecraft servers require libstdc++6 and lib32gcc1
-	if [ "${gamename}" != "TeamSpeak 3" ]&&[ "${gamename}" != "Mumble" ]&&[ "${engine}" != "lwjgl2" ]; then
+	# All servers except ts3,mumble,multitheftauto and minecraft servers require libstdc++6 and lib32gcc1
+	if [ "${gamename}" != "TeamSpeak 3" ]&&[ "${gamename}" != "Mumble" ]&&[ "${engine}" != "lwjgl2" ]&&[ "${engine}" != "RenderWare" ]; then
 		if [ "${arch}" == "x86_64" ]; then
 			array_deps_required+=( lib32gcc1 libstdc++6:i386 )
 		else
@@ -241,8 +241,8 @@ elif [ -n "$(command -v yum)" ]; then
 		fi
 	fi
 
-	# All servers except ts3,mumble and minecraft servers require glibc.i686 and libstdc++.i686
-	if [ "${gamename}" != "TeamSpeak 3" ]&&[ "${gamename}" != "Mumble" ]&&[ "${engine}" != "lwjgl2" ]; then
+	# All servers except ts3,mumble,multitheftauto and minecraft servers require glibc.i686 and libstdc++.i686
+	if [ "${gamename}" != "TeamSpeak 3" ]&&[ "${gamename}" != "Mumble" ]&&[ "${engine}" != "lwjgl2" ]&&[ "${engine}" != "RenderWare" ]; then
 		array_deps_required+=( glibc.i686 libstdc++.i686 )
 	fi
 

+ 23 - 4
lgsm/functions/command_details.sh

@@ -168,6 +168,11 @@ fn_details_gameserver(){
 			echo -e "${blue}dbplugin:\t${default}${dbplugin}"
 		fi
 
+		# ASE (Multi Theft Auto)
+		if [ -n "${ase}" ]; then
+			echo -e "${blue}ASE:\t${default}${ase}"
+		fi
+
 		# Online status
 		if [ "${status}" == "0" ]; then
 			echo -e "${blue}Status:\t${red}OFFLINE${default}"
@@ -310,7 +315,7 @@ fn_details_ports(){
 
 	parmslocation="${red}UNKNOWN${default}"
 	# engines/games that require editing in the config file
-	local ports_edit_array=( "avalanche" "dontstarve" "idtech2" "idtech3" "idtech3_ql" "lwjgl2" "projectzomboid" "quake" "refractor" "seriousengine35" "teeworlds" "terraria" "unreal" "unreal2" "unreal3" "TeamSpeak 3" "Mumble" "7 Days To Die" )
+	local ports_edit_array=( "avalanche" "dontstarve" "idtech2" "idtech3" "idtech3_ql" "lwjgl2" "projectzomboid" "quake" "refractor" "realvirtuality" "RenderWare" "seriousengine35" "teeworlds" "terraria" "unreal" "unreal2" "unreal3" "TeamSpeak 3" "Mumble" "7 Days To Die" )
 	for port_edit in "${ports_edit_array[@]}"
 	do
 		if [ "${engine}" == "${port_edit}" ]||[ "${gamename}" == "${port_edit}" ]; then
@@ -726,6 +731,18 @@ fn_details_wolfensteinenemyterritory(){
 	} | column -s $'\t' -t
 }
 
+fn_details_mta(){
+	echo -e "netstat -atunp | grep mta-server64"
+	echo -e ""
+	{
+		echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL\tINI VARIABLE"
+		echo -e "> Game\tOUTBOUND\t${port}\tudp\tPort=${port}"
+		echo -e "> HTTP Server\tINBOUND\t${httpport}\ttcp"
+		if [ "${ase}" == "Enabled" ]; then
+			echo -e "> ASE Game_Monitor\tOUTBOUND\t$((${port} + 123))\tudp"
+		fi
+	} | column -s $'\t' -t
+}
 
 # Run checks and gathers details to display.
 
@@ -742,7 +759,7 @@ fn_display_details() {
 	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" ]&&[ "${engine}" != "RenderWare" ]; then
 		fn_parms
 		fn_details_commandlineparms
 	fi
@@ -793,6 +810,8 @@ fn_display_details() {
 		fn_details_cod4
 	elif [ "${gamename}" == "Call of Duty: World at War" ]; then
 		fn_details_codwaw
+	elif [ "${gamename}" == "Factorio" ]; then
+		fn_details_factorio    
 	elif [ "${gamename}" == "Hurtworld" ]; then
 		fn_details_hurtworld
 	elif [ "${gamename}" == "QuakeWorld" ]; then
@@ -805,14 +824,14 @@ fn_display_details() {
 		fn_details_quakelive
 	elif [ "${gamename}" == "TeamSpeak 3" ]; then
 		fn_details_teamspeak3
+	elif [ "${gamename}" == "Multi Theft Auto" ]; then
+		fn_details_mta    
 	elif [ "${gamename}" == "Mumble" ]; then
 		fn_details_mumble
 	elif [ "${gamename}" == "Rust" ]; then
 		fn_details_rust
 	elif [ "${gamename}" == "Wolfenstein: Enemy Territory" ]; then
 		fn_details_wolfensteinenemyterritory
-	elif [ "${gamename}" == "Factorio" ]; then
-		fn_details_factorio
 	else
 		fn_print_error_nl "Unable to detect server engine."
 	fi

+ 2 - 0
lgsm/functions/command_install.sh

@@ -34,6 +34,8 @@ elif [ "${gamename}" == "Don't Starve Together" ]; then
 	install_dst_token.sh
 elif [ "${gamename}" == "TeamSpeak 3" ]; then
 	install_ts3db.sh
+elif [ "${gamename}" == "Multi Theft Auto" ]; then
+	install_mta_resources.sh
 fi
 
 fix.sh

+ 30 - 0
lgsm/functions/command_stop.sh

@@ -190,6 +190,34 @@ fn_stop_graceful_minecraft(){
 	fn_stop_tmux
 }
 
+# Attempts graceful of mta using rcon 'quit' command.
+fn_stop_graceful_mta(){
+	fn_print_dots "Graceful: console quit"
+	fn_script_log_info "Graceful: console quit"
+	# sends quit
+	tmux send -t "${servicename}" quit ENTER > /dev/null 2>&1
+	# waits up to 120 seconds giving the server time to shutdown gracefuly, we need a long wait time here as resources are stopped individually and process their own shutdowns
+	for seconds in {1..120}; do
+		check_status.sh
+		if [ "${status}" == "0" ]; then
+			fn_print_ok "Graceful: console quit: ${seconds}: "
+			fn_print_ok_eol_nl
+			fn_script_log_pass "Graceful: console quit: OK: ${seconds} seconds"
+			break
+		fi
+		sleep 1
+		fn_print_dots "Graceful: console quit: ${seconds}"
+	done
+	check_status.sh
+	if [ "${status}" != "0" ]; then
+		fn_print_error "Graceful: console quit: "
+		fn_print_fail_eol_nl
+		fn_script_log_error "Graceful: console quit: FAIL"
+	fi
+	sleep 1
+	fn_stop_tmux
+}
+
 fn_stop_graceful_select(){
 	if [ "${gamename}" == "7 Days To Die" ]; then
 		fn_stop_graceful_sdtd
@@ -201,6 +229,8 @@ fn_stop_graceful_select(){
 		fn_stop_graceful_goldsource
 	elif [ "${engine}" == "lwjgl2" ]; then
 		fn_stop_graceful_minecraft
+	elif [ "${engine}" == "RenderWare" ]; then
+		fn_stop_graceful_mta
 	else
 		fn_stop_tmux
 	fi

+ 1 - 1
lgsm/functions/core_dl.sh

@@ -58,7 +58,7 @@ fn_dl_extract(){
 	mime=$(file -b --mime-type "${filedir}/${filename}")
 
 	if [ "${mime}" == "application/gzip" ]||[ "${mime}" == "application/x-gzip" ]; then
-		tarcmd=$(tar -zxf "${filedir}/${filename}" -C "${extractdir}")
+		tarcmd=$(tar -zxf "${filedir}/${filename}" -C "${extractdir}" --strip-components=1)
 	elif [ "${mime}" == "application/x-bzip2" ]; then
 		tarcmd=$(tar -jxf "${filedir}/${filename}" -C "${extractdir}")
 	elif [ "${mime}" == "application/zip" ]; then

+ 5 - 0
lgsm/functions/core_functions.sh

@@ -571,6 +571,11 @@ functionfile="${FUNCNAME}"
 fn_fetch_function
 }
 
+install_mta_resources.sh(){
+functionfile="${FUNCNAME}"
+fn_fetch_function
+}
+
 # Calls the global Ctrl-C trap
 core_trap.sh
 

+ 1 - 1
lgsm/functions/core_getopt.sh

@@ -789,7 +789,7 @@ elif [ "${engine}" == "unreal2" ]; then
 elif [ "${engine}" == "unreal" ]; then
 	fn_getopt_unreal
 # Generic
-elif [ "${gamename}" == "Battlefield: 1942" ]||[ "${gamename}" == "Call of Duty" ]||[ "${gamename}" == "Call of Duty: United Offensive" ]||[ "${gamename}" == "Call of Duty 2" ]||[ "${gamename}" == "Call of Duty 4" ]||[ "${gamename}" == "Call of Duty: World at War" ]||[ "${gamename}" == "QuakeWorld" ]||[ "${gamename}" == "Quake 2" ]||[ "${gamename}" == "Quake 3: Arena" ]||[ "${gamename}" == "Wolfenstein: Enemy Territory" ]; then
+elif [ "${gamename}" == "Battlefield: 1942" ]||[ "${gamename}" == "Call of Duty" ]||[ "${gamename}" == "Call of Duty: United Offensive" ]||[ "${gamename}" == "Call of Duty 2" ]||[ "${gamename}" == "Call of Duty 4" ]||[ "${gamename}" == "Call of Duty: World at War" ]||[ "${gamename}" == "Multi Theft Auto" ]||[ "${gamename}" == "QuakeWorld" ]||[ "${gamename}" == "Quake 2" ]||[ "${gamename}" == "Quake 3: Arena" ]||[ "${gamename}" == "Wolfenstein: Enemy Territory" ]; then
 	fn_getopt_generic_no_update
 elif  [ "${gamename}" == "Factorio" ]; then
 	fn_getopt_generic_update_no_steam	

+ 34 - 0
lgsm/functions/info_config.sh

@@ -603,6 +603,38 @@ fn_info_config_sdtd(){
 	fi
 }
 
+fn_info_config_mta(){
+	if [ ! -f "${servercfgfullpath}" ]; then
+		port="${unavailable}"
+		httpport="${unavailable}"
+		ase="${unavailable}"
+		servername="${unavailable}"
+		serverpassword="${unavailable}"
+		maxplayers="${zero}"
+	else
+		port=$(grep -m 1 "serverport" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/<serverport>//g' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//' | cut -f1 -d "<" | tr -cd '[:digit:]')
+		httpport=$(grep -m 1 "httpport" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/<httpport>//g' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//' | cut -f1 -d "<" | tr -cd '[:digit:]')
+		ase=$(grep -m 1 "ase" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/<ase>//g' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//' | cut -f1 -d "<" | tr -cd '[:digit:]')
+		servername=$(grep -m 1 "servername" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/<servername>//g' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//' | cut -f1 -d "<")
+		serverpassword=$(grep -m 1 "password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/<password>//g' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//' | cut -f1 -d "<")
+		maxplayers=$(grep -m 1 "maxplayers" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/<maxplayers>//g' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//' | cut -f1 -d "<" | tr -cd '[:digit:]')
+
+		if [ "${ase}" == "1" ]; then
+			ase="Enabled"
+		else
+			ase="Disabled"
+		fi
+
+		# Not Set
+		port=${port:-"NOT SET - Defaults to 22003"}
+		httpport=${httpport:-"NOT SET - Defaults to 22005"}
+		ase=${ase:-"NOT SET - Defaults to Disabled"}
+		servername=${servername:-"NOT SET"}
+		serverpassword=${serverpassword:-"NOT SET - Defaults to none"}
+		maxplayers=${maxplayers:-"0"}
+	fi
+}
+
 # Just Cause 2
 if [ "${engine}" == "avalanche" ]; then
 	fn_info_config_avalanche
@@ -676,4 +708,6 @@ elif [ "${gamename}" == "7 Days To Die" ]; then
 	fn_info_config_sdtd
 elif [ "${gamename}" == "Wolfenstein: Enemy Territory" ]; then
 	fn_info_config_wolfensteinenemyterritory
+elif [ "${gamename}" == "Multi Theft Auto" ]; then
+	fn_info_config_mta
 fi

+ 3 - 0
lgsm/functions/info_glibc.sh

@@ -134,6 +134,9 @@ elif [ "${engine}" == "refractor" ]; then
 elif [ "${gamename}" == "Wolfenstein: Enemy Territory" ]; then
 	glibcrequired="2.2.4"
 	glibcfix="no"
+elif [ "${gamename}" == "Multi Theft Auto" ]; then
+	glibcrequired="NOT REQUIRED"
+	glibcfix="no"
 else
 	glibcrequired="UNKNOWN"
 	glibcfix="no"

+ 7 - 0
lgsm/functions/install_config.sh

@@ -498,4 +498,11 @@ elif [ "${gamename}" == "Wolfenstein: Enemy Territory" ]; then
 	fn_fetch_default_config
 	fn_default_config_remote
 	fn_set_config_vars
+elif [ "${gamename}" == "Multi Theft Auto" ]; then
+	gamedirname="MultiTheftAuto"
+	fn_check_cfgdir
+	array_configs+=( acl.xml mtaserver.conf vehiclecolors.conf )
+	fn_fetch_default_config
+	fn_default_config_remote
+	fn_set_config_vars
 fi

+ 58 - 0
lgsm/functions/install_mta_resources.sh

@@ -0,0 +1,58 @@
+#!/bin/bash
+# LGSM install_mta_resources.sh function
+# Author: Daniel Gibbs
+# Contributor: ChaosMTA
+# Website: https://gameservermanagers.com
+# Description: Installs the libmysqlclient for database functions on the server and optionally installs default resources required to run the server
+
+local commandname="INSTALL"
+local commandaction="Install"
+local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
+
+fn_install_libmysqlclient16(){
+	echo ""
+	echo "Checking if libmysqlclient16 is installed"
+	echo "================================="
+	sleep 1
+	if [ ! -f /usr/lib/libmysqlclient.so.16 ]; then
+		fn_print_warn_nl "libmysqlclient16 not installed. Installing.."
+		sleep 1
+		sudo -v > /dev/null 2>&1
+		if [ $? -eq 0 ]; then
+    	fileurl="https://nightly.mtasa.com/files/modules/64/libmysqlclient.so.16"; filedir="${tmpdir}"; filename="libmysqlclient.so.16"; executecmd="executecmd" run="norun"; force="noforce"; md5="6c188e0f8fb5d7a29f4bc413b9fed6c2"
+    	fn_fetch_file "${fileurl}" "${filedir}" "${filename}" "${executecmd}" "${run}" "${force}" "${md5}"
+			sudo mv ${tmpdir}/${filename} /usr/lib/${filename}
+		else
+			fn_print_fail_nl "Failed to install libmysqlclient16, $(whoami) does not have sudo access. Download it manually and place it in /usr/lib"
+			sleep 1
+		fi
+	else
+  	echo "libmysqlclient16 already installed."
+	fi
+}
+
+fn_install_resources(){
+	echo ""
+	echo "Installing Default Resources"
+	echo "================================="
+  fileurl="http://mirror.mtasa.com/mtasa/resources/mtasa-resources-latest.zip"; filedir="${tmpdir}"; filename="multitheftauto_resources.zip"; executecmd="noexecute" run="norun"; force="noforce"; md5="97a587509698f7f010bcd6e5c6dd9c31"
+  fn_fetch_file "${fileurl}" "${filedir}" "${filename}" "${executecmd}" "${run}" "${force}" "${md5}"
+	fn_dl_extract "${filedir}" "${filename}" "${resourcesdir}"
+  echo "Default Resources Installed."
+}
+
+fn_install_libmysqlclient16
+
+if [ -z "${autoinstall}" ]; then
+	echo ""
+	while true; do
+		read -e -i "y" -p "Do you want to have the default resources downloaded? (Server is inoperable without resources!) [y/N]" yn
+		case $yn in
+		[Yy]* ) fn_install_resources && break;;
+		[Nn]* ) break;;
+		* ) echo "Please answer yes or no.";;
+		esac
+	done
+else
+fn_print_warning_nl "./${selfname} auto-install does not download the default resources. If you require them use ./${selfname} install"
+fi

+ 2 - 0
lgsm/functions/install_server_files.sh

@@ -39,6 +39,8 @@ fn_install_server_files(){
 		fileurl="http://files.gameservermanagers.com/UnrealTournament3/UT3-linux-server-2.1.tar.bz2"; filedir="${tmpdir}"; filename="UT3-linux-server-2.1.tar.bz2";  executecmd="noexecute" run="norun"; force="noforce"; md5="2527437b46f1b47f20228d27d72395a6"
 	elif [ "${gamename}" == "Wolfenstein: Enemy Territory" ]; then
 		fileurl="http://files.gameservermanagers.com/WolfensteinEnemyTerritory/enemy-territory.260b.tar.bz2"; filedir="${tmpdir}"; filename="enemy-territory.260b.tar.bz2";  executecmd="noexecute" run="norun"; force="noforce"; md5="f833f514bfcdd46b42c111f83350c5a7"
+	elif [ "${gamename}" == "Multi Theft Auto" ]; then
+		fileurl="https://linux.mtasa.com/dl/153/multitheftauto_linux_x64-1.5.3.tar.gz"; filedir="${tmpdir}"; filename="multitheftauto_linux_x64-1.5.3.tar.gz"; executecmd="noexecute" run="norun"; force="noforce"; md5="77caf91fe280877a8d21f8046d5f42ba"
 	fi
 	fn_fetch_file "${fileurl}" "${filedir}" "${filename}" "${executecmd}" "${run}" "${force}" "${md5}"
 	fn_dl_extract "${filedir}" "${filename}" "${filesdir}"