Skip to content

Commit

Permalink
Merge branch 'develop' into feature/ismgs
Browse files Browse the repository at this point in the history
  • Loading branch information
dgibbs64 committed Jan 7, 2025
2 parents 81c0041 + 181cd50 commit acf3702
Show file tree
Hide file tree
Showing 88 changed files with 1,096 additions and 892 deletions.
2 changes: 1 addition & 1 deletion LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# The MIT License (MIT)

Copyright (c) 2012-2024 Daniel Gibbs
Copyright (c) 2012-2025 Daniel Gibbs

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<a href="https://bitbucket.org/GameServerManagers/linuxgsm"><img alt="GitHub Workflow Status" src="https://img.shields.io/github/actions/workflow/status/GameServerManagers/LinuxGSM/git-sync.yml?color=0052CC&logo=bitbucket&style=flat-square"></a>
<a href="https://linuxgsm.com/discord"><img alt="Discord" src="https://img.shields.io/discord/127498813903601664?color=5865F2&label=%20&logo=discord&logoColor=ffffff&style=flat-square"></a>
<a href="https://developer.valvesoftware.com/wiki/SteamCMD"><img src="https://img.shields.io/badge/SteamCMD-000000?style=flat-square&amp;logo=Steam&amp;logoColor=white" alt="SteamCMD"></a>
<a href="https://github.com/GameServerManagers/LinuxGSM/blob/main/LICENSE"><img src="https://img.shields.io/github/license/gameservermanagers/LinuxGSM?style=flat-square" alt="MIT License"></a>
<a href="https://github.com/GameServerManagers/LinuxGSM/blob/master/LICENSE.md"><img src="https://img.shields.io/github/license/gameservermanagers/LinuxGSM?style=flat-square" alt="MIT License"></a>
</p>

