From 6521320df133cf4472d9b8aeb281e7719166934d Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Tue, 31 Aug 2021 21:53:23 +0100 Subject: [PATCH] feat(info): refactor info modules (#3428) * add new details to queryraw * fix httpport ac server * correct info bug for bt1944server * added bt1944 to info_parms update info messages bt1944ports * steamport * raw port raw * message display * check_root bug * add more ports merge words * arma 3 improvements * master port * add arma3 ports * portnames * strip ./ from executable * exec * integrate ss * replace netstat with ss * port header headerr * remove inbound outbound * ark * shorten executable * change to port display * add info_distro * response * acserver improvements acserver ac * add assettocorsa query * ss * rawport * update av server exec merge av changes * av ports * av ss bug * av * avserver * remove port * port changes * listen * col * bt1944 * cmw cmw * cmw * changes * etl * add servers * hw * inss ins * add rcon to insserver * rcon * jc * jc3 minecraft * mcb * onset * Memories of mars * mumble * changes * steamport * tcp query * udp * fix * steamport * info_distro now required before parms * srcdslinuxopid * srcds_linux * hlds_linux * ins * date * ns2 * rising world rising world query port rising world javaram rising world a * rising world ports * portipv6 * add ports to query raw * add Rising World Query * fix rising world game mode * update 7 Days to Die * port3 * increased sdtd glibc to 2.27 * corrected starbound ports location * starbound * added new SteamCMD error code * Master server check if query raw * Stationeers * stationeers * webadmin * added extra query ports for ts3 a * add teamspeak3 query * add ts3 query details * ts3 version * queryport reverts back once gamedig finished * added telnetport to ts3 * fix TS3 bug causing shutdown when starting debug the fix was running and killing a running server * show start parameters for ts3 * tower unite * terraria * terraria * ss command in dev-query-raw info_messages.sh * ut4 and others * more updates * soldat * col vint * pvr query port tab * pvr query type tcp * pvr gameport+400 * changed to shortname * unreal99 * ut99 beacon * httpport * ut2k4 * kf * kf * bug * httpport * httpport * more kf ports * lan port * steammasterport * kf * ports * ports * ut2k4 * ut2k4 * lanport * lanport * ro * ro * kf2 * httpport * update naming * ut3 * ut3 * ut3 * mom * mom * reshuffle * sort list * function re-shuffle * merge info_parms and info_config into info_game.sh a * updated source filters * added ac to edit ports array * Revert "updated source filters" This reverts commit e8621eaed6d7b7f38fa3911858a4c28a0e4dcc18. * spaces * fix typo * tidy * re ordered ports edit array * added java * add bf1942 * Added Last Oasis * corrected pc function name * re ordered in alpha * space * remove space --- .../config-lgsm/acserver/_default.cfg | 2 +- .../config-lgsm/avserver/_default.cfg | 6 +- .../config-lgsm/csgoserver/_default.cfg | 1 + .../config-lgsm/inssserver/_default.cfg | 4 +- .../config-lgsm/pvrserver/_default.cfg | 2 +- .../config-lgsm/rwserver/_default.cfg | 4 +- .../config-lgsm/sdtdserver/_default.cfg | 2 +- .../config-lgsm/ts3server/_default.cfg | 2 +- lgsm/data/serverlist.csv | 2 +- lgsm/functions/alert.sh | 2 +- lgsm/functions/check_ip.sh | 3 +- lgsm/functions/check_root.sh | 3 + lgsm/functions/command_debug.sh | 9 +- lgsm/functions/command_details.sh | 6 +- lgsm/functions/command_dev_query_raw.sh | 208 +- lgsm/functions/command_monitor.sh | 5 +- lgsm/functions/command_postdetails.sh | 4 +- lgsm/functions/command_restart.sh | 2 +- lgsm/functions/command_start.sh | 10 +- lgsm/functions/command_stop.sh | 2 +- lgsm/functions/command_test_alert.sh | 2 +- lgsm/functions/core_dl.sh | 10 +- lgsm/functions/core_functions.sh | 11 +- lgsm/functions/fix_ts3.sh | 2 +- lgsm/functions/info_distro.sh | 10 +- .../{info_config.sh => info_game.sh} | 2258 ++++++++++------- lgsm/functions/info_messages.sh | 1130 ++++----- lgsm/functions/info_parms.sh | 332 --- lgsm/functions/query_gamedig.sh | 17 +- tests/tests_fctrserver.sh | 2 +- tests/tests_jc2server.sh | 2 +- tests/tests_mcserver.sh | 2 +- tests/tests_ts3server.sh | 2 +- 33 files changed, 2190 insertions(+), 1869 deletions(-) rename lgsm/functions/{info_config.sh => info_game.sh} (79%) mode change 100755 => 100644 delete mode 100755 lgsm/functions/info_parms.sh diff --git a/lgsm/config-default/config-lgsm/acserver/_default.cfg b/lgsm/config-default/config-lgsm/acserver/_default.cfg index 728671a7a..6dbcf68e6 100644 --- a/lgsm/config-default/config-lgsm/acserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/acserver/_default.cfg @@ -139,7 +139,7 @@ stopmode="2" # 4: gsquery # 5: tcp querymode="5" -querytype="" +querytype="assettocorsa" ## Console type consoleverbose="yes" diff --git a/lgsm/config-default/config-lgsm/avserver/_default.cfg b/lgsm/config-default/config-lgsm/avserver/_default.cfg index 17d670d0f..2eef21849 100644 --- a/lgsm/config-default/config-lgsm/avserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/avserver/_default.cfg @@ -9,7 +9,7 @@ #### Game Server Settings #### ## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters -port="27000" + # https://steamidfinder.com adminsteamid="" if [ -n "${adminsteamid}" ]; then @@ -160,8 +160,8 @@ glibc="2.15" avdatapath="${serverfiles}/galaxy" avgalaxypath="${avdatapath}/${selfname}" systemdir="${serverfiles}" -executabledir="${systemdir}" -executable="./server.sh" +executabledir="${systemdir}/bin" +executable="./bin/AvorionServer" servercfgdir="${avgalaxypath}" servercfg="server.ini" servercfgdefault="server.ini" diff --git a/lgsm/config-default/config-lgsm/csgoserver/_default.cfg b/lgsm/config-default/config-lgsm/csgoserver/_default.cfg index 28f3082b3..564ac84a3 100644 --- a/lgsm/config-default/config-lgsm/csgoserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/csgoserver/_default.cfg @@ -26,6 +26,7 @@ ip="0.0.0.0" port="27015" clientport="27005" sourcetvport="27020" +steamport="26901" defaultmap="de_mirage" maxplayers="16" tickrate="64" diff --git a/lgsm/config-default/config-lgsm/inssserver/_default.cfg b/lgsm/config-default/config-lgsm/inssserver/_default.cfg index e9895b132..1dbc0889f 100644 --- a/lgsm/config-default/config-lgsm/inssserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/inssserver/_default.cfg @@ -12,6 +12,8 @@ ip="0.0.0.0" port="27102" queryport="27131" +rconport="27015" +rconpassword="" servername="LinuxGSM Server" defaultmap="Canyon" defaultscenario="Scenario_Crossing_Push_Security" @@ -19,7 +21,7 @@ maxplayers="28" ## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters ## Parameter Docs | https://sandstorm-support.newworldinteractive.com/hc/en-us/articles/360049211072-Server-Admin-Guide -startparameters="${defaultmap}?Scenario=${defaultscenario}?MaxPlayers=${maxplayers} -Port=${port} -QueryPort=${queryport} -hostname='${servername}' -log" +startparameters="${defaultmap}?Scenario=${defaultscenario}?MaxPlayers=${maxplayers} -Port=${port} -QueryPort=${queryport} -hostname='${servername}' -Rcon -RconPassword=${rconpassword} -RconListenPort=${rconport} -log" #### LinuxGSM Settings #### diff --git a/lgsm/config-default/config-lgsm/pvrserver/_default.cfg b/lgsm/config-default/config-lgsm/pvrserver/_default.cfg index 3fa9a8864..ed65d0f2f 100644 --- a/lgsm/config-default/config-lgsm/pvrserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/pvrserver/_default.cfg @@ -139,7 +139,7 @@ stopmode="2" # 3: gamedig # 4: gsquery # 5: tcp -querymode="1" +querymode="5" querytype="" ## Console type diff --git a/lgsm/config-default/config-lgsm/rwserver/_default.cfg b/lgsm/config-default/config-lgsm/rwserver/_default.cfg index 3ff7bc137..0ff3726ba 100644 --- a/lgsm/config-default/config-lgsm/rwserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/rwserver/_default.cfg @@ -135,8 +135,8 @@ stopmode="3" # 3: gamedig # 4: gsquery # 5: tcp -querymode="1" -querytype="" +querymode="2" +querytype="protocol-valve" ## Console type consoleverbose="yes" diff --git a/lgsm/config-default/config-lgsm/sdtdserver/_default.cfg b/lgsm/config-default/config-lgsm/sdtdserver/_default.cfg index d8ca86974..7c985a636 100644 --- a/lgsm/config-default/config-lgsm/sdtdserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/sdtdserver/_default.cfg @@ -146,7 +146,7 @@ consoleinteract="no" # Do not edit gamename="7 Days To Die" engine="unity3d" -glibc="2.15" +glibc="2.27" #### Directories #### # Edit with care diff --git a/lgsm/config-default/config-lgsm/ts3server/_default.cfg b/lgsm/config-default/config-lgsm/ts3server/_default.cfg index 3bfaf5d10..694b0501f 100644 --- a/lgsm/config-default/config-lgsm/ts3server/_default.cfg +++ b/lgsm/config-default/config-lgsm/ts3server/_default.cfg @@ -123,7 +123,7 @@ stopmode="2" # 4: gsquery # 5: tcp querymode="5" -querytype="" +querytype="teamspeak3" ## Console type consoleverbose="yes" diff --git a/lgsm/data/serverlist.csv b/lgsm/data/serverlist.csv index 249f1616d..524826a33 100644 --- a/lgsm/data/serverlist.csv +++ b/lgsm/data/serverlist.csv @@ -108,8 +108,8 @@ ut2k4,ut2k4server,Unreal Tournament 2004 ut3,ut3server,Unreal Tournament 3 ut99,ut99server,Unreal Tournament 99 vh,vhserver,Valheim -vs,vsserver,Vampire Slayer vints,vintsserver,Vintage Story +vs,vsserver,Vampire Slayer wet,wetserver,Wolfenstein: Enemy Territory wf,wfserver,Warfork wmc,wmcserver,WaterfallMC diff --git a/lgsm/functions/alert.sh b/lgsm/functions/alert.sh index 5fd999728..782c6e9a4 100755 --- a/lgsm/functions/alert.sh +++ b/lgsm/functions/alert.sh @@ -11,7 +11,7 @@ functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" # Used with email alerts. fn_alert_log(){ info_distro.sh - info_config.sh + info_game.sh info_messages.sh if [ -f "${alertlog}" ]; then rm -f "${alertlog:?}" diff --git a/lgsm/functions/check_ip.sh b/lgsm/functions/check_ip.sh index ae1b99b77..09b948ccd 100755 --- a/lgsm/functions/check_ip.sh +++ b/lgsm/functions/check_ip.sh @@ -8,8 +8,7 @@ functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" -info_config.sh -info_parms.sh +info_game.sh if [ ! -f "/bin/ip" ]; then ipcommand="/sbin/ip" diff --git a/lgsm/functions/check_root.sh b/lgsm/functions/check_root.sh index 1eb6309cb..13942cbd4 100755 --- a/lgsm/functions/check_root.sh +++ b/lgsm/functions/check_root.sh @@ -12,6 +12,9 @@ if [ "$(whoami)" = "root" ]; then fn_print_fail_nl "Do NOT run this script as root!" if [ -d "${lgsmlogdir}" ]; then fn_script_log_fatal "${selfname} attempted to run as root." + else + # Forces exit code is log does not yet exist. + exitcode=1 fi core_exit.sh fi diff --git a/lgsm/functions/command_debug.sh b/lgsm/functions/command_debug.sh index aac203ac9..a9cceebdb 100755 --- a/lgsm/functions/command_debug.sh +++ b/lgsm/functions/command_debug.sh @@ -27,7 +27,7 @@ fn_lockfile_trap(){ check.sh fix.sh info_distro.sh -info_config.sh +info_game.sh # NOTE: Check if works with server without parms. Could be intergrated in to info_parms.sh. fn_print_header { @@ -104,7 +104,12 @@ echo "${port}" >> "${lockdir}/${selfname}.lock" fn_script_log_info "Lockfile generated" fn_script_log_info "${lockdir}/${selfname}.lock" -cd "${executabledir}" || exit +if [ "${shortname}" == "av" ]; then + cd "${systemdir}" || exit +else + cd "${executabledir}" || exit +fi + # Note: do not add double quotes to ${executable} ${startparameters}. if [ "${engine}" == "source" ]||[ "${engine}" == "goldsrc" ]; then ${executable} ${startparameters} -debug diff --git a/lgsm/functions/command_details.sh b/lgsm/functions/command_details.sh index 14765ca99..2daeeb2f7 100755 --- a/lgsm/functions/command_details.sh +++ b/lgsm/functions/command_details.sh @@ -12,9 +12,8 @@ fn_firstcommand_set # Run checks and gathers details to display. check.sh -info_config.sh -info_parms.sh info_distro.sh +info_game.sh info_messages.sh if [ "${querymode}" == "2" ]||[ "${querymode}" == "3" ]; then for queryip in "${queryips[@]}"; do @@ -31,9 +30,10 @@ fn_info_message_gameserver fn_info_message_script fn_info_message_backup # Some game servers do not have parms. -if [ "${shortname}" != "ts3" ]&&[ "${shortname}" != "jc2" ]&&[ "${shortname}" != "dst" ]&&[ "${shortname}" != "pz" ]&&[ "${engine}" != "renderware" ]; then +if [ "${shortname}" != "jc2" ]&&[ "${shortname}" != "dst" ]&&[ "${shortname}" != "pz" ]&&[ "${engine}" != "renderware" ]; then fn_info_message_commandlineparms fi +fn_info_message_ports_edit fn_info_message_ports fn_info_message_select_engine fn_info_message_statusbottom diff --git a/lgsm/functions/command_dev_query_raw.sh b/lgsm/functions/command_dev_query_raw.sh index 7c2dd95f9..c9123ebcb 100755 --- a/lgsm/functions/command_dev_query_raw.sh +++ b/lgsm/functions/command_dev_query_raw.sh @@ -11,25 +11,204 @@ functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_firstcommand_set check.sh -info_config.sh -info_parms.sh +info_game.sh +info_distro.sh +info_messages.sh echo -e "" -echo -e "Query Port - Raw Output" +echo -e "${lightgreen}Query IP Addresses${default}" echo -e "==================================================================" echo -e "" -echo -e "QUERY IP" for queryip in "${queryips[@]}"; do echo -e "${queryip}" done +echo -e "" +echo -e "${lightgreen}Game Server Ports${default}" +echo -e "==================================================================" +{ +echo -e "${lightblue}Port Name \tPort Number \tStatus \tTCP \tUDP${default}" +if [ -v port ]; then + echo -e "Game: \t${port} \t$(ss -tupl|grep ${port}|wc -l) \t$(ss -tupl|grep ${port}|grep tcp|awk '{ print $2 }') \t$(ss -tupl|grep ${port}|grep udp|awk '{ print $2 }')" +else + echo -e "Game:" +fi +if [ "${shortname}" == "rw" ]; then + if [ -v port2 ]; then + echo -e "Game+1: \t${port2} \t$(ss -tupl|grep ${port}|wc -l) \t$(ss -tupl|grep ${port2}|grep tcp|awk '{ print $2 }') \t$(ss -tupl|grep ${port2}|grep udp|awk '{ print $2 }')" + else + echo -e "Game+1:" + fi + + if [ -v port3 ]; then + echo -e "Game+2: \t${port3} \t$(ss -tupl|grep ${port}|wc -l) \t$(ss -tupl|grep ${port3}|grep tcp|awk '{ print $2 }') \t$(ss -tupl|grep ${port3}|grep udp|awk '{ print $2 }')" + else + echo -e "Game+2:" + fi + + if [ -v port4 ]; then + echo -e "Game+3: \t${port4} \t$(ss -tupl|grep ${port}|wc -l) \t$(ss -tupl|grep ${port4}|grep tcp|awk '{ print $2 }') \t$(ss -tupl|grep ${port4}|grep udp|awk '{ print $2 }')" + else + echo -e "Game+3:" + fi +fi + +if [ -v port401 ]; then + echo -e "Game+400: \t${port401} \t$(ss -tupl|grep ${port401}|wc -l) \t$(ss -tupl|grep ${port401}|grep tcp|awk '{ print $2 }') \t$(ss -tupl|grep ${port401}|grep udp|awk '{ print $2 }')" +else + echo -e "Game+400:" +fi + +if [ -v portipv6 ]; then + echo -e "Game ipv6: \t${portipv6} \t$(ss -tupl|grep ${portipv6}|wc -l) \t$(ss -tupl|grep ${portipv6}|grep tcp|awk '{ print $2 }') \t$(ss -tupl|grep ${portipv6}|grep udp|awk '{ print $2 }')" +else + echo -e "Game ipv6:" +fi + +if [ -v queryport ]; then + echo -e "Query: \t${queryport} \t$(ss -tupl|grep ${queryport}|wc -l) \t$(ss -tupl|grep ${queryport}|grep tcp|awk '{ print $2 }') \t$(ss -tupl|grep ${queryport}|grep udp|awk '{ print $2 }')" +else + echo -e "Query:" +fi + +if [ -v httpport ]; then + echo -e "HTTP: \t${httpport} \t$(ss -tupl|grep ${httpport}|wc -l) \t$(ss -tupl|grep ${httpport}|grep tcp|awk '{ print $2 }') \t$(ss -tupl|grep ${httpport}|grep udp|awk '{ print $2 }')" +else + echo -e "HTTP:" +fi + +if [ -v httpqueryport ]; then + echo -e "HTTP Query: \t${httpqueryport} \t$(ss -tupl|grep ${httpqueryport}|wc -l) \t$(ss -tupl|grep ${httpqueryport}|grep tcp|awk '{ print $2 }') \t$(ss -tupl|grep ${httpqueryport}|grep udp|awk '{ print $2 }')" +else + echo -e "HTTP Query:" +fi + + +if [ -v webadminport ]; then + echo -e "Web Admin: \t${webadminport} \t$(ss -tupl|grep ${webadminport}|wc -l) \t$(ss -tupl|grep ${webadminport}|grep tcp|awk '{ print $2 }') \t$(ss -tupl|grep ${webadminport}|grep udp|awk '{ print $2 }')" +else + echo -e "Web Admin:" +fi + +if [ -v clientport ]; then + echo -e "Client: \t${clientport} \t$(ss -tupl|grep ${clientport}|wc -l) \t$(ss -tupl|grep ${clientport}|grep tcp|awk '{ print $2 }') \t$(ss -tupl|grep ${clientport}|grep udp|awk '{ print $2 }')" +else + echo -e "Client:" +fi + +if [ -v rconport ]; then + echo -e "RCON: \t${rconport} \t$(ss -tupl|grep ${rconport}|wc -l) \t$(ss -tupl|grep ${rconport}|grep tcp|awk '{ print $2 }') \t$(ss -tupl|grep ${rconport}|grep udp|awk '{ print $2 }')" +else + echo -e "RCON:" +fi + +if [ -v rawport ]; then + echo -e "RAW UDP Socket: \t${rawport} \t$(ss -tupl|grep ${rawport}|wc -l) \t$(ss -tupl|grep ${rawport}|grep tcp|awk '{ print $2 }') \t$(ss -tupl|grep ${rawport}|grep udp|awk '{ print $2 }')" +else + echo -e "RAW UDP Socket:" +fi + +if [ -v masterport ]; then + echo -e "Game: Master: \t${masterport} \t$(ss -tupl|grep ${masterport}|wc -l) \t$(ss -tupl|grep ${masterport}|grep tcp|awk '{ print $2 }') \t$(ss -tupl|grep ${masterport}|grep udp|awk '{ print $2 }')" +else + echo -e "Game: Master:" +fi + +if [ -v steamport ]; then + echo -e "Steam: \t${steamport} \t$(ss -tupl|grep ${steamport}|wc -l) \t$(ss -tupl|grep ${steamport}|grep tcp|awk '{ print $2 }') \t$(ss -tupl|grep ${steamport}|grep udp|awk '{ print $2 }')" +else + echo -e "Steam:" +fi + +if [ -v steamauthport ]; then + echo -e "Steam: Auth: \t${steamauthport} \t$(ss -tupl|grep ${steamauthport}|wc -l) \t$(ss -tupl|grep ${steamauthport}|grep tcp|awk '{ print $2 }') \t$(ss -tupl|grep ${steamauthport}|grep udp|awk '{ print $2 }')" +else + echo -e "Steam: Auth:" +fi + +if [ -v steammasterport ]; then + echo -e "Steam: Master: \t${steammasterport} \t$(ss -tupl|grep ${steammasterport}|wc -l) \t$(ss -tupl|grep ${steammasterport}|grep tcp|awk '{ print $2 }') \t$(ss -tupl|grep ${steammasterport}|grep udp|awk '{ print $2 }')" +else + echo -e "Steam: Master:" +fi + +if [ -v steamqueryport ]; then + echo -e "Steam: Query: \t${steamqueryport} \t$(ss -tupl|grep ${steamqueryport}|wc -l) \t$(ss -tupl|grep ${steamqueryport}|grep tcp|awk '{ print $2 }') \t$(ss -tupl|grep ${steamqueryport}|grep udp|awk '{ print $2 }')" +else + echo -e "Steam: Query:" +fi +if [ -v beaconport ]; then + echo -e "Beacon: \t${beaconport} \t$(ss -tupl|grep ${beaconport}|wc -l) \t$(ss -tupl|grep ${beaconport}|grep tcp|awk '{ print $2 }') \t$(ss -tupl|grep ${beaconport}|grep udp|awk '{ print $2 }')" +else + echo -e "Beacon:" +fi + +if [ -v appport ]; then + echo -e "App: \t${appport} \t$(ss -tupl|grep ${appport}|wc -l) \t$(ss -tupl|grep ${appport}|grep tcp|awk '{ print $2 }') \t$(ss -tupl|grep ${appport}|grep udp|awk '{ print $2 }')" +else + echo -e "App:" +fi + +if [ -v telnetport ]; then + echo -e "Telnet: \t${telnetport} \t$(ss -tupl|grep ${telnetport}|wc -l) \t$(ss -tupl|grep ${telnetport}|grep tcp|awk '{ print $2 }') \t$(ss -tupl|grep ${telnetport}|grep udp|awk '{ print $2 }')" +else + echo -e "Telnet:" +fi + +if [ -v sourcetvport ]; then + echo -e "SourceTV: \t${sourcetvport} \t$(ss -tupl|grep ${sourcetvport}|wc -l) \t$(ss -tupl|grep ${sourcetvport}|grep tcp|awk '{ print $2 }') \t$(ss -tupl|grep ${sourcetvport}|grep udp|awk '{ print $2 }')" +else + echo -e "SourceTV:" +fi + +if [ -v fileport ]; then + echo -e "File: \t${fileport} \t$(ss -tupl|grep ${fileport}|wc -l) \t$(ss -tupl|grep ${fileport}|grep tcp|awk '{ print $2 }') \t$(ss -tupl|grep ${fileport}|grep udp|awk '{ print $2 }')" +else + echo -e "File:" +fi + +if [ -v udplinkport ]; then + echo -e "UDP Link: \t${udplinkport} \t$(ss -tupl|grep ${udplinkport}|wc -l) \t$(ss -tupl|grep ${udplinkport}|grep tcp|awk '{ print $2 }') \t$(ss -tupl|grep ${udplinkport}|grep udp|awk '{ print $2 }')" +else + echo -e "UDP Link:" +fi + +if [ -v voiceport ]; then + echo -e "Voice: \t${voiceport} \t$(ss -tupl|grep ${voiceport}|wc -l) \t$(ss -tupl|grep ${voiceport}|grep tcp|awk '{ print $2 }') \t$(ss -tupl|grep ${voiceport}|grep udp|awk '{ print $2 }')" +else + echo -e "Voice:" +fi + +if [ -v voiceunusedport ]; then + echo -e "Voice (Unused): \t${voiceunusedport} \t$(ss -tupl|grep ${voiceunusedport}|wc -l) \t$(ss -tupl|grep ${voiceunusedport}|grep tcp|awk '{ print $2 }') \t$(ss -tupl|grep ${voiceunusedport}|grep udp|awk '{ print $2 }')" +else + echo -e "Voice (Unused):" +fi + +if [ -v battleeyeport ]; then + echo -e "BattleEye: \t${battleeyeport} \t$(ss -tupl|grep ${battleeyeport}|wc -l) \t$(ss -tupl|grep ${battleeyeport}|grep tcp|awk '{ print $2 }') \t$(ss -tupl|grep ${battleeyeport}|grep udp|awk '{ print $2 }')" +else + echo -e "BattleEye:" +fi + +if [ -v statsport ]; then + echo -e "Stats: \t${battleeyeport} \t$(ss -tupl|grep ${statsport}|wc -l) \t$(ss -tupl|grep ${statsport}|grep tcp|awk '{ print $2 }') \t$(ss -tupl|grep ${statsport}|grep udp|awk '{ print $2 }')" +else + echo -e "Stats:" +fi + +} | column -s $'\t' -t +echo -e "" +echo -e "${lightgreen}SS Output${default}" echo -e "=================================" -echo -e "Ports" -echo -e "=================================" +fn_info_message_ports +echo -e "" +echo -e "${lightgreen}Query Port - Raw Output${default}" +echo -e "==================================================================" echo -e "" echo -e "PORT: ${port}" echo -e "QUERY PORT: ${queryport}" echo -e "" -echo -e "Gamedig Raw Output" +echo -e "${lightgreen}Gamedig Raw Output${default}" echo -e "=================================" echo -e "" if [ ! "$(command -v gamedig 2>/dev/null)" ]; then @@ -45,7 +224,7 @@ for queryip in "${queryips[@]}"; do echo "${gamedigraw}" | jq done echo -e "" -echo -e "gsquery Raw Output" +echo -e "${lightgreen}gsquery Raw Output${default}" echo -e "=================================" echo -e "" for queryip in "${queryips[@]}"; do @@ -57,7 +236,7 @@ for queryip in "${queryips[@]}"; do "${functionsdir}"/query_gsquery.py -a "${queryip}" -p "${queryport}" -e "${querytype}" done echo -e "" -echo -e "TCP Raw Output" +echo -e "${lightgreen}TCP Raw Output${default}" echo -e "=================================" echo -e "" for queryip in "${queryips[@]}"; do @@ -73,10 +252,10 @@ for queryip in "${queryips[@]}"; do fi done echo -e "" -echo -e "Game Port - Raw Output" +echo -e "${lightgreen}Game Port - Raw Output${default}" echo -e "==================================================================" echo -e "" -echo -e "TCP Raw Output" +echo -e "${lightgreen}TCP Raw Output${default}" echo -e "=================================" echo -e "" for queryip in "${queryips[@]}"; do @@ -91,5 +270,12 @@ for queryip in "${queryips[@]}"; do echo -e "TCP query FAIL" fi done +echo -e "" +echo -e "${lightgreen}Steam Master Server Response${default}" +echo -e "==================================================================" +echo -e "" +echo -e "Response: ${displaymasterserver}" +echo -e "" + exitcode=0 core_exit.sh diff --git a/lgsm/functions/command_monitor.sh b/lgsm/functions/command_monitor.sh index 3602bef93..3f4e397e2 100755 --- a/lgsm/functions/command_monitor.sh +++ b/lgsm/functions/command_monitor.sh @@ -74,12 +74,10 @@ fn_monitor_check_queryport(){ fn_script_log_info "Checking port: CHECKING" if [ -n "${rconenabled}" ]&&[ "${rconenabled}" != "true" ]&&[ ${shortname} == "av" ]; then fn_print_warn "Checking port: Unable to query, rcon is not enabled" - fn_print_warn_eol_nl fn_script_log_warn "Checking port: Unable to query, rcon is not enabled" else fn_print_error "Checking port: Unable to query, queryport is not set" fn_script_log_error "Checking port: Unable to query, queryport is not set" - fn_print_error_eol_nl fi core_exit.sh fi @@ -227,8 +225,7 @@ fn_monitor_loop(){ monitorflag=1 check.sh core_logs.sh -info_config.sh -info_parms.sh +info_game.sh # query pre-checks fn_monitor_check_lockfile diff --git a/lgsm/functions/command_postdetails.sh b/lgsm/functions/command_postdetails.sh index fa2907b1e..f8b36fb61 100755 --- a/lgsm/functions/command_postdetails.sh +++ b/lgsm/functions/command_postdetails.sh @@ -31,8 +31,7 @@ if [ "${exitbypass}" ]; then else # Run checks and gathers details to display. check.sh - info_config.sh - info_parms.sh + info_game.sh info_distro.sh info_messages.sh for queryip in "${queryips[@]}" @@ -54,6 +53,7 @@ else if [ "${shortname}" != "jc2" ]&&[ "${shortname}" != "jc3" ]&&[ "${shortname}" != "dst" ]&&[ "${shortname}" != "pz" ]&&[ "${engine}" != "renderware" ]; then fn_info_message_commandlineparms fi + fn_info_message_ports_edit fn_info_message_ports fn_info_message_select_engine fn_info_message_statusbottom diff --git a/lgsm/functions/command_restart.sh b/lgsm/functions/command_restart.sh index 47a6b904c..3bf60c32c 100755 --- a/lgsm/functions/command_restart.sh +++ b/lgsm/functions/command_restart.sh @@ -10,7 +10,7 @@ commandaction="Restarting" functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_firstcommand_set -info_config.sh +info_game.sh exitbypass=1 command_stop.sh command_start.sh diff --git a/lgsm/functions/command_start.sh b/lgsm/functions/command_start.sh index caa933320..58ecfcff7 100755 --- a/lgsm/functions/command_start.sh +++ b/lgsm/functions/command_start.sh @@ -72,7 +72,13 @@ fn_start_tmux(){ echo "${version}" >> "${lockdir}/${selfname}.lock" echo "${port}" >> "${lockdir}/${selfname}.lock" fn_reload_startparameters - cd "${executabledir}" || exit + + if [ "${shortname}" == "av" ]; then + cd "${systemdir}" || exit + else + cd "${executabledir}" || exit + fi + tmux new-session -d -x "${sessionwidth}" -y "${sessionheight}" -s "${sessionname}" "${preexecutable} ${executable} ${startparameters}" 2> "${lgsmlogdir}/.${selfname}-tmux-error.tmp" # Create logfile. @@ -185,7 +191,7 @@ fi if [ -z "${fixbypass}" ]; then fix.sh fi -info_config.sh +info_game.sh core_logs.sh # Will check for updates is updateonstart is yes. diff --git a/lgsm/functions/command_stop.sh b/lgsm/functions/command_stop.sh index f0a0bf92c..ef54b525c 100644 --- a/lgsm/functions/command_stop.sh +++ b/lgsm/functions/command_stop.sh @@ -269,7 +269,7 @@ fn_stop_pre_check(){ check.sh fn_print_dots "${servername}" -info_config.sh +info_game.sh fn_stop_pre_check # Remove lockfile. if [ -f "${lockdir}/${selfname}.lock" ]; then diff --git a/lgsm/functions/command_test_alert.sh b/lgsm/functions/command_test_alert.sh index 9397a445c..7fe61e48a 100755 --- a/lgsm/functions/command_test_alert.sh +++ b/lgsm/functions/command_test_alert.sh @@ -12,7 +12,7 @@ fn_firstcommand_set fn_print_dots "${servername}" check.sh -info_config.sh +info_game.sh alert="test" alert.sh diff --git a/lgsm/functions/core_dl.sh b/lgsm/functions/core_dl.sh index 2c8c269bf..9d80913a7 100755 --- a/lgsm/functions/core_dl.sh +++ b/lgsm/functions/core_dl.sh @@ -92,9 +92,14 @@ fn_dl_steamcmd(){ if [ -n "$(grep -i "Error!" "${steamcmdlog}" | tail -1)" ]&&[ "$(grep -ic "Error!" "${steamcmdlog}")" -ge "${counter}" ] ; then # Not enough space. if [ -n "$(grep "0x202" "${steamcmdlog}" | tail -1)" ]; then - fn_print_failure_nl "${commandaction} ${selfname}: ${remotelocation}: Not enough space to download server files" - fn_script_log_fatal "${commandaction} ${selfname}: ${remotelocation}: Not enough space to download server files" + fn_print_failure_nl "${commandaction} ${selfname}: ${remotelocation}: Not enough disk space to download server files" + fn_script_log_fatal "${commandaction} ${selfname}: ${remotelocation}: Not enough disk space to download server files" core_exit.sh + # Not enough space. + elif [ -n "$(grep "0x212" "${steamcmdlog}" | tail -1)" ]; then + fn_print_failure_nl "${commandaction} ${selfname}: ${remotelocation}: Not enough disk space to download server files" + fn_script_log_fatal "${commandaction} ${selfname}: ${remotelocation}: Not enough disk space to download server files" + core_exit.sh # Need tp purchase game. elif [ -n "$(grep "No subscription" "${steamcmdlog}" | tail -1)" ]; then fn_print_failure_nl "${commandaction} ${selfname}: ${remotelocation}: Steam account does not have a license for the required game" @@ -116,6 +121,7 @@ fn_dl_steamcmd(){ fn_script_log_error "${commandaction} ${selfname}: ${remotelocation}: Update required but not completed - check network" else fn_print_error2_nl "${commandaction} ${selfname}: ${remotelocation}: Unknown error occured" + echo -en "Please provide content log to LinuxGSM developers https://linuxgsm.com/steamcmd-error" fn_script_log_error "${commandaction} ${selfname}: ${remotelocation}: Unknown error occured" fi elif [ "${exitcode}" != "0" ]; then diff --git a/lgsm/functions/core_functions.sh b/lgsm/functions/core_functions.sh index 59e6b20f5..dd82419a4 100755 --- a/lgsm/functions/core_functions.sh +++ b/lgsm/functions/core_functions.sh @@ -513,17 +513,12 @@ fn_fetch_function # Info -info_stats.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - -info_config.sh(){ +info_distro.sh(){ functionfile="${FUNCNAME[0]}" fn_fetch_function } -info_distro.sh(){ +info_game.sh(){ functionfile="${FUNCNAME[0]}" fn_fetch_function } @@ -538,7 +533,7 @@ functionfile="${FUNCNAME[0]}" fn_fetch_function } -info_parms.sh(){ +info_stats.sh(){ functionfile="${FUNCNAME[0]}" fn_fetch_function } diff --git a/lgsm/functions/fix_ts3.sh b/lgsm/functions/fix_ts3.sh index b1ed7d84b..021f03764 100755 --- a/lgsm/functions/fix_ts3.sh +++ b/lgsm/functions/fix_ts3.sh @@ -17,7 +17,7 @@ fi # Fixes: failed to register local accounting service: No such file or directory. accountingfile="/dev/shm/7gbhujb54g8z9hu43jre8" -if [ -f "${accountingfile}" ]; then +if [ -f "${accountingfile}" ]&&[ "${status}" == "0" ]; then # Check permissions for the file if the current user owns it, if not exit. if [ "$( stat -c %U ${accountingfile})" == "$(whoami)" ]; then fixname="Delete file ${accountingfile}" diff --git a/lgsm/functions/info_distro.sh b/lgsm/functions/info_distro.sh index 7f0dc2b19..fdfc076ab 100755 --- a/lgsm/functions/info_distro.sh +++ b/lgsm/functions/info_distro.sh @@ -11,6 +11,11 @@ functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" ### Game Server pid if [ "${status}" == "1" ]; then gameserverpid=$(tmux list-sessions -F "#{session_name} #{pane_pid}" | grep "^${sessionname} " | awk '{print $NF}') + if [ "${engine}" == "source" ]; then + srcdslinuxpid=$(ps -ef | grep -v grep | grep "${gameserverpid}" | grep srcds_linux | awk '{print $2}') + elif [ "${engine}" == "goldsrc" ]; then + hldslinuxpid=$(ps -ef | grep -v grep | grep "${gameserverpid}" | grep hlds_linux | awk '{print $2}') + fi fi ### Distro information @@ -268,7 +273,7 @@ fi # Steam Master Server - checks if detected by master server. if [ "$(command -v jq 2>/dev/null)" ]; then if [ "${ip}" ]&&[ "${port}" ]; then - if [ "${steammaster}" == "true" ]; then + if [ "${steammaster}" == "true" ]||[ ${commandname} == "DEV-QUERY-RAW" ]; then # Will query server IP addresses first. for queryip in "${queryips[@]}"; do masterserver="$(curl --connect-timeout 10 -m 3 -s 'https://api.steampowered.com/ISteamApps/GetServersAtAddress/v0001?addr='${queryip}':'${port}'&format=json' | jq '.response.servers[]|.addr' | wc -l 2>/dev/null)" @@ -292,3 +297,6 @@ if [ "${appid}" ]; then glibc="2.14" fi fi + +# Gather Port Info using ss +ssinfo="$(ss -tuplwn)" diff --git a/lgsm/functions/info_config.sh b/lgsm/functions/info_game.sh old mode 100755 new mode 100644 similarity index 79% rename from lgsm/functions/info_config.sh rename to lgsm/functions/info_game.sh index 07960e290..2c3c52584 --- a/lgsm/functions/info_config.sh +++ b/lgsm/functions/info_game.sh @@ -1,9 +1,9 @@ #!/bin/bash -# LinuxGSM info_config.sh module +# LinuxGSM info_game.sh module # Author: Daniel Gibbs # Contributors: http://linuxgsm.com/contrib # Website: https://linuxgsm.com -# Description: Gets specific details from config files. +# Description: Gathers various game server information. functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" @@ -14,8 +14,7 @@ functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" # grep -v "foo" filter out lines that contain foo # cut -f1 -d "/" remove everything after / - -fn_info_config_assettocorsa(){ +fn_info_game_ac(){ if [ ! -f "${servercfgfullpath}" ]; then httpport="${zero}" port="${zero}" @@ -25,7 +24,7 @@ fn_info_config_assettocorsa(){ else httpport=$(grep "HTTP_PORT" "${servercfgfullpath}" | tr -cd '[:digit:]') port=$(grep "TCP_PORT" "${servercfgfullpath}" | tr -cd '[:digit:]') - queryport="${port}" + queryport="${httpport}" servername=$(grep "NAME" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/NAME//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//'| head -n 1) adminpassword=$(grep "ADMIN_PASSWORD" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/ADMIN_PASSWORD//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') @@ -39,87 +38,149 @@ fn_info_config_assettocorsa(){ fi } -fn_info_config_justcause2(){ +fn_info_game_ark(){ + # Config + if [ ! -f "${servercfgfullpath}" ]; then + servername="${unavailable}" + adminpassword="${unavailable}" + serverpassword="${unavailable}" + else + servername=$(grep "SessionName" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^--/d' -e 's/SessionName//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + adminpassword=$(grep "ServerAdminPassword" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^--/d' -e 's/ServerAdminPassword//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//' ) + serverpassword=$( grep "ServerPassword" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^--/d' -e 's/ServerPassword//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + + # Not Set + servername=${servername:-"NOT SET"} + adminpassword=${adminpassword:-"NOT SET"} + serverpassword=${serverpassword:-"NOT SET"} + fi + + # Parameters + port=${port:-"0"} + queryport=${queryport:-"0"} + rconport=${rconport:-"0"} + rawport=$((port+1)) + maxplayers=${maxplayers:-"0"} +} + +fn_info_game_arma3(){ + # Config if [ ! -f "${servercfgfullpath}" ]; then servername="${unavailable}" + adminpassword="${unavailable}" serverpassword="${unavailable}" maxplayers="${zero}" - port="${zero}" - queryport="${zero}" else - servername=$(grep "Name" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^--/d' -e 's/Name//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - serverdescription=$(grep "Description" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^--/d' -e 's/Description//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]*$//') - maxplayers=$(grep "MaxPlayers" "${servercfgfullpath}" | grep -v "\--" | tr -cd '[:digit:]') - port=$(grep "BindPort" "${servercfgfullpath}" | grep -v "\--" | tr -cd '[:digit:]') - queryport="${port}" - configip=$(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" + 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]*$//') + maxplayers=$(grep "maxPlayers" "${servercfgfullpath}" | grep -v "//" | tr -cd '[:digit:]') # Not Set servername=${servername:-"NOT SET"} + adminpassword=${adminpassword:-"NOT SET"} serverpassword=${serverpassword:-"NOT SET"} maxplayers=${maxplayers:-"0"} - port=${port:-"0"} + fi + + # Parameters + port=${port:-"2302"} + voiceport=${port:-"2302"} + queryport=$((port+1)) + steammasterport=$((port+2)) + voiceunusedport=$((port+3)) + battleeyeport=$((port+4)) +} + +fn_info_game_av() { + if [ ! -f "${servercfgfullpath}" ]; then + maxplayers="${unavailable}" + servername="${unavailable}" + serverpassword="${unavailable}" + rconpassword="${unavailable}" + rconport="${unavailable}" + rconenabled="${unavailable}" + queryport="${unavailable}" + else + maxplayers=$(grep "maxPlayers=" "${servercfgfullpath}" | sed 's/maxPlayers=//') + servername=$(grep "name=" "${servercfgfullpath}" | sed 's/name=//') + serverpassword=$(grep "password=" "${servercfgfullpath}" | sed 's/password=//') + + port=$(grep "port=" "${servercfgfullpath}" | sed 's/port=//') + queryport=$((port+3)) + steamqueryport=$((port+20)) + steammasterport=$((port+21)) + rconport=$(grep "rconPort=" "${servercfgfullpath}" | sed 's/rconPort=//') + + rconpassword=$(grep "rconPassword=" "${servercfgfullpath}" | sed 's/rconPassword=//') + if [ -n "${rconpassword}" ]; then + rconenabled="true" + fi + + # Not set + maxplayers=${maxplayers:-"NOT SET"} + servername=${servername:-"NOT SET"} + serverpassword=${serverpassword:-"NOT SET"} + rconpassword=${rconpassword:-"NOT SET"} + rconport=${rconport:-"0"} + rconenabled=${rconenabled:-"false"} queryport=${queryport:-"0"} fi } -fn_info_config_justcause3(){ +fn_info_game_bf1942(){ if [ ! -f "${servercfgfullpath}" ]; then servername="${unavailable}" - serverdescription="${unavailable}" serverpassword="${unavailable}" maxplayers="${zero}" port="${zero}" - queryPort="${zero}" - steamport="${zero}" - tickrate="${zero}" + queryport="${zero}" else - servername=$(grep "name" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/name//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - serverdescription=$(grep "description" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/description//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]*$//') - maxplayers=$(grep "\"maxPlayers\"" "${servercfgfullpath}" | tr -cd '[:digit:]') - port=$(grep "\"port\"" "${servercfgfullpath}" | tr -cd '[:digit:]') - queryport=$(grep "\"queryPort\"" "${servercfgfullpath}" | tr -cd '[:digit:]') - steamport=$(grep "\"steamPort\"" "${servercfgfullpath}" | tr -cd '[:digit:]') - tickrate=$(grep "\"maxTickRate\"" "${servercfgfullpath}" | tr -cd '[:digit:]') + servername=$(grep -E "^game.serverName " "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^--/d' -e 's/game.serverName //g' | tr -d '=\";,:' | xargs) + serverpassword=$(grep "game.serverPassword" "${servercfgfullpath}" | sed -e 's/^ *//g' -e '/^--/d' -e 's/game.serverPassword//g' | tr -d '=\";,:' | xargs) + maxplayers=$(grep "game.serverMaxPlayers" "${servercfgfullpath}" | grep -v "\--" | tr -cd '[:digit:]') + port=$(grep "game.serverPort" "${servercfgfullpath}" | grep -v "\--" | tr -cd '[:digit:]') + queryport="22000" - configip=$(grep "host" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/host//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + configip=$(grep "game.serverIP" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^--/d' -e 's/game.serverIP//g' | tr -d '=\";,:' | xargs) ipsetinconfig=1 - ipinconfigvar="host" + ipinconfigvar="game.serverIP" # Not Set servername=${servername:-"NOT SET"} - serverdescription=${serverdescription:-"NOT SET"} serverpassword=${serverpassword:-"NOT SET"} - maxplayers=${maxplayers=:-"0"} - port=${port=:-"0"} - queryport=${queryport=:-"0"} - steamport=${steamport=:-"0"} - tickrate=${tickrate=:-"0"} + maxplayers=${maxplayers:-"0"} + port=${port:-"0"} fi } -fn_info_config_ark(){ +fn_info_game_bfv(){ if [ ! -f "${servercfgfullpath}" ]; then servername="${unavailable}" - adminpassword="${unavailable}" serverpassword="${unavailable}" + maxplayers="${zero}" + port="${zero}" + queryport="${zero}" else - servername=$(grep "SessionName" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^--/d' -e 's/SessionName//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - adminpassword=$(grep "ServerAdminPassword" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^--/d' -e 's/ServerAdminPassword//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//' ) - serverpassword=$( grep "ServerPassword" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^--/d' -e 's/ServerPassword//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + servername=$(grep "game.serverName" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^--/d' -e 's/game.serverName//g' | tr -d '=\";,:' | xargs) + serverpassword=$(grep "game.serverPassword" "${servercfgfullpath}" | sed -e 's/^ *//g' -e '/^--/d' -e 's/game.serverPassword//g' | tr -d '=\";,:' | xargs) + maxplayers=$(grep "game.serverMaxPlayers" "${servercfgfullpath}" | grep -v "\--" | tr -cd '[:digit:]') + port=$(grep "game.serverPort" "${servercfgfullpath}" | grep -v "\--" | tr -cd '[:digit:]') + queryport="23000" + + configip=$(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"} - adminpassword=${adminpassword:-"NOT SET"} serverpassword=${serverpassword:-"NOT SET"} + maxplayers=${maxplayers:-"0"} + port=${port:-"0"} fi } -fn_info_config_ballistic_overkill(){ +fn_info_game_bo(){ if [ ! -f "${servercfgfullpath}" ]; then servername="${unavailable}" serverpassword="${unavailable}" @@ -130,7 +191,7 @@ fn_info_config_ballistic_overkill(){ 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 "Password=" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/Password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') port=$(grep "ServerPort=" "${servercfgfullpath}" | tr -cd '[:digit:]') - queryport=$((port + 1)) + queryport=$((port+1)) maxplayers=$(grep "MaxPlayers=" "${servercfgfullpath}" | tr -cd '[:digit:]') # Not Set @@ -142,7 +203,8 @@ fn_info_config_ballistic_overkill(){ fi } -fn_info_config_barotrauma(){ +fn_info_game_bt(){ + # Config if [ ! -f "${servercfgfullpath}" ]; then servername="${unavailable}" serverpassword="${unavailable}" @@ -163,94 +225,53 @@ fn_info_config_barotrauma(){ queryport=${queryport:-"0"} maxplayers=${maxplayers:-"0"} fi -} -fn_info_config_battalion1944(){ - if [ ! -f "${servercfgfullpath}" ]; then - servername="${unavailable}" - serverpassword="${unavailable}" - else - 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 "Password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^--/d' -e 's/Password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - - # Not Set - servername=${servername:-"NOT SET"} - serverpassword=${serverpassword:-"NOT SET"} - fi + # Parameters + port=${port:-"0"} + queryport=${queryport:-"0"} } -fn_info_config_bf1942(){ +fn_info_game_bt1944(){ + # Config if [ ! -f "${servercfgfullpath}" ]; then servername="${unavailable}" serverpassword="${unavailable}" - maxplayers="${zero}" - port="${zero}" - queryport="${zero}" + gamemode="${unavailable}" else - - servername=$(grep -E "^game.serverName " "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^--/d' -e 's/game.serverName //g' | tr -d '=\";,:' | xargs) - serverpassword=$(grep "game.serverPassword" "${servercfgfullpath}" | sed -e 's/^ *//g' -e '/^--/d' -e 's/game.serverPassword//g' | tr -d '=\";,:' | xargs) - maxplayers=$(grep "game.serverMaxPlayers" "${servercfgfullpath}" | grep -v "\--" | tr -cd '[:digit:]') - port=$(grep "game.serverPort" "${servercfgfullpath}" | grep -v "\--" | tr -cd '[:digit:]') - queryport="22000" - - configip=$(grep "game.serverIP" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^--/d' -e 's/game.serverIP//g' | tr -d '=\";,:' | xargs) - ipsetinconfig=1 - ipinconfigvar="game.serverIP" + servername=$(grep -m2 "ServerName" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^--/d' -e 's/ServerName//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + serverpassword=$(grep "Password" "${servercfgfullpath}" | grep -v "RCONPassword" | sed -e 's/^[ \t]*//g' -e '/^--/d' -e 's/Password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + gamemode=$(grep -m2 "PlayMode" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^--/d' -e 's/PlayMode//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') # Not Set servername=${servername:-"NOT SET"} serverpassword=${serverpassword:-"NOT SET"} - maxplayers=${maxplayers:-"0"} - port=${port:-"0"} + gamemode=${gamemode:-"NOT SET"} fi -} - -fn_info_config_bfv(){ - if [ ! -f "${servercfgfullpath}" ]; then - servername="${unavailable}" - serverpassword="${unavailable}" - maxplayers="${zero}" - port="${zero}" - queryport="${zero}" - else - - servername=$(grep "game.serverName" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^--/d' -e 's/game.serverName//g' | tr -d '=\";,:' | xargs) - serverpassword=$(grep "game.serverPassword" "${servercfgfullpath}" | sed -e 's/^ *//g' -e '/^--/d' -e 's/game.serverPassword//g' | tr -d '=\";,:' | xargs) - maxplayers=$(grep "game.serverMaxPlayers" "${servercfgfullpath}" | grep -v "\--" | tr -cd '[:digit:]') - port=$(grep "game.serverPort" "${servercfgfullpath}" | grep -v "\--" | tr -cd '[:digit:]') - queryport="23000" - - configip=$(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"} - maxplayers=${maxplayers:-"0"} - port=${port:-"0"} - fi + # Parameters + port=${port:-"0"} + rconport=$((port+2)) + queryport=${queryport:-"0"} } -fn_info_config_chivalry(){ +fn_info_game_cmw(){ if [ ! -f "${servercfgfullpath}" ]; then servername="${unavailable}" serverpassword="${unavailable}" adminpassword="${unavailable}" - else + rconport="${unavailable}" + else servername=$(grep -E "^ServerName" "${servercfgfullpath}" | sed 's/^ServerName=//') - adminpassword=$(grep -E "^AdminPassword" "${servercfgfullpath}" | sed 's/^AdminPassword=//') + rconport=$(grep -E "^RConPort=" "${servercfgdir}/DefaultGame.ini" | tr -cd '[:digit:]') # Not Set servername=${servername:-"NOT SET"} - serverpassword=${serverpassword:-"NOT SET"} - adminpassword=${adminpassword:-"NOT SET"} - port=${port:-"0"} + rconport=${port:-"0"} fi } -fn_info_config_cod(){ +fn_info_game_cod(){ + # Config if [ ! -f "${servercfgfullpath}" ]; then servername="${unavailable}" rconpassword="${unavailable}" @@ -262,9 +283,15 @@ fn_info_config_cod(){ servername=${servername:-"NOT SET"} rconpassword=${rconpassword=:-"NOT SET"} fi + + # Parameters + defaultmap=${defaultmap:-"NOT SET"} + maxplayers=${maxplayers:-"0"} + port=${port:-"0"} + queryport=${port:-"0"} } -fn_info_config_cod2(){ +fn_info_game_cod2(){ if [ ! -f "${servercfgfullpath}" ]; then servername="${unavailable}" rconpassword="${unavailable}" @@ -278,7 +305,7 @@ fn_info_config_cod2(){ fi } -fn_info_config_cod4(){ +fn_info_game_cod4(){ if [ ! -f "${servercfgfullpath}" ]; then servername="${unavailable}" rconpassword="${unavailable}" @@ -292,7 +319,7 @@ fn_info_config_cod4(){ fi } -fn_info_config_codwaw(){ +fn_info_game_codwaw(){ if [ ! -f "${servercfgfullpath}" ]; then servername="${unavailable}" rconpassword="${unavailable}" @@ -306,7 +333,31 @@ fn_info_config_codwaw(){ fi } -fn_info_config_dontstarve(){ +fn_info_game_col(){ + if [ -f "${servercfgfullpath}" ]; then + servername=$(jq -r '.ServerSettings.ServerName' "${servercfgfullpath}") + serverpassword=$(jq -r '.ServerSettings.ServerPassword' "${servercfgfullpath}") + maxplayers=$(jq -r '.ServerSettings.MaxPlayerCount' "${servercfgfullpath}") + port=$(jq -r '.ServerSettings.ServerGamePort' "${servercfgfullpath}") + steamport=$(jq -r '.ServerSettings.ServerSteamPort' "${servercfgfullpath}") + rconpassword=$(jq -r '.ServerSettings.RCONPassword' "${servercfgfullpath}") + configip=$(jq -r '.ServerSettings.ServerIP' "${servercfgfullpath}") + + # password not set + serverpassword=${serverpassword:-"NOT SET"} + queryport=${port:-"0"} + else + servername=${servername:-"NOT SET"} + serverpassword=${serverpassword:-"NOT SET"} + maxplayers=${maxplayers:-"0"} + port=${port:-"27004"} + steamport=${steamport:-"27005"} + rconpassword=${rconpassword:-"NOT SET"} + fi +} + +fn_info_game_dst(){ + # Config if [ ! -f "${clustercfgfullpath}" ]; then servername="${unavailable}" serverpassword="${unavailable}" @@ -337,21 +388,28 @@ fn_info_config_dontstarve(){ if [ ! -f "${servercfgfullpath}" ]; then port="${zero}" - steamauthenticationport="${zero}" - steammasterserverport="${zero}" + steamauthport="${zero}" + steammasterport="${zero}" else port=$(grep "server_port" "${servercfgfullpath}" | grep "^server_port" | grep -v "#" | tr -cd '[:digit:]') - steamauthenticationport=$(grep "authentication_port" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') - steammasterserverport=$(grep "master_server_port" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') + steamauthport=$(grep "authentication_port" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') + steammasterport=$(grep "master_server_port" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') # Not Set port=${port:-"0"} - steamauthenticationport=${steamauthenticationport:-"0"} - steammasterserverport=${steammasterserverport:-"0"} + steamauthport=${steamauthport:-"0"} + steammasterport=${steammasterport:-"0"} fi + + # Parameters + sharding=${sharding:-"NOT SET"} + master=${master:-"NOT SET"} + shard=${shard:-"NOT SET"} + cluster=${cluster:-"NOT SET"} + cave=${cave:-"NOT SET"} } -fn_info_config_eco(){ +fn_info_game_eco(){ if [ ! -f "${servercfgfullpath}" ]; then configip="${unavailable}" servername="${unavailable}" @@ -379,7 +437,38 @@ fn_info_config_eco(){ fi } -fn_info_config_factorio(){ +fn_info_game_etl(){ + if [ ! -f "${servercfgfullpath}" ]; then + rconpassword="${unavailable}" + servername="${unavailable}" + serverpassword="${unavailable}" + maxplayers="${zero}" + port="${zero}" + queryport="${zero}" + else + port=$(grep "set net_port" "${servercfgfullpath}" | grep -v "//" | tr -cd '[:digit:]') + queryport="${port}" + rconpassword=$(grep "set rconpassword" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set rconpassword //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]*$//') + maxplayers=$(grep "set sv_maxclients" "${servercfgfullpath}" | grep -v "//" | tr -cd '[:digit:]') + + configip=$(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"} + maxplayers=${maxplayers:-"0"} + port=${port:-"27960"} + queryport=${queryport:-"27960"} + fi +} + +fn_info_game_fctr(){ + # Config if [ ! -f "${servercfgfullpath}" ]; then servername="Factorio Server" serverpassword="${unavailable}" @@ -403,790 +492,899 @@ fn_info_config_factorio(){ savegameinterval=${savegameinterval:-"0"} versioncount=${versioncount:-"0"} fi + + # Parameters + port=${port:-"0"} + rconport=${rconport:-"0"} + rconpassword=${rconpassword:-"NOT SET"} } -fn_info_config_minecraft(){ +fn_info_game_jc2(){ if [ ! -f "${servercfgfullpath}" ]; then servername="${unavailable}" - rconpassword="${unavailable}" - rconport="${zero}" + serverpassword="${unavailable}" maxplayers="${zero}" port="${zero}" queryport="${zero}" - queryenabled="${unavailable}" - gamemode="${unavailable}" - gameworld="${unavailable}" else - 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:]') - maxplayers=$(grep "max-players" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') - port=$(grep "server-port" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') - queryport=$(grep "query.port" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') - if [ -z "${queryport}" ]; then - queryport=${port} - fi - queryenabled=$(grep "enable-query" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/enable-query//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - 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]*$//') - - configip=$(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=$(grep "Name" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^--/d' -e 's/Name//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + serverdescription=$(grep "Description" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^--/d' -e 's/Description//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]*$//') + maxplayers=$(grep "MaxPlayers" "${servercfgfullpath}" | grep -v "\--" | tr -cd '[:digit:]') + port=$(grep "BindPort" "${servercfgfullpath}" | grep -v "\--" | tr -cd '[:digit:]') + queryport="${port}" + configip=$(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"} - rconpassword=${rconpassword:-"NOT SET"} - rconport=${rconport:-"NOT SET"} - maxplayers=${maxplayers:-"NOT SET"} - port=${port:-"NOT SET"} - queryport=${queryport:-"NOT SET"} - queryenabled="${queryenabled:-"NOT SET"}" - gamemode=${gamemode:-"NOT SET"} - gameworld=${gameworld:-"NOT SET"} + serverpassword=${serverpassword:-"NOT SET"} + maxplayers=${maxplayers:-"0"} + port=${port:-"0"} + queryport=${queryport:-"0"} fi } -fn_info_config_minecraft_bedrock(){ +fn_info_game_hw(){ + servername=${servername:-"NOT SET"} + port=${port:-"0"} + queryport=${queryport:-"0"} + maxplayers=${maxplayers:-"0"} + defaultmap=${defaultmap:-"NOT SET"} + creativemode=${creativemode:-"NOT SET"} +} + +fn_info_game_inss(){ + # Parameters + port=${port:-"0"} + queryport=${queryport:-"0"} + rconport=${rconport:-"0"} + servername=${servername:-"NOT SET"} + serverpassword=${serverpassword:-"NOT SET"} + defaultmap=${defaultmap:-"NOT SET"} + defaultscenario=${defaultscenario:-"NOT SET"} + maxplayers=${maxplayers:-"0"} +} + +fn_info_game_jc3(){ if [ ! -f "${servercfgfullpath}" ]; then servername="${unavailable}" + serverdescription="${unavailable}" + serverpassword="${unavailable}" maxplayers="${zero}" port="${zero}" - port6="${zero}" - queryport="${zero}" - gamemode="${unavailable}" - gameworld="${unavailable}" + queryPort="${zero}" + steamport="${zero}" + httpport="${zero}" + tickrate="${zero}" else - servername=$(grep "server-name" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/server-name//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - maxplayers=$(grep "max-players" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') - port=$(grep "server-port\b" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') - port6=$(grep "server-portv6\b" "${servercfgfullpath}" | sed 's/v6//g' | grep -v "#" | tr -cd '[:digit:]') - queryport=${port} - gamemode=$(grep "gamemode" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/gamemode//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]*$//') + servername=$(grep "name" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/name//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + serverdescription=$(grep "description" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/description//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]*$//') + maxplayers=$(grep "\"maxPlayers\"" "${servercfgfullpath}" | tr -cd '[:digit:]') + port=$(grep "\"port\"" "${servercfgfullpath}" | tr -cd '[:digit:]') + queryport=$(grep "\"queryPort\"" "${servercfgfullpath}" | tr -cd '[:digit:]') + steamport=$(grep "\"steamPort\"" "${servercfgfullpath}" | tr -cd '[:digit:]') + httpport=$(grep "\"httpPort\"" "${servercfgfullpath}" | tr -cd '[:digit:]') + tickrate=$(grep "\"maxTickRate\"" "${servercfgfullpath}" | tr -cd '[:digit:]') + + configip=$(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="host" # Not Set servername=${servername:-"NOT SET"} - maxplayers=${maxplayers:-"NOT SET"} - port=${port:-"NOT SET"} - port6=${port6:-"NOT SET"} - queryport=${queryport:-"NOT SET"} - gamemode=${gamemode:-"NOT SET"} - gameworld=${gameworld:-"NOT SET"} + serverdescription=${serverdescription:-"NOT SET"} + serverpassword=${serverpassword:-"NOT SET"} + maxplayers=${maxplayers=:-"0"} + port=${port=:-"0"} + queryport=${queryport=:-"0"} + steamport=${steamport=:-"0"} + httpport=${httpport=:-"0"} + tickrate=${tickrate=:-"0"} fi } -fn_info_config_mofm(){ +fn_info_game_jk2(){ + # Config if [ ! -f "${servercfgfullpath}" ]; then + rconpassword="${unavailable}" servername="${unavailable}" serverpassword="${unavailable}" + maxplayers="${zero}" else - 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 "ServerPassword" "${servercfgfullpath}" | sed -e 's/^ *//g' -e '/^--/d' -e 's/ServerPassword//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + rconpassword=$(grep "seta rconpassword" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/seta rconpassword//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + servername=$(grep "seta sv_hostname" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/seta sv_hostname//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + serverpassword=$(grep "seta g_password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/seta g_password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + maxplayers=$(grep "seta sv_maxclients" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') + serverversion=$(grep "seta mv_serverversion" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/seta mv_serverversion//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') # Not Set + rconpassword=${rconpassword:-"NOT SET"} servername=${servername:-"NOT SET"} serverpassword=${serverpassword:-"NOT SET"} + maxplayers=${maxplayers:-"0"} fi + + # Parameters + queryport="${port:-"0"}" } -fn_info_config_onset(){ +fn_info_game_kf(){ if [ ! -f "${servercfgfullpath}" ]; then servername="${unavailable}" - maxplayers="${zero}" + serverpassword="${unavailable}" + adminpassword="${unavailable}" port="${zero}" - httpport="${zero}" queryport="${zero}" + queryportgs="${zero}" + steamport="${zero}" + steammasterport="${zero}" + lanport="${zero}" + httpport="${zero}" + webadminenabled="${unavailable}" + webadminuser="${unavailable}" + webadminpass="${unavailable}" else - servername=$(grep -v "servername_short" "${servercfgfullpath}" | grep "servername" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/servername//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//' ) - maxplayers=$(grep "maxplayers" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') - port=$(grep "port" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') - httpport=$((port-2)) - queryport=$((port-1)) + servername=$(sed -nr 's/^ServerName=(.*)$/\1/p' "${servercfgfullpath}" | tr -d '=\";,:' | sed 's/\r$//') + serverpassword=$(sed -nr 's/^GamePassword=(.*)$/\1/p' "${servercfgfullpath}" | tr -d '=\";,:' | sed 's/\r$//') + adminpassword=$(sed -nr 's/^AdminPassword=(.*)$/\1/p' "${servercfgfullpath}" | tr -d '=\";,:' | sed 's/\r$//') + port=$(sed -nr 's/^Port=(.*)$/\1/p' "${servercfgfullpath}" | tr -cd '[:digit:]') + queryport=$((port+1)) + queryportgs=$(sed -nr 's/^OldQueryPortNumber=(.*)$/\1/p' "${servercfgfullpath}" | tr -cd '[:digit:]') + steamport="20560" + steammasterport="28852" + lanport=$(grep "LANServerPort=" "${servercfgfullpath}" | tr -cd '[:digit:]') + httpport=$(sed -nr 's/^ListenPort=(.*)$/\1/p' "${servercfgfullpath}" | tr -cd '[:digit:]') + webadminenabled=$(sed -nr 's/^bEnabled=(.*)$/\1/p' "${servercfgfullpath}" | tr -d '=\";,:' | sed 's/\r$//') + webadminuser=$(sed -nr 's/^AdminName=(.*)$/\1/p' "${servercfgfullpath}" | tr -d '=\";,:' | sed 's/\r$//') + webadminpass="${adminpassword}" # Not Set servername=${servername:-"NOT SET"} - maxplayers=${maxplayers:-"NOT SET"} - port=${port:-"NOT SET"} - httpport=${httpport:-"NOT SET"} - queryport=${queryport:-"NOT SET"} + serverpassword=${serverpassword:-"NOT SET"} + adminpassword=${adminpassword:-"NOT SET"} + port=${port:-"0"} + queryport=${queryport:-"0"} + queryportgs=${queryportgs:-"0"} + steamport=${steamport:-"0"} + steammasterport=${steammasterport:-"0"} + lanport=${lanport:-"0"} + httpport=${httpport:-"0"} + webadminenabled=${webadminenabled:-"NOT SET"} + webadminuser=${webadminuser:-"NOT SET"} + webadminpass=${webadminpass:-"NOT SET"} fi } -fn_info_config_mohaa(){ +fn_info_game_kf2(){ + # Config if [ ! -f "${servercfgfullpath}" ]; then - rconpassword="${unavailable}" servername="${unavailable}" serverpassword="${unavailable}" - maxplayers="${zero}" + adminpassword="${unavailable}" + port="${unavailable}" + queryport="${unavailable}" + webadminenabled="${unavailable}" + httpport="${zero}" + webadminuser="${unavailable}" + webadminpass="${unavailable}" else - rconpassword=$(grep "rconpassword" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/seta rconpassword//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - servername=$(grep "sv_hostname" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/seta 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/seta g_password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - maxplayers=$(grep "sv_maxclients" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') + 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" "${servercfgdir}/LinuxServer-KFEngine.ini" | sed -e 's/^[ \t]*//g' | grep "^Port" | grep -v "#" | tr -cd '[:digit:]') + webadminenabled=$(grep "bEnabled" "${servercfgdir}/KFWeb.ini" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/bEnabled//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + httpport=$(grep "ListenPort" "${servercfgdir}/KFWeb.ini" | grep -v "#" | tr -cd '[:digit:]') + webadminuser="Admin" + webadminpass=$(grep "AdminPassword" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/AdminPassword//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') # Not Set - rconpassword=${rconpassword:-"NOT SET"} servername=${servername:-"NOT SET"} serverpassword=${serverpassword:-"NOT SET"} - maxplayers=${maxplayers:-"0"} - fi -} - -#Post Scriptum: The bloody Seventh -fn_info_config_pstbs(){ - if [ ! -f "${servercfgfullpath}" ]; then - servername="${unavailable}" - maxplayers="${unavailable}" - reservedslots="${unavailable}" - else - servername=$(grep "ServerName=" "${servercfgfullpath}" | sed -e 's/^[ \t]//g' -e '/^#/d' -e 's/ServerName//g' | tr -d '=";,:' | sed -e 's/^[ \t]//' -e 's/[ \t]*$//') - maxplayers=$(grep "MaxPlayers=" "${servercfgfullpath}" | tr -cd '[:digit:]') - reservedslots=$(grep "NumReservedSlots=" "${servercfgfullpath}" | tr -cd '[:digit:]') - fi - - if [ ! -f "${servercfgdir}/Rcon.cfg" ]; then - rconport=${unavailable} - rconpassword=${unavailable} - else - rconport=$(grep "Port=" "${servercfgdir}/Rcon.cfg" | tr -cd '[:digit:]') - rconpassword=$(grep "Password=" "${servercfgdir}/Rcon.cfg" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/Password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + adminpassword=${adminpassword:-"NOT SET"} + port=${port:-"0"} + webadminenabled=${webadminenabled:-"NOT SET"} + httpport=${webadminport:-"0"} + webadminuser=${webadminuser:-"NOT SET"} + webadminpass=${webadminpass:-"NOT SET"} fi - rconport=${rconport:-"0"} - if [ -z "${rconpassword}" ]||[ ${#rconpassword} == 1 ]; then - rconpassword="NOT SET" - fi - servername=${servername:-"NOT SET"} - serverpassword=${serverpassword:-"NOT SET"} - maxplayers=${maxplayers:-"0"} - numreservedslots=${numreservedslots:-"0"} + # Parameters + queryport=${queryport:-"0"} + defaultmap=${defaultmap:-"NOT SET"} } -fn_info_config_projectcars(){ +fn_info_game_mc(){ if [ ! -f "${servercfgfullpath}" ]; then servername="${unavailable}" - serverpassword="${unavailable}" + rconpassword="${unavailable}" + rconport="${zero}" maxplayers="${zero}" port="${zero}" queryport="${zero}" - steamport="${zero}" + queryenabled="${unavailable}" + gamemode="${unavailable}" + gameworld="${unavailable}" else - 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/^[ \t]*//g' -e '/^\//d' -e 's/password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - maxplayers=$(grep "MaxPlayers" "${servercfgfullpath}" | grep -v "//" | tr -cd '[:digit:]') - port=$(grep "hostPort" "${servercfgfullpath}" | grep -v "//" | tr -cd '[:digit:]') - queryport=$(grep "queryPort" "${servercfgfullpath}" | grep -v "//" | tr -cd '[:digit:]') - steamport=$(grep "steamPort" "${servercfgfullpath}" | grep -v "//" | tr -cd '[:digit:]') + 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:]') + maxplayers=$(grep "max-players" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') + port=$(grep "server-port" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') + queryport=$(grep "query.port" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') + if [ -z "${queryport}" ]; then + queryport=${port:-"0"} + fi + queryenabled=$(grep "enable-query" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/enable-query//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + 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]*$//') + + configip=$(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"} - serverpassword=${serverpassword:-"NOT SET"} + rconpassword=${rconpassword:-"NOT SET"} + rconport=${rconport:-"NOT SET"} maxplayers=${maxplayers:-"NOT SET"} port=${port:-"NOT SET"} queryport=${queryport:-"NOT SET"} - steamport=${steamport:-"NOT SET"} + queryenabled="${queryenabled:-"NOT SET"}" + gamemode=${gamemode:-"NOT SET"} + gameworld=${gameworld:-"NOT SET"} fi } -fn_info_config_projectzomboid(){ +fn_info_game_mcb(){ if [ ! -f "${servercfgfullpath}" ]; then servername="${unavailable}" - serverpassword="${unavailable}" - rconpassword="${unavailable}" maxplayers="${zero}" port="${zero}" + portipv6="${zero}" + queryport="${zero}" + gamemode="${unavailable}" gameworld="${unavailable}" else - 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]*$//') - maxplayers=$(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 '=\";' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + servername=$(grep "server-name" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/server-name//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + maxplayers=$(grep "max-players" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') + port=$(grep "server-port\b" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') + portipv6=$(grep "server-portv6\b" "${servercfgfullpath}" | sed 's/v6//g' | grep -v "#" | tr -cd '[:digit:]') + queryport=${port:-"0"} + gamemode=$(grep "gamemode" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/gamemode//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]*$//') # Not Set servername=${servername:-"NOT SET"} - serverpassword=${serverpassword:-"NOT SET"} - rconpassword=${rconpassword:-"NOT SET"} maxplayers=${maxplayers:-"NOT SET"} port=${port:-"NOT SET"} + portipv6=${portipv6:-"NOT SET"} + queryport=${queryport:-"NOT SET"} + gamemode=${gamemode:-"NOT SET"} gameworld=${gameworld:-"NOT SET"} fi } -fn_info_config_quakeworld(){ +fn_info_game_mh(){ + # Config if [ ! -f "${servercfgfullpath}" ]; then - rconpassword="${unavailable}" servername="${unavailable}" serverpassword="${unavailable}" - maxplayers="${zero}" - port="${zero}" + rconpassword="${unavailable}" + maxplayers="${unavailable}" else - rconpassword=$(grep "rcon_password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set rcon_password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//' | cut -f1 -d "/") - servername=$(grep "hostname" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set hostname//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//' | cut -f1 -d "/") - maxplayers=$(grep "maxclients" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') + servername=$(grep "ServerName" "${servercfgfullpath}" | awk -F '=' '{print $2}') + serverpassword=$(grep "ServerPassword" "${servercfgfullpath}" | awk -F '=' '{print $2}') + rconpassword=$(grep "AdminPassword" "${servercfgfullpath}" | awk -F '=' '{print $2}') + maxplayers=$(grep "MaxSlots" "${servercfgfullpath}" | awk -F '=' '{print $2}') - # Not Set - rconpassword=${rconpassword:-"NOT SET"} + # Not set servername=${servername:-"NOT SET"} + serverpassword=${serverpassword:-"NOT SET"} + rconpassword=${rconpassword:-"NOT SET"} maxplayers=${maxplayers:-"0"} fi + + # Parameters + port=${port:-"0"} + queryport=${queryport:-"0"} + beaconport=${beaconport:-"0"} } -fn_info_config_quake2(){ +fn_info_game_mohaa(){ + # Config if [ ! -f "${servercfgfullpath}" ]; then rconpassword="${unavailable}" servername="${unavailable}" serverpassword="${unavailable}" maxplayers="${zero}" else - rconpassword=$(grep "rcon_password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set rcon_password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - servername=$(grep "hostname" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set hostname//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - maxplayers=$(grep "maxclients" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') + rconpassword=$(grep "rconpassword" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/seta rconpassword//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + servername=$(grep "sv_hostname" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/seta 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/seta g_password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + maxplayers=$(grep "sv_maxclients" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') # Not Set rconpassword=${rconpassword:-"NOT SET"} servername=${servername:-"NOT SET"} + serverpassword=${serverpassword:-"NOT SET"} maxplayers=${maxplayers:-"0"} fi + + # Parameters + port=${port:-"0"} + queryport=${port:-"0"} + defaultmap=${defaultmap:-"NOT SET"} } -fn_info_config_quake3(){ +fn_info_game_mom(){ + # Config if [ ! -f "${servercfgfullpath}" ]; then - rconpassword="${unavailable}" servername="${unavailable}" serverpassword="${unavailable}" - maxplayers="${zero}" + maxplayer="${zero}" + defaultmap="${unavailable}" else - 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 "rconpassword" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set rconpassword//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - maxplayers=$(grep "sv_maxclients" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') + 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 "ServerPassword" "${servercfgfullpath}" | sed -e 's/^ *//g' -e '/^--/d' -e 's/ServerPassword//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + maxplayers=$(grep "MaxPlayers" "${servercfgfullpath}" | sed -e 's/^ *//g' -e '/^--/d' -e 's/MaxPlayers//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + defaultmap=$(grep "MapName" "${servercfgfullpath}" | sed -e 's/^ *//g' -e '/^--/d' -e 's/MapName//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') # Not Set - rconpassword=${rconpassword:-"NOT SET"} servername=${servername:-"NOT SET"} serverpassword=${serverpassword:-"NOT SET"} - maxplayers=${maxplayers:-"0"} + maxplayer=${maxplayers:-"NOT SET"} + defaultmap=${defaultmap:-"NOT SET"} fi + + # Parameters + port=${port:-"7777"} + beaconport=${queryport:-"15000"} } -fn_info_config_jk2(){ +fn_info_game_mta(){ + # Config if [ ! -f "${servercfgfullpath}" ]; then - rconpassword="${unavailable}" + configip="${zero}" + port="${unavailable}" + httpport="${unavailable}" + ase="${unavailable}" servername="${unavailable}" serverpassword="${unavailable}" maxplayers="${zero}" else - rconpassword=$(grep "seta rconpassword" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/seta rconpassword//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - servername=$(grep "seta sv_hostname" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/seta sv_hostname//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - serverpassword=$(grep "seta g_password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/seta g_password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - maxplayers=$(grep "seta sv_maxclients" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') - serverversion=$(grep "seta mv_serverversion" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/seta mv_serverversion//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + port=$(grep -m 1 "serverport" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's///g' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//' | cut -f1 -d "<" | tr -cd '[:digit:]') + httpport=$(grep -m 1 "httpport" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's///g' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//' | cut -f1 -d "<" | tr -cd '[:digit:]') + servername=$(grep -m 1 "servername" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's///g' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//' | cut -f1 -d "<") + serverpassword=$(grep -m 1 "password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's///g' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//' | cut -f1 -d "<") + maxplayers=$(grep -m 1 "maxplayers" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's///g' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//' | cut -f1 -d "<" | tr -cd '[:digit:]') + ase=$(grep -m 1 "ase" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's///g' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//' | cut -f1 -d "<" | tr -cd '[:digit:]') + if [ "${ase}" == "1" ]; then + ase="Enabled" + else + ase="Disabled" + fi + # configip=$(grep -m 1 "serverip" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's///g' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//' | cut -f1 -d "<") + # ipsetinconfig=1 + # ipinconfigvar="serverip" # Not Set - rconpassword=${rconpassword:-"NOT SET"} + port=${port:-"22003"} + httpport=${httpport:-"22005"} + ase=${ase:-"Disabled"} servername=${servername:-"NOT SET"} serverpassword=${serverpassword:-"NOT SET"} maxplayers=${maxplayers:-"0"} fi + + # Parameters + queryport=$((port+123)) } -fn_info_config_quakelive(){ +fn_info_game_mumble(){ + if [ ! -f "${servercfgfullpath}" ]; then + port="64738" + queryport="${port}" + servername="Mumble" + else + 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}" + + configip=$(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}" + fi +} + +fn_info_game_onset(){ if [ ! -f "${servercfgfullpath}" ]; then - rconpassword="${unavailable}" servername="${unavailable}" - serverpassword="${unavailable}" maxplayers="${zero}" port="${zero}" + httpport="${zero}" queryport="${zero}" - rconport="${zero}" - statsport="${zero}" else - 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]*$//') - maxplayers=$(grep "sv_maxClients" "${servercfgfullpath}" | grep -v "//" | tr -cd '[:digit:]') - port=$(grep "net_port" "${servercfgfullpath}" | grep -v "//" | tr -cd '[:digit:]') - queryport="${port}" - rconport=$(grep "zmq_rcon_port" "${servercfgfullpath}" | grep -v "//" | tr -cd '[:digit:]') - statsport=$(grep "zmq_stats_port" "${servercfgfullpath}" | grep -v "//" | tr -cd '[:digit:]') - - configip=$(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" + servername=$(grep -v "servername_short" "${servercfgfullpath}" | grep "servername" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/servername//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//' ) + maxplayers=$(grep "maxplayers" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') + port=$(grep "port" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') + httpport=$((port-2)) + queryport=$((port-1)) # Not Set - rconpassword=${rconpassword:-"NOT SET"} servername=${servername:-"NOT SET"} - serverpassword=${serverpassword:-"NOT SET"} - maxplayers=${maxplayers:-"0"} - port=${port:-"0"} - queryport=${queryport:-"0"} - rconport=${rconport:-"0"} - statsport=${statsport:-"0"} + maxplayers=${maxplayers:-"NOT SET"} + port=${port:-"NOT SET"} + httpport=${httpport:-"NOT SET"} + queryport=${queryport:-"NOT SET"} fi } -fn_info_config_realvirtuality(){ +fn_info_game_pc(){ if [ ! -f "${servercfgfullpath}" ]; then servername="${unavailable}" - adminpassword="${unavailable}" serverpassword="${unavailable}" maxplayers="${zero}" + port="${zero}" + queryport="${zero}" + steamport="${zero}" else - 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]*$//') - maxplayers=$(grep "maxPlayers" "${servercfgfullpath}" | grep -v "//" | tr -cd '[:digit:]') + 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/^[ \t]*//g' -e '/^\//d' -e 's/password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + maxplayers=$(grep "MaxPlayers" "${servercfgfullpath}" | grep -v "//" | tr -cd '[:digit:]') + port=$(grep "hostPort" "${servercfgfullpath}" | grep -v "//" | tr -cd '[:digit:]') + queryport=$(grep "queryPort" "${servercfgfullpath}" | grep -v "//" | tr -cd '[:digit:]') + steamport=$(grep "steamPort" "${servercfgfullpath}" | grep -v "//" | tr -cd '[:digit:]') # Not Set servername=${servername:-"NOT SET"} - adminpassword=${adminpassword:-"NOT SET"} serverpassword=${serverpassword:-"NOT SET"} + maxplayers=${maxplayers:-"NOT SET"} + port=${port:-"NOT SET"} + queryport=${queryport:-"NOT SET"} + steamport=${steamport:-"NOT SET"} + fi +} + +fn_info_game_pstbs(){ + if [ ! -f "${servercfgfullpath}" ]; then + servername="${unavailable}" + maxplayers="${unavailable}" + reservedslots="${unavailable}" + else + servername=$(grep "ServerName=" "${servercfgfullpath}" | sed -e 's/^[ \t]//g' -e '/^#/d' -e 's/ServerName//g' | tr -d '=";,:' | sed -e 's/^[ \t]//' -e 's/[ \t]*$//') + maxplayers=$(grep "MaxPlayers=" "${servercfgfullpath}" | tr -cd '[:digit:]') + reservedslots=$(grep "NumReservedSlots=" "${servercfgfullpath}" | tr -cd '[:digit:]') + fi + + if [ ! -f "${servercfgdir}/Rcon.cfg" ]; then + rconport=${unavailable} + rconpassword=${unavailable} + else + rconport=$(grep "Port=" "${servercfgdir}/Rcon.cfg" | tr -cd '[:digit:]') + rconpassword=$(grep "Password=" "${servercfgdir}/Rcon.cfg" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/Password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + fi + + rconport=${rconport:-"0"} + if [ -z "${rconpassword}" ]||[ ${#rconpassword} == 1 ]; then + rconpassword="NOT SET" + fi + servername=${servername:-"NOT SET"} + serverpassword=${serverpassword:-"NOT SET"} + maxplayers=${maxplayers:-"0"} + numreservedslots=${numreservedslots:-"0"} +} + +fn_info_game_pvr(){ + # Config + if [ ! -f "${servercfgfullpath}" ]; then + servername="${unavailable}" + maxplayers="${unavailable}" + else + servername=$(grep "ServerName" "${servercfgfullpath}" | awk -F '=' '{print $2}') + maxplayers=$(grep "MaxPlayers" "${servercfgfullpath}" | awk -F '=' '{print $2}') + + # Not set + servername=${servername:-"NOT SET"} maxplayers=${maxplayers:-"0"} fi + + # Parameters + port=${port:-"0"} + port401=$((port+400)) + queryport=${port:-"0"} } -fn_info_config_risingworld(){ +fn_info_game_pz(){ + # Config if [ ! -f "${servercfgfullpath}" ]; then servername="${unavailable}" + serverpassword="${unavailable}" rconpassword="${unavailable}" - rconport="${zero}" maxplayers="${zero}" port="${zero}" - gamemode="${unavailable}" gameworld="${unavailable}" else - servername=$(grep "server_name" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/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]*$//') - 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:]') - maxplayers=$(grep "settings_max_players" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') - port=$(grep "server_port" "${servercfgfullpath}" | grep -v "database_mysql_server_port" | grep -v "#" | tr -cd '[:digit:]') - gamemode=$(grep "gamemode" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') - gameworld=$(grep "server_world_name" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/server_world_name//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - javaram=$(grep "server_memory" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/server_memory//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - configip=$(grep "server_ip" "${servercfgfullpath}" | grep -v "database_mysql_server_ip" | 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" + 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]*$//') + maxplayers=$(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 '=\";' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') # Not Set servername=${servername:-"NOT SET"} + serverpassword=${serverpassword:-"NOT SET"} rconpassword=${rconpassword:-"NOT SET"} - rconport=${rconport:-"NOT SET"} maxplayers=${maxplayers:-"NOT SET"} port=${port:-"NOT SET"} - gamemode=${gamemode:-"NOT SET"} gameworld=${gameworld:-"NOT SET"} fi + + # Parameters + adminpassword=${adminpassword:-"NOT SET"} + queryport=${port:-"0"} } -fn_info_config_rtcw(){ +fn_info_game_q2(){ + # Config if [ ! -f "${servercfgfullpath}" ]; then rconpassword="${unavailable}" servername="${unavailable}" serverpassword="${unavailable}" maxplayers="${zero}" else - rconpassword=$(grep "rconpassword" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set rconpassword//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]*$//') - maxplayers=$(grep "sv_maxclients" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') + rconpassword=$(grep "rcon_password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set rcon_password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + servername=$(grep "hostname" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set hostname//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + maxplayers=$(grep "maxclients" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') # Not Set rconpassword=${rconpassword:-"NOT SET"} servername=${servername:-"NOT SET"} - serverpassword=${serverpassword:-"NOT SET"} maxplayers=${maxplayers:-"0"} fi + + # Parameters + port=${port:-"0"} + queryport=${port:-"0"} + defaultmap=${defaultmap:-"NOT SET"} } -#StickyBots -fn_info_config_sbots(){ +fn_info_game_q3(){ if [ ! -f "${servercfgfullpath}" ]; then + rconpassword="${unavailable}" servername="${unavailable}" - maxplayers="${unavailable}" + serverpassword="${unavailable}" + maxplayers="${zero}" else - servername=$(grep "ServerName=" "${servercfgfullpath}" | sed -e 's/^[ \t]//g' -e '/^#/d' -e 's/ServerName//g' | tr -d '=";,:' | sed -e 's/^[ \t]//' -e 's/[ \t]*$//') - maxplayers=$(grep "MaxPlayers=" "${servercfgfullpath}" | tr -cd '[:digit:]') - fi + 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 "rconpassword" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set rconpassword//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + maxplayers=$(grep "sv_maxclients" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') - servername=${servername:-"NOT SET"} - serverpassword=${serverpassword:-"NOT SET"} - maxplayers=${maxplayers:-"0"} + # Not Set + rconpassword=${rconpassword:-"NOT SET"} + servername=${servername:-"NOT SET"} + serverpassword=${serverpassword:-"NOT SET"} + maxplayers=${maxplayers:-"0"} + fi } -fn_info_config_sof2(){ +fn_info_game_ql(){ if [ ! -f "${servercfgfullpath}" ]; then rconpassword="${unavailable}" servername="${unavailable}" serverpassword="${unavailable}" maxplayers="${zero}" + port="${zero}" + queryport="${zero}" + rconport="${zero}" + statsport="${zero}" else - rconpassword=$(grep "rconpassword" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set rconpassword//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + 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]*$//') - maxplayers=$(grep "sv_maxclients" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') + maxplayers=$(grep "sv_maxClients" "${servercfgfullpath}" | grep -v "//" | tr -cd '[:digit:]') + port=$(grep "net_port" "${servercfgfullpath}" | grep -v "//" | tr -cd '[:digit:]') + queryport="${port}" + rconport=$(grep "zmq_rcon_port" "${servercfgfullpath}" | grep -v "//" | tr -cd '[:digit:]') + statsport=$(grep "zmq_stats_port" "${servercfgfullpath}" | grep -v "//" | tr -cd '[:digit:]') + + configip=$(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"} maxplayers=${maxplayers:-"0"} + port=${port:-"0"} + queryport=${queryport:-"0"} + rconport=${rconport:-"0"} + statsport=${statsport:-"0"} fi } -fn_info_config_source(){ +fn_info_game_qw(){ + # Config if [ ! -f "${servercfgfullpath}" ]; then + rconpassword="${unavailable}" servername="${unavailable}" serverpassword="${unavailable}" - rconpassword="${unavailable}" + maxplayers="${zero}" + port="${zero}" else - 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]*$//') + rconpassword=$(grep "rcon_password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set rcon_password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//' | cut -f1 -d "/") + servername=$(grep "hostname" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set hostname//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//' | cut -f1 -d "/") + maxplayers=$(grep "maxclients" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') # Not Set - servername=${servername:-"NOT SET"} - serverpassword=${serverpassword:-"NOT SET"} rconpassword=${rconpassword:-"NOT SET"} + servername=${servername:-"NOT SET"} + maxplayers=${maxplayers:-"0"} fi + + # Parameters + port=${port:-"0"} + queryport=${port:-"0"} } -fn_info_config_starbound(){ +fn_info_game_ro(){ if [ ! -f "${servercfgfullpath}" ]; then servername="${unavailable}" - queryenabled="${unavailable}" - rconenabled="${unavailable}" - rconpassword="${unavailable}" - port="21025" - queryport="21025" - rconport="21026" - maxplayers="8" + serverpassword="${unavailable}" + adminpassword="${unavailable}" + port="${zero}" + queryport="${zero}" + steamport="${zero}" + steammasterport="${zero}" + lanport="${zero}" + httpport="${zero}" + webadminenabled="${unavailable}" + webadminuser="${unavailable}" + webadminpass="${unavailable}" else - servername=$(grep "serverName" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e 's/serverName//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - queryenabled=$(grep "runQueryServer" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e 's/runQueryServer//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - rconenabled=$(grep "runRconServer" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e 's/runRconServer//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:]') - maxplayers=$(grep "maxPlayers" "${servercfgfullpath}" | tr -cd '[:digit:]') + servername=$(sed -nr 's/^ServerName=(.*)$/\1/p' "${servercfgfullpath}" | tr -d '=\";,:' | sed 's/\r$//') + serverpassword=$(sed -nr 's/^GamePassword=(.*)$/\1/p' "${servercfgfullpath}" | tr -d '=\";,:' | sed 's/\r$//') + adminpassword=$(sed -nr 's/^AdminPassword=(.*)$/\1/p' "${servercfgfullpath}" | tr -d '=\";,:' | sed 's/\r$//') + port=$(sed -nr 's/^Port=(.*)$/\1/p' "${servercfgfullpath}" | tr -cd '[:digit:]') + queryport=$((port+1)) + steamport="20610" + steammasterport="28902" + lanport=$(grep "LANServerPort=" "${servercfgfullpath}" | tr -cd '[:digit:]') + httpport=$(sed -nr 's/^ListenPort=(.*)$/\1/p' "${servercfgfullpath}" | tr -cd '[:digit:]') + webadminenabled=$(sed -nr 's/^bEnabled=(.*)$/\1/p' "${servercfgfullpath}" | tr -d '=\";,:' | sed 's/\r$//') + webadminuser=$(sed -nr 's/^AdminName=(.*)$/\1/p' "${servercfgfullpath}" | tr -d '=\";,:' | sed 's/\r$//') + webadminpass="${adminpassword}" # Not Set servername=${servername:-"NOT SET"} - queryenabled=${queryenabled:-"NOT SET"} - rconenabled=${rconenabled:-"NOT SET"} - rconpassword=${rconpassword:-"NOT SET"} - port=${port:-"21025"} - queryport=${queryport:-"21025"} - rconport=${rconport:-"21026"} - maxplayers=${maxplayers:-"8"} + serverpassword=${serverpassword:-"NOT SET"} + adminpassword=${adminpassword:-"NOT SET"} + port=${port:-"0"} + queryport=${queryport:-"0"} + steamport=${steamport:-"0"} + steammasterport=${steammasterport:-"0"} + lanport=${lanport:-"0"} + httpport=${httpport:-"0"} + webadminenabled=${webadminenabled:-"NOT SET"} + webadminuser=${webadminuser:-"NOT SET"} + webadminpass=${webadminpass:-"NOT SET"} fi } -fn_info_config_teamspeak3(){ +fn_info_game_rtcw(){ + # Config if [ ! -f "${servercfgfullpath}" ]; then - dbplugin="${unavailable}" - port="9987" - queryport="10011" - fileport="30033" + rconpassword="${unavailable}" + servername="${unavailable}" + serverpassword="${unavailable}" + maxplayers="${zero}" else - 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:]') - - configip=$(grep "voice_ip" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/voice_ip//g' | sed 's/,.*//' | tr -d '=\";,' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - ipsetinconfig=1 - ipinconfigvar="voice_ip" + rconpassword=$(grep "rconpassword" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set rconpassword//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]*$//') + maxplayers=$(grep "sv_maxclients" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') # Not Set - port=${port:-"9987"} - queryport=${queryport:-"10011"} - fileport=${fileport:-"30033"} + rconpassword=${rconpassword:-"NOT SET"} + servername=${servername:-"NOT SET"} + serverpassword=${serverpassword:-"NOT SET"} + maxplayers=${maxplayers:-"0"} fi + + # Parameters + port=${port:-"0"} + queryport=${port:-"0"} + defaultmap=${defaultmap:-"NOT SET"} +} + +fn_info_game_rust(){ + # Parameters + servername=${servername:-"NOT SET"} + port=${port:-"0"} + queryport=${port:-"0"} + appport=${appport:-"0"} + rconport=${rconport:-"0"} + gamemode=${gamemode:-"NOT SET"} + maxplayers=${maxplayers:-"0"} + rconpassword=${rconpassword:-"NOT SET"} + rconweb=${rconweb:-"NOT SET"} + tickrate=${tickrate:-"0"} + saveinterval=${saveinterval:-"0"} + serverlevel=${serverlevel:-"NOT SET"} + worldsize=${worldsize:-"0"} } -fn_info_config_mumble(){ +fn_info_game_rw(){ + # Config if [ ! -f "${servercfgfullpath}" ]; then - port="64738" - queryport="${port}" - servername="Mumble" + servername="${unavailable}" + rconpassword="${unavailable}" + rconport="${zero}" + maxplayers="${zero}" + port="${zero}" + port2="${zero}" + port3="${zero}" + port4="${zero}" + queryport="${zero}" + gamemode="${unavailable}" + gameworld="${unavailable}" else - port=$(grep "port" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^;/d' -e 's/port//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + servername=$(grep "server_name" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/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]*$//') + 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:]') + maxplayers=$(grep "settings_max_players" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') + port=$(grep "server_port" "${servercfgfullpath}" | grep -v "database_mysql_server_port" | grep -v "#" | tr -cd '[:digit:]') + port2=$((port+1)) + port3=$((port+2)) + port4=$((port+3)) queryport="${port}" - - configip=$(grep "host=" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^;/d' -e 's/host=//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + gamemode=$(grep "settings_default_gamemode=" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/settings_default_gamemode//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + gameworld=$(grep "server_world_name" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/server_world_name//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + #javaram=$(grep "server_memory" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/server_memory//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + configip=$(grep "server_ip" "${servercfgfullpath}" | grep -v "database_mysql_server_ip" | sed -e 's/^[ \t]*//g' -e '/^--/d' -e 's/server_ip//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') ipsetinconfig=1 - ipinconfigvar="voice_ip" + ipinconfigvar="server-ip" # Not Set - port=${port:-"64738"} - queryport=${queryport:-"64738"} - servername="Mumble Port ${port}" + servername=${servername:-"NOT SET"} + rconpassword=${rconpassword:-"NOT SET"} + rconport=${rconport:-"NOT SET"} + maxplayers=${maxplayers:-"NOT SET"} + port=${port:-"NOT SET"} + gamemode=${gamemode:-"NOT SET"} + gameworld=${gameworld:-"NOT SET"} fi + + # Parameters + servername=${servername:-"NOT SET"} + port=${port:-"0"} + httpqueryport=$((port-1)) } -fn_info_config_samp(){ +fn_info_game_samp(){ + # Config if [ ! -f "${servercfgfullpath}" ]; then servername="unnamed server" serverpassword="${unavailable}" rconpassword="${unavailable}" port="7777" + rconport="${port}" maxplayers="50" else servername=$(grep "hostname" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/hostname//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]*$//') port=$(grep "port" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') + rconport="${port}" maxplayers=$(grep "maxplayers" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') # Not Set servername=${servername:-"NOT SET"} rconpassword=${rconpassword:-"NOT SET"} - port=${port:-"8303"} + port=${port:-"7777"} + rconport="${port}" maxplayers=${maxplayers:-"12"} fi -} - -fn_info_config_teeworlds(){ - if [ ! -f "${servercfgfullpath}" ]; then - servername="unnamed server" - serverpassword="${unavailable}" - rconpassword="${unavailable}" - port="8303" - queryport="8303" - maxplayers="12" - else - 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:]') - queryport="${port}" - maxplayers=$(grep "sv_max_clients" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') - - # Not Set - servername=${servername:-"NOT SET"} - serverpassword=${serverpassword:-"NOT SET"} - rconpassword=${rconpassword:-"NOT SET"} - port=${port:-"8303"} - queryport=${port:-"8303"} - maxplayers=${maxplayers:-"12"} - fi -} - -fn_info_config_terraria(){ - if [ ! -f "${servercfgfullpath}" ]; then - servername="${unavailable}" - port="${zero}" - gameworld="${unavailable}" - maxplayers="${zero}" - queryport="${zero}" - else - 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:]') - queryport=${port:-"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]*$//') - maxplayers=$(grep "maxplayers" "${servercfgfullpath}" | grep -v "//" | tr -cd '[:digit:]') - - # Not Set - servername=${servername:-"NOT SET"} - port=${port:-"0"} - queryport=${queryport:-"0"} - gameworld=${gameworld:-"NOT SET"} - maxplayers=${maxplayers:-"0"} - fi -} - -fn_info_config_towerunite(){ - if [ ! -f "${servercfgfullpath}" ]; then - servername="${unavailable}" - maxplayers="${zero}" - else - servername=$(grep "ServerTitle" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^--/d' -e 's/ServerTitle//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - maxplayers=$(grep "MaxPlayers" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') - - # Not Set - servername=${servername:-"NOT SET"} - maxplayers=${maxplayers:-"0"} - fi -} -fn_info_config_unreal(){ - if [ ! -f "${servercfgfullpath}" ]; then - servername="${unavailable}" - serverpassword="${unavailable}" - adminpassword="${unavailable}" - port="${zero}" - queryport="${zero}" - queryportgs="${zero}" - webadminenabled="${unavailable}" - webadminport="${zero}" - webadminuser="${unavailable}" - webadminpass="${unavailable}" - else - servername=$(grep "ServerName" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/ServerName//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//'| sed 's/\r$//') - serverpassword=$(grep "GamePassword" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/GamePassword//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//'| sed 's/\r$//') - adminpassword=$(grep "AdminPassword" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/AdminPassword//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//'| sed 's/\r$//') - port=$(grep "Port" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' | grep "^Port" | grep -v "#" | tr -cd '[:digit:]') - queryport=$((port + 1)) - queryportgs=$(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 '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//'| sed 's/\r$//') - webadminport=$(grep "ListenPort" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') - webadminuser=$(grep "AdminUsername" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/AdminUsername//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//'| sed 's/\r$//') - 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]*$//'| sed 's/\r$//') - # Not Set - servername=${servername:-"NOT SET"} - serverpassword=${serverpassword:-"NOT SET"} - adminpassword=${adminpassword:-"NOT SET"} - port=${port:-"0"} - queryport=${queryport:-"0"} - queryportgs=${queryportgs:-"0"} - webadminenabled=${webadminenabled:-"NOT SET"} - webadminport=${webadminport:-"0"} - webadminuser=${webadminuser:-"NOT SET"} - webadminpass=${webadminpass:-"NOT SET"} - fi + # Parameters + queryport=${port:-"0"} } -fn_info_config_unreal2(){ +fn_info_game_sb(){ if [ ! -f "${servercfgfullpath}" ]; then servername="${unavailable}" - serverpassword="${unavailable}" - adminpassword="${unavailable}" - port="${zero}" - queryport="${zero}" - queryportgs="${zero}" - webadminenabled="${unavailable}" - webadminport="${zero}" - webadminuser="${unavailable}" - webadminpass="${unavailable}" + queryenabled="${unavailable}" + rconenabled="${unavailable}" + rconpassword="${unavailable}" + port="21025" + queryport="21025" + rconport="21026" + maxplayers="8" else - servername=$(sed -nr 's/^ServerName=(.*)$/\1/p' "${servercfgfullpath}" | tr -d '=\";,:' | sed 's/\r$//') - serverpassword=$(sed -nr 's/^GamePassword=(.*)$/\1/p' "${servercfgfullpath}" | tr -d '=\";,:' | sed 's/\r$//') - adminpassword=$(sed -nr 's/^AdminPassword=(.*)$/\1/p' "${servercfgfullpath}" | tr -d '=\";,:' | sed 's/\r$//') - port=$(sed -nr 's/^Port=(.*)$/\1/p' "${servercfgfullpath}" | tr -cd '[:digit:]') - queryport=$((port + 1)) - queryportgs=$(sed -nr 's/^OldQueryPortNumber=(.*)$/\1/p' "${servercfgfullpath}" | tr -cd '[:digit:]') - webadminenabled=$(sed -nr 's/^bEnabled=(.*)$/\1/p' "${servercfgfullpath}" | tr -d '=\";,:' | sed 's/\r$//') - webadminport=$(sed -nr 's/^ListenPort=(.*)$/\1/p' "${servercfgfullpath}" | tr -cd '[:digit:]') - webadminuser=$(sed -nr 's/^AdminName=(.*)$/\1/p' "${servercfgfullpath}" | tr -d '=\";,:' | sed 's/\r$//') - webadminpass="${adminpassword}" + servername=$(grep "serverName" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e 's/serverName//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + queryenabled=$(grep "runQueryServer" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e 's/runQueryServer//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + rconenabled=$(grep "runRconServer" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e 's/runRconServer//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:]') + maxplayers=$(grep "maxPlayers" "${servercfgfullpath}" | tr -cd '[:digit:]') # Not Set servername=${servername:-"NOT SET"} - serverpassword=${serverpassword:-"NOT SET"} - adminpassword=${adminpassword:-"NOT SET"} - port=${port:-"0"} - queryport=${queryport:-"0"} - queryportgs=${queryportgs:-"0"} - webadminenabled=${webadminenabled:-"NOT SET"} - webadminport=${webadminport:-"0"} - webadminuser=${webadminuser:-"NOT SET"} - webadminpass=${webadminpass:-"NOT SET"} + queryenabled=${queryenabled:-"NOT SET"} + rconenabled=${rconenabled:-"NOT SET"} + rconpassword=${rconpassword:-"NOT SET"} + port=${port:-"21025"} + queryport=${queryport:-"21025"} + rconport=${rconport:-"21026"} + maxplayers=${maxplayers:-"8"} fi } -fn_info_config_unreal3(){ +fn_info_game_sbots(){ + # Config if [ ! -f "${servercfgfullpath}" ]; then servername="${unavailable}" - serverpassword="${unavailable}" - adminpassword="${unavailable}" maxplayers="${unavailable}" - webadminenabled="${unavailable}" - webadminport="${zero}" - webadminuser="${unavailable}" - webadminpass="${unavailable}" else - 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]*$//') - maxplayers=$(grep "MaxPlayers" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') - webadminenabled=$(grep "bEnabled" "${servercfgdir}/UTWeb.ini" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/bEnabled//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - webadminport=$(grep "ListenPort" "${servercfgdir}/UTWeb.ini" | grep -v "#" | tr -cd '[:digit:]') - webadminuser="Admin" - webadminpass=$(grep "AdminPassword" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/AdminPassword//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + servername=$(grep "ServerName=" "${servercfgfullpath}" | sed -e 's/^[ \t]//g' -e '/^#/d' -e 's/ServerName//g' | tr -d '=";,:' | sed -e 's/^[ \t]//' -e 's/[ \t]*$//') + maxplayers=$(grep "MaxPlayers=" "${servercfgfullpath}" | tr -cd '[:digit:]') # Not Set servername=${servername:-"NOT SET"} serverpassword=${serverpassword:-"NOT SET"} - adminpassword=${adminpassword:-"NOT SET"} - maxplayers=${maxplayers:-"NOT SET"} - webadminenabled=${webadminenabled:-"NOT SET"} - webadminport=${webadminport:-"0"} - webadminuser=${webadminuser:-"NOT SET"} - webadminpass=${webadminpass:-"NOT SET"} + maxplayers=${maxplayers:-"0"} fi -} - -fn_info_config_ut(){ - if [ ! -f "${servercfgfullpath}" ]; then - servername="${unavailable}" - else - servername=$(grep "ServerName" "${servercfgfullpath}" | awk -F '=' '{print $2}') - # Not set - servername=${servername:-"NOT SET"} - fi + # Parameters + port=${port:-"0"} + queryport=${queryport:-"0"} + servername=${servername:-"NOT SET"} + serverpassword=${serverpassword:-"NOT SET"} + defaultmap=${defaultmap:-"NOT SET"} + maxplayers=${maxplayers:-"0"} } -fn_info_config_warfork(){ - if [ ! -f "${servercfgfullpath}" ]; then - rconpassword="${unavailable}" - servername="${unavailable}" - maxplayers="${zero}" - else - rconpassword=$(grep "rcon_password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set 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]*$//') - maxplayers=$(grep "sv_maxclients" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') - - # Not Set - rconpassword=${rconpassword:-"NOT SET"} - servername=${servername:-"NOT SET"} - maxplayers=${maxplayers:-"0"} - fi -} +fn_info_game_scpsl(){ + # Config + if [ -f "${servercfgfullpath}" ]; then + servername=$(sed -nr 's/^server_name: (.*)$/\1/p' "${servercfgfullpath}") + maxplayers=$(sed -nr 's/^max_players: (.*)$/\1/p' "${servercfgfullpath}") + configip=$(sed -nr 's/^ipv4_bind_ip: (.*)$/\1/p' "${servercfgfullpath}") + tickrate=$(sed -nr 's/^server_tickrate: (.*)$/\1/p' "${servercfgfullpath}") + adminpassword=$(sed -nr 's/^administrator_query_password: (.*)$/\1/p' "${servercfgfullpath}") -fn_info_config_kf2(){ - if [ ! -f "${servercfgfullpath}" ]; then - servername="${unavailable}" - serverpassword="${unavailable}" - adminpassword="${unavailable}" - port="${unavailable}" - queryport="${unavailable}" - webadminenabled="${unavailable}" - webadminport="${zero}" - webadminuser="${unavailable}" - webadminpass="${unavailable}" + if [ "${adminpassword}" == "none" ]; then + adminpassword="NOT SET" + fi else - 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" "${servercfgdir}/LinuxServer-KFEngine.ini" | sed -e 's/^[ \t]*//g' | grep "^Port" | grep -v "#" | tr -cd '[:digit:]') - webadminenabled=$(grep "bEnabled" "${servercfgdir}/KFWeb.ini" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/bEnabled//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - webadminport=$(grep "ListenPort" "${servercfgdir}/KFWeb.ini" | grep -v "#" | tr -cd '[:digit:]') - webadminuser="Admin" - webadminpass=$(grep "AdminPassword" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/AdminPassword//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - - # Not Set servername=${servername:-"NOT SET"} - serverpassword=${serverpassword:-"NOT SET"} + maxplayers=${maxplayers:-"0"} + configip=${configip:-"0.0.0.0"} + tickrate=${tickrate:-"NOT SET"} adminpassword=${adminpassword:-"NOT SET"} - port=${port:-"0"} - webadminenabled=${webadminenabled:-"NOT SET"} - webadminport=${webadminport:-"0"} - webadminuser=${webadminuser:-"NOT SET"} - webadminpass=${webadminpass:-"NOT SET"} fi + + # Parameters + queryport="${port:-"0"}" } -fn_info_config_sdtd(){ +fn_info_game_sdtd(){ if [ ! -f "${servercfgfullpath}" ]; then servername="${unavailable}" serverpassword="${unavailable}" port="${zero}" + port3="${zero}" queryport="${zero}" webadminenabled="${unavailable}" webadminport="${zero}" @@ -1202,168 +1400,140 @@ fn_info_config_sdtd(){ servername=$(grep "ServerName" "${servercfgfullpath}" | sed 's/^.*value="//' | cut -f1 -d"\"") serverpassword=$(grep "ServerPassword" "${servercfgfullpath}" | sed 's/^.*value="//' | cut -f1 -d"\"") port=$(grep "ServerPort" "${servercfgfullpath}" | grep -Eo 'value="[0-9]+"' | tr -cd '[:digit:]') + port3=$((port+2)) queryport=${port:-"0"} - webadminenabled=$(grep "ControlPanelEnabled" "${servercfgfullpath}" | sed 's/^.*value="//' | cut -f1 -d"\"") webadminport=$(grep "ControlPanelPort" "${servercfgfullpath}" | tr -cd '[:digit:]') webadminpass=$(grep "ControlPanelPassword" "${servercfgfullpath}" | sed 's/^.*value="//' | cut -f1 -d"\"") - telnetenabled=$(grep "TelnetEnabled" "${servercfgfullpath}" | sed 's/^.*value="//' | cut -f1 -d"\"") - telnetport=$(grep "TelnetPort" "${servercfgfullpath}" | tr -cd '[:digit:]') - telnetpass=$(grep "TelnetPassword" "${servercfgfullpath}" | sed 's/^.*value="//' | cut -f1 -d"\"") - # Telnet IP will be localhost if no password is set - # check_ip will set the IP first. This will overwrite it. - if [ -z "${telnetpass}" ]; then - telnetip="127.0.0.1" - fi - maxplayers=$(grep "ServerMaxPlayerCount" "${servercfgfullpath}" | tr -cd '[:digit:]') - gamemode=$(grep "GameMode" "${servercfgfullpath}" | sed 's/^.*value="//' | cut -f1 -d"\"") - gameworld=$(grep "GameWorld" "${servercfgfullpath}" | sed 's/^.*value="//' | cut -f1 -d"\"") - - # Not Set - servername=${servername:-"NOT SET"} - serverpassword=${serverpassword:-"NOT SET"} - port=${port:-"0"} - queryport=${queryport:-"0"} - webadminenabled=${webadminenabled:-"NOT SET"} - webadminport=${webadminport:-"0"} - webadminpass=${webadminpass:-"NOT SET"} - telnetenabled=${telnetenabled:-"NOT SET"} - telnetport=${telnetport:-"0"} - telnetpass=${telnetpass:-"NOT SET"} - maxplayers=${maxplayers:-"NOT SET"} - gamemode=${gamemode:-"NOT SET"} - gameworld=${gameworld:-"NOT SET"} - fi -} - -fn_info_config_mta(){ - if [ ! -f "${servercfgfullpath}" ]; then - configip="${zero}" - port="${unavailable}" - httpport="${unavailable}" - ase="${unavailable}" - servername="${unavailable}" - serverpassword="${unavailable}" - maxplayers="${zero}" - else - port=$(grep -m 1 "serverport" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's///g' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//' | cut -f1 -d "<" | tr -cd '[:digit:]') - httpport=$(grep -m 1 "httpport" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's///g' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//' | cut -f1 -d "<" | tr -cd '[:digit:]') - servername=$(grep -m 1 "servername" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's///g' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//' | cut -f1 -d "<") - serverpassword=$(grep -m 1 "password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's///g' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//' | cut -f1 -d "<") - maxplayers=$(grep -m 1 "maxplayers" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's///g' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//' | cut -f1 -d "<" | tr -cd '[:digit:]') - ase=$(grep -m 1 "ase" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's///g' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//' | cut -f1 -d "<" | tr -cd '[:digit:]') - if [ "${ase}" == "1" ]; then - ase="Enabled" - else - ase="Disabled" + telnetenabled=$(grep "TelnetEnabled" "${servercfgfullpath}" | sed 's/^.*value="//' | cut -f1 -d"\"") + telnetport=$(grep "TelnetPort" "${servercfgfullpath}" | tr -cd '[:digit:]') + telnetpass=$(grep "TelnetPassword" "${servercfgfullpath}" | sed 's/^.*value="//' | cut -f1 -d"\"") + # Telnet IP will be localhost if no password is set + # check_ip will set the IP first. This will overwrite it. + if [ -z "${telnetpass}" ]; then + telnetip="127.0.0.1" fi - # configip=$(grep -m 1 "serverip" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's///g' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//' | cut -f1 -d "<") - # ipsetinconfig=1 - # ipinconfigvar="serverip" + maxplayers=$(grep "ServerMaxPlayerCount" "${servercfgfullpath}" | tr -cd '[:digit:]') + gamemode=$(grep "GameMode" "${servercfgfullpath}" | sed 's/^.*value="//' | cut -f1 -d"\"") + gameworld=$(grep "GameWorld" "${servercfgfullpath}" | sed 's/^.*value="//' | cut -f1 -d"\"") # Not Set - port=${port:-"22003"} - httpport=${httpport:-"22005"} - ase=${ase:-"Disabled"} servername=${servername:-"NOT SET"} serverpassword=${serverpassword:-"NOT SET"} - maxplayers=${maxplayers:-"0"} + port=${port:-"0"} + queryport=${queryport:-"0"} + webadminenabled=${webadminenabled:-"NOT SET"} + webadminport=${webadminport:-"0"} + webadminpass=${webadminpass:-"NOT SET"} + telnetenabled=${telnetenabled:-"NOT SET"} + telnetport=${telnetport:-"0"} + telnetpass=${telnetpass:-"NOT SET"} + maxplayers=${maxplayers:-"NOT SET"} + gamemode=${gamemode:-"NOT SET"} + gameworld=${gameworld:-"NOT SET"} fi } -fn_info_config_wolfensteinenemyterritory(){ +fn_info_game_sof2(){ + # Config if [ ! -f "${servercfgfullpath}" ]; then rconpassword="${unavailable}" servername="${unavailable}" serverpassword="${unavailable}" maxplayers="${zero}" - port="${zero}" - queryport="${zero}" else - port=$(grep "set net_port" "${servercfgfullpath}" | grep -v "//" | tr -cd '[:digit:]') - queryport="${port}" - 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]*$//') - maxplayers=$(grep "set sv_maxclients" "${servercfgfullpath}" | grep -v "//" | tr -cd '[:digit:]') - - configip=$(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" + rconpassword=$(grep "rconpassword" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set rconpassword//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]*$//') + maxplayers=$(grep "sv_maxclients" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') # Not Set rconpassword=${rconpassword:-"NOT SET"} servername=${servername:-"NOT SET"} serverpassword=${serverpassword:-"NOT SET"} maxplayers=${maxplayers:-"0"} - port=${port:-"27960"} - queryport=${queryport:-"27960"} fi + + # Parameters + port=${port:-"0"} + queryport=${port:-"0"} + defaultmap=${defaultmap:-"NOT SET"} } -fn_info_config_etlegacy(){ +fn_info_game_sol(){ if [ ! -f "${servercfgfullpath}" ]; then - rconpassword="${unavailable}" - servername="${unavailable}" - serverpassword="${unavailable}" - maxplayers="${zero}" + adminpassword="${unavailable}" + maxplayers="${unavailable}" port="${zero}" queryport="${zero}" + servername="${unavailable}" + serverpassword="${unavailable}" else - port=$(grep "set net_port" "${servercfgfullpath}" | grep -v "//" | tr -cd '[:digit:]') + adminpassword=$(grep "Admin_Password=" "${servercfgfullpath}" | awk -F '=' '{print $2}') + maxplayers=$(grep "Max_Players=" "${servercfgfullpath}" | tr -cd '[:digit:]') + port=$(grep "Port=" "${servercfgfullpath}" | tr -cd '[:digit:]') queryport="${port}" - rconpassword=$(grep "set rconpassword" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set rconpassword //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]*$//') - maxplayers=$(grep "set sv_maxclients" "${servercfgfullpath}" | grep -v "//" | tr -cd '[:digit:]') - - configip=$(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" + filesport=$((port+10)) + servername=$(grep "Server_Name=" "${servercfgfullpath}" | awk -F '=' '{print $2}') + serverpassword=$(grep "Game_Password=" "${servercfgfullpath}" | awk -F '=' '{print $2}') - # Not Set - rconpassword=${rconpassword:-"NOT SET"} + # Not set + adminpassword=${adminpassword:-"NOT SET"} + maxplayers=${maxplayers:-"0"} + port=${port:-"23073"} + queryport=${queryport:-"23083"} servername=${servername:-"NOT SET"} serverpassword=${serverpassword:-"NOT SET"} - maxplayers=${maxplayers:-"0"} - port=${port:-"27960"} - queryport=${queryport:-"27960"} fi } -fn_info_config_wurmunlimited(){ +fn_info_game_source(){ + # Config if [ ! -f "${servercfgfullpath}" ]; then - port="${zero}" - queryport="${zero}" - rconpassword="${unavailable}" servername="${unavailable}" serverpassword="${unavailable}" - adminpassword="${unavailable}" - maxplayers="${zero}" + rconpassword="${unavailable}" else - - port=$(grep "EXTERNALPORT=" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') - queryport=$(grep "QUERYPORT=" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') - 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 "SERVERPASSWORD=" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/SERVERPASSWORD//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - adminpassword=$(grep "ADMINPWD=" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/ADMINPWD//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - maxplayers=$(grep "MAXPLAYERS=" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') - - configip=$(grep "IP" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/IP//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - ipsetinconfig=1 - ipinconfigvar="IP" + 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 - port=${port:-"3724"} - queryport=${queryport:-"27017"} servername=${servername:-"NOT SET"} serverpassword=${serverpassword:-"NOT SET"} - adminpassword=${adminpassword:-"NOT SET"} - maxplayers=${maxplayers:-"0"} + rconpassword=${rconpassword:-"NOT SET"} fi + + # Parameters + defaultmap=${defaultmap:-"NOT SET"} + maxplayers=${maxplayers:-"0"} + port=${port:-"0"} + rconport=${port:-"0"} + queryport=${port:-"0"} + clientport=${clientport:-"0"} + # Steamport can be between 26901-26910 and is normaly automaticly set. + # Some servers might support -steamport parameter to set + if [ "${steamport}" == "0" ]||[ -z "${steamport}" ]; then + steamport="$(echo "${ssinfo}" | grep "${srcdslinuxpid}" | awk '{print $5}' | grep ":269" | cut -d ":" -f2)" + fi + steamport="${steamport:-"0"}" +} + +fn_info_game_spark(){ + defaultmap=${defaultmap:-"NOT SET"} + maxplayers=${maxplayers:-"0"} + port=${port:-"0"} + queryport=$((port+1)) + servername=${servername:-"NOT SET"} + serverpassword=${serverpassword:-"NOT SET"} + webadminuser=${webadminuser:-"NOT SET"} + webadminpass=${webadminpass:-"NOT SET"} + webadminport=${webadminport:-"0"} + # Commented out as displaying not set in details parameters + #mods=${mods:-"NOT SET"} } -fn_info_config_squad(){ +fn_info_game_squad(){ if [ ! -f "${servercfgfullpath}" ]; then servername="${unavailable}" maxplayers="${unavailable}" @@ -1389,7 +1559,8 @@ fn_info_config_squad(){ maxplayers=${maxplayers:-"0"} } -fn_info_config_stationeers(){ +fn_info_game_st(){ + # Config if [ ! -f "${servercfgfullpath}" ]; then servername="${unavailable}" serverpassword="${unavailable}" @@ -1407,165 +1578,379 @@ fn_info_config_stationeers(){ rconpassword=${rconpassword:-"NOT SET"} maxplayers=${maxplayers:-"0"} fi + + # Parameters + port=${port:-"0"} + queryport=${queryport:-"0"} + httpport=${port:-"0"} + worldtype=${worldtype:-"NOT SET"} + autosaveinterval=${autosaveinterval:-"0"} + clearinterval=${clearinterval:-"0"} + worldname=${worldname:-"NOT SET"} +} +fn_info_game_terraria(){ + if [ ! -f "${servercfgfullpath}" ]; then + servername="${unavailable}" + port="${zero}" + gameworld="${unavailable}" + maxplayers="${zero}" + queryport="${zero}" + else + 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:]') + queryport=${port:-"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]*$//') + maxplayers=$(grep "maxplayers" "${servercfgfullpath}" | grep -v "//" | tr -cd '[:digit:]') + + # Not Set + servername=${servername:-"NOT SET"} + port=${port:-"0"} + queryport=${queryport:-"0"} + gameworld=${gameworld:-"NOT SET"} + maxplayers=${maxplayers:-"0"} + fi +} + +fn_info_game_ts3(){ + if [ ! -f "${servercfgfullpath}" ]; then + dbplugin="${unavailable}" + port="9987" + queryport="10011" + querysshport="10022" + queryhttpport="10080" + queryhttpsport="10443" + fileport="30033" + telnetport="10011" + else + 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:]') + querysshport=$(grep "query_ssh_port" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') + queryhttpport=$(grep "query_http_port" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') + queryhttpsport=$(grep "query_https_port" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') + fileport=$(grep "filetransfer_port" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') + telnetport="${queryport}" + + configip=$(grep "voice_ip" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/voice_ip//g' | sed 's/,.*//' | tr -d '=\";,' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + ipsetinconfig=1 + ipinconfigvar="voice_ip" + + # Not Set + dbplugin=${dbplugin:-"NOT SET"} + port=${port:-"9987"} + queryport=${queryport:-"10011"} + querysshport=${querysshport:-"10022"} + queryhttpport=${queryhttpport:-"10080"} + queryhttpsport=${queryhttpsport:-"10443"} + fileport=${fileport:-"30033"} + telnetport=${telnetport:-"10011"} + fi } -fn_info_config_mordhau(){ +fn_info_game_tu(){ + # Config if [ ! -f "${servercfgfullpath}" ]; then servername="${unavailable}" + maxplayers="${zero}" + else + servername=$(grep "ServerTitle" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^--/d' -e 's/ServerTitle//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + maxplayers=$(grep "MaxPlayers" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') + + # Not Set + servername=${servername:-"NOT SET"} + maxplayers=${maxplayers:-"0"} + fi + + # Parameters + port=${port:-"0"} + steamport=$((port+1)) + queryport=${queryport:-"0"} +} + +fn_info_game_tw(){ + # Config + if [ ! -f "${servercfgfullpath}" ]; then + servername="unnamed server" serverpassword="${unavailable}" rconpassword="${unavailable}" - maxplayers="${unavailable}" + port="8303" + queryport="8303" + maxplayers="12" else - servername=$(grep "ServerName" "${servercfgfullpath}" | awk -F '=' '{print $2}') - serverpassword=$(grep "ServerPassword" "${servercfgfullpath}" | awk -F '=' '{print $2}') - rconpassword=$(grep "AdminPassword" "${servercfgfullpath}" | awk -F '=' '{print $2}') - maxplayers=$(grep "MaxSlots" "${servercfgfullpath}" | awk -F '=' '{print $2}') + 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:]') + queryport="${port}" + maxplayers=$(grep "sv_max_clients" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') - # Not set + # Not Set servername=${servername:-"NOT SET"} serverpassword=${serverpassword:-"NOT SET"} rconpassword=${rconpassword:-"NOT SET"} - maxplayers=${maxplayers:-"0"} + port=${port:-"8303"} + queryport=${port:-"8303"} + maxplayers=${maxplayers:-"12"} + fi + + # Parameters + queryport="${port:-"0"}" +} + +fn_info_game_unreal(){ + # Config + if [ ! -f "${servercfgfullpath}" ]; then + servername="${unavailable}" + serverpassword="${unavailable}" + adminpassword="${unavailable}" + port="${zero}" + queryport="${zero}" + queryportgs="${zero}" + webadminenabled="${unavailable}" + webadminport="${zero}" + webadminuser="${unavailable}" + webadminpass="${unavailable}" + else + servername=$(grep "ServerName" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/ServerName//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//'| sed 's/\r$//') + serverpassword=$(grep "GamePassword" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/GamePassword//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//'| sed 's/\r$//') + adminpassword=$(grep "AdminPassword" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/AdminPassword//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//'| sed 's/\r$//') + port=$(grep "Port" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' | grep "^Port" | grep -v "#" | tr -cd '[:digit:]') + queryport=$((port+1)) + queryportgs=$(grep "OldQueryPortNumber" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') + beaconport=$(grep "ServerBeaconPort" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') + webadminenabled=$(grep "bEnabled" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/bEnabled//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//'| sed 's/\r$//') + httpport=$(grep "ListenPort" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') + webadminuser=$(grep "AdminUsername" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/AdminUsername//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//'| sed 's/\r$//') + 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]*$//'| sed 's/\r$//') + + # Not Set + servername=${servername:-"NOT SET"} + serverpassword=${serverpassword:-"NOT SET"} + adminpassword=${adminpassword:-"NOT SET"} + port=${port:-"0"} + queryport=${queryport:-"0"} + beaconport=${beaconport:-"8777"} + queryportgs=${queryportgs:-"0"} + webadminenabled=${webadminenabled:-"NOT SET"} + webadminport=${webadminport:-"0"} + webadminuser=${webadminuser:-"NOT SET"} + webadminpass=${webadminpass:-"NOT SET"} + fi + + # Parameters + defaultmap=${defaultmap:-"NOT SET"} +} + +fn_info_game_unreal2(){ + # Config + if [ ! -f "${servercfgfullpath}" ]; then + servername="${unavailable}" + serverpassword="${unavailable}" + adminpassword="${unavailable}" + port="${zero}" + queryport="${zero}" + queryportgs="${zero}" + webadminenabled="${unavailable}" + webadminport="${zero}" + webadminuser="${unavailable}" + webadminpass="${unavailable}" + else + servername=$(sed -nr 's/^ServerName=(.*)$/\1/p' "${servercfgfullpath}" | tr -d '=\";,:' | sed 's/\r$//') + serverpassword=$(sed -nr 's/^GamePassword=(.*)$/\1/p' "${servercfgfullpath}" | tr -d '=\";,:' | sed 's/\r$//') + adminpassword=$(sed -nr 's/^AdminPassword=(.*)$/\1/p' "${servercfgfullpath}" | tr -d '=\";,:' | sed 's/\r$//') + port=$(sed -nr 's/^Port=(.*)$/\1/p' "${servercfgfullpath}" | tr -cd '[:digit:]') + queryport=$((port+1)) + queryportgs=$(sed -nr 's/^OldQueryPortNumber=(.*)$/\1/p' "${servercfgfullpath}" | tr -cd '[:digit:]') + webadminenabled=$(sed -nr 's/^bEnabled=(.*)$/\1/p' "${servercfgfullpath}" | tr -d '=\";,:' | sed 's/\r$//') + webadminport=$(sed -nr 's/^ListenPort=(.*)$/\1/p' "${servercfgfullpath}" | tr -cd '[:digit:]') + webadminuser=$(sed -nr 's/^AdminName=(.*)$/\1/p' "${servercfgfullpath}" | tr -d '=\";,:' | sed 's/\r$//') + webadminpass="${adminpassword}" + + # Not Set + servername=${servername:-"NOT SET"} + serverpassword=${serverpassword:-"NOT SET"} + adminpassword=${adminpassword:-"NOT SET"} + port=${port:-"0"} + queryport=${queryport:-"0"} + queryportgs=${queryportgs:-"0"} + webadminenabled=${webadminenabled:-"NOT SET"} + webadminport=${webadminport:-"0"} + webadminuser=${webadminuser:-"NOT SET"} + webadminpass=${webadminpass:-"NOT SET"} fi + + # Parameters + defaultmap=${defaultmap:-"NOT SET"} } +fn_info_game_unt(){ + servername=${selfname:-"NOT SET"} + port=${port:-"0"} + queryport=$((port+1)) +} -fn_info_config_avorion() { +fn_info_game_ut(){ + # Config if [ ! -f "${servercfgfullpath}" ]; then - maxplayers="${unavailable}" servername="${unavailable}" - serverpassword="${unavailable}" - rconpassword="${unavailable}" - rconport="${unavailable}" - rconenabled="${unavailable}" - queryport="${unavailable}" else - maxplayers=$(grep "maxPlayers=" "${servercfgfullpath}" | sed 's/maxPlayers=//') - servername=$(grep "name=" "${servercfgfullpath}" | sed 's/name=//') - serverpassword=$(grep "password=" "${servercfgfullpath}" | sed 's/password=//') - rconpassword=$(grep "rconPassword=" "${servercfgfullpath}" | sed 's/rconPassword=//') - rconport=$(grep "rconPort=" "${servercfgfullpath}" | sed 's/rconPort=//') - if [ -n "${rconpassword}" ]; then - rconenabled="true" - queryport="${rconport}" - fi + servername=$(grep "ServerName" "${servercfgfullpath}" | awk -F '=' '{print $2}') # Not set - maxplayers=${maxplayers:-"NOT SET"} servername=${servername:-"NOT SET"} - serverpassword=${serverpassword:-"NOT SET"} - rconpassword=${rconpassword:-"NOT SET"} - rconport=${rconport:-"0"} - rconenabled=${rconenabled:-"false"} - queryport=${queryport:-"0"} fi + + # Parameters + port=${port:-"0"} + queryport=$((port+1)) } -fn_info_config_soldat(){ +fn_info_game_ut2k4(){ if [ ! -f "${servercfgfullpath}" ]; then + servername="${unavailable}" + serverpassword="${unavailable}" adminpassword="${unavailable}" - maxplayers="${unavailable}" port="${zero}" queryport="${zero}" - servername="${unavailable}" - serverpassword="${unavailable}" + queryportgs="${zero}" + lanport="${zero}" + webadminenabled="${unavailable}" + httpport="${zero}" + webadminuser="${unavailable}" + webadminpass="${unavailable}" else - adminpassword=$(grep "Admin_Password=" "${servercfgfullpath}" | awk -F '=' '{print $2}') - maxplayers=$(grep "Max_Players=" "${servercfgfullpath}" | tr -cd '[:digit:]') - port=$(grep "Port=" "${servercfgfullpath}" | tr -cd '[:digit:]') - queryport="${port}" - servername=$(grep "Server_Name=" "${servercfgfullpath}" | awk -F '=' '{print $2}') - serverpassword=$(grep "Game_Password=" "${servercfgfullpath}" | awk -F '=' '{print $2}') + servername=$(sed -nr 's/^ServerName=(.*)$/\1/p' "${servercfgfullpath}" | tr -d '=\";,:' | sed 's/\r$//') + serverpassword=$(sed -nr 's/^GamePassword=(.*)$/\1/p' "${servercfgfullpath}" | tr -d '=\";,:' | sed 's/\r$//') + adminpassword=$(sed -nr 's/^AdminPassword=(.*)$/\1/p' "${servercfgfullpath}" | tr -d '=\";,:' | sed 's/\r$//') + port=$(sed -nr 's/^Port=(.*)$/\1/p' "${servercfgfullpath}" | tr -cd '[:digit:]') + queryport=$((port+1)) + queryportgs=$(sed -nr 's/^OldQueryPortNumber=(.*)$/\1/p' "${servercfgfullpath}" | tr -cd '[:digit:]') + lanport=$(grep "LANServerPort=" "${servercfgfullpath}" | tr -cd '[:digit:]') + webadminenabled=$(sed -nr 's/^bEnabled=(.*)$/\1/p' "${servercfgfullpath}" | tr -d '=\";,:' | sed 's/\r$//') + httpport=$(sed -nr 's/^ListenPort=(.*)$/\1/p' "${servercfgfullpath}" | tr -cd '[:digit:]') + webadminuser=$(sed -nr 's/^AdminName=(.*)$/\1/p' "${servercfgfullpath}" | tr -d '=\";,:' | sed 's/\r$//') + webadminpass="${adminpassword}" - # Not set - adminpassword=${adminpassword:-"NOT SET"} - maxplayers=${maxplayers:-"0"} - port=${port:-"23073"} - queryport=${queryport:-"23083"} + # Not Set servername=${servername:-"NOT SET"} serverpassword=${serverpassword:-"NOT SET"} + adminpassword=${adminpassword:-"NOT SET"} + port=${port:-"0"} + queryport=${queryport:-"0"} + queryportgs=${queryportgs:-"0"} + lanport=${lanport:-"0"} + webadminenabled=${webadminenabled:-"NOT SET"} + httpport=${httpport:-"0"} + webadminuser=${webadminuser:-"NOT SET"} + webadminpass=${webadminpass:-"NOT SET"} fi } -fn_info_config_pavlovvr(){ +fn_info_game_ut3(){ + # Config if [ ! -f "${servercfgfullpath}" ]; then servername="${unavailable}" + serverpassword="${unavailable}" + adminpassword="${unavailable}" maxplayers="${unavailable}" + webadminenabled="${unavailable}" + webadminport="${zero}" + webadminuser="${unavailable}" + webadminpass="${unavailable}" else - servername=$(grep "ServerName" "${servercfgfullpath}" | awk -F '=' '{print $2}') - maxplayers=$(grep "MaxPlayers" "${servercfgfullpath}" | awk -F '=' '{print $2}') + 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]*$//') + maxplayers=$(grep "MaxPlayers" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') + webadminenabled=$(grep "bEnabled" "${servercfgdir}/UTWeb.ini" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/bEnabled//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + webadminport=$(grep "ListenPort" "${servercfgdir}/UTWeb.ini" | grep -v "#" | tr -cd '[:digit:]') + webadminuser="Admin" + webadminpass=$(grep "AdminPassword" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/AdminPassword//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - # Not set + # Not Set servername=${servername:-"NOT SET"} - maxplayers=${maxplayers:-"0"} + serverpassword=${serverpassword:-"NOT SET"} + adminpassword=${adminpassword:-"NOT SET"} + maxplayers=${maxplayers:-"NOT SET"} + webadminenabled=${webadminenabled:-"NOT SET"} + webadminport=${webadminport:-"0"} + webadminuser=${webadminuser:-"NOT SET"} + webadminpass=${webadminpass:-"NOT SET"} fi -} -fn_info_config_col(){ - if [ -f "${servercfgfullpath}" ]; then - servername=$(jq -r '.ServerSettings.ServerName' "${servercfgfullpath}") - serverpassword=$(jq -r '.ServerSettings.ServerPassword' "${servercfgfullpath}") - maxplayers=$(jq -r '.ServerSettings.MaxPlayerCount' "${servercfgfullpath}") - port=$(jq -r '.ServerSettings.ServerGamePort' "${servercfgfullpath}") - steamport=$(jq -r '.ServerSettings.ServerSteamPort' "${servercfgfullpath}") - rconpassword=$(jq -r '.ServerSettings.RCONPassword' "${servercfgfullpath}") - configip=$(jq -r '.ServerSettings.ServerIP' "${servercfgfullpath}") + # Parameters + port=${port:-"0"} + queryport=${queryport:-"0"} + defaultmap=${defaultmap:-"NOT SET"} +} - # password not set - serverpassword=${serverpassword:-"NOT SET"} - queryport=${port:-"0"} +fn_info_game_vh(){ + port=${port:-"0"} + if [ "${public}" != "0" ]; then + queryport=$((port+1)) else - servername=${servername:-"NOT SET"} - serverpassword=${serverpassword:-"NOT SET"} - maxplayers=${maxplayers:-"0"} - port=${port:-"27004"} - steamport=${steamport:-"27005"} - rconpassword=${rconpassword:-"NOT SET"} + querymode="1" fi + gameworld=${gameworld:-"NOT SET"} + serverpassword=${serverpassword:-"NOT SET"} + servername=${servername:-"NOT SET"} } -fn_info_config_vintagestory(){ +fn_info_game_wet(){ if [ ! -f "${servercfgfullpath}" ]; then + rconpassword="${unavailable}" servername="${unavailable}" - maxplayers="${unavailable}" serverpassword="${unavailable}" - port="${unavailable}" - queryport="${unavailable}" - configip="${unavailable}" + maxplayers="${zero}" + port="${zero}" + queryport="${zero}" else - servername=$(jq -r '.ServerName' "${servercfgfullpath}") - maxplayers=$(jq -r '.MaxClients' "${servercfgfullpath}") - serverpassword=$(jq -r 'select(.Password != null) | .Password' "${servercfgfullpath}") - port=$(jq -r '.Port' "${servercfgfullpath}") - queryport=${port:-"0"} - configip=$(jq -r 'select(.Ip != null) | .Ip' "${servercfgfullpath}") + port=$(grep "set net_port" "${servercfgfullpath}" | grep -v "//" | tr -cd '[:digit:]') + queryport="${port}" + 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]*$//') + maxplayers=$(grep "set sv_maxclients" "${servercfgfullpath}" | grep -v "//" | tr -cd '[:digit:]') + + configip=$(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"} - configip=${configip:-"0.0.0.0"} + maxplayers=${maxplayers:-"0"} + port=${port:-"27960"} + queryport=${queryport:-"27960"} fi } -fn_info_config_scpsl(){ - if [ -f "${servercfgfullpath}" ]; then - servername=$(sed -nr 's/^server_name: (.*)$/\1/p' "${servercfgfullpath}") - maxplayers=$(sed -nr 's/^max_players: (.*)$/\1/p' "${servercfgfullpath}") - configip=$(sed -nr 's/^ipv4_bind_ip: (.*)$/\1/p' "${servercfgfullpath}") - tickrate=$(sed -nr 's/^server_tickrate: (.*)$/\1/p' "${servercfgfullpath}") - adminpassword=$(sed -nr 's/^administrator_query_password: (.*)$/\1/p' "${servercfgfullpath}") - - if [ "${adminpassword}" == "none" ]; then - adminpassword="NOT SET" - fi +fn_info_game_wf(){ + # Config + if [ ! -f "${servercfgfullpath}" ]; then + rconpassword="${unavailable}" + servername="${unavailable}" + maxplayers="${zero}" else + rconpassword=$(grep "rcon_password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set 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]*$//') + maxplayers=$(grep "sv_maxclients" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') + + # Not Set + rconpassword=${rconpassword:-"NOT SET"} servername=${servername:-"NOT SET"} maxplayers=${maxplayers:-"0"} - configip=${configip:-"0.0.0.0"} - tickrate=${tickrate:-"NOT SET"} - adminpassword=${adminpassword:-"NOT SET"} fi + + # Parameters + port=${port:-"0"} + queryport="${port:-"0"}" + webadminport=${webadminport:-"0"} } -fn_info_config_waterfall(){ + +fn_info_game_wmc(){ if [ -f "${servercfgfullpath}" ]; then servername=$(sed -e '/^listeners:/,/^[a-z]/!d' "${servercfgfullpath}" | sed -nr 's/^[ ]+motd: (.*)$/\1/p' | tr -d "'" | sed 's/&1//') queryport=$(sed -nr 's/^[ -]+query_port: ([0-9]+)/\1/p' "${servercfgfullpath}") @@ -1587,132 +1972,183 @@ fn_info_config_waterfall(){ fi } +fn_info_game_wurm(){ + if [ ! -f "${servercfgfullpath}" ]; then + port="${zero}" + queryport="${zero}" + rconpassword="${unavailable}" + servername="${unavailable}" + serverpassword="${unavailable}" + adminpassword="${unavailable}" + maxplayers="${zero}" + else + + port=$(grep "EXTERNALPORT=" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') + queryport=$(grep "QUERYPORT=" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') + 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 "SERVERPASSWORD=" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/SERVERPASSWORD//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + adminpassword=$(grep "ADMINPWD=" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/ADMINPWD//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + maxplayers=$(grep "MAXPLAYERS=" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') + + configip=$(grep "IP" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/IP//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + ipsetinconfig=1 + ipinconfigvar="IP" + + # Not Set + port=${port:-"3724"} + queryport=${queryport:-"27017"} + servername=${servername:-"NOT SET"} + serverpassword=${serverpassword:-"NOT SET"} + adminpassword=${adminpassword:-"NOT SET"} + maxplayers=${maxplayers:-"0"} + fi +} + +unavailable="${red}UNAVAILABLE${default}" +zero="${red}0${default}" + if [ "${shortname}" == "ac" ]; then - fn_info_config_assettocorsa + fn_info_game_ac elif [ "${shortname}" == "ark" ]; then - fn_info_config_ark + fn_info_game_ark +elif [ "${shortname}" == "arma3" ]; then + fn_info_game_arma3 elif [ "${shortname}" == "av" ]; then - fn_info_config_avorion + fn_info_game_av +elif [ "${shortname}" == "bf1942" ]; then + fn_info_game_bf1942 +elif [ "${shortname}" == "bfv" ]; then + fn_info_game_bfv elif [ "${shortname}" == "bo" ]; then - fn_info_config_ballistic_overkill + fn_info_game_bo elif [ "${shortname}" == "bt" ]; then - fn_info_config_barotrauma + fn_info_game_bt elif [ "${shortname}" == "bt1944" ]; then - fn_info_config_battalion1944 -elif [ "${shortname}" == "bf1942" ]; then - fn_info_config_bf1942 -elif [ "${shortname}" == "bfv" ]; then - fn_info_config_bfv + fn_info_game_bt1944 elif [ "${shortname}" == "cmw" ]; then - fn_info_config_chivalry + fn_info_game_cmw elif [ "${shortname}" == "cod" ]||[ "${shortname}" == "coduo" ]; then - fn_info_config_cod + fn_info_game_cod elif [ "${shortname}" == "cod2" ]; then - fn_info_config_cod2 + fn_info_game_cod2 elif [ "${shortname}" == "cod4" ]; then - fn_info_config_cod4 + fn_info_game_cod4 elif [ "${shortname}" == "codwaw" ]; then - fn_info_config_codwaw + fn_info_game_codwaw elif [ "${shortname}" == "col" ]; then - fn_info_config_col + fn_info_game_col elif [ "${shortname}" == "dst" ]; then - fn_info_config_dontstarve + fn_info_game_dst elif [ "${shortname}" == "eco" ]; then - fn_info_config_eco + fn_info_game_eco +elif [ "${shortname}" == "etl" ]; then + fn_info_game_etl elif [ "${shortname}" == "fctr" ]; then - fn_info_config_factorio + fn_info_game_fctr +elif [ "${shortname}" == "hw" ]; then + fn_info_game_hw +elif [ "${shortname}" == "inss" ]; then + fn_info_game_inss elif [ "${shortname}" == "jc2" ]; then - fn_info_config_justcause2 + fn_info_game_jc2 elif [ "${shortname}" == "jc3" ]; then - fn_info_config_justcause3 -elif [ "${shortname}" == "kf2" ]; then - fn_info_config_kf2 -elif [ "${shortname}" == "mohaa" ]; then - fn_info_config_mohaa -elif [ "${shortname}" == "mofm" ]; then - fn_info_config_mofm -elif [ "${shortname}" == "qw" ]; then - fn_info_config_quakeworld -elif [ "${shortname}" == "q2" ]; then - fn_info_config_quake2 -elif [ "${shortname}" == "q3" ]; then - fn_info_config_quake3 -elif [ "${shortname}" == "ql" ]; then - fn_info_config_quakelive + fn_info_game_jc3 elif [ "${shortname}" == "jk2" ]; then - fn_info_config_jk2 + fn_info_game_jk2 +elif [ "${shortname}" == "kf" ]; then + fn_info_game_kf +elif [ "${shortname}" == "kf2" ]; then + fn_info_game_kf2 elif [ "${shortname}" == "mc" ]||[ "${shortname}" == "pmc" ]; then - fn_info_config_minecraft + fn_info_game_mc elif [ "${shortname}" == "mcb" ]; then - fn_info_config_minecraft_bedrock + fn_info_game_mcb +elif [ "${shortname}" == "mh" ]; then + fn_info_game_mh +elif [ "${shortname}" == "mohaa" ]; then + fn_info_game_mohaa +elif [ "${shortname}" == "mom" ]; then + fn_info_game_mom +elif [ "${shortname}" == "mta" ]; then + fn_info_game_mta +elif [ "${shortname}" == "mumble" ]; then + fn_info_game_mumble elif [ "${shortname}" == "onset" ]; then - fn_info_config_onset -elif [ "${shortname}" == "pstbs" ]; then - fn_info_config_pstbs + fn_info_game_onset elif [ "${shortname}" == "pc" ]; then - fn_info_config_projectcars + fn_info_game_pc +elif [ "${shortname}" == "pstbs" ]; then + fn_info_game_pstbs +elif [ "${shortname}" == "pvr" ];then + fn_info_game_pvr elif [ "${shortname}" == "pz" ]; then - fn_info_config_projectzomboid -elif [ "${shortname}" == "arma3" ]; then - fn_info_config_realvirtuality + fn_info_game_pz +elif [ "${shortname}" == "q2" ]; then + fn_info_game_q2 +elif [ "${shortname}" == "q3" ]; then + fn_info_game_q3 +elif [ "${shortname}" == "ql" ]; then + fn_info_game_ql +elif [ "${shortname}" == "qw" ]; then + fn_info_game_qw +elif [ "${shortname}" == "ro" ]; then + fn_info_game_ro elif [ "${shortname}" == "rtcw" ]; then - fn_info_config_rtcw + fn_info_game_rtcw +elif [ "${shortname}" == "rust" ]; then + fn_info_game_rust elif [ "${shortname}" == "rw" ]; then - fn_info_config_risingworld -elif [ "${shortname}" == "sol" ]; then - fn_info_config_soldat -elif [ "${shortname}" == "sof2" ]; then - fn_info_config_sof2 -elif [ "${engine}" == "source" ]||[ "${engine}" == "goldsrc" ]; then - fn_info_config_source -elif [ "${shortname}" == "sb" ]; then - fn_info_config_starbound -elif [ "${shortname}" == "ts3" ]; then - fn_info_config_teamspeak3 -elif [ "${shortname}" == "mumble" ]; then - fn_info_config_mumble + fn_info_game_rw elif [ "${shortname}" == "samp" ]; then - fn_info_config_samp -elif [ "${shortname}" == "pstbs" ]; then - fn_info_config_sbots -elif [ "${shortname}" == "tw" ]; then - fn_info_config_teeworlds -elif [ "${shortname}" == "terraria" ]; then - fn_info_config_terraria -elif [ "${shortname}" == "tu" ]; then - fn_info_config_towerunite -elif [ "${engine}" == "unreal" ]; then - fn_info_config_unreal -elif [ "${engine}" == "unreal2" ]; then - fn_info_config_unreal2 -elif [ "${engine}" == "unreal3" ]; then - fn_info_config_unreal3 -elif [ "${shortname}" == "ut" ]; then - fn_info_config_ut + fn_info_game_samp +elif [ "${shortname}" == "sb" ]; then + fn_info_game_sb +elif [ "${shortname}" == "sbots" ]; then + fn_info_game_sbots elif [ "${shortname}" == "scpsl" ]||[ "${shortname}" == "scpslsm" ]; then - fn_info_config_scpsl + fn_info_game_scpsl elif [ "${shortname}" == "sdtd" ]; then - fn_info_config_sdtd -elif [ "${shortname}" == "wet" ]; then - fn_info_config_wolfensteinenemyterritory -elif [ "${shortname}" == "wf" ]; then - fn_info_config_warfork -elif [ "${shortname}" == "etl" ]; then - fn_info_config_etlegacy -elif [ "${shortname}" == "wurm" ]; then - fn_info_config_wurmunlimited -elif [ "${shortname}" == "mta" ]; then - fn_info_config_mta + fn_info_game_sdtd +elif [ "${shortname}" == "sof2" ]; then + fn_info_game_sof2 +elif [ "${shortname}" == "sol" ]; then + fn_info_game_sol +elif [ "${engine}" == "spark" ]; then + fn_info_game_spark elif [ "${shortname}" == "squad" ]; then - fn_info_config_squad + fn_info_game_squad elif [ "${shortname}" == "st" ]; then - fn_info_config_stationeers -elif [ "${shortname}" == "mh" ]; then - fn_info_config_mordhau -elif [ "${shortname}" == "pvr" ];then - fn_info_config_pavlovvr + fn_info_game_st +elif [ "${shortname}" == "terraria" ]; then + fn_info_game_terraria +elif [ "${shortname}" == "tu" ]; then + fn_info_game_tu +elif [ "${shortname}" == "tw" ]; then + fn_info_game_tw +elif [ "${shortname}" == "unt" ]; then + fn_info_game_unt +elif [ "${shortname}" == "ut" ]; then + fn_info_game_ut +elif [ "${shortname}" == "ut2k4" ]; then + fn_info_game_ut2k4 +elif [ "${shortname}" == "ut3" ]; then + fn_info_game_ut3 +elif [ "${shortname}" == "vh" ]; then + fn_info_game_vh elif [ "${shortname}" == "vints" ]; then - fn_info_config_vintagestory + fn_info_game_vints +elif [ "${shortname}" == "wet" ]; then + fn_info_game_wet +elif [ "${shortname}" == "wf" ]; then + fn_info_game_wf elif [ "${shortname}" == "wmc" ]; then - fn_info_config_waterfall + fn_info_game_wmc +elif [ "${shortname}" == "wurm" ]; then + fn_info_game_wurm +elif [ "${engine}" == "source" ]||[ "${engine}" == "goldsrc" ]; then + fn_info_game_source +elif [ "${engine}" == "unreal" ]; then + fn_info_game_unreal +elif [ "${engine}" == "unreal2" ]; then + fn_info_game_unreal2 fi diff --git a/lgsm/functions/info_messages.sh b/lgsm/functions/info_messages.sh index d2ef50586..f68d12e4f 100755 --- a/lgsm/functions/info_messages.sh +++ b/lgsm/functions/info_messages.sh @@ -92,7 +92,7 @@ fn_info_message_distro(){ echo -e "${lightyellow}Distro Details${default}" fn_messages_separator { - echo -e "${lightblue}Date:\t${default}${date}" + echo -e "${lightblue}Date:\t${default}$(date)" echo -e "${lightblue}Distro:\t${default}${distroname}" echo -e "${lightblue}Arch:\t${default}${arch}" echo -e "${lightblue}Kernel:\t${default}${kernel}" @@ -637,7 +637,7 @@ fn_info_message_commandlineparms(){ echo -e "${preexecutable} ${executable} ${startparameters}" } -fn_info_message_ports(){ +fn_info_message_ports_edit(){ # # Ports # ================================= @@ -650,18 +650,18 @@ fn_info_message_ports(){ startparameterslocation="${red}UNKNOWN${default}" # engines/games that require editing in the config file. - local ports_edit_array=( "avalanche2.0" "avalanche3.0" "Ballistic Overkill" "Barotrauma" "dontstarve" "Eco" "idtech2" "idtech3" "idtech3_ql" "lwjgl2" "Minecraft Bedrock" "Project Cars" "projectzomboid" "quake" "refractor" "realvirtuality" "renderware" "Stationeers" "teeworlds" "terraria" "unreal" "unreal2" "unreal3" "TeamSpeak 3" "Mumble" "7 Days To Die" "Vintage Story" "wurm") + local ports_edit_array=( "ac" "arma3" "bo" "bt" "dst" "eco" "idtech2" "idtech3" "idtech3_ql" "jc2" "jc3" "lwjgl2" "mcb" "mumble" "pc" "pz" "qw" "refractor" "renderware" "rw" "sb" "sdtd" "st" "ts3" "tw" "terraria" "unreal" "unreal2" "unreal3" "vints" "wurm") for port_edit in "${ports_edit_array[@]}"; do if [ "${shortname}" == "ut3" ]; then startparameterslocation="${servercfgdir}/UTWeb.ini" elif [ "${shortname}" == "kf2" ]; then startparameterslocation="${servercfgdir}/LinuxServer-KFEngine.ini\n${servercfgdir}/KFWeb.ini" - elif [ "${engine}" == "${port_edit}" ]||[ "${gamename}" == "${port_edit}" ]; then + elif [ "${engine}" == "${port_edit}" ]||[ "${gamename}" == "${port_edit}" ]||[ "${shortname}" == "${port_edit}" ]; then startparameterslocation="${servercfgfullpath}" fi done # engines/games that require editing the start parameters. - local ports_edit_array=( "Avorion" "col" "goldsrc" "Factorio" "Hurtworld" "iw3.0" "ioquake3" "qfusion" "Rust" "scpsl" "scpslsm" "Soldat" "spark" "source" "starbound" "unreal4" "realvirtuality" "Unturned" "vh" ) + local ports_edit_array=( "av" "col" "fctr" "goldsrc" "hw" "iw3.0" "ioquake3" "qfusion" "rust" "scpsl" "scpslsm" "sol" "spark" "source" "unreal4" "arma3" "unt" "vh" ) for port_edit in "${ports_edit_array[@]}"; do if [ "${engine}" == "${port_edit}" ]||[ "${gamename}" == "${port_edit}" ]||[ "${shortname}" == "${port_edit}" ]; then startparameterslocation="${configdirserver}" @@ -669,7 +669,27 @@ fn_info_message_ports(){ done echo -e "${startparameterslocation}" echo -e "" +} + +fn_info_message_ports(){ echo -e "${lightblue}Useful port diagnostic command:${default}" + if [ "${shortname}" == "av" ]; then + echo -e "ss -tuplwn | grep AvorionServer" + elif [ "${shortname}" == "bf1942" ]; then + echo -e "ss -tuplwn | grep bf1942_lnxded" + elif [ "${shortname}" == "mc" ]||[ "${shortname}" == "pmc" ]||[ "${shortname}" == "rw" ]||[ "${shortname}" == "wmc" ]; then + echo -e "ss -tuplwn | grep java" + elif [ "${shortname}" == "terraria" ]; then + echo -e "ss -tuplwn | grep Main" + elif [ "${engine}" == "source" ]; then + echo -e "ss -tuplwn | grep srcds_linux" + elif [ "${engine}" == "goldsrc" ]; then + echo -e "ss -tuplwn | grep hlds_linux" + else + executableshort="$(echo "${executable//.\/}" | cut -c -15)" + echo -e "ss -tuplwn | grep ${executableshort}" + fi + echo -e "" } fn_info_message_statusbottom(){ @@ -728,477 +748,562 @@ fn_info_logs(){ # Engine/Game Specific details -fn_info_message_assettocorsa(){ - echo -e "netstat -atunp| grep acServer" - echo -e "" +# Function used to generate port info. by passing info to function. (Reduces repeating code) +# example output +# DESCRIPTION PORT PROTOCOL LISTEN +# Game 7777 udp 1 +# RAW UDP Socket 7778 udp 1 +# Query 27015 udp 1 +# RCON 27020 tcp 1 + +fn_port(){ + if [ "${1}" == "header" ]; then + echo -e "${lightblue}DESCRIPTION\tPORT\tPROTOCOL\tLISTEN${default}" + else + portname="${1}" + porttype="${2}" + portprotocol="${3}" + echo -e "${portname}\t${!porttype}\t${portprotocol}\t$(echo "${ssinfo}" | grep ${portprotocol} | grep ${!porttype} | wc -l)" + fi +} + +fn_info_message_ac(){ { - echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" - echo -e "> Game\tINBOUND\t${port}\tudp" - echo -e "> HTTP\tINBOUND\t${port}\tudp" + fn_port "header" + fn_port "Game" port udp + fn_port "Game" port tcp + fn_port "Query" queryport udp + fn_port "HTTP" httpport tcp } | column -s $'\t' -t } fn_info_message_ark(){ - echo -e "netstat -atunp | grep ShooterGame" - echo -e "" { - echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" - echo -e "> Game\tINBOUND\t${port}\tudp" - # Don't do arithmetics if ever the port wasn't a numeric value - if [ "${port}" -eq "${port}" ]; then - echo -e "> RAW\tINBOUND\t$((port+1))\tudp" - fi - echo -e "> Query\tINBOUND\t${queryport}\tudp" - echo -e "> RCON\tINBOUND\t${rconport}\ttcp" + fn_port "header" + fn_port "Game" port udp + fn_port "RAW UDP Socket" rawport udp + fn_port "Query" queryport udp + fn_port "RCON" rconport tcp } | column -s $'\t' -t } -fn_info_message_avorion() { - echo "netstat -atunp | grep Avorion" - echo -e "" +fn_info_message_arma3(){ { - echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL" - echo -e "> Game\tINBOUND\t${port}\tudp" - echo -e "> RCON\tINBOUND\t${rconport}\ttcp" + fn_port "header" + fn_port "Game" port udp + fn_port "Voice" voiceport udp + fn_port "Query Steam" queryport udp + fn_port "Steam Master" steammasterport udp + fn_port "Voice (unused)" voiceunusedport udp + fn_port "BattleEye" battleeyeport udp } | column -s $'\t' -t } -fn_info_message_ballisticoverkill(){ - echo -e "netstat -atunp | grep BODS.x86" - echo -e "" +fn_info_message_av(){ { - echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" - echo -e "> Game/RCON\tINBOUND\t${port}\tudp" - echo -e "> Query\tINBOUND\t${queryport}\tudp" + fn_port "header" + fn_port "Game" port udp + fn_port "Query" queryport udp + fn_port "Steam Master" steammasterport udp + fn_port "Steam Query" steamqueryport udp + fn_port "RCON" rconport tcp } | column -s $'\t' -t } -fn_info_message_battalion1944(){ - echo -e "netstat -atunp | grep BattalionServ" - echo -e "" +fn_info_message_bf1942(){ { - echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" - echo -e "> Game\tINBOUND\t${port}\tudp" - # Don't do arithmetics if ever the port wasn't a numeric value - # unconfirmed - http://wiki.battaliongame.com/Community_Servers#Firewalls_.2F_Port_Forwarding - if [ "${port}" -eq "${port}" ]; then - echo -e "> Steam\tINBOUND\t$((port+1))\tudp" - echo -e "> Unused\tINBOUND\t$((port+2))\ttcp" - fi - echo -e "> Query\tINBOUND\t${queryport}\tudp" + fn_port "header" + fn_port "Game" port udp + fn_port "Query" queryport udp } | column -s $'\t' -t } -fn_info_message_cod(){ - echo -e "netstat -atunp | grep cod_lnxded" - echo -e "" +fn_info_message_bfv(){ { - echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" - echo -e "> Game\tINBOUND\t${port}\tudp" + fn_port "header" + fn_port "Game" port udp + fn_port "Query" queryport udp } | column -s $'\t' -t } -fn_info_message_coduo(){ - echo -e "netstat -atunp | grep coduo_lnxded" - echo -e "" +fn_info_message_bo(){ { - echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" - echo -e "> Game\tINBOUND\t${port}\tudp" + fn_port "header" + fn_port "Game" port udp + fn_port "Query" queryport udp } | column -s $'\t' -t } -fn_info_message_chivalry(){ +fn_info_message_bt(){ + { + fn_port "header" + fn_port "Game" port udp + fn_port "Query" queryport udp + } | column -s $'\t' -t +} + +fn_info_message_bt1944(){ + { + fn_port "header" + fn_port "Game" port udp + fn_port "Query" queryport udp + fn_port "RCON" rconport tcp + } | column -s $'\t' -t +} + +fn_info_message_cmw(){ fn_info_message_password_strip - echo -e "netstat -atunp | grep UDKGame" - echo -e "" { - echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" - echo -e "> Game\tINBOUND\t${port}\tudp" - echo -e "> Query\tINBOUND\t${queryport}\tudp" - echo -e "> RCON\tINBOUND\t27960\ttcp" + fn_port "header" + fn_port "Game" port udp + fn_port "Query" queryport udp + fn_port "RCON" rconport tcp + } | column -s $'\t' -t +} + +fn_info_message_cod(){ + { + fn_port "header" + fn_port "Game" port udp + fn_port "Query" queryport udp + } | column -s $'\t' -t +} + +fn_info_message_coduo(){ + { + fn_port "header" + fn_port "Game" port udp + fn_port "Query" queryport udp } | column -s $'\t' -t } fn_info_message_cod2(){ - echo -e "netstat -atunp | grep cod2_lnxded" - echo -e "" { - echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" - echo -e "> Game\tINBOUND\t${port}\tudp" + fn_port "header" + fn_port "Game" port udp + fn_port "Query" queryport udp } | column -s $'\t' -t } fn_info_message_cod4(){ - echo -e "netstat -atunp" - echo -e "" { - echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" - echo -e "> Game\tINBOUND\t${port}\tudp" + fn_port "header" + fn_port "Game" port udp + fn_port "Query" queryport udp } | column -s $'\t' -t } fn_info_message_codwaw(){ - echo -e "netstat -atunp | grep codwaw_lnxded" - echo -e "" { - echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" - echo -e "> Game\tINBOUND\t${port}\tudp" + fn_port "header" + fn_port "Game" port udp + fn_port "Query" queryport udp + } | column -s $'\t' -t +} + +fn_info_message_col(){ + { + fn_port "header" + fn_port "Game" port udp + fn_port "Query" queryport tcp + fn_port "Steam" steamport tcp + } | column -s $'\t' -t +} + +fn_info_message_csgo(){ + { + fn_port "header" + fn_port "Game" port udp + fn_port "Query" queryport tcp + fn_port "RCON" rconport tcp + fn_port "SourceTV" sourcetvport udp + fn_port "Client" clientport udp } | column -s $'\t' -t } fn_info_message_dst(){ - echo -e "netstat -atunp | grep dontstarve" - echo -e "" { - echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" - echo -e "> Game: Server\tINBOUND\t${port}\tudp" - echo -e "> Game: Master\tINBOUND\t${masterport}\tudp" - echo -e "> Steam: Auth\tINBOUND\t${steamauthenticationport}\tudp" - echo -e "> Steam: Master\tINBOUND\t${steammasterserverport}\tudp" + fn_port "header" + fn_port "Game: Server" port udp + fn_port "Game: Master" masterport udp + fn_port "Steam: Auth" steamauthport udp + fn_port "Steam: Master" steammasterport udp } | column -s $'\t' -t } fn_info_message_eco(){ - echo -e "netstat -atunp | grep EcoServer" - echo -e "" { - echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" - echo -e "> Game\tINBOUND\t${port}\tudp" - echo -e "> Web Admin\tINBOUND\t${webadminport}\ttcp" + fn_port "header" + fn_port "Game" port udp + fn_port "Web Admin" webadminport tcp } | column -s $'\t' -t } - -fn_info_message_etlegacy(){ - echo -e "netstat -atunp | grep etlded" - echo -e "" +fn_info_message_etl(){ { - echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" - echo -e "> Game/Query\tINBOUND\t${port}\tudp" + fn_port "header" + fn_port "Game" port udp + fn_port "Query" queryport udp } | column -s $'\t' -t } -fn_info_message_factorio(){ - echo -e "netstat -atunp | grep factorio" - echo -e "" +fn_info_message_fctr(){ { - echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" - echo -e "> Game\tINBOUND\t${port}\tudp" - echo -e "> RCON\tINBOUND\t${rconport}\ttcp" + fn_port "header" + fn_port "Game" port udp + fn_port "RCON" rconport tcp } | column -s $'\t' -t } fn_info_message_goldsrc(){ - echo -e "netstat -atunp | grep hlds_linux" - echo -e "" { - echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" - echo -e "> Game/RCON\tINBOUND\t${port}\ttcp/udp" - echo -e "< Client\tOUTBOUND\t${clientport}\tudp" + fn_port "header" + fn_port "Game" port udp + fn_port "Client" clientport udp } | column -s $'\t' -t } -fn_info_message_hurtworld(){ - echo -e "netstat -atunp | grep Hurtworld" - echo -e "" +fn_info_message_hw(){ { - echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" - echo -e "> Game/RCON\tINBOUND\t${port}\tudp" - echo -e "> Query\tINBOUND\t${queryport}\tudp" + fn_port "header" + fn_port "Game" port udp + fn_port "Query" queryport udp + } | column -s $'\t' -t +} + +fn_info_message_ins(){ + { + fn_port "header" + fn_port "Game" port udp + fn_port "Query" queryport tcp + fn_port "RCON" rconport tcp + fn_port "SourceTV" sourcetvport udp + fn_port "Client" clientport udp } | column -s $'\t' -t } fn_info_message_inss(){ - echo -e "netstat -atunp | grep Insurgency" - echo -e "" { - echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" - echo -e "> Game\tINBOUND\t${port}\tudp" - echo -e "> Query\tINBOUND\t${queryport}\tudp" - if [ -n "${rconport}" ]; then - echo -e "> RCON\tINBOUND\t${rconport}\ttcp" - fi + fn_port "header" + fn_port "Game" port udp + fn_port "Query" queryport udp + fn_port "RCON" rconport tcp } | column -s $'\t' -t } - fn_info_message_jk2(){ - echo -e "netstat -atunp | grep jk2mvded" - echo -e "" - { - echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL" - echo -e "> Game\tINBOUND\t${port}\tudp" - } | column -s $'\t' -t - } +fn_info_message_jc2(){ + { + fn_port "header" + fn_port "Game" port udp + fn_port "Query" queryport udp + } | column -s $'\t' -t +} + +fn_info_message_jc3(){ + { + fn_port "header" + fn_port "Game" port udp + fn_port "Query" queryport udp + fn_port "Steam" steamport udp + fn_port "HTTP" httpport tcp + } | column -s $'\t' -t +} -fn_info_message_justcause2(){ - echo -e "netstat -atunp | grep Jcmp-Server" +fn_info_message_jk2(){ + { + fn_port "header" + fn_port "Game" port udp + } | column -s $'\t' -t +} + +fn_info_message_kf(){ + { + fn_port "header" + fn_port "Game" port udp + fn_port "Query" queryport udp + fn_port "Query (GameSpy)" queryportgs udp + fn_port "Web Admin" webadminport tcp + fn_port "LAN" lanport udp + fn_port "Steam" steamport udp + fn_port "Steam Master" steammasterport udp + } | column -s $'\t' -t echo -e "" + echo -e "${lightgreen}${servername} Web Admin${default}" + fn_messages_separator { - echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" - echo -e "> Game\tINBOUND\t${port}\tudp" + echo -e "${lightblue}Web Admin enabled:\t${default}${webadminenabled}" + echo -e "${lightblue}Web Admin url:\t${default}http://${webadminip}:${webadminport}" + echo -e "${lightblue}Web Admin username:\t${default}${webadminuser}" + echo -e "${lightblue}Web Admin password:\t${default}${webadminpass}" } | column -s $'\t' -t } -fn_info_message_justcause3(){ - echo -e "netstat -atunp | grep Server" +fn_info_message_kf2(){ + fn_info_message_password_strip + { + fn_port "header" + fn_port "Game" port udp + fn_port "Query" queryport udp + fn_port "Web Admin" webadminport tcp + } | column -s $'\t' -t echo -e "" + echo -e "${lightgreen}${servername} Web Admin${default}" + fn_messages_separator { - echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" - echo -e "> Game\tINBOUND\t${port}\tudp" - echo -e "> Query\tINBOUND\t${queryport}\tudp" - echo -e "> Steam\tINBOUND\t${steamport}\tudp" + echo -e "${lightblue}Web Admin enabled:\t${default}${webadminenabled}" + echo -e "${lightblue}Web Admin url:\t${default}http://${webadminip}:${webadminport}" + echo -e "${lightblue}Web Admin username:\t${default}${webadminuser}" + echo -e "${lightblue}Web Admin password:\t${default}${webadminpass}" } | column -s $'\t' -t } fn_info_message_lo(){ - echo -e "netstat -atunp | grep MistServer" - echo -e "" { - echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" - echo -e "> Game\tINBOUND\t${port}\tudp" - echo -e "> Query\tINBOUND\t${queryport}\tudp" + fn_port "header" + fn_port "Game" port udp + fn_port "Query" queryport udp } | column -s $'\t' -t } -fn_info_message_minecraft(){ - echo -e "netstat -atunp | grep java" - echo -e "" +fn_info_message_mc(){ { - echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" - echo -e "> Game\tINBOUND\t${port}\ttcp" - echo -e "> Query\tINBOUND\t${queryport}\tudp" - echo -e "> Rcon\tINBOUND\t${rconport}\ttcp" + fn_port "header" + fn_port "Game" port tcp + fn_port "Query" queryport udp + fn_port "RCON" rconport tcp } | column -s $'\t' -t } -fn_info_message_minecraft_bedrock(){ - echo -e "netstat -atunp | grep bedrock_serv" - echo -e "" +fn_info_message_mcb(){ { - echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" - echo -e "> Game\tINBOUND\t${port}\tudp" - echo -e "> Game\tINBOUND\t${port6}\tudp6" + fn_port "header" + fn_port "Game" port udp + fn_port "Game" portipv6 udp6 } | column -s $'\t' -t } -fn_info_message_onset(){ - echo -e "netstat -atunp | grep OnsetServer" - echo -e "" +fn_info_message_mh(){ { - echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" - echo -e "> Game\tINBOUND\t${port}\tudp" - echo -e "> Query\tINBOUND\t${queryport}\tudp" - echo -e "> HTTP\tINBOUND\t${httpport}\ttcp" + fn_port "header" + fn_port "Game" port udp + fn_port "Query" queryport udp + fn_port "Beacon" beaconport udp } | column -s $'\t' -t } fn_info_message_mohaa(){ - echo -e "netstat -atunp | grep mohaa_lnxded" - echo -e "" { - echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL" - echo -e "> Game\tINBOUND\t${port}\tudp" + fn_port "header" + fn_port "Game" port udp } | column -s $'\t' -t } fn_info_message_mom(){ - echo -e "netstat -atunp | grep MemoriesOfMar" - echo -e "" { - echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" - echo -e "> Game\tINBOUND\t${port}\tudp" - echo -e "> BeaconPort\tINBOUND\t${beaconport}\tudp" + fn_port "header" + fn_port "Game" port udp + fn_port "Beacon" beaconport udp } | column -s $'\t' -t } -fn_info_message_mumble(){ - echo -e "netstat -atunp | grep murmur" - echo -e "" +fn_info_message_mta(){ { - echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" - echo -e "> Voice\tINBOUND\t${port}\tudp" - echo -e "> ServerQuery\tINBOUND\t${port}\ttcp" + fn_port "header" + fn_port "Game" port udp + if [ "${ase}" == "Enabled" ]; then + fn_port "Query" queryport udp + fi + fn_port "HTTP" httpport tcp } | column -s $'\t' -t } -fn_info_message_pstbs(){ - echo -e "netstat -atunp | grep PostScriptum" - echo -e "" + +fn_info_message_mumble(){ { - echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" - echo -e "> Game\tINBOUND\t${port}\tudp" - echo -e "> Query\tINBOUND\t${queryport}\tudp" - echo -e "> RCON\tINBOUND\t${rconport}\ttcp" + fn_port "header" + fn_port "Voice" port udp + fn_port "Query" queryport tcp } | column -s $'\t' -t } -fn_info_message_projectcars(){ - echo -e "netstat -atunp | grep DedicatedS" - echo -e "" +fn_info_message_onset(){ { - echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" - echo -e "> Game\tINBOUND\t${port}\tudp" - echo -e "> Query\tINBOUND\t${queryport}\tudp" - echo -e "> Steam\tINBOUND\t${steamport}\tudp" + fn_port "header" + fn_port "Game" port udp + fn_port "Query" queryport udp + fn_port "HTTP" httpport tcp } | column -s $'\t' -t } -fn_info_message_projectzomboid(){ - echo -e "netstat -atunp | grep ProjectZomb" - echo -e "" +fn_info_message_pc(){ { - echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" - echo -e "> Game/Query\tINBOUND\t${port}\tudp" + fn_port "header" + fn_port "Game" port udp + fn_port "Query" queryport udp + fn_port "Steam" steamport udp } | column -s $'\t' -t } -fn_info_message_quake(){ - echo -e "netstat -atunp | grep mvdsv" - echo -e "" +fn_info_message_pstbs(){ { - echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" - echo -e "> Game\tINBOUND\t${port}\tudp" + fn_port "header" + fn_port "Game" port udp + fn_port "Query" queryport udp + fn_port "RCON" rconport tcp } | column -s $'\t' -t } -fn_info_message_quake2(){ - echo -e "netstat -atunp | grep quake2" - echo -e "" +fn_info_message_pvr(){ { - echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" - echo -e "> Game\tINBOUND\t${port}\tudp" + fn_port "header" + fn_port "Game" port udp + fn_port "Game" port tcp + fn_port "Game+400" port401 udp + fn_port "Query" queryport tcp } | column -s $'\t' -t } -fn_info_message_quake3(){ - echo -e "netstat -atunp | grep q3ded" - echo -e "" +fn_info_message_pz(){ { - echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" - echo -e "> Game\tINBOUND\t${port}\tudp" + fn_port "header" + fn_port "Game" port udp + fn_port "Query" queryport udp } | column -s $'\t' -t } -fn_info_message_quakelive(){ - echo -e "netstat -atunp | grep qzeroded" - echo -e "" - if [ -z "${port}" ]||[ -z "${rconport}" ]||[ -z "${statsport}" ]; then - echo -e "${red}ERROR!${default} Missing/commented ports in ${servercfg}." - echo -e "" - fi +fn_info_message_qw(){ { - echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" - echo -e "> Game/Query\tINBOUND\t${port}\tudp" - echo -e "> Rcon\tINBOUND\t${rconport}\tudp" - echo -e "> Stats\tINBOUND\t${statsport}\tudp" + fn_port "header" + fn_port "Game" port udp } | column -s $'\t' -t } -fn_info_message_arma3(){ - echo -e "netstat -atunp | grep arma3server" - echo -e "" - # Default port - if [ -z "${port}" ]; then - port="2302" - fi +fn_info_message_q2(){ { - echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" - echo -e "> Game\tINBOUND\t${port}\tudp" - # Don't do arithmetics if ever the port wasn't a numeric value - if [ "${port}" -eq "${port}" ]; then - echo -e "> Query Steam\tINBOUND\t$((port+1))\tudp" - echo -e "> Steam: Master traffic\tINBOUND\t$((port+2))\tudp" - echo -e "> Undocumented Port\tINBOUND\t$((port+3))\tudp" - fi + fn_port "header" + fn_port "Game" port udp } | column -s $'\t' -t } -fn_info_message_bf1942(){ - echo -e "netstat -atunp | grep bf1942_lnxd" - echo -e "" +fn_info_message_q3(){ { - echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" - echo -e "> Game/Query\tINBOUND\t${port}\tudp" - echo -e "> Query Steam\tINBOUND\t${queryport}\tudp" + fn_port "header" + fn_port "Game" port udp } | column -s $'\t' -t } -fn_info_message_bfv(){ - echo -e "netstat -atunp | grep bfv_linded" - echo -e "" +fn_info_message_ql(){ { - echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" - echo -e "> Game\tINBOUND\t${port}\tudp" - echo -e "> Query\tINBOUND\t${queryport}\tudp" + fn_port "header" + fn_port "Game" port udp + fn_port "Query" queryport udp + fn_port "RCON" rconport tcp + fn_port "Stats" statsport udp } | column -s $'\t' -t } -fn_info_message_risingworld(){ - echo -e "netstat -atunp | grep java" +fn_info_message_ro(){ + { + fn_port "header" + fn_port "Game" port udp + fn_port "Query" queryport udp + fn_port "Web Admin" webadminport tcp + fn_port "LAN" lanport udp + fn_port "Steam" steamport udp + fn_port "Steam Master" steammasterport udp + } | column -s $'\t' -t echo -e "" + echo -e "${lightgreen}${servername} Web Admin${default}" + fn_messages_separator { - echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" - echo -e "> Game/Query\tINBOUND\t${port}\ttcp/udp" - echo -e "> Query HTTP\tINBOUND\t${httpqueryport}\ttcp" - echo -e "> RCON\tINBOUND\t${rconport}\ttcp" + echo -e "${lightblue}Web Admin enabled:\t${default}${webadminenabled}" + echo -e "${lightblue}Web Admin url:\t${default}http://${webadminip}:${webadminport}" + echo -e "${lightblue}Web Admin username:\t${default}${webadminuser}" + echo -e "${lightblue}Web Admin password:\t${default}${webadminpass}" } | column -s $'\t' -t } fn_info_message_rtcw(){ - echo -e "netstat -atunp | grep iowolfded" - echo -e "" { - echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" - echo -e "> Game\tINBOUND\t${port}\tudp" + fn_port "header" + fn_port "Game" port udp } | column -s $'\t' -t } fn_info_message_rust(){ - echo -e "netstat -atunp | grep Rust" - echo -e "" { - echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" - echo -e "> Game/Query\tINBOUND\t${port}\tudp" - echo -e "> RCON\tINBOUND\t${rconport}\ttcp" - echo -e "> App\tINBOUND\t${appport}\ttcp" + fn_port "header" + fn_port "Game" port udp + fn_port "Query" queryport udp + fn_port "RCON" rconport tcp + fn_port "App" appport tcp + } | column -s $'\t' -t +} + +fn_info_message_rw(){ + { + fn_port "header" + fn_port "Game" port udp + fn_port "Game+1" port2 udp + fn_port "Game+2" port3 udp + fn_port "Game+3" port4 udp + fn_port "Game+1" port2 tcp + fn_port "Game+2" port3 tcp + fn_port "Game+3" port4 tcp + fn_port "Query" queryport tcp + fn_port "Query HTTP" httpqueryport tcp + fn_port "RCON" rconport tcp } | column -s $'\t' -t } fn_info_message_samp(){ - echo -e "netstat -atunp | grep samp03svr" - echo -e "" { - echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" - echo -e "> Game/RCON\tINBOUND\t${port}\ttcp/udp" + fn_port "header" + fn_port "Game" port udp + fn_port "RCON" rconport udp + } | column -s $'\t' -t +} + +fn_info_message_sb(){ + { + fn_port "header" + fn_port "Game" port udp + fn_port "Query" queryport tcp + fn_port "RCON" rconport tcp } | column -s $'\t' -t } fn_info_message_sbots(){ - echo -e "netstat -atunp | grep blank1" - echo -e "" { - echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" - echo -e "> Game\tINBOUND\t${port}\tudp" - echo -e "> Query\tINBOUND\t${queryport}\tudp" + fn_port "header" + fn_port "Game" port udp + fn_port "Query" queryport udp + } | column -s $'\t' -t +} + +fn_info_message_scpsl(){ + { + fn_port "header" + fn_port "Game" port tcp } | column -s $'\t' -t } fn_info_message_sdtd(){ fn_info_message_password_strip - echo -e "netstat -atunp | grep 7DaysToDie" - echo -e "" { - echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" - echo -e "> Game/RCON\tINBOUND\t${port}\tudp" - echo -e "> Query\tINBOUND\t${queryport}\tudp" - echo -e "> Web Admin\tINBOUND\t${webadminport}\ttcp" - echo -e "> Telnet\tINBOUND\t${telnetport}\ttcp" + fn_port "header" + fn_port "Game" port udp + fn_port "Game+2" port3 udp + fn_port "Query" queryport tcp + fn_port "Web Admin" webadminport tcp + fn_port "Telnet" telnetport tcp } | column -s $'\t' -t echo -e "" echo -e "${lightgreen}${gamename} Web Admin${default}" fn_messages_separator { echo -e "${lightblue}Web Admin enabled:\t${default}${webadminenabled}" - echo -e "${lightblue}Web Admin url:\t${default}http://${webadminip}:${webadminport}" + echo -e "${lightblue}Web Admin url:\t${default}http://${webadminip}:${webadminport}/index.html" + echo -e "${lightblue}Web Admin username:\t${default}${webadminuser}" echo -e "${lightblue}Web Admin password:\t${default}${webadminpass}" } | column -s $'\t' -t echo -e "" @@ -1212,37 +1317,44 @@ fn_info_message_sdtd(){ } fn_info_message_sof2(){ - echo -e "netstat -atunp | grep sof2ded" - echo -e "" { - echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" - echo -e "> Game/Query\tINBOUND\t${port}\tudp" + fn_port "header" + fn_port "Game" port udp + fn_port "Query" queryport udp } | column -s $'\t' -t } +fn_info_message_sol(){ + { + fn_port "header" + fn_port "Game" port udp + fn_port "Query" queryport udp + fn_port "Files" filesport tcp + } | column -s $'\t' -t +} fn_info_message_source(){ - echo -e "netstat -atunp | grep srcds_linux" - echo -e "" { - echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" - echo -e "> Game/RCON\tINBOUND\t${port}\ttcp/udp" - echo -e "> SourceTV\tINBOUND\t${sourcetvport}\tudp" - echo -e "< Client\tOUTBOUND\t${clientport}\tudp" + fn_port "header" + fn_port "Game" port udp + fn_port "Query" queryport tcp + fn_port "RCON" rconport tcp + fn_port "SourceTV" sourcetvport udp + # not manualy set by default more research needed + fn_port "Steam" steamport udp + fn_port "Client" clientport udp } | column -s $'\t' -t } fn_info_message_spark(){ fn_info_message_password_strip - echo -e "netstat -atunp | grep server_linux" - echo -e "" { - echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" - echo -e "> Game/RCON\tINBOUND\t${port}\tudp" - echo -e "> Query\tINBOUND\t${queryport}\tudp" - echo -e "> Web Admin\tINBOUND\t${webadminport}\ttcp" + fn_port "header" + fn_port "Game" port udp + fn_port "Query" queryport udp + fn_port "Web Admin" webadminport tcp } | column -s $'\t' -t echo -e "" - echo -e "${lightgreen}${servername} Web Admin${default}" + echo -e "${lightgreen}${gamename} Web Admin${default}" fn_messages_separator { echo -e "${lightblue}Web Admin url:\t${default}http://${webadminip}:${webadminport}/index.html" @@ -1252,107 +1364,75 @@ fn_info_message_spark(){ } fn_info_message_squad(){ - echo -e "netstat -atunp | grep SquadServer" - echo -e "" { - echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" - echo -e "> Game\tINBOUND\t${port}\tudp" - echo -e "> Query\tINBOUND\t${queryport}\tudp" - echo -e "> RCON\tINBOUND\t${rconport}\ttcp" + fn_port "header" + fn_port "Game" port udp + fn_port "Query" queryport udp + fn_port "RCON" rconport tcp } | column -s $'\t' -t } -fn_info_message_starbound(){ - echo -e "netstat -atunp | grep starbound" - echo -e "" +fn_info_message_st(){ { - echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" - echo -e "> Game\tINBOUND\t${port}\ttcp" - echo -e "> Query\tINBOUND\t${queryport}\ttcp" - echo -e "> RCON\tINBOUND\t${rconport}\ttcp" + fn_port "header" + fn_port "Game" port udp + fn_port "Query" queryport udp + fn_port "Web Admin" webadminport tcp } | column -s $'\t' -t -} - -fn_info_message_stationeers(){ - echo -e "netstat -atunp | grep rocketstation" echo -e "" + echo -e "${lightgreen}${gamename} Web Admin${default}" + fn_messages_separator { - echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" - echo -e "> Game\tINBOUND\t${port}\ttcp" - echo -e "> Query\tINBOUND\t${queryport}\ttcp" + echo -e "${lightblue}Web Admin url:\t${default}http://${webadminip}:${webadminport}" } | column -s $'\t' -t } -fn_info_message_teamspeak3(){ - echo -e "netstat -atunp | grep ts3server" - echo -e "" +fn_info_message_ts3(){ { - echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" - echo -e "> Voice\tINBOUND\t${port}\tudp" - echo -e "> ServerQuery\tINBOUND\t${queryport}\ttcp" - echo -e "> File transfer\tINBOUND\t${fileport}\ttcp" + fn_port "header" + fn_port "Voice" port udp + fn_port "Query" queryport tcp + fn_port "Query (SSH)" querysshport tcp + fn_port "Query (http)" queryhttpport tcp + fn_port "Query (https)" queryhttpsport tcp + fn_port "File Transfer" fileport tcp + fn_port "Telnet" telnetport tcp } | column -s $'\t' -t } -fn_info_message_teeworlds(){ - echo -e "netstat -atunp | grep teeworlds" - echo -e "" +fn_info_message_tw(){ { - echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" - echo -e "> Game\Query\tINBOUND\t${port}\ttcp" + fn_port "header" + fn_port "Game" port udp + fn_port "Query" queryport udp } | column -s $'\t' -t } fn_info_message_terraria(){ - echo -e "netstat -atunp | grep Terraria" - echo -e "" { - echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" - echo -e "> Game\tINBOUND\t${port}\ttcp" + fn_port "header" + fn_port "Game" port tcp + fn_port "Query" queryport tcp } | column -s $'\t' -t } -fn_info_message_towerunite(){ - echo -e "netstat -atunp | grep TowerServer" - echo -e "" +fn_info_message_tu(){ { - echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" - echo -e "> Game\tINBOUND\t${port}\ttcp" - # Don't do arithmetics if ever the port wasn't a numeric value - if [ "${port}" -eq "${port}" ]; then - echo -e "> Steam\tINBOUND\t$((port+1))\tudp" - fi - echo -e "> Query\tINBOUND\t${queryport}\tudp" + fn_port "header" + fn_port "Game" port udp + fn_port "Query" queryport udp + fn_port "Steam" steamport udp } | column -s $'\t' -t } fn_info_message_unreal(){ fn_info_message_password_strip - echo -e "netstat -atunp | grep ucc-bin" - echo -e "" { - echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL\tINI VARIABLE" - echo -e "> Game\tINBOUND\t${port}\tudp\tPort=${port}" - echo -e "> Query\tINBOUND\t${queryport}\tudp" - if [ "${engine}" == "unreal" ]; then - echo -e "< UdpLink Port (random)\tOUTBOUND\t${udplinkport}+\tudp" - fi - if [ "${engine}" != "unreal" ]&&[ "${appid}" != "223250" ]; then - echo -e "> Query (GameSpy)\tINBOUND\t${queryportgs}\tudp\tOldQueryPortNumber=${queryportgs}" - fi - if [ "${appid}" == "215360" ]; then - echo -e "< Master server\tOUTBOUND\t28852\ttcp/udp" - else - echo -e "< Master server\tOUTBOUND\t28900/28902\ttcp/udp" - fi - if [ "${appid}" ]; then - if [ "${appid}" == "223250" ]; then - echo -e "> Steam\tINBOUND\t20610\tudp" - else - echo -e "> Steam\tINBOUND\t20660\tudp" - fi - fi - echo -e "> Web Admin\tINBOUND\t${webadminport}\ttcp\tListenPort=${webadminport}" + fn_port "header" + fn_port "Game" port udp + fn_port "Query" queryport udp + fn_port "LAN Beacon" beaconport udp + fn_port "Web Admin" webadminport tcp } | column -s $'\t' -t echo -e "" echo -e "${lightgreen}${servername} Web Admin${default}" @@ -1365,18 +1445,14 @@ fn_info_message_unreal(){ } | column -s $'\t' -t } -fn_info_message_unreal2(){ - fn_info_message_password_strip - echo -e "netstat -atunp | grep ucc-bin" - echo -e "" +fn_info_message_ut2k4(){ { - echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL\tINI VARIABLE" - echo -e "> Game\tINBOUND\t${port}\tudp\tPort=${port}" - echo -e "> Query\tINBOUND\t${queryport}\tudp" - if [ "${appid}" != "223250" ]; then - echo -e "> Query (GameSpy)\tINBOUND\t${queryportgs}\tudp\tOldQueryPortNumber=${queryportgs}" - fi - echo -e "> Web Admin\tINBOUND\t${webadminport}\ttcp\tListenPort=${webadminport}" + fn_port "header" + fn_port "Game" port udp + fn_port "Query" queryport udp + fn_port "Query (GameSpy)" queryportgs udp + fn_port "Web Admin" webadminport tcp + fn_port "LAN" lanport udp } | column -s $'\t' -t echo -e "" echo -e "${lightgreen}${servername} Web Admin${default}" @@ -1389,15 +1465,14 @@ fn_info_message_unreal2(){ } | column -s $'\t' -t } -fn_info_message_unreal3(){ +fn_info_message_unreal(){ fn_info_message_password_strip - echo -e "netstat -atunp | grep ut3-bin" - echo -e "" { - echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" - echo -e "> Game\tINBOUND\t${port}\tudp" - echo -e "> Query\tINBOUND\t${queryport}\tudp" - echo -e "> Web Admin\tINBOUND\t${webadminport}\ttcp\tListenPort=${webadminport}" + fn_port "header" + fn_port "Game" port udp + fn_port "Query" queryport udp + fn_port "LAN Beacon" beaconport udp + fn_port "Web Admin" webadminport tcp } | column -s $'\t' -t echo -e "" echo -e "${lightgreen}${servername} Web Admin${default}" @@ -1410,45 +1485,29 @@ fn_info_message_unreal3(){ } | column -s $'\t' -t } -fn_info_message_unturned(){ - echo -e "netstat -atunp | grep Unturned" - echo -e "" +fn_info_message_unt(){ { - echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" - echo -e "> Game\tINBOUND\t${port}\tudp" - echo -e "> Query\tINBOUND\t${queryport}\tudp" + fn_port "header" + fn_port "Game" port udp + fn_port "Query" queryport udp } | column -s $'\t' -t } fn_info_message_ut(){ - echo -e "netstat -atunp | grep UE4Server" - echo -e "" { - echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" - echo -e "> Game\tINBOUND\t${port}\tudp" + fn_port "header" + fn_port "Game" port udp + fn_port "Query" queryport udp } | column -s $'\t' -t } -fn_info_message_vh(){ - echo -e "netstat -atunp | grep valheim" - echo -e "" - { - echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" - echo -e "> Game\tINBOUND\t${port}\tudp" - echo -e "> Query\tINBOUND\t${queryport}\tudp" - } | column -s $'\t' -t -} - -fn_info_message_kf2(){ +fn_info_message_ut3(){ fn_info_message_password_strip - echo -e "netstat -atunp | grep KFGame" - echo -e "" { - echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" - echo -e "> Game\tINBOUND\t${port}\ttcp\tPort=${port}" - echo -e "> Query\tINBOUND\t${queryport}\tudp" - echo -e "> Steam\tINBOUND\t20560\tudp" - echo -e "> Web Admin\tINBOUND\t${webadminport}\ttcp\tListenPort=${webadminport}" + fn_port "header" + fn_port "Game" port udp + fn_port "Query" queryport udp + fn_port "Web Admin" webadminport tcp } | column -s $'\t' -t echo -e "" echo -e "${lightgreen}${servername} Web Admin${default}" @@ -1461,141 +1520,69 @@ fn_info_message_kf2(){ } | column -s $'\t' -t } -fn_info_message_wolfensteinenemyterritory(){ - echo -e "netstat -atunp | grep etded" - echo -e "" - { - echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" - echo -e "> Game/Query\tINBOUND\t${port}\tudp" - } | column -s $'\t' -t -} - - -fn_info_message_wurmunlimited(){ - echo -e "netstat -atunp | grep WurmServer" - echo -e "" - { - echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" - echo -e "> Game\tINBOUND\t${port}\ttcp" - echo -e "> Query\tINBOUND\t${queryport}\tudp" - } | column -s $'\t' -t -} - -fn_info_message_mta(){ - echo -e "netstat -atunp | grep mta-server" - echo -e "" - { - echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" - echo -e "> Game/Query\tINBOUND\t${port}\tudp" - echo -e "> HTTP Server\tINBOUND\t${httpport}\ttcp" - if [ "${ase}" == "Enabled" ]; then - echo -e "> Query Port\tOUTBOUND\t${queryport}\tudp" - fi - } | column -s $'\t' -t -} - -fn_info_message_mordhau(){ - echo -e "netstat -atunp | grep Mord" - echo -e "" - { - echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" - echo -e "> Game\tINBOUND\t${port}\tudp" - echo -e "> BeaconPort\tINBOUND\t${beaconport}\tudp" - echo -e "> Query\tINBOUND\t${queryport}\tudp" - } | column -s $'\t' -t -} - -fn_info_message_barotrauma(){ - echo -e "netstat -atunp | grep /./Server.bin" - echo -e "" - { - echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" - echo -e "> Game\tINBOUND\t${port}\tudp" - echo -e "> Query\tINBOUND\t$((port+1))\tudp" - } | column -s $'\t' -t -} - -fn_info_message_soldat() { - echo -e "netstat -atunp | grep soldat" - echo -e "" - { - echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" - echo -e "> Game\tINBOUND\t${port}\tudp" - echo -e "> Query\tINBOUND\t${queryport}\tudp" - echo -e "> FILES\tINBOUND\t$((port+10))\ttcp" - } | column -s $'\t' -t -} - -fn_info_message_warfork(){ - echo -e "netstat -atunp | grep wf_server" - echo -e "" +fn_info_message_vh(){ { - echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" - echo -e "> Game\tINBOUND\t${port}\tudp" - echo -e "> HTTP\tINBOUND\t${httpport}\ttcp" + fn_port "header" + fn_port "Game" port udp + fn_port "Query" queryport udp } | column -s $'\t' -t } -fn_info_message_pavlovvr(){ - echo "netstat -atunp | grep Pavlov" - echo -e "" +fn_info_message_vints(){ { - echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL" - echo -e "> Game\tINBOUND\t${port}\tudp" - echo -e "> Game\tINBOUND\t$((port+400))\tudp" + fn_port "header" + fn_port "Game" port tcp } | column -s $'\t' -t } -fn_info_message_colony(){ - echo -e "netstat -atunp | grep colonyserv" - echo -e "" +fn_info_message_wet(){ { - echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" - echo -e "> Game\tINBOUND\t${port}\tudp" - echo -e "> Steam\tINBOUND\t${steamport}\tudp" + fn_port "header" + fn_port "Game" port udp + fn_port "Query" queryport udp } | column -s $'\t' -t } -fn_info_message_vintagestory(){ - echo "netstat -atunp | grep cli" - echo -e "" +fn_info_message_wf(){ { - echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL" - echo -e "> Game\tINBOUND\t${port}\tTCP" + fn_port "header" + fn_port "Game" port udp + fn_port "HTTP" httpport tcp } | column -s $'\t' -t } -fn_info_message_scpsl(){ - echo -e "netstat -atunp | grep SCPSL" - echo -e "" +fn_info_message_wurm(){ { - echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" - echo -e "> Game\tINBOUND\t${port}\tudp" + fn_port "header" + fn_port "Game" port tcp + fn_port "Query" queryport udp } | column -s $'\t' -t } fn_info_message_select_engine(){ # Display details depending on game or engine. if [ "${shortname}" == "ac" ]; then - fn_info_message_assettocorsa + fn_info_message_ac elif [ "${shortname}" == "ark" ]; then fn_info_message_ark - elif [ "${shortname}" == "av" ]; then - fn_info_message_avorion elif [ "${shortname}" == "arma3" ]; then fn_info_message_arma3 + elif [ "${shortname}" == "av" ]; then + fn_info_message_av elif [ "${shortname}" == "bf1942" ]; then fn_info_message_bf1942 elif [ "${shortname}" == "bfv" ]; then fn_info_message_bfv elif [ "${shortname}" == "bo" ]; then - fn_info_message_ballisticoverkill + fn_info_message_bo elif [ "${shortname}" == "bt" ]; then - fn_info_message_barotrauma + fn_info_message_bt elif [ "${shortname}" == "bt1944" ]; then - fn_info_message_battalion1944 + fn_info_message_bt1944 + elif [ "${shortname}" == "csgo" ]; then + fn_info_message_csgo elif [ "${shortname}" == "cmw" ]; then - fn_info_message_chivalry + fn_info_message_cmw elif [ "${shortname}" == "cod" ]; then fn_info_message_cod elif [ "${shortname}" == "coduo" ]; then @@ -1607,107 +1594,117 @@ fn_info_message_select_engine(){ elif [ "${shortname}" == "codwaw" ]; then fn_info_message_codwaw elif [ "${shortname}" == "col" ]; then - fn_info_message_colony + fn_info_message_col elif [ "${shortname}" == "dst" ]; then fn_info_message_dst elif [ "${shortname}" == "eco" ]; then fn_info_message_eco elif [ "${shortname}" == "etl" ]; then - fn_info_message_etlegacy + fn_info_message_etl elif [ "${shortname}" == "fctr" ]; then - fn_info_message_factorio + fn_info_message_fctr elif [ "${shortname}" == "hw" ]; then - fn_info_message_hurtworld + fn_info_message_hw + elif [ "${shortname}" == "ins" ]; then + fn_info_message_ins elif [ "${shortname}" == "inss" ]; then fn_info_message_inss - elif [ "${shortname}" == "jk2" ]; then - fn_info_message_jk2 elif [ "${shortname}" == "jc2" ]; then - fn_info_message_justcause2 + fn_info_message_jc2 elif [ "${shortname}" == "jc3" ]; then - fn_info_message_justcause3 - elif [ "${shortname}" == "lo" ]; then - fn_info_message_lo + fn_info_message_jc3 + elif [ "${shortname}" == "jk2" ]; then + fn_info_message_jk2 + elif [ "${shortname}" == "kf" ]; then + fn_info_message_kf elif [ "${shortname}" == "kf2" ]; then fn_info_message_kf2 + elif [ "${shortname}" == "lo" ]; then + fn_info_message_lo elif [ "${shortname}" == "mc" ]||[ "${shortname}" == "pmc" ]||[ "${shortname}" == "wmc" ]; then - fn_info_message_minecraft + fn_info_message_mc elif [ "${shortname}" == "mcb" ]; then - fn_info_message_minecraft_bedrock + fn_info_message_mcb elif [ "${shortname}" == "mh" ]; then - fn_info_message_mordhau + fn_info_message_mh elif [ "${shortname}" == "mohaa" ]; then fn_info_message_mohaa elif [ "${shortname}" == "mta" ]; then fn_info_message_mta elif [ "${shortname}" == "mumble" ]; then fn_info_message_mumble - elif [ "${shortname}" == "onset" ]; then - fn_info_message_onset elif [ "${shortname}" == "mom" ]; then fn_info_message_mom - elif [ "${shortname}" == "pz" ]; then - fn_info_message_projectzomboid + elif [ "${shortname}" == "onset" ]; then + fn_info_message_onset + elif [ "${shortname}" == "pc" ]; then + fn_info_message_pc elif [ "${shortname}" == "pstbs" ]; then fn_info_message_pstbs - elif [ "${shortname}" == "pc" ]; then - fn_info_message_projectcars - elif [ "${shortname}" == "qw" ]; then - fn_info_message_quake + elif [ "${shortname}" == "pvr" ]; then + fn_info_message_pvr + elif [ "${shortname}" == "pz" ]; then + fn_info_message_pz elif [ "${shortname}" == "q2" ]; then - fn_info_message_quake2 + fn_info_message_q2 elif [ "${shortname}" == "q3" ]; then - fn_info_message_quake3 + fn_info_message_q3 elif [ "${shortname}" == "ql" ]; then - fn_info_message_quakelive + fn_info_message_ql + elif [ "${shortname}" == "qw" ]; then + fn_info_message_qw + elif [ "${shortname}" == "ro" ]; then + fn_info_message_ro + elif [ "${shortname}" == "rtcw" ]; then + fn_info_message_rtcw elif [ "${shortname}" == "samp" ]; then fn_info_message_samp + elif [ "${shortname}" == "sb" ]; then + fn_info_message_sb + elif [ "${shortname}" == "sbots" ]; then + fn_info_message_sbots elif [ "${shortname}" == "scpsl" ]||[ "${shortname}" == "scpslsm" ]; then fn_info_message_scpsl elif [ "${shortname}" == "sdtd" ]; then fn_info_message_sdtd - elif [ "${shortname}" == "squad" ]; then - fn_info_message_squad - elif [ "${shortname}" == "st" ]; then - fn_info_message_stationeers elif [ "${shortname}" == "sof2" ]; then fn_info_message_sof2 elif [ "${shortname}" == "sol" ]; then - fn_info_message_soldat - elif [ "${shortname}" == "sb" ]; then - fn_info_message_starbound - elif [ "${shortname}" == "sbots" ]; then - fn_info_message_sbots + fn_info_message_sol + elif [ "${shortname}" == "squad" ]; then + fn_info_message_squad + elif [ "${shortname}" == "st" ]; then + fn_info_message_st elif [ "${shortname}" == "terraria" ]; then fn_info_message_terraria elif [ "${shortname}" == "ts3" ]; then - fn_info_message_teamspeak3 + fn_info_message_ts3 elif [ "${shortname}" == "tu" ]; then - fn_info_message_towerunite + fn_info_message_tu elif [ "${shortname}" == "tw" ]; then - fn_info_message_teeworlds + fn_info_message_tw elif [ "${shortname}" == "unt" ]; then - fn_info_message_unturned - elif [ "${shortname}" == "ut" ]; then - fn_info_message_ut + fn_info_message_unt elif [ "${shortname}" == "vh" ]; then fn_info_message_vh - elif [ "${shortname}" == "rtcw" ]; then - fn_info_message_rtcw - elif [ "${shortname}" == "pvr" ]; then - fn_info_message_pavlovvr + elif [ "${shortname}" == "vints" ]; then + fn_info_message_vints elif [ "${shortname}" == "rust" ]; then fn_info_message_rust - elif [ "${shortname}" == "vints" ]; then - fn_info_message_vintagestory - elif [ "${shortname}" == "wf" ]; then - fn_info_message_warfork - elif [ "${shortname}" == "wurm" ]; then - fn_info_message_wurmunlimited elif [ "${shortname}" == "rw" ]; then - fn_info_message_risingworld + fn_info_message_rw + elif [ "${shortname}" == "ut" ]; then + fn_info_message_ut + elif [ "${shortname}" == "ut2k4" ]; then + fn_info_message_ut2k4 + elif [ "${shortname}" == "ut3" ]; then + fn_info_message_ut3 elif [ "${shortname}" == "wet" ]; then - fn_info_message_wolfensteinenemyterritory + fn_info_message_wet + elif [ "${shortname}" == "wf" ]; then + fn_info_message_wf + elif [ "${shortname}" == "wurm" ]; then + fn_info_message_wurm elif [ "${engine}" == "goldsrc" ]; then fn_info_message_goldsrc elif [ "${engine}" == "source" ]; then @@ -1716,10 +1713,7 @@ fn_info_message_select_engine(){ fn_info_message_spark elif [ "${engine}" == "unreal" ]; then fn_info_message_unreal - elif [ "${engine}" == "unreal2" ]; then - fn_info_message_unreal2 - elif [ "${engine}" == "unreal3" ]; then - fn_info_message_unreal3 + else fn_print_error_nl "Unable to detect server engine." fi diff --git a/lgsm/functions/info_parms.sh b/lgsm/functions/info_parms.sh deleted file mode 100755 index 9aee054cd..000000000 --- a/lgsm/functions/info_parms.sh +++ /dev/null @@ -1,332 +0,0 @@ -#!/bin/bash -# LinuxGSM info_parms.sh module -# Author: Daniel Gibbs -# Contributors: http://linuxgsm.com/contrib -# Website: https://linuxgsm.com -# Description: If specific parms are not set then this will be displayed in details. - -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" - -## Examples of filtering to get info from config files -# sed 's/foo//g' - remove foo -# tr -cd '[:digit:]' leave only digits -# tr -d '=\"; ' remove selected charectors =\"; -# grep -v "foo" filter out lines that contain foo - -unavailable="${red}UNAVAILABLE${default}" -zero="${red}0${default}" - -fn_info_parms_ark(){ - port=${port:-"0"} - queryport=${queryport:-"0"} - rconport=${rconport:-"0"} - maxplayers=${maxplayers:-"0"} -} - -fn_info_parms_barotrauma(){ - port=${port:-"0"} - queryport=${queryport:-"0"} -} - -fn_info_parms_cod(){ - defaultmap=${defaultmap:-"NOT SET"} - maxplayers=${maxplayers:-"0"} - port=${port:-"0"} - queryport=${port:-"0"} -} - -fn_info_parms_dst(){ - sharding=${sharding:-"NOT SET"} - master=${master:-"NOT SET"} - shard=${shard:-"NOT SET"} - cluster=${cluster:-"NOT SET"} - cave=${cave:-"NOT SET"} -} - -fn_info_parms_factorio(){ - port=${port:-"0"} - rconport=${rconport:-"0"} - rconpassword=${rconpassword:-"NOT SET"} -} - -fn_info_parms_hurtworld(){ - servername=${servername:-"NOT SET"} - port=${port:-"0"} - queryport=${queryport:-"0"} - maxplayers=${maxplayers:-"0"} - defaultmap=${defaultmap:-"NOT SET"} - creativemode=${creativemode:-"NOT SET"} -} - -fn_info_parms_inss(){ - port=${port:-"0"} - queryport=${queryport:-"0"} - servername=${servername:-"NOT SET"} - serverpassword=${serverpassword:-"NOT SET"} - defaultmap=${defaultmap:-"NOT SET"} - defaultscenario=${defaultscenario:-"NOT SET"} - maxplayers=${maxplayers:-"0"} -} - -fn_info_parms_jk2(){ - queryport=${port} -} - -fn_info_parms_kf2(){ - queryport=${queryport:-"0"} - defaultmap=${defaultmap:-"NOT SET"} -} - -fn_info_parms_lo(){ - servername=${servername:-"NOT SET"} - port=${port:-"0"} - queryport=${queryport:-"0"} -} - -fn_info_parms_mordhau(){ - port=${port:-"0"} - queryport=${queryport:-"0"} - beaconport=${beaconport:-"0"} -} - -fn_info_parms_mohaa(){ - port=${port:-"0"} - queryport=${port:-"0"} - defaultmap=${defaultmap:-"NOT SET"} -} - -fn_info_parms_mom(){ - port=${port:-"7777"} - beaconport=${queryport:-"15000"} -} - -fn_info_parms_mta(){ - queryport=$((port + 123)) -} - -fn_info_parms_projectzomboid(){ - adminpassword=${adminpassword:-"NOT SET"} - queryport=${port:-"0"} -} - -fn_info_parms_quakeworld(){ - port=${port:-"0"} - queryport=${port:-"0"} -} - -fn_info_parms_quake2(){ - port=${port:-"0"} - queryport=${port:-"0"} - defaultmap=${defaultmap:-"NOT SET"} -} - -fn_info_parms_realvirtuality(){ - port=${port:-"0"} - queryport=$((port + 1)) -} - -fn_info_parms_risingworld(){ - servername=${servername:-"NOT SET"} - port=${port:-"0"} - httpqueryport=$((port - 1)) -} - -fn_info_parms_rtcw(){ - port=${port:-"0"} - queryport="${port:-"0"}" - defaultmap=${defaultmap:-"NOT SET"} -} - -fn_info_parms_rust(){ - servername=${servername:-"NOT SET"} - port=${port:-"0"} - queryport=${port:-"0"} - appport=${appport:-"0"} - rconport=${rconport:-"0"} - gamemode=${gamemode:-"NOT SET"} - maxplayers=${maxplayers:-"0"} - rconpassword=${rconpassword:-"NOT SET"} - rconweb=${rconweb:-"NOT SET"} - tickrate=${tickrate:-"0"} - saveinterval=${saveinterval:-"0"} - serverlevel=${serverlevel:-"NOT SET"} - worldsize=${worldsize:-"0"} -} - -fn_info_parms_samp(){ - queryport=${port:-"0"} -} - -fn_info_parms_sof2(){ - port=${port:-"0"} - defaultmap=${defaultmap:-"NOT SET"} -} - -fn_info_parms_source(){ - defaultmap=${defaultmap:-"NOT SET"} - maxplayers=${maxplayers:-"0"} - port=${port:-"0"} - queryport=${port:-"0"} - clientport=${clientport:-"0"} -} - -fn_info_parms_spark(){ - defaultmap=${defaultmap:-"NOT SET"} - maxplayers=${maxplayers:-"0"} - port=${port:-"0"} - queryport=$((port + 1)) - servername=${servername:-"NOT SET"} - serverpassword=${serverpassword:-"NOT SET"} - webadminuser=${webadminuser:-"NOT SET"} - webadminpass=${webadminpass:-"NOT SET"} - webadminport=${webadminport:-"0"} - mods=${mods:-"NOT SET"} -} - -fn_info_parms_stickybots(){ - port=${port:-"0"} - queryport=${queryport:-"0"} - servername=${servername:-"NOT SET"} - serverpassword=${serverpassword:-"NOT SET"} - defaultmap=${defaultmap:-"NOT SET"} - maxplayers=${maxplayers:-"0"} -} - -fn_info_parms_sof2(){ - port=${port:-"0"} - queryport=${port:-"0"} - defaultmap=${defaultmap:-"NOT SET"} -} - -fn_info_parms_towerunite(){ - port=${port:-"0"} - queryport=${queryport:-"0"} -} - -fn_info_parms_teeworlds(){ - queryport=${port:-"0"} -} - -fn_info_parms_pavlovvr(){ - port=${port:-"0"} - queryport=${queryport:-"0"} -} - -fn_info_parms_unreal(){ - defaultmap=${defaultmap:-"NOT SET"} - queryport=$((port + 1)) -} - -fn_info_parms_unreal2(){ - defaultmap=${defaultmap:-"NOT SET"} - queryport=$((port + 1)) -} - -fn_info_parms_unreal3(){ - port=${port:-"0"} - queryport=${queryport:-"0"} - defaultmap=${defaultmap:-"NOT SET"} -} - -fn_info_parms_unturned(){ - servername=${selfname:-"NOT SET"} - port=${port:-"0"} - queryport=$((port + 1)) -} - -fn_info_parms_ut(){ - port=${port:-"0"} -} - -fn_info_parms_vh(){ - port=${port:-"0"} - if [ "${public}" != "0" ]; then - queryport=$((port + 1)) - else - querymode="1" - fi - gameworld=${gameworld:-"NOT SET"} - serverpassword=${serverpassword:-"NOT SET"} - servername=${servername:-"NOT SET"} -} - -fn_info_parms_wf(){ - port=${port:-"0"} - queryport="${port:-"0"}" - webadminport=${webadminport:-"0"} -} - -fn_info_parms_queryport(){ - queryport="${port:-"0"}" -} - -if [ "${shortname}" == "ark" ]; then - fn_info_parms_ark -elif [ "${shortname}" == "arma3" ]; then - fn_info_parms_realvirtuality -elif [ "${shortname}" == "bt" ]; then - fn_info_parms_barotrauma -elif [ "${shortname}" == "cod" ]||[ "${shortname}" == "coduo" ]||[ "${engine}" == "iw2.0" ]||[ "${engine}" == "iw3.0" ]; then - fn_info_parms_cod -elif [ "${shortname}" == "fctr" ]; then - fn_info_parms_factorio -elif [ "${shortname}" == "inss" ]; then - fn_info_parms_inss -elif [ "${shortname}" == "jk2" ]; then - fn_info_parms_jk2 -elif [ "${shortname}" == "kf2" ]; then - fn_info_parms_kf2 -elif [ "${shortname}" == "lo" ]; then - fn_info_parms_lo -elif [ "${shortname}" == "mohaa" ]; then - fn_info_parms_mohaa -elif [ "${shortname}" == "mom" ]; then - fn_info_parms_mom -elif [ "${shortname}" == "pz" ]; then - fn_info_parms_projectzomboid -elif [ "${shortname}" == "pvr" ]; then - fn_info_parms_pavlovvr -elif [ "${shortname}" == "qw" ]; then - fn_info_parms_quakeworld -elif [ "${shortname}" == "q2" ]||[ "${shortname}" == "q3" ]; then - fn_info_parms_quake2 -elif [ "${shortname}" == "rtcw" ]; then - fn_info_parms_rtcw -elif [ "${shortname}" == "rust" ]; then - fn_info_parms_rust -elif [ "${shortname}" == "samp" ]; then - fn_info_parms_samp -elif [ "${shortname}" == "rw" ]; then - fn_info_parms_risingworld -elif [ "${shortname}" == "sof2" ]; then - fn_info_parms_sof2 -elif [ "${shortname}" == "sbots" ]; then - fn_info_parms_stickybots -elif [ "${engine}" == "source" ]||[ "${engine}" == "goldsrc" ]; then - fn_info_parms_source -elif [ "${engine}" == "spark" ]; then - fn_info_parms_spark -elif [ "${shortname}" == "tu" ]; then - fn_info_parms_towerunite -elif [ "${shortname}" == "tw" ]; then - fn_info_parms_teeworlds -elif [ "${shortname}" == "vh" ]; then - fn_info_parms_vh -elif [ "${shortname}" == "mh" ]; then - fn_info_parms_mordhau -elif [ "${shortname}" == "mta" ]; then - fn_info_parms_mta -elif [ "${engine}" == "unreal" ]||[ "${engine}" == "unreal2" ]; then - fn_info_parms_unreal -elif [ "${engine}" == "unreal3" ]; then - fn_info_parms_unreal3 -elif [ "${shortname}" == "unt" ]; then - fn_info_parms_unturned -elif [ "${shortname}" == "ut" ]; then - fn_info_parms_ut -elif [ "${shortname}" == "wf" ]; then - fn_info_parms_wf -# for servers that have a missing queryport from the config -elif [ "${shortname}" == "scpsl" ]||[ "${shortname}" == "scpslsm" ]; then - fn_info_parms_queryport -fi diff --git a/lgsm/functions/query_gamedig.sh b/lgsm/functions/query_gamedig.sh index 123d8c86c..32b70aac2 100755 --- a/lgsm/functions/query_gamedig.sh +++ b/lgsm/functions/query_gamedig.sh @@ -14,6 +14,10 @@ if [ "$(command -v gamedig 2>/dev/null)" ]&&[ "$(command -v jq 2>/dev/null)" ]; # will bypass query if server offline. check_status.sh if [ "${status}" != "0" ]; then + # GameDig requires you use the voice port when querying. + if [ "${querytype}" == "teamspeak3" ]; then + queryport="${port}" + fi # checks if query is working null = pass. gamedigcmd=$(echo -e "gamedig --type \"${querytype}\" --host \"${queryip}\" --query_port \"${queryport}\"|jq") gamedigraw=$(gamedig --type "${querytype}" --host "${queryip}" --query_port "${queryport}") @@ -25,6 +29,10 @@ if [ "$(command -v gamedig 2>/dev/null)" ]&&[ "$(command -v jq 2>/dev/null)" ]; querystatus=$(echo "${gamedigraw}" | jq '.error|length') fi + if [ "${querytype}" == "teamspeak3" ]; then + fn_info_game_ts3 + fi + # server name. gdname=$(echo "${gamedigraw}" | jq -re '.name') if [ "${gdname}" == "null" ]; then @@ -34,6 +42,8 @@ if [ "$(command -v gamedig 2>/dev/null)" ]&&[ "$(command -v jq 2>/dev/null)" ]; # numplayers. if [ "${querytype}" == "minecraft" ]; then gdplayers=$(echo "${gamedigraw}" | jq -re '.players | length-1') + elif [ "${querytype}" == "teamspeak3" ]; then + gdplayers=$(echo "${gamedigraw}" | jq -re '.raw.virtualserver_clientsonline') else gdplayers=$(echo "${gamedigraw}" | jq -re '.players | length') fi @@ -70,7 +80,12 @@ if [ "$(command -v gamedig 2>/dev/null)" ]&&[ "$(command -v jq 2>/dev/null)" ]; fi # server version. - gdversion=$(echo "${gamedigraw}" | jq -re '.raw.version') + if [ "${querytype}" == "teamspeak3" ]; then + dversion=$(echo "${gamedigraw}" | jq -re '.raw.virtualserver_version') + else + gdversion=$(echo "${gamedigraw}" | jq -re '.raw.version') + fi + if [ "${gdversion}" == "null" ]||[ "${gdversion}" == "0" ]; then unset gdversion fi diff --git a/tests/tests_fctrserver.sh b/tests/tests_fctrserver.sh index 9b47f763d..ef62e9724 100644 --- a/tests/tests_fctrserver.sh +++ b/tests/tests_fctrserver.sh @@ -923,7 +923,7 @@ echo -e "" echo -e "5.0 - Monitor Tests" echo -e "==================================================================" echo -e "" -info_config.sh +info_game.sh echo -e "Server IP - Port: ${ip}:${port}" echo -e "Server IP - Query Port: ${ip}:${queryport}" diff --git a/tests/tests_jc2server.sh b/tests/tests_jc2server.sh index da0fd91ce..474d45f06 100644 --- a/tests/tests_jc2server.sh +++ b/tests/tests_jc2server.sh @@ -1082,7 +1082,7 @@ echo -e "" echo -e "5.0 - Monitor Tests" echo -e "==================================================================" echo -e "" -info_config.sh +info_game.sh echo -e "Server IP - Port: ${ip}:${port}" echo -e "Server IP - Query Port: ${ip}:${queryport}" diff --git a/tests/tests_mcserver.sh b/tests/tests_mcserver.sh index 501b64a43..b6d6217cd 100644 --- a/tests/tests_mcserver.sh +++ b/tests/tests_mcserver.sh @@ -945,7 +945,7 @@ echo -e "" echo -e "5.0 - Monitor Tests" echo -e "==================================================================" echo -e "" -info_config.sh +info_game.sh echo -e "Server IP - Port: ${ip}:${port}" echo -e "Server IP - Query Port: ${ip}:${queryport}" diff --git a/tests/tests_ts3server.sh b/tests/tests_ts3server.sh index b9941598a..6d2b5d95f 100644 --- a/tests/tests_ts3server.sh +++ b/tests/tests_ts3server.sh @@ -922,7 +922,7 @@ echo -e "" echo -e "5.0 - Monitor Tests" echo -e "==================================================================" echo -e "" -info_config.sh +info_game.sh echo -e "Server IP - Port: ${ip}:${port}" echo -e "Server IP - Query Port: ${ip}:${queryport}"