|
|
@@ -12,857 +12,282 @@ lgsm_version="010316"
|
|
|
# tr -d '=\"; ' remove selected charectors =\";
|
|
|
# grep -v "foo" filter out lines that contain foo
|
|
|
|
|
|
-## Just Cause 2
|
|
|
-if [ "${engine}" == "avalanche" ]; then
|
|
|
+unavailable="\e[0;31mUNAVAILABLE\e[0m"
|
|
|
+zero="\e[0;31m0\e[0m"
|
|
|
|
|
|
- # server name
|
|
|
- if [ -f "${servercfgfullpath}" ]; then
|
|
|
- servername=$(grep "Name" "${servercfgfullpath}" | sed 's/Name//g' | tr -d '=", \n')
|
|
|
- if [ ! -n "${servername}" ]; then
|
|
|
- servername="NOT SET"
|
|
|
- fi
|
|
|
+fn_info_config_avalanche(){
|
|
|
+ if [ ! -f "${servercfgfullpath}" ]; then
|
|
|
+ servername="${unavailable}"
|
|
|
+ serverpassword="${unavailable}"
|
|
|
+ slots="${zero}"
|
|
|
+ port="${zero}"
|
|
|
else
|
|
|
- servername="\e[0;31mUNAVAILABLE\e[0m"
|
|
|
- fi
|
|
|
-
|
|
|
- # ip
|
|
|
- if [ -f "${servercfgfullpath}" ]; then
|
|
|
- # check if the ip exists in the config file. Failing this will fall back to the default.
|
|
|
- configipcheck=$(grep "BindIP" "${servercfgfullpath}" | sed 's/BindIP//g' | tr -d '=", \n')
|
|
|
- fi
|
|
|
- if [ -n "${configipcheck}" ]; then
|
|
|
- ip=$(grep "BindIP" "${servercfgfullpath}" | sed 's/BindIP//g' | tr -d '=", \n')
|
|
|
- fi
|
|
|
-
|
|
|
- # server password
|
|
|
- if [ -f "${servercfgfullpath}" ]; then
|
|
|
+ servername=$(grep "Name" "${servercfgfullpath}" | sed 's/Name//g' | tr -d '=", \n')
|
|
|
serverpassword=$(grep "Password" "${servercfgfullpath}" | sed 's/Password//g' | tr -d '=", \n')
|
|
|
- if [ ! -n "${serverpassword}" ]; then
|
|
|
- serverpassword="NOT SET"
|
|
|
- fi
|
|
|
- else
|
|
|
- serverpassword="\e[0;31mUNAVAILABLE\e[0m"
|
|
|
- fi
|
|
|
-
|
|
|
- # slots
|
|
|
- if [ -f "${servercfgfullpath}" ]; then
|
|
|
slots=$(grep "MaxPlayers" "${servercfgfullpath}" | tr -cd '[:digit:]')
|
|
|
- if [ ! -n "${slots}" ]; then
|
|
|
- slots="NOT SET"
|
|
|
- fi
|
|
|
- else
|
|
|
- slots="\e[0;31mUNAVAILABLE\e[0m"
|
|
|
- fi
|
|
|
-
|
|
|
- # port
|
|
|
- if [ -f "${servercfgfullpath}" ]; then
|
|
|
port=$(grep "BindPort" "${servercfgfullpath}" | tr -cd '[:digit:]')
|
|
|
- fi
|
|
|
- if [ ! -n "${port}" ]; then
|
|
|
- port="0"
|
|
|
- fi
|
|
|
-
|
|
|
-## Dont Starve Together
|
|
|
-elif [ "${engine}" == "dontstarve" ]; then
|
|
|
-
|
|
|
- # server name
|
|
|
- if [ -f "${servercfgfullpath}" ]; then
|
|
|
- servername=$(grep "default_server_name = " "${servercfgfullpath}" | sed 's/default_server_name = //g')
|
|
|
- if [ ! -n "${servername}" ]; then
|
|
|
- servername="NOT SET"
|
|
|
- fi
|
|
|
+
|
|
|
+ # Not Set
|
|
|
+ servername=${servername:-"NOT SET"}
|
|
|
+ serverpassword=${serverpassword:-"NOT SET"}
|
|
|
+ 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 's/BindIP//g' | tr -d '=", \n')
|
|
|
+ if [ -n "${ipconfigcheck}" ]; then
|
|
|
+ ip="${ipconfigcheck}"
|
|
|
+ fi
|
|
|
+ fi
|
|
|
+}
|
|
|
+
|
|
|
+fn_info_config_dontstarve(){
|
|
|
+ if [ ! -f "${servercfgfullpath}" ]; then
|
|
|
+ servername="${unavailable}"
|
|
|
+ serverpassword="${unavailable}"
|
|
|
+ slots="${zero}"
|
|
|
+ gamemode="${unavailable}"
|
|
|
+ tickrate="${zero}"
|
|
|
+ port="${zero}"
|
|
|
else
|
|
|
- servername="\e[0;31mUNAVAILABLE\e[0m"
|
|
|
- fi
|
|
|
-
|
|
|
- # server password
|
|
|
- if [ -f "${servercfgfullpath}" ]; then
|
|
|
+ servername=$(grep "default_server_name = " "${servercfgfullpath}" | sed 's/default_server_name = //g')
|
|
|
serverpassword=$(grep "server_password = " "${servercfgfullpath}" | grep -v "#" | sed 's/server_password = //g')
|
|
|
- if [ ! -n "${serverpassword}" ]; then
|
|
|
- serverpassword="NOT SET"
|
|
|
- fi
|
|
|
- else
|
|
|
- serverpassword="\e[0;31mUNAVAILABLE\e[0m"
|
|
|
- fi
|
|
|
-
|
|
|
- # slots
|
|
|
- if [ -f "${servercfgfullpath}" ]; then
|
|
|
slots=$(grep "max_players" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]')
|
|
|
- if [ ! -n "${slots}" ]; then
|
|
|
- slots="NOT SET"
|
|
|
- fi
|
|
|
- else
|
|
|
- slots="\e[0;31mUNAVAILABLE\e[0m"
|
|
|
- fi
|
|
|
-
|
|
|
- # game mode
|
|
|
- if [ -f "${servercfgfullpath}" ]; then
|
|
|
gamemode=$(grep "game_mode = " "${servercfgfullpath}" | grep -v "#" | sed 's/game_mode = //g')
|
|
|
- if [ ! -n "${gamemode}" ]; then
|
|
|
- gamemode="NOT SET"
|
|
|
- fi
|
|
|
- else
|
|
|
- gamemode="\e[0;31mUNAVAILABLE\e[0m"
|
|
|
- fi
|
|
|
-
|
|
|
- # tickrate
|
|
|
- if [ -f "${servercfgfullpath}" ]; then
|
|
|
tickrate=$(grep "tick_rate" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]')
|
|
|
- if [ ! -n "${tickrate}" ]; then
|
|
|
- tickrate="NOT SET"
|
|
|
- fi
|
|
|
- else
|
|
|
- tickrate="\e[0;31mUNAVAILABLE\e[0m"
|
|
|
- fi
|
|
|
-
|
|
|
- # port
|
|
|
- if [ -f "${servercfgfullpath}" ]; then
|
|
|
port=$(grep "server_port" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]')
|
|
|
- fi
|
|
|
- if [ ! -n "${port}" ]; then
|
|
|
- port="0"
|
|
|
- fi
|
|
|
-
|
|
|
-## Project Zomboid
|
|
|
-elif [ "${engine}" == "projectzomboid" ]; then
|
|
|
-
|
|
|
- # server name
|
|
|
- if [ -f "${servercfgfullpath}" ]; then
|
|
|
- servername=$(grep "PublicName=" "${servercfgfullpath}" | sed 's/PublicName=//g' | tr -d '=", \n')
|
|
|
- if [ ! -n "${servername}" ]; then
|
|
|
- servername="NOT SET"
|
|
|
- fi
|
|
|
+
|
|
|
+ # Not Set
|
|
|
+ servername=${servername:-"NOT SET"}
|
|
|
+ serverpassword=${serverpassword:-"NOT SET"}
|
|
|
+ slots=${slots:-"0"}
|
|
|
+ gamemode=${gamemode:-"NOT SET"}
|
|
|
+ tickrate=${tickrate:-"0"}
|
|
|
+ port=${port:-"0"}
|
|
|
+ fi
|
|
|
+}
|
|
|
+
|
|
|
+fn_info_config_projectzomboid(){
|
|
|
+ if [ ! -f "${servercfgfullpath}" ]; then
|
|
|
+ servername="${unavailable}"
|
|
|
+ slots="${zero}"
|
|
|
+ port="${zero}"
|
|
|
else
|
|
|
- servername="\e[0;31mUNAVAILABLE\e[0m"
|
|
|
- fi
|
|
|
-
|
|
|
- # slots
|
|
|
- if [ -f "${servercfgfullpath}" ]; then
|
|
|
+ servername=$(grep "PublicName=" "${servercfgfullpath}" | sed 's/PublicName=//g' | tr -d '=", \n')
|
|
|
slots=$(grep "MaxPlayers=" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]')
|
|
|
- if [ ! -n "${slots}" ]; then
|
|
|
- slots="NOT SET"
|
|
|
- fi
|
|
|
- else
|
|
|
- slots="\e[0;31mUNAVAILABLE\e[0m"
|
|
|
- fi
|
|
|
-
|
|
|
- # port
|
|
|
- if [ -f "${servercfgfullpath}" ]; then
|
|
|
port=$(grep "DefaultPort=" "${servercfgfullpath}" | tr -cd '[:digit:]')
|
|
|
+
|
|
|
+ # Not Set
|
|
|
+ servername=${servername:-"NOT SET"}
|
|
|
+ slots=${slots:-"0"}
|
|
|
+ port=${port:-"0"}
|
|
|
fi
|
|
|
- if [ ! -n "${port}" ]; then
|
|
|
- port="0"
|
|
|
- fi
|
|
|
-
|
|
|
-
|
|
|
-# Quake Live
|
|
|
-elif [ "${engine}" == "idtech3" ]; then
|
|
|
+}
|
|
|
|
|
|
- # server name
|
|
|
- if [ -f "${servercfgfullpath}" ]; then
|
|
|
- servername=$(grep "set sv_hostname " "${servercfgfullpath}" | sed 's/set sv_hostname //g' | tr -d '=\"; ')
|
|
|
- if [ ! -n "${servername}" ]; then
|
|
|
- servername="NOT SET"
|
|
|
- fi
|
|
|
+fn_info_config_idtech3(){
|
|
|
+ if [ ! -f "${servercfgfullpath}" ]; then
|
|
|
+ servername="${unavailable}"
|
|
|
+ serverpassword="${unavailable}"
|
|
|
+ slots="${zero}"
|
|
|
else
|
|
|
- servername="\e[0;31mUNAVAILABLE\e[0m"
|
|
|
- fi
|
|
|
-
|
|
|
- # server password
|
|
|
- if [ -f "${servercfgfullpath}" ]; then
|
|
|
-
|
|
|
+ servername=$(grep "set sv_hostname " "${servercfgfullpath}" | sed 's/set sv_hostname //g' | tr -d '=\"; ')
|
|
|
serverpassword=$(grep "set g_password" "${servercfgfullpath}" | sed -e 's/set g_password//g' | tr -d '=\"; '| cut -f1 -d "/")
|
|
|
- if [ ! -n "${serverpassword}" ]; then
|
|
|
- serverpassword="NOT SET"
|
|
|
- fi
|
|
|
- else
|
|
|
- serverpassword="\e[0;31mUNAVAILABLE\e[0m"
|
|
|
- fi
|
|
|
-
|
|
|
- # rcon password
|
|
|
- rconpassword="${rconpassword}"
|
|
|
- if [ -f "${servercfgfullpath}" ]; then
|
|
|
- if [ ! -n "${rconpassword}" ]; then
|
|
|
- rconpassword="NOT SET"
|
|
|
- fi
|
|
|
- else
|
|
|
- rconpassword="\e[0;31mUNAVAILABLE\e[0m"
|
|
|
- fi
|
|
|
-
|
|
|
- # slots
|
|
|
- if [ -f "${servercfgfullpath}" ]; then
|
|
|
slots=$(grep "set sv_maxClients" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]')
|
|
|
- if [ ! -n "${slots}" ]; then
|
|
|
- slots="NOT SET"
|
|
|
- fi
|
|
|
- else
|
|
|
- slots="\e[0;31mUNAVAILABLE\e[0m"
|
|
|
- fi
|
|
|
-
|
|
|
- # port
|
|
|
- port="${gameport}"
|
|
|
- if [ ! -n "${port}" ]; then
|
|
|
- port="0"
|
|
|
+
|
|
|
+ # Not Set
|
|
|
+ servername=${servername:-"NOT SET"}
|
|
|
+ serverpassword=${serverpassword:-"NOT SET"}
|
|
|
+ slots=${slots:-"0"}
|
|
|
fi
|
|
|
+}
|
|
|
|
|
|
- # rcon port
|
|
|
- if [ ! -n "${rconport}" ]; then
|
|
|
- rconport="0"
|
|
|
- fi
|
|
|
-
|
|
|
- # Stats port
|
|
|
- if [ ! -n "${statsport}" ]; then
|
|
|
- statsport="0"
|
|
|
- fi
|
|
|
-
|
|
|
-# ARMA 3
|
|
|
-elif [ "${engine}" == "realvirtuality" ]; then
|
|
|
-
|
|
|
- # server name
|
|
|
- if [ -f "${servercfgfullpath}" ]; then
|
|
|
- servername=$(grep "hostname" "${servercfgfullpath}" | grep -v "//" | sed -e 's/\<hostname\>//g' | tr -d '=\"; ')
|
|
|
- if [ ! -n "${servername}" ]; then
|
|
|
- servername="NOT SET"
|
|
|
- fi
|
|
|
+fn_info_config_realvirtuality(){
|
|
|
+ if [ ! -f "${servercfgfullpath}" ]; then
|
|
|
+ servername="${unavailable}"
|
|
|
+ adminpassword="${unavailable}"
|
|
|
+ serverpassword="${unavailable}"
|
|
|
+ slots="${zero}"
|
|
|
else
|
|
|
- servername="\e[0;31mUNAVAILABLE\e[0m"
|
|
|
- fi
|
|
|
-
|
|
|
- # admin password
|
|
|
- if [ -f "${servercfgfullpath}" ]; then
|
|
|
+ servername=$(grep "hostname" "${servercfgfullpath}" | grep -v "//" | sed -e 's/\<hostname\>//g' | tr -d '=\"; ')
|
|
|
adminpassword=$(grep "passwordAdmin" "${servercfgfullpath}" | grep -v "//" | sed -e 's/\passwordAdmin//g' | tr -d '=\"; ')
|
|
|
- if [ ! -n "${adminpassword}" ]; then
|
|
|
- adminpassword="NOT SET"
|
|
|
- fi
|
|
|
- else
|
|
|
- adminpassword="\e[0;31mUNAVAILABLE\e[0m"
|
|
|
- fi
|
|
|
-
|
|
|
- # server password
|
|
|
- if [ -f "${servercfgfullpath}" ]; then
|
|
|
serverpassword=$(grep "password =" "${servercfgfullpath}" | grep -v "//" | sed -e 's/\password//g' | tr -d '=\"; ')
|
|
|
- if [ ! -n "${serverpassword}" ]; then
|
|
|
- serverpassword="NOT SET"
|
|
|
- fi
|
|
|
- else
|
|
|
- serverpassword="\e[0;31mUNAVAILABLE\e[0m"
|
|
|
- fi
|
|
|
-
|
|
|
- # slots
|
|
|
- if [ -f "${servercfgfullpath}" ]; then
|
|
|
slots=$(grep "maxPlayers" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]')
|
|
|
- if [ ! -n "${slots}" ]; then
|
|
|
- slots="NOT SET"
|
|
|
- fi
|
|
|
+
|
|
|
+ # Not Set
|
|
|
+ servername=${servername:-"NOT SET"}
|
|
|
+ adminpassword=${adminpassword:-"NOT SET"}
|
|
|
+ serverpassword=${serverpassword:-"NOT SET"}
|
|
|
+ slots=${slots:-"0"}
|
|
|
+ fi
|
|
|
+}
|
|
|
+
|
|
|
+fn_info_config_seriousengine35(){
|
|
|
+ if [ ! -f "${servercfgfullpath}" ]; then
|
|
|
+ servername="${unavailable}"
|
|
|
+ rconpassword="${unavailable}"
|
|
|
+ gamemode="${unavailable}"
|
|
|
+ slots="${zero}"
|
|
|
+ port="${zero}"
|
|
|
else
|
|
|
- slots="\e[0;31mUNAVAILABLE\e[0m"
|
|
|
- fi
|
|
|
-
|
|
|
- # port
|
|
|
- if [ "${port}" != "" ]; then
|
|
|
- port=${port}
|
|
|
- fi
|
|
|
- if [ ! -n "${port}" ]; then
|
|
|
- port="0"
|
|
|
- fi
|
|
|
-
|
|
|
- # query port
|
|
|
- if [ "${port}" != "" ]; then
|
|
|
- queryport=$((port + 1))
|
|
|
- fi
|
|
|
- if [ ! -n "${queryport}" ]; then
|
|
|
- queryport="0"
|
|
|
- fi
|
|
|
-
|
|
|
- # master port
|
|
|
- if [ "${port}" != "" ]; then
|
|
|
- masterport=$((port + 2))
|
|
|
- fi
|
|
|
- if [ ! -n "${masterport}" ]; then
|
|
|
- masterport="0"
|
|
|
- fi
|
|
|
-
|
|
|
-# Serious Sam
|
|
|
-elif [ "${engine}" == "seriousengine35" ]; then
|
|
|
-
|
|
|
- # server name
|
|
|
- if [ -f "${servercfgfullpath}" ]; then
|
|
|
servername=$(grep "prj_strMultiplayerSessionName" "${servercfgfullpath}" | sed 's/prj_strMultiplayerSessionName = //g' | tr -d '=\"; ')
|
|
|
- if [ ! -n "${servername}" ]; then
|
|
|
- servername="NOT SET"
|
|
|
- fi
|
|
|
- else
|
|
|
- servername="\e[0;31mUNAVAILABLE\e[0m"
|
|
|
- fi
|
|
|
-
|
|
|
- # rcon password
|
|
|
- if [ -f "${servercfgfullpath}" ]; then
|
|
|
rconpassword=$(grep "rcts_strAdminPassword" "${servercfgfullpath}" | sed 's/rcts_strAdminPassword = //g' | tr -d '=\"; ')
|
|
|
- if [ ! -n "${rconpassword}" ]; then
|
|
|
- rconpassword="NOT SET"
|
|
|
- fi
|
|
|
- else
|
|
|
- rconpassword="\e[0;31mUNAVAILABLE\e[0m"
|
|
|
- fi
|
|
|
-
|
|
|
- # slots
|
|
|
- if [ -f "${servercfgfullpath}" ]; then
|
|
|
- slots=$(grep "gam_ctMaxPlayers" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]')
|
|
|
- if [ ! -n "${slots}" ]; then
|
|
|
- slots="NOT SET"
|
|
|
- fi
|
|
|
- else
|
|
|
- slots="\e[0;31mUNAVAILABLE\e[0m"
|
|
|
- fi
|
|
|
-
|
|
|
- # game mode
|
|
|
- if [ -f "${servercfgfullpath}" ]; then
|
|
|
gamemode=$(grep "gam_idGameMode" "${servercfgfullpath}" | grep -v "#" | sed 's/gam_idGameMode//g' | tr -d '=\"; ')
|
|
|
- if [ ! -n "${gamemode}" ]; then
|
|
|
- gamemode="NOT SET"
|
|
|
- fi
|
|
|
- else
|
|
|
- gamemode="\e[0;31mUNAVAILABLE\e[0m"
|
|
|
- fi
|
|
|
-
|
|
|
- # port
|
|
|
- if [ -f "${servercfgfullpath}" ]; then
|
|
|
+ slots=$(grep "gam_ctMaxPlayers" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]')
|
|
|
port=$(grep "prj_uwPort" "${servercfgfullpath}" | tr -d '\r' | tr -cd '[:digit:]')
|
|
|
- fi
|
|
|
- if [ ! -n "${port}" ]; then
|
|
|
- port="0"
|
|
|
- fi
|
|
|
-
|
|
|
- # query port
|
|
|
- if [ -f "${servercfgfullpath}" ]; then
|
|
|
- queryport=$((port + 1))
|
|
|
- fi
|
|
|
- if [ ! -n "${queryport}" ]; then
|
|
|
- queryport="0"
|
|
|
- fi
|
|
|
-
|
|
|
-# Source Engine Games
|
|
|
-elif [ "${engine}" == "source" ]||[ "${engine}" == "goldsource" ]; then
|
|
|
-
|
|
|
- # server name
|
|
|
- if [ -f "${servercfgfullpath}" ]; then
|
|
|
- servername=$(grep "hostname" "${servercfgfullpath}" | sed 's/hostname //g' | sed 's/"//g')
|
|
|
- if [ ! -n "${servername}" ]; then
|
|
|
- servername="NOT SET"
|
|
|
- fi
|
|
|
+
|
|
|
+ # Not Set
|
|
|
+ servername=${servername:-"NOT SET"}
|
|
|
+ rconpassword=${rconpassword:-"NOT SET"}
|
|
|
+ gamemode=${gamemode:-"NOT SET"}
|
|
|
+ slots=${slots:-"0"}
|
|
|
+ port=${port:-"0"}
|
|
|
+ fi
|
|
|
+}
|
|
|
+
|
|
|
+fn_info_config_source(){
|
|
|
+ if [ ! -f "${servercfgfullpath}" ]; then
|
|
|
+ servername="${unavailable}"
|
|
|
+ serverpassword="${unavailable}"
|
|
|
+ rconpassword="${unavailable}"
|
|
|
else
|
|
|
- servername="\e[0;31mUNAVAILABLE\e[0m"
|
|
|
- fi
|
|
|
-
|
|
|
- # server password
|
|
|
- if [ -f "${servercfgfullpath}" ]; then
|
|
|
+ servername=$(grep "hostname" "${servercfgfullpath}" | sed 's/hostname //g' | sed 's/"//g')
|
|
|
serverpassword=$(grep "sv_password" "${servercfgfullpath}" | sed 's/sv_password //g' | sed 's/"//g')
|
|
|
- if [ ! -n "${serverpassword}" ]; then
|
|
|
- serverpassword="NOT SET"
|
|
|
- fi
|
|
|
- else
|
|
|
- serverpassword="\e[0;31mUNAVAILABLE\e[0m"
|
|
|
- fi
|
|
|
-
|
|
|
- # rcon password
|
|
|
- if [ -f "${servercfgfullpath}" ]; then
|
|
|
rconpassword=$(grep "rcon_password" "${servercfgfullpath}" | sed 's/rcon_password //g' | sed 's/"//g')
|
|
|
- if [ ! -n "${rconpassword}" ]; then
|
|
|
- rconpassword="NOT SET"
|
|
|
- fi
|
|
|
- else
|
|
|
- rconpassword="\e[0;31mUNAVAILABLE\e[0m"
|
|
|
- fi
|
|
|
-
|
|
|
-# Spark (NS2: Combat)
|
|
|
-elif [ "${engine}" == "spark" ]; then
|
|
|
-
|
|
|
- # query port
|
|
|
- if [ -f "${servercfgfullpath}" ]; then
|
|
|
- queryport=$((port + 1))
|
|
|
- fi
|
|
|
- if [ ! -n "${queryport}" ]; then
|
|
|
- queryport="0"
|
|
|
+
|
|
|
+ # Not Set
|
|
|
+ servername=${servername:-"NOT SET"}
|
|
|
+ serverpassword=${serverpassword:-"NOT SET"}
|
|
|
+ rconpassword=${rconpassword:-"NOT SET"}
|
|
|
fi
|
|
|
+}
|
|
|
|
|
|
-# Teamspeak 3
|
|
|
-elif [ "${gamename}" == "Teamspeak 3" ]; then
|
|
|
-
|
|
|
- # ip
|
|
|
- if [ -f "${servercfgfullpath}" ]; then
|
|
|
+fn_info_config_teamspeak3(){
|
|
|
+ if [ ! -f "${servercfgfullpath}" ]; then
|
|
|
+ dbplugin="${unavailable}"
|
|
|
+ port="9987"
|
|
|
+ queryport="10011"
|
|
|
+ fileport="30033"
|
|
|
+ else
|
|
|
# check if the ip exists in the config file. Failing this will fall back to the default.
|
|
|
- configipcheck=$(grep "voice_ip=" "${servercfgfullpath}" | sed 's/\voice_ip=//g')
|
|
|
- fi
|
|
|
- if [ -n "${configipcheck}" ]; then
|
|
|
- ip=$(grep "voice_ip=" "${servercfgfullpath}" | sed 's/\voice_ip=//g')
|
|
|
- fi
|
|
|
-
|
|
|
- # dbplugin
|
|
|
- if [ -f "${servercfgfullpath}" ]; then
|
|
|
- dbplugin=$(grep "dbplugin=" "${servercfgfullpath}" | sed 's/\dbplugin=//g')
|
|
|
- if [ ! -n "${dbplugin}" ]; then
|
|
|
- dbplugin="NOT SET"
|
|
|
+ ipconfigcheck=$(grep "voice_ip=" "${servercfgfullpath}" | sed 's/\voice_ip=//g')
|
|
|
+ if [ -n "${ipconfigcheck}" ]; then
|
|
|
+ ip="${ipconfigcheck}"
|
|
|
fi
|
|
|
- else
|
|
|
- dbplugin="\e[0;31mUNAVAILABLE\e[0m"
|
|
|
- fi
|
|
|
-
|
|
|
- # port
|
|
|
- if [ -f "${servercfgfullpath}" ]; then
|
|
|
+ dbplugin=$(grep "dbplugin=" "${servercfgfullpath}" | sed 's/\dbplugin=//g')
|
|
|
port=$(grep "default_voice_port=" "${servercfgfullpath}" | tr -cd '[:digit:]')
|
|
|
- fi
|
|
|
- if [ ! -n "${port}" ]; then
|
|
|
- port="9987"
|
|
|
- fi
|
|
|
-
|
|
|
- # query port
|
|
|
- if [ -f "${servercfgfullpath}" ]; then
|
|
|
queryport=$(grep "query_port=" "${servercfgfullpath}" | tr -cd '[:digit:]')
|
|
|
- fi
|
|
|
- if [ ! -n "${queryport}" ]; then
|
|
|
- queryport="10011"
|
|
|
- fi
|
|
|
-
|
|
|
- # file port
|
|
|
- if [ -f "${servercfgfullpath}" ]; then
|
|
|
fileport=$(grep "filetransfer_port=" "${servercfgfullpath}" | tr -cd '[:digit:]')
|
|
|
- fi
|
|
|
- if [ ! -n "${fileport}" ]; then
|
|
|
- fileport="30033"
|
|
|
- fi
|
|
|
|
|
|
-# Teeworlds
|
|
|
-elif [ "${engine}" == "teeworlds" ]; then
|
|
|
-
|
|
|
- # server name
|
|
|
- if [ -f "${servercfgfullpath}" ]; then
|
|
|
- servername=$(grep "sv_name" "${servercfgfullpath}" | sed 's/sv_name //g' | sed 's/"//g')
|
|
|
- if [ ! -n "${servername}" ]; then
|
|
|
- servername="unnamed server"
|
|
|
- fi
|
|
|
- else
|
|
|
- servername="unnamed server"
|
|
|
+ # Not Set
|
|
|
+ port=${port:-"9987"}
|
|
|
+ queryport=${queryport:-"10011"}
|
|
|
+ fileport=${fileport:-"30033"}
|
|
|
fi
|
|
|
+}
|
|
|
|
|
|
- # server password
|
|
|
- if [ -f "${servercfgfullpath}" ]; then
|
|
|
+fn_info_config_teeworlds(){
|
|
|
+ if [ ! -f "${servercfgfullpath}" ]; then
|
|
|
+ servername="unnamed server"
|
|
|
+ serverpassword="${unavailable}"
|
|
|
+ rconpassword="${unavailable}"
|
|
|
+ port="8303"
|
|
|
+ slots="12"
|
|
|
+ else
|
|
|
+ servername=$(grep "sv_name" "${servercfgfullpath}" | sed 's/sv_name //g' | sed 's/"//g')
|
|
|
serverpassword=$(grep "password " "${servercfgfullpath}" | awk '!/sv_rcon_password/'| sed 's/password //g' | tr -d '=\"; ')
|
|
|
- if [ ! -n "${serverpassword}" ]; then
|
|
|
- serverpassword="NOT SET"
|
|
|
- fi
|
|
|
- else
|
|
|
- serverpassword="\e[0;31mUNAVAILABLE\e[0m"
|
|
|
- fi
|
|
|
-
|
|
|
- # rcon password
|
|
|
- if [ -f "${servercfgfullpath}" ]; then
|
|
|
rconpassword=$(grep "sv_rcon_password" "${servercfgfullpath}" | sed 's/sv_rcon_password //g' | tr -d '=\"; ')
|
|
|
- if [ ! -n "${rconpassword}" ]; then
|
|
|
- rconpassword="NOT SET"
|
|
|
- fi
|
|
|
- else
|
|
|
- rconpassword="\e[0;31mUNAVAILABLE\e[0m"
|
|
|
- fi
|
|
|
-
|
|
|
- # port
|
|
|
- if [ -f "${servercfgfullpath}" ]; then
|
|
|
port=$(grep "sv_port" "${servercfgfullpath}" | tr -cd '[:digit:]')
|
|
|
- fi
|
|
|
- if [ ! -n "${port}" ]; then
|
|
|
- port="8303"
|
|
|
- fi
|
|
|
-
|
|
|
- # slots
|
|
|
- if [ -f "${servercfgfullpath}" ]; then
|
|
|
slots=$(grep "sv_max_clients" "${servercfgfullpath}" | tr -cd '[:digit:]')
|
|
|
- if [ ! -n "${slots}" ]; then
|
|
|
- slots="12"
|
|
|
- fi
|
|
|
- else
|
|
|
- slots="12"
|
|
|
- fi
|
|
|
-
|
|
|
-# Terraria
|
|
|
-elif [ "${engine}" == "terraria" ]; then
|
|
|
-
|
|
|
- # port
|
|
|
- if [ -f "${servercfgfullpath}" ]; then
|
|
|
- port=$(grep "port=" "${servercfgfullpath}" | tr -cd '[:digit:]')
|
|
|
- fi
|
|
|
- if [ ! -n "${port}" ]; then
|
|
|
- port="0"
|
|
|
- fi
|
|
|
-
|
|
|
-# 7 Day To Die (unity3d)
|
|
|
-elif [ "${gamename}" == "7 Days To Die" ]; then
|
|
|
-
|
|
|
- # server name
|
|
|
- if [ -f "${servercfgfullpath}" ]; then
|
|
|
- servername=$(grep "ServerName" "${servercfgfullpath}" | sed 's/^.*value="//' | cut -f1 -d"\"")
|
|
|
- if [ ! -n "${servername}" ]; then
|
|
|
- servername="NOT SET"
|
|
|
- fi
|
|
|
- else
|
|
|
- servername="\e[0;31mUNAVAILABLE\e[0m"
|
|
|
- fi
|
|
|
-
|
|
|
- # server password
|
|
|
- if [ -f "${servercfgfullpath}" ]; then
|
|
|
- serverpassword=$(grep "ServerPassword" "${servercfgfullpath}" | sed 's/^.*value="//' | cut -f1 -d"\"")
|
|
|
- if [ ! -n "${serverpassword}" ]; then
|
|
|
- serverpassword="NOT SET"
|
|
|
- fi
|
|
|
- else
|
|
|
- serverpassword="\e[0;31mUNAVAILABLE\e[0m"
|
|
|
- fi
|
|
|
-
|
|
|
- # webadmin enabled
|
|
|
- if [ -f "${servercfgfullpath}" ]; then
|
|
|
- webadminenabled=$(grep "ControlPanelEnabled" "${servercfgfullpath}" | sed 's/^.*value="//' | cut -f1 -d"\"")
|
|
|
- if [ ! -n "${webadminenabled}" ]; then
|
|
|
- webadminenabled="NOT SET"
|
|
|
- fi
|
|
|
- else
|
|
|
- webadminenabled="\e[0;31mUNAVAILABLE\e[0m"
|
|
|
- fi
|
|
|
-
|
|
|
- # webadmin port
|
|
|
- if [ -f "${servercfgfullpath}" ]; then
|
|
|
- webadminport=$(grep "ControlPanelPort" "${servercfgfullpath}" | tr -cd '[:digit:]')
|
|
|
- fi
|
|
|
- if [ ! -n "${webadminport}" ]; then
|
|
|
- webadminport="0"
|
|
|
- fi
|
|
|
-
|
|
|
- # webadmin enabled
|
|
|
- if [ -f "${servercfgfullpath}" ]; then
|
|
|
- webadminenabled=$(grep "ControlPanelEnabled" "${servercfgfullpath}" | sed 's/^.*value="//' | cut -f1 -d"\"")
|
|
|
- if [ ! -n "${webadminenabled}" ]; then
|
|
|
- webadminenabled="NOT SET"
|
|
|
- fi
|
|
|
- else
|
|
|
- webadminenabled="\e[0;31mUNAVAILABLE\e[0m"
|
|
|
- fi
|
|
|
-
|
|
|
- # webadmin password
|
|
|
- if [ -f "${servercfgfullpath}" ]; then
|
|
|
- webadminpass=$(grep "ControlPanelPassword" "${servercfgfullpath}" | sed 's/^.*value="//' | cut -f1 -d"\"")
|
|
|
- if [ ! -n "${webadminpass}" ]; then
|
|
|
- webadminpass="NOT SET"
|
|
|
- fi
|
|
|
- else
|
|
|
- webadminpass="\e[0;31mUNAVAILABLE\e[0m"
|
|
|
- fi
|
|
|
-
|
|
|
- # telnet enabled
|
|
|
- if [ -f "${servercfgfullpath}" ]; then
|
|
|
- telnetenabled=$(grep "TelnetEnabled" "${servercfgfullpath}" | sed 's/^.*value="//' | cut -f1 -d"\"")
|
|
|
- if [ ! -n "${telnetenabled}" ]; then
|
|
|
- telnetenabled="NOT SET"
|
|
|
- fi
|
|
|
- else
|
|
|
- telnetenabled="\e[0;31mUNAVAILABLE\e[0m"
|
|
|
- fi
|
|
|
-
|
|
|
- # telnet port
|
|
|
- if [ -f "${servercfgfullpath}" ]; then
|
|
|
- telnetport=$(grep "TelnetPort" "${servercfgfullpath}" | tr -cd '[:digit:]')
|
|
|
- fi
|
|
|
- if [ ! -n "${telnetport}" ]; then
|
|
|
- telnetport="0"
|
|
|
- fi
|
|
|
-
|
|
|
- # telnet password
|
|
|
- if [ -f "${servercfgfullpath}" ]; then
|
|
|
- telnetpass=$(grep "TelnetPassword" "${servercfgfullpath}" | sed 's/^.*value="//' | cut -f1 -d"\"")
|
|
|
- if [ ! -n "${telnetpass}" ]; then
|
|
|
- telnetpass="NOT SET"
|
|
|
- fi
|
|
|
- else
|
|
|
- telnetpass="\e[0;31mUNAVAILABLE\e[0m"
|
|
|
- fi
|
|
|
-
|
|
|
- # slots
|
|
|
- if [ -f "${servercfgfullpath}" ]; then
|
|
|
- slots=$(grep "ServerMaxPlayerCount" "${servercfgfullpath}" | tr -cd '[:digit:]')
|
|
|
- if [ ! -n "${slots}" ]; then
|
|
|
- slots="NOT SET"
|
|
|
- fi
|
|
|
- else
|
|
|
- slots="\e[0;31mUNAVAILABLE\e[0m"
|
|
|
- fi
|
|
|
-
|
|
|
- # game mode
|
|
|
- if [ -f "${servercfgfullpath}" ]; then
|
|
|
- gamemode=$(grep "GameMode" "${servercfgfullpath}" | sed 's/^.*value="//' | cut -f1 -d"\"")
|
|
|
- if [ ! -n "${gamemode}" ]; then
|
|
|
- gamemode="NOT SET"
|
|
|
- fi
|
|
|
- else
|
|
|
- gamemode="\e[0;31mUNAVAILABLE\e[0m"
|
|
|
- fi
|
|
|
-
|
|
|
- # game world
|
|
|
- if [ -f "${servercfgfullpath}" ]; then
|
|
|
- gameworld=$(grep "GameWorld" "${servercfgfullpath}" | sed 's/^.*value="//' | cut -f1 -d"\"")
|
|
|
- if [ ! -n "${gameworld}" ]; then
|
|
|
- gameworld="NOT SET"
|
|
|
- fi
|
|
|
- else
|
|
|
- gameworld="\e[0;31mUNAVAILABLE\e[0m"
|
|
|
- fi
|
|
|
+
|
|
|
+ # Not Set
|
|
|
+ servername=${servername:-"NOT SET"}
|
|
|
+ serverpassword=${serverpassword:-"NOT SET"}
|
|
|
+ rconpassword=${rconpassword:-"NOT SET"}
|
|
|
+ port=${port:-"8303"}
|
|
|
+ slots=${slots:-"12"}
|
|
|
+ fi
|
|
|
+}
|
|
|
|
|
|
- # port
|
|
|
- if [ -f "${servercfgfullpath}" ]; then
|
|
|
- port=$(grep "sv_port" "${servercfgfullpath}" | tr -cd '[:digit:]')
|
|
|
- fi
|
|
|
- if [ ! -n "${port}" ]; then
|
|
|
+fn_info_config_terraria(){
|
|
|
+ if [ ! -f "${servercfgfullpath}" ]; then
|
|
|
port="0"
|
|
|
- fi
|
|
|
-
|
|
|
- # query port
|
|
|
- if [ -f "${servercfgfullpath}" ]; then
|
|
|
- queryport=$((port + 1))
|
|
|
- fi
|
|
|
- if [ ! -n "${queryport}" ]; then
|
|
|
- queryport="0"
|
|
|
- fi
|
|
|
-
|
|
|
-# Hurtworld (unity3d)
|
|
|
-elif [ "${gamename}" == "Hurtworld" ]; then
|
|
|
-
|
|
|
- # server name
|
|
|
- if [ -n "${servername}" ]; then
|
|
|
- servername="${servername}"
|
|
|
- else
|
|
|
- servername="\e[0;31mUNAVAILABLE\e[0m"
|
|
|
- fi
|
|
|
-
|
|
|
- # server password
|
|
|
- # not available yet
|
|
|
-
|
|
|
- # slots
|
|
|
- if [ -n "${maxplayers}" ]; then
|
|
|
- slots="${maxplayers}"
|
|
|
- else
|
|
|
- slots="NOT SET"
|
|
|
- fi
|
|
|
-
|
|
|
- # game world
|
|
|
- if [ -n "${map}" ]; then
|
|
|
- gameworld="${map}"
|
|
|
- else
|
|
|
- gameworld="NO MAP SET"
|
|
|
- fi
|
|
|
+ else
|
|
|
+ port=$(grep "port=" "${servercfgfullpath}" | tr -cd '[:digit:]')
|
|
|
|
|
|
- # port
|
|
|
- if [ -n "${port}" ]; then
|
|
|
- port="${port}"
|
|
|
- else
|
|
|
- port="0"
|
|
|
+ # Not Set
|
|
|
+ port=${port:-"0"}
|
|
|
fi
|
|
|
+}
|
|
|
|
|
|
- # query port
|
|
|
- if [ -n "${queryport}" ]; then
|
|
|
- queryport="${queryport}"
|
|
|
+fn_info_config_unreal(){
|
|
|
+ if [ ! -f "${servercfgfullpath}" ]; then
|
|
|
+ servername="${unavailable}"
|
|
|
+ serverpassword="${unavailable}"
|
|
|
+ adminpassword="${unavailable}"
|
|
|
+ port="${zero}"
|
|
|
+ gsqueryport="${zero}"
|
|
|
+ webadminenabled="${unavailable}"
|
|
|
+ webadminport="${zero}"
|
|
|
+ webadminuser="${unavailable}"
|
|
|
+ webadminpass="${unavailable}"
|
|
|
else
|
|
|
- queryport="0"
|
|
|
- fi
|
|
|
-
|
|
|
-# Unreal Tournament
|
|
|
-elif [ "${engine}" == "unreal" ]||[ "${engine}" == "unreal2" ]; then
|
|
|
-
|
|
|
- # server name
|
|
|
- if [ -f "${servercfgfullpath}" ]; then
|
|
|
servername=$(grep "ServerName=" "${servercfgfullpath}" | sed 's/ServerName=//g')
|
|
|
- if [ ! -n "${servername}" ]; then
|
|
|
- servername="NOT SET"
|
|
|
- fi
|
|
|
- else
|
|
|
- servername="\e[0;31mUNAVAILABLE\e[0m"
|
|
|
- fi
|
|
|
-
|
|
|
- # server password
|
|
|
- if [ -f "${servercfgfullpath}" ]; then
|
|
|
serverpassword=$(grep "GamePassword=" "${servercfgfullpath}" | sed 's/GamePassword=//g')
|
|
|
- if [ ! -n "${serverpassword}" ]; then
|
|
|
- serverpassword="NOT SET"
|
|
|
- fi
|
|
|
- else
|
|
|
- serverpassword="\e[0;31mUNAVAILABLE\e[0m"
|
|
|
- fi
|
|
|
-
|
|
|
- # admin password
|
|
|
- if [ -f "${servercfgfullpath}" ]; then
|
|
|
adminpassword=$(grep "AdminPassword=" "${servercfgfullpath}" | sed 's/AdminPassword=//g')
|
|
|
- if [ ! -n "${adminpassword}" ]; then
|
|
|
- adminpassword="NOT SET"
|
|
|
- fi
|
|
|
- else
|
|
|
- adminpassword="\e[0;31mUNAVAILABLE\e[0m"
|
|
|
- fi
|
|
|
-
|
|
|
- # port
|
|
|
- if [ -f "${servercfgfullpath}" ]; then
|
|
|
port=$(grep "Port=" "${servercfgfullpath}" | grep -v "Master" | grep -v "LAN" | grep -v "Proxy" | grep -v "Listen" | tr -d '\r' | tr -cd '[:digit:]')
|
|
|
- fi
|
|
|
- if [ ! -n "${port}" ]; then
|
|
|
- port="0"
|
|
|
- fi
|
|
|
-
|
|
|
- # query port
|
|
|
- if [ -f "${servercfgfullpath}" ]; then
|
|
|
- queryport=$((port + 1))
|
|
|
- fi
|
|
|
- if [ ! -n "${queryport}" ]; then
|
|
|
- queryport="0"
|
|
|
- fi
|
|
|
-
|
|
|
- # gamespy query port
|
|
|
- if [ -f "${servercfgfullpath}" ]; then
|
|
|
gsqueryport=$(grep "OldQueryPortNumber=" "${servercfgfullpath}" | tr -d '\r' | tr -cd '[:digit:]')
|
|
|
- fi
|
|
|
- if [ ! -n "${gsqueryport}" ]; then
|
|
|
- gsqueryport="0"
|
|
|
- fi
|
|
|
-
|
|
|
- # query port
|
|
|
- if [ -f "${servercfgfullpath}" ]; then
|
|
|
- udplinkport=$((port + 2))
|
|
|
- fi
|
|
|
- if [ ! -n "${udplinkport}" ]; then
|
|
|
- udplinkport="0"
|
|
|
- fi
|
|
|
-
|
|
|
- # webadmin enabled
|
|
|
- if [ -f "${servercfgfullpath}" ]; then
|
|
|
webadminenabled=$(grep "bEnabled=" "${servercfgfullpath}" | sed 's/bEnabled=//g' | tr -d '\r')
|
|
|
- if [ ! -n "${webadminenabled}" ]; then
|
|
|
- webadminenabled="NOT SET"
|
|
|
- fi
|
|
|
- else
|
|
|
- webadminenabled="\e[0;31mUNAVAILABLE\e[0m"
|
|
|
- fi
|
|
|
-
|
|
|
- # webadmin port
|
|
|
- if [ -f "${servercfgfullpath}" ]; then
|
|
|
webadminport=$(grep "ListenPort=" "${servercfgfullpath}" | tr -d '\r' | tr -cd '[:digit:]')
|
|
|
- fi
|
|
|
- if [ ! -n "${webadminport}" ]; then
|
|
|
- webadminport="0"
|
|
|
- fi
|
|
|
-
|
|
|
- if [ "${engine}" == "unreal" ]; then
|
|
|
-
|
|
|
- # webadmin user
|
|
|
- if [ -f "${servercfgfullpath}" ]; then
|
|
|
+ if [ "${engine}" == "unreal" ]; then
|
|
|
webadminuser=$(grep "AdminUsername=" "${servercfgfullpath}" | sed 's/\AdminUsername=//g')
|
|
|
- if [ ! -n "${webadminuser}" ]; then
|
|
|
- webadminuser="NOT SET"
|
|
|
- fi
|
|
|
- else
|
|
|
- webadminuser="\e[0;31mUNAVAILABLE\e[0m"
|
|
|
- fi
|
|
|
-
|
|
|
- # webadmin password
|
|
|
- if [ -f "${servercfgfullpath}" ]; then
|
|
|
webadminpass=$(grep "UTServerAdmin.UTServerAdmin" "${servercfgfullpath}" -A 2 | grep "AdminPassword=" | sed 's/\AdminPassword=//g')
|
|
|
- if [ ! -n "${webadminpass}" ]; then
|
|
|
- webadminpass="NOT SET"
|
|
|
- fi
|
|
|
else
|
|
|
- webadminpass="\e[0;31mUNAVAILABLE\e[0m"
|
|
|
- fi
|
|
|
-
|
|
|
- else
|
|
|
-
|
|
|
- # webadmin user
|
|
|
- if [ -f "${servercfgfullpath}" ]; then
|
|
|
webadminuser=$(grep "AdminName=" "${servercfgfullpath}" | sed 's/\AdminName=//g')
|
|
|
- if [ ! -n "${webadminuser}" ]; then
|
|
|
- webadminuser="NOT SET"
|
|
|
- fi
|
|
|
- else
|
|
|
- webadminuser="\e[0;31mUNAVAILABLE\e[0m"
|
|
|
- fi
|
|
|
-
|
|
|
- # webadmin password
|
|
|
- if [ -f "${servercfgfullpath}" ]; then
|
|
|
webadminpass=$(grep "AdminPassword=" "${servercfgfullpath}" | sed 's/\AdminPassword=//g')
|
|
|
- if [ ! -n "${webadminpass}" ]; then
|
|
|
- webadminpass="NOT SET"
|
|
|
- fi
|
|
|
- else
|
|
|
- webadminpass="\e[0;31mUNAVAILABLE\e[0m"
|
|
|
fi
|
|
|
|
|
|
- fi
|
|
|
-
|
|
|
-# ARK: Survivaial Evolved
|
|
|
-elif [ "${gamename}" == "ARK: Survivial Evolved" ]; then
|
|
|
-
|
|
|
- # server name
|
|
|
- if [ -f "${servercfgfullpath}" ]; then
|
|
|
- servername=$(grep "SessionName=" "${servercfgfullpath}" | sed 's/SessionName=//g')
|
|
|
- if [ ! -n "${servername}" ]; then
|
|
|
- servername="NOT SET"
|
|
|
- fi
|
|
|
- else
|
|
|
- servername="\e[0;31mUNAVAILABLE\e[0m"
|
|
|
+ # Not Set
|
|
|
+ servername=${servername:-"NOT SET"}
|
|
|
+ serverpassword=${serverpassword:-"NOT SET"}
|
|
|
+ adminpassword=${adminpassword:-"NOT SET"}
|
|
|
+ port=${port:-"0"}
|
|
|
+ gsqueryport=${gsqueryport:-"NOT SET"}
|
|
|
+ webadminenabled=${webadminenabled:-"NOT SET"}
|
|
|
+ webadminport=${webadminport:-"NOT SET"}
|
|
|
+ webadminuser=${webadminuser:-"NOT SET"}
|
|
|
+ webadminpass=${webadminpass:-"NOT SET"}
|
|
|
fi
|
|
|
+}
|
|
|
|
|
|
- # server password
|
|
|
- if [ -f "${servercfgfullpath}" ]; then
|
|
|
- serverpassword=$(grep "ServerPassword=" "${servercfgfullpath}" | sed 's/ServerPassword=//g')
|
|
|
- if [ ! -n "${serverpassword}" ]; then
|
|
|
- serverpassword="NOT SET"
|
|
|
- fi
|
|
|
- else
|
|
|
- serverpassword="\e[0;31mUNAVAILABLE\e[0m"
|
|
|
- fi
|
|
|
-
|
|
|
- # admin password
|
|
|
- if [ -f "${servercfgfullpath}" ]; then
|
|
|
- adminpassword=$(grep "ServerAdminPassword=" "${servercfgfullpath}" | sed 's/ServerAdminPassword=//g')
|
|
|
- if [ ! -n "${adminpassword}" ]; then
|
|
|
- adminpassword="NOT SET"
|
|
|
- fi
|
|
|
- else
|
|
|
- adminpassword="\e[0;31mUNAVAILABLE\e[0m"
|
|
|
- fi
|
|
|
-
|
|
|
- # slots
|
|
|
- if [ -f "${servercfgfullpath}" ]; then
|
|
|
- slots=$(grep "MaxPlayers=" "${servercfgfullpath}" | tr -cd '[:digit:]')
|
|
|
- if [ ! -n "${slots}" ]; then
|
|
|
- slots="NOT SET"
|
|
|
- fi
|
|
|
- else
|
|
|
- slots="\e[0;31mUNAVAILABLE\e[0m"
|
|
|
- fi
|
|
|
-
|
|
|
- # port
|
|
|
- if [ -f "${servercfgfullpath}" ]; then
|
|
|
- port=$(grep "Port=" "${servercfgfullpath}" | grep -v "RCONPort=" | grep -v "QueryPort=" | tr -cd '[:digit:]')
|
|
|
- fi
|
|
|
- if [ ! -n "${port}" ]; then
|
|
|
- port="0"
|
|
|
- fi
|
|
|
-
|
|
|
- # rcon port
|
|
|
- if [ -f "${servercfgfullpath}" ]; then
|
|
|
- rconport=$(grep "RCONPort=" "${servercfgfullpath}" | tr -cd '[:digit:]')
|
|
|
- fi
|
|
|
- if [ ! -n "${rconport}" ]; then
|
|
|
- rconport="0"
|
|
|
- fi
|
|
|
-
|
|
|
- # query port
|
|
|
- if [ -f "${servercfgfullpath}" ]; then
|
|
|
- queryport=$(grep "QueryPort=" "${servercfgfullpath}" | tr -cd '[:digit:]')
|
|
|
- fi
|
|
|
- if [ ! -n "${queryport}" ]; then
|
|
|
- queryport="0"
|
|
|
- fi
|
|
|
-
|
|
|
-fi
|
|
|
+## Just Cause 2
|
|
|
+if [ "${engine}" == "avalanche" ]; then
|
|
|
+ fn_info_config_avalanche
|
|
|
+## Dont Starve Together
|
|
|
+elif [ "${engine}" == "dontstarve" ]; then
|
|
|
+ fn_info_config_dontstarve
|
|
|
+## Project Zomboid
|
|
|
+elif [ "${engine}" == "projectzomboid" ]; then
|
|
|
+ fn_info_config_projectzomboid
|
|
|
+# Quake Love
|
|
|
+elif [ "${engine}" == "idtech3" ]; then
|
|
|
+ fn_info_config_idtech3
|
|
|
+# ARMA 3
|
|
|
+elif [ "${engine}" == "realvirtuality" ]; then
|
|
|
+ fn_info_config_realvirtuality
|
|
|
+# Serious Sam
|
|
|
+elif [ "${engine}" == "seriousengine35" ]; then
|
|
|
+ fn_info_config_seriousengine35
|
|
|
+# Source Engine Games
|
|
|
+elif [ "${engine}" == "source" ]||[ "${engine}" == "goldsource" ]; then
|
|
|
+ fn_info_config_source
|
|
|
+elif [ "${gamename}" == "Teamspeak 3" ]; then
|
|
|
+ fn_info_config_teamspeak3
|
|
|
+# Teeworlds
|
|
|
+elif [ "${engine}" == "teeworlds" ]; then
|
|
|
+ fn_info_config_teeworlds
|
|
|
+elif [ "${engine}" == "terraria" ]; then
|
|
|
+ fn_info_config_terraria
|
|
|
+# Unreal/Unreal 2 engine
|
|
|
+elif [ "${engine}" == "unreal" ]||[ "${engine}" == "unreal2" ]; then
|
|
|
+ fn_info_config_unreal
|
|
|
+fi
|