[LinuxGSM](https://linuxgsm.com) is the command-line tool for quick, simple deployment and management of Linux dedicated game servers.
Expand Down
4 changes: 2 additions & 2 deletions lgsm/config-default/config-lgsm/bfvserver/_default.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,8 @@ stopmode="3"
# 3: gamedig
# 4: gsquery
# 5: tcp
querymode="1"
querytype=""
querymode="3"
querytype="protocol-gamespy2"

## Console type
consoleverbose="yes"
Expand Down
5 changes: 5 additions & 0 deletions lgsm/config-default/config-lgsm/cs2server/_default.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ port="27015"
maxplayers="16"
wsapikey=""

## Game Server Login Token (GSLT): Required
# GSLT is required for running a public server.
# More info: https://docs.linuxgsm.com/steamcmd/gslt
gslt=""

## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters
startparameters="-dedicated -ip ${ip} -port ${port} -maxplayers ${maxplayers} -authkey ${wsapikey} +exec ${selfname}.cfg"

Expand Down
2 changes: 1 addition & 1 deletion lgsm/config-default/config-lgsm/jc2server/_default.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ stopmode="2"
# 4: gsquery
# 5: tcp
querymode="2"
querytype="jc2m"
querytype="jc2mp"

## Console type
consoleverbose="yes"
Expand Down
2 changes: 1 addition & 1 deletion lgsm/config-default/config-lgsm/sof2server/_default.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ glibc="2.1"
# Edit with care

## Game Server Directories
systemdir="${serverfiles}/main"
systemdir="${serverfiles}/base"
executabledir="${serverfiles}"
executable="./sof2ded"
servercfgdir="${systemdir}"
Expand Down
4 changes: 2 additions & 2 deletions lgsm/config-default/config-lgsm/stserver/_default.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@
#### Game Server Settings ####

## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters
worldname="moon_save"
worldsave="moon_save"
worldtype="Moon"

## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters
startparameters="-LOADLATEST ${worldname} ${worldtype}"
startparameters="-LOAD ${worldsave} ${worldtype}"

#### LinuxGSM Settings ####

Expand Down
2 changes: 1 addition & 1 deletion lgsm/config-default/config-lgsm/ts3server/_default.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ consoleinteract="no"
## Game Server Details
# Do not edit
gamename="TeamSpeak 3"
servername="TeamSpeak 3 Server"
servername="LinuxGSM"
engine="null"
glibc="2.17"

Expand Down
2 changes: 1 addition & 1 deletion lgsm/modules/alert_email.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ else
mail -s "${alerttitle}" "${email}" < "${alertlog}"
fi
exitcode=$?
if [ "${exitcode}" == "0" ]; then
if [ "${exitcode}" -ne 0 ]; then
fn_print_ok_nl "Sending Email alert: ${email}"
fn_script_log_pass "Sending Email alert: ${email}"
else
Expand Down
2 changes: 1 addition & 1 deletion lgsm/modules/alert_gotify.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# Website: https://linuxgsm.com
# Description: Sends Gotify alert.

module_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"

json=$(
cat << EOF
Expand Down
2 changes: 1 addition & 1 deletion lgsm/modules/check.sh
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ for allowed_command in "${allowed_commands_array[@]}"; do
fi
done

allowed_commands_array=(BACKUP DEBUG START)
allowed_commands_array=(BACKUP DEBUG DETAILS START UPDATE)
for allowed_command in "${allowed_commands_array[@]}"; do
if [ "${allowed_command}" == "${commandname}" ]; then
check_deps.sh
Expand Down
18 changes: 10 additions & 8 deletions lgsm/modules/check_deps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,12 @@ fn_install_mono_repo() {

# Did Mono repo install correctly?
if [ "${monoautoinstall}" != "1" ]; then
if [ $? != 0 ]; then
exitcode=$?
if [ "${exitcode}" -ne 0 ]; then
fn_print_failure_nl "Unable to install Mono repository."
fn_script_log_fail "Unable to install Mono repository."
else
fn_print_complete_nl "Installing Mono repository completed."
fn_print_success_nl "Installing Mono repository completed."
fn_script_log_pass "Installing Mono repository completed."
fi
fi
Expand Down Expand Up @@ -113,13 +114,13 @@ fn_deps_email() {
elif [ -d /etc/sendmail ]; then
array_deps_required+=(sendmail)
elif [ "$(command -v yum 2> /dev/null)" ] || [ "$(command -v dnf 2> /dev/null)" ]; then
array_deps_required+=(mailx postfix)
array_deps_required+=(s-nail postfix)
elif [ "$(command -v apt 2> /dev/null)" ]; then
array_deps_required+=(mailutils postfix)
fi
else
if [ "$(command -v yum 2> /dev/null)" ] || [ "$(command -v dnf 2> /dev/null)" ]; then
array_deps_required+=(mailx postfix)
array_deps_required+=(s-nail postfix)
elif [ "$(command -v apt 2> /dev/null)" ]; then
array_deps_required+=(mailutils postfix)
fi
Expand Down Expand Up @@ -195,9 +196,10 @@ fn_install_missing_deps() {
fi
autodepinstall="$?"

# If auto install passes remove steamcmd install failure.
# If auto install passes, remove steamcmd install failure and set exit code to 0.
if [ "${autodepinstall}" == "0" ]; then
unset steamcmdfail
exitcode=0
fi
fi

Expand Down Expand Up @@ -225,15 +227,15 @@ fn_install_missing_deps() {

else
if [ "${commandname}" == "INSTALL" ]; then
fn_print_information_nl "Required dependencies already installed."
fn_print_skip2_nl "Required dependencies already installed."
fn_script_log_info "Required dependencies already installed."
fi
fi
}

fn_check_loop() {
# Loop though required depenencies checking if they are installed.
for deptocheck in ${array_deps_required[*]}; do
for deptocheck in "${array_deps_required[@]}"; do
fn_deps_detector
done

Expand Down Expand Up @@ -317,7 +319,7 @@ fn_deps_detector() {
fi
# If SteamCMD requirements are not met install will fail.
if [ -n "${appid}" ]; then
for steamcmddeptocheck in ${array_deps_required_steamcmd[*]}; do
for steamcmddeptocheck in "${array_deps_required_steamcmd[@]}"; do
if [ "${deptocheck}" != "steamcmd" ] && [ "${deptocheck}" == "${steamcmddeptocheck}" ]; then
steamcmdfail=1
fi
Expand Down
2 changes: 2 additions & 0 deletions lgsm/modules/check_gamedig.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
# Website: https://linuxgsm.com
# Description: Installs nodejs and gamedig

moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"

if [ "$(command -v node)" ] && [ "$(command -v npm)" ] && [ "$(node -v | cut -d 'v' -f 2 | cut -d '.' -f 1)" -ge 16 ] && [ ! -f "${lgsmdir}/node_modules/gamedig/bin/gamedig.js" ]; then
echo -e ""
echo -e "${bold}${lightyellow}Installing Gamedig${default}"
Expand Down
2 changes: 1 addition & 1 deletion lgsm/modules/check_logs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
fn_check_logs() {
fn_print_dots "Checking for log files"
fn_print_info_nl "Checking for log files: Creating log files"
checklogs=1
checklogs=true
install_logs.sh
}

Expand Down
11 changes: 8 additions & 3 deletions lgsm/modules/check_system_requirements.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@ moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"

info_distro.sh

# RAM requirements in gigabytes for each game or engine.
if [[ "${arch}" != "x86_64" && "${arch}" != "i386" && "${arch}" != "i686" ]]; then
echo -e "${red}Error: Only x86 type architectures are supported. Detected architecture: ${arch}${default}"
fn_script_log_error "Only x86 type architectures are supported. Detected architecture: ${arch}"
core_exit.sh
fi

if [ "${shortname}" == "ark" ]; then
ramrequirementgb="7"
Expand Down Expand Up @@ -67,8 +71,9 @@ fi
if [ "${ramrequirementgb}" ]; then
if (($(echo "${physmemtotalgb} < ${ramrequirementgb}" | bc -l))); then
fn_print_dots "Checking RAM"
fn_print_warn_nl "Checking RAM: ${ramrequirementgb}G required, ${physmemtotal} available"
echo "* ${gamename} server may fail to run or experience poor performance."
fn_print_warn_nl "Checking RAM: Minumum RAM requirements not met"
fn_print_nl "* ${ramrequirementgb}G is required, but only ${physmemtotal} is available."
fn_print_nl "* ${gamename} server may fail to run or experience poor performance."
fn_sleep_time_5
fi
fi
14 changes: 7 additions & 7 deletions lgsm/modules/command_backup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# Description: Creates a .tar.gz file in the backup directory.

commandname="BACKUP"
commandaction="Backing up"
commandaction="Backup"
moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
fn_firstcommand_set

Expand Down Expand Up @@ -115,7 +115,7 @@ fn_backup_compression() {
# Tells how much will be compressed using rootdirduexbackup value from info_distro and prompt for continue.
fn_print_info "A total of ${rootdirduexbackup} will be compressed."
fn_script_log_info "A total of ${rootdirduexbackup} will be compressed: ${backupdir}/${backupname}.tar.gz"
fn_print_dots "Backup (${rootdirduexbackup}) ${backupname}.tar.gz, in progress..."
fn_print_dots "Backup (${rootdirduexbackup}) ${backupname}.tar.gz, in progress ..."
fn_script_log_info "Backup ${rootdirduexbackup} ${backupname}.tar.gz, in progress"
excludedir=$(fn_backup_relpath)

Expand All @@ -127,16 +127,16 @@ fn_backup_compression() {
fi

tar --use-compress-program=pigz -cf "${backupdir}/${backupname}.tar.gz" -C "${rootdir}" --exclude "${excludedir}" --exclude "${lockdir}" --exclude "${tmpdir}" ./.
local exitcode=$?
if [ "${exitcode}" != 0 ]; then
exitcode=$?
if [ "${exitcode}" -ne 0 ]; then
fn_print_fail_eol
fn_script_log_fail "Backup in progress: FAIL"
echo -e "${extractcmd}" | tee -a "${lgsmlog}"
fn_print_fail_nl "Starting backup"
fn_script_log_fail "Starting backup"
else
fn_print_ok_eol
fn_print_ok_nl "Completed: ${backupname}.tar.gz, total size $(du -sh "${backupdir}/${backupname}.tar.gz" | awk '{print $1}')"
fn_print_ok_nl "Completed: ${italic}${backupname}.tar.gz${default}, 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}')"
alert="backup"
alert.sh
Expand Down Expand Up @@ -190,15 +190,15 @@ fn_backup_prune() {
fn_backup_relpath() {
# Written by CedarLUG as a "realpath --relative-to" alternative in bash.
# Populate an array of tokens initialized from the rootdir components.
declare -a rdirtoks=($(readlink -f "${rootdir}" | sed "s/\// /g"))
mapfile -t rdirtoks < <(readlink -f "${rootdir}" | sed "s/\// /g")
if [ ${#rdirtoks[@]} -eq 0 ]; then
fn_print_fail_nl "Problem assessing rootdir during relative path assessment"
fn_script_log_fail "Problem assessing rootdir during relative path assessment: ${rootdir}"
core_exit.sh
fi

# Populate an array of tokens initialized from the backupdir components.
declare -a bdirtoks=($(readlink -f "${backupdir}" | sed "s/\// /g"))
mapfile -t bdirtoks < <(readlink -f "${backupdir}" | sed "s/\// /g")
if [ ${#bdirtoks[@]} -eq 0 ]; then
fn_print_fail_nl "Problem assessing backupdir during relative path assessment"
fn_script_log_fail "Problem assessing backupdir during relative path assessment: ${rootdir}"
Expand Down
11 changes: 6 additions & 5 deletions lgsm/modules/command_console.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,14 @@
# Description: Gives access to the server tmux console.

commandname="CONSOLE"
commandaction="Access console"
commandaction="Access Console"
moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
fn_firstcommand_set

check.sh
fn_print_header

check.sh

if [ "${consoleverbose}" == "yes" ]; then
echo -e "* Verbose output: ${lightgreen}yes${default}"
elif [ "${consoleverbose}" == "no" ]; then
Expand All @@ -29,10 +30,10 @@ else
echo -e "* Interactive output: ${red}unknown${default}"
fi
echo ""
fn_print_information_nl "Press \"CTRL+b\" then \"d\" to exit console."
fn_print_warning_nl "Do NOT press CTRL+c to exit."
echo -e "* https://docs.linuxgsm.com/commands/console"
fn_print_information_nl "Press ${italic}\"CTRL+b\"${default} then ${italic}\"d\"${default} to exit console."
fn_print_warning_nl "Do ${underline}NOT${default} press CTRL+c to exit."
echo -e ""
echo -e "${italic}https://docs.linuxgsm.com/commands/console${default}"
if ! fn_prompt_yn "Continue?" Y; then
exitcode=0
core_exit.sh
Expand Down
13 changes: 8 additions & 5 deletions lgsm/modules/command_debug.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# Description: Runs the server without tmux and directly from the terminal.

commandname="DEBUG"
commandaction="Debuging"
commandaction="Debugging"
moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
fn_firstcommand_set

Expand All @@ -24,11 +24,13 @@ fn_lockfile_trap() {
core_exit.sh
}

fn_print_header

check.sh
fix.sh
info_distro.sh
info_game.sh
fn_print_header

{
echo -e "${lightblue}Distro:\t\t${default}${distroname}"
echo -e "${lightblue}Architecture:\t\t${default}${arch}"
Expand Down Expand Up @@ -121,9 +123,10 @@ else
eval "${preexecutable} ${executable} ${startparameters}"
fi

if [ $? -ne 0 ]; then
fn_print_error_nl "Server has stopped: exit code: $?"
fn_script_log_error "Server has stopped: exit code: $?"
exitcode=$?
if [ "${exitcode}" -ne 0 ]; then
fn_print_error_nl "Server has stopped: exit code: ${exitcode}"
fn_script_log_error "Server has stopped: exit code: ${exitcode}"
fn_print_error_nl "Press ENTER to exit debug mode"
read -r
else
Expand Down
2 changes: 1 addition & 1 deletion lgsm/modules/command_details.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# Description: Displays server information.

commandname="DETAILS"
commandaction="Viewing details"
commandaction="Display Details"
moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
fn_firstcommand_set

Expand Down
2 changes: 1 addition & 1 deletion lgsm/modules/command_dev_clear_modules.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# Description: Deletes the contents of the modules dir.

commandname="DEV-CLEAR-MODULES"
commandaction="Clearing modules"
commandaction="Clear Modules"
moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
fn_firstcommand_set

Expand Down
2 changes: 1 addition & 1 deletion lgsm/modules/command_dev_debug.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# Description: Dev only: Enables debugging log to be saved to dev-debug.log.

commandname="DEV-DEBUG"
commandaction="Developer debug"
commandaction="Developer Debug"
moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
fn_firstcommand_reset

Expand Down
8 changes: 3 additions & 5 deletions lgsm/modules/command_dev_detect_deps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,11 @@
# Description: Detects dependencies the server binary requires.

commandname="DEV-DETECT-DEPS"
commandaction="Developer detect deps"
commandaction="Dependency Checker"
moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
fn_firstcommand_set

echo -e ""
echo -e "${bold}Dependencies Checker${default}"
fn_messages_separator
fn_print_header
echo -e "Checking directory: "
echo -e "${serverfiles}"
if [ "$(command -v eu-readelf 2> /dev/null)" ]; then
Expand Down Expand Up @@ -186,7 +184,7 @@ echo -e "${bold}Required Dependencies${default}"
fn_messages_separator
echo -e "${executable}"
echo -e ""
echo -e "CentOS"
echo -e "${bold}CentOS"
fn_messages_separator
cat "${tmpdir}/.depdetect_centos_line"
echo -e ""
Expand Down
Loading

0 comments on commit acf3702

Please sign in to comment.