Przeglądaj źródła

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

# Conflicts:
#	lgsm/functions/info_config.sh
Daniel Gibbs 9 lat temu
rodzic
commit
710edbf524
1 zmienionych plików z 31 dodań i 36 usunięć
  1. 31 36
      lgsm/functions/info_config.sh

+ 31 - 36
lgsm/functions/info_config.sh

@@ -26,17 +26,16 @@ fn_info_config_avalanche(){
 		serverpassword=$(grep "Password" "${servercfgfullpath}" | sed -e 's/^ *//g' -e '/^--/d' -e 's/Password//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:]')
 		slots=$(grep "MaxPlayers" "${servercfgfullpath}" | grep -v "\--" | tr -cd '[:digit:]')
 		port=$(grep "BindPort" "${servercfgfullpath}" | grep -v "\--" | tr -cd '[:digit:]')
 		port=$(grep "BindPort" "${servercfgfullpath}" | grep -v "\--" | tr -cd '[:digit:]')
+
 		ip=$(grep "BindIP" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^--/d' -e 's/BindIP//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//')
 		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"
+
 		# Not Set
 		# Not Set
 		servername=${servername:-"NOT SET"}
 		servername=${servername:-"NOT SET"}
 		serverpassword=${serverpassword:-"NOT SET"}
 		serverpassword=${serverpassword:-"NOT SET"}
 		slots=${slots:-"0"}
 		slots=${slots:-"0"}
 		port=${port:-"0"}
 		port=${port:-"0"}
-		
-		# Misc Variables
-		ipsetinconfig=1
-		ipinconfigvar="BindIP"
 	fi
 	fi
 }
 }
 
 
@@ -54,17 +53,16 @@ fn_info_config_bf1942(){
 		slots=$(grep "game.serverMaxPlayers" "${servercfgfullpath}" | grep -v "\--" | tr -cd '[:digit:]')
 		slots=$(grep "game.serverMaxPlayers" "${servercfgfullpath}" | grep -v "\--" | tr -cd '[:digit:]')
 		port=$(grep "game.serverPort" "${servercfgfullpath}" | grep -v "\--" | tr -cd '[:digit:]')
 		port=$(grep "game.serverPort" "${servercfgfullpath}" | grep -v "\--" | tr -cd '[:digit:]')
 		queryport="22000"
 		queryport="22000"
+
 		ip=$(grep "game.serverIP" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^--/d' -e 's/game.serverIP//g' | tr -d '=\";,:' | xargs)
 		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"
+
 		# Not Set
 		# Not Set
 		servername=${servername:-"NOT SET"}
 		servername=${servername:-"NOT SET"}
 		serverpassword=${serverpassword:-"NOT SET"}
 		serverpassword=${serverpassword:-"NOT SET"}
 		slots=${slots:-"0"}
 		slots=${slots:-"0"}
 		port=${port:-"0"}
 		port=${port:-"0"}
-		
-		# Misc Variables
-		ipsetinconfig=1
-		ipinconfigvar="game.serverIP"
 	fi
 	fi
 }
 }
 
 
@@ -113,8 +111,11 @@ fn_info_config_minecraft(){
 		port=$(grep "server-port" "${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:]')
 		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 '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//')
 		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]*$//')
+
 		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]*$//')
 		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"
+
 		# Not Set
 		# Not Set
 		servername=${servername:-"NOT SET"}
 		servername=${servername:-"NOT SET"}
 		rconpassword=${rconpassword:-"NOT SET"}
 		rconpassword=${rconpassword:-"NOT SET"}
@@ -123,10 +124,7 @@ fn_info_config_minecraft(){
 		port=${port:-"NOT SET"}
 		port=${port:-"NOT SET"}
 		gamemode=${gamemode:-"NOT SET"}
 		gamemode=${gamemode:-"NOT SET"}
 		gameworld=${gameworld:-"NOT SET"}
 		gameworld=${gameworld:-"NOT SET"}
-		
-		# Misc Variables
-		ipsetinconfig=1
-		ipinconfigvar="server-ip"
+
 	fi
 	fi
 }
 }
 
 
@@ -167,17 +165,16 @@ fn_info_config_quakelive(){
 		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]*$//')
 		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]*$//')
 		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:]')
 		slots=$(grep "sv_maxClients" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]')
