فهرست منبع

Merge remote-tracking branch 'refs/remotes/origin/master' into development

Daniel Gibbs 9 سال پیش
والد
کامیت
2fb6547b7a

+ 1 - 1
7DaysToDie/sdtdserver

@@ -74,9 +74,9 @@ systemdir="${filesdir}"
 executabledir="${filesdir}"
 executable="./7DaysToDieServer.x86"
 servercfg="${servicename}.xml"
+servercfgdefault="serverconfig.xml"
 servercfgdir="${filesdir}"
 servercfgfullpath="${servercfgdir}/${servercfg}"
-servercfgdefault="${servercfgdir}/serverconfig.xml"
 backupdir="${rootdir}/backups"
 
 # Logging

+ 1 - 1
Battlefield1942/bf1942server

@@ -29,7 +29,7 @@ pushbullettoken="accesstoken"
 # Start Variables
 
 fn_parms(){
-parms=" +hostServer 1 +dedicated 1"
+parms="+hostServer 1 +dedicated 1"
 }
 
 #### Advanced Variables ####

+ 1 - 0
JustCause2/cfg/config.lua

@@ -177,3 +177,4 @@ World =
     -- The default weather severity at world creation.
     -- Default value: 0
     WeatherSeverity             = 0
+}

+ 0 - 1
JustCause2/jc2server

@@ -31,7 +31,6 @@ steamuser="anonymous"
 steampass=""
 
 # Start Variables
-ip="0.0.0.0"
 updateonstart="off"
 
 fn_parms(){

+ 0 - 1
Mumble/mumbleserver

@@ -43,7 +43,6 @@ githubuser="GameServerManagers"
 githubrepo="LinuxGSM"
 githubbranch="master"
 
-
 # Server Details
 gamename="Mumble"
 servicename="mumble-server"

+ 0 - 0
SvenCoop/svencoopserver → SvenCoop/svenserver


+ 0 - 1
WolfensteinEnemyTerritory/wetserver

@@ -27,7 +27,6 @@ pushbulletalert="off"
 pushbullettoken="accesstoken"
 
 # Start Variables
-ip="0.0.0.0"
 
 fn_parms(){
 	parms="+set net_strict 1 +set fs_homepath ${filesdir} +exec ${servercfg}"

+ 9 - 3
lgsm/functions/check_ip.sh

@@ -16,7 +16,7 @@ if [ "${gamename}" != "TeamSpeak 3" ] && [ "${gamename}" != "Mumble" ]; then
 	fi
 	getip=$(${ipcommand} -o -4 addr|awk '{print $4}'|grep -oe '\([0-9]\{1,3\}\.\?\)\{4\}'|grep -v 127.0.0)
 	getipwc=$(${ipcommand} -o -4 addr|awk '{print $4}'|grep -oe '\([0-9]\{1,3\}\.\?\)\{4\}'|grep -vc 127.0.0)
-
+	info_config.sh
 	if [ "${ip}" == "0.0.0.0" ]||[ "${ip}" == "" ]; then
 		if [ "${getipwc}" -ge "2" ]; then
 			fn_print_dots "Check IP"
@@ -24,8 +24,14 @@ if [ "${gamename}" != "TeamSpeak 3" ] && [ "${gamename}" != "Mumble" ]; then
 			fn_print_fail "Check IP: Multiple active network interfaces found."
 			sleep 1
 			echo -en "\n"
-			fn_print_information "Specify the IP you want to use within the ${selfname} script.\n"
-			echo -en "Set ip=\"0.0.0.0\" to one of the following:\n"
+			if [ "${ipsetinconfig}" == "1" ]; then
+				fn_print_information "Specify the IP you want to use within the server config file ${servercfg}.\n"
+				echo -en "${servercfgfullpath}\n"
+				echo -en "Set ${ipinconfigvar} to one of the following:\n"
+			else
+				fn_print_information "Specify the IP you want to use within the ${selfname} script.\n"
+				echo -en "Set ip=\"0.0.0.0\" to one of the following:\n"
+			fi
 			echo -en "${getip}\n"
 			echo -en ""
 			echo -en "https://gameservermanagers.com/network-interfaces\n"

+ 7 - 1
lgsm/functions/command_dev_detect_glibc.sh

@@ -9,6 +9,12 @@ echo "================================="
 echo "GLIBC Requirements Checker"
 echo "================================="
 
+if [ -z "$(command -v objdump)" ]; then
+	fn_print_failure_nl "objdump is missing"
+	fn_script_log_fatal "objdump is missing"
+	core_exit.sh
+fi
+
 if [ -z "${filesdir}" ]; then
 	dir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))"
 fi
@@ -31,4 +37,4 @@ while IFS= read -r -d $'\0' line; do
 done
 echo ""
 cat "${tmpdir}/detect_glibc.tmp"|sort|uniq|sort -r --version-sort
-rm "${tmpdir}/detect_glibc.tmp"
+#rm "${tmpdir}/detect_glibc.tmp"

+ 113 - 112
lgsm/functions/gsquery.py

@@ -9,122 +9,123 @@ import optparse
 import socket
 import sys
 
+
 class GameServer:
