diff --git a/lgsm/functions/info_config.sh b/lgsm/functions/info_config.sh index dc7486c85..d5f283404 100644 --- a/lgsm/functions/info_config.sh +++ b/lgsm/functions/info_config.sh @@ -27,15 +27,15 @@ fn_info_config_avalanche(){ slots=$(grep "MaxPlayers" "${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]*$//') + ipsetinconfig=1 + ipinconfigvar="BindIP" + # Not Set servername=${servername:-"NOT SET"} serverpassword=${serverpassword:-"NOT SET"} slots=${slots:-"0"} port=${port:-"0"} - - 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 } @@ -54,15 +54,15 @@ fn_info_config_bf1942(){ port=$(grep "game.serverPort" "${servercfgfullpath}" | grep -v "\--" | tr -cd '[:digit:]') queryport="22000" + 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 servername=${servername:-"NOT SET"} serverpassword=${serverpassword:-"NOT SET"} slots=${slots:-"0"} port=${port:-"0"} - - 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 } @@ -112,6 +112,10 @@ fn_info_config_minecraft(){ 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]*$//') + 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 servername=${servername:-"NOT SET"} rconpassword=${rconpassword:-"NOT SET"} @@ -121,9 +125,6 @@ fn_info_config_minecraft(){ gamemode=${gamemode:-"NOT SET"} gameworld=${gameworld:-"NOT SET"} - 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 } @@ -165,15 +166,15 @@ fn_info_config_quakelive(){ 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:]') + 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 rconpassword=${rconpassword:-"NOT SET"} servername=${servername:-"NOT SET"} serverpassword=${serverpassword:-"NOT SET"} slots=${slots:-"0"} - - 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 } @@ -191,6 +192,9 @@ fn_info_config_wolfensteinenemyterritory(){ 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:]') + 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 rconpassword=${rconpassword:-"NOT SET"} @@ -198,10 +202,6 @@ fn_info_config_wolfensteinenemyterritory(){ serverpassword=${serverpassword:-"NOT SET"} slots=${slots:-"0"} port=${port:-"27960"} - - 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 } @@ -303,14 +303,14 @@ fn_info_config_teamspeak3(){ queryport=$(grep "query_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]*$//') + ipsetinconfig=1 + ipinconfigvar="voice_ip" + # Not Set port=${port:-"9987"} queryport=${queryport:-"10011"} fileport=${fileport:-"30033"} - - 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 } @@ -323,14 +323,14 @@ fn_info_config_mumble(){ 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 port=${port:-"64738"} queryport=${queryport:-"64738"} servername="Mumble Port ${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" fi } @@ -515,4 +515,4 @@ elif [ "${gamename}" == "7 Days To Die" ]; then fn_info_config_sdtd elif [ "${gamename}" == "Wolfenstein: Enemy Territory" ]; then fn_info_config_wolfensteinenemyterritory -fi +fi \ No newline at end of file