Browse Source

Merge branch 'develop' into feature/goldsrc-fixes

pull/4297/head
Daniel Gibbs 2 years ago
committed by GitHub
parent
commit
e0899d853e
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      .github/workflows/details-check.yml
  2. 2
      .github/workflows/labeler.yml
  3. 2
      lgsm/config-default/config-lgsm/avserver/_default.cfg
  4. 14
      lgsm/config-default/config-lgsm/rwserver/_default.cfg
  5. 15
      lgsm/config-default/config-lgsm/tiserver/_default.cfg
  6. 6
      lgsm/config-default/config-lgsm/vintsserver/_default.cfg
  7. 51
      lgsm/config-default/config-lgsm/wurmserver/_default.cfg
  8. 2
      lgsm/functions/check_status.sh
  9. 2
      lgsm/functions/command_console.sh
  10. 2
      lgsm/functions/command_send.sh
  11. 10
      lgsm/functions/command_start.sh
  12. 12
      lgsm/functions/command_stop.sh
  13. 2
      lgsm/functions/info_distro.sh
  14. 14
      lgsm/functions/info_game.sh
  15. 14
      lgsm/modules/check_last_update.sh
  16. 2
      lgsm/modules/check_status.sh
  17. 16
      lgsm/modules/check_system_dir.sh
  18. 28
      lgsm/modules/command_backup.sh
  19. 2
      lgsm/modules/command_console.sh
  20. 12
      lgsm/modules/command_debug.sh
  21. 19
      lgsm/modules/command_dev_query_raw.sh
  22. 2
      lgsm/modules/command_mods_remove.sh
  23. 195
      lgsm/modules/command_monitor.sh
  24. 2
      lgsm/modules/command_restart.sh
  25. 2
      lgsm/modules/command_send.sh
  26. 3
      lgsm/modules/command_skeleton.sh
  27. 101
      lgsm/modules/command_start.sh
  28. 30
      lgsm/modules/command_stop.sh
  29. 4
      lgsm/modules/command_ts3_server_pass.sh
  30. 3
      lgsm/modules/command_update.sh
  31. 5
      lgsm/modules/command_validate.sh
  32. 8
      lgsm/modules/core_dl.sh
  33. 2
      lgsm/modules/core_exit.sh
  34. 2
      lgsm/modules/core_functions.sh
  35. 2
      lgsm/modules/core_getopt.sh
  36. 2
      lgsm/modules/core_modules.sh
  37. 5
      lgsm/modules/core_steamcmd.sh
  38. 2
      lgsm/modules/fix_csgo.sh
  39. 13
      lgsm/modules/fix_ts3.sh
  40. 21
      lgsm/modules/fix_wurm.sh
  41. 9
      lgsm/modules/info_distro.sh
  42. 138
      lgsm/modules/info_game.sh
  43. 14
      lgsm/modules/info_messages.sh
  44. 163
      lgsm/modules/info_stats.sh
  45. 117
      lgsm/modules/install_config.sh
  46. 5
      lgsm/modules/update_factorio.sh
  47. 5
      lgsm/modules/update_jediknight2.sh
  48. 5
      lgsm/modules/update_minecraft.sh
  49. 5
      lgsm/modules/update_minecraft_bedrock.sh
  50. 5
      lgsm/modules/update_mta.sh
  51. 5
      lgsm/modules/update_papermc.sh
  52. 5
      lgsm/modules/update_steamcmd.sh
  53. 5
      lgsm/modules/update_ts3.sh
  54. 5
      lgsm/modules/update_ut99.sh
  55. 11
      lgsm/modules/update_vintagestory.sh
  56. 5
      linuxgsm.sh
  57. 2
      tests/tests_fctrserver.sh
  58. 2
      tests/tests_jc2server.sh
  59. 2
      tests/tests_mcserver.sh
  60. 2
      tests/tests_ts3server.sh

3
.github/workflows/details-check.yml

@ -42,6 +42,9 @@ jobs:
- name: Install dependencies - name: Install dependencies
run: sudo apt-get install libxml2-utils jq run: sudo apt-get install libxml2-utils jq
- name: Create serverfiles directory
run: mkdir -p serverfiles
- name: Grab server - name: Grab server
run: LGSM_GITHUBBRANCH="${GITHUB_REF#refs/heads/}" ./linuxgsm.sh ${{ matrix.shortname }}server run: LGSM_GITHUBBRANCH="${GITHUB_REF#refs/heads/}" ./linuxgsm.sh ${{ matrix.shortname }}server

2
.github/workflows/labeler.yml

@ -14,7 +14,7 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Issue Labeler - name: Issue Labeler
uses: github/issue-labeler@v3.1 uses: github/issue-labeler@v3.2
with: with:
repo-token: "${{ secrets.GITHUB_TOKEN }}" repo-token: "${{ secrets.GITHUB_TOKEN }}"
configuration-path: .github/labeler.yml configuration-path: .github/labeler.yml

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

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

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

@ -8,9 +8,6 @@
#### Game Server Settings #### #### Game Server Settings ####
## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters
javaram="2048" # -Xmx$2048M
## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters ## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters
startparameters="" startparameters=""
@ -115,7 +112,7 @@ sleeptime="0.5"
appid="339010" appid="339010"
steamcmdforcewindows="no" steamcmdforcewindows="no"
# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch # SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch
branch="" branch="unity"
betapassword="" betapassword=""
# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server # Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server
steammaster="false" steammaster="false"
@ -145,13 +142,13 @@ querytype="protocol-valve"
## Console type ## Console type
consoleverbose="yes" consoleverbose="yes"
consoleinteract="no" consoleinteract="yes"
## Game Server Details ## Game Server Details
# Do not edit # Do not edit
gamename="Rising World" gamename="Rising World"
engine="risingworld" engine="unity3d"
glibc="null" glibc="2.17"
#### Directories #### #### Directories ####
# Edit with care # Edit with care
@ -159,8 +156,7 @@ glibc="null"
## Game Server Directories ## Game Server Directories
systemdir="${serverfiles}" systemdir="${serverfiles}"
executabledir="${serverfiles}" executabledir="${serverfiles}"
preexecutable="java -Xmx${javaram}M -jar" executable="./RisingWorldServer.x64"
executable="./server.jar"
servercfgdir="${systemdir}" servercfgdir="${systemdir}"
servercfg="server.properties" servercfg="server.properties"
servercfgdefault="server.properties" servercfgdefault="server.properties"

15
lgsm/config-default/config-lgsm/tiserver/_default.cfg

@ -11,15 +11,10 @@
## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters ## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters
ip="0.0.0.0" ip="0.0.0.0"
port="7777" port="7777"
queryport="27015" defaultmap="/Game/TheIsle/Maps/Game/Isla_Spiro/Isla_Spiro"
# Possible maps, see: https://isle.fandom.com/wiki/The_Isle_Server_Settings_and_Configuration#Optional_Maps
map=""
# EAC start parameters
eaclaunch="-ini:Engine:[EpicOnlineServices]:DedicatedServerClientId=xyza7891gk5PRo3J7G9puCJGFJjmEguW -ini:Engine:[EpicOnlineServices]:DedicatedServerClientSecret=pKWl6t5i9NJK8gTpVlAxzENZ65P8hYzodV8Dqe5Rlc8"
## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters ## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters
startparameters="${map} -MultiHome=${ip} -Port=${port} -QueryPort=${queryport} -log ${eaclaunch}" startparameters="${defaultmap} -Port=${port} -log"
#### LinuxGSM Settings #### #### LinuxGSM Settings ####
@ -125,7 +120,7 @@ steamcmdforcewindows="no"
branch="evrima" branch="evrima"
betapassword="" betapassword=""
# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server # Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server
steammaster="true" steammaster="false"
## Stop Mode | https://docs.linuxgsm.com/features/stop-mode ## Stop Mode | https://docs.linuxgsm.com/features/stop-mode
# 1: tmux kill # 1: tmux kill
@ -147,8 +142,8 @@ stopmode="2"
# 3: gamedig # 3: gamedig
# 4: gsquery # 4: gsquery
# 5: tcp # 5: tcp
querymode="2" querymode="1"
querytype="protocol-valve" querytype=""
## Console type ## Console type
consoleverbose="yes" consoleverbose="yes"

6
lgsm/config-default/config-lgsm/vintsserver/_default.cfg

@ -9,7 +9,7 @@
#### Game Server Settings #### #### Game Server Settings ####
## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters ## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters
startparameters="--datapath ${servercfgdir}" startparameters="--dataPath ${servercfgdir}"
## Release Settings | https://docs.linuxgsm.com/game-servers/vintagestory#release-settings ## Release Settings | https://docs.linuxgsm.com/game-servers/vintagestory#release-settings
# Branch (stable|unstable) # Branch (stable|unstable)
@ -150,8 +150,8 @@ glibc="2.17"
## Game Server Directories ## Game Server Directories
systemdir="${serverfiles}" systemdir="${serverfiles}"
executabledir="${systemdir}" executabledir="${systemdir}"
preexecutable="mono" preexecutable=""
executable="./VintagestoryServer.exe" executable="./VintagestoryServer"
servercfgdir="${serverfiles}/data/${selfname}" servercfgdir="${serverfiles}/data/${selfname}"
servercfg="serverconfig.json" servercfg="serverconfig.json"
servercfgdefault="serverconfig.json" servercfgdefault="serverconfig.json"

51
lgsm/config-default/config-lgsm/wurmserver/_default.cfg

@ -8,9 +8,52 @@
#### Game Server Settings #### #### Game Server Settings ####
## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters
# https://www.wurmpedia.com/index.php/Server_administration_(Wurm_Unlimited)
# Game mode (Creative|Adventure)
gamemode="Creative"
# The kingdom the server belongs to.
# If you're using the Adventure base, use 1, 2, or 3.
# If you're using Creative, use 4.
# Kingdom numbers:
# 0 - No kingdom
# 1 - Jen-Kellon
# 2 - Mol-Rehan
# 3 - Horde of the Summoned
# 4 - Freedom
homekingdom="4"
# Unlocks the admin commands from within the game, that can be used to change
# the gameplay settings of the server, such as skill gain rate and field growth time.
adminpassword="ADMINPASSWORD"
# If true the server will follow the rules from the Epic servers in Wurm Online.
# For instance it will use the skill curve.
epicsettings="false"
# If the server is a home server (belongs to a single kingdom).
homeserver="true"
# Defaults to true, should only be set to false if the server is intended to be
# connected with another server that is going to act as a loginserver.
loginserver="true"
# Used for server to server communication.
rmiport="7221"
rmiregport="7220"
maxplayers="200"
servername="LinuxGSM"
serverpassword=""
ip="0.0.0.0"
port="3724"
queryport="27016"
## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters ## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters
# Parameters are edited in the game server config file. # Parameters are edited in the game server config file.
startparameters="ADMINPWD=\"$ADMINPWD\" EPICSETTINGS=\"$EPICSETTINGS\" EXTERNALPORT=\"$EXTERNALPORT\" HOMESERVER=\"$HOMESERVER\" HOMEKINGDOM=\"$HOMEKINGDOM\" LOGINSERVER=\"$LOGINSERVER\" MAXPLAYERS=\"$MAXPLAYERS\" QUERYPORT=\"$QUERYPORT\" SERVERNAME=\"$SERVERNAME\" SERVERPASSWORD=\"$SERVERPASSWORD\" START=\"$START\" IP=\"$IP\"" startparameters="start=${gamemode} adminpwd='${adminpassword}' epicsettings='${epicsettings}' externalport='${port}' homeserver='${homeserver}' homekingdom='${homekingdom}' loginserver='${loginserver}' maxplayers='${maxplayers}' queryport='${queryport}' rmiport='${rmiport}' rmiregport='${rmiregport}' servername='${servername}' serverpassword='${serverpassword}' ip='${ip}'"
#### LinuxGSM Settings #### #### LinuxGSM Settings ####
@ -157,13 +200,7 @@ glibc="2.14"
## Game Server Directories ## Game Server Directories
systemdir="${serverfiles}" systemdir="${serverfiles}"
executabledir="${systemdir}" executabledir="${systemdir}"
preexecutable="xvfb-run"
executable="./WurmServerLauncher" executable="./WurmServerLauncher"
servercfgdir="${systemdir}"
servercfg="${selfname}.cfg"
servercfgdefault="server.cfg"
servercfgfullpath="${servercfgdir}/${servercfg}"
source "${servercfgfullpath}"
## Backup Directory ## Backup Directory
backupdir="${lgsmdir}/backup" backupdir="${lgsmdir}/backup"

2
lgsm/functions/check_status.sh

@ -7,4 +7,4 @@
functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
status=$(tmux list-sessions -F "#{session_name}" 2> /dev/null | grep -Ecx "^${sessionname}") status=$(tmux -L "${sessionname}" list-sessions -F "#{session_name}" 2>/dev/null | grep -Ecx "^${sessionname}")

2
lgsm/functions/command_console.sh

@ -42,7 +42,7 @@ check_status.sh
if [ "${status}" != "0" ]; then if [ "${status}" != "0" ]; then
fn_print_ok_nl "Accessing console" fn_print_ok_nl "Accessing console"
fn_script_log_pass "Console accessed" fn_script_log_pass "Console accessed"
tmux attach-session -t "${sessionname}" tmux -L "${sessionname}" attach-session -t "${sessionname}"
fn_print_ok_nl "Closing console" fn_print_ok_nl "Closing console"
fn_script_log_pass "Console closed" fn_script_log_pass "Console closed"
else else

2
lgsm/functions/command_send.sh

@ -26,7 +26,7 @@ if [ "${status}" != "0" ]; then
fi fi
echo "" echo ""
fn_print_dots "Sending command to console: \"${commandtosend}\"" fn_print_dots "Sending command to console: \"${commandtosend}\""
tmux send-keys -t "${servicename}" "${commandtosend}" ENTER tmux -L "${sessionname}" send-keys -t "${servicename}" "${commandtosend}" ENTER
fn_print_ok_nl "Sending command to console: \"${commandtosend}\"" fn_print_ok_nl "Sending command to console: \"${commandtosend}\""
fn_script_log_pass "Command \"${commandtosend}\" sent to console" fn_script_log_pass "Command \"${commandtosend}\" sent to console"
else else

10
lgsm/functions/command_start.sh