-	def __init__( self, options, arguments ):
-		self.option = options
-		self.argument = arguments
-		#
-		self.server_response_timeout = 5
-		self.default_buffer_length = 1024
-		#
-		if self.option.engine == 'avalanche':
-			self.query_prompt_string = b'\xFE\xFD\x09\x10\x20\x30\x40'
-		
-		elif self.option.engine == 'goldsource':
-			self.query_prompt_string = b'\xFF\xFF\xFF\xFFTSource Engine Query\0'
-		elif self.option.engine == 'idtech3':
-			self.query_prompt_string = b'\xff\xff\xff\xffgetstatus'
-		elif self.option.engine == 'quakelive':
-			self.query_prompt_string = b'\xFF\xFF\xFF\xFFTSource Engine Query\0'				
-		elif self.option.engine == 'realvirtuality':
-			self.query_prompt_string = b'\xFF\xFF\xFF\xFFTSource Engine Query\0'			
-		elif self.option.engine == 'refractor':
-			self.query_prompt_string = b'\xFF\xFF\xFF\xFFTSource Engine Query\0'				
-		elif self.option.engine == 'source':
-			self.query_prompt_string = b'\xFF\xFF\xFF\xFFTSource Engine Query\0'
-		elif self.option.engine == 'spark':
-			self.query_prompt_string = b'\xFF\xFF\xFF\xFFTSource Engine Query\0'
-		elif self.option.engine == 'unity3d':
-			self.query_prompt_string = '\xFF\xFF\xFF\xFFTSource Engine Query\0'
-		elif self.option.engine == 'unreal':
-			self.query_prompt_string = b'\x5C\x69\x6E\x66\x6F\x5C'
-		elif self.option.engine == 'unreal2':
-			self.query_prompt_string = b'\x79\x00\x00\x00\x00'
-			self.connected = False
-		self.response = None
-		self.sanity_checks()
+    def __init__(self, options, arguments):
+        self.option = options
+        self.argument = arguments
+        #
+        self.server_response_timeout = 5
+        self.default_buffer_length = 1024
+        #
+        if self.option.engine == 'avalanche':
+            self.query_prompt_string = b'\xFE\xFD\x09\x10\x20\x30\x40'
+        elif self.option.engine == 'goldsource':
+            self.query_prompt_string = b'\xFF\xFF\xFF\xFFTSource Engine Query\0'
+        elif self.option.engine == 'idtech3':
+            self.query_prompt_string = b'\xff\xff\xff\xffgetstatus'
+        elif self.option.engine == 'quakelive':
+            self.query_prompt_string = b'\xFF\xFF\xFF\xFFTSource Engine Query\0'
+        elif self.option.engine == 'realvirtuality':
+            self.query_prompt_string = b'\xFF\xFF\xFF\xFFTSource Engine Query\0'
+        elif self.option.engine == 'refractor':
+            self.query_prompt_string = b'\xFF\xFF\xFF\xFFTSource Engine Query\0'
+        elif self.option.engine == 'source':
+            self.query_prompt_string = b'\xFF\xFF\xFF\xFFTSource Engine Query\0'
+        elif self.option.engine == 'spark':
+            self.query_prompt_string = b'\xFF\xFF\xFF\xFFTSource Engine Query\0'
+        elif self.option.engine == 'unity3d':
+            self.query_prompt_string = '\xFF\xFF\xFF\xFFTSource Engine Query\0'
+        elif self.option.engine == 'unreal':
+            self.query_prompt_string = b'\x5C\x69\x6E\x66\x6F\x5C'
+        elif self.option.engine == 'unreal2':
+            self.query_prompt_string = b'\x79\x00\x00\x00\x00'
+        self.connected = False
+        self.response = None
+        self.sanity_checks()
+
+    def fatal_error(self, error_message, error_code=1):
+        sys.stderr.write('ERROR: ' + str(error_message) + '\n')
+        sys.exit(error_code)
 
-	def fatal_error( self, error_message, error_code=1 ):
-		sys.stderr.write( 'ERROR: ' + str(error_message) + '\n' )
-		sys.exit( error_code )
+    def exit_success(self, success_message=''):
+        sys.stdout.write('OK: ' + str(success_message) + '\n')
+        sys.exit(0)
 
-	def exit_success( self, success_message='' ):
-		sys.stdout.write( 'OK: ' + str(success_message) + '\n' )
-		sys.exit( 0 )
+    def responding(self):
+        # Connect.
+        connection = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
+        connection.settimeout(self.server_response_timeout)
+        try:
+            self.connected = connection.connect((self.option.address, int(self.option.port)))
+        except socket.timeout:
+            self.fatal_error('Request timed out', 1)
+        except:
+            self.fatal_error('Unable to connect', 1)
+        # Send.
+        connection.send(self.query_prompt_string)
+        # Receive.
+        try:
+            self.response = connection.recv(self.default_buffer_length)
+        except socket.error:
+            self.fatal_error('Unable to receive', 2)
+        connection.close()
+        # Response.
+        if self.response is None:
+            self.fatal_error('No response', 3)
+        if len(self.response) < 10:
+            sys.exit('Short response.', 3)
+        else:
+            self.exit_success(str(self.response))
 
-	def responding( self ):
-		# Connect.
-		connection = socket.socket( socket.AF_INET, socket.SOCK_DGRAM )
-		connection.settimeout( self.server_response_timeout )
-		try:
-			self.connected = connection.connect( ( self.option.address, int(self.option.port) ) )
-		except socket.timeout:
-			self.fatal_error( 'Request timed out', 1 )
-		except:
-			self.fatal_error( 'Unable to connect', 1 )
-		# Send.
-		connection.send( self.query_prompt_string )
-		# Receive.
-		try:
-			self.response = connection.recv( self.default_buffer_length )
-		except socket.error:
-			self.fatal_error( 'Unable to receive', 2 )
-		connection.close()
-		# Response.
-		if self.response == None:
-			self.fatal_error( 'No response', 3 )
-		if len( self.response ) < 10 :
-			sys.exit( 'Short response.', 3 )
-		else:
-			self.exit_success( str( self.response ) )
+    def sanity_checks(self):
+        if not self.option.address:
+            self.fatal_error('No IPv4 address supplied.', 4)
+        if not self.option.port:
+            self.fatal_error('No port supplied.', 4)
 
-	def sanity_checks( self ):
-		if not self.option.address:
-			self.fatal_error( 'No IPv4 address supplied.', 4 )
-		if not self.option.port:
-			self.fatal_error( 'No port supplied.', 4 )
 
 if __name__ == '__main__':