+
 		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]*$//')
 		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"
 
 
 		# Not Set
 		# Not Set
 		rconpassword=${rconpassword:-"NOT SET"}
 		rconpassword=${rconpassword:-"NOT SET"}
 		servername=${servername:-"NOT SET"}
 		servername=${servername:-"NOT SET"}
 		serverpassword=${serverpassword:-"NOT SET"}
 		serverpassword=${serverpassword:-"NOT SET"}
 		slots=${slots:-"0"}
 		slots=${slots:-"0"}
-		
-		# Misc Variables
-		ipsetinconfig=1
-		ipinconfigvar="set net_ip"
 	fi
 	fi
 }
 }
 
 
@@ -194,7 +191,10 @@ fn_info_config_wolfensteinenemyterritory(){
 		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]*$//')
 		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]*$//')
 		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:]')
 		slots=$(grep "set sv_maxclients" "${servercfgfullpath}" | grep -v "//" | tr -cd '[:digit:]')
+
 		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]*$//')
 		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"
 
 
 		# Not Set
 		# Not Set
 		rconpassword=${rconpassword:-"NOT SET"}
 		rconpassword=${rconpassword:-"NOT SET"}
@@ -202,10 +202,6 @@ fn_info_config_wolfensteinenemyterritory(){
 		serverpassword=${serverpassword:-"NOT SET"}
 		serverpassword=${serverpassword:-"NOT SET"}
 		slots=${slots:-"0"}
 		slots=${slots:-"0"}
 		port=${port:-"27960"}
 		port=${port:-"27960"}
-		
-		# Misc Variables
-		ipsetinconfig=1
-		ipinconfigvar="set net_ip"
 	fi
 	fi
 }
 }
 
 
@@ -306,16 +302,15 @@ fn_info_config_teamspeak3(){
 		port=$(grep "default_voice_port" "${servercfgfullpath}" | tr -cd '[:digit:]')
 		port=$(grep "default_voice_port" "${servercfgfullpath}" | tr -cd '[:digit:]')
 		queryport=$(grep "query_port" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]')
 		queryport=$(grep "query_port" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]')
 		fileport=$(grep "filetransfer_port" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]')
 		fileport=$(grep "filetransfer_port" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]')
+
 		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]*$//')
 		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"
+
 		# Not Set
 		# Not Set
 		port=${port:-"9987"}
 		port=${port:-"9987"}
 		queryport=${queryport:-"10011"}
 		queryport=${queryport:-"10011"}
 		fileport=${fileport:-"30033"}
 		fileport=${fileport:-"30033"}
-		
-		# Misc Variables
-		ipsetinconfig=1
-		ipinconfigvar="voice_ip"
 	fi
 	fi
 }
 }
 
 
@@ -325,17 +320,17 @@ fn_info_config_mumble(){
 		queryport="${port}"
 		queryport="${port}"
 		servername="Mumble"
 		servername="Mumble"
 	else
 	else
-		port=$(grep "port=" "${servercfgfullpath}" | awk -F "=" '{ print $2 }' )
-		ip=$(grep "host=" "${servercfgfullpath}" | awk -F "=" '{ print $2 }' )
-		
+		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}"
+
+		ip=$(grep "host=" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^;/d' -e 's/host=//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//')
+		ipsetinconfig=1
+		ipinconfigvar="voice_ip"
+
 		# Not Set
 		# Not Set
 		port=${port:-"64738"}
 		port=${port:-"64738"}
 		queryport=${queryport:-"64738"}
 		queryport=${queryport:-"64738"}
 		servername="Mumble Port ${port}"
 		servername="Mumble Port ${port}"
-		
-		# Misc variables
-		ipsetinconfig=1
-		ipinconfigvar="voice_ip"
 	fi
 	fi
 }
 }
 
 
@@ -520,4 +515,4 @@ elif [ "${gamename}" == "7 Days To Die" ]; then
 	fn_info_config_sdtd
 	fn_info_config_sdtd
 elif [ "${gamename}" == "Wolfenstein: Enemy Territory" ]; then
 elif [ "${gamename}" == "Wolfenstein: Enemy Territory" ]; then
 	fn_info_config_wolfensteinenemyterritory
 	fn_info_config_wolfensteinenemyterritory
-fi
+fi