@ -37,7 +37,7 @@ fn_start_teamspeak3() {
# Used to allow update to detect JK2MV server version. # Used to allow update to detect JK2MV server version.
fn_start_jk2() { fn_start_jk2() {
fn_start_tmux fn_start_tmux
tmux send -t "${sessionname}" version ENTER > /dev/null 2>&1 tmux -L "${sessionname}" send -t "${sessionname}" version ENTER > /dev/null 2>&1
} }
fn_start_tmux() { fn_start_tmux() {
@ -80,7 +80,7 @@ fn_start_tmux() {
cd "${executabledir}" || exit cd "${executabledir}" || exit
fi fi
tmux new-session -d -x "${sessionwidth}" -y "${sessionheight}" -s "${sessionname}" "${preexecutable} ${executable} ${startparameters}" 2> "${lgsmlogdir}/.${selfname}-tmux-error.tmp" tmux -L "${sessionname}" new-session -d -x "${sessionwidth}" -y "${sessionheight}" -s "${sessionname}" "${preexecutable} ${executable} ${startparameters}" 2> "${lgsmlogdir}/.${selfname}-tmux-error.tmp"
# Create logfile. # Create logfile.
touch "${consolelog}" touch "${consolelog}"
@ -94,9 +94,9 @@ fn_start_tmux() {
echo -e "tmux version: master (user compiled)" >> "${consolelog}" echo -e "tmux version: master (user compiled)" >> "${consolelog}"
if [ "${consolelogging}" == "on" ] || [ -z "${consolelogging}" ]; then if [ "${consolelogging}" == "on" ] || [ -z "${consolelogging}" ]; then
if [ "$logtimestamp" == "on" ]; then if [ "$logtimestamp" == "on" ]; then
tmux pipe-pane -o -t "${sessionname}" "exec bash -c \"cat | $addtimestamp\" >> '${consolelog}'" tmux -L "${sessionname}" pipe-pane -o -t "${sessionname}" "exec bash -c \"cat | $addtimestamp\" >> '${consolelog}'"
else else
tmux pipe-pane -o -t "${sessionname}" "exec cat >> '${consolelog}'" tmux -L "${sessionname}" pipe-pane -o -t "${sessionname}" "exec cat >> '${consolelog}'"
fi fi
fi fi
@ -143,7 +143,7 @@ fn_start_tmux() {
echo -e "" echo -e ""
echo -e "Command" echo -e "Command"
echo -e "=================================" echo -e "================================="
echo -e "tmux new-session -d -s \"${sessionname}\" \"${preexecutable} ${executable} ${startparameters}\"" | tee -a "${lgsmlog}" echo -e "tmux -L \"${sessionname}\" new-session -d -s \"${sessionname}\" \"${preexecutable} ${executable} ${startparameters}\"" | tee -a "${lgsmlog}"
echo -e "" echo -e ""
echo -e "Error" echo -e "Error"
echo -e "=================================" echo -e "================================="

12
lgsm/functions/command_stop.sh

@ -15,7 +15,7 @@ fn_stop_graceful_ctrlc() {
fn_print_dots "Graceful: CTRL+c" fn_print_dots "Graceful: CTRL+c"
fn_script_log_info "Graceful: CTRL+c" fn_script_log_info "Graceful: CTRL+c"
# Sends quit. # Sends quit.
tmux send-keys -t "${sessionname}" C-c > /dev/null 2>&1 tmux -L "${sessionname}" send-keys -t "${sessionname}" C-c > /dev/null 2>&1
# Waits up to 30 seconds giving the server time to shutdown gracefuly. # Waits up to 30 seconds giving the server time to shutdown gracefuly.
for seconds in {1..30}; do for seconds in {1..30}; do
check_status.sh check_status.sh
@ -43,7 +43,7 @@ fn_stop_graceful_cmd() {
fn_print_dots "Graceful: sending \"${1}\"" fn_print_dots "Graceful: sending \"${1}\""
fn_script_log_info "Graceful: sending \"${1}\"" fn_script_log_info "Graceful: sending \"${1}\""
# Sends specific stop command. # Sends specific stop command.
tmux send -t "${sessionname}" ENTER "${1}" ENTER > /dev/null 2>&1 tmux -L "${sessionname}" send -t "${sessionname}" ENTER "${1}" ENTER > /dev/null 2>&1
# Waits up to ${seconds} seconds giving the server time to shutdown gracefully. # Waits up to ${seconds} seconds giving the server time to shutdown gracefully.
for ((seconds = 1; seconds <= ${2}; seconds++)); do for ((seconds = 1; seconds <= ${2}; seconds++)); do
check_status.sh check_status.sh
@ -71,7 +71,7 @@ fn_stop_graceful_goldsrc() {
fn_print_dots "Graceful: sending \"quit\"" fn_print_dots "Graceful: sending \"quit\""
fn_script_log_info "Graceful: sending \"quit\"" fn_script_log_info "Graceful: sending \"quit\""
# sends quit # sends quit
tmux send -t "${sessionname}" quit ENTER > /dev/null 2>&1 tmux -L "${sessionname}" send -t "${sessionname}" quit ENTER > /dev/null 2>&1
# Waits 3 seconds as goldsrc servers restart with the quit command. # Waits 3 seconds as goldsrc servers restart with the quit command.
for seconds in {1..3}; do for seconds in {1..3}; do
sleep 1 sleep 1
@ -184,10 +184,10 @@ fn_stop_graceful_avorion() {
fn_print_dots "Graceful: /save /stop" fn_print_dots "Graceful: /save /stop"
fn_script_log_info "Graceful: /save /stop" fn_script_log_info "Graceful: /save /stop"
# Sends /save. # Sends /save.
tmux send-keys -t "${sessionname}" /save ENTER > /dev/null 2>&1 tmux -L "${sessionname}" send-keys -t "${sessionname}" /save ENTER > /dev/null 2>&1
sleep 5 sleep 5
# Sends /quit. # Sends /quit.
tmux send-keys -t "${sessionname}" /stop ENTER > /dev/null 2>&1 tmux -L "${sessionname}" send-keys -t "${sessionname}" /stop ENTER > /dev/null 2>&1
# Waits up to 30 seconds giving the server time to shutdown gracefuly. # Waits up to 30 seconds giving the server time to shutdown gracefuly.
for seconds in {1..30}; do for seconds in {1..30}; do
check_status.sh check_status.sh
@ -240,7 +240,7 @@ fn_stop_tmux() {
fn_print_dots "${servername}" fn_print_dots "${servername}"
fn_script_log_info "tmux kill-session: ${sessionname}: ${servername}" fn_script_log_info "tmux kill-session: ${sessionname}: ${servername}"
# Kill tmux session. # Kill tmux session.
tmux kill-session -t "${sessionname}" > /dev/null 2>&1 tmux -L "${sessionname}" kill-session -t "${sessionname}" > /dev/null 2>&1
sleep 0.5 sleep 0.5
check_status.sh check_status.sh
if [ "${status}" == "0" ]; then if [ "${status}" == "0" ]; then

2
lgsm/functions/info_distro.sh

@ -10,7 +10,7 @@ functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
### Game Server pid ### Game Server pid
if [ "${status}" == "1" ]; then if [ "${status}" == "1" ]; then
gameserverpid="$(tmux list-sessions -F "#{session_name} #{pane_pid}" | grep "^${sessionname} " | awk '{print $NF}')" gameserverpid="$(tmux -L "${sessionname}" list-sessions -F "#{session_name} #{pane_pid}" | grep "^${sessionname} " | awk '{print $NF}')"
if [ "${engine}" == "source" ]; then if [ "${engine}" == "source" ]; then
srcdslinuxpid="$(ps -ef | grep -v grep | grep "${gameserverpid}" | grep srcds_linux | awk '{print $2}')" srcdslinuxpid="$(ps -ef | grep -v grep | grep "${gameserverpid}" | grep srcds_linux | awk '{print $2}')"
elif [ "${engine}" == "goldsrc" ]; then elif [ "${engine}" == "goldsrc" ]; then

14
lgsm/functions/info_game.sh

@ -97,17 +97,17 @@ fn_info_game_armar() {
if [ ! -f "${servercfgfullpath}" ]; then if [ ! -f "${servercfgfullpath}" ]; then
adminpassword="${unavailable}" adminpassword="${unavailable}"
maxplayers="${zero}" maxplayers="${zero}"
port=${port:-"0"} port="${zero}"
queryport= queryport="${zero}"
servername="${unavailable}" servername="${unavailable}"
serverpassword="${unavailable}" serverpassword="${unavailable}"
else else
adminpassword=$(jq -r '.adminPassword' "${servercfgfullpath}") adminpassword=$(jq -r '.game.passwordAdmin' "${servercfgfullpath}")
battleeyeport=1376 battleeyeport=1376
configip=$(jq -r '.gameHostBindAddress' "${servercfgfullpath}") configip=$(jq -r '.bindAddress' "${servercfgfullpath}")
maxplayers=$(jq -r '.game.playerCountLimit' "${servercfgfullpath}") maxplayers=$(jq -r '.game.maxPlayers' "${servercfgfullpath}")
port=$(jq -r '.gameHostBindPort' "${servercfgfullpath}") port=$(jq -r '.bindPort' "${servercfgfullpath}")
queryport=$(jq -r '.steamQueryPort' "${servercfgfullpath}") queryport=$(jq -r '.a2s.port' "${servercfgfullpath}")
servername=$(jq -r '.game.name' "${servercfgfullpath}") servername=$(jq -r '.game.name' "${servercfgfullpath}")
serverpassword=$(jq -r '.game.password' "${servercfgfullpath}") serverpassword=$(jq -r '.game.password' "${servercfgfullpath}")

14
lgsm/modules/check_last_update.sh

@ -3,21 +3,21 @@
# Author: Daniel Gibbs # Author: Daniel Gibbs
# Contributors: http://linuxgsm.com/contrib # Contributors: http://linuxgsm.com/contrib
# Website: https://linuxgsm.com # Website: https://linuxgsm.com
# Description: Checks lock file to see when last update happened. # Description: Checks Lockfile to see when last update happened.
# Will reboot server if instance not rebooted since update. # Will reboot server if instance not rebooted since update.
moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
if [ -f "${lockdir}/${selfname}-laststart.lock" ]; then if [ -f "${lockdir}/${selfname}-last-started.lock" ]; then
laststart=$(cat "${lockdir}/${selfname}-laststart.lock") laststart=$(cat "${lockdir}/${selfname}-last-started.lock")
fi fi
if [ -f "${lockdir}/lastupdate.lock" ]; then if [ -f "${lockdir}/last-updated.lock" ]; then
lastupdate=$(cat "${lockdir}/lastupdate.lock") lastupdate=$(cat "${lockdir}/last-updated.lock")
fi fi
check_status.sh check_status.sh
if [ -f "${lockdir}/lastupdate.lock" ] && [ "${status}" != "0" ]; then if [ -f "${lockdir}/last-updated.lock" ] && [ "${status}" != "0" ]; then
if [ ! -f "${lockdir}/${selfname}-laststart.lock" ] || [ "${laststart}" -lt "${lastupdate}" ]; then if [ ! -f "${lockdir}/${selfname}-last-started.lock" ] || [ "${laststart}" -lt "${lastupdate}" ]; then
fn_print_info "${selfname} has not been restarted since last update" fn_print_info "${selfname} has not been restarted since last update"
fn_script_log_info "${selfname} has not been restarted since last update" fn_script_log_info "${selfname} has not been restarted since last update"
command_restart.sh command_restart.sh

2
lgsm/modules/check_status.sh

@ -7,4 +7,4 @@
moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
status=$(tmux list-sessions -F "#{session_name}" 2> /dev/null | grep -Ecx "^${sessionname}") status=$(tmux -L "${socketname}" list-sessions -F "#{session_name}" 2> /dev/null | grep -Ecx "^${sessionname}")

16
lgsm/modules/check_system_dir.sh

@ -7,16 +7,18 @@
moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
if [ "${commandname}" != "VALIDATE" ]; then if [ ! -d "${serverfiles}" ]; then
checkdir="${serverfiles}" fn_print_fail_nl "Cannot access ${serverfiles}: No such directory"
else if [ -d "${lgsmlogdir}" ]; then
checkdir="${systemdir}" fn_script_log_fatal "Cannot access ${serverfiles}: No such directory."
fi
core_exit.sh
fi fi
if [ ! -d "${checkdir}" ]; then if [ ! -d "${systemdir}" ]; then
fn_print_fail_nl "Cannot access ${checkdir}: No such directory" fn_print_fail_nl "Cannot access ${systemdir}: No such directory"
if [ -d "${lgsmlogdir}" ]; then if [ -d "${lgsmlogdir}" ]; then
fn_script_log_fatal "Cannot access ${checkdir}: No such directory." fn_script_log_fatal "Cannot access ${systemdir}: No such directory."
fi fi
core_exit.sh core_exit.sh
fi fi

28
lgsm/modules/command_backup.sh

@ -22,7 +22,7 @@ fn_backup_trap() {
echo -en "backup ${backupname}.tar.gz..." echo -en "backup ${backupname}.tar.gz..."
fn_print_removed_eol_nl fn_print_removed_eol_nl
fn_script_log_info "Backup ${backupname}.tar.gz: REMOVED" fn_script_log_info "Backup ${backupname}.tar.gz: REMOVED"
# Remove lock file. # Remove backup lockfile.
rm -f "${lockdir:?}/backup.lock" rm -f "${lockdir:?}/backup.lock"
fn_backup_start_server fn_backup_start_server
unset exitbypass unset exitbypass
@ -31,9 +31,21 @@ fn_backup_trap() {
# Check if a backup is pending or has been aborted using backup.lock. # Check if a backup is pending or has been aborted using backup.lock.
fn_backup_check_lockfile() { fn_backup_check_lockfile() {
# Remove stale lockfile.
if [ -f "${lockdir}/backup.lock" ]; then if [ -f "${lockdir}/backup.lock" ]; then
fn_print_info_nl "Lock file found: Backup is currently running" if [ "$(find "${lockdir}/backup.lock" -mmin +60)" ]; then
fn_script_log_error "Lock file found: Backup is currently running: ${lockdir}/backup.lock" fn_print_dots "Lockfile found: "
fn_print_checking_eol
fn_print_warn "Lockfile found: Removing stale lockfile: "
fn_print_warn_eol
fn_script_log_warn "Lockfile found: Removing stale lockfile"
rm -f "${lockdir:?}/backup.lock"
fi
fi
if [ -f "${lockdir}/backup.lock" ]; then
fn_print_info_nl "Lockfile found: Backup is currently running"
fn_script_log_error "Lockfile found: Backup is currently running: ${lockdir}/backup.lock"
core_exit.sh core_exit.sh
fi fi
} }
@ -117,8 +129,8 @@ fn_backup_migrate_olddir() {
fn_backup_create_lockfile() { fn_backup_create_lockfile() {
# Create lockfile. # Create lockfile.
date '+%s' > "${lockdir}/backup.lock" date '+%s' > "${lockdir:?}/backup.lock"
fn_script_log_info "Lockfile generated" fn_script_log_info "Backup lockfile generated"
fn_script_log_info "${lockdir}/backup.lock" fn_script_log_info "${lockdir}/backup.lock"
# trap to remove lockfile on quit. # trap to remove lockfile on quit.
trap fn_backup_trap INT trap fn_backup_trap INT
@ -140,7 +152,7 @@ fn_backup_compression() {
core_exit.sh core_exit.sh
fi fi
tar -czf "${backupdir}/${backupname}.tar.gz" -C "${rootdir}" --exclude "${excludedir}" --exclude "${lockdir}/backup.lock" ./. tar -czf "${backupdir}/${backupname}.tar.gz" -C "${rootdir}" --exclude "${excludedir}" --exclude "${lockdir}" ./.
local exitcode=$? local exitcode=$?
if [ "${exitcode}" != 0 ]; then if [ "${exitcode}" != 0 ]; then
fn_print_fail_eol fn_print_fail_eol
@ -153,8 +165,6 @@ fn_backup_compression() {
fn_print_ok_nl "Completed: ${backupname}.tar.gz, total size $(du -sh "${backupdir}/${backupname}.tar.gz" | awk '{print $1}')" fn_print_ok_nl "Completed: ${backupname}.tar.gz, total size $(du -sh "${backupdir}/${backupname}.tar.gz" | awk '{print $1}')"
fn_script_log_pass "Backup created: ${backupname}.tar.gz, total size $(du -sh "${backupdir}/${backupname}.tar.gz" | awk '{print $1}')" fn_script_log_pass "Backup created: ${backupname}.tar.gz, total size $(du -sh "${backupdir}/${backupname}.tar.gz" | awk '{print $1}')"
fi fi
# Remove lock file
rm -f "${lockdir:?}/backup.lock"
} }
# Clear old backups according to maxbackups and maxbackupdays variables. # Clear old backups according to maxbackups and maxbackupdays variables.
@ -265,4 +275,6 @@ fn_backup_compression
fn_backup_prune fn_backup_prune
fn_backup_start_server fn_backup_start_server
# Remove backup lockfile.
rm -f "${lockdir:?}/backup.lock"
core_exit.sh core_exit.sh

2
lgsm/modules/command_console.sh

@ -42,7 +42,7 @@ check_status.sh
if [ "${status}" != "0" ]; then if [ "${status}" != "0" ]; then
fn_print_ok_nl "Accessing console" fn_print_ok_nl "Accessing console"
fn_script_log_pass "Console accessed" fn_script_log_pass "Console accessed"
tmux attach-session -t "${sessionname}" tmux -L "${socketname}" attach-session -t "${sessionname}"
fn_print_ok_nl "Closing console" fn_print_ok_nl "Closing console"
fn_script_log_pass "Console closed" fn_script_log_pass "Console closed"
else else

12
lgsm/modules/command_debug.sh

@ -13,7 +13,7 @@ fn_firstcommand_set
# Trap to remove lockfile on quit. # Trap to remove lockfile on quit.
fn_lockfile_trap() { fn_lockfile_trap() {
# Remove lockfile. # Remove lockfile.
rm -f "${lockdir:?}/${selfname}.lock" rm -f "${lockdir:?}/${selfname}-started.lock"
# resets terminal. Servers can sometimes mess up the terminal on exit. # resets terminal. Servers can sometimes mess up the terminal on exit.
reset reset
fn_print_dots "Stopping debug" fn_print_dots "Stopping debug"
@ -98,12 +98,12 @@ fn_print_dots "Starting debug"
fn_script_log_info "Starting debug" fn_script_log_info "Starting debug"
fn_print_ok_nl "Starting debug" fn_print_ok_nl "Starting debug"
# Create lockfile. # Create started lockfile.
date '+%s' > "${lockdir}/${selfname}.lock" date '+%s' > "${lockdir:?}/${selfname}-started.lock"
echo "${version}" >> "${lockdir}/${selfname}.lock" echo "${version}" >> "${lockdir}/${selfname}-started.lock"
echo "${port}" >> "${lockdir}/${selfname}.lock" echo "${port}" >> "${lockdir}/${selfname}-started.lock"
fn_script_log_info "Lockfile generated" fn_script_log_info "Lockfile generated"
fn_script_log_info "${lockdir}/${selfname}.lock" fn_script_log_info "${lockdir}/${selfname}-started.lock"
if [ "${shortname}" == "av" ]; then if [ "${shortname}" == "av" ]; then
cd "${systemdir}" || exit cd "${systemdir}" || exit

19
lgsm/modules/command_dev_query_raw.sh

@ -32,25 +32,6 @@ echo -e "=================================================================="
else else
echo -e "Game:" echo -e "Game:"
fi fi
if [ "${shortname}" == "rw" ]; then
if [ -v port2 ]; then
echo -e "Game+1: \t${port2} \t$(ss -tupl | grep -c "${port}") \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 -c "${port}") \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 -c "${port}") \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 [ "${shortname}" == "pvr" ]; then if [ "${shortname}" == "pvr" ]; then
if [ -v port401 ]; then if [ -v port401 ]; then
echo -e "Game+400: \t${port401} \t$(ss -tupl | grep -c "${port401}") \t$(ss -tupl | grep "${port401}" | grep tcp | awk '{ print $2 }') \t$(ss -tupl | grep "${port401}" | grep udp | awk '{ print $2 }')" echo -e "Game+400: \t${port401} \t$(ss -tupl | grep -c "${port401}") \t$(ss -tupl | grep "${port401}" | grep tcp | awk '{ print $2 }') \t$(ss -tupl | grep "${port401}" | grep udp | awk '{ print $2 }')"

2
lgsm/modules/command_mods_remove.sh

@ -131,7 +131,7 @@ fi
if [ "${engine}" == "unity3d" ] && [[ "${modprettyname}" == *"Oxide"* ]]; then if [ "${engine}" == "unity3d" ] && [[ "${modprettyname}" == *"Oxide"* ]]; then
fn_print_information_nl "Validating to restore original ${gamename} files replaced by Oxide" fn_print_information_nl "Validating to restore original ${gamename} files replaced by Oxide"
fn_script_log "Validating to restore original ${gamename} files replaced by Oxide" fn_script_log "Validating to restore original ${gamename} files replaced by Oxide"
exitbypass="1" exitbypass=1
command_validate.sh command_validate.sh
fn_firstcommand_reset fn_firstcommand_reset
unset exitbypass unset exitbypass

195
lgsm/modules/command_monitor.sh

@ -11,87 +11,181 @@ commandaction="Monitoring"
moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
fn_firstcommand_set fn_firstcommand_set
fn_monitor_check_lockfile() { fn_monitor_check_monitoring() {
# Monitor does not run if lockfile is not found. # Monitor does not run if lockfile is not found.
if [ ! -f "${lockdir}/${selfname}.lock" ]; then if [ ! -f "${lockdir}/${selfname}-monitoring.lock" ]; then
fn_print_dots "Checking lockfile: " fn_print_dots "Checking lockfile: "
fn_print_checking_eol fn_print_checking_eol
fn_script_log_info "Checking lockfile: CHECKING" fn_script_log_info "Checking lockfile: CHECKING"
fn_monitor_check_update
fn_monitor_check_backup
fn_monitor_check_debug
fn_print_error "Checking lockfile: No lockfile found: " fn_print_error "Checking lockfile: No lockfile found: "
fn_print_error_eol_nl fn_print_error_eol_nl
fn_script_log_error "Checking lockfile: No lockfile found: ERROR" fn_script_log_error "Checking lockfile: No lockfile found: ERROR"
echo -e "* Start ${selfname} to run monitor." echo -e "* Start ${selfname} to run monitor."
core_exit.sh core_exit.sh
fi fi
}
# Fix if lockfile is not unix time or contains letters fn_monitor_check_install() {
if [ -f "${lockdir}/${selfname}.lock" ] && [[ "$(head -n 1 "${lockdir}/${selfname}.lock")" =~ [A-Za-z] ]]; then if [ "$(pgrep -fc -u "${USER}" "${selfname} install")" != "0" ] || [ "$(pgrep -fc -u "${USER}" "${selfname} i")" != "0" ] || [ "$(pgrep -fc -u "${USER}" "${selfname} auto-install")" != "0" ] || [ "$(pgrep -fc -u "${USER}" "${selfname} ai")" != "0" ]; then
date '+%s' > "${lockdir}/${selfname}.lock" fn_print_dots "Checking installer: "
echo "${version}" >> "${lockdir}/${selfname}.lock" fn_print_checking_eol
echo "${port}" >> "${lockdir}/${selfname}.lock" fn_script_log_info "Checking installer: CHECKING"
fn_print_info "Checking installer: Installer is : "
fn_print_info_eol
fn_script_log_pass "Checking installer: LinuxGSM is installing"
core_exit.sh
fi fi
} }
fn_monitor_check_backup() { fn_monitor_check_debug() {
# Monitor will check if backup is running. if [ "$(pgrep -fc -u "${USER}" "${selfname} debug")" != "0" ] || [ "$(pgrep -fc -u "${USER}" "${selfname} d")" != "0" ]; then
if [ "$(pgrep "${selfname} backup" | wc -l)" != "0" ] || [ "$(pgrep "${selfname} b" | wc -l)" != "0" ]; then fn_print_dots "Checking debug: "
fn_print_info_nl "Checking lockfile: LinuxGSM is currently running a backup: " fn_print_checking_eol
fn_print_info "Checking debug: Debug is running: "
fn_print_info_eol fn_print_info_eol
fn_script_log_info "Checking lockfile: LinuxGSM is currently running a backup" fn_script_log_pass "Checking debug: Debug is running"
core_exit.sh core_exit.sh
fi fi
} }
fn_monitor_check_debug() { fn_monitor_check_starting(){
# Monitor will check if backup is running. # Remove stale lockfile.
if [ "$(pgrep -fc "${selfname} backup")" != "0" ] || [ "$(pgrep -fc "${selfname} b")" != "0" ]; then if [ -f "${lockdir}/${selfname}-starting.lock" ]; then
fn_print_info_nl "Checking lockfile: LinuxGSM is currently in debug mode: " if [ "$(find "${lockdir}/${selfname}-starting.lock" -mmin +5)" ]; then
fn_print_dots "Checking start: "
fn_print_checking_eol
fn_print_warn "Checking start: Removing stale lockfile: "
fn_print_warn_eol
fn_script_log_warn "Checking start: Removing stale lockfile"
rm -f "${lockdir:?}/${selfname}-starting.lock"
fi
fi
if [ -f "${lockdir}/${selfname}-starting.lock" ] && [[ "$(pgrep -fc -u "${USER}" "${selfname} start")" != "0" || "$(pgrep -fc -u "${USER}" "${selfname} s")" != "0" ]]; then
fn_print_dots "Checking start: "
fn_print_checking_eol
fn_print_info "Checking start: LinuxGSM is starting: "
fn_print_info_eol fn_print_info_eol
fn_script_log_pass "Checking lockfile: LinuxGSM is currently in debug mode" fn_script_log_info "Checking backup: LinuxGSM is starting"
core_exit.sh core_exit.sh
fi fi
} }
fn_monitor_check_install() { fn_monitor_check_stopping(){
# Monitor will check if update is running. # Remove stale lockfile.
if [ "$(pgrep -fc "${selfname} install")" != "0" ] || [ "$(pgrep -fc "${selfname} i")" != "0" ] || [ "$(pgrep -fc "${selfname} auto-install")" != "0" ] || [ "$(pgrep -fc "${selfname} ai")" != "0" ]; then if [ -f "${lockdir}/${selfname}-stopping.lock" ]; then
fn_print_dots "Checking for installer: " if [ "$(find "${lockdir}/${selfname}-stopping.lock" -mmin +5)" ]; then
fn_print_dots "Checking stop: "
fn_print_checking_eol
fn_print_warn "Checking stop: Removing stale lockfile: "
fn_print_warn_eol
fn_script_log_warn "Checking stop: Removing stale lockfile"
rm -f "${lockdir:?}/${selfname}-stopping.lock"
fi
fi
if [ -f "${lockdir}/${selfname}-stopping.lock" ] && [[ "$(pgrep -fc -u "${USER}" "${selfname} stop")" != "0" || "$(pgrep -fc -u "${USER}" "${selfname} s")" != "0" ]]; then
fn_print_dots "Checking stop: "
fn_print_checking_eol fn_print_checking_eol
fn_script_log_info "Checking for installer: CHECKING" fn_print_info "Checking stop: LinuxGSM is stopping: "
fn_print_info_nl "Checking for installer: LinuxGSM is currently installing: "
fn_print_info_eol fn_print_info_eol
fn_script_log_pass "Checking for installer: LinuxGSM is currently installing" fn_script_log_info "Checking backup: LinuxGSM is stopping"
core_exit.sh core_exit.sh
fi fi
} }
fn_monitor_check_update() { fn_monitor_check_backup() {
# Specific check for docker. Will ignore the command watch -n 1800 ./csgoserver update # Remove stale lockfile.
monitorps=0 if [ -f "${lockdir}/backup.lock" ]; then
if [ "$(pgrep -fc "n*${selfname} update")" != "0" ]; then if [ "$(find "${lockdir}/backup.lock" -mmin +60)" ]; then
monitorps="$((monitorps - 1))" fn_print_dots "Checking backup: "
fn_print_checking_eol
fn_print_warn "Checking backup: Removing stale lockfile: "
fn_print_warn_eol
fn_script_log_warn "Checking backup: Removing stale lockfile"
rm -f "${lockdir:?}/backup.lock"
fi
fi
if [ -f "${lockdir}/backup.lock" ] && [[ "$(pgrep -fc -u "${USER}" "${selfname} backup")" != "0" || "$(pgrep -fc -u "${USER}" "${selfname} b")" != "0" ]]; then
fn_print_dots "Checking backup: "
fn_print_checking_eol
fn_print_info "Checking backup: Backup is running: "
fn_print_info_eol
fn_script_log_info "Checking backup: Backup is running"
core_exit.sh
fi fi
# Monitor will check if an update is running. }
if [ "$(pgrep -fc "${selfname} update")" != "0" ] || [ "$(pgrep -fc "${selfname} u")" != "0" ] || [ "$(pgrep -fc "${selfname} validate")" != "0" ] || [ "$(pgrep -fc "${selfname} v")" != "0" ]; then
monitorps="$((monitorps + 2))" fn_monitor_check_update() {
if [ "${monitorps}" != "0" ]; then # Remove stale lockfile.
fn_print_info_nl "Checking lockfile: LinuxGSM is currently updating: " if [ -f "${lockdir}/update.lock" ]; then
fn_print_info_eol if [ "$(find "${lockdir}/update.lock" -mmin +15)" ]; then
fn_script_log_pass "Checking lockfile: LinuxGSM is currently updating" fn_print_dots "Checking update: "
core_exit.sh fn_print_checking_eol
fn_print_warn "Checking update: Removing stale lockfile: "
fn_print_warn_eol
fn_script_log_warn "Checking update: Removing stale lockfile"
rm -f "${lockdir:?}/update.lock"
fi fi
fi fi
if [ -f "${lockdir}/update.lock" ] && [[ "$(pgrep -fc -u "${USER}" "${selfname} update")" != "0" || "$(pgrep -fc -u "${USER}" "${selfname} validate")" != "0" || "$(pgrep -fc -u "${USER}" "${selfname} v")" != "0" || "$(pgrep -fc force-update "${USER}" "${selfname} fu")" != "0" ]]; then
fn_print_dots "Checking update: "
fn_print_checking_eol
fn_print_info "Checking update: LinuxGSM is updating the game server: "
fn_print_info_eol
fn_script_log_pass "Checking update: LinuxGSM is updating the game server"
core_exit.sh
fi
}
# Source engine games may display a messages to indicate the server needs restarting.
fn_monitor_check_update_source(){
if [ -f "${consolelogdir}/${selfname}-console.log" ] && [ "${engine}" == "source" ]; then
if grep -q "Your server needs to be restarted in order to receive the latest update." "${consolelogdir}/${selfname}-console.log"; then
fn_print_dots "Checking update: "
fn_print_checking_eol
fn_script_log_info "Checking update: CHECKING"
fn_print_ok "Checking update: "
fn_print_ok_eol_nl
fn_script_log_info "Checking update: Monitor is restarting ${selfname} to apply update"
alert="restart"
alert.sh
command_restart.sh
core_exit.sh
fi
fi
} }
fn_monitor_check_session() { fn_monitor_check_session() {
fn_print_dots "Checking session: " fn_print_dots "Checking session: "
fn_print_checking_eol fn_print_checking_eol
fn_script_log_info "Checking session: CHECKING" fn_script_log_info "Checking session: CHECKING"
# uses status var from check_status.sh # Tmux session width and height needs to be reviewed as may no longer be required.
if [ "${status}" != "0" ]; then sessionwidth="80"
sessionheight="23"
# Check for PIDS with identical tmux sessions running.
if [ "$(pgrep -fc "tmux -L ${socketname} new-session -d -x ${sessionwidth} -y ${sessionheight} -s ${sessionname}")" -ge "2" ]; then
fn_print_error "Checking session: "
fn_print_error_eol_nl
fn_script_log_error "Checking session: ERROR"
fn_script_log_error "Checking session: There are PIDS with identical tmux sessions running"
fn_script_log_error "Checking session: Killing all tmux sessions with the socketname name ${socketname} and session name ${sessionname}"
pkill -f "tmux -L ${socketname} new-session -d -x ${sessionwidth} -y ${sessionheight} -s ${sessionname}"
command_restart.sh
core_exit.sh
# Check for tmux pids with the same tmux session and socket names. This will reduce issues with migration to release v23.5.0. #4296
elif [ "$(pgrep -fc -u "${USER}" "tmux -L ${sessionname} new-session -d -x ${sessionwidth} -y ${sessionheight} -s ${sessionname}")" != "0" ]; then
fn_print_error "Checking session: "
fn_print_error_eol_nl
fn_script_log_error "Checking session: ERROR"
fn_script_log_error "Checking session: PIDS with the same tmux session and socket names are running"
fn_script_log_error "Checking session: Killing session with the socketname name ${sessionname} and session name ${sessionname}"
pkill -f "tmux -L ${sessionname} new-session -d -x ${sessionwidth} -y ${sessionheight} -s ${sessionname}"
command_restart.sh
core_exit.sh
elif [ "${status}" != "0" ]; then
fn_print_ok "Checking session: " fn_print_ok "Checking session: "
fn_print_ok_eol_nl fn_print_ok_eol_nl
fn_script_log_pass "Checking session: OK" fn_script_log_pass "Checking session: OK"
@ -107,8 +201,8 @@ fn_monitor_check_session() {
fi fi
} }
# Monitor will check queryport is set before continuing.
fn_monitor_check_queryport() { fn_monitor_check_queryport() {
# Monitor will check queryport is set before continuing.
if [ -z "${queryport}" ] || [ "${queryport}" == "0" ]; then if [ -z "${queryport}" ] || [ "${queryport}" == "0" ]; then
fn_print_dots "Checking port: " fn_print_dots "Checking port: "
fn_print_checking_eol fn_print_checking_eol
@ -133,7 +227,7 @@ fn_query_gsquery() {
} }
fn_query_tcp() { fn_query_tcp() {
bash -c 'exec 3<> /dev/tcp/'${queryip}'/'${queryport}'' > /dev/null 2>&1 bash -c "exec 3<> /dev/tcp/'${queryip}'/'${queryport}'" > /dev/null 2>&1
querystatus="$?" querystatus="$?"
} }
@ -147,12 +241,12 @@ fn_monitor_query() {
fn_print_querying_eol fn_print_querying_eol
fn_script_log_info "Querying port: ${querymethod}: ${queryip}:${queryport} : ${queryattempt} : QUERYING" fn_script_log_info "Querying port: ${querymethod}: ${queryip}:${queryport} : ${queryattempt} : QUERYING"
# querydelay # querydelay
if [ "$(head -n 1 "${lockdir}/${selfname}.lock")" -gt "$(date "+%s" -d "${querydelay} mins ago")" ]; then if [ "$(head -n 1 "${lockdir}/${selfname}-started.lock")" -gt "$(date "+%s" -d "${querydelay} mins ago")" ]; then
fn_print_ok "Querying port: ${querymethod}: ${ip}:${queryport} : ${totalseconds}/${queryattempt}: " fn_print_ok "Querying port: ${querymethod}: ${ip}:${queryport} : ${totalseconds}/${queryattempt}: "
fn_print_delay_eol_nl fn_print_delay_eol_nl
fn_script_log_info "Querying port: ${querymethod}: ${ip}:${queryport} : ${queryattempt} : DELAY" fn_script_log_info "Querying port: ${querymethod}: ${ip}:${queryport} : ${queryattempt} : DELAY"
fn_script_log_info "Query bypassed: ${gameservername} started less than ${querydelay} minutes ago" fn_script_log_info "Query bypassed: ${gameservername} started less than ${querydelay} minutes ago"
fn_script_log_info "Server started: $(date -d @$(head -n 1 "${lockdir}/${selfname}.lock"))" fn_script_log_info "Server started: $(date -d "@$(head -n 1 "${lockdir}/${selfname}-started.lock")")"
fn_script_log_info "Current time: $(date)" fn_script_log_info "Current time: $(date)"
monitorpass=1 monitorpass=1
core_exit.sh core_exit.sh
@ -271,8 +365,15 @@ core_logs.sh
info_game.sh info_game.sh
# query pre-checks # query pre-checks
fn_monitor_check_lockfile fn_monitor_check_update_source
fn_monitor_check_update
fn_monitor_check_backup
fn_monitor_check_debug
fn_monitor_check_monitoring
fn_monitor_check_starting
fn_monitor_check_stopping
fn_monitor_check_session fn_monitor_check_session
# Monitor will not continue if session only check. # Monitor will not continue if session only check.
if [ "${querymode}" != "1" ]; then if [ "${querymode}" != "1" ]; then
fn_monitor_check_queryport fn_monitor_check_queryport

2
lgsm/modules/command_restart.sh

@ -5,7 +5,7 @@
# Website: https://linuxgsm.com # Website: https://linuxgsm.com
# Description: Restarts the server. # Description: Restarts the server.
commandname="MODS-INSTALL" commandname="RESTART"
commandaction="Restarting" commandaction="Restarting"
moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
fn_firstcommand_set fn_firstcommand_set

2
lgsm/modules/command_send.sh

@ -26,7 +26,7 @@ if [ "${status}" != "0" ]; then
fi fi
echo "" echo ""
fn_print_dots "Sending command to console: \"${commandtosend}\"" fn_print_dots "Sending command to console: \"${commandtosend}\""
tmux send-keys -t "${servicename}" "${commandtosend}" ENTER tmux -L "${socketname}" send-keys -t "${servicename}" "${commandtosend}" ENTER
fn_print_ok_nl "Sending command to console: \"${commandtosend}\"" fn_print_ok_nl "Sending command to console: \"${commandtosend}\""
fn_script_log_pass "Command \"${commandtosend}\" sent to console" fn_script_log_pass "Command \"${commandtosend}\" sent to console"
else else

3
lgsm/modules/command_skeleton.sh

@ -5,7 +5,10 @@
# Website: https://linuxgsm.com # Website: https://linuxgsm.com
# Description: Creates an copy of a game servers directorys. # Description: Creates an copy of a game servers directorys.
commandname="SKELETON"
commandaction="Skeleton"
moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
fn_firstcommand_set
fn_print_dots "Creating skeleton directory" fn_print_dots "Creating skeleton directory"
check.sh check.sh

101
lgsm/modules/command_start.sh

@ -11,39 +11,14 @@ moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
addtimestamp="gawk '{ print strftime(\\\"[$logtimestampformat]\\\"), \\\$0 }'" addtimestamp="gawk '{ print strftime(\\\"[$logtimestampformat]\\\"), \\\$0 }'"
fn_firstcommand_set fn_firstcommand_set
fn_start_teamspeak3() {
if [ ! -f "${servercfgfullpath}" ]; then
fn_print_warn_nl "${servercfgfullpath} is missing"
fn_script_log_warn "${servercfgfullpath} is missing"
echo " * Creating blank ${servercfg}"
fn_script_log_info "Creating blank ${servercfg}"
fn_sleep_time
echo " * ${servercfg} can remain blank by default."
fn_script_log_info "${servercfgfullpath} can remain blank by default."
fn_sleep_time
echo " * ${servercfg} is located in ${servercfgfullpath}."
fn_script_log_info "${servercfg} is located in ${servercfgfullpath}."
sleep 5
touch "${servercfgfullpath}"
fi
# Accept license.
if [ ! -f "${executabledir}/.ts3server_license_accepted" ]; then
install_eula.sh
fi
fn_start_tmux
}
# This will allow the Jedi Knight 2 version to be printed in console on start. # This will allow the Jedi Knight 2 version to be printed in console on start.
# Used to allow update to detect JK2MV server version. # Used to allow update to detect JK2MV server version.
fn_start_jk2() { fn_start_jk2() {
fn_start_tmux fn_start_tmux
tmux send -t "${sessionname}" version ENTER > /dev/null 2>&1 tmux -L "${socketname}" end -t "${sessionname}" version ENTER > /dev/null 2>&1
} }
fn_start_tmux() { fn_start_tmux() {
if [ "${parmsbypass}" ]; then
startparameters=""
fi
# check for tmux size variables. # check for tmux size variables.
if [[ "${servercfgtmuxwidth}" =~ ^[0-9]+$ ]]; then if [[ "${servercfgtmuxwidth}" =~ ^[0-9]+$ ]]; then
sessionwidth="${servercfgtmuxwidth}" sessionwidth="${servercfgtmuxwidth}"
@ -68,35 +43,41 @@ fn_start_tmux() {
mv "${consolelog}" "${consolelogdate}" mv "${consolelog}" "${consolelogdate}"
fi fi
# Create lockfile # Create a starting lockfile that only exists while the start command is running.
date '+%s' > "${lockdir}/${selfname}.lock" date '+%s' > "${lockdir:?}/${selfname}-starting.lock"
echo "${version}" >> "${lockdir}/${selfname}.lock"
echo "${port}" >> "${lockdir}/${selfname}.lock"
fn_reload_startparameters fn_reload_startparameters
# Create uid to ensure unique tmux socket name.
if [ ! -f "${datadir}/${selfname}.uid" ]; then
# stop running server (if running) to prevent lingering tmux sessions.
exitbypass=1
command_stop.sh
uid=$(date '+%s' | sha1sum | head -c 8)
echo "${uid}" > "${datadir}/${selfname}.uid"
socketname="${sessionname}-$(cat "${datadir}/${selfname}.uid")"
fi
if [ "${shortname}" == "av" ]; then if [ "${shortname}" == "av" ]; then
cd "${systemdir}" || exit cd "${systemdir}" || exit
else else
cd "${executabledir}" || exit cd "${executabledir}" || exit
fi fi
tmux new-session -d -x "${sessionwidth}" -y "${sessionheight}" -s "${sessionname}" "${preexecutable} ${executable} ${startparameters}" 2> "${lgsmlogdir}/.${selfname}-tmux-error.tmp" tmux -L "${socketname}" new-session -d -x "${sessionwidth}" -y "${sessionheight}" -s "${sessionname}" "${preexecutable} ${executable} ${startparameters}" 2> "${lgsmlogdir}/.${selfname}-tmux-error.tmp"
# Create logfile. # Create logfile.
touch "${consolelog}" touch "${consolelog}"
# Create last start lock file
date +%s > "${lockdir}/${selfname}-laststart.lock"
# tmux compiled from source will return "master", therefore ignore it. # tmux compiled from source will return "master", therefore ignore it.
if [ "${tmuxv}" == "master" ]; then if [ "${tmuxv}" == "master" ]; then
fn_script_log "tmux version: master (user compiled)" fn_script_log "tmux version: master (user compiled)"
echo -e "tmux version: master (user compiled)" >> "${consolelog}" echo -e "tmux version: master (user compiled)" >> "${consolelog}"
if [ "${consolelogging}" == "on" ] || [ -z "${consolelogging}" ]; then if [ "${consolelogging}" == "on" ] || [ -z "${consolelogging}" ]; then
if [ "$logtimestamp" == "on" ]; then if [ "${logtimestamp}" == "on" ]; then
tmux pipe-pane -o -t "${sessionname}" "exec bash -c \"cat | $addtimestamp\" >> '${consolelog}'" tmux -L "${socketname}" pipe-pane -o -t "${sessionname}" "exec bash -c \"cat | $addtimestamp\" >> '${consolelog}'"
else else
tmux pipe-pane -o -t "${sessionname}" "exec cat >> '${consolelog}'" tmux -L "${socketname}" pipe-pane -o -t "${sessionname}" "exec cat >> '${consolelog}'"
fi fi
fi fi
@ -114,10 +95,10 @@ fn_start_tmux() {
Currently installed: $(tmux -V)" > "${consolelog}" Currently installed: $(tmux -V)" > "${consolelog}"
# Console logging enable or not set. # Console logging enable or not set.
elif [ "${consolelogging}" == "on" ] || [ -z "${consolelogging}" ]; then elif [ "${consolelogging}" == "on" ] || [ -z "${consolelogging}" ]; then
if [ "$logtimestamp" == "on" ]; then if [ "${logtimestamp}" == "on" ]; then
tmux pipe-pane -o -t "${sessionname}" "exec bash -c \"cat | $addtimestamp\" >> '${consolelog}'" tmux -L "${socketname}" pipe-pane -o -t "${sessionname}" "exec bash -c \"cat | $addtimestamp\" >> '${consolelog}'"
else else
tmux pipe-pane -o -t "${sessionname}" "exec cat >> '${consolelog}'" tmux -L "${socketname}" pipe-pane -o -t "${sessionname}" "exec cat >> '${consolelog}'"
fi fi
fi fi
else else
@ -127,7 +108,7 @@ fn_start_tmux() {
# Console logging disabled. # Console logging disabled.
if [ "${consolelogging}" == "off" ]; then if [ "${consolelogging}" == "off" ]; then
echo -e "Console logging disabled by user" >> "${consolelog}" echo -e "Console logging disabled in settings" >> "${consolelog}"
fn_script_log_info "Console logging disabled by user" fn_script_log_info "Console logging disabled by user"
fi fi
fn_sleep_time fn_sleep_time
@ -143,7 +124,7 @@ fn_start_tmux() {
echo -e "" echo -e ""
echo -e "Command" echo -e "Command"
echo -e "=================================" echo -e "================================="
echo -e "tmux new-session -d -s \"${sessionname}\" \"${preexecutable} ${executable} ${startparameters}\"" | tee -a "${lgsmlog}" echo -e "tmux -L \"${sessionname}\" new-session -d -s \"${sessionname}\" \"${preexecutable} ${executable} ${startparameters}\"" | tee -a "${lgsmlog}"
echo -e "" echo -e ""
echo -e "Error" echo -e "Error"
echo -e "=================================" echo -e "================================="
@ -176,8 +157,20 @@ fn_start_tmux() {
fi fi
fi fi
fi fi
# Remove starting lockfile when command ends.
rm -f "${lockdir:?}/${selfname}-starting.lock"
core_exit.sh core_exit.sh
else else
# Create start lockfile that exists only when the server is running.
date '+%s' > "${lockdir:?}/${selfname}-started.lock"
echo "${version}" >> "${lockdir}/${selfname}-started.lock"
echo "${port}" >> "${lockdir}/${selfname}-started.lock"
fn_print_ok "${servername}"
fn_script_log_pass "Started ${servername}"
# Create last started Lockfile.
date +%s > "${lockdir}/${selfname}-last-started.lock"
fn_print_ok "${servername}" fn_print_ok "${servername}"
fn_script_log_pass "Started ${servername}" fn_script_log_pass "Started ${servername}"
fi fi
@ -187,23 +180,28 @@ fn_start_tmux() {
check.sh check.sh
# Is the server already started. # If user ran the start command monitor will become enabled.
# $status comes from check_status.sh, which is run by check.sh for this command if [ "${firstcommandname}" == "START" ]||[ "${firstcommandname}" == "RESTART" ]; then
date '+%s' > "${lockdir:?}/${selfname}-monitoring.lock"
fi
# If the server already started dont start again.
if [ "${status}" != "0" ]; then if [ "${status}" != "0" ]; then
fn_print_dots "${servername}" fn_print_dots "${servername}"
fn_print_info_nl "${servername} is already running" fn_print_info_nl "${servername} is already running"
fn_script_log_error "${servername} is already running" fn_script_log_error "${servername} is already running"
if [ -z "${exitbypass}" ]; then if [ -z "${exitbypass}" ]; then
# Remove starting lockfile when command ends.
rm -f "${lockdir:?}/${selfname}-starting.lock"
core_exit.sh core_exit.sh
fi fi
fi fi
if [ -z "${fixbypass}" ]; then
fix.sh fix.sh
fi
info_game.sh info_game.sh
core_logs.sh core_logs.sh
# Will check for updates is updateonstart is yes. # Will check for updates if updateonstart is yes.
if [ "${updateonstart}" == "yes" ] || [ "${updateonstart}" == "1" ] || [ "${updateonstart}" == "on" ]; then if [ "${updateonstart}" == "yes" ] || [ "${updateonstart}" == "1" ] || [ "${updateonstart}" == "on" ]; then
exitbypass=1 exitbypass=1
unset updateonstart unset updateonstart
@ -212,13 +210,12 @@ if [ "${updateonstart}" == "yes" ] || [ "${updateonstart}" == "1" ] || [ "${upda
fi fi
fn_print_dots "${servername}" fn_print_dots "${servername}"
if [ "${shortname}" == "jk2" ]; then
if [ "${shortname}" == "ts3" ]; then
fn_start_teamspeak3
elif [ "${shortname}" == "jk2" ]; then
fn_start_jk2 fn_start_jk2
else else
fn_start_tmux fn_start_tmux
fi fi
# Remove starting lockfile when command ends.
rm -f "${lockdir:?}/${selfname}-starting.lock"
core_exit.sh core_exit.sh

30
lgsm/modules/command_stop.sh

@ -15,7 +15,7 @@ fn_stop_graceful_ctrlc() {
fn_print_dots "Graceful: CTRL+c" fn_print_dots "Graceful: CTRL+c"
fn_script_log_info "Graceful: CTRL+c" fn_script_log_info "Graceful: CTRL+c"
# Sends quit. # Sends quit.
tmux send-keys -t "${sessionname}" C-c > /dev/null 2>&1 tmux -L "${socketname}" send-keys -t "${sessionname}" C-c > /dev/null 2>&1
# Waits up to 30 seconds giving the server time to shutdown gracefuly. # Waits up to 30 seconds giving the server time to shutdown gracefuly.
for seconds in {1..30}; do for seconds in {1..30}; do
check_status.sh check_status.sh
@ -43,7 +43,7 @@ fn_stop_graceful_cmd() {
fn_print_dots "Graceful: sending \"${1}\"" fn_print_dots "Graceful: sending \"${1}\""
fn_script_log_info "Graceful: sending \"${1}\"" fn_script_log_info "Graceful: sending \"${1}\""
# Sends specific stop command. # Sends specific stop command.
tmux send -t "${sessionname}" ENTER "${1}" ENTER > /dev/null 2>&1 tmux -L "${socketname}" send -t "${sessionname}" ENTER "${1}" ENTER > /dev/null 2>&1
# Waits up to ${seconds} seconds giving the server time to shutdown gracefully. # Waits up to ${seconds} seconds giving the server time to shutdown gracefully.
for ((seconds = 1; seconds <= ${2}; seconds++)); do for ((seconds = 1; seconds <= ${2}; seconds++)); do
check_status.sh check_status.sh
@ -71,7 +71,7 @@ fn_stop_graceful_goldsrc() {
fn_print_dots "Graceful: sending \"quit\"" fn_print_dots "Graceful: sending \"quit\""
fn_script_log_info "Graceful: sending \"quit\"" fn_script_log_info "Graceful: sending \"quit\""
# sends quit # sends quit
tmux send -t "${sessionname}" quit ENTER > /dev/null 2>&1 tmux -L "${socketname}" send -t "${sessionname}" quit ENTER > /dev/null 2>&1
# Waits 3 seconds as goldsrc servers restart with the quit command. # Waits 3 seconds as goldsrc servers restart with the quit command.
for seconds in {1..3}; do for seconds in {1..3}; do
sleep 1 sleep 1
@ -184,10 +184,10 @@ fn_stop_graceful_avorion() {
fn_print_dots "Graceful: /save /stop" fn_print_dots "Graceful: /save /stop"
fn_script_log_info "Graceful: /save /stop" fn_script_log_info "Graceful: /save /stop"
# Sends /save. # Sends /save.
tmux send-keys -t "${sessionname}" /save ENTER > /dev/null 2>&1 tmux -L "${socketname}" send-keys -t "${sessionname}" /save ENTER > /dev/null 2>&1
sleep 5 sleep 5
# Sends /quit. # Sends /quit.
tmux send-keys -t "${sessionname}" /stop ENTER > /dev/null 2>&1 tmux -L "${socketname}" send-keys -t "${sessionname}" /stop ENTER > /dev/null 2>&1
# Waits up to 30 seconds giving the server time to shutdown gracefuly. # Waits up to 30 seconds giving the server time to shutdown gracefuly.
for seconds in {1..30}; do for seconds in {1..30}; do
check_status.sh check_status.sh
@ -240,7 +240,7 @@ fn_stop_tmux() {
fn_print_dots "${servername}" fn_print_dots "${servername}"
fn_script_log_info "tmux kill-session: ${sessionname}: ${servername}" fn_script_log_info "tmux kill-session: ${sessionname}: ${servername}"
# Kill tmux session. # Kill tmux session.
tmux kill-session -t "${sessionname}" > /dev/null 2>&1 tmux -L "${socketname}" kill-session -t "${sessionname}" > /dev/null 2>&1
sleep 0.5 sleep 0.5
check_status.sh check_status.sh
if [ "${status}" == "0" ]; then if [ "${status}" == "0" ]; then
@ -269,15 +269,27 @@ fn_stop_pre_check() {
} }
check.sh check.sh
# Create a stopping lockfile that only exists while the stop command is running.
date '+%s' > "${lockdir:?}/${selfname}-stopping.lock"
fn_print_dots "${servername}" fn_print_dots "${servername}"
info_game.sh info_game.sh
fn_stop_pre_check fn_stop_pre_check
# Remove lockfile.
if [ -f "${lockdir}/${selfname}.lock" ]; then # Remove started lockfile.
rm -f "${lockdir:?}/${selfname}.lock" rm -f "${lockdir:?}/${selfname}-started.lock"
# If user ran the stop command monitor will become disabled.
if [ "${firstcommandname}" == "STOP" ];then
rm -f "${lockdir:?}/${selfname}-monitoring.lock"
fi fi
# Remove stopping lockfile.
rm -f "${lockdir:?}/${selfname}-stopping.lock"
if [ -z "${exitbypass}" ]; then if [ -z "${exitbypass}" ]; then
core_exit.sh core_exit.sh
fi fi

4
lgsm/modules/command_ts3_server_pass.sh

@ -28,7 +28,7 @@ fn_serveradmin_password_prompt() {
fn_serveradmin_password_set() { fn_serveradmin_password_set() {
# Start server in "new password mode". # Start server in "new password mode".
ts3serverpass="1" ts3serverpass="1"
exitbypass="1" exitbypass=1
command_start.sh command_start.sh
fn_firstcommand_reset fn_firstcommand_reset
fn_print_ok_nl "New password applied" fn_print_ok_nl "New password applied"
@ -40,7 +40,7 @@ check.sh
fn_serveradmin_password_prompt fn_serveradmin_password_prompt
if [ "${status}" != "0" ]; then if [ "${status}" != "0" ]; then
# Stop any running server. # Stop any running server.
exitbypass="1" exitbypass=1
command_stop.sh command_stop.sh
fn_firstcommand_reset fn_firstcommand_reset
fn_serveradmin_password_set fn_serveradmin_password_set

3
lgsm/modules/command_update.sh

@ -37,4 +37,7 @@ else
update_steamcmd.sh update_steamcmd.sh
fi fi
# remove update lockfile.
rm -f "${lockdir:?}/update.lock"
core_exit.sh core_exit.sh

5
lgsm/modules/command_validate.sh

@ -23,7 +23,7 @@ fn_validate() {
fi fi
done done
fn_print_warn_nl "Validate might overwrite some customised files" fn_print_warn_nl "Validate might overwrite some customised files"
date '+%s' > "${lockdir:?}/update.lock"
fn_dl_steamcmd fn_dl_steamcmd
} }
@ -46,4 +46,7 @@ else
fn_validate fn_validate
fi fi
# remove update lockfile
rm -f "${lockdir:?}/update.lock"
core_exit.sh core_exit.sh

8
lgsm/modules/core_dl.sh

@ -119,6 +119,14 @@ fn_dl_steamcmd() {
elif [ -n "$(grep "0x402" "${steamcmdlog}" | tail -1)" ] || [ -n "$(grep "0x602" "${steamcmdlog}" | tail -1)" ]; then elif [ -n "$(grep "0x402" "${steamcmdlog}" | tail -1)" ] || [ -n "$(grep "0x602" "${steamcmdlog}" | tail -1)" ]; then
fn_print_error2_nl "${commandaction} ${selfname}: ${remotelocation}: Update required but not completed - check network" fn_print_error2_nl "${commandaction} ${selfname}: ${remotelocation}: Update required but not completed - check network"
fn_script_log_error "${commandaction} ${selfname}: ${remotelocation}: Update required but not completed - check network" fn_script_log_error "${commandaction} ${selfname}: ${remotelocation}: Update required but not completed - check network"
# Disk write failure.
elif [ -n "$(grep "0x606" "${steamcmdlog}" | tail -1)" ] || [ -n "$(grep "0x602" "${steamcmdlog}" | tail -1)" ]; then
fn_print_error2_nl "${commandaction} ${selfname}: ${remotelocation}: Disk write failure"
fn_script_log_error "${commandaction} ${selfname}: ${remotelocation}: Disk write failure"
# Missing update files.
elif [ -n "$(grep "0x626" "${steamcmdlog}" | tail -1)" ] || [ -n "$(grep "0x626" "${steamcmdlog}" | tail -1)" ]; then
fn_print_error2_nl "${commandaction} ${selfname}: ${remotelocation}: Missing update files"
fn_script_log_error "${commandaction} ${selfname}: ${remotelocation}: Missing update files"
else else
fn_print_error2_nl "${commandaction} ${selfname}: ${remotelocation}: Unknown error occured" fn_print_error2_nl "${commandaction} ${selfname}: ${remotelocation}: Unknown error occured"
echo -en "Please provide content log to LinuxGSM developers https://linuxgsm.com/steamcmd-error" echo -en "Please provide content log to LinuxGSM developers https://linuxgsm.com/steamcmd-error"

2
lgsm/modules/core_exit.sh

@ -12,7 +12,7 @@ fn_exit_dev_debug() {
echo -e "" echo -e ""
echo -e "${moduleselfname} exiting with code: ${exitcode}" echo -e "${moduleselfname} exiting with code: ${exitcode}"
if [ -f "${rootdir}/dev-debug.log" ]; then if [ -f "${rootdir}/dev-debug.log" ]; then
grep "modulefile=" "${rootdir}/dev-debug.log" | sed 's/modulefile=//g' > "${rootdir}/dev-debug-module-order.log" grep -a "modulefile=" "${rootdir}/dev-debug.log" | sed 's/modulefile=//g' > "${rootdir}/dev-debug-module-order.log"
fi fi
fi fi
} }

2
lgsm/modules/core_functions.sh

@ -8,7 +8,7 @@
module_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" module_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
modulesversion="v23.3.6" modulesversion="v23.4.0"
# Core # Core

2
lgsm/modules/core_getopt.sh

@ -55,7 +55,7 @@ cmd_dev_detect_deps=("dd;detect-deps" "command_dev_detect_deps.sh" "Detect requi
cmd_dev_detect_glibc=("dg;detect-glibc" "command_dev_detect_glibc.sh" "Detect required glibc.") cmd_dev_detect_glibc=("dg;detect-glibc" "command_dev_detect_glibc.sh" "Detect required glibc.")
cmd_dev_detect_ldd=("dl;detect-ldd" "command_dev_detect_ldd.sh" "Detect required dynamic dependencies.") cmd_dev_detect_ldd=("dl;detect-ldd" "command_dev_detect_ldd.sh" "Detect required dynamic dependencies.")
cmd_dev_query_raw=("qr;query-raw" "command_dev_query_raw.sh" "The raw output of gamedig and gsquery.") cmd_dev_query_raw=("qr;query-raw" "command_dev_query_raw.sh" "The raw output of gamedig and gsquery.")
cmd_dev_clear_modules=("cf;clear-modules" "command_dev_clear_modules.sh" "Delete the contents of the modules dir.") cmd_dev_clear_modules=("cm;clear-modules" "command_dev_clear_modules.sh" "Delete the contents of the modules dir.")
### Set specific opt here. ### Set specific opt here.

2
lgsm/modules/core_modules.sh

@ -8,7 +8,7 @@
moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
modulesversion="v23.3.6" modulesversion="v23.4.0"
# Core # Core

5
lgsm/modules/core_steamcmd.sh

@ -204,7 +204,10 @@ fn_update_steamcmd_remotebuild() {
fn_update_steamcmd_compare() { fn_update_steamcmd_compare() {
fn_print_dots "Checking for update: ${remotelocation}" fn_print_dots "Checking for update: ${remotelocation}"
# Update has been found or force update.
if [ "${localbuild}" != "${remotebuildversion}" ] || [ "${forceupdate}" == "1" ]; then if [ "${localbuild}" != "${remotebuildversion}" ] || [ "${forceupdate}" == "1" ]; then
# Create update lockfile.
date '+%s' > "${lockdir:?}/update.lock"
fn_print_ok_nl "Checking for update: ${remotelocation}" fn_print_ok_nl "Checking for update: ${remotelocation}"
echo -en "\n" echo -en "\n"
echo -e "Update available" echo -e "Update available"
@ -248,7 +251,7 @@ fn_update_steamcmd_compare() {
fn_firstcommand_reset fn_firstcommand_reset
fi fi
unset exitbypass unset exitbypass
date +%s > "${lockdir}/lastupdate.lock" date +%s > "${lockdir:?}/last-updated.lock"
alert="update" alert="update"
elif [ "${commandname}" == "CHECK-UPDATE" ]; then elif [ "${commandname}" == "CHECK-UPDATE" ]; then
alert="check-update" alert="check-update"

2
lgsm/modules/fix_csgo.sh

@ -37,6 +37,6 @@ libgccc_so="${serverfiles}/bin/libgcc_s.so.1"
if [ -f "${libgccc_so}" ]; then if [ -f "${libgccc_so}" ]; then
fixname="libgcc_s.so.1 move away" fixname="libgcc_s.so.1 move away"
fn_fix_msg_start fn_fix_msg_start
mv -v "${libgccc_so}" "${libgccc_so}.bck" mv "${libgccc_so}" "${libgccc_so}.bak"
fn_fix_msg_end fn_fix_msg_end
fi fi

13
lgsm/modules/fix_ts3.sh

@ -7,6 +7,19 @@
moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
# Creates a blank ts3server.ini if it does not exist.
if [ ! -f "${servercfgfullpath}" ]; then
fixname="create blank ${servercfg}"
fn_fix_msg_start
touch "${servercfgfullpath}"
fn_fix_msg_end
fi
# Accept license.
if [ ! -f "${executabledir}/.ts3server_license_accepted" ]; then
install_eula.sh
fi
# Fixes: makes libmariadb2 available #1924. # Fixes: makes libmariadb2 available #1924.
if [ ! -f "${serverfiles}/libmariadb.so.2" ]; then if [ ! -f "${serverfiles}/libmariadb.so.2" ]; then
fixname="libmariadb.so.2" fixname="libmariadb.so.2"

21
lgsm/modules/fix_wurm.sh

@ -10,14 +10,15 @@ moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
# First run requires start with no parms. # First run requires start with no parms.
# After first run new dirs are created. # After first run new dirs are created.
if [ ! -d "${serverfiles}/Creative" ]; then if [ ! -d "${serverfiles}/Creative" ]; then
parmsbypass=1 fixname="Copy Creative directory"
fixbypass=1 fn_fix_msg_start
exitbypass=1 cp -R "${serverfiles}/dist/Creative" "${serverfiles}/Creative"
command_start.sh fn_fix_msg_end
fn_firstcommand_reset fi
sleep 10
exitbypass=1 if [ ! -d "${serverfiles}/Adventure" ]; then
command_stop.sh fixname="Copy Adventure directory"
fn_firstcommand_reset fn_fix_msg_start
unset parmsbypass cp -R "${serverfiles}/dist/Adventure" "${serverfiles}/Adventure"
fn_fix_msg_end
fi fi

9
lgsm/modules/info_distro.sh

@ -10,7 +10,7 @@ moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
### Game Server pid ### Game Server pid
if [ "${status}" == "1" ]; then if [ "${status}" == "1" ]; then
gameserverpid="$(tmux list-sessions -F "#{session_name} #{pane_pid}" | grep "^${sessionname} " | awk '{print $NF}')" gameserverpid="$(tmux -L "${socketname}" list-sessions -F "#{session_name} #{pane_pid}" | grep "^${sessionname} " | awk '{print $NF}')"
if [ "${engine}" == "source" ]; then if [ "${engine}" == "source" ]; then
srcdslinuxpid="$(ps -ef | grep -v grep | grep "${gameserverpid}" | grep srcds_linux | awk '{print $2}')" srcdslinuxpid="$(ps -ef | grep -v grep | grep "${gameserverpid}" | grep srcds_linux | awk '{print $2}')"
elif [ "${engine}" == "goldsrc" ]; then elif [ "${engine}" == "goldsrc" ]; then
@ -73,7 +73,12 @@ for distro_info in "${distro_info_array[@]}"; do
fi fi
done done
# some RHEL based distros use 8.4 instead of just 8. # Get virtual environment
if [ "$(command -v systemd-detect-virt 2> /dev/null)" ]; then
virtualenvironment="$(systemd-detect-virt)"
fi
# Some RHEL based distros use 8.4 instead of just 8.
if [[ "${distroidlike}" == *"rhel"* ]] || [ "${distroid}" == "rhel" ]; then if [[ "${distroidlike}" == *"rhel"* ]] || [ "${distroid}" == "rhel" ]; then
distroversioncsv="${distroversionrh}" distroversioncsv="${distroversionrh}"
else else

138
lgsm/modules/info_game.sh

@ -323,9 +323,8 @@ fn_info_game_av() {
rconenabled="${rconenabled:-"false"}" rconenabled="${rconenabled:-"false"}"
rconpassword="${rconpassword:-"NOT SET"}" rconpassword="${rconpassword:-"NOT SET"}"
rconport="${rconport:-"0"}" rconport="${rconport:-"0"}"
# queryport is port + 3 # queryport doesnt respond to any queries, using session only.
# this doesnt respond to any queries, using tcp query on rconport instead. queryport=""$((port + 3))""
queryport="${rconport:-"0"}"
servername="${servername:-"NOT SET"}" servername="${servername:-"NOT SET"}"
serverpassword="${serverpassword:-"NOT SET"}" serverpassword="${serverpassword:-"NOT SET"}"
steamport="$((port + 21))" steamport="$((port + 21))"
@ -666,18 +665,24 @@ fn_info_game_stn() {
fn_info_game_ti() { fn_info_game_ti() {
if [ -f "${servercfgfullpath}" ]; then if [ -f "${servercfgfullpath}" ]; then
fn_info_game_ini "maxplayers" "MaxPlayerCount" fn_info_game_ini "maxplayers" "MaxPlayerCount"
fn_info_game_ini "queueenabled" "QueueEnabled" fn_info_game_ini "queueenabled" "bQueueEnabled"
fn_info_game_ini "queueport" "QueuePort" fn_info_game_ini "queueport" "QueuePort"
fn_info_game_ini "rconenabled" "RconEnabled" fn_info_game_ini "rconenabled" "bRconEnabled"
fn_info_game_ini "rconpassword" "RconPassword"
fn_info_game_ini "rconport" "RconPort" fn_info_game_ini "rconport" "RconPort"
fn_info_game_ini "servername" "ServerName" fn_info_game_ini "servername" "ServerName"
fn_info_game_ini "serverpassword" "ServerPassword"
fn_info_game_ini "serverpasswordenabled" "bServerPassword"
fi fi
maxplayers="${maxplayers:-"0"}" maxplayers="${maxplayers:-"0"}"
queueenabled="${queueenabled:-"NOT SET"}" queueenabled="${queueenabled:-"NOT SET"}"
queueport="${queueport:-"0"}" queueport="${queueport:-"0"}"
rconenabled="${rconenabled:-"NOT SET"}" rconenabled="${rconenabled:-"NOT SET"}"
rconpassword="${rconpassword:-"NOT SET"}"
rconport="${rconport:-"0"}" rconport="${rconport:-"0"}"
servername="${servername:-"NOT SET"}" servername="${servername:-"NOT SET"}"
serverpassword="${serverpassword:-"NOT SET"}"
serverpasswordenabled="${serverpasswordenabled:-"NOT SET"}"
} }
# Config Type: ini # Config Type: ini
@ -866,11 +871,11 @@ fn_info_game_ut2k4() {
# Filetype: json # Filetype: json
fn_info_game_armar() { fn_info_game_armar() {
if [ -f "${servercfgfullpath}" ]; then if [ -f "${servercfgfullpath}" ]; then
fn_info_game_json "adminpassword" ".adminPassword" fn_info_game_json "adminpassword" ".game.passwordAdmin"
fn_info_game_json "configip" ".gameHostBindAddress" fn_info_game_json "configip" ".bindAddress"
fn_info_game_json "maxplayers" ".game.playerCountLimit" fn_info_game_json "maxplayers" ".game.maxPlayers"
fn_info_game_json "port" ".gameHostBindPort" fn_info_game_json "port" ".bindPort"
fn_info_game_json "queryport" ".steamQueryPort" fn_info_game_json "queryport" ".a2s.port"
fn_info_game_json "servername" ".game.name" fn_info_game_json "servername" ".game.name"
fn_info_game_json "serverpassword" ".game.password" fn_info_game_json "serverpassword" ".game.password"
fi fi
@ -1744,52 +1749,26 @@ fn_info_game_rust() {
} }
fn_info_game_rw() { fn_info_game_rw() {
# Config if [ -f "${servercfgfullpath}" ]; then
if [ ! -f "${servercfgfullpath}" ]; then fn_info_game_keyvalue_pairs "configip" "Server_IP"
servername="${unavailable}" fn_info_game_keyvalue_pairs "gamemode" "World_GameMode"
serverpassword="${unavailable}" fn_info_game_keyvalue_pairs "maxplayers" "Server_MaxPlayers"
rconpassword="${unavailable}" fn_info_game_keyvalue_pairs "port" "Server_Port"
rconport="${zero}" fn_info_game_keyvalue_pairs "rconport" "RCON_Port"
maxplayers="${zero}" fn_info_game_keyvalue_pairs "seed" "World_Seed"
port="${zero}" fn_info_game_keyvalue_pairs "servername" "Server_Name"
port2="${zero}" fn_info_game_keyvalue_pairs "worldname" "World_Name"
port3="${zero}"
port4="${zero}"
queryport="${zero}"
gamemode="${unavailable}"
worldname="${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:]')
port2=$((port + 1))
port3=$((port + 2))
port4=$((port + 3))
queryport="${port}"
httpqueryport=$((port - 1))
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]*$//')
worldname=$(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]*$//')
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]*$//')
# Not set
servername="${servername:-"NOT SET"}"
serverpassword="${serverpassword:-"NOT SET"}"
rconpassword="${rconpassword:-"NOT SET"}"
rconport="${rconport:-"0"}"
maxplayers="${maxplayers:-"0"}"
port="${port:-"0"}"
port2="${port2:-"0"}"
port3="${port3:-"0"}"
port4="${port4:-"0"}"
queryport="${queryport:-"0"}"
httpqueryport="${httpport:-"0"}"
gamemode="${gamemode:-"NOT SET"}"
worldname="${worldname:-"NOT SET"}"
configip="${configip:-"0.0.0.0"}"
fi fi
configip="${configip:-"0.0.0.0"}"
gamemode="${gamemode:-"NOT SET"}"
maxplayers="${maxplayers:-"0"}"
port="${port:-"0"}"
queryport="$((port - 1))"
rconport="${rconport:-"0"}"
seed="${seed:-"0"}"
servername="${servername:-"NOT SET"}"
worldname="${worldname:-"NOT SET"}"
} }
# Config Type: custom # Config Type: custom
@ -2143,7 +2122,7 @@ fn_info_game_wet() {
configip="${configip:-"0.0.0.0"}" configip="${configip:-"0.0.0.0"}"
maxplayers="${maxplayers:-"0"}" maxplayers="${maxplayers:-"0"}"
port="${port:-"0"}" port="${port:-"0"}"
queryport="${queryport:-"0"}" queryport="${port}"
rconpassword="${rconpassword:-"NOT SET"}" rconpassword="${rconpassword:-"NOT SET"}"
servername="${servername:-"NOT SET"}" servername="${servername:-"NOT SET"}"
serverpassword="${serverpassword:-"NOT SET"}" serverpassword="${serverpassword:-"NOT SET"}"
@ -2195,36 +2174,25 @@ fn_info_game_wmc() {
fi fi
} }
# Config Type: custom (key-value) # Config Type: parameters
# Comment: # # Parameters: true
# Example: SERVERNAME=SERVERNAME # Comment:
# Example: hostname='SERVERNAME'
# Filetype: parameters
fn_info_game_wurm() { fn_info_game_wurm() {
# Config gamemode="${gamemode:-"NOT SET"}"
if [ ! -f "${servercfgfullpath}" ]; then homekingdom="${homekingdom:-"0"}"
port="${zero}" adminpassword="${adminpassword:-"NOT SET"}"
queryport="${zero}" epicsettings="${epicsettings:-"NOT SET"}"
rconpassword="${unavailable}" homeserver="${homeserver:-"NOT SET"}"
servername="${unavailable}" loginserver="${loginserver:-"NOT SET"}"
serverpassword="${unavailable}" rmiport="${rmiport:-"0"}"
adminpassword="${unavailable}" rmiregport="${rmiregport:-"0"}"
maxplayers="${zero}" maxplayers="${maxplayers:-"0"}"
else servername="${servername:-"NOT SET"}"
port=$(grep "EXTERNALPORT=" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') # serverpassword="${serverpassword:-"NOT SET"}"
queryport=$(grep "QUERYPORT=" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') port="${port:-"0"}"
servername=$(grep "SERVERNAME=" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/SERVERNAME//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') queryport="${queryport:-"0"}"
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]*$//')
# 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}" unavailable="${red}UNAVAILABLE${default}"

14
lgsm/modules/info_messages.sh

@ -698,7 +698,7 @@ fn_info_message_ports() {
portcommand="ss -tuplwn | grep AvorionServer" portcommand="ss -tuplwn | grep AvorionServer"
elif [ "${shortname}" == "bf1942" ]; then elif [ "${shortname}" == "bf1942" ]; then
portcommand="ss -tuplwn | grep bf1942_lnxded" portcommand="ss -tuplwn | grep bf1942_lnxded"
elif [ "${shortname}" == "mc" ] || [ "${shortname}" == "nec" ] || [ "${shortname}" == "pmc" ] || [ "${shortname}" == "rw" ] || [ "${shortname}" == "vpmc" ] || [ "${shortname}" == "wmc" ]; then elif [ "${shortname}" == "mc" ] || [ "${shortname}" == "nec" ] || [ "${shortname}" == "pmc" ] || [ "${shortname}" == "vpmc" ] || [ "${shortname}" == "wmc" ]; then
portcommand="ss -tuplwn | grep java" portcommand="ss -tuplwn | grep java"
elif [ "${shortname}" == "terraria" ]; then elif [ "${shortname}" == "terraria" ]; then
portcommand="ss -tuplwn | grep Main" portcommand="ss -tuplwn | grep Main"
@ -1352,14 +1352,7 @@ fn_info_message_rw() {
{ {
fn_port "header" fn_port "header"
fn_port "Game" port udp 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" queryport tcp
fn_port "Query HTTP" httpqueryport tcp
fn_port "RCON" rconport tcp fn_port "RCON" rconport tcp
} | column -s $'\t' -t } | column -s $'\t' -t
} }
@ -1512,7 +1505,8 @@ fn_info_message_ti() {
{ {
fn_port "header" fn_port "header"
fn_port "Game" port udp fn_port "Game" port udp
fn_port "Query" queryport udp fn_port "Queue" queueport tcp
fn_port "RCON" rconport tcp
} | column -s $'\t' -t } | column -s $'\t' -t
} }
@ -1672,6 +1666,8 @@ fn_info_message_wurm() {
fn_port "header" fn_port "header"
fn_port "Game" port tcp fn_port "Game" port tcp
fn_port "Query" queryport udp fn_port "Query" queryport udp
fn_port "RMI" rmiport tcp
fn_port "RMI Registry" rmiregport tcp
} | column -s $'\t' -t } | column -s $'\t' -t
} }

163
lgsm/modules/info_stats.sh

@ -56,108 +56,104 @@ cpuusedmhzroundup="$(((cpuusedmhz + 99) / 100 * 100))"
# nearest 100MB # nearest 100MB
memusedroundup="$(((memused + 99) / 100 * 100))" memusedroundup="$(((memused + 99) / 100 * 100))"
# Spliting the metrics in to 3 propertys allows more accurate metrics on numbers of invidual instances, installs and hardware. apisecret="A-OzP02TSMWt4_vHi6ZpUw"
# Instance Property - UA-165287622-1 measurementid="G-0CR8V7EMT5"
# Install Property - UA-165287622-2
# Hardware Property - UA-165287622-3 # Sending stats to Google Analytics GA4
payload="{
\"client_id\": \"${uuidinstance}\",
\"events\": [
{
\"name\": \"LinuxGSM\",
\"params\": {
\"cpuusedmhzroundup\": \"${cpuusedmhzroundup}MHz\",
\"diskused\": \"${serverfilesdu}\",
\"distro\": \"${distroname}\",
\"game\": \"${gamename}\",
\"memusedroundup\": \"${memusedroundup}MB\",
\"ramused\": \"${memusedroundup}MB\",
\"servercpu\": \"${cpumodel} ${cpucores} cores\",
\"servercpufreq\": \"${cpufreqency} x${cpucores}\",
\"serverdisk\": \"${totalspace}\",
\"serverfilesdu\": \"${serverfilesdu}\",
\"serverram\": \"${physmemtotal}\",
\"uuidhardware\": \"${uuidhardware}\",
\"uuidinstall\": \"${uuidinstall}\",
\"uuidinstance\": \"${uuidinstance}\",
\"version\": \"${version}\",
\"virtualenvironment\": \"${virtualenvironment}\"
}
}
]
}"
fn_alert_payload(){
alertpayload="{
\"client_id\": \"${uuidinstance}\",
\"events\": [
{
\"name\": \"LinuxGSM\",
\"params\": {
\"alert\": \"${alerttype}\"
}
}
]
}"
}
curl -X POST "https://www.google-analytics.com/mp/collect?api_secret=A-OzP02TSMWt4_vHi6ZpUw&measurement_id=G-0CR8V7EMT5" -H "Content-Type: application/json" -d "${payload}"
## Distro.
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-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-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-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-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-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
fi
## CPU Model.
if [ -n "${cpumodel}" ]; then
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
fi
## CPU Frequency.
if [ -n "${cpufreqency}" ]; then
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
fi
## Server RAM.
if [ -n "${physmemtotal}" ]; then
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
fi
## Server Disk.
if [ -n "${totalspace}" ]; then
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 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 alerttype="discord"
fn_alert_payload
curl -X POST "https://www.google-analytics.com/mp/collect?api_secret=${apisecret}&measurement_id=${measurementid}" -H "Content-Type: application/json" -d "${alertpayload}"
fi fi
if [ "${emailalert}" == "on" ]; then 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 alerttype="email"
fn_alert_payload
curl -X POST "https://www.google-analytics.com/mp/collect?api_secret=${apisecret}&measurement_id=${measurementid}" -H "Content-Type: application/json" -d "${alertpayload}"
fi
if [ "${gotifyalert}" == "on" ]; then
alerttype="gotify"
fn_alert_payload
curl -X POST "https://www.google-analytics.com/mp/collect?api_secret=${apisecret}&measurement_id=${measurementid}" -H "Content-Type: application/json" -d "${alertpayload}"
fi fi
if [ "${iftttalert}" == "on" ]; then 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 alerttype="ifttt"
fn_alert_payload
curl -X POST "https://www.google-analytics.com/mp/collect?api_secret=${apisecret}&measurement_id=${measurementid}" -H "Content-Type: application/json" -d "${alertpayload}"
fi fi
if [ "${mailgunalert}" == "on" ]; then 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 alerttype="mailgun"
fn_alert_payload
curl -X POST "https://www.google-analytics.com/mp/collect?api_secret=${apisecret}&measurement_id=${measurementid}" -H "Content-Type: application/json" -d "${alertpayload}"
fi fi
if [ "${pushbulletalert}" == "on" ]; then 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 alerttype="pushbullet"
fn_alert_payload
curl -X POST "https://www.google-analytics.com/mp/collect?api_secret=${apisecret}&measurement_id=${measurementid}" -H "Content-Type: application/json" -d "${alertpayload}"
fi fi
if [ "${pushoveralert}" == "on" ]; then 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 alerttype="pushover"
fn_alert_payload
curl -X POST "https://www.google-analytics.com/mp/collect?api_secret=${apisecret}&measurement_id=${measurementid}" -H "Content-Type: application/json" -d "${alertpayload}"
fi fi
if [ "${rocketchatalert}" == "on" ]; then 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 alerttype="rocketchat"
fn_alert_payload
curl -X POST "https://www.google-analytics.com/mp/collect?api_secret=${apisecret}&measurement_id=${measurementid}" -H "Content-Type: application/json" -d "${alertpayload}"
fi fi
if [ "${slackalert}" == "on" ]; then 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 alerttype="slack"
fn_alert_payload
curl -X POST "https://www.google-analytics.com/mp/collect?api_secret=${apisecret}&measurement_id=${measurementid}" -H "Content-Type: application/json" -d "${alertpayload}"
fi fi
if [ "${telegramalert}" == "on" ]; then 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 alerttype="telegram"
fn_alert_payload
curl -X POST "https://www.google-analytics.com/mp/collect?api_secret=${apisecret}&measurement_id=${measurementid}" -H "Content-Type: application/json" -d "${alertpayload}"
fi fi
## Summary Stats
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 "Send LinuxGSM stats"
fn_script_log_info "* uuid-${selfname}: ${uuidinstance}" fn_script_log_info "* uuid-${selfname}: ${uuidinstance}"
fn_script_log_info "* uuid-install: ${uuidinstall}" fn_script_log_info "* uuid-install: ${uuidinstall}"
@ -171,3 +167,6 @@ fn_script_log_info "* Server CPU Model: ${cpumodel}"
fn_script_log_info "* Server CPU Frequency: ${cpufreqency}" fn_script_log_info "* Server CPU Frequency: ${cpufreqency}"
fn_script_log_info "* Server RAM: ${physmemtotal}" fn_script_log_info "* Server RAM: ${physmemtotal}"
fn_script_log_info "* Server Disk: ${totalspace}" fn_script_log_info "* Server Disk: ${totalspace}"
fn_script_log_info "* Virtual Environment: ${virtualenvironment}"
fn_script_log_info "* LinuxGSM Version: ${version}"
fn_script_log_info "* Enabled Alerts"

117
lgsm/modules/install_config.sh

@ -24,9 +24,9 @@ fn_fetch_default_config() {
echo -e "default configs from https://github.com/GameServerManagers/Game-Server-Configs" echo -e "default configs from https://github.com/GameServerManagers/Game-Server-Configs"
fn_sleep_time fn_sleep_time
mkdir -p "${lgsmdir}/config-default/config-game" mkdir -p "${lgsmdir}/config-default/config-game"
githuburl="https://raw.githubusercontent.com/GameServerManagers/Game-Server-Configs/master" githuburl="https://raw.githubusercontent.com/GameServerManagers/Game-Server-Configs/main"
for config in "${array_configs[@]}"; do for config in "${array_configs[@]}"; do
fn_fetch_file "${githuburl}/${gamedirname}/${config}" "${remote_fileurl_backup}" "GitHub" "Bitbucket" "${lgsmdir}/config-default/config-game" "${config}" "nochmodx" "norun" "forcedl" "nohash" fn_fetch_file "${githuburl}/${shortname}/${config}" "${remote_fileurl_backup}" "GitHub" "Bitbucket" "${lgsmdir}/config-default/config-game" "${config}" "nochmodx" "norun" "forcedl" "nohash"
done done
} }
@ -162,32 +162,27 @@ fn_list_config_locations() {
} }
if [ "${shortname}" == "sdtd" ]; then if [ "${shortname}" == "sdtd" ]; then
gamedirname="7DaysToDie"
fn_default_config_local fn_default_config_local
fn_list_config_locations fn_list_config_locations
elif [ "${shortname}" == "ac" ]; then elif [ "${shortname}" == "ac" ]; then
gamedirname="AssettoCorsa"
array_configs+=(server_cfg.ini) array_configs+=(server_cfg.ini)
fn_fetch_default_config fn_fetch_default_config
fn_default_config_remote fn_default_config_remote
fn_set_config_vars fn_set_config_vars
fn_list_config_locations fn_list_config_locations
elif [ "${shortname}" == "ahl" ]; then elif [ "${shortname}" == "ahl" ]; then
gamedirname="ActionHalfLife"
array_configs+=(server.cfg) array_configs+=(server.cfg)
fn_fetch_default_config fn_fetch_default_config
fn_default_config_remote fn_default_config_remote
fn_set_config_vars fn_set_config_vars
fn_list_config_locations fn_list_config_locations
elif [ "${shortname}" == "ahl2" ]; then elif [ "${shortname}" == "ahl2" ]; then
gamedirname="ActionSource"
array_configs+=(server.cfg) array_configs+=(server.cfg)
fn_fetch_default_config fn_fetch_default_config
fn_default_config_remote fn_default_config_remote
fn_set_config_vars fn_set_config_vars
fn_list_config_locations fn_list_config_locations
elif [ "${shortname}" == "ark" ]; then elif [ "${shortname}" == "ark" ]; then
gamedirname="ARKSurvivalEvolved"
fn_check_cfgdir fn_check_cfgdir
array_configs+=(GameUserSettings.ini) array_configs+=(GameUserSettings.ini)
fn_fetch_default_config fn_fetch_default_config
@ -195,7 +190,6 @@ elif [ "${shortname}" == "ark" ]; then
fn_set_config_vars fn_set_config_vars
fn_list_config_locations fn_list_config_locations
elif [ "${shortname}" == "arma3" ]; then elif [ "${shortname}" == "arma3" ]; then
gamedirname="Arma3"
fn_check_cfgdir fn_check_cfgdir
array_configs+=(server.cfg network.cfg) array_configs+=(server.cfg network.cfg)
fn_fetch_default_config fn_fetch_default_config
@ -203,7 +197,6 @@ elif [ "${shortname}" == "arma3" ]; then
fn_set_config_vars fn_set_config_vars
fn_list_config_locations fn_list_config_locations
elif [ "${shortname}" == "armar" ]; then elif [ "${shortname}" == "armar" ]; then
gamedirname="ArmaReforger"
fn_check_cfgdir fn_check_cfgdir
array_configs+=(server.json) array_configs+=(server.json)
fn_fetch_default_config fn_fetch_default_config
@ -211,7 +204,6 @@ elif [ "${shortname}" == "armar" ]; then
fn_set_config_vars fn_set_config_vars
fn_list_config_locations fn_list_config_locations
elif [ "${shortname}" == "ats" ]; then elif [ "${shortname}" == "ats" ]; then
gamedirname="AmericanTruckSimulator"
fn_check_cfgdir fn_check_cfgdir
array_configs+=(server_config.sii) array_configs+=(server_config.sii)
fn_fetch_default_config fn_fetch_default_config
@ -219,21 +211,18 @@ elif [ "${shortname}" == "ats" ]; then
fn_set_config_vars fn_set_config_vars
fn_list_config_locations fn_list_config_locations
elif [ "${shortname}" == "bo" ]; then elif [ "${shortname}" == "bo" ]; then
gamedirname="BallisticOverkill"
array_configs+=(config.txt) array_configs+=(config.txt)
fn_fetch_default_config fn_fetch_default_config
fn_default_config_remote fn_default_config_remote
fn_set_config_vars fn_set_config_vars
fn_list_config_locations fn_list_config_locations
elif [ "${shortname}" == "bd" ]; then elif [ "${shortname}" == "bd" ]; then
gamedirname="BaseDefense"
array_configs+=(server.cfg) array_configs+=(server.cfg)
fn_fetch_default_config fn_fetch_default_config
fn_default_config_remote fn_default_config_remote
fn_set_config_vars fn_set_config_vars
fn_list_config_locations fn_list_config_locations
elif [ "${shortname}" == "bt" ]; then elif [ "${shortname}" == "bt" ]; then
gamedirname="Barotrauma"
fn_check_cfgdir fn_check_cfgdir
array_configs+=(serversettings.xml) array_configs+=(serversettings.xml)
fn_fetch_default_config fn_fetch_default_config
@ -241,7 +230,6 @@ elif [ "${shortname}" == "bt" ]; then
fn_set_config_vars fn_set_config_vars
fn_list_config_locations fn_list_config_locations
elif [ "${shortname}" == "btl" ]; then elif [ "${shortname}" == "btl" ]; then
gamedirname="BattalionLegacy"
fn_check_cfgdir fn_check_cfgdir
array_configs+=(DefaultGame.ini) array_configs+=(DefaultGame.ini)
fn_fetch_default_config fn_fetch_default_config
@ -249,147 +237,126 @@ elif [ "${shortname}" == "btl" ]; then
fn_set_config_vars fn_set_config_vars
fn_list_config_locations fn_list_config_locations
elif [ "${shortname}" == "bf1942" ]; then elif [ "${shortname}" == "bf1942" ]; then
gamedirname="Battlefield1942"
array_configs+=(serversettings.con) array_configs+=(serversettings.con)
fn_fetch_default_config fn_fetch_default_config
fn_default_config_remote fn_default_config_remote
fn_set_config_vars fn_set_config_vars
fn_list_config_locations fn_list_config_locations
elif [ "${shortname}" == "bfv" ]; then elif [ "${shortname}" == "bfv" ]; then
gamedirname="BattlefieldVietnam"
array_configs+=(serversettings.con) array_configs+=(serversettings.con)
fn_fetch_default_config fn_fetch_default_config
fn_default_config_remote fn_default_config_remote
fn_set_config_vars fn_set_config_vars
fn_list_config_locations fn_list_config_locations
elif [ "${shortname}" == "bs" ]; then elif [ "${shortname}" == "bs" ]; then
gamedirname="BladeSymphony"
array_configs+=(server.cfg) array_configs+=(server.cfg)
fn_fetch_default_config fn_fetch_default_config
fn_default_config_remote fn_default_config_remote
fn_set_config_vars fn_set_config_vars
fn_list_config_locations fn_list_config_locations
elif [ "${shortname}" == "bb" ]; then elif [ "${shortname}" == "bb" ]; then
gamedirname="BrainBread"
array_configs+=(server.cfg) array_configs+=(server.cfg)
fn_fetch_default_config fn_fetch_default_config
fn_default_config_remote fn_default_config_remote
fn_set_config_vars fn_set_config_vars
fn_list_config_locations fn_list_config_locations
elif [ "${shortname}" == "bb2" ]; then elif [ "${shortname}" == "bb2" ]; then
gamedirname="BrainBread2"
array_configs+=(server.cfg) array_configs+=(server.cfg)
fn_fetch_default_config fn_fetch_default_config
fn_default_config_remote fn_default_config_remote
fn_set_config_vars fn_set_config_vars
fn_list_config_locations fn_list_config_locations
elif [ "${shortname}" == "bmdm" ]; then elif [ "${shortname}" == "bmdm" ]; then
gamedirname="BlackMesa"
array_configs+=(server.cfg) array_configs+=(server.cfg)
fn_fetch_default_config fn_fetch_default_config
fn_default_config_remote fn_default_config_remote
fn_set_config_vars fn_set_config_vars
fn_list_config_locations fn_list_config_locations
elif [ "${shortname}" == "cd" ]; then elif [ "${shortname}" == "cd" ]; then
gamedirname="CraftingDead"
array_configs+=(properties.json) array_configs+=(properties.json)
fn_fetch_default_config fn_fetch_default_config
fn_default_config_remote fn_default_config_remote
fn_set_config_vars fn_set_config_vars
fn_list_config_locations fn_list_config_locations
elif [ "${shortname}" == "ck" ]; then elif [ "${shortname}" == "ck" ]; then
gamedirname="CoreKeeper"
array_configs+=(ServerConfig.json) array_configs+=(ServerConfig.json)
fn_fetch_default_config fn_fetch_default_config
fn_default_config_remote fn_default_config_remote
fn_set_config_vars fn_set_config_vars
fn_list_config_locations fn_list_config_locations
elif [ "${shortname}" == "cod" ]; then elif [ "${shortname}" == "cod" ]; then
gamedirname="CallOfDuty"
array_configs+=(server.cfg) array_configs+=(server.cfg)
fn_fetch_default_config fn_fetch_default_config
fn_default_config_remote fn_default_config_remote
fn_set_config_vars fn_set_config_vars
fn_list_config_locations fn_list_config_locations
elif [ "${shortname}" == "coduo" ]; then elif [ "${shortname}" == "coduo" ]; then
gamedirname="CallOfDutyUnitedOffensive"
array_configs+=(server.cfg) array_configs+=(server.cfg)
fn_fetch_default_config fn_fetch_default_config
fn_default_config_remote fn_default_config_remote
fn_set_config_vars fn_set_config_vars
fn_list_config_locations fn_list_config_locations
elif [ "${shortname}" == "cod2" ]; then elif [ "${shortname}" == "cod2" ]; then
gamedirname="CallOfDuty2"
array_configs+=(server.cfg) array_configs+=(server.cfg)
fn_fetch_default_config fn_fetch_default_config
fn_default_config_remote fn_default_config_remote
fn_set_config_vars fn_set_config_vars
fn_list_config_locations fn_list_config_locations
elif [ "${shortname}" == "cod4" ]; then elif [ "${shortname}" == "cod4" ]; then
gamedirname="CallOfDuty4"
array_configs+=(server.cfg) array_configs+=(server.cfg)
fn_fetch_default_config fn_fetch_default_config
fn_default_config_remote fn_default_config_remote
fn_set_config_vars fn_set_config_vars
fn_list_config_locations fn_list_config_locations
elif [ "${shortname}" == "codwaw" ]; then elif [ "${shortname}" == "codwaw" ]; then
gamedirname="CallOfDutyWorldAtWar"
array_configs+=(server.cfg) array_configs+=(server.cfg)
fn_fetch_default_config fn_fetch_default_config
fn_default_config_remote fn_default_config_remote
fn_set_config_vars fn_set_config_vars
fn_list_config_locations fn_list_config_locations
elif [ "${shortname}" == "cc" ]; then elif [ "${shortname}" == "cc" ]; then
gamedirname="CodenameCURE"
array_configs+=(server.cfg) array_configs+=(server.cfg)
fn_fetch_default_config fn_fetch_default_config
fn_default_config_remote fn_default_config_remote
fn_set_config_vars fn_set_config_vars
fn_list_config_locations fn_list_config_locations
elif [ "${shortname}" == "col" ]; then elif [ "${shortname}" == "col" ]; then
gamedirname="ColonySurvival"
array_configs+=(colserver.json) array_configs+=(colserver.json)
fn_fetch_default_config fn_fetch_default_config
fn_default_config_remote fn_default_config_remote
fn_set_config_vars fn_set_config_vars
fn_list_config_locations fn_list_config_locations
elif [ "${shortname}" == "cs" ]; then elif [ "${shortname}" == "cs" ]; then
gamedirname="CounterStrike"
array_configs+=(server.cfg) array_configs+=(server.cfg)
fn_fetch_default_config fn_fetch_default_config
fn_default_config_remote fn_default_config_remote
fn_set_config_vars fn_set_config_vars
fn_list_config_locations fn_list_config_locations
elif [ "${shortname}" == "cscz" ]; then elif [ "${shortname}" == "cscz" ]; then
gamedirname="CounterStrikeConditionZero"
array_configs+=(server.cfg) array_configs+=(server.cfg)
fn_fetch_default_config fn_fetch_default_config
fn_default_config_remote fn_default_config_remote
fn_set_config_vars fn_set_config_vars
fn_list_config_locations fn_list_config_locations
elif [ "${shortname}" == "csgo" ]; then elif [ "${shortname}" == "csgo" ]; then
gamedirname="CounterStrikeGlobalOffensive"
array_configs+=(server.cfg) array_configs+=(server.cfg)
fn_fetch_default_config fn_fetch_default_config
fn_default_config_remote fn_default_config_remote
fn_set_config_vars fn_set_config_vars
fn_list_config_locations fn_list_config_locations
elif [ "${shortname}" == "css" ]; then elif [ "${shortname}" == "css" ]; then
gamedirname="CounterStrikeSource"
array_configs+=(server.cfg) array_configs+=(server.cfg)
fn_fetch_default_config fn_fetch_default_config
fn_default_config_remote fn_default_config_remote
fn_set_config_vars fn_set_config_vars
fn_list_config_locations fn_list_config_locations
elif [ "${shortname}" == "ct" ]; then elif [ "${shortname}" == "ct" ]; then
gamedirname="Craftopia"
array_configs+=(ServerSetting.ini) array_configs+=(ServerSetting.ini)
fn_fetch_default_config fn_fetch_default_config
fn_default_config_remote fn_default_config_remote
fn_set_config_vars fn_set_config_vars
fn_list_config_locations fn_list_config_locations
elif [ "${shortname}" == "dayz" ]; then elif [ "${shortname}" == "dayz" ]; then
gamedirname="DayZ"
fn_check_cfgdir fn_check_cfgdir
array_configs+=(server.cfg) array_configs+=(server.cfg)
fn_fetch_default_config fn_fetch_default_config
@ -397,41 +364,35 @@ elif [ "${shortname}" == "dayz" ]; then
fn_set_config_vars fn_set_config_vars
fn_list_config_locations fn_list_config_locations
elif [ "${shortname}" == "dod" ]; then elif [ "${shortname}" == "dod" ]; then
gamedirname="DayOfDefeat"
array_configs+=(server.cfg) array_configs+=(server.cfg)
fn_fetch_default_config fn_fetch_default_config
fn_default_config_remote fn_default_config_remote
fn_set_config_vars fn_set_config_vars
fn_list_config_locations fn_list_config_locations
elif [ "${shortname}" == "dodr" ]; then elif [ "${shortname}" == "dodr" ]; then
gamedirname="DayOfDragons"
array_configs+=(Game.ini) array_configs+=(Game.ini)
fn_fetch_default_config fn_fetch_default_config
fn_default_config_remote fn_default_config_remote
fn_list_config_locations fn_list_config_locations
elif [ "${shortname}" == "dods" ]; then elif [ "${shortname}" == "dods" ]; then
gamedirname="DayOfDefeatSource"
array_configs+=(server.cfg) array_configs+=(server.cfg)
fn_fetch_default_config fn_fetch_default_config
fn_default_config_remote fn_default_config_remote
fn_set_config_vars fn_set_config_vars
fn_list_config_locations fn_list_config_locations
elif [ "${shortname}" == "doi" ]; then elif [ "${shortname}" == "doi" ]; then
gamedirname="DayOfInfamy"
array_configs+=(server.cfg) array_configs+=(server.cfg)
fn_fetch_default_config fn_fetch_default_config
fn_default_config_remote fn_default_config_remote
fn_set_config_vars fn_set_config_vars
fn_list_config_locations fn_list_config_locations
elif [ "${shortname}" == "dmc" ]; then elif [ "${shortname}" == "dmc" ]; then
gamedirname="DeathmatchClassic"
array_configs+=(server.cfg) array_configs+=(server.cfg)
fn_fetch_default_config fn_fetch_default_config
fn_default_config_remote fn_default_config_remote
fn_set_config_vars fn_set_config_vars
fn_list_config_locations fn_list_config_locations
elif [ "${shortname}" == "dst" ]; then elif [ "${shortname}" == "dst" ]; then
gamedirname="DontStarveTogether"
fn_check_cfgdir fn_check_cfgdir
array_configs+=(cluster.ini server.ini) array_configs+=(cluster.ini server.ini)
fn_fetch_default_config fn_fetch_default_config
@ -439,21 +400,18 @@ elif [ "${shortname}" == "dst" ]; then
fn_set_dst_config_vars fn_set_dst_config_vars
fn_list_config_locations fn_list_config_locations
elif [ "${shortname}" == "dab" ]; then elif [ "${shortname}" == "dab" ]; then
gamedirname="DoubleActionBoogaloo"
array_configs+=(server.cfg) array_configs+=(server.cfg)
fn_fetch_default_config fn_fetch_default_config
fn_default_config_remote fn_default_config_remote
fn_set_config_vars fn_set_config_vars
fn_list_config_locations fn_list_config_locations
elif [ "${shortname}" == "dys" ]; then elif [ "${shortname}" == "dys" ]; then
gamedirname="Dystopia"
array_configs+=(server.cfg) array_configs+=(server.cfg)
fn_fetch_default_config fn_fetch_default_config
fn_default_config_remote fn_default_config_remote
fn_set_config_vars fn_set_config_vars
fn_list_config_locations fn_list_config_locations
elif [ "${shortname}" == "eco" ]; then elif [ "${shortname}" == "eco" ]; then
gamedirname="Eco"
array_configs+=(Network.eco) array_configs+=(Network.eco)
fn_fetch_default_config fn_fetch_default_config
fn_default_config_remote fn_default_config_remote
@ -463,14 +421,12 @@ elif [ "${shortname}" == "em" ]; then
fn_default_config_local fn_default_config_local
fn_list_config_locations fn_list_config_locations
elif [ "${shortname}" == "etl" ]; then elif [ "${shortname}" == "etl" ]; then
gamedirname="ETLegacy"
array_configs+=(server.cfg) array_configs+=(server.cfg)
fn_fetch_default_config fn_fetch_default_config
fn_default_config_remote fn_default_config_remote
fn_set_config_vars fn_set_config_vars
fn_list_config_locations fn_list_config_locations
elif [ "${shortname}" == "ets2" ]; then elif [ "${shortname}" == "ets2" ]; then
gamedirname="EuroTruckSimulator2"
fn_check_cfgdir fn_check_cfgdir
array_configs+=(server_config.sii) array_configs+=(server_config.sii)
fn_fetch_default_config fn_fetch_default_config
@ -478,133 +434,114 @@ elif [ "${shortname}" == "ets2" ]; then
fn_set_config_vars fn_set_config_vars
fn_list_config_locations fn_list_config_locations
elif [ "${shortname}" == "fctr" ]; then elif [ "${shortname}" == "fctr" ]; then
gamedirname="Factorio"
array_configs+=(server-settings.json) array_configs+=(server-settings.json)
fn_fetch_default_config fn_fetch_default_config
fn_default_config_remote fn_default_config_remote
fn_set_config_vars fn_set_config_vars
fn_list_config_locations fn_list_config_locations
elif [ "${shortname}" == "fof" ]; then elif [ "${shortname}" == "fof" ]; then
gamedirname="FistfulofFrags"
array_configs+=(server.cfg) array_configs+=(server.cfg)
fn_fetch_default_config fn_fetch_default_config
fn_default_config_remote fn_default_config_remote
fn_set_config_vars fn_set_config_vars
fn_list_config_locations fn_list_config_locations
elif [ "${shortname}" == "gmod" ]; then elif [ "${shortname}" == "gmod" ]; then
gamedirname="GarrysMod"
array_configs+=(server.cfg) array_configs+=(server.cfg)
fn_fetch_default_config fn_fetch_default_config
fn_default_config_remote fn_default_config_remote
fn_set_config_vars fn_set_config_vars
fn_list_config_locations fn_list_config_locations
elif [ "${shortname}" == "hldm" ]; then elif [ "${shortname}" == "hldm" ]; then
gamedirname="HalfLifeDeathmatch"
array_configs+=(server.cfg) array_configs+=(server.cfg)
fn_fetch_default_config fn_fetch_default_config
fn_default_config_remote fn_default_config_remote
fn_set_config_vars fn_set_config_vars
fn_list_config_locations fn_list_config_locations
elif [ "${shortname}" == "hldms" ]; then elif [ "${shortname}" == "hldms" ]; then
gamedirname="HalfLifeDeathmatchSource"
array_configs+=(server.cfg) array_configs+=(server.cfg)
fn_fetch_default_config fn_fetch_default_config
fn_default_config_remote fn_default_config_remote
fn_set_config_vars fn_set_config_vars
fn_list_config_locations fn_list_config_locations
elif [ "${shortname}" == "ohd" ]; then elif [ "${shortname}" == "ohd" ]; then
gamedirname="OperationHarshDoorstop"
array_configs+=(Game.ini) array_configs+=(Game.ini)
fn_fetch_default_config fn_fetch_default_config
fn_default_config_remote fn_default_config_remote
fn_set_config_vars fn_set_config_vars
fn_list_config_locations fn_list_config_locations
elif [ "${shortname}" == "opfor" ]; then elif [ "${shortname}" == "opfor" ]; then
gamedirname="OpposingForce"
array_configs+=(server.cfg) array_configs+=(server.cfg)
fn_fetch_default_config fn_fetch_default_config
fn_default_config_remote fn_default_config_remote
fn_set_config_vars fn_set_config_vars
fn_list_config_locations fn_list_config_locations
elif [ "${shortname}" == "hl2dm" ]; then elif [ "${shortname}" == "hl2dm" ]; then
gamedirname="HalfLife2Deathmatch"
array_configs+=(server.cfg) array_configs+=(server.cfg)
fn_fetch_default_config fn_fetch_default_config
fn_default_config_remote fn_default_config_remote
fn_set_config_vars fn_set_config_vars
fn_list_config_locations fn_list_config_locations
elif [ "${shortname}" == "ins" ]; then elif [ "${shortname}" == "ins" ]; then
gamedirname="Insurgency"
array_configs+=(server.cfg) array_configs+=(server.cfg)
fn_fetch_default_config fn_fetch_default_config
fn_default_config_remote fn_default_config_remote
fn_set_config_vars fn_set_config_vars
fn_list_config_locations fn_list_config_locations
elif [ "${shortname}" == "ios" ]; then elif [ "${shortname}" == "ios" ]; then
gamedirname="IOSoccer"
array_configs+=(server.cfg) array_configs+=(server.cfg)
fn_fetch_default_config fn_fetch_default_config
fn_default_config_remote fn_default_config_remote
fn_set_config_vars fn_set_config_vars
fn_list_config_locations fn_list_config_locations
elif [ "${shortname}" == "jc2" ]; then elif [ "${shortname}" == "jc2" ]; then
gamedirname="JustCause2"
array_configs+=(config.lua) array_configs+=(config.lua)
fn_fetch_default_config fn_fetch_default_config
fn_default_config_remote fn_default_config_remote
fn_set_config_vars fn_set_config_vars
fn_list_config_locations fn_list_config_locations
elif [ "${shortname}" == "jc3" ]; then elif [ "${shortname}" == "jc3" ]; then
gamedirname="JustCause3"
array_configs+=(config.json) array_configs+=(config.json)
fn_fetch_default_config fn_fetch_default_config
fn_default_config_remote fn_default_config_remote
fn_set_config_vars fn_set_config_vars
fn_list_config_locations fn_list_config_locations
elif [ "${shortname}" == "kf" ]; then elif [ "${shortname}" == "kf" ]; then
gamedirname="KillingFloor"
array_configs+=(Default.ini) array_configs+=(Default.ini)
fn_fetch_default_config fn_fetch_default_config
fn_default_config_remote fn_default_config_remote
fn_set_config_vars fn_set_config_vars
fn_list_config_locations fn_list_config_locations
elif [ "${shortname}" == "l4d" ]; then elif [ "${shortname}" == "l4d" ]; then
gamedirname="Left4Dead"
array_configs+=(server.cfg) array_configs+=(server.cfg)
fn_fetch_default_config fn_fetch_default_config
fn_default_config_remote fn_default_config_remote
fn_set_config_vars fn_set_config_vars
fn_list_config_locations fn_list_config_locations
elif [ "${shortname}" == "l4d2" ]; then elif [ "${shortname}" == "l4d2" ]; then
gamedirname="Left4Dead2"
array_configs+=(server.cfg) array_configs+=(server.cfg)
fn_fetch_default_config fn_fetch_default_config
fn_default_config_remote fn_default_config_remote
fn_set_config_vars fn_set_config_vars
fn_list_config_locations fn_list_config_locations
elif [ "${shortname}" == "mc" ] || [ "${shortname}" == "pmc" ]; then elif [ "${shortname}" == "mc" ] || [ "${shortname}" == "pmc" ]; then
gamedirname="Minecraft"
array_configs+=(server.properties) array_configs+=(server.properties)
fn_fetch_default_config fn_fetch_default_config
fn_default_config_remote fn_default_config_remote
fn_set_config_vars fn_set_config_vars
fn_list_config_locations fn_list_config_locations
elif [ "${shortname}" == "mcb" ]; then elif [ "${shortname}" == "mcb" ]; then
gamedirname="MinecraftBedrock"
array_configs+=(server.properties) array_configs+=(server.properties)
fn_fetch_default_config fn_fetch_default_config
fn_default_config_remote fn_default_config_remote
fn_set_config_vars fn_set_config_vars
fn_list_config_locations fn_list_config_locations
elif [ "${shortname}" == "mohaa" ]; then elif [ "${shortname}" == "mohaa" ]; then
gamedirname="MedalOfHonorAlliedAssault"
array_configs+=(server.cfg) array_configs+=(server.cfg)
fn_fetch_default_config fn_fetch_default_config
fn_default_config_remote fn_default_config_remote
fn_set_config_vars fn_set_config_vars
fn_list_config_locations fn_list_config_locations
elif [ "${shortname}" == "mh" ]; then elif [ "${shortname}" == "mh" ]; then
gamedirname="Mordhau"
fn_check_cfgdir fn_check_cfgdir
array_configs+=(Game.ini) array_configs+=(Game.ini)
fn_fetch_default_config fn_fetch_default_config
@ -612,56 +549,48 @@ elif [ "${shortname}" == "mh" ]; then
fn_set_config_vars fn_set_config_vars
fn_list_config_locations fn_list_config_locations
elif [ "${shortname}" == "ns" ]; then elif [ "${shortname}" == "ns" ]; then
gamedirname="NaturalSelection"
array_configs+=(server.cfg) array_configs+=(server.cfg)
fn_fetch_default_config fn_fetch_default_config
fn_default_config_remote fn_default_config_remote
fn_set_config_vars fn_set_config_vars
fn_list_config_locations fn_list_config_locations
elif [ "${shortname}" == "nmrih" ]; then elif [ "${shortname}" == "nmrih" ]; then
gamedirname="NoMoreRoominHell"
array_configs+=(server.cfg) array_configs+=(server.cfg)
fn_fetch_default_config fn_fetch_default_config
fn_default_config_remote fn_default_config_remote
fn_set_config_vars fn_set_config_vars
fn_list_config_locations fn_list_config_locations
elif [ "${shortname}" == "nd" ]; then elif [ "${shortname}" == "nd" ]; then
gamedirname="NuclearDawn"
array_configs+=(server.cfg) array_configs+=(server.cfg)
fn_fetch_default_config fn_fetch_default_config
fn_default_config_remote fn_default_config_remote
fn_set_config_vars fn_set_config_vars
fn_list_config_locations fn_list_config_locations
elif [ "${shortname}" == "mta" ]; then elif [ "${shortname}" == "mta" ]; then
gamedirname="MultiTheftAuto"
fn_check_cfgdir fn_check_cfgdir
array_configs+=(acl.xml mtaserver.conf vehiclecolors.conf) array_configs+=(acl.xml mtaserver.conf vehiclecolors.conf)
fn_fetch_default_config fn_fetch_default_config
fn_default_config_remote fn_default_config_remote
fn_list_config_locations fn_list_config_locations
elif [ "${shotname}" == "mom" ]; then elif [ "${shotname}" == "mom" ]; then
gamedirname="MemoriesofMars"
array_configs+=(DedicatedServerConfig.cfg) array_configs+=(DedicatedServerConfig.cfg)
fn_fetch_default_config fn_fetch_default_config
fn_default_config_remote fn_default_config_remote
fn_set_config_vars fn_set_config_vars
fn_list_config_locations fn_list_config_locations
elif [ "${shortname}" == "pvr" ]; then elif [ "${shortname}" == "pvr" ]; then
gamedirname="PavlovVR"
fn_check_cfgdir fn_check_cfgdir
array_configs+=(Game.ini) array_configs+=(Game.ini)
fn_fetch_default_config fn_fetch_default_config
fn_default_config_remote fn_default_config_remote
fn_set_config_vars fn_set_config_vars
elif [ "${shortname}" == "pvkii" ]; then elif [ "${shortname}" == "pvkii" ]; then
gamedirname="PiratesVikingandKnightsII"
array_configs+=(server.cfg) array_configs+=(server.cfg)
fn_fetch_default_config fn_fetch_default_config
fn_default_config_remote fn_default_config_remote
fn_set_config_vars fn_set_config_vars
fn_list_config_locations fn_list_config_locations
elif [ "${shortname}" == "pz" ]; then elif [ "${shortname}" == "pz" ]; then
gamedirname="ProjectZomboid"
fn_check_cfgdir fn_check_cfgdir
array_configs+=(server.ini) array_configs+=(server.ini)
fn_fetch_default_config fn_fetch_default_config
@ -669,7 +598,6 @@ elif [ "${shortname}" == "pz" ]; then
fn_set_config_vars fn_set_config_vars
fn_list_config_locations fn_list_config_locations
elif [ "${shortname}" == "nec" ]; then elif [ "${shortname}" == "nec" ]; then
gamedirname="Necesse"
fn_check_cfgdir fn_check_cfgdir
array_configs+=(server.cfg) array_configs+=(server.cfg)
fn_fetch_default_config fn_fetch_default_config
@ -677,184 +605,157 @@ elif [ "${shortname}" == "nec" ]; then
fn_set_config_vars fn_set_config_vars
fn_list_config_locations fn_list_config_locations
elif [ "${shortname}" == "pc" ]; then elif [ "${shortname}" == "pc" ]; then
gamedirname="ProjectCars"
array_configs+=(server.cfg) array_configs+=(server.cfg)
fn_fetch_default_config fn_fetch_default_config
fn_default_config_remote fn_default_config_remote
fn_set_config_vars fn_set_config_vars
fn_list_config_locations fn_list_config_locations
elif [ "${shortname}" == "pc2" ]; then elif [ "${shortname}" == "pc2" ]; then
gamedirname="ProjectCars2"
fn_default_config_local fn_default_config_local
fn_list_config_locations fn_list_config_locations
elif [ "${shortname}" == "q2" ]; then elif [ "${shortname}" == "q2" ]; then
gamedirname="Quake2"
array_configs+=(server.cfg) array_configs+=(server.cfg)
fn_fetch_default_config fn_fetch_default_config
fn_default_config_remote fn_default_config_remote
fn_set_config_vars fn_set_config_vars
fn_list_config_locations fn_list_config_locations
elif [ "${shortname}" == "q3" ]; then elif [ "${shortname}" == "q3" ]; then
gamedirname="Quake3Arena"
array_configs+=(server.cfg) array_configs+=(server.cfg)
fn_fetch_default_config fn_fetch_default_config
fn_default_config_remote fn_default_config_remote
fn_set_config_vars fn_set_config_vars
fn_list_config_locations fn_list_config_locations
elif [ "${shortname}" == "ql" ]; then elif [ "${shortname}" == "ql" ]; then
gamedirname="QuakeLive"
array_configs+=(server.cfg) array_configs+=(server.cfg)
fn_fetch_default_config fn_fetch_default_config
fn_default_config_remote fn_default_config_remote
fn_set_config_vars fn_set_config_vars
fn_list_config_locations fn_list_config_locations
elif [ "${shortname}" == "jk2" ]; then elif [ "${shortname}" == "jk2" ]; then
gamedirname="JediKnightIIJediOutcast"
array_configs+=(server.cfg) array_configs+=(server.cfg)
fn_fetch_default_config fn_fetch_default_config
fn_default_config_remote fn_default_config_remote
fn_set_config_vars fn_set_config_vars
elif [ "${shortname}" == "qw" ]; then elif [ "${shortname}" == "qw" ]; then
gamedirname="QuakeWorld"
array_configs+=(server.cfg) array_configs+=(server.cfg)
fn_fetch_default_config fn_fetch_default_config
fn_default_config_remote fn_default_config_remote
fn_set_config_vars fn_set_config_vars
fn_list_config_locations fn_list_config_locations
elif [ "${shortname}" == "ricochet" ]; then elif [ "${shortname}" == "ricochet" ]; then
gamedirname="Ricochet"
array_configs+=(server.cfg) array_configs+=(server.cfg)
fn_fetch_default_config fn_fetch_default_config
fn_default_config_remote fn_default_config_remote
fn_set_config_vars fn_set_config_vars
fn_list_config_locations fn_list_config_locations
elif [ "${shortname}" == "rtcw" ]; then elif [ "${shortname}" == "rtcw" ]; then
gamedirname="ReturnToCastleWolfenstein"
array_configs+=(server.cfg) array_configs+=(server.cfg)
fn_fetch_default_config fn_fetch_default_config
fn_default_config_remote fn_default_config_remote
fn_set_config_vars fn_set_config_vars
fn_list_config_locations fn_list_config_locations
elif [ "${shortname}" == "rust" ]; then elif [ "${shortname}" == "rust" ]; then
gamedirname="Rust"
fn_check_cfgdir fn_check_cfgdir
array_configs+=(server.cfg) array_configs+=(server.cfg)
fn_fetch_default_config fn_fetch_default_config
fn_default_config_remote fn_default_config_remote
fn_list_config_locations fn_list_config_locations
elif [ "${shortname}" == "scpsl" ] || [ "${shortname}" == "scpslsm" ]; then elif [ "${shortname}" == "scpsl" ] || [ "${shortname}" == "scpslsm" ]; then
gamedirname="SCPSecretLaboratory"
array_configs+=(config_gameplay.txt config_localadmin.txt) array_configs+=(config_gameplay.txt config_localadmin.txt)
fn_fetch_default_config fn_fetch_default_config
fn_default_config_remote fn_default_config_remote
fn_set_config_vars fn_set_config_vars
fn_list_config_locations fn_list_config_locations
elif [ "${shortname}" == "sf" ]; then elif [ "${shortname}" == "sf" ]; then
gamedirname="Satisfactory"
array_configs+=(GameUserSettings.ini) array_configs+=(GameUserSettings.ini)
fn_fetch_default_config fn_fetch_default_config
fn_default_config_remote fn_default_config_remote
fn_set_config_vars fn_set_config_vars
fn_list_config_locations fn_list_config_locations
elif [ "${shortname}" == "sol" ]; then elif [ "${shortname}" == "sol" ]; then
gamedirname="Soldat"
array_configs+=(soldat.ini) array_configs+=(soldat.ini)
fn_fetch_default_config fn_fetch_default_config
fn_default_config_remote fn_default_config_remote
fn_set_config_vars fn_set_config_vars
fn_list_config_locations fn_list_config_locations
elif [ "${shortname}" == "sof2" ]; then elif [ "${shortname}" == "sof2" ]; then
gamedirname="SoldierOfFortune2Gold"
array_configs+=(server.cfg mapcycle.txt) array_configs+=(server.cfg mapcycle.txt)
fn_fetch_default_config fn_fetch_default_config
fn_default_config_remote fn_default_config_remote
fn_set_config_vars fn_set_config_vars
fn_list_config_locations fn_list_config_locations
elif [ "${shortname}" == "sfc" ]; then elif [ "${shortname}" == "sfc" ]; then
gamedirname="SourceFortsClassic"
array_configs+=(server.cfg) array_configs+=(server.cfg)
fn_fetch_default_config fn_fetch_default_config
fn_default_config_remote fn_default_config_remote
fn_set_config_vars fn_set_config_vars
fn_list_config_locations fn_list_config_locations
elif [ "${shortname}" == "squad" ]; then elif [ "${shortname}" == "squad" ]; then
gamedirname="Squad"
array_configs+=(Admins.cfg Bans.cfg License.cfg Server.cfg Rcon.cfg) array_configs+=(Admins.cfg Bans.cfg License.cfg Server.cfg Rcon.cfg)
fn_fetch_default_config fn_fetch_default_config
fn_default_config_remote fn_default_config_remote
fn_set_config_vars fn_set_config_vars
fn_list_config_locations fn_list_config_locations
elif [ "${shortname}" == "sb" ]; then elif [ "${shortname}" == "sb" ]; then
gamedirname="Starbound"
array_configs+=(starbound_server.config) array_configs+=(starbound_server.config)
fn_fetch_default_config fn_fetch_default_config
fn_default_config_remote fn_default_config_remote
fn_set_config_vars fn_set_config_vars
fn_list_config_locations fn_list_config_locations
elif [ "${shortname}" == "stn" ]; then elif [ "${shortname}" == "stn" ]; then
gamedirname="SurvivetheNights"
array_configs+=(ServerConfig.txt ServerUsers.txt TpPresets.json UserPermissions.json) array_configs+=(ServerConfig.txt ServerUsers.txt TpPresets.json UserPermissions.json)
fn_fetch_default_config fn_fetch_default_config
fn_default_config_remote fn_default_config_remote
fn_set_config_vars fn_set_config_vars
fn_list_config_locations fn_list_config_locations
elif [ "${shortname}" == "sven" ]; then elif [ "${shortname}" == "sven" ]; then
gamedirname="SvenCoop"
array_configs+=(server.cfg) array_configs+=(server.cfg)
fn_fetch_default_config fn_fetch_default_config
fn_default_config_remote fn_default_config_remote
fn_set_config_vars fn_set_config_vars
fn_list_config_locations fn_list_config_locations
elif [ "${shortname}" == "tf2" ]; then elif [ "${shortname}" == "tf2" ]; then
gamedirname="TeamFortress2"
array_configs+=(server.cfg) array_configs+=(server.cfg)
fn_fetch_default_config fn_fetch_default_config
fn_default_config_remote fn_default_config_remote
fn_set_config_vars fn_set_config_vars
fn_list_config_locations fn_list_config_locations
elif [ "${shortname}" == "tfc" ]; then elif [ "${shortname}" == "tfc" ]; then
gamedirname="TeamFortressClassic"
array_configs+=(server.cfg) array_configs+=(server.cfg)
fn_fetch_default_config fn_fetch_default_config
fn_default_config_remote fn_default_config_remote
fn_set_config_vars fn_set_config_vars
fn_list_config_locations fn_list_config_locations
elif [ "${shortname}" == "ti" ]; then elif [ "${shortname}" == "ti" ]; then
gamedirname="TheIsle" array_configs+=(Game.ini Engine.ini)
array_configs+=(Game.ini)
fn_fetch_default_config fn_fetch_default_config
fn_default_config_remote fn_default_config_remote
fn_set_config_vars fn_set_config_vars
fn_list_config_locations fn_list_config_locations
elif [ "${shortname}" == "ts" ]; then elif [ "${shortname}" == "ts" ]; then
gamedirname="TheSpecialists"
array_configs+=(server.cfg) array_configs+=(server.cfg)
fn_fetch_default_config fn_fetch_default_config
fn_default_config_remote fn_default_config_remote
fn_set_config_vars fn_set_config_vars
fn_list_config_locations fn_list_config_locations
elif [ "${shortname}" == "ts3" ]; then elif [ "${shortname}" == "ts3" ]; then
gamedirname="TeamSpeak3"
array_configs+=(ts3server.ini) array_configs+=(ts3server.ini)
fn_fetch_default_config fn_fetch_default_config
fn_default_config_remote fn_default_config_remote
fn_list_config_locations fn_list_config_locations
elif [ "${shortname}" == "tw" ]; then elif [ "${shortname}" == "tw" ]; then
gamedirname="Teeworlds"
array_configs+=(server.cfg ctf.cfg dm.cfg duel.cfg tdm.cfg) array_configs+=(server.cfg ctf.cfg dm.cfg duel.cfg tdm.cfg)
fn_fetch_default_config fn_fetch_default_config
fn_default_config_remote fn_default_config_remote
fn_set_config_vars fn_set_config_vars
fn_list_config_locations fn_list_config_locations
elif [ "${shortname}" == "terraria" ]; then elif [ "${shortname}" == "terraria" ]; then
gamedirname="Terraria"
array_configs+=(serverconfig.txt) array_configs+=(serverconfig.txt)
fn_fetch_default_config fn_fetch_default_config
fn_default_config_remote fn_default_config_remote
fn_set_config_vars fn_set_config_vars
fn_list_config_locations fn_list_config_locations
elif [ "${shortname}" == "tu" ]; then elif [ "${shortname}" == "tu" ]; then
gamedirname="TowerUnite"
fn_check_cfgdir fn_check_cfgdir
array_configs+=(TowerServer.ini) array_configs+=(TowerServer.ini)
fn_fetch_default_config fn_fetch_default_config
@ -862,83 +763,71 @@ elif [ "${shortname}" == "tu" ]; then
fn_set_config_vars fn_set_config_vars
fn_list_config_locations fn_list_config_locations
elif [ "${shortname}" == "ut" ]; then elif [ "${shortname}" == "ut" ]; then
gamedirname="UnrealTournament"
array_configs+=(Game.ini Engine.ini) array_configs+=(Game.ini Engine.ini)
fn_fetch_default_config fn_fetch_default_config
fn_default_config_remote fn_default_config_remote
fn_set_config_vars fn_set_config_vars
fn_list_config_locations fn_list_config_locations
elif [ "${shortname}" == "ut2k4" ]; then elif [ "${shortname}" == "ut2k4" ]; then
gamedirname="UnrealTournament2004"
array_configs+=(UT2004.ini) array_configs+=(UT2004.ini)
fn_fetch_default_config fn_fetch_default_config
fn_default_config_remote fn_default_config_remote
fn_set_config_vars fn_set_config_vars
fn_list_config_locations fn_list_config_locations
elif [ "${shortname}" == "ut99" ]; then elif [ "${shortname}" == "ut99" ]; then
gamedirname="UnrealTournament99"
array_configs+=(Default.ini) array_configs+=(Default.ini)
fn_fetch_default_config fn_fetch_default_config
fn_default_config_remote fn_default_config_remote
fn_set_config_vars fn_set_config_vars
fn_list_config_locations fn_list_config_locations
elif [ "${shortname}" == "unt" ]; then elif [ "${shortname}" == "unt" ]; then
gamedirname="Unturned"
array_configs+=(Config.json) array_configs+=(Config.json)
fn_fetch_default_config fn_fetch_default_config
fn_default_config_remote fn_default_config_remote
fn_set_config_vars fn_set_config_vars
fn_list_config_locations fn_list_config_locations
elif [ "${shortname}" == "vints" ]; then elif [ "${shortname}" == "vints" ]; then
gamedirname="VintageStory"
array_configs+=(serverconfig.json) array_configs+=(serverconfig.json)
fn_fetch_default_config fn_fetch_default_config
fn_default_config_remote fn_default_config_remote
fn_set_config_vars fn_set_config_vars
fn_list_config_locations fn_list_config_locations
elif [ "${shortname}" == "vs" ]; then elif [ "${shortname}" == "vs" ]; then
gamedirname="VampireSlayer"
array_configs+=(server.cfg) array_configs+=(server.cfg)
fn_fetch_default_config fn_fetch_default_config
fn_default_config_remote fn_default_config_remote
fn_set_config_vars fn_set_config_vars
fn_list_config_locations fn_list_config_locations
elif [ "${shortname}" == "wet" ]; then elif [ "${shortname}" == "wet" ]; then
gamedirname="WolfensteinEnemyTerritory"
array_configs+=(server.cfg) array_configs+=(server.cfg)
fn_fetch_default_config fn_fetch_default_config
fn_default_config_remote fn_default_config_remote
fn_set_config_vars fn_set_config_vars
fn_list_config_locations fn_list_config_locations
elif [ "${shortname}" == "wf" ]; then elif [ "${shortname}" == "wf" ]; then
gamedirname="Warfork"
array_configs+=(server.cfg) array_configs+=(server.cfg)
fn_fetch_default_config fn_fetch_default_config
fn_default_config_remote fn_default_config_remote
fn_set_config_vars fn_set_config_vars
fn_list_config_locations fn_list_config_locations
elif [ "${shortname}" == "wmc" ]; then elif [ "${shortname}" == "wmc" ]; then
gamedirname="Waterfall"
array_configs+=(config.yml) array_configs+=(config.yml)
fn_fetch_default_config fn_fetch_default_config
fn_default_config_remote fn_default_config_remote
fn_set_config_vars fn_set_config_vars
elif [ "${shortname}" == "wurm" ]; then elif [ "${shortname}" == "wurm" ]; then
gamedirname="WurmUnlimited"
array_configs+=(server.cfg) array_configs+=(server.cfg)
fn_fetch_default_config fn_fetch_default_config
fn_default_config_remote fn_default_config_remote
fn_set_config_vars fn_set_config_vars
fn_list_config_locations fn_list_config_locations
elif [ "${shortname}" == "zmr" ]; then elif [ "${shortname}" == "zmr" ]; then
gamedirname="ZombieMasterReborn"
array_configs+=(server.cfg) array_configs+=(server.cfg)
fn_fetch_default_config fn_fetch_default_config
fn_default_config_remote fn_default_config_remote
fn_set_config_vars fn_set_config_vars
fn_list_config_locations fn_list_config_locations
elif [ "${shortname}" == "zps" ]; then elif [ "${shortname}" == "zps" ]; then
gamedirname="ZombiePanicSource"
array_configs+=(server.cfg) array_configs+=(server.cfg)
fn_fetch_default_config fn_fetch_default_config
fn_default_config_remote fn_default_config_remote

5
lgsm/modules/update_factorio.sh

@ -64,7 +64,10 @@ fn_update_remotebuild() {
fn_update_compare() { fn_update_compare() {
fn_print_dots "Checking for update: ${remotelocation}" fn_print_dots "Checking for update: ${remotelocation}"
# Update has been found or force update.
if [ "${localbuild}" != "${remotebuildversion}" ] || [ "${forceupdate}" == "1" ]; then if [ "${localbuild}" != "${remotebuildversion}" ] || [ "${forceupdate}" == "1" ]; then
# Create update lockfile.
date '+%s' > "${lockdir:?}/update.lock"
fn_print_ok_nl "Checking for update: ${remotelocation}" fn_print_ok_nl "Checking for update: ${remotelocation}"
echo -en "\n" echo -en "\n"
echo -e "Update available" echo -e "Update available"
@ -117,7 +120,7 @@ fn_update_compare() {
fn_firstcommand_reset fn_firstcommand_reset
fi fi
unset exitbypass unset exitbypass
date +%s > "${lockdir}/lastupdate.lock" date +%s > "${lockdir}/last-updated.lock"
alert="update" alert="update"
elif [ "${commandname}" == "CHECK-UPDATE" ]; then elif [ "${commandname}" == "CHECK-UPDATE" ]; then
alert="check-update" alert="check-update"

5
lgsm/modules/update_jediknight2.sh

@ -61,7 +61,10 @@ fn_update_remotebuild() {
fn_update_compare() { fn_update_compare() {
fn_print_dots "Checking for update: ${remotelocation}" fn_print_dots "Checking for update: ${remotelocation}"
# Update has been found or force update.
if [ "${localbuild}" != "${remotebuildversion}" ] || [ "${forceupdate}" == "1" ]; then if [ "${localbuild}" != "${remotebuildversion}" ] || [ "${forceupdate}" == "1" ]; then
# Create update lockfile.
date '+%s' > "${lockdir:?}/update.lock"
fn_print_ok_nl "Checking for update: ${remotelocation}" fn_print_ok_nl "Checking for update: ${remotelocation}"
echo -en "\n" echo -en "\n"
echo -e "Update available" echo -e "Update available"
@ -114,7 +117,7 @@ fn_update_compare() {
fn_firstcommand_reset fn_firstcommand_reset
fi fi
unset exitbypass unset exitbypass
date +%s > "${lockdir}/lastupdate.lock" date +%s > "${lockdir}/last-updated.lock"
alert="update" alert="update"
elif [ "${commandname}" == "CHECK-UPDATE" ]; then elif [ "${commandname}" == "CHECK-UPDATE" ]; then
alert="check-update" alert="check-update"

5
lgsm/modules/update_minecraft.sh

@ -75,7 +75,10 @@ fn_update_remotebuild() {
fn_update_compare() { fn_update_compare() {
fn_print_dots "Checking for update: ${remotelocation}" fn_print_dots "Checking for update: ${remotelocation}"
# Update has been found or force update.
if [ "${localbuild}" != "${remotebuildversion}" ] || [ "${forceupdate}" == "1" ]; then if [ "${localbuild}" != "${remotebuildversion}" ] || [ "${forceupdate}" == "1" ]; then
# Create update lockfile.
date '+%s' > "${lockdir:?}/update.lock"
fn_print_ok_nl "Checking for update: ${remotelocation}" fn_print_ok_nl "Checking for update: ${remotelocation}"
echo -en "\n" echo -en "\n"
echo -e "Update available" echo -e "Update available"
@ -128,7 +131,7 @@ fn_update_compare() {
fn_firstcommand_reset fn_firstcommand_reset
fi fi
unset exitbypass unset exitbypass
date +%s > "${lockdir}/lastupdate.lock" date +%s > "${lockdir}/last-updated.lock"
alert="update" alert="update"
elif [ "${commandname}" == "CHECK-UPDATE" ]; then elif [ "${commandname}" == "CHECK-UPDATE" ]; then
alert="check-update" alert="check-update"

5
lgsm/modules/update_minecraft_bedrock.sh

@ -80,7 +80,10 @@ fn_update_remotebuild() {
fn_update_compare() { fn_update_compare() {
fn_print_dots "Checking for update: ${remotelocation}" fn_print_dots "Checking for update: ${remotelocation}"
# Update has been found or force update.
if [ "${localbuild}" != "${remotebuildversion}" ] || [ "${forceupdate}" == "1" ]; then if [ "${localbuild}" != "${remotebuildversion}" ] || [ "${forceupdate}" == "1" ]; then
# Create update lockfile.
date '+%s' > "${lockdir:?}/update.lock"
fn_print_ok_nl "Checking for update: ${remotelocation}" fn_print_ok_nl "Checking for update: ${remotelocation}"
echo -en "\n" echo -en "\n"
echo -e "Update available" echo -e "Update available"
@ -133,7 +136,7 @@ fn_update_compare() {
fn_firstcommand_reset fn_firstcommand_reset
fi fi
unset exitbypass unset exitbypass
date +%s > "${lockdir}/lastupdate.lock" date +%s > "${lockdir}/last-updated.lock"
alert="update" alert="update"
elif [ "${commandname}" == "CHECK-UPDATE" ]; then elif [ "${commandname}" == "CHECK-UPDATE" ]; then
alert="check-update" alert="check-update"

5
lgsm/modules/update_mta.sh

@ -59,7 +59,10 @@ fn_update_remotebuild() {
fn_update_compare() { fn_update_compare() {
fn_print_dots "Checking for update: ${remotelocation}" fn_print_dots "Checking for update: ${remotelocation}"
# Update has been found or force update.
if [ "${localbuild}" != "${remotebuildversion}" ] || [ "${forceupdate}" == "1" ]; then if [ "${localbuild}" != "${remotebuildversion}" ] || [ "${forceupdate}" == "1" ]; then
# Create update lockfile.
date '+%s' > "${lockdir:?}/update.lock"
if [ "${forceupdate}" == "1" ]; then if [ "${forceupdate}" == "1" ]; then
# forceupdate bypasses checks, useful for small build changes # forceupdate bypasses checks, useful for small build changes
mtaupdatestatus="forced" mtaupdatestatus="forced"
@ -118,7 +121,7 @@ fn_update_compare() {
fn_firstcommand_reset fn_firstcommand_reset
fi fi
unset exitbypass unset exitbypass
date +%s > "${lockdir}/lastupdate.lock" date +%s > "${lockdir}/last-updated.lock"
alert="update" alert="update"
elif [ "${commandname}" == "CHECK-UPDATE" ]; then elif [ "${commandname}" == "CHECK-UPDATE" ]; then
alert="check-update" alert="check-update"

5
lgsm/modules/update_papermc.sh

@ -85,7 +85,10 @@ fn_update_remotebuild() {
fn_update_compare() { fn_update_compare() {
fn_print_dots "Checking for update: ${remotelocation}" fn_print_dots "Checking for update: ${remotelocation}"
# Update has been found or force update.
if [ "${localbuild}" != "${remotebuildversion}" ] || [ "${forceupdate}" == "1" ]; then if [ "${localbuild}" != "${remotebuildversion}" ] || [ "${forceupdate}" == "1" ]; then
# Create update lockfile.
date '+%s' > "${lockdir:?}/update.lock"
fn_print_ok_nl "Checking for update: ${remotelocation}" fn_print_ok_nl "Checking for update: ${remotelocation}"
echo -en "\n" echo -en "\n"
echo -e "Update available" echo -e "Update available"
@ -138,7 +141,7 @@ fn_update_compare() {
fn_firstcommand_reset fn_firstcommand_reset
fi fi
unset exitbypass unset exitbypass
date +%s > "${lockdir}/lastupdate.lock" date +%s > "${lockdir}/last-updated.lock"
alert="update" alert="update"
elif [ "${commandname}" == "CHECK-UPDATE" ]; then elif [ "${commandname}" == "CHECK-UPDATE" ]; then
alert="check-update" alert="check-update"

5
lgsm/modules/update_steamcmd.sh

@ -23,14 +23,15 @@ if [ "${forceupdate}" == "1" ]; then
exitbypass=1 exitbypass=1
command_stop.sh command_stop.sh
fn_firstcommand_reset fn_firstcommand_reset
date '+%s' > "${lockdir:?}/update.lock"
fn_dl_steamcmd fn_dl_steamcmd
date +%s > "${lockdir}/lastupdate.lock" date +%s > "${lockdir}/last-updated.lock"
exitbypass=1 exitbypass=1
command_start.sh command_start.sh
fn_firstcommand_reset fn_firstcommand_reset
else else
fn_dl_steamcmd fn_dl_steamcmd
date +%s > "${lockdir}/lastupdate.lock" date +%s > "${lockdir}/last-updated.lock"
fi fi
else else
fn_update_steamcmd_localbuild fn_update_steamcmd_localbuild

5
lgsm/modules/update_ts3.sh

@ -68,7 +68,10 @@ fn_update_remotebuild() {
fn_update_compare() { fn_update_compare() {
fn_print_dots "Checking for update: ${remotelocation}" fn_print_dots "Checking for update: ${remotelocation}"
# Update has been found or force update.
if [ "${localbuild}" != "${remotebuildversion}" ] || [ "${forceupdate}" == "1" ]; then if [ "${localbuild}" != "${remotebuildversion}" ] || [ "${forceupdate}" == "1" ]; then
# Create update lockfile.
date '+%s' > "${lockdir:?}/update.lock"
fn_print_ok_nl "Checking for update: ${remotelocation}" fn_print_ok_nl "Checking for update: ${remotelocation}"
echo -en "\n" echo -en "\n"
echo -e "Update available" echo -e "Update available"
@ -121,7 +124,7 @@ fn_update_compare() {
fn_firstcommand_reset fn_firstcommand_reset
fi fi
unset exitbypass unset exitbypass
date +%s > "${lockdir}/lastupdate.lock" date +%s > "${lockdir}/last-updated.lock"
alert="update" alert="update"
elif [ "${commandname}" == "CHECK-UPDATE" ]; then elif [ "${commandname}" == "CHECK-UPDATE" ]; then
alert="check-update" alert="check-update"

5
lgsm/modules/update_ut99.sh

@ -62,7 +62,10 @@ fn_update_remotebuild() {
fn_update_compare() { fn_update_compare() {
fn_print_dots "Checking for update: ${remotelocation}" fn_print_dots "Checking for update: ${remotelocation}"
# Update has been found or force update.
if [ "${localbuild}" != "${remotebuildversion}" ] || [ "${forceupdate}" == "1" ]; then if [ "${localbuild}" != "${remotebuildversion}" ] || [ "${forceupdate}" == "1" ]; then
# Create update lockfile.
date '+%s' > "${lockdir:?}/update.lock"
fn_print_ok_nl "Checking for update: ${remotelocation}" fn_print_ok_nl "Checking for update: ${remotelocation}"
echo -en "\n" echo -en "\n"
echo -e "Update available" echo -e "Update available"
@ -115,7 +118,7 @@ fn_update_compare() {
fn_firstcommand_reset fn_firstcommand_reset
fi fi
unset exitbypass unset exitbypass
date +%s > "${lockdir}/lastupdate.lock" date +%s > "${lockdir}/last-updated.lock"
alert="update" alert="update"
elif [ "${commandname}" == "CHECK-UPDATE" ]; then elif [ "${commandname}" == "CHECK-UPDATE" ]; then
alert="check-update" alert="check-update"

11
lgsm/modules/update_vintagestory.sh

@ -42,9 +42,9 @@ fn_update_remotebuild() {
else else
remotebuildversion=$(echo "${remotebuildresponse}" | jq -r '[ to_entries[] ] | .[].key' | grep -E "\-rc|\-pre" | sort -r -V | head -1) remotebuildversion=$(echo "${remotebuildresponse}" | jq -r '[ to_entries[] ] | .[].key' | grep -E "\-rc|\-pre" | sort -r -V | head -1)
fi fi
remotebuildfilename=$(echo "${remotebuildresponse}" | jq --arg remotebuildversion "${remotebuildversion}" -r '.[$remotebuildversion].server.filename') remotebuildfilename=$(echo "${remotebuildresponse}" | jq --arg remotebuildversion "${remotebuildversion}" -r '.[$remotebuildversion].linuxserver.filename')
remotebuildurl=$(echo "${remotebuildresponse}" | jq --arg remotebuildversion "${remotebuildversion}" -r '.[$remotebuildversion].server.urls.cdn') remotebuildurl=$(echo "${remotebuildresponse}" | jq --arg remotebuildversion "${remotebuildversion}" -r '.[$remotebuildversion].linuxserver.urls.cdn')
remotebuildhash=$(echo "${remotebuildresponse}" | jq --arg remotebuildversion "${remotebuildversion}" -r '.[$remotebuildversion].server.md5') remotebuildhash=$(echo "${remotebuildresponse}" | jq --arg remotebuildversion "${remotebuildversion}" -r '.[$remotebuildversion].linuxserver.md5')
if [ "${firstcommandname}" != "INSTALL" ]; then if [ "${firstcommandname}" != "INSTALL" ]; then
fn_print_dots "Checking remote build: ${remotelocation}" fn_print_dots "Checking remote build: ${remotelocation}"
@ -69,7 +69,10 @@ fn_update_remotebuild() {
fn_update_compare() { fn_update_compare() {
fn_print_dots "Checking for update: ${remotelocation}" fn_print_dots "Checking for update: ${remotelocation}"
# Update has been found or force update.
if [ "${localbuild}" != "${remotebuildversion}" ] || [ "${forceupdate}" == "1" ]; then if [ "${localbuild}" != "${remotebuildversion}" ] || [ "${forceupdate}" == "1" ]; then
# Create update lockfile.
date '+%s' > "${lockdir:?}/update.lock"
fn_print_ok_nl "Checking for update: ${remotelocation}" fn_print_ok_nl "Checking for update: ${remotelocation}"
echo -en "\n" echo -en "\n"
echo -e "Update available" echo -e "Update available"
@ -122,7 +125,7 @@ fn_update_compare() {
fn_firstcommand_reset fn_firstcommand_reset
fi fi
unset exitbypass unset exitbypass
date +%s > "${lockdir}/lastupdate.lock" date +%s > "${lockdir}/last-updated.lock"
alert="update" alert="update"
elif [ "${commandname}" == "CHECK-UPDATE" ]; then elif [ "${commandname}" == "CHECK-UPDATE" ]; then
alert="check-update" alert="check-update"

5
linuxgsm.sh

@ -20,13 +20,12 @@ if [ -f ".dev-debug" ]; then
set -x set -x
fi fi
version="v23.3.6" version="v23.4.0"
shortname="core" shortname="core"
gameservername="core" gameservername="core"
commandname="CORE" commandname="CORE"
rootdir=$(dirname "$(readlink -f "${BASH_SOURCE[0]}")") rootdir=$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")
selfname=$(basename "$(readlink -f "${BASH_SOURCE[0]}")") selfname=$(basename "$(readlink -f "${BASH_SOURCE[0]}")")
sessionname=$(echo "${selfname}" | cut -f1 -d".")
lgsmdir="${rootdir}/lgsm" lgsmdir="${rootdir}/lgsm"
[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" [ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log"
lgsmlogdir="${logdir}/lgsm" lgsmlogdir="${logdir}/lgsm"
@ -36,6 +35,8 @@ modulesdir="${lgsmdir}/modules"
tmpdir="${lgsmdir}/tmp" tmpdir="${lgsmdir}/tmp"
datadir="${lgsmdir}/data" datadir="${lgsmdir}/data"
lockdir="${lgsmdir}/lock" lockdir="${lgsmdir}/lock"
sessionname="${selfname}"
[ -f "${datadir}/${selfname}.uid" ] && socketname="${sessionname}-$(cat "${datadir}/${selfname}.uid")" || socketname="${sessionname}"
serverlist="${datadir}/serverlist.csv" serverlist="${datadir}/serverlist.csv"
serverlistmenu="${datadir}/serverlistmenu.csv" serverlistmenu="${datadir}/serverlistmenu.csv"
[ -n "${LGSM_CONFIG}" ] && configdir="${LGSM_CONFIG}" || configdir="${lgsmdir}/config-lgsm" [ -n "${LGSM_CONFIG}" ] && configdir="${LGSM_CONFIG}" || configdir="${lgsmdir}/config-lgsm"

2
tests/tests_fctrserver.sh

@ -20,7 +20,7 @@ if [ -f ".dev-debug" ]; then
set -x set -x
fi fi
version="v23.3.6" version="v23.4.0"
shortname="fctr" shortname="fctr"
gameservername="fctrserver" gameservername="fctrserver"
commandname="CORE" commandname="CORE"

2
tests/tests_jc2server.sh

@ -20,7 +20,7 @@ if [ -f ".dev-debug" ]; then
set -x set -x
fi fi
version="v23.3.6" version="v23.4.0"
shortname="jc2" shortname="jc2"
gameservername="jc2server" gameservername="jc2server"
commandname="CORE" commandname="CORE"

2
tests/tests_mcserver.sh

@ -20,7 +20,7 @@ if [ -f ".dev-debug" ]; then
set -x set -x
fi fi
version="v23.3.6" version="v23.4.0"
shortname="mc" shortname="mc"
gameservername="mcserver" gameservername="mcserver"
commandname="CORE" commandname="CORE"

2
tests/tests_ts3server.sh

@ -20,7 +20,7 @@ if [ -f ".dev-debug" ]; then
set -x set -x
fi fi
version="v23.3.6" version="v23.4.0"
shortname="ts3" shortname="ts3"
gameservername="ts3server" gameservername="ts3server"
commandname="CORE" commandname="CORE"

Loading…
Cancel
Save