-	parser = optparse.OptionParser(
-		usage = 'usage: python %prog [options]',
-		version = '%prog 0.0.1'
-	)
-	parser.add_option(
-		'-a', '--address',
-		action = 'store',
-		dest = 'address',
-		default = False,
-		help = 'The IPv4 address of the server.'
-	)
-	parser.add_option(
-		'-p', '--port',
-		action = 'store',
-		dest = 'port',
-		default = False,
-		help = 'The IPv4 port of the server.'
-	)
-	parser.add_option(
-		'-e', '--engine',
-		action = 'store',
-		dest = 'engine',
-		default = False,
-		help = 'Engine type: avalanche, goldsource, idtech3, realvirtuality, quakelive, refractor, spark, source, unity3d, unreal, unreal2.'
-	)
-	parser.add_option(
-		'-v', '--verbose',
-		action = 'store_true',
-		dest = 'verbose',
-		default = False,
-		help = 'Display verbose output.'
-	)
-	parser.add_option(
-		'-d', '--debug',
-		action = 'store_true',
-		dest = 'debug',
-		default = False,
-		help = 'Display debugging output.'
-	)
-	options, arguments = parser.parse_args()
-	#
-	server = GameServer( options, arguments )
-	server.responding()
+    parser = optparse.OptionParser(
+        usage='usage: python %prog [options]',
+        version='%prog 0.0.1'
+    )
+    parser.add_option(
+        '-a', '--address',
+        action='store',
+        dest='address',
+        default=False,
+        help='The IPv4 address of the server.'
+    )
+    parser.add_option(
+        '-p', '--port',
+        action='store',
+        dest='port',
+        default=False,
+        help='The IPv4 port of the server.'
+    )
+    parser.add_option(
+        '-e', '--engine',
+        action='store',
+        dest='engine',
+        default=False,
+        help='Engine type: avalanche, goldsource, idtech3, realvirtuality, quakelive, refractor, spark, source, unity3d, unreal, unreal2.'
+    )
+    parser.add_option(
+        '-v', '--verbose',
+        action='store_true',
+        dest='verbose',
+        default=False,
+        help='Display verbose output.'
+    )
+    parser.add_option(
+        '-d', '--debug',
+        action='store_true',
+        dest='debug',
+        default=False,
+        help='Display debugging output.'
+    )
+    options, arguments = parser.parse_args()
+    #
+    server = GameServer(options, arguments)
+    server.responding()

+ 66 - 76
lgsm/functions/info_config.sh

