|
@ -2,7 +2,7 @@ |
|
|
# LGSM fn_details_config function |
|
|
# LGSM fn_details_config function |
|
|
# Author: Daniel Gibbs |
|
|
# Author: Daniel Gibbs |
|
|
# Website: http://gameservermanagers.com |
|
|
# Website: http://gameservermanagers.com |
|
|
# Version: 220715 |
|
|
# Version: 250715 |
|
|
|
|
|
|
|
|
# Description: Gets specific details from config files. |
|
|
# Description: Gets specific details from config files. |
|
|
|
|
|
|
|
@ -20,14 +20,6 @@ fi |
|
|
|
|
|
|
|
|
## Just Cause 2 |
|
|
## Just Cause 2 |
|
|
if [ "${engine}" == "avalanche" ]; then |
|
|
if [ "${engine}" == "avalanche" ]; then |
|
|
# 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 name |
|
|
# server name |
|
|
if [ -f "${servercfgfullpath}" ]; then |
|
|
if [ -f "${servercfgfullpath}" ]; then |
|
@ -39,12 +31,13 @@ if [ "${engine}" == "avalanche" ]; then |
|
|
servername="\e[0;31mUNAVAILABLE\e[0m" |
|
|
servername="\e[0;31mUNAVAILABLE\e[0m" |
|
|
fi |
|
|
fi |
|
|
|
|
|
|
|
|
# port |
|
|
# ip |
|
|
if [ -f "${servercfgfullpath}" ]; then |
|
|
if [ -f "${servercfgfullpath}" ]; then |
|
|
port=$(grep "BindPort" "${servercfgfullpath}"|tr -cd [:digit:]) |
|
|
# 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 |
|
|
fi |
|
|
if [ ! -n "${port}" ]; then |
|
|
if [ -n "${configipcheck}" ]; then |
|
|
port="0" |
|
|
ip=$(grep "BindIP" "${servercfgfullpath}"|sed 's/BindIP//g'|tr -d '=", \n') |
|
|
fi |
|
|
fi |
|
|
|
|
|
|
|
|
# server password |
|
|
# server password |
|
@ -67,10 +60,19 @@ if [ "${engine}" == "avalanche" ]; then |
|
|
slots="\e[0;31mUNAVAILABLE\e[0m" |
|
|
slots="\e[0;31mUNAVAILABLE\e[0m" |
|
|
fi |
|
|
fi |
|
|
|
|
|
|
|
|
|
|
|
# port |
|
|
|
|
|
if [ -f "${servercfgfullpath}" ]; then |
|
|
|
|
|
port=$(grep "BindPort" "${servercfgfullpath}"|tr -cd [:digit:]) |
|
|
|
|
|
fi |
|
|
|
|
|
if [ ! -n "${port}" ]; then |
|
|
|
|
|
port="0" |
|
|
|
|
|
fi |
|
|
|
|
|
|
|
|
fn_servercfgfullpath |
|
|
fn_servercfgfullpath |
|
|
|
|
|
|
|
|
## Dont Starve Together |
|
|
## Dont Starve Together |
|
|
elif [ "${engine}" == "dontstarve" ]; then |
|
|
elif [ "${engine}" == "dontstarve" ]; then |
|
|
|
|
|
|
|
|
# server name |
|
|
# server name |
|
|
if [ -f "${servercfgfullpath}" ]; then |
|
|
if [ -f "${servercfgfullpath}" ]; then |
|
|
servername=$(grep -s "default_server_name = " "${servercfgfullpath}"|sed 's/default_server_name = //g') |
|
|
servername=$(grep -s "default_server_name = " "${servercfgfullpath}"|sed 's/default_server_name = //g') |
|
@ -81,14 +83,6 @@ elif [ "${engine}" == "dontstarve" ]; then |
|
|
servername="\e[0;31mUNAVAILABLE\e[0m" |
|
|
servername="\e[0;31mUNAVAILABLE\e[0m" |
|
|
fi |
|
|
fi |
|
|
|
|
|
|
|
|
# port |
|
|
|
|
|
if [ -f "${servercfgfullpath}" ]; then |
|
|
|
|
|
port=$(grep -s "server_port" "${servercfgfullpath}"|grep -v "#"|tr -cd "[:digit:]") |
|
|
|
|
|
fi |
|
|
|
|
|
if [ ! -n "${port}" ]; then |
|
|
|
|
|
port="0" |
|
|
|
|
|
fi |
|
|
|
|
|
|
|
|
|
|
|
# server password |
|
|
# server password |
|
|
if [ -f "${servercfgfullpath}" ]; then |
|
|
if [ -f "${servercfgfullpath}" ]; then |
|
|
serverpassword=$(grep -s "server_password = " "${servercfgfullpath}"|grep -v "#"|sed 's/server_password = //g') |
|
|
serverpassword=$(grep -s "server_password = " "${servercfgfullpath}"|grep -v "#"|sed 's/server_password = //g') |
|
@ -129,8 +123,19 @@ elif [ "${engine}" == "dontstarve" ]; then |
|
|
tickrate="\e[0;31mUNAVAILABLE\e[0m" |
|
|
tickrate="\e[0;31mUNAVAILABLE\e[0m" |
|
|
fi |
|
|
fi |
|
|
|
|
|
|
|
|
|
|
|
# port |
|
|
|
|
|
if [ -f "${servercfgfullpath}" ]; then |
|
|
|
|
|
port=$(grep -s "server_port" "${servercfgfullpath}"|grep -v "#"|tr -cd "[:digit:]") |
|
|
|
|
|
fi |
|
|
|
|
|
if [ ! -n "${port}" ]; then |
|
|
|
|
|
port="0" |
|
|
|
|
|
fi |
|
|
|
|
|
|
|
|
|
|
|
fn_servercfgfullpath |
|
|
|
|
|
|
|
|
## Project Zomboid |
|
|
## Project Zomboid |
|
|
elif [ "${engine}" == "projectzomboid" ]; then |
|
|
elif [ "${engine}" == "projectzomboid" ]; then |
|
|
|
|
|
|
|
|
# server name |
|
|
# server name |
|
|
if [ -f "${servercfgfullpath}" ]; then |
|
|
if [ -f "${servercfgfullpath}" ]; then |
|
|
servername=$(grep -s "PublicName=" "${servercfgfullpath}"|sed 's/PublicName=//g'|tr -d '=", \n') |
|
|
servername=$(grep -s "PublicName=" "${servercfgfullpath}"|sed 's/PublicName=//g'|tr -d '=", \n') |
|
@ -141,14 +146,6 @@ elif [ "${engine}" == "projectzomboid" ]; then |
|
|
servername="\e[0;31mUNAVAILABLE\e[0m" |
|
|
servername="\e[0;31mUNAVAILABLE\e[0m" |
|
|
fi |
|
|
fi |
|
|
|
|
|
|
|
|
# port |
|
|
|
|
|
if [ -f "${servercfgfullpath}" ]; then |
|
|
|
|
|
port=$(grep -s "DefaultPort=" "${servercfgfullpath}"|tr -cd [:digit:]) |
|
|
|
|
|
fi |
|
|
|
|
|
if [ ! -n "${port}" ]; then |
|
|
|
|
|
port="0" |
|
|
|
|
|
fi |
|
|
|
|
|
|
|
|
|
|
|
# slots |
|
|
# slots |
|
|
if [ -f "${servercfgfullpath}" ]; then |
|
|
if [ -f "${servercfgfullpath}" ]; then |
|
|
slots=$(grep -s "MaxPlayers=" "${servercfgfullpath}"|grep -v "#"|tr -cd [:digit:]) |
|
|
slots=$(grep -s "MaxPlayers=" "${servercfgfullpath}"|grep -v "#"|tr -cd [:digit:]) |
|
@ -159,9 +156,18 @@ elif [ "${engine}" == "projectzomboid" ]; then |
|
|
slots="\e[0;31mUNAVAILABLE\e[0m" |
|
|
slots="\e[0;31mUNAVAILABLE\e[0m" |
|
|
fi |
|
|
fi |
|
|
|
|
|
|
|
|
|
|
|
# port |
|
|
|
|
|
if [ -f "${servercfgfullpath}" ]; then |
|
|
|
|
|
port=$(grep -s "DefaultPort=" "${servercfgfullpath}"|tr -cd [:digit:]) |
|
|
|
|
|
fi |
|
|
|
|
|
if [ ! -n "${port}" ]; then |
|
|
|
|
|
port="0" |
|
|
|
|
|
fi |
|
|
|
|
|
|
|
|
fn_servercfgfullpath |
|
|
fn_servercfgfullpath |
|
|
|
|
|
|
|
|
elif [ "${engine}" == "realvirtuality" ]; then |
|
|
elif [ "${engine}" == "realvirtuality" ]; then |
|
|
|
|
|
|
|
|
# server name |
|
|
# server name |
|
|
if [ -f "${servercfgfullpath}" ]; then |
|
|
if [ -f "${servercfgfullpath}" ]; then |
|
|
servername=$(grep -s "hostname" "${servercfgfullpath}"| grep -v //|sed -e 's/\<hostname\>//g'| tr -d '=\"; ') |
|
|
servername=$(grep -s "hostname" "${servercfgfullpath}"| grep -v //|sed -e 's/\<hostname\>//g'| tr -d '=\"; ') |
|
@ -172,28 +178,24 @@ elif [ "${engine}" == "realvirtuality" ]; then |
|
|
servername="\e[0;31mUNAVAILABLE\e[0m" |
|
|
servername="\e[0;31mUNAVAILABLE\e[0m" |
|
|
fi |
|
|
fi |
|
|
|
|
|
|
|
|
# port |
|
|
# admin password |
|
|
if [ -f "${servercfgfullpath}" ]; then |
|
|
|
|
|
port=$(grep -s "serverport=" "${servercfgfullpath}"|grep -v //|tr -d '\r'|tr -cd [:digit:]) |
|
|
|
|
|
fi |
|
|
|
|
|
if [ ! -n "${port}" ]; then |
|
|
|
|
|
port="0" |
|
|
|
|
|
fi |
|
|
|
|
|
|
|
|
|
|
|
# query port |
|
|
|
|
|
if [ -f "${servercfgfullpath}" ]; then |
|
|
if [ -f "${servercfgfullpath}" ]; then |
|
|
queryport=$(grep -s "steamqueryport=" "${servercfgfullpath}"|grep -v //|tr -d '\r'|tr -cd [:digit:]) |
|
|
adminpassword=$(grep -s "password =" "${servercfgfullpath}"|grep -v //|sed -e 's/\password//g'|tr -d '=\"; ') |
|
|
|
|
|
if [ ! -n "${adminpassword}" ]; then |
|
|
|
|
|
adminpassword="NOT SET" |
|
|
fi |
|
|
fi |
|
|
if [ ! -n "${queryport}" ]; then |
|
|
else |
|
|
queryport="0" |
|
|
adminpassword="\e[0;31mUNAVAILABLE\e[0m" |
|
|
fi |
|
|
fi |
|
|
|
|
|
|
|
|
# master port |
|
|
# server password |
|
|
if [ -f "${servercfgfullpath}" ]; then |
|
|
if [ -f "${servercfgfullpath}" ]; then |
|
|
masterport=$(grep -s "steamport=" "${servercfgfullpath}"|grep -v //|tr -d '\r'|tr -cd [:digit:]) |
|
|
serverpassword=$(grep -s "passwordAdmin" "${servercfgfullpath}"|grep -v //|sed -e 's/\passwordAdmin//g'|tr -d '=\"; ') |
|
|
|
|
|
if [ ! -n "${adminpassword}" ]; then |
|
|
|
|
|
serverpassword="NOT SET" |
|
|
fi |
|
|
fi |
|
|
if [ ! -n "${masterport}" ]; then |
|
|
else |
|
|
masterport="0" |
|
|
serverpassword="\e[0;31mUNAVAILABLE\e[0m" |
|
|
fi |
|
|
fi |
|
|
|
|
|
|
|
|
# slots |
|
|
# slots |
|
@ -206,29 +208,34 @@ elif [ "${engine}" == "realvirtuality" ]; then |
|
|
slots="\e[0;31mUNAVAILABLE\e[0m" |
|
|
slots="\e[0;31mUNAVAILABLE\e[0m" |
|
|
fi |
|
|
fi |
|
|
|
|
|
|
|
|
# admin password |
|
|
# port |
|
|
if [ -f "${servercfgfullpath}" ]; then |
|
|
if [ -f "${servercfgfullpath}" ]; then |
|
|
adminpassword=$(grep -s "password =" "${servercfgfullpath}"|grep -v //|sed -e 's/\password//g'|tr -d '=\"; ') |
|
|
port=$(grep -s "serverport=" "${servercfgfullpath}"|grep -v //|tr -d '\r'|tr -cd [:digit:]) |
|
|
if [ ! -n "${adminpassword}" ]; then |
|
|
|
|
|
adminpassword="NOT SET" |
|
|
|
|
|
fi |
|
|
fi |
|
|
else |
|
|
if [ ! -n "${port}" ]; then |
|
|
adminpassword="\e[0;31mUNAVAILABLE\e[0m" |
|
|
port="0" |
|
|
fi |
|
|
fi |
|
|
|
|
|
|
|
|
# server password |
|
|
# query port |
|
|
if [ -f "${servercfgfullpath}" ]; then |
|
|
if [ -f "${servercfgfullpath}" ]; then |
|
|
serverpassword=$(grep -s "passwordAdmin" "${servercfgfullpath}"|grep -v //|sed -e 's/\passwordAdmin//g'|tr -d '=\"; ') |
|
|
queryport=$(grep -s "steamqueryport=" "${servercfgfullpath}"|grep -v //|tr -d '\r'|tr -cd [:digit:]) |
|
|
if [ ! -n "${adminpassword}" ]; then |
|
|
|
|
|
serverpassword="NOT SET" |
|
|
|
|
|
fi |
|
|
fi |
|
|
else |
|
|
if [ ! -n "${queryport}" ]; then |
|
|
serverpassword="\e[0;31mUNAVAILABLE\e[0m" |
|
|
queryport="0" |
|
|
|
|
|
fi |
|
|
|
|
|
|
|
|
|
|
|
# master port |
|
|
|
|
|
if [ -f "${servercfgfullpath}" ]; then |
|
|
|
|
|
masterport=$(grep -s "steamport=" "${servercfgfullpath}"|grep -v //|tr -d '\r'|tr -cd [:digit:]) |
|
|
|
|
|
fi |
|
|
|
|
|
if [ ! -n "${masterport}" ]; then |
|
|
|
|
|
masterport="0" |
|
|
fi |
|
|
fi |
|
|
|
|
|
|
|
|
fn_servercfgfullpath |
|
|
fn_servercfgfullpath |
|
|
|
|
|
|
|
|
elif [ "${engine}" == "seriousengine35" ]; then |
|
|
elif [ "${engine}" == "seriousengine35" ]; then |
|
|
|
|
|
|
|
|
# server name |
|
|
# server name |
|
|
if [ -f "${servercfgfullpath}" ]; then |
|
|
if [ -f "${servercfgfullpath}" ]; then |
|
|
servername=$(grep -s "prj_strMultiplayerSessionName" "${servercfgfullpath}"|sed 's/prj_strMultiplayerSessionName = //g'|tr -d '=\"; ') |
|
|
servername=$(grep -s "prj_strMultiplayerSessionName" "${servercfgfullpath}"|sed 's/prj_strMultiplayerSessionName = //g'|tr -d '=\"; ') |
|
@ -239,7 +246,7 @@ elif [ "${engine}" == "seriousengine35" ]; then |
|
|
servername="\e[0;31mUNAVAILABLE\e[0m" |
|
|
servername="\e[0;31mUNAVAILABLE\e[0m" |
|
|
fi |
|
|
fi |
|
|
|
|
|
|
|
|
# rcon |
|
|
# rcon password |
|
|
if [ -f "${servercfgfullpath}" ]; then |
|
|
if [ -f "${servercfgfullpath}" ]; then |
|
|
rcon=$(grep -s "rcts_strAdminPassword" "${servercfgfullpath}"|sed 's/rcts_strAdminPassword = //g'|tr -d '=\"; ') |
|
|
rcon=$(grep -s "rcts_strAdminPassword" "${servercfgfullpath}"|sed 's/rcts_strAdminPassword = //g'|tr -d '=\"; ') |
|
|
if [ ! -n "${rcon}" ]; then |
|
|
if [ ! -n "${rcon}" ]; then |
|
@ -249,22 +256,6 @@ elif [ "${engine}" == "seriousengine35" ]; then |
|
|
servername="\e[0;31mUNAVAILABLE\e[0m" |
|
|
servername="\e[0;31mUNAVAILABLE\e[0m" |
|
|
fi |
|
|
fi |
|
|
|
|
|
|
|
|
# port |
|
|
|
|
|
if [ -f "${servercfgfullpath}" ]; then |
|
|
|
|
|
port=$(grep -s "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 |
|
|
|
|
|
|
|
|
|
|
|
# slots |
|
|
# slots |
|
|
if [ -f "${servercfgfullpath}" ]; then |
|
|
if [ -f "${servercfgfullpath}" ]; then |
|
|
slots=$(grep -s "gam_ctMaxPlayers" "${servercfgfullpath}"|grep -v "#"|tr -cd [:digit:]) |
|
|
slots=$(grep -s "gam_ctMaxPlayers" "${servercfgfullpath}"|grep -v "#"|tr -cd [:digit:]) |
|
@ -285,7 +276,26 @@ elif [ "${engine}" == "seriousengine35" ]; then |
|
|
gamemode="\e[0;31mUNAVAILABLE\e[0m" |
|
|
gamemode="\e[0;31mUNAVAILABLE\e[0m" |
|
|
fi |
|
|
fi |
|
|
|
|
|
|
|
|
|
|
|
# port |
|
|
|
|
|
if [ -f "${servercfgfullpath}" ]; then |
|
|
|
|
|
port=$(grep -s "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 |
|
|
|
|
|
|
|
|
|
|
|
fn_servercfgfullpath |
|
|
|
|
|
|
|
|
elif [ "${engine}" == "source" ]||[ "${engine}" == "goldsource" ]; then |
|
|
elif [ "${engine}" == "source" ]||[ "${engine}" == "goldsource" ]; then |
|
|
|
|
|
|
|
|
# server name |
|
|
# server name |
|
|
if [ -f "${servercfgfullpath}" ]; then |
|
|
if [ -f "${servercfgfullpath}" ]; then |
|
|
servername=$(grep -s "hostname" "${servercfgfullpath}"|sed 's/hostname //g'|sed 's/"//g') |
|
|
servername=$(grep -s "hostname" "${servercfgfullpath}"|sed 's/hostname //g'|sed 's/"//g') |
|
@ -296,16 +306,6 @@ elif [ "${engine}" == "source" ]||[ "${engine}" == "goldsource" ]; then |
|
|
servername="\e[0;31mUNAVAILABLE\e[0m" |
|
|
servername="\e[0;31mUNAVAILABLE\e[0m" |
|
|
fi |
|
|
fi |
|
|
|
|
|
|
|
|
# rcon |
|
|
|
|
|
if [ -f "${servercfgfullpath}" ]; then |
|
|
|
|
|
rcon=$(grep -s "rcon_password" "${servercfgfullpath}"|sed 's/rcon_password //g'|sed 's/"//g') |
|
|
|
|
|
if [ ! -n "${rcon}" ]; then |
|
|
|
|
|
rcon="NOT SET" |
|
|
|
|
|
fi |
|
|
|
|
|
else |
|
|
|
|
|
rcon="\e[0;31mUNAVAILABLE\e[0m" |
|
|
|
|
|
fi |
|
|
|
|
|
|
|
|
|
|
|
# server password |
|
|
# server password |
|
|
if [ -f "${servercfgfullpath}" ]; then |
|
|
if [ -f "${servercfgfullpath}" ]; then |
|
|
serverpassword=$(grep -s "sv_password" "${servercfgfullpath}"|sed 's/sv_password//g'|sed 's/"//g') |
|
|
serverpassword=$(grep -s "sv_password" "${servercfgfullpath}"|sed 's/sv_password//g'|sed 's/"//g') |
|
@ -316,6 +316,16 @@ elif [ "${engine}" == "source" ]||[ "${engine}" == "goldsource" ]; then |
|
|
serverpassword="\e[0;31mUNAVAILABLE\e[0m" |
|
|
serverpassword="\e[0;31mUNAVAILABLE\e[0m" |
|
|
fi |
|
|
fi |
|
|
|
|
|
|
|
|
|
|
|
# rcon password |
|
|
|
|
|
if [ -f "${servercfgfullpath}" ]; then |
|
|
|
|
|
rcon=$(grep -s "rcon_password" "${servercfgfullpath}"|sed 's/rcon_password //g'|sed 's/"//g') |
|
|
|
|
|
if [ ! -n "${rcon}" ]; then |
|
|
|
|
|
rcon="NOT SET" |
|
|
|
|
|
fi |
|
|
|
|
|
else |
|
|
|
|
|
rcon="\e[0;31mUNAVAILABLE\e[0m" |
|
|
|
|
|
fi |
|
|
|
|
|
|
|
|
# slots |
|
|
# slots |
|
|
if [ -f "${servercfgfullpath}" ]; then |
|
|
if [ -f "${servercfgfullpath}" ]; then |
|
|
slots=$(grep -s "gam_ctMaxPlayers" "${servercfgfullpath}"|grep -v "#"|tr -cd [:digit:]) |
|
|
slots=$(grep -s "gam_ctMaxPlayers" "${servercfgfullpath}"|grep -v "#"|tr -cd [:digit:]) |
|
@ -327,6 +337,7 @@ elif [ "${engine}" == "source" ]||[ "${engine}" == "goldsource" ]; then |
|
|
fi |
|
|
fi |
|
|
|
|
|
|
|
|
elif [ "${engine}" == "spark" ]; then |
|
|
elif [ "${engine}" == "spark" ]; then |
|
|
|
|
|
|
|
|
# query port |
|
|
# query port |
|
|
if [ -f "${servercfgfullpath}" ]; then |
|
|
if [ -f "${servercfgfullpath}" ]; then |
|
|
queryport=$((${port} + 1)) |
|
|
queryport=$((${port} + 1)) |
|
@ -336,6 +347,26 @@ elif [ "${engine}" == "spark" ]; then |
|
|
fi |
|
|
fi |
|
|
|
|
|
|
|
|
elif [ "${gamename}" == "Teamspeak 3" ]; then |
|
|
elif [ "${gamename}" == "Teamspeak 3" ]; then |
|
|
|
|
|
|
|
|
|
|
|
# ip |
|
|
|
|
|
if [ -f "${servercfgfullpath}" ]; then |
|
|
|
|
|
# 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 "${serverpassword}" ]; then |
|
|
|
|
|
dbplugin="NOT SET" |
|
|
|
|
|
fi |
|
|
|
|
|
else |
|
|
|
|
|
dbplugin="\e[0;31mUNAVAILABLE\e[0m" |
|
|
|
|
|
fi |
|
|
|
|
|
|
|
|
# port |
|
|
# port |
|
|
if [ -f "${servercfgfullpath}" ]; then |
|
|
if [ -f "${servercfgfullpath}" ]; then |
|
|
port=$(grep "default_voice_port=" "${servercfgfullpath}"|tr -cd [:digit:]) |
|
|
port=$(grep "default_voice_port=" "${servercfgfullpath}"|tr -cd [:digit:]) |
|
@ -360,26 +391,8 @@ elif [ "${gamename}" == "Teamspeak 3" ]; then |
|
|
fileport="30033" |
|
|
fileport="30033" |
|
|
fi |
|
|
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 "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 "${serverpassword}" ]; then |
|
|
|
|
|
dbplugin="NOT SET" |
|
|
|
|
|
fi |
|
|
|
|
|
else |
|
|
|
|
|
dbplugin="\e[0;31mUNAVAILABLE\e[0m" |
|
|
|
|
|
fi |
|
|
|
|
|
|
|
|
|
|
|
elif [ "${engine}" == "unity3d" ]; then |
|
|
elif [ "${engine}" == "unity3d" ]; then |
|
|
|
|
|
|
|
|
# server name |
|
|
# server name |
|
|
if [ -f "${servercfgfullpath}" ]; then |
|
|
if [ -f "${servercfgfullpath}" ]; then |
|
|
servername=$(grep "ServerName" "${servercfgfullpath}"|sed 's/^.*value="//'|cut -f1 -d"\"") |
|
|
servername=$(grep "ServerName" "${servercfgfullpath}"|sed 's/^.*value="//'|cut -f1 -d"\"") |
|
@ -400,22 +413,6 @@ elif [ "${engine}" == "unity3d" ]; then |
|
|
serverpassword="\e[0;31mUNAVAILABLE\e[0m" |
|
|
serverpassword="\e[0;31mUNAVAILABLE\e[0m" |
|
|
fi |
|
|
fi |
|
|
|
|
|
|
|
|
# port |
|
|
|
|
|
if [ -f "${servercfgfullpath}" ]; then |
|
|
|
|
|
port=$(grep "ServerPort" "${servercfgfullpath}"|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 |
|
|
|
|
|
|
|
|
|
|
|
# webadmin enabled |
|
|
# webadmin enabled |
|
|
if [ -f "${servercfgfullpath}" ]; then |
|
|
if [ -f "${servercfgfullpath}" ]; then |
|
|
webadminenabled=$(grep "ControlPanelEnabled" "${servercfgfullpath}"|sed 's/^.*value="//'|cut -f1 -d"\"") |
|
|
webadminenabled=$(grep "ControlPanelEnabled" "${servercfgfullpath}"|sed 's/^.*value="//'|cut -f1 -d"\"") |
|
@ -512,19 +509,127 @@ elif [ "${engine}" == "unity3d" ]; then |
|
|
gameworld="\e[0;31mUNAVAILABLE\e[0m" |
|
|
gameworld="\e[0;31mUNAVAILABLE\e[0m" |
|
|
fi |
|
|
fi |
|
|
|
|
|
|
|
|
|
|
|
# port |
|
|
|
|
|
if [ -f "${servercfgfullpath}" ]; then |
|
|
|
|
|
port=$(grep "ServerPort" "${servercfgfullpath}"|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 |
|
|
|
|
|
|
|
|
elif [ "${engine}" == "unreal" ]||[ "${engine}" == "unreal2" ]; then |
|
|
elif [ "${engine}" == "unreal" ]||[ "${engine}" == "unreal2" ]; then |
|
|
|
|
|
|
|
|
|
|
|
# server name |
|
|
|
|
|
if [ -f "${servercfgfullpath}" ]; then |
|
|
servername=$(grep -s ServerName= ${servercfgfullpath}|sed 's/ServerName=//g') |
|
|
servername=$(grep -s ServerName= ${servercfgfullpath}|sed 's/ServerName=//g') |
|
|
|
|
|
if [ ! -n "${servername}" ]; then |
|
|
|
|
|
servername="NOT SET" |
|
|
|
|
|
fi |
|
|
|
|
|
else |
|
|
|
|
|
servername="\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:]) |
|
|
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)) |
|
|
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:]) |
|
|
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)) |
|
|
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') |
|
|
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:]) |
|
|
webadminport=$(grep ListenPort= "${servercfgfullpath}"|tr -d '\r'|tr -cd [:digit:]) |
|
|
|
|
|
fi |
|
|
|
|
|
if [ ! -n "${webadminport}" ]; then |
|
|
|
|
|
webadminport="0" |
|
|
|
|
|
fi |
|
|
|
|
|
|
|
|
if [ "${engine}" == "unreal" ]; then |
|
|
if [ "${engine}" == "unreal" ]; then |
|
|
|
|
|
|
|
|
|
|
|
# webadmin user |
|
|
|
|
|
if [ -f "${servercfgfullpath}" ]; then |
|
|
webadminuser=$(grep AdminUsername= "${servercfgfullpath}"|sed 's/\AdminUsername=//g') |
|
|
webadminuser=$(grep AdminUsername= "${servercfgfullpath}"|sed 's/\AdminUsername=//g') |
|
|
|
|
|
if [ ! -n "${webadminpass}" ]; then |
|
|
|
|
|
webadminpass="NOT SET" |
|
|
|
|
|
fi |
|
|
|
|
|
else |
|
|
|
|
|
webadminpass="\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') |
|
|
webadminpass=$(grep UTServerAdmin.UTServerAdmin "${servercfgfullpath}" -A 2| grep AdminPassword=|sed 's/\AdminPassword=//g') |
|
|
|
|
|
if [ ! -n "${webadminpass}" ]; then |
|
|
|
|
|
webadminpass="NOT SET" |
|
|
|
|
|
fi |
|
|
else |
|
|
else |
|
|
|
|
|
webadminpass="\e[0;31mUNAVAILABLE\e[0m" |
|
|
|
|
|
fi |
|
|
|
|
|
|
|
|
|
|
|
else |
|
|
|
|
|
|
|
|
|
|
|
# webadmin user |
|
|
|
|
|
if [ -f "${servercfgfullpath}" ]; then |
|
|
webadminuser=$(grep AdminName= "${servercfgfullpath}"|sed 's/\AdminName=//g') |
|
|
webadminuser=$(grep AdminName= "${servercfgfullpath}"|sed 's/\AdminName=//g') |
|
|
|
|
|
if [ ! -n "${webadminpass}" ]; then |
|
|
|
|
|
webadminpass="NOT SET" |
|
|
|
|
|
fi |
|
|
|
|
|
else |
|
|
|
|
|
webadminpass="\e[0;31mUNAVAILABLE\e[0m" |
|
|
|
|
|
fi |
|
|
|
|
|
|
|
|
|
|
|
# webadmin password |
|
|
|
|
|
if [ -f "${servercfgfullpath}" ]; then |
|
|
webadminpass=$(grep AdminPassword= "${servercfgfullpath}"|sed 's/\AdminPassword=//g') |
|
|
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 |
|
|
fi |
|
|
fi |
|
|
fi |
|
|