Browse Source

Merge branch 'develop' into feature/gotify

pull/3509/head
Daniel Gibbs 4 years ago
parent
commit
191336b65b
  1. 4
      .github/workflows/git-sync.yml
  2. 2
      .github/workflows/lock.yml
  3. 3
      CONTRIBUTING.md
  4. 2
      LICENSE
  5. 6
      README.md
  6. 2
      lgsm/config-default/config-lgsm/acserver/_default.cfg
  7. 6
      lgsm/config-default/config-lgsm/avserver/_default.cfg
  8. 1
      lgsm/config-default/config-lgsm/csgoserver/_default.cfg
  9. 4
      lgsm/config-default/config-lgsm/inssserver/_default.cfg
  10. 188
      lgsm/config-default/config-lgsm/loserver/_default.cfg
  11. 2
      lgsm/config-default/config-lgsm/mhserver/_default.cfg
  12. 2
      lgsm/config-default/config-lgsm/pvrserver/_default.cfg
  13. 4
      lgsm/config-default/config-lgsm/rwserver/_default.cfg
  14. 2
      lgsm/config-default/config-lgsm/sdtdserver/_default.cfg
  15. 2
      lgsm/config-default/config-lgsm/ts3server/_default.cfg
  16. 3
      lgsm/data/serverlist.csv
  17. 2
      lgsm/functions/alert.sh
  18. 3
      lgsm/functions/check_ip.sh
  19. 6
      lgsm/functions/check_permissions.sh
  20. 3
      lgsm/functions/check_root.sh
  21. 9
      lgsm/functions/command_debug.sh
  22. 6
      lgsm/functions/command_details.sh
  23. 208
      lgsm/functions/command_dev_query_raw.sh
  24. 5
      lgsm/functions/command_monitor.sh
  25. 4
      lgsm/functions/command_postdetails.sh
  26. 2
      lgsm/functions/command_restart.sh
  27. 10
      lgsm/functions/command_start.sh
  28. 2
      lgsm/functions/command_stop.sh
  29. 2
      lgsm/functions/command_test_alert.sh
  30. 10
      lgsm/functions/core_dl.sh
  31. 21
      lgsm/functions/core_functions.sh
  32. 6
      lgsm/functions/fix.sh
  33. 17
      lgsm/functions/fix_lo.sh
  34. 2
      lgsm/functions/fix_ts3.sh
  35. 10
      lgsm/functions/info_distro.sh
  36. 2257
      lgsm/functions/info_game.sh
  37. 1131
      lgsm/functions/info_messages.sh
  38. 324
      lgsm/functions/info_parms.sh
  39. 46
      lgsm/functions/info_stats.sh
  40. 17
      lgsm/functions/query_gamedig.sh
  41. 7
      lgsm/functions/update_minecraft_bedrock.sh
  42. 2
      linuxgsm.sh
  43. 4
      tests/tests_fctrserver.sh
  44. 4
      tests/tests_jc2server.sh
  45. 4
      tests/tests_mcserver.sh
  46. 4
      tests/tests_ts3server.sh

4
.github/workflows/git-sync.yml

@ -12,12 +12,12 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: webfactory/ssh-agent
uses: webfactory/ssh-agent@v0.4.1
uses: webfactory/ssh-agent@v0.5.3
with:
ssh-private-key: ${{ secrets.BITBUCKET_SECRET }}
- name: repo-sync
uses: wei/git-sync@v2.1.0
uses: wei/git-sync@v3.0.0
with:
ssh_private_key: ${{ secrets.BITBUCKET_SECRET }}
source_repo: "https://github.com/GameServerManagers/LinuxGSM"

2
.github/workflows/lock.yml

@ -8,7 +8,7 @@ jobs:
lock:
runs-on: ubuntu-latest
steps:
- uses: dessant/lock-threads@v2
- uses: dessant/lock-threads@v2.0.3
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
issue-lock-comment: >

3
CONTRIBUTING.md