@@ -22,8 +22,8 @@ fn_info_config_avalanche(){
 		port="${zero}"
 	else
 
-		servername=$(grep "Name" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^--/d' -e 's/Name//g' | tr -d '=\";,:' | xargs -0)
-		serverpassword=$(grep "Password" "${servercfgfullpath}" | sed -e 's/^ *//g' -e '/^--/d' -e 's/Password//g' | tr -d '=\";,:' | xargs -0)
+		servername=$(grep "Name" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^--/d' -e 's/Name//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//')
+		serverpassword=$(grep "Password" "${servercfgfullpath}" | sed -e 's/^ *//g' -e '/^--/d' -e 's/Password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//')
 		slots=$(grep "MaxPlayers" "${servercfgfullpath}" | grep -v "\--" | tr -cd '[:digit:]')
 		port=$(grep "BindPort" "${servercfgfullpath}" | grep -v "\--" | tr -cd '[:digit:]')
 
@@ -33,11 +33,9 @@ fn_info_config_avalanche(){
 		slots=${slots:-"0"}
 		port=${port:-"0"}
 
-		# check if the ip exists in the config file. Failing this will fall back to the default.
-		ipconfigcheck=$(grep "BindIP" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^--/d' -e 's/BindIP//g' | tr -d '=\";,:' | xargs -0)
-		if [ -n "${ipconfigcheck}" ]; then
-			ip="${ipconfigcheck}"
-		fi
+		ip=$(grep "BindIP" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^--/d' -e 's/BindIP//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//')
+		ipsetinconfig=1
+		ipinconfigvar="BindIP"
 	fi
 }
 
@@ -62,11 +60,9 @@ fn_info_config_bf1942(){
 		slots=${slots:-"0"}
 		port=${port:-"0"}
 
-		# check if the ip exists in the config file. Failing this will fall back to the default.
-		ipconfigcheck=$(grep "game.serverIP" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^--/d' -e 's/game.serverIP//g' | tr -d '=\";,:' | xargs)
-		if [ -n "${ipconfigcheck}" ]; then
-			ip="${ipconfigcheck}"
-		fi
+		ip=$(grep "game.serverIP" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^--/d' -e 's/game.serverIP//g' | tr -d '=\";,:' | xargs)
+		ipsetinconfig=1
+		ipinconfigvar="game.serverIP"
 	fi
 }
 
@@ -80,10 +76,10 @@ fn_info_config_dontstarve(){
 		tickrate="${zero}"
 		port="${zero}"
 	else
-		servername=$(grep "default_server_name" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/default_server_name//g' | tr -d '=\";,:' | xargs -0)
-		serverpassword=$(grep "server_password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/server_password//g' | tr -d '=\";,:' | xargs -0)
+		servername=$(grep "default_server_name" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/default_server_name//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//')
+		serverpassword=$(grep "server_password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/server_password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//')
 		slots=$(grep "max_players" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]')
-		gamemode=$(grep "game_mode" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/game_mode//g' | tr -d '=\";,:' | xargs -0)
+		gamemode=$(grep "game_mode" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/game_mode//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//')
 		tickrate=$(grep "tick_rate" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]')
 		port=$(grep "server_port" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]')
 
@@ -108,13 +104,13 @@ fn_info_config_minecraft(){
 		gameworld="${unavailable}"
 	else
 
-		servername=$(grep "motd" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/motd//g' | tr -d '=\";,:' | xargs -0)
-		rconpassword=$(grep "rcon.password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/rcon.password//g' | tr -d '=\";,:' | xargs -0)
+		servername=$(grep "motd" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/motd//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//')
+		rconpassword=$(grep "rcon.password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/rcon.password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//')
 		rconport=$(grep "rcon.port" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]')
 		slots=$(grep "max-players" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]')
 		port=$(grep "server-port" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]')
 		gamemode=$(grep "gamemode" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]')
-		gameworld=$(grep "level-name" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/level-name//g' | tr -d '=\";,:' | xargs -0)
+		gameworld=$(grep "level-name" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/level-name//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//')
 
 		# Not Set
 		servername=${servername:-"NOT SET"}
@@ -125,11 +121,9 @@ fn_info_config_minecraft(){
 		gamemode=${gamemode:-"NOT SET"}
 		gameworld=${gameworld:-"NOT SET"}
 
-		# check if the ip exists in the config file. Failing this will fall back to the default.
-		ipconfigcheck=$(grep "server-ip" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^--/d' -e 's/server-ip//g' | tr -d '=\";,:' | xargs -0)
-		if [ -n "${ipconfigcheck}" ]; then
-			ip="${ipconfigcheck}"
-		fi
+		ip=$(grep "server-ip" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^--/d' -e 's/server-ip//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//')
+		ipsetinconfig=1
+		ipinconfigvar="server-ip"
 	fi
 }
 
@@ -142,12 +136,12 @@ fn_info_config_projectzomboid(){
 		port="${zero}"
 		gameworld="${unavailable}"
 	else
-		servername=$(grep "PublicName" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/PublicName//g' | tr -d '=\";,:' | xargs -0)
-		serverpassword=$(grep "Password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' | grep "^Password" | sed  -e '/^#/d' -e 's/Password//g' | tr -d '=\";,:' | xargs -0)
-		rconpassword=$(grep "RCONPassword" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/RCONPassword//g' | tr -d '=\";,:' | xargs -0)
+		servername=$(grep "PublicName" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/PublicName//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//')
+		serverpassword=$(grep "Password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' | grep "^Password" | sed  -e '/^#/d' -e 's/Password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//')
+		rconpassword=$(grep "RCONPassword" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/RCONPassword//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//')
 		slots=$(grep "MaxPlayers" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]')
 		port=$(grep "DefaultPort" "${servercfgfullpath}" | tr -cd '[:digit:]')
-		gameworld=$(grep "Map" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' | grep "^Map" | sed -e '/^#/d' -e 's/Map//g' | tr -d '=\";' | xargs -0)
+		gameworld=$(grep "Map" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' | grep "^Map" | sed -e '/^#/d' -e 's/Map//g' | tr -d '=\";' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//')
 
 		# Not Set
 		servername=${servername:-"NOT SET"}
@@ -166,9 +160,9 @@ fn_info_config_quakelive(){
 		serverpassword="${unavailable}"
 		slots="${zero}"
 	else
-		rconpassword=$(grep "zmq_rcon_password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set zmq_rcon_password//g' | tr -d '=\";,:' | xargs -0)
-		servername=$(grep "sv_hostname" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set sv_hostname//g' | tr -d '=\";,:' | xargs -0)
-		serverpassword=$(grep "g_password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set g_password//g' | tr -d '=\";,:' | xargs -0)
+		rconpassword=$(grep "zmq_rcon_password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set zmq_rcon_password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//')
+		servername=$(grep "sv_hostname" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set sv_hostname//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//')
+		serverpassword=$(grep "g_password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set g_password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//')
 		slots=$(grep "sv_maxClients" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]')
 
 		# Not Set
@@ -176,10 +170,10 @@ fn_info_config_quakelive(){
 		servername=${servername:-"NOT SET"}
 		serverpassword=${serverpassword:-"NOT SET"}
 		slots=${slots:-"0"}
-		ipconfigcheck=$(grep "set net_ip" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set net_ip//g' | tr -d '=\";,:' | xargs -0)
-		if [ -n "${ipconfigcheck}" ]; then
-			ip="${ipconfigcheck}"
-		fi
+
+		ip=$(grep "set net_ip" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set net_ip//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//')
+		ipsetinconfig=1
+		ipinconfigvar="set net_ip"
 	fi
 }
 
@@ -192,9 +186,9 @@ fn_info_config_wolfensteinenemyterritory(){
 		port="${zero}"
 	else
 		port=$(grep "set net_port" "${servercfgfullpath}" | grep -v "//" | tr -cd '[:digit:]')
-		rconpassword=$(grep "set zmq_rcon_password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set zmq_rcon_password //g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//g' -e '/^\//d' | xargs -0)
-		servername=$(grep "set sv_hostname" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set sv_hostname //g' | tr -d '=\";,:' | xargs -0)
-		serverpassword=$(grep "set g_password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set g_password //g' | tr -d '=\";,:' | xargs -0)
+		rconpassword=$(grep "set zmq_rcon_password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set zmq_rcon_password //g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//g' -e '/^\//d' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//')
+		servername=$(grep "set sv_hostname" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set sv_hostname //g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//')
+		serverpassword=$(grep "set g_password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set g_password //g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//')
 		slots=$(grep "set sv_maxclients" "${servercfgfullpath}" | grep -v "//" | tr -cd '[:digit:]')
 
 
@@ -204,10 +198,10 @@ fn_info_config_wolfensteinenemyterritory(){
 		serverpassword=${serverpassword:-"NOT SET"}
 		slots=${slots:-"0"}
 		port=${port:-"27960"}
-		ipconfigcheck=$(grep "set net_ip" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set net_ip//g' | tr -d '=\";,:' | xargs -0)
-		if [ -n "${ipconfigcheck}" ]; then
-			ip="${ipconfigcheck}"
-		fi
+
+		ip=$(grep "set net_ip" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set net_ip//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//')
+		ipsetinconfig=1
+		ipinconfigvar="set net_ip"
 	fi
 }
 
@@ -218,9 +212,9 @@ fn_info_config_realvirtuality(){
 		serverpassword="${unavailable}"
 		slots="${zero}"
 	else
-		servername=$(grep "hostname" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/hostname//g' | tr -d '=\";,:' | xargs -0)
-		adminpassword=$(grep "passwordAdmin" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/passwordAdmin//g' | tr -d '=\";,:' | xargs -0)
-		serverpassword=$(grep "password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/password//g' | tr -d '=\";,:' | xargs -0)
+		servername=$(grep "hostname" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/hostname//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//')
+		adminpassword=$(grep "passwordAdmin" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/passwordAdmin//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//')
+		serverpassword=$(grep "password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//')
 		slots=$(grep "maxPlayers" "${servercfgfullpath}" | grep -v "//" | tr -cd '[:digit:]')
 
 		# Not Set
@@ -239,9 +233,9 @@ fn_info_config_seriousengine35(){
 		slots="${zero}"
 		port="${zero}"
 	else
-		servername=$(grep "prj_strMultiplayerSessionName" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/prj_strMultiplayerSessionName//g' | tr -d '=\";,:' | xargs -0)
-		rconpassword=$(grep "rcts_strAdminPassword" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/rcts_strAdminPassword//g' | tr -d '=\";,:' | xargs -0)
-		gamemode=$(grep "gam_idGameMode" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/gam_idGameMode//g' | tr -d '=\";,:' | xargs -0)
+		servername=$(grep "prj_strMultiplayerSessionName" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/prj_strMultiplayerSessionName//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//')
+		rconpassword=$(grep "rcts_strAdminPassword" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/rcts_strAdminPassword//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//')
+		gamemode=$(grep "gam_idGameMode" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/gam_idGameMode//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//')
 		slots=$(grep "gam_ctMaxPlayers" "${servercfgfullpath}" | grep -v "//" | tr -cd '[:digit:]')
 		port=$(grep "prj_uwPort" "${servercfgfullpath}" | grep -v "//" | tr -cd '[:digit:]')
 
@@ -260,9 +254,9 @@ fn_info_config_source(){
 		serverpassword="${unavailable}"
 		rconpassword="${unavailable}"
 	else
-		servername=$(grep "hostname" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/hostname//g' | tr -d '=\";,:' | xargs -0)
-		serverpassword=$(grep "sv_password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/sv_password//g' | tr -d '=\";,:' | xargs -0)
-		rconpassword=$(grep "rcon_password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/rcon_password//g' | tr -d '=\";,:' | xargs -0)
+		servername=$(grep "hostname" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/hostname//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//')
+		serverpassword=$(grep "sv_password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/sv_password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//')
+		rconpassword=$(grep "rcon_password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/rcon_password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//')
 
 		# Not Set
 		servername=${servername:-"NOT SET"}
@@ -280,8 +274,8 @@ fn_info_config_starbound(){
 		rconport="21026"
 		slots="8"
 	else
-		servername=$(grep "serverName" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e 's/serverName//g' | tr -d '=\";,:' | xargs -0)
-		rconpassword=$(grep "rconServerPassword" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e 's/rconServerPassword//g' | tr -d '=\";,:' | xargs -0)
+		servername=$(grep "serverName" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e 's/serverName//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//')
+		rconpassword=$(grep "rconServerPassword" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e 's/rconServerPassword//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//')
 		port=$(grep "gameServerPort" "${servercfgfullpath}" | tr -cd '[:digit:]')
 		queryport=$(grep "queryServerPort" "${servercfgfullpath}" | tr -cd '[:digit:]')
 		rconport=$(grep "rconServerPort" "${servercfgfullpath}" | tr -cd '[:digit:]')
@@ -304,7 +298,7 @@ fn_info_config_teamspeak3(){
 		queryport="10011"
 		fileport="30033"
 	else
-		dbplugin=$(grep "dbplugin=" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/dbplugin=//g' | tr -d '=\";,:' | xargs -0)
+		dbplugin=$(grep "dbplugin=" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/dbplugin=//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//')
 		port=$(grep "default_voice_port" "${servercfgfullpath}" | tr -cd '[:digit:]')
 		queryport=$(grep "query_port" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]')
 		fileport=$(grep "filetransfer_port" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]')
@@ -314,11 +308,9 @@ fn_info_config_teamspeak3(){
 		queryport=${queryport:-"10011"}
 		fileport=${fileport:-"30033"}
 
-		# check if the ip exists in the config file. Failing this will fall back to the default.
-		ipconfigcheck=$(grep "voice_ip" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/voice_ip//g' | tr -d '=\";,:' | xargs -0)
-		if [ -n "${ipconfigcheck}" ]; then
-			ip="${ipconfigcheck}"
-		fi
+		ip=$(grep "voice_ip" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/voice_ip//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//')
+		ipsetinconfig=1
+		ipinconfigvar="voice_ip"
 	fi
 }
 
@@ -328,7 +320,7 @@ fn_info_config_mumble(){
 		queryport="${port}"
 		servername="Mumble"
 	else
-		port=$(grep "port" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^;/d' -e 's/port//g' | tr -d '=\";,:' | xargs -0)
+		port=$(grep "port" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^;/d' -e 's/port//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//')
 		queryport="${port}"
 
 		# Not Set
@@ -336,11 +328,9 @@ fn_info_config_mumble(){
 		queryport=${queryport:-"64738"}
 		servername="Mumble Port ${port}"
 
-		# check if the ip exists in the config file. Failing this will fall back to the default.
-		ipconfigcheck=$(cat "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^;/d' -e 's/voice_ip//g' | tr -d '=\";,:' | xargs -0)
-		if [ -n "${ipconfigcheck}" ]; then
-			ip="${ipconfigcheck}"
-		fi
+		ip=$(cat "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^;/d' -e 's/voice_ip//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//')
+		ipsetinconfig=1
+		ipinconfigvar="voice_ip"
 	fi
 }
 
@@ -352,9 +342,9 @@ fn_info_config_teeworlds(){
 		port="8303"
 		slots="12"
 	else
-		servername=$(grep "sv_name" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/^sv_name//g' | tr -d '=\";,:' | xargs -0)
-		serverpassword=$(grep "password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' | grep "^password" | sed -e '/^#/d' -e 's/^password//g' | tr -d '=\";,:' | xargs -0)
-		rconpassword=$(grep "sv_rcon_password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/^sv_rcon_password//g' | tr -d '=\";,:' | xargs -0)
+		servername=$(grep "sv_name" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/^sv_name//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//')
+		serverpassword=$(grep "password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' | grep "^password" | sed -e '/^#/d' -e 's/^password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//')
+		rconpassword=$(grep "sv_rcon_password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/^sv_rcon_password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//')
 		port=$(grep "sv_port" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]')
 		slots=$(grep "sv_max_clients" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]')
 
@@ -374,9 +364,9 @@ fn_info_config_terraria(){
 		gameworld="${unavailable}"
 		slots="${zero}"
 	else
-		servername=$(grep "worldname" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/worldname//g' | tr -d '=\";,:' | xargs -0)
+		servername=$(grep "worldname" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/worldname//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//')
 		port=$(grep "port" "${servercfgfullpath}" | tr -cd '[:digit:]')
-		gameworld=$(grep "world=" "${servercfgfullpath}" | grep -v "//" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/world=//g' | tr -d '=\";,:' | xargs -0)
+		gameworld=$(grep "world=" "${servercfgfullpath}" | grep -v "//" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/world=//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//')
 		slots=$(grep "maxplayers" "${servercfgfullpath}" | grep -v "//" | tr -cd '[:digit:]')
 
 		# Not Set
@@ -399,18 +389,18 @@ fn_info_config_unreal(){
 		webadminuser="${unavailable}"
 		webadminpass="${unavailable}"
 	else
-		servername=$(grep "ServerName" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/ServerName//g' | tr -d '=\";,:' | xargs -0)
-		serverpassword=$(grep "GamePassword" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/GamePassword//g' | tr -d '=\";,:' | xargs -0)
-		adminpassword=$(grep "AdminPassword" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/AdminPassword//g' | tr -d '=\";,:' | xargs -0)
+		servername=$(grep "ServerName" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/ServerName//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//')
+		serverpassword=$(grep "GamePassword" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/GamePassword//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//')
+		adminpassword=$(grep "AdminPassword" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/AdminPassword//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//')
 		port=$(grep "Port" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' | grep "^Port" | grep -v "#" | tr -cd '[:digit:]')
 		gsqueryport=$(grep "OldQueryPortNumber" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]')
-		webadminenabled=$(grep "bEnabled" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/bEnabled//g' | tr -d '=\";,:' | xargs -0)
+		webadminenabled=$(grep "bEnabled" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/bEnabled//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//')
 		webadminport=$(grep "ListenPort" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]')
 		if [ "${engine}" == "unreal" ]; then
-			webadminuser=$(grep "AdminUsername" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/AdminUsername//g' | tr -d '=\";,:' | xargs -0)
-			webadminpass=$(grep "UTServerAdmin.UTServerAdmin" "${servercfgfullpath}" -A 4 | grep "AdminPassword" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/AdminPassword//g' | tr -d '=\";,:' | xargs -0)
+			webadminuser=$(grep "AdminUsername" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/AdminUsername//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//')
+			webadminpass=$(grep "UTServerAdmin.UTServerAdmin" "${servercfgfullpath}" -A 4 | grep "AdminPassword" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/AdminPassword//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//')
 		else
-			webadminuser=$(grep "AdminName" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/AdminName//g' | tr -d '=\";,:' | xargs -0)
+			webadminuser=$(grep "AdminName" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/AdminName//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//')
 			webadminpass="${adminpassword}"
 		fi
 

+ 62 - 44
lgsm/functions/install_config.sh

@@ -19,26 +19,20 @@ fn_fetch_default_config(){
 	done
 }
 
-# allow user to input server name and password
-fn_user_input_config(){
-	if [ -z "${autoinstall}" ]; then
-		echo ""
-		echo "Configuring ${gamename} Server"
-		echo "================================="
-		sleep 1
-		read -p "Enter server name: " servername
-		read -p "Enter rcon password: " rconpass
-	else
-		servername="LinuxGSM"
-		rconpass="rcon$RANDOM"
-	fi
+# Changes some variables within the default configs
+# SERVERNAME to LinuxGSM
+# PASSWORD to random password
+fn_set_config_vars(){
+	random=$(strings /dev/urandom | grep -o '[[:alnum:]]' | head -n 8 | tr -d '\n'; echo)
+	servername="LinuxGSM"
+	rconpass="admin$random"
 	echo "changing hostname."
 	fn_script_log_info "changing hostname."
-	sed -i "s/\"<hostname>\"/\"${servername}\"/g" "${servercfgfullpath}"
 	sleep 1
-	echo "changing rconpassword."
-	fn_script_log_info "changing RCON password."
-	sed -i "s/\"<rconpassword>\"/\"${rconpass}\"/g" "${servercfgfullpath}"
+	sed -i "s/SERVERNAME/${servername}/g" "${servercfgfullpath}"
+	echo "changing rcon/admin password."
+	fn_script_log_info "changing rcon/admin password."
+	sed -i "s/ADMINPASSWORD/${rconpass}/g" "${servercfgfullpath}"
 	sleep 1
 }
 
@@ -72,191 +66,199 @@ if [ "${gamename}" == "7 Days To Die" ]; then
 	array_configs+=( serverconfig.xml )
 	fn_fetch_default_config
 	fn_default_config_remote
+	fn_set_config_vars
 elif [ "${gamename}" == "ARK: Survivial Evolved" ]; then
 	gamedirname="ARKSurvivalEvolved"
 	array_configs+=( GameUserSettings.ini )
 	fn_fetch_default_config
 	fn_default_config_remote
+	fn_set_config_vars
 elif [ "${gamename}" == "ARMA 3" ]; then
 	gamedirname="Arma3"
 	array_configs+=( server.cfg network.cfg )
 	fn_fetch_default_config
 	fn_default_config_remote
+	fn_set_config_vars
 elif [ "${gamename}" == "Battlefield: 1942" ]; then
 	gamedirname="Battlefield1942"
 	array_configs+=( serversettings.con )
 	fn_fetch_default_config
 	fn_default_config_remote
+	fn_set_config_vars
 elif [ "${gamename}" == "Blade Symphony" ]; then
 	gamedirname="BladeSymphony"
 	array_configs+=( server.cfg )
 	fn_fetch_default_config
 	fn_default_config_remote
-	fn_user_input_config
+	fn_set_config_vars
 elif [ "${gamename}" == "BrainBread 2" ]; then
 	gamedirname="BrainBread2"
 	array_configs+=( server.cfg )
 	fn_fetch_default_config
 	fn_default_config_remote
-	fn_user_input_config
+	fn_set_config_vars
 elif [ "${gamename}" == "Black Mesa: Deathmatch" ]; then
 	gamedirname="BlackMesa"
 	array_configs+=( server.cfg )
 	fn_fetch_default_config
 	fn_default_config_remote
-	fn_user_input_config
+	fn_set_config_vars
 elif [ "${gamename}" == "Codename CURE" ]; then
 	gamedirname="CodenameCURE"
 	array_configs+=( server.cfg )
 	fn_fetch_default_config
 	fn_default_config_remote
-	fn_user_input_config
+	fn_set_config_vars
 elif [ "${gamename}" == "Counter-Strike 1.6" ]; then
 	gamedirname="CounterStrike"
 	array_configs+=( server.cfg )
 	fn_fetch_default_config
 	fn_default_config_remote
-	fn_user_input_config
+	fn_set_config_vars
 elif [ "${gamename}" == "Counter-Strike: Condition Zero" ]; then
 	gamedirname="CounterStrikeConditionZero"
 	array_configs+=( server.cfg )
 	fn_fetch_default_config
 	fn_default_config_remote
-	fn_user_input_config
+	fn_set_config_vars
 elif [ "${gamename}" == "Counter-Strike: Global Offensive" ]; then
 	gamedirname="CounterStrikeGlobalOffensive"
 	array_configs+=( server.cfg )
 	fn_fetch_default_config
 	fn_default_config_remote
-	fn_user_input_config
+	fn_set_config_vars
 elif [ "${gamename}" == "Counter-Strike: Source" ]; then
 	gamedirname="CounterStrikeSource"
 	array_configs+=( server.cfg )
 	fn_fetch_default_config
 	fn_default_config_remote
-	fn_user_input_config
+	fn_set_config_vars
 elif [ "${gamename}" == "Day of Defeat" ]; then
 	gamedirname="DayOfDefeat"
 	array_configs+=( server.cfg )
 	fn_fetch_default_config
 	fn_default_config_remote
-	fn_user_input_config
+	fn_set_config_vars
 elif [ "${gamename}" == "Day of Defeat: Source" ]; then
 	gamedirname="DayOfDefeatSource"
 	array_configs+=( server.cfg )
 	fn_fetch_default_config
 	fn_default_config_remote
-	fn_user_input_config
+	fn_set_config_vars
 elif [ "${gamename}" == "Day of Infamy" ]; then
 	gamedirname="DayOfInfamy"
 	array_configs+=( server.cfg )
 	fn_fetch_default_config
 	fn_default_config_remote
-	fn_user_input_config
+	fn_set_config_vars
 elif [ "${gamename}" == "Deathmatch Classic" ]; then
 	gamedirname="DeathmatchClassic"
 	array_configs+=( server.cfg )
 	fn_fetch_default_config
 	fn_default_config_remote
-	fn_user_input_config
+	fn_set_config_vars
 elif [ "${gamename}" == "Don't Starve Together" ]; then
 	gamedirname="DontStarveTogether"
 	array_configs+=( Settings.ini )
 	fn_fetch_default_config
 	fn_default_config_remote
+	fn_set_config_vars
 elif [ "${gamename}" == "Double Action: Boogaloo" ]; then
 	gamedirname="DoubleActionBoogaloo"
 	array_configs+=( server.cfg )
 	fn_fetch_default_config
 	fn_default_config_remote
-	fn_user_input_config
+	fn_set_config_vars
 elif [ "${gamename}" == "Fistful of Frags" ]; then
 	gamedirname="FistfulofFrags"
 	array_configs+=( server.cfg )
 	fn_fetch_default_config
 	fn_default_config_remote
-	fn_user_input_config
+	fn_set_config_vars
 elif [ "${gamename}" == "Garry's Mod" ]; then
 	gamedirname="GarrysMod"
 	array_configs+=( server.cfg )
 	fn_fetch_default_config
 	fn_default_config_remote
-	fn_user_input_config
+	fn_set_config_vars
 elif [ "${gamename}" == "GoldenEye: Source" ]; then
 	gamedirname="GoldenEyeSource"
 	array_configs+=( server.cfg )
 	fn_fetch_default_config
 	fn_default_config_remote
-	fn_user_input_config
+	fn_set_config_vars
 elif [ "${gamename}" == "Half Life: Deathmatch" ]; then
 	gamedirname="HalfLifeDeathmatch"
 	array_configs+=( server.cfg )
 	fn_fetch_default_config
 	fn_default_config_remote
-	fn_user_input_config
+	fn_set_config_vars
 elif [ "${gamename}" == "Half-Life Deathmatch: Source" ]; then
 	gamedirname="HalfLifeDeathmatchSource"
 	array_configs+=( server.cfg )
 	fn_fetch_default_config
 	fn_default_config_remote
-	fn_user_input_config
+	fn_set_config_vars
 elif [ "${gamename}" == "Half-Life: Opposing Force" ]; then
 	gamedirname="OpposingForce"
 	array_configs+=( server.cfg )
 	fn_fetch_default_config
 	fn_default_config_remote
-	fn_user_input_config
+	fn_set_config_vars
 elif [ "${gamename}" == "Half Life 2: Deathmatch" ]; then
 	gamedirname="HalfLife2Deathmatch"
 	array_configs+=( server.cfg )
 	fn_fetch_default_config
 	fn_default_config_remote
-	fn_user_input_config
+	fn_set_config_vars
 elif [ "${gamename}" == "Insurgency" ]; then
 	gamedirname="Insurgency"
 	array_configs+=( server.cfg )
 	fn_fetch_default_config
 	fn_default_config_remote
-	fn_user_input_config
+	fn_set_config_vars
 elif [ "${gamename}" == "Just Cause 2" ]; then
 	gamedirname="JustCause2"
 	array_configs+=( config.lua )
 	fn_fetch_default_config
 	fn_default_config_remote
+	fn_set_config_vars
 elif [ "${gamename}" == "Killing Floor" ]; then
 	gamedirname="KillingFloor"
 	array_configs+=( Default.ini )
 	fn_fetch_default_config
 	fn_default_config_remote
+	fn_set_config_vars
 elif [ "${gamename}" == "Left 4 Dead" ]; then
 	gamedirname="Left4Dead"
 	array_configs+=( server.cfg )
 	fn_fetch_default_config
 	fn_default_config_remote
-	fn_user_input_config
+	fn_set_config_vars
 elif [ "${gamename}" == "Left 4 Dead" ]; then
 	gamedirname="Left4Dead"
 	array_configs+=( server.cfg )
 	fn_fetch_default_config
 	fn_default_config_remote
-	fn_user_input_config
+	fn_set_config_vars
 elif [ "${gamename}" == "Left 4 Dead 2" ]; then
 	gamedirname="Left4Dead2"
 	array_configs+=( server.cfg )
 	fn_fetch_default_config
 	fn_default_config_remote
-	fn_user_input_config
+	fn_set_config_vars
 elif [ "${gamename}" == "Minecraft" ]; then
 	gamedirname="Minecraft"
 	array_configs+=( server.properties )
 	fn_fetch_default_config
 	fn_default_config_remote
+	fn_set_config_vars
 elif [ "${gamename}" == "No More Room in Hell" ]; then
 	gamedirname="NoMoreRoominHell"
 	array_configs+=( server.cfg )
 	fn_fetch_default_config
 	fn_default_config_remote
-	fn_user_input_config
+	fn_set_config_vars
 elif [ "${gamename}" == "Mumble" ]; then
 	:
 elif [ "${gamename}" == "Natural Selection 2" ]; then
@@ -268,17 +270,19 @@ elif [ "${gamename}" == "Pirates, Vikings, and Knights II" ]; then
 	array_configs+=( server.cfg )
 	fn_fetch_default_config
 	fn_default_config_remote
-	fn_user_input_config
+	fn_set_config_vars
 elif [ "${gamename}" == "Project Zomboid" ]; then
 	gamedirname="ProjectZomboid"
 	array_configs+=( server.ini )
 	fn_fetch_default_config
 	fn_default_config_remote
+	fn_set_config_vars
 elif [ "${gamename}" == "Quake Live" ]; then
 	gamedirname="QuakeLive"
 	array_configs+=( server.cfg )
 	fn_fetch_default_config
 	fn_default_config_remote
+	fn_set_config_vars
 elif [ "${gamename}" == "Red Orchestra: Ostfront 41-45" ]; then
 	:
 elif [ "${gamename}" == "Ricochet" ]; then
@@ -286,76 +290,90 @@ elif [ "${gamename}" == "Ricochet" ]; then
 	array_configs+=( server.cfg )
 	fn_fetch_default_config
 	fn_default_config_remote
-	fn_user_input_config
+	fn_set_config_vars
 elif [ "${gamename}" == "Rust" ]; then
 	gamedirname="Rust"
 	array_configs+=( server.cfg )
 	fn_fetch_default_config
 	fn_default_config_remote
+	fn_set_config_vars
 elif [ "${gamename}" == "Serious Sam 3: BFE" ]; then
 	gamedirname="SeriousSam3BFE"
 	array_configs+=( server.ini )
 	fn_fetch_default_config
 	fn_default_config_remote
+	fn_set_config_vars
 elif [ "${gamename}" == "Starbound" ]; then
 	gamedirname="Starbound"
 	array_configs+=( starbound.config )
 	fn_fetch_default_config
 	fn_default_config_remote
+	fn_set_config_vars
 elif [ "${gamename}" == "Sven Co-op" ]; then
 	gamedirname="SvenCoop"
 	array_configs+=( server.cfg )
 	fn_fetch_default_config
 	fn_default_config_remote
+	fn_set_config_vars
 elif [ "${gamename}" == "Team Fortress 2" ]; then
 	gamedirname="TeamFortress2"
 	array_configs+=( server.cfg )
 	fn_fetch_default_config
 	fn_default_config_remote
+	fn_set_config_vars
 elif [ "${gamename}" == "Team Fortress Classic" ]; then
 	gamedirname="TeamFortressClassic"
 	array_configs+=( server.cfg )
 	fn_fetch_default_config
 	fn_default_config_remote
+	fn_set_config_vars
 elif [ "${gamename}" == "TeamSpeak 3" ]; then
 	gamedirname="TeamSpeak3"
 	array_configs+=( ts3server.ini )
 	fn_fetch_default_config
 	fn_default_config_remote
+	fn_set_config_vars
 elif [ "${gamename}" == "Teeworlds" ]; then
 	gamedirname="Teeworlds"
 	array_configs+=( server.cfg ctf.cfg dm.cfg duel.cfg tdm.cfg )
 	fn_fetch_default_config
 	fn_default_config_remote
+	fn_set_config_vars
 elif [ "${gamename}" == "Terraria" ]; then
 	gamedirname="Terraria"
 	array_configs+=( serverconfig.txt )
 	fn_fetch_default_config
 	fn_default_config_remote
+	fn_set_config_vars
 elif [ "${gamename}" == "Unreal Tournament" ]; then
 	gamedirname="UnrealTournament"
 	array_configs+=( Game.ini Engine.ini )
 	fn_fetch_default_config
 	fn_default_config_remote
+	fn_set_config_vars
 elif [ "${gamename}" == "Unreal Tournament 2004" ]; then
 	gamedirname="UnrealTournament2004"
 	array_configs+=( UT2004.ini )
 	fn_fetch_default_config
 	fn_default_config_remote
+	fn_set_config_vars
 elif [ "${gamename}" == "Unreal Tournament 3" ]; then
 	gamedirname="UnrealTournament3"
 	array_configs+=( UTGame.ini )
 	fn_fetch_default_config
 	fn_default_config_remote
+	fn_set_config_vars
 elif [ "${gamename}" == "Unreal Tournament 99" ]; then
 	gamedirname="UnrealTournament99"
 	array_configs+=( Default.ini )
 	fn_fetch_default_config
 	fn_default_config_remote
+	fn_set_config_vars
 elif [ "${gamename}" == "Wolfenstein: Enemy Territory" ]; then
 	gamedirname="WolfensteinEnemyTerritory"
 	array_configs+=( server.cfg )
 	fn_fetch_default_config
 	fn_default_config_remote
+	fn_set_config_vars
 fi