@ -48,8 +48,7 @@ Before creating bug reports, please check [this list](https://github.com/GameSer
#### Before Submitting A Bug Report
* **Check the [documentation](https://docs.linuxgsm.com).** You might be able to find the cause of the problem and fix things yourself.
* **Check that the problem is not related to** [**support page**](https://linuxgsm/com/support) for links to other support options.
* **Check the** [**support page**](https://linuxgsm/com/support) for links to other support options.
* **Check the** [**support page**](https://linuxgsm.com/support) for links to other support options.
* **Perform a** [**cursory search**](https://github.com/search?q=org:GameServerManagers%20type:issues&type=Issues) to see if the problem has already been reported. If it has **and the issue is still open**, add a comment to the existing issue and give it a thumbs up instead of opening a new one.
#### How Do I Submit A (Good) Bug Report?

2
LICENSE

@ -1,6 +1,6 @@
MIT License
Copyright (c) 2012-2020 Daniel Gibbs
Copyright (c) 2012-2021 Daniel Gibbs
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal

6
README.md

File diff suppressed because one or more lines are too long

2
lgsm/config-default/config-lgsm/acserver/_default.cfg

@ -144,7 +144,7 @@ stopmode="2"
# 4: gsquery
# 5: tcp
querymode="5"
querytype=""
querytype="assettocorsa"
## Console type
consoleverbose="yes"

6
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
@ -165,8 +165,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"

1
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"

4
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 ####

188
lgsm/config-default/config-lgsm/loserver/_default.cfg

@ -0,0 +1,188 @@
##################################
######## Default Settings ########
##################################
# DO NOT EDIT, ANY CHANGES WILL BE OVERWRITTEN!
# Copy settings from here and use them in either:
# common.cfg - applies settings to every instance.
# [instance].cfg - applies settings to a specific instance.
#### Game Server Settings ####
## SteamCMD Login | https://docs.linuxgsm.com/steamcmd#steamcmd-login
steamuser="username"
steampass='password'
## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters
servername="LinuxGSM"
ip="0.0.0.0"
port="7777"
queryport="27015"
customerkey=""
providerkey=""
slots="100"
## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters
startparameters="-log -force_steamclient_link -messaging -NoLiveServer -EnableCheats -backendapiurloverride='backend.last-oasis.com' -identifier=${servername} -port=${port} -CustomerKey=${customerkey} -ProviderKey=${providerkey} -slots=${slots} -QueryPort=${queryport} -OverrideConnectionAddress=${ip}"
#### LinuxGSM Settings ####
## LinuxGSM Stats
# Send useful stats to LinuxGSM developers.
# https://docs.linuxgsm.com/configuration/linuxgsm-stats
# (on|off)
stats="off"
## Notification Alerts
# (on|off)
# Display IP | https://docs.linuxgsm.com/alerts#display-ip
displayip=""
# More info | https://docs.linuxgsm.com/alerts#more-info
postalert="off"
# Discord Alerts | https://docs.linuxgsm.com/alerts/discord
discordalert="off"
discordwebhook="webhook"
# Email Alerts | https://docs.linuxgsm.com/alerts/email
emailalert="off"
email="[email protected]"
emailfrom=""
# IFTTT Alerts | https://docs.linuxgsm.com/alerts/ifttt
iftttalert="off"
ifttttoken="accesstoken"
iftttevent="linuxgsm_alert"
# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun
mailgunalert="off"
mailgunapiregion="us"
mailguntoken="accesstoken"
mailgundomain="example.com"
mailgunemailfrom="[email protected]"
mailgunemail="[email protected]"
# Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet
pushbulletalert="off"
pushbullettoken="accesstoken"
channeltag=""
# Pushover Alerts | https://docs.linuxgsm.com/alerts/pushover
pushoveralert="off"
pushovertoken="accesstoken"
pushoveruserkey="userkey"
# Rocket.Chat Alerts | https://docs.linuxgsm.com/alerts/rocket.chat
rocketchatalert="off"
rocketchatwebhook="webhook"
rocketchattoken=""
# Slack Alerts | https://docs.linuxgsm.com/alerts/slack
slackalert="off"
slackwebhook="webhook"
# Telegram Alerts | https://docs.linuxgsm.com/alerts/telegram
# You can add a custom cURL string eg proxy (useful in Russia) in "curlcustomstring".
# For example "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help".
telegramapi="api.telegram.org"
telegramalert="off"
telegramtoken="accesstoken"
telegramchatid=""
curlcustomstring=""
## Updating | https://docs.linuxgsm.com/commands/update
updateonstart="off"
## Backup | https://docs.linuxgsm.com/commands/backup
maxbackups="4"
maxbackupdays="30"
stoponbackup="on"
## Logging | https://docs.linuxgsm.com/features/logging
consolelogging="on"
logdays="7"
## Monitor | https://docs.linuxgsm.com/commands/monitor
# Query delay time
querydelay="1"
## ANSI Colors | https://docs.linuxgsm.com/features/ansi-colors
ansi="on"
#### Advanced Settings ####
## Message Display Time | https://docs.linuxgsm.com/features/message-display-time
sleeptime="0.5"
## SteamCMD Settings | https://docs.linuxgsm.com/steamcmd
# Server appid
appid="920720"
steamcmdforcewindows="no"
# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch
branch=""
betapassword=""
# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server
steammaster="false"
## Stop Mode | https://docs.linuxgsm.com/features/stop-mode
# 1: tmux kill
# 2: CTRL+c
# 3: quit
# 4: quit 120s
# 5: stop
# 6: q
# 7: exit
# 8: 7 Days to Die
# 9: GoldSrc
# 10: Avorion
# 11: end
stopmode="2"
## Query mode
# 1: session only
# 2: gamedig (gsquery fallback)
# 3: gamedig
# 4: gsquery
# 5: tcp
querymode="1"
querytype=""
## Console type
consoleverbose="yes"
consoleinteract="no"
## Game Server Details
# Do not edit
gamename="Last Oasis"
engine="unreal4"
glibc="2.17"
#### Directories ####
# Edit with care
## Game Server Directories
systemdir="${serverfiles}/Mist"
executabledir="${systemdir}/Binaries/Linux"
executable="./MistServer-Linux-Shipping"
servercfgdir="${systemdir}/Saved/Config/LinuxServer"
servercfg="Game.ini"
servercfgdefault="Game.ini"
servercfgfullpath="${servercfgdir}/${servercfg}"
## Backup Directory
backupdir="${lgsmdir}/backup"
## Logging Directories
logdir="${rootdir}/log"
gamelogdir="${systemdir}/Saved/Logs"
lgsmlogdir="${logdir}/script"
consolelogdir="${logdir}/console"
lgsmlog="${lgsmlogdir}/${selfname}-script.log"
consolelog="${consolelogdir}/${selfname}-console.log"
alertlog="${lgsmlogdir}/${selfname}-alert.log"
postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log"
## Logs Naming
lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log"
consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log"

2
lgsm/config-default/config-lgsm/mhserver/_default.cfg

@ -17,7 +17,7 @@ queryport="27015"
defaultmap="FFA_ThePit"
## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters
startparameters="Mordhau ${defaultmap} -log -MultiHome=${ip} -Port=${port} -BeaconPort=${beaconport} -QueryPort=${queryport}"
startparameters="Mordhau ${defaultmap} -log -MultiHome=${ip} -Port=${port} -BeaconPort=${beaconport} -QueryPort=${queryport} -GameIni=${servercfgfullpath}"
#### LinuxGSM Settings ####

2
lgsm/config-default/config-lgsm/pvrserver/_default.cfg

@ -144,7 +144,7 @@ stopmode="2"
# 3: gamedig
# 4: gsquery
# 5: tcp
querymode="1"
querymode="5"
querytype=""
## Console type

4
lgsm/config-default/config-lgsm/rwserver/_default.cfg

@ -140,8 +140,8 @@ stopmode="3"
# 3: gamedig
# 4: gsquery
# 5: tcp
querymode="1"
querytype=""
querymode="2"
querytype="protocol-valve"
## Console type
consoleverbose="yes"

2
lgsm/config-default/config-lgsm/sdtdserver/_default.cfg

@ -151,7 +151,7 @@ consoleinteract="no"
# Do not edit
gamename="7 Days To Die"
engine="unity3d"
glibc="2.15"
glibc="2.27"
#### Directories ####
# Edit with care

2
lgsm/config-default/config-lgsm/ts3server/_default.cfg

@ -128,7 +128,7 @@ stopmode="2"
# 4: gsquery
# 5: tcp
querymode="5"
querytype=""
querytype="teamspeak3"
## Console type
consoleverbose="yes"

3
lgsm/data/serverlist.csv

@ -51,6 +51,7 @@ jc3,jc3server,Just Cause 3
jk2,jk2server,Jedi Knight II: Jedi Outcast
kf,kfserver,Killing Floor
kf2,kf2server,Killing Floor 2
lo,loserver,Last Oasis
l4d,l4dserver,Left 4 Dead
l4d2,l4d2server,Left 4 Dead 2
mc,mcserver,Minecraft
@ -107,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

Can't render this file because it has a wrong number of fields in line 66.

2
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:?}"

3
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"

6
lgsm/functions/check_permissions.sh

@ -31,13 +31,13 @@ fn_check_ownership(){
{
echo -e "User\tGroup\tFile\n"
if [ "${selfownissue}" == "1" ]; then
find "${rootdir}/${selfname}" -not -user "$(whoami)" -printf "%u\t\t%g\t%p\n"
find "${rootdir}/${selfname}" -not -user "$(whoami)" -printf "%u\t%g\t%p\n"
fi
if [ "${funcownissue}" == "1" ]; then
find "${functionsdir}" -not -user "$(whoami)" -printf "%u\t\t%g\t%p\n"
find "${functionsdir}" -not -user "$(whoami)" -printf "%u\t%g\t%p\n"
fi
if [ "${filesownissue}" == "1" ]; then
find "${serverfiles}" -not -user "$(whoami)" -printf "%u\t\t%g\t%p\n"
find "${serverfiles}" -not -user "$(whoami)" -printf "%u\t%g\t%p\n"
fi
} | column -s $'\t' -t | tee -a "${lgsmlog}"

3
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

9
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

6
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

208
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

5
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

4
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

2
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

10
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.

2
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

2
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

10
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

21
lgsm/functions/core_functions.sh

@ -8,7 +8,7 @@
functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
modulesversion="v21.2.4"
modulesversion="v21.2.5"
# Core
@ -381,6 +381,11 @@ functionfile="${FUNCNAME[0]}"
fn_fetch_function
}
fix_lo.sh(){
functionfile="${FUNCNAME[0]}"
fn_fetch_function
}
fix_mcb.sh(){
functionfile="${FUNCNAME[0]}"
fn_fetch_function
@ -508,22 +513,12 @@ fn_fetch_function
# Info
info_stats.sh(){
functionfile="${FUNCNAME[0]}"
fn_fetch_function
}
info_config.sh(){
functionfile="${FUNCNAME[0]}"
fn_fetch_function
}
info_distro.sh(){
functionfile="${FUNCNAME[0]}"
fn_fetch_function
}
info_gamedig.sh(){
info_game.sh(){
functionfile="${FUNCNAME[0]}"
fn_fetch_function
}
@ -533,7 +528,7 @@ functionfile="${FUNCNAME[0]}"
fn_fetch_function
}
info_parms.sh(){
info_stats.sh(){
functionfile="${FUNCNAME[0]}"
fn_fetch_function
}

6
lgsm/functions/fix.sh

@ -94,9 +94,9 @@ fi
# Fixes that are run on install only.
if [ "${commandname}" == "INSTALL" ]; then
if [ "${shortname}" == "av" ]||[ "${shortname}" == "cmw" ]||[ "${shortname}" == "kf" ]||[ "${shortname}" == "kf2" ]||[ "${shortname}" == "onset" ]||[ "${shortname}" == "ro" ]||[ "${shortname}" == "samp" ]||[ "${shortname}" == "ut2k4" ]||[ "${shortname}" == "ut" ]||[ "${shortname}" == "ut3" ]; then
if [ "${shortname}" == "av" ]||[ "${shortname}" == "cmw" ]||[ "${shortname}" == "kf" ]||[ "${shortname}" == "kf2" ]||[ "${shortname}" == "lo" ]||[ "${shortname}" == "onset" ]||[ "${shortname}" == "ro" ]||[ "${shortname}" == "samp" ]||[ "${shortname}" == "ut2k4" ]||[ "${shortname}" == "ut" ]||[ "${shortname}" == "ut3" ]; then
echo -e ""
echo -e "${lightyellow}Applying Post-Install Fixes}${default}"
echo -e "${lightyellow}Applying Post-Install Fixes${default}"
echo -e "================================="
fn_sleep_time
postinstall=1
@ -106,6 +106,8 @@ if [ "${commandname}" == "INSTALL" ]; then
fix_kf.sh
elif [ "${shortname}" == "kf2" ]; then
fix_kf2.sh
elif [ "${shortname}" == "lo" ]; then
fix_lo.sh
elif [ "${shortname}" == "ro" ]; then
fix_ro.sh
elif [ "${shortname}" == "samp" ]; then

17
lgsm/functions/fix_lo.sh

@ -0,0 +1,17 @@
#!/bin/bash
# LinuxGSM fix_lo.sh function
# Author: Daniel Gibbs
# Website: https://linuxgsm.com
# Description: Resolves installation issue with Last Oasis
functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
local APPID_FILE=${executabledir}/steam_appid.txt
if [ ! -f "${APPID_FILE}" ]; then
fn_print_information "adding ${APPID_FILE} to ${gamename} server."
fn_sleep_time
echo "903950" > "${APPID_FILE}"
else
fn_print_information "${APPID_FILE} already exists. No action to be taken."
fn_sleep_time
fi

2
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}"

10
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)"

2257
lgsm/functions/info_config.sh → lgsm/functions/info_game.sh

File diff suppressed because it is too large

1131
lgsm/functions/info_messages.sh

File diff suppressed because it is too large

324
lgsm/functions/info_parms.sh

@ -1,324 +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_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}" == "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

46
lgsm/functions/info_stats.sh

@ -62,40 +62,34 @@ memusedroundup="$(((memused + 99) / 100 * 100))"
# Hardware Property - UA-165287622-3
## Distro.
curl https://www.google-analytics.com/collect -d "tid=UA-655379-31" -d "aip=1" -d "cid=${uuidinstance}" -d "t=event" -d "ec=distro" -d "ea=${distroname}" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1
curl https://www.google-analytics.com/collect -d "tid=UA-165287622-1" -d "aip=1" -d "cid=${uuidinstance}" -d "t=event" -d "ec=distro" -d "ea=${distroname}" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1
curl https://www.google-analytics.com/collect -d "tid=UA-165287622-2" -d "aip=1" -d "cid=${uuidinstall}" -d "t=event" -d "ec=distro" -d "ea=${distroname}" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1
curl https://www.google-analytics.com/collect -d "tid=UA-165287622-3" -d "aip=1" -d "cid=${uuidhardware}" -d "t=event" -d "ec=distro" -d "ea=${distroname}" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1
## Game Server Name.
curl https://www.google-analytics.com/collect -d "tid=UA-655379-31" -d "aip=1" -d "cid=${uuidinstance}" -d "t=event" -d "ec=game" -d "ea=${gamename}" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1
curl https://www.google-analytics.com/collect -d "tid=UA-165287622-1" -d "aip=1" -d "cid=${uuidinstance}" -d "t=event" -d "ec=game" -d "ea=${gamename}" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1
curl https://www.google-analytics.com/collect -d "tid=UA-165287622-2" -d "aip=1" -d "cid=${uuidinstall}" -d "t=event" -d "ec=game" -d "ea=${gamename}" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1
curl https://www.google-analytics.com/collect -d "tid=UA-165287622-3" -d "aip=1" -d "cid=${uuidhardware}" -d "t=event" -d "ec=game" -d "ea=${gamename}" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1
## LinuxGSM Version.
curl https://www.google-analytics.com/collect -d "tid=UA-655379-31" -d "aip=1" -d "cid=${uuidinstance}" -d "t=event" -d "ec=version" -d "ea=${version}" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1
curl https://www.google-analytics.com/collect -d "tid=UA-165287622-1" -d "aip=1" -d "cid=${uuidinstance}" -d "t=event" -d "ec=version" -d "ea=${version}" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1
curl https://www.google-analytics.com/collect -d "tid=UA-165287622-2" -d "aip=1" -d "cid=${uuidinstall}" -d "t=event" -d "ec=version" -d "ea=${version}" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1
curl https://www.google-analytics.com/collect -d "tid=UA-165287622-3" -d "aip=1" -d "cid=${uuidhardware}" -d "t=event" -d "ec=version" -d "ea=${version}" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1
## CPU usage of a game server.
if [ -n "${cpuusedmhzroundup}" ]; then
curl https://www.google-analytics.com/collect -d "tid=UA-655379-31" -d "aip=1" -d "cid=${uuidinstance}" -d "t=event" -d "ec=cpuused" -d "ea=${cpuusedmhzroundup}MHz" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1
curl https://www.google-analytics.com/collect -d "tid=UA-165287622-1" -d "aip=1" -d "cid=${uuidinstance}" -d "t=event" -d "ec=cpuused" -d "ea=${cpuusedmhzroundup}MHz" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1
curl https://www.google-analytics.com/collect -d "tid=UA-165287622-2" -d "aip=1" -d "cid=${uuidinstall}" -d "t=event" -d "ec=cpuused" -d "ea=${cpuusedmhzroundup}MHz" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1
curl https://www.google-analytics.com/collect -d "tid=UA-165287622-3" -d "aip=1" -d "cid=${uuidhardware}" -d "t=event" -d "ec=cpuused" -d "ea=${cpuusedmhzroundup}MHz" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1
fi
## Ram usage of a game server.
if [ -n "${memusedroundup}" ]; then
curl https://www.google-analytics.com/collect -d "tid=UA-655379-31" -d "aip=1" -d "cid=${uuidinstance}" -d "t=event" -d "ec=ramused" -d "ea=${memusedroundup}MB" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1
curl https://www.google-analytics.com/collect -d "tid=UA-165287622-1" -d "aip=1" -d "cid=${uuidinstance}" -d "t=event" -d "ec=ramused" -d "ea=${memusedroundup}MB" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1
curl https://www.google-analytics.com/collect -d "tid=UA-165287622-2" -d "aip=1" -d "cid=${uuidinstall}" -d "t=event" -d "ec=ramused" -d "ea=${memusedroundup}MB" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1
curl https://www.google-analytics.com/collect -d "tid=UA-165287622-3" -d "aip=1" -d "cid=${uuidhardware}" -d "t=event" -d "ec=ramused" -d "ea=${memusedroundup}MB" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1
fi
## Disk usage of a game server.
if [ -n "${serverfilesdu}" ]; then
curl https://www.google-analytics.com/collect -d "tid=UA-655379-31" -d "aip=1" -d "cid=${uuidinstance}" -d "t=event" -d "ec=diskused" -d "ea=${serverfilesdu}" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1
curl https://www.google-analytics.com/collect -d "tid=UA-165287622-1" -d "aip=1" -d "cid=${uuidinstance}" -d "t=event" -d "ec=diskused" -d "ea=${serverfilesdu}" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1
curl https://www.google-analytics.com/collect -d "tid=UA-165287622-2" -d "aip=1" -d "cid=${uuidinstall}" -d "t=event" -d "ec=diskused" -d "ea=${serverfilesdu}" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1
curl https://www.google-analytics.com/collect -d "tid=UA-165287622-3" -d "aip=1" -d "cid=${uuidhardware}" -d "t=event" -d "ec=diskused" -d "ea=${serverfilesdu}" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1
@ -103,7 +97,6 @@ fi
## CPU Model.
if [ -n "${cpumodel}" ]; then
curl https://www.google-analytics.com/collect -d "tid=UA-655379-31" -d "aip=1" -d "cid=${uuidinstance}" -d "t=event" -d "ec=servercpu" -d "ea=${cpumodel} ${cpucores} cores" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1
curl https://www.google-analytics.com/collect -d "tid=UA-165287622-1" -d "aip=1" -d "cid=${uuidinstance}" -d "t=event" -d "ec=servercpu" -d "ea=${cpumodel} ${cpucores} cores" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1
curl https://www.google-analytics.com/collect -d "tid=UA-165287622-2" -d "aip=1" -d "cid=${uuidinstall}" -d "t=event" -d "ec=servercpu" -d "ea=${cpumodel} ${cpucores} cores" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1
curl https://www.google-analytics.com/collect -d "tid=UA-165287622-3" -d "aip=1" -d "cid=${uuidhardware}" -d "t=event" -d "ec=servercpu" -d "ea=${cpumodel} ${cpucores} cores" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1
@ -112,7 +105,6 @@ fi
## CPU Frequency.
if [ -n "${cpufreqency}" ]; then
curl https://www.google-analytics.com/collect -d "tid=UA-655379-31" -d "aip=1" -d "cid=${uuidinstance}" -d "t=event" -d "ec=servercpufreq" -d "ea=${cpufreqency} x${cpucores}" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1
curl https://www.google-analytics.com/collect -d "tid=UA-165287622-1" -d "aip=1" -d "cid=${uuidinstance}" -d "t=event" -d "ec=servercpufreq" -d "ea=${cpufreqency} x${cpucores}" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1
curl https://www.google-analytics.com/collect -d "tid=UA-165287622-2" -d "aip=1" -d "cid=${uuidinstall}" -d "t=event" -d "ec=servercpufreq" -d "ea=${cpufreqency} x${cpucores}" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1
curl https://www.google-analytics.com/collect -d "tid=UA-165287622-3" -d "aip=1" -d "cid=${uuidhardware}" -d "t=event" -d "ec=servercpufreq" -d "ea=${cpufreqency} x${cpucores}" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1
@ -120,7 +112,6 @@ fi
## Server RAM.
if [ -n "${physmemtotal}" ]; then
curl https://www.google-analytics.com/collect -d "tid=UA-655379-31" -d "aip=1" -d "cid=${uuidinstance}" -d "t=event" -d "ec=serverram" -d "ea=${physmemtotal}" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1
curl https://www.google-analytics.com/collect -d "tid=UA-165287622-1" -d "aip=1" -d "cid=${uuidinstance}" -d "t=event" -d "ec=serverram" -d "ea=${physmemtotal}" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1
curl https://www.google-analytics.com/collect -d "tid=UA-165287622-2" -d "aip=1" -d "cid=${uuidinstall}" -d "t=event" -d "ec=serverram" -d "ea=${physmemtotal}" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1
curl https://www.google-analytics.com/collect -d "tid=UA-165287622-3" -d "aip=1" -d "cid=${uuidhardware}" -d "t=event" -d "ec=serverram" -d "ea=${physmemtotal}" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1
@ -128,17 +119,44 @@ fi
## Server Disk.
if [ -n "${totalspace}" ]; then
curl https://www.google-analytics.com/collect -d "tid=UA-655379-31" -d "aip=1" -d "cid=${uuidinstance}" -d "t=event" -d "ec=serverdisk" -d "ea=${totalspace}" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1
curl https://www.google-analytics.com/collect -d "tid=UA-165287622-1" -d "aip=1" -d "cid=${uuidinstance}" -d "t=event" -d "ec=serverdisk" -d "ea=${totalspace}" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1
curl https://www.google-analytics.com/collect -d "tid=UA-165287622-2" -d "aip=1" -d "cid=${uuidinstall}" -d "t=event" -d "ec=serverdisk" -d "ea=${totalspace}" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1
curl https://www.google-analytics.com/collect -d "tid=UA-165287622-3" -d "aip=1" -d "cid=${uuidhardware}" -d "t=event" -d "ec=serverdisk" -d "ea=${totalspace}" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1
fi
## Alert Stats.
if [ "${discordalert}" == "on" ]; then
curl https://www.google-analytics.com/collect -d "tid=UA-165287622-1" -d "aip=1" -d "cid=${uuidinstance}" -d "t=event" -d "ec=alert" -d "ea=Discord" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1
fi
if [ "${emailalert}" == "on" ]; then
curl https://www.google-analytics.com/collect -d "tid=UA-165287622-1" -d "aip=1" -d "cid=${uuidinstance}" -d "t=event" -d "ec=alert" -d "ea=Email" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1
fi
if [ "${iftttalert}" == "on" ]; then
curl https://www.google-analytics.com/collect -d "tid=UA-165287622-1" -d "aip=1" -d "cid=${uuidinstance}" -d "t=event" -d "ec=alert" -d "ea=IFTTT" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1
fi
if [ "${mailgunalert}" == "on" ]; then
curl https://www.google-analytics.com/collect -d "tid=UA-165287622-1" -d "aip=1" -d "cid=${uuidinstance}" -d "t=event" -d "ec=alert" -d "ea=Mailgun" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1
fi
if [ "${pushbulletalert}" == "on" ]; then
curl https://www.google-analytics.com/collect -d "tid=UA-165287622-1" -d "aip=1" -d "cid=${uuidinstance}" -d "t=event" -d "ec=alert" -d "ea=Pushbullet" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1
fi
if [ "${pushoveralert}" == "on" ]; then
curl https://www.google-analytics.com/collect -d "tid=UA-165287622-1" -d "aip=1" -d "cid=${uuidinstance}" -d "t=event" -d "ec=alert" -d "ea=Pushover" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1
fi
if [ "${rocketchatalert}" == "on" ]; then
curl https://www.google-analytics.com/collect -d "tid=UA-165287622-1" -d "aip=1" -d "cid=${uuidinstance}" -d "t=event" -d "ec=alert" -d "ea=Rocket Chat" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1
fi
if [ "${slackalert}" == "on" ]; then
curl https://www.google-analytics.com/collect -d "tid=UA-165287622-1" -d "aip=1" -d "cid=${uuidinstance}" -d "t=event" -d "ec=alert" -d "ea=Slack" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1
fi
if [ "${telegramalert}" == "on" ]; then
curl https://www.google-analytics.com/collect -d "tid=UA-165287622-1" -d "aip=1" -d "cid=${uuidinstance}" -d "t=event" -d "ec=alert" -d "ea=Telegram" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1
fi
## Summary Stats
curl https://www.google-analytics.com/collect -d "tid=UA-655379-31" -d "aip=1" -d "cid=${uuidinstance}" -d "t=event" -d "ec=summary" -d "ea=GAME: ${gamename} | DISTRO: ${distroname} | CPU MODEL: ${cpumodel} ${cpucores} cores | RAM: ${physmemtotal} | DISK: ${totalspace}" -d "v=1" > /dev/null 2>&1
curl https://www.google-analytics.com/collect -d "tid=UA-165287622-1" -d "aip=1" -d "cid=${uuidinstance}" -d "t=event" -d "ec=summary" -d "ea=GAME: ${gamename} | DISTRO: ${distroname} | CPU MODEL: ${cpumodel} ${cpucores} cores | RAM: ${physmemtotal} | DISK: ${totalspace}" -d "v=1" > /dev/null 2>&1
curl https://www.google-analytics.com/collect -d "tid=UA-165287622-2" -d "aip=1" -d "cid=${uuidinstall}" -d "t=event" -d "ec=summary" -d "ea=GAME: ${gamename} | DISTRO: ${distroname} | CPU MODEL: ${cpumodel} ${cpucores} cores | RAM: ${physmemtotal} | DISK: ${totalspace}" -d "v=1" > /dev/null 2>&1
curl https://www.google-analytics.com/collect -d "tid=UA-165287622-3" -d "aip=1" -d "cid=${uuidhardware}" -d "t=event" -d "ec=summary" -d "ea=GAME: ${gamename} | DISTRO: ${distroname} | CPU MODEL: ${cpumodel} ${cpucores} cores | RAM: ${physmemtotal} | DISK: ${totalspace}" -d "v=1" > /dev/null 2>&1
curl https://www.google-analytics.com/collect -d "tid=UA-165287622-1" -d "aip=1" -d "cid=${uuidinstance}" -d "t=event" -d "ec=summary" -d "ea=GAME: ${gamename} | DISTRO: ${distroname} | CPU MODEL: ${cpumodel} ${cpucores} cores | RAM: ${physmemtotal} | DISK: ${totalspace}" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1
curl https://www.google-analytics.com/collect -d "tid=UA-165287622-2" -d "aip=1" -d "cid=${uuidinstall}" -d "t=event" -d "ec=summary" -d "ea=GAME: ${gamename} | DISTRO: ${distroname} | CPU MODEL: ${cpumodel} ${cpucores} cores | RAM: ${physmemtotal} | DISK: ${totalspace}" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1
curl https://www.google-analytics.com/collect -d "tid=UA-165287622-3" -d "aip=1" -d "cid=${uuidhardware}" -d "t=event" -d "ec=summary" -d "ea=GAME: ${gamename} | DISTRO: ${distroname} | CPU MODEL: ${cpumodel} ${cpucores} cores | RAM: ${physmemtotal} | DISK: ${totalspace}" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1
fn_script_log_info "Send LinuxGSM stats"
fn_script_log_info "* uuid-${selfname}: ${uuidinstance}"

17
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

7
lgsm/functions/update_minecraft_bedrock.sh

@ -7,8 +7,11 @@
functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
#random number for userAgent
randnum=$((1 + RANDOM % 5000))
fn_update_minecraft_dl(){
latestmcbuildurl=$(curl -Ls "https://www.minecraft.net/en-us/download/server/bedrock/" | grep -o 'https://minecraft.azureedge.net/bin-linux/[^"]*zip')
latestmcbuildurl=$(curl -H "Accept-Encoding: identity" -H "Accept-Language: en" -Ls -A "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.${randnum}.212 Safari/537.36" "https://www.minecraft.net/en-us/download/server/bedrock/" | grep -o 'https://minecraft.azureedge.net/bin-linux/[^"]*zip')
fn_fetch_file "${latestmcbuildurl}" "" "" "" "${tmpdir}" "bedrock_server.${remotebuild}.zip"
echo -e "Extracting to ${serverfiles}...\c"
if [ "${firstcommandname}" == "INSTALL" ]; then
@ -79,7 +82,7 @@ fn_update_minecraft_localbuild(){
fn_update_minecraft_remotebuild(){
# Gets remote build info.
remotebuild=$(curl -Ls "https://www.minecraft.net/en-us/download/server/bedrock/" | grep -o 'https://minecraft.azureedge.net/bin-linux/[^"]*' | sed 's/.*\///' | grep -Eo "[.0-9]+[0-9]")
remotebuild=$(curl -H "Accept-Encoding: identity" -H "Accept-Language: en" -Ls -A "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.${randnum}.212 Safari/537.36" "https://www.minecraft.net/en-us/download/server/bedrock/" | grep -o 'https://minecraft.azureedge.net/bin-linux/[^"]*' | sed 's/.*\///' | grep -Eo "[.0-9]+[0-9]")
if [ "${firstcommandname}" != "INSTALL" ]; then
fn_print_dots "Checking remote build: ${remotelocation}"
# Checks if remotebuild variable has been set.

2
linuxgsm.sh

@ -20,7 +20,7 @@ if [ -f ".dev-debug" ]; then
set -x
fi
version="v21.2.4"
version="v21.2.5"
shortname="core"
gameservername="core"
commandname="CORE"

4
tests/tests_fctrserver.sh

@ -20,7 +20,7 @@ if [ -f ".dev-debug" ]; then
set -x
fi
version="v21.2.4"
version="v21.2.5"
shortname="fctr"
gameservername="fctrserver"
commandname="CORE"
@ -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}"

4
tests/tests_jc2server.sh

@ -20,7 +20,7 @@ if [ -f ".dev-debug" ]; then
set -x
fi
version="v21.2.4"
version="v21.2.5"
shortname="jc2"
gameservername="jc2server"
commandname="CORE"
@ -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}"

4
tests/tests_mcserver.sh

@ -20,7 +20,7 @@ if [ -f ".dev-debug" ]; then
set -x
fi
version="v21.2.4"
version="v21.2.5"
shortname="mc"
gameservername="mcserver"
commandname="CORE"
@ -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}"

4
tests/tests_ts3server.sh

@ -20,7 +20,7 @@ if [ -f ".dev-debug" ]; then
set -x
fi
version="v21.2.4"
version="v21.2.5"
shortname="ts3"
gameservername="ts3server"
commandname="CORE"
@ -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}"

Loading…
Cancel
Save