From 1c3e5048ebb0abf8f2e631d1259e3a1eafbb4feb Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Tue, 21 Dec 2021 22:07:32 +0000 Subject: [PATCH 001/161] feat: give warning if distro is not supported by vendor (#3723) --- lgsm/functions/check_deps.sh | 8 ++++++++ lgsm/functions/info_distro.sh | 17 +++++++++++++++++ 2 files changed, 25 insertions(+) diff --git a/lgsm/functions/check_deps.sh b/lgsm/functions/check_deps.sh index fab923bd7..340a6456b 100755 --- a/lgsm/functions/check_deps.sh +++ b/lgsm/functions/check_deps.sh @@ -316,6 +316,14 @@ if [ "${commandname}" == "INSTALL" ]; then fi fi +# Will warn user if their distro is no longer supported by the vendor. +if [ -n "${distrosupport}" ]; then + if [ "${distrosupport}" == "unsupported" ]; then + fn_print_warning_nl "${distroname} is no longer supported by the vendor. Upgrading is recommended." + fn_script_log_warn "${distroname} is no longer supported by the vendor. Upgrading is recommended." + fi +fi + info_distro.sh if [ ! -f "${tmpdir}/dependency-no-check.tmp" ]&&[ ! -f "${datadir}/${distroid}-${distroversioncsv}.csv" ]; then diff --git a/lgsm/functions/info_distro.sh b/lgsm/functions/info_distro.sh index 3e3051d2d..472c9c5b2 100755 --- a/lgsm/functions/info_distro.sh +++ b/lgsm/functions/info_distro.sh @@ -80,6 +80,23 @@ else distroversioncsv="${distroversion}" fi +# Check if distro supported by distro vendor. +if [ "$(command -v distro-info 2>/dev/null)" ]; then + distrosunsupported="$(distro-info --unsupported)" + distrosunsupported_array=( "${distrosunsupported}" ) + for distrounsupported in "${distrosunsupported_array[@]}"; do + if [ "${distrounsupported}" == "${distrocodename}" ]; then + distrosupport=unsupported + break + else + distrosupport=supported + fi + done +else + distrosupport=unknown +fi + +echo "${distrosupport}" ## Glibc version # e.g: 1.17 glibcversion="$(ldd --version | sed -n '1s/.* //p')" From de6240fd0ceeef73750e03eb331ae6b2181efdde Mon Sep 17 00:00:00 2001 From: UltimateByte Date: Tue, 21 Dec 2021 23:08:07 +0100 Subject: [PATCH 002/161] fix: #1868 mods lowercase conversion (#3717) * Finally fixes #1868 mods lowercase conversion Sample output: Installing DarkRP ================================= creating mod download directory /home/ulti/lgsm/mods/tmp...OK #=#=- # # ################################################################################################################################################################################################################################################ 100.0% -#O=- # # # extracting darkrp-master.zip...OK converting DarkRP files to lowercase...Found 19 uppercase files out of 588, converting...OK building darkrp-files.txt...OK copying DarkRP to /home/ulti/serverfiles/garrysmod/gamemodes...OK tidy up darkrp-files.txt...OK clearing mod download directory /home/ulti/lgsm/mods/tmp...OK DarkRP installed * removed unused variable --- lgsm/functions/mods_core.sh | 44 +++++++++++++++++++++---------------- 1 file changed, 25 insertions(+), 19 deletions(-) diff --git a/lgsm/functions/mods_core.sh b/lgsm/functions/mods_core.sh index 7e46f7977..47ac70cb2 100755 --- a/lgsm/functions/mods_core.sh +++ b/lgsm/functions/mods_core.sh @@ -33,33 +33,39 @@ fn_mod_install_files(){ # Convert mod files to lowercase if needed. fn_mod_lowercase(){ + # Checking lowercase settings from mods array definition if [ "${modlowercase}" == "LowercaseOn" ]; then - echo -en "converting ${modprettyname} files to lowercase..." fn_sleep_time fn_script_log_info "Converting ${modprettyname} files to lowercase" - fileswc=$(find "${extractdir}" -depth | wc -l) - echo -en "\r" + # Total files and directories for the mod, to output to the user + fileswc=$(find "${extractdir}" | wc -l) + # Total uppercase files and directories for the mod, to output to the user + filesupperwc=$(find "${extractdir}" -name '*[[:upper:]]*' | wc -l) + fn_script_log_info "Found ${filesupperwc} uppercase files out of ${fileswc}, converting" + echo -en "Found ${filesupperwc} uppercase files out of ${fileswc}, converting..." + # Convert files and directories starting from the deepest to prevent issues (-depth argument) while read -r src; do - dst=$(dirname "${src}$(/)basename" "${src}" | tr '[:upper:]' '[:lower:]') - if [ "${src}" != "${dst}" ] - then - [ ! -e "${dst}" ] && mv -T "${src}" "${dst}" || echo -e "${src} was not renamed" + # We have to convert only the last file from the path, otherwise we will fail to convert anything if a parent dir has any uppercase + # therefore, we have to separate the end of the filename to only lowercase it rather than the whole line + # Gather parent dir, filename lowercase filename, and set lowercase destination name + latestparentdir=$(dirname "${src}") + latestfilelc=$(basename "${src}" | tr '[:upper:]' '[:lower:]') + dst="${latestparentdir}/${latestfilelc}" + # Only convert if destination does not already exist for some reason + if [ ! -e "${dst}" ]; then + # Finally we can rename the file + mv "${src}" "${dst}" + # Exit if it fails for any reason local exitcode=$? - ((renamedwc++)) + if [ "${exitcode}" != 0 ]; then + fn_print_fail_eol_nl + core_exit.sh + fi fi - echo -en "${renamedwc} / ${totalfileswc} / ${fileswc} converting ${modprettyname} files to lowercase..." $'\r' - ((totalfileswc++)) - done < <(find "${extractdir}" -depth) - echo -en "${renamedwc} / ${totalfileswc} / ${fileswc} converting ${modprettyname} files to lowercase..." - - if [ "${exitcode}" != 0 ]; then - fn_print_fail_eol_nl - core_exit.sh - else + done < <(find "${extractdir}" -depth -name '*[[:upper:]]*') fn_print_ok_eol_nl - fi - fi + fi } # Create ${modcommand}-files.txt containing the full extracted file/directory list. From 1c603b7449383a937cb3c3cee89604caac9eac70 Mon Sep 17 00:00:00 2001 From: Viktor Vilhelm Sonesten Date: Wed, 22 Dec 2021 13:32:14 +0100 Subject: [PATCH 003/161] fix(pzserver): start with --ip instead of -ip (#3724) `-ip` is not parsed correctly by the new build 41 release. See https://github.com/GameServerManagers/LinuxGSM/discussions/3711#discussioncomment-1844368 --- lgsm/config-default/config-lgsm/pzserver/_default.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lgsm/config-default/config-lgsm/pzserver/_default.cfg b/lgsm/config-default/config-lgsm/pzserver/_default.cfg index a9dfb40b2..2d284187f 100644 --- a/lgsm/config-default/config-lgsm/pzserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/pzserver/_default.cfg @@ -13,7 +13,7 @@ ip="0.0.0.0" adminpassword="CHANGE_ME" ## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters -startparameters="-ip ${ip} -adminpassword \"${adminpassword}\" -servername ${selfname}" +startparameters="--ip ${ip} -adminpassword \"${adminpassword}\" -servername ${selfname}" #### LinuxGSM Settings #### From 588453a43ae73f2e0bc2d1628ea8281de15a354e Mon Sep 17 00:00:00 2001 From: Christian Date: Fri, 31 Dec 2021 22:12:30 +0100 Subject: [PATCH 004/161] fix(cd): add config install (#3726) --- lgsm/functions/install_config.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lgsm/functions/install_config.sh b/lgsm/functions/install_config.sh index 7832e9cd2..76de7867f 100755 --- a/lgsm/functions/install_config.sh +++ b/lgsm/functions/install_config.sh @@ -274,6 +274,13 @@ elif [ "${shortname}" == "bmdm" ]; then fn_default_config_remote fn_set_config_vars fn_list_config_locations +elif [ "${shortname}" == "cd" ]; then + gamedirname="CraftingDead" + array_configs+=( properties.json ) + fn_fetch_default_config + fn_default_config_remote + fn_set_config_vars + fn_list_config_locations elif [ "${shortname}" == "cod" ]; then gamedirname="CallOfDuty" array_configs+=( server.cfg ) From 043f9da769b17eab3c763e657d367645a6206333 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Fri, 31 Dec 2021 21:23:00 +0000 Subject: [PATCH 005/161] Release v21.5.0 --- lgsm/functions/core_functions.sh | 2 +- linuxgsm.sh | 2 +- tests/tests_fctrserver.sh | 2 +- tests/tests_jc2server.sh | 2 +- tests/tests_mcserver.sh | 2 +- tests/tests_ts3server.sh | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lgsm/functions/core_functions.sh b/lgsm/functions/core_functions.sh index 725cd297b..4e857553e 100755 --- a/lgsm/functions/core_functions.sh +++ b/lgsm/functions/core_functions.sh @@ -8,7 +8,7 @@ functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" -modulesversion="v21.4.1" +modulesversion="v21.5.0" # Core diff --git a/linuxgsm.sh b/linuxgsm.sh index 1eff0d00f..76edddfa3 100755 --- a/linuxgsm.sh +++ b/linuxgsm.sh @@ -20,7 +20,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="v21.4.1" +version="v21.5.0" shortname="core" gameservername="core" commandname="CORE" diff --git a/tests/tests_fctrserver.sh b/tests/tests_fctrserver.sh index 138864098..8dfad01c6 100644 --- a/tests/tests_fctrserver.sh +++ b/tests/tests_fctrserver.sh @@ -20,7 +20,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="v21.4.1" +version="v21.5.0" shortname="fctr" gameservername="fctrserver" commandname="CORE" diff --git a/tests/tests_jc2server.sh b/tests/tests_jc2server.sh index 86637f5b2..c4b2bba4a 100644 --- a/tests/tests_jc2server.sh +++ b/tests/tests_jc2server.sh @@ -20,7 +20,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="v21.4.1" +version="v21.5.0" shortname="jc2" gameservername="jc2server" commandname="CORE" diff --git a/tests/tests_mcserver.sh b/tests/tests_mcserver.sh index 447b8b9e3..382dd4e12 100644 --- a/tests/tests_mcserver.sh +++ b/tests/tests_mcserver.sh @@ -20,7 +20,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="v21.4.1" +version="v21.5.0" shortname="mc" gameservername="mcserver" commandname="CORE" diff --git a/tests/tests_ts3server.sh b/tests/tests_ts3server.sh index 3c160f009..aec69cdd1 100644 --- a/tests/tests_ts3server.sh +++ b/tests/tests_ts3server.sh @@ -20,7 +20,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="v21.4.1" +version="v21.5.0" shortname="ts3" gameservername="ts3server" commandname="CORE" From dda4af8a0a3e1a63c15fd19010088b6e26904ae3 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Fri, 31 Dec 2021 21:28:24 +0000 Subject: [PATCH 006/161] fix ti message --- lgsm/functions/info_messages.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lgsm/functions/info_messages.sh b/lgsm/functions/info_messages.sh index 13e6987c1..a5ad5852e 100755 --- a/lgsm/functions/info_messages.sh +++ b/lgsm/functions/info_messages.sh @@ -1434,9 +1434,11 @@ fn_info_message_st(){ } fn_info_message_ti(){ - fn_port "header" - fn_port "Game" port udp - fn_port "Query" queryport udp + { + fn_port "header" + fn_port "Game" port udp + fn_port "Query" queryport udp + } | column -s $'\t' -t } fn_info_message_ts3(){ From ad8fc3ac8a79ad9c15fe4d032c3d16636b9cf5e3 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Mon, 3 Jan 2022 19:05:16 +0000 Subject: [PATCH 007/161] fix: remove unneeded echo --- lgsm/functions/info_distro.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/lgsm/functions/info_distro.sh b/lgsm/functions/info_distro.sh index 472c9c5b2..148e2df48 100755 --- a/lgsm/functions/info_distro.sh +++ b/lgsm/functions/info_distro.sh @@ -96,7 +96,6 @@ else distrosupport=unknown fi -echo "${distrosupport}" ## Glibc version # e.g: 1.17 glibcversion="$(ldd --version | sed -n '1s/.* //p')" From 643a6fed2628d4488ac7fe5884b28a97d9eb7071 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sat, 8 Jan 2022 18:01:22 +0000 Subject: [PATCH 008/161] feat(ark): increase glibc requirement to 2.17 --- lgsm/config-default/config-lgsm/arkserver/_default.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lgsm/config-default/config-lgsm/arkserver/_default.cfg b/lgsm/config-default/config-lgsm/arkserver/_default.cfg index eb3ac908b..8e24debfc 100644 --- a/lgsm/config-default/config-lgsm/arkserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/arkserver/_default.cfg @@ -158,7 +158,7 @@ consoleinteract="no" # Do not edit gamename="ARK: Survival Evolved" engine="unreal4" -glibc="2.15" +glibc="2.17" #### Directories #### # Edit with care From 0465e0970bb1e9909269c7aba186d91e4d78a0db Mon Sep 17 00:00:00 2001 From: Christian Date: Sun, 9 Jan 2022 22:41:31 +0100 Subject: [PATCH 009/161] fix(deps): add missing dep for distro-info (#3732) --- lgsm/data/debian-10.csv | 2 +- lgsm/data/debian-11.csv | 2 +- lgsm/data/debian-9.csv | 2 +- lgsm/data/ubuntu-18.04.csv | 2 +- lgsm/data/ubuntu-20.04.csv | 2 +- lgsm/data/ubuntu-21.04.csv | 2 +- lgsm/data/ubuntu-21.10.csv | 2 +- lgsm/data/ubuntu-22.04.csv | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/lgsm/data/debian-10.csv b/lgsm/data/debian-10.csv index 5f066b1ee..94f356412 100644 --- a/lgsm/data/debian-10.csv +++ b/lgsm/data/debian-10.csv @@ -1,4 +1,4 @@ -all,bc,binutils,bsdmainutils,bzip2,ca-certificates,cpio,curl,file,gzip,hostname,jq,lib32gcc1,lib32stdc++6,netcat,python3,tar,tmux,unzip,util-linux,wget,xz-utils +all,bc,binutils,bsdmainutils,bzip2,ca-certificates,cpio,curl,distro-info,file,gzip,hostname,jq,lib32gcc1,lib32stdc++6,netcat,python3,tar,tmux,unzip,util-linux,wget,xz-utils steamcmd,lib32gcc1,lib32stdc++6,libsdl2-2.0-0:i386,steamcmd ac ahl diff --git a/lgsm/data/debian-11.csv b/lgsm/data/debian-11.csv index ca7b2a208..6e2b3e99f 100644 --- a/lgsm/data/debian-11.csv +++ b/lgsm/data/debian-11.csv @@ -1,4 +1,4 @@ -all,bc,binutils,bsdmainutils,bzip2,ca-certificates,cpio,curl,file,gzip,hostname,jq,lib32gcc-s1,lib32stdc++6,netcat,python3,tar,tmux,unzip,util-linux,wget,xz-utils +all,bc,binutils,bsdmainutils,bzip2,ca-certificates,cpio,curl,distro-info,file,gzip,hostname,jq,lib32gcc-s1,lib32stdc++6,netcat,python3,tar,tmux,unzip,util-linux,wget,xz-utils steamcmd,lib32gcc-s1,lib32stdc++6,libsdl2-2.0-0:i386,steamcmd ac ahl diff --git a/lgsm/data/debian-9.csv b/lgsm/data/debian-9.csv index 36f752356..9cb339c8e 100644 --- a/lgsm/data/debian-9.csv +++ b/lgsm/data/debian-9.csv @@ -1,4 +1,4 @@ -all,bc,binutils,bsdmainutils,bzip2,ca-certificates,cpio,curl,file,gzip,hostname,jq,lib32gcc1,lib32stdc++6,netcat,python3,tar,tmux,unzip,util-linux,wget,xz-utils +all,bc,binutils,bsdmainutils,bzip2,ca-certificates,cpio,curl,distro-info,file,gzip,hostname,jq,lib32gcc1,lib32stdc++6,netcat,python3,tar,tmux,unzip,util-linux,wget,xz-utils steamcmd,lib32gcc1,lib32stdc++6,libsdl2-2.0-0:i386,steamcmd ac ahl diff --git a/lgsm/data/ubuntu-18.04.csv b/lgsm/data/ubuntu-18.04.csv index 5f066b1ee..94f356412 100644 --- a/lgsm/data/ubuntu-18.04.csv +++ b/lgsm/data/ubuntu-18.04.csv @@ -1,4 +1,4 @@ -all,bc,binutils,bsdmainutils,bzip2,ca-certificates,cpio,curl,file,gzip,hostname,jq,lib32gcc1,lib32stdc++6,netcat,python3,tar,tmux,unzip,util-linux,wget,xz-utils +all,bc,binutils,bsdmainutils,bzip2,ca-certificates,cpio,curl,distro-info,file,gzip,hostname,jq,lib32gcc1,lib32stdc++6,netcat,python3,tar,tmux,unzip,util-linux,wget,xz-utils steamcmd,lib32gcc1,lib32stdc++6,libsdl2-2.0-0:i386,steamcmd ac ahl diff --git a/lgsm/data/ubuntu-20.04.csv b/lgsm/data/ubuntu-20.04.csv index 4809d4b97..bf5a9601c 100644 --- a/lgsm/data/ubuntu-20.04.csv +++ b/lgsm/data/ubuntu-20.04.csv @@ -1,4 +1,4 @@ -all,bc,binutils,bsdmainutils,bzip2,ca-certificates,cpio,curl,file,gzip,hostname,jq,lib32gcc1,lib32stdc++6,netcat,python3,tar,tmux,unzip,util-linux,wget,xz-utils +all,bc,binutils,bsdmainutils,bzip2,ca-certificates,cpio,curl,distro-info,file,gzip,hostname,jq,lib32gcc1,lib32stdc++6,netcat,python3,tar,tmux,unzip,util-linux,wget,xz-utils steamcmd,lib32gcc1,lib32stdc++6,libsdl2-2.0-0:i386,steamcmd ac ahl diff --git a/lgsm/data/ubuntu-21.04.csv b/lgsm/data/ubuntu-21.04.csv index 18918e443..c2a4b959d 100644 --- a/lgsm/data/ubuntu-21.04.csv +++ b/lgsm/data/ubuntu-21.04.csv @@ -1,4 +1,4 @@ -all,bc,binutils,bsdmainutils,bzip2,ca-certificates,cpio,curl,file,gzip,hostname,jq,lib32gcc-s1,lib32stdc++6,netcat,python3,tar,tmux,unzip,util-linux,wget,xz-utils +all,bc,binutils,bsdmainutils,bzip2,ca-certificates,cpio,curl,distro-info,file,gzip,hostname,jq,lib32gcc-s1,lib32stdc++6,netcat,python3,tar,tmux,unzip,util-linux,wget,xz-utils steamcmd,lib32gcc-s1,lib32stdc++6,libsdl2-2.0-0:i386,steamcmd ac ahl diff --git a/lgsm/data/ubuntu-21.10.csv b/lgsm/data/ubuntu-21.10.csv index d12f19447..8c66e2e26 100644 --- a/lgsm/data/ubuntu-21.10.csv +++ b/lgsm/data/ubuntu-21.10.csv @@ -1,4 +1,4 @@ -all,bc,binutils,bsdmainutils,bzip2,ca-certificates,cpio,curl,file,gzip,hostname,jq,lib32gcc-s1,lib32stdc++6,netcat,python3,tar,tmux,unzip,util-linux,wget,xz-utils +all,bc,binutils,bsdmainutils,bzip2,ca-certificates,cpio,curl,distro-info,file,gzip,hostname,jq,lib32gcc-s1,lib32stdc++6,netcat,python3,tar,tmux,unzip,util-linux,wget,xz-utils steamcmd,lib32gcc-s1,lib32stdc++6,libsdl2-2.0-0:i386,steamcmd ac ahl diff --git a/lgsm/data/ubuntu-22.04.csv b/lgsm/data/ubuntu-22.04.csv index d12f19447..8c66e2e26 100644 --- a/lgsm/data/ubuntu-22.04.csv +++ b/lgsm/data/ubuntu-22.04.csv @@ -1,4 +1,4 @@ -all,bc,binutils,bsdmainutils,bzip2,ca-certificates,cpio,curl,file,gzip,hostname,jq,lib32gcc-s1,lib32stdc++6,netcat,python3,tar,tmux,unzip,util-linux,wget,xz-utils +all,bc,binutils,bsdmainutils,bzip2,ca-certificates,cpio,curl,distro-info,file,gzip,hostname,jq,lib32gcc-s1,lib32stdc++6,netcat,python3,tar,tmux,unzip,util-linux,wget,xz-utils steamcmd,lib32gcc-s1,lib32stdc++6,libsdl2-2.0-0:i386,steamcmd ac ahl From 079fe0766e98bc0a1a191ecb7e576a05d25bc273 Mon Sep 17 00:00:00 2001 From: Christian Date: Sun, 9 Jan 2022 22:42:07 +0100 Subject: [PATCH 010/161] fix(vh): log a message when the password is not set or to short (#3738) --- lgsm/functions/check_config.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lgsm/functions/check_config.sh b/lgsm/functions/check_config.sh index 5b8d51691..0a6313151 100755 --- a/lgsm/functions/check_config.sh +++ b/lgsm/functions/check_config.sh @@ -25,3 +25,11 @@ elif [ -v rconpassword ]&&[ "${rconpassword}" == "CHANGE_ME" ]; then fn_print_warn_nl "Default RCON Password detected" fn_script_log_warn "Default RCON Password detected" fi + +if [ "${shortname}" == "vh" ]&&[ -z "${serverpassword}" ]; then + fn_print_fail_nl "serverpassword is not set" + fn_script_log_fatal "serverpassword is not set" +elif [ "${shortname}" == "vh" ]&&[ "${#serverpassword}" -le "4" ]; then + fn_print_fail_nl "serverpassword is to short (min 5 chars)" + fn_script_log_fatal "serverpassword is to short (min 5 chars)" +fi From 1a022caf21b9f4c7716b5e3d542c78d8f4d3f675 Mon Sep 17 00:00:00 2001 From: sharaga44 <97103998+sharaga44@users.noreply.github.com> Date: Mon, 10 Jan 2022 00:42:36 +0300 Subject: [PATCH 011/161] fix(unt): resolve start parameter issues #2681 (#3733) * Update linuxgsm.sh * Update _default.cfg * Update install_config.sh * Update _default.cfg * Revert "Update linuxgsm.sh" This reverts commit 12639d26d1935f09c0ebd4de79d70dd9ce75d4b8. * Revert "Update install_config.sh" This reverts commit 2de6088edddc1fc7e0d934439395bd6d57dfa441. --- lgsm/config-default/config-lgsm/untserver/_default.cfg | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lgsm/config-default/config-lgsm/untserver/_default.cfg b/lgsm/config-default/config-lgsm/untserver/_default.cfg index e57f08f57..41d1981e7 100644 --- a/lgsm/config-default/config-lgsm/untserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/untserver/_default.cfg @@ -12,10 +12,15 @@ ip="0.0.0.0" port="27015" maxplayers="20" -defaultmap="pei" +defaultmap="PEI" + +## 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="-port:${port} -players:${maxplayers} --nographics -${defaultmap} -batchmode +secureserver/${selfname}" +startparameters="-nographics -batchmode -bind ${ip} -port ${port} -maxplayers ${maxplayers} -map ${defaultmap} -gslt ${gslt} +InternetServer/${selfname}" #### LinuxGSM Settings #### From f60c65a744fe82410f947e85b5d8ae93387d9406 Mon Sep 17 00:00:00 2001 From: Christian Date: Sat, 15 Jan 2022 14:30:48 +0100 Subject: [PATCH 012/161] refactor(core): move curl check to main file (#3740) --- lgsm/functions/core_dl.sh | 6 ------ linuxgsm.sh | 6 ++++++ 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lgsm/functions/core_dl.sh b/lgsm/functions/core_dl.sh index 5abfdfbb3..297f4101f 100755 --- a/lgsm/functions/core_dl.sh +++ b/lgsm/functions/core_dl.sh @@ -597,9 +597,3 @@ fn_dl_latest_release_github(){ fi fi } - -# Check that curl is installed -if [ ! "$(command -v curl 2>/dev/null)" ]; then - echo -e "[ FAIL ] Curl is not installed" - exit 1 -fi diff --git a/linuxgsm.sh b/linuxgsm.sh index 76edddfa3..6eb3f0beb 100755 --- a/linuxgsm.sh +++ b/linuxgsm.sh @@ -51,6 +51,12 @@ githubuser="GameServerManagers" githubrepo="LinuxGSM" githubbranch="master" +# Check that curl is installed before doing anything +if [ ! "$(command -v curl 2>/dev/null)" ]; then + echo -e "[ FAIL ] Curl is not installed" + exit 1 +fi + # Core function that is required first. core_functions.sh(){ functionfile="${FUNCNAME[0]}" From fc97f5b696e100f81ef9332193be4e5e5ff445a6 Mon Sep 17 00:00:00 2001 From: StudioEtrange Date: Mon, 17 Jan 2022 23:38:25 +0100 Subject: [PATCH 013/161] feat(core): allow to set github details at runtime with env vars (#3708) --- linuxgsm.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/linuxgsm.sh b/linuxgsm.sh index 76edddfa3..5e5565f3e 100755 --- a/linuxgsm.sh +++ b/linuxgsm.sh @@ -47,9 +47,9 @@ userinput2="${2}" ## GitHub Branch Select # Allows for the use of different function files # from a different repo and/or branch. -githubuser="GameServerManagers" -githubrepo="LinuxGSM" -githubbranch="master" +[ -n "${LGSM_GITHUBUSER}" ] && githubuser="${LGSM_GITHUBUSER}" || githubuser="GameServerManagers" +[ -n "${LGSM_GITHUBREPO}" ] && githubrepo="${LGSM_GITHUBREPO}" || githubrepo="LinuxGSM" +[ -n "${LGSM_GITHUBBRANCH}" ] && githubbranch="${LGSM_GITHUBBRANCH}" || githubbranch="master" # Core function that is required first. core_functions.sh(){ From 437ebfaed727d7a9244dca4e5a14f7f545c0e8c8 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Mon, 17 Jan 2022 22:44:07 +0000 Subject: [PATCH 014/161] Release v21.5.1 --- lgsm/functions/core_functions.sh | 2 +- linuxgsm.sh | 2 +- tests/tests_fctrserver.sh | 2 +- tests/tests_jc2server.sh | 2 +- tests/tests_mcserver.sh | 2 +- tests/tests_ts3server.sh | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lgsm/functions/core_functions.sh b/lgsm/functions/core_functions.sh index 4e857553e..4a72bf7d0 100755 --- a/lgsm/functions/core_functions.sh +++ b/lgsm/functions/core_functions.sh @@ -8,7 +8,7 @@ functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" -modulesversion="v21.5.0" +modulesversion="v21.5.1" # Core diff --git a/linuxgsm.sh b/linuxgsm.sh index 5e5565f3e..99cf85902 100755 --- a/linuxgsm.sh +++ b/linuxgsm.sh @@ -20,7 +20,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="v21.5.0" +version="v21.5.1" shortname="core" gameservername="core" commandname="CORE" diff --git a/tests/tests_fctrserver.sh b/tests/tests_fctrserver.sh index 8dfad01c6..c5c80590c 100644 --- a/tests/tests_fctrserver.sh +++ b/tests/tests_fctrserver.sh @@ -20,7 +20,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="v21.5.0" +version="v21.5.1" shortname="fctr" gameservername="fctrserver" commandname="CORE" diff --git a/tests/tests_jc2server.sh b/tests/tests_jc2server.sh index c4b2bba4a..89867b5fa 100644 --- a/tests/tests_jc2server.sh +++ b/tests/tests_jc2server.sh @@ -20,7 +20,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="v21.5.0" +version="v21.5.1" shortname="jc2" gameservername="jc2server" commandname="CORE" diff --git a/tests/tests_mcserver.sh b/tests/tests_mcserver.sh index 382dd4e12..347646789 100644 --- a/tests/tests_mcserver.sh +++ b/tests/tests_mcserver.sh @@ -20,7 +20,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="v21.5.0" +version="v21.5.1" shortname="mc" gameservername="mcserver" commandname="CORE" diff --git a/tests/tests_ts3server.sh b/tests/tests_ts3server.sh index aec69cdd1..01a705086 100644 --- a/tests/tests_ts3server.sh +++ b/tests/tests_ts3server.sh @@ -20,7 +20,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="v21.5.0" +version="v21.5.1" shortname="ts3" gameservername="ts3server" commandname="CORE" From a52d3d4638bb5fba28815f89ce24c604d345b7b8 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Wed, 9 Feb 2022 23:39:46 +0000 Subject: [PATCH 015/161] Create dependabot.yml --- .github/dependabot.yml | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 .github/dependabot.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 000000000..c39f10ad4 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,9 @@ +# Set update schedule for GitHub Actions +version: 2 +updates: + + - package-ecosystem: "github-actions" + directory: "/" + schedule: + # Check for updates to GitHub Actions every weekday + interval: "daily" From ff7a9e788f0005ce012b24438a0762698a80bed0 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 9 Feb 2022 23:41:31 +0000 Subject: [PATCH 016/161] build(deps): bump release-drafter/release-drafter from 5.15.0 to 5.18.1 (#3783) * Create dependabot.yml * build(deps): bump release-drafter/release-drafter from 5.15.0 to 5.18.1 Bumps [release-drafter/release-drafter](https://github.com/release-drafter/release-drafter) from 5.15.0 to 5.18.1. - [Release notes](https://github.com/release-drafter/release-drafter/releases) - [Commits](https://github.com/release-drafter/release-drafter/compare/v5.15.0...v5.18.1) --- updated-dependencies: - dependency-name: release-drafter/release-drafter dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: Daniel Gibbs Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/dependabot.yml | 9 +++++++++ .github/workflows/create-release.yml | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 .github/dependabot.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 000000000..c39f10ad4 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,9 @@ +# Set update schedule for GitHub Actions +version: 2 +updates: + + - package-ecosystem: "github-actions" + directory: "/" + schedule: + # Check for updates to GitHub Actions every weekday + interval: "daily" diff --git a/.github/workflows/create-release.yml b/.github/workflows/create-release.yml index 04b6adb87..7b71953f0 100644 --- a/.github/workflows/create-release.yml +++ b/.github/workflows/create-release.yml @@ -10,7 +10,7 @@ jobs: runs-on: ubuntu-latest steps: # Drafts your next Release notes as Pull Requests are merged into "master" - - uses: release-drafter/release-drafter@v5.15.0 + - uses: release-drafter/release-drafter@v5.18.1 with: config-name: release-drafter.yml env: From ef583bdf33a3e612d5b095e80fd65945046d0561 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 9 Feb 2022 23:42:00 +0000 Subject: [PATCH 017/161] build(deps): bump dessant/lock-threads from 2.1.2 to 3 (#3782) * Create dependabot.yml * build(deps): bump dessant/lock-threads from 2.1.2 to 3 Bumps [dessant/lock-threads](https://github.com/dessant/lock-threads) from 2.1.2 to 3. - [Release notes](https://github.com/dessant/lock-threads/releases) - [Changelog](https://github.com/dessant/lock-threads/blob/master/CHANGELOG.md) - [Commits](https://github.com/dessant/lock-threads/compare/v2.1.2...v3) --- updated-dependencies: - dependency-name: dessant/lock-threads dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: Daniel Gibbs Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/lock.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/lock.yml b/.github/workflows/lock.yml index 733fe595d..668b8a581 100644 --- a/.github/workflows/lock.yml +++ b/.github/workflows/lock.yml @@ -8,7 +8,7 @@ jobs: lock: runs-on: ubuntu-latest steps: - - uses: dessant/lock-threads@v2.1.2 + - uses: dessant/lock-threads@v3 with: github-token: ${{ secrets.GITHUB_TOKEN }} issue-lock-comment: > From be04256904c6b78eece7b72987520e36b3ecab26 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 9 Feb 2022 23:42:50 +0000 Subject: [PATCH 018/161] build(deps): bump webfactory/ssh-agent from 0.5.3 to 0.5.4 (#3781) Bumps [webfactory/ssh-agent](https://github.com/webfactory/ssh-agent) from 0.5.3 to 0.5.4. - [Release notes](https://github.com/webfactory/ssh-agent/releases) - [Changelog](https://github.com/webfactory/ssh-agent/blob/master/CHANGELOG.md) - [Commits](https://github.com/webfactory/ssh-agent/compare/v0.5.3...v0.5.4) --- updated-dependencies: - dependency-name: webfactory/ssh-agent dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/git-sync.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/git-sync.yml b/.github/workflows/git-sync.yml index d666af6db..fb0b3c477 100644 --- a/.github/workflows/git-sync.yml +++ b/.github/workflows/git-sync.yml @@ -10,8 +10,8 @@ jobs: GitHub-to-Bitbucket: runs-on: ubuntu-latest steps: - - name: webfactory/ssh-agent@v0.5.3 - uses: webfactory/ssh-agent@v0.5.3 + - name: webfactory/ssh-agent@v0.5.4 + uses: webfactory/ssh-agent@v0.5.4 with: ssh-private-key: ${{ secrets.BITBUCKET_SECRET }} From eaa2ee9d2c263c65ee6b1c51e31ce9a90c2fc4a9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 31 Mar 2022 21:21:58 +0100 Subject: [PATCH 019/161] build(deps): bump dessant/lock-threads from 2.1.2 to 3 (#3785) Bumps [dessant/lock-threads](https://github.com/dessant/lock-threads) from 2.1.2 to 3. - [Release notes](https://github.com/dessant/lock-threads/releases) - [Changelog](https://github.com/dessant/lock-threads/blob/master/CHANGELOG.md) - [Commits](https://github.com/dessant/lock-threads/compare/v2.1.2...v3) --- updated-dependencies: - dependency-name: dessant/lock-threads dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/lock.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/lock.yml b/.github/workflows/lock.yml index 733fe595d..668b8a581 100644 --- a/.github/workflows/lock.yml +++ b/.github/workflows/lock.yml @@ -8,7 +8,7 @@ jobs: lock: runs-on: ubuntu-latest steps: - - uses: dessant/lock-threads@v2.1.2 + - uses: dessant/lock-threads@v3 with: github-token: ${{ secrets.GITHUB_TOKEN }} issue-lock-comment: > From e9fe47395f56b0416e09dac104fb2a8f8a6dd2d8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 31 Mar 2022 21:22:10 +0100 Subject: [PATCH 020/161] build(deps): bump release-drafter/release-drafter from 5.15.0 to 5.19.0 (#3810) Bumps [release-drafter/release-drafter](https://github.com/release-drafter/release-drafter) from 5.15.0 to 5.19.0. - [Release notes](https://github.com/release-drafter/release-drafter/releases) - [Commits](https://github.com/release-drafter/release-drafter/compare/v5.15.0...v5.19.0) --- updated-dependencies: - dependency-name: release-drafter/release-drafter dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/create-release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/create-release.yml b/.github/workflows/create-release.yml index 04b6adb87..c53f39d3d 100644 --- a/.github/workflows/create-release.yml +++ b/.github/workflows/create-release.yml @@ -10,7 +10,7 @@ jobs: runs-on: ubuntu-latest steps: # Drafts your next Release notes as Pull Requests are merged into "master" - - uses: release-drafter/release-drafter@v5.15.0 + - uses: release-drafter/release-drafter@v5.19.0 with: config-name: release-drafter.yml env: From a8061d7bf03860f224031c0cb187f556226013a3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 31 Mar 2022 21:22:33 +0100 Subject: [PATCH 021/161] build(deps): bump actions/checkout from 2 to 3 (#3803) Bumps [actions/checkout](https://github.com/actions/checkout) from 2 to 3. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/v2...v3) --- updated-dependencies: - dependency-name: actions/checkout dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/version-check.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/version-check.yml b/.github/workflows/version-check.yml index 903a79268..2bf80f491 100644 --- a/.github/workflows/version-check.yml +++ b/.github/workflows/version-check.yml @@ -16,7 +16,7 @@ jobs: # Steps represent a sequence of tasks that will be executed as part of the job steps: # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 # Runs a single command using the runners shell - name: compare versions From 8253bdf4768e4996ca8db1111c2f7e7f6c986b12 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Thu, 31 Mar 2022 21:29:23 +0100 Subject: [PATCH 022/161] Update config for lock v3 --- .github/workflows/lock.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/lock.yml b/.github/workflows/lock.yml index 668b8a581..0ec82b1f6 100644 --- a/.github/workflows/lock.yml +++ b/.github/workflows/lock.yml @@ -11,11 +11,11 @@ jobs: - uses: dessant/lock-threads@v3 with: github-token: ${{ secrets.GITHUB_TOKEN }} - issue-lock-comment: > + issue-comment: > This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. - pr-lock-comment: > + pr-comment: > This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. From 522bb2d3c3bab786bee3e52a14c30df423ead471 Mon Sep 17 00:00:00 2001 From: Christian Date: Mon, 4 Apr 2022 21:56:06 +0200 Subject: [PATCH 023/161] fix(av): fix port for config info (#3826) --- lgsm/functions/info_game.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lgsm/functions/info_game.sh b/lgsm/functions/info_game.sh index 754f6183d..8c1652023 100644 --- a/lgsm/functions/info_game.sh +++ b/lgsm/functions/info_game.sh @@ -125,7 +125,7 @@ fn_info_game_av() { maxplayers=${maxplayers:-"NOT SET"} servername=${servername:-"NOT SET"} serverpassword=${serverpassword:-"NOT SET"} - port=${zero} + port=${port:-"0"} queryport=${queryport:-"0"} steamqueryport=${steamqueryport:-"0"} steammasterport=${steammasterport:-"0"} From 50d485ff0542e0bff75c34b70409cb1fa8a4b792 Mon Sep 17 00:00:00 2001 From: Christian Date: Mon, 4 Apr 2022 21:56:25 +0200 Subject: [PATCH 024/161] fix(squad): fix variable for queryport (#3824) --- lgsm/functions/info_game.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lgsm/functions/info_game.sh b/lgsm/functions/info_game.sh index 8c1652023..bb750559f 100644 --- a/lgsm/functions/info_game.sh +++ b/lgsm/functions/info_game.sh @@ -1742,7 +1742,7 @@ fn_info_game_squad(){ # Parameters port=${port:-"0"} - queryport=${port:-"0"} + queryport=${queryport:-"0"} } fn_info_game_st(){ From 95e9498330bc2f75d421545630f41671529b65b9 Mon Sep 17 00:00:00 2001 From: Christian Date: Mon, 4 Apr 2022 21:59:01 +0200 Subject: [PATCH 025/161] fix(deps): change openjdk to version 17 for debian 11 (#3825) --- lgsm/data/debian-11.csv | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lgsm/data/debian-11.csv b/lgsm/data/debian-11.csv index 6e2b3e99f..e0021c345 100644 --- a/lgsm/data/debian-11.csv +++ b/lgsm/data/debian-11.csv @@ -78,7 +78,7 @@ pmc,openjdk-17-jre pstbs,libgconf-2-4 pvkii pvr,libc++1 -pz,openjdk-16-jre,rng-tools +pz,openjdk-17-jre,rng-tools q2 q3 ql @@ -87,7 +87,7 @@ ricochet ro rtcw rust,lib32z1 -rw,openjdk-16-jre +rw,openjdk-17-jre samp sb sbots From 3fb3ccc8243e66ffbd343396a37d1c860396cd25 Mon Sep 17 00:00:00 2001 From: Christian Date: Mon, 4 Apr 2022 21:59:15 +0200 Subject: [PATCH 026/161] fix(ns2): remove login (#3759) --- lgsm/config-default/config-lgsm/ns2server/_default.cfg | 4 ---- 1 file changed, 4 deletions(-) diff --git a/lgsm/config-default/config-lgsm/ns2server/_default.cfg b/lgsm/config-default/config-lgsm/ns2server/_default.cfg index 2d7a64cbe..e071f539e 100644 --- a/lgsm/config-default/config-lgsm/ns2server/_default.cfg +++ b/lgsm/config-default/config-lgsm/ns2server/_default.cfg @@ -8,10 +8,6 @@ #### Game Server Settings #### -## SteamCMD Login | https://docs.linuxgsm.com/steamcmd#steamcmd-login -steamuser="username" -steampass='password' - ## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters ip="0.0.0.0" port="27015" From 00cdee22decc42bb9bcc4fabdd761904a8012931 Mon Sep 17 00:00:00 2001 From: Jay Oster Date: Mon, 4 Apr 2022 12:59:55 -0700 Subject: [PATCH 027/161] fix(sdtdserver): monitor command fails (#3764) * Fix monitor command for SDTD - Closes #3619 - Related to #3701 * Fix semantic pull request --- lgsm/config-default/config-lgsm/sdtdserver/_default.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lgsm/config-default/config-lgsm/sdtdserver/_default.cfg b/lgsm/config-default/config-lgsm/sdtdserver/_default.cfg index bd922057b..090309696 100644 --- a/lgsm/config-default/config-lgsm/sdtdserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/sdtdserver/_default.cfg @@ -140,7 +140,7 @@ stopmode="8" # 3: gamedig # 4: gsquery # 5: tcp -querymode="2" +querymode="5" querytype="protocol-valve" ## Console type From 4844b695dce5a23ab4f8de287b838f8a2acfadc8 Mon Sep 17 00:00:00 2001 From: Christian Date: Mon, 4 Apr 2022 22:00:16 +0200 Subject: [PATCH 028/161] fix(ns2): change mods commandline (#3760) --- lgsm/config-default/config-lgsm/ns2server/_default.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lgsm/config-default/config-lgsm/ns2server/_default.cfg b/lgsm/config-default/config-lgsm/ns2server/_default.cfg index e071f539e..83dfd991b 100644 --- a/lgsm/config-default/config-lgsm/ns2server/_default.cfg +++ b/lgsm/config-default/config-lgsm/ns2server/_default.cfg @@ -24,7 +24,7 @@ serverpassword="" # -password \"${serverpassword}\" ## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters -startparameters="-name \"${servername}\" -port ${port} -webadmin -webdomain ${ip} -webuser ${webadminuser} -webpassword \"${webadminpass}\" -webport ${webadminport} -map ${defaultmap} -limit ${maxplayers} -config_path \"${servercfgdir}\" -logdir \"${gamelogdir}\" -modstorage \"${modstoragedir}\" -mods \"${mods}\"" +startparameters="-name \"${servername}\" -port ${port} -webadmin -webdomain ${ip} -webuser ${webadminuser} -webpassword \"${webadminpass}\" -webport ${webadminport} -map ${defaultmap} -limit ${maxplayers} -config_path \"${servercfgdir}\" -logdir \"${gamelogdir}\" -modstorage \"${modstoragedir}\" -mods2 \"${mods}\"" #### LinuxGSM Settings #### From 1d6d94d7a3a8fcbe2d346e4f9d1d91738f64b59c Mon Sep 17 00:00:00 2001 From: Jens Date: Mon, 11 Apr 2022 00:36:07 +0200 Subject: [PATCH 029/161] feat(mods): csgo mods - scraping latest versions for GOKZ and MovementAPI (#3841) --- lgsm/functions/mods_list.sh | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/lgsm/functions/mods_list.sh b/lgsm/functions/mods_list.sh index 7afeffcfb..ed9be2121 100755 --- a/lgsm/functions/mods_list.sh +++ b/lgsm/functions/mods_list.sh @@ -82,6 +82,13 @@ csgopracticelatestlink=$(echo -e "${csgopracticelatest}" | jq -r '.browser_downl csgopuglatest=$(curl --connect-timeout 10 -sL https://api.github.com/repos/splewis/csgo-pug-setup/releases/latest | jq '.assets[]') csgopuglatestfile=$(echo -e "${csgopuglatest}" | jq -r '.name') csgopuglatestlink=$(echo -e "${csgopuglatest}" | jq -r '.browser_download_url') +gokzlatestversion=$(curl --connect-timeout 10 -s https://api.github.com/repos/KZGlobalTeam/gokz/releases/latest | grep "tag_name" | cut -d : -f 2,3 | sed -E 's/.*"([^"]+)".*/\1/') +gokzlatestfile="GOKZ-v${gokzlatestversion}.zip" +gokzlatestlink="https://github.com/KZGlobalTeam/gokz/releases/download/${gokzlatestversion}/${gokzlatestfile}" +movementapilatestversion=$(curl --connect-timeout 10 -s https://api.github.com/repos/danzayau/MovementAPI/releases/latest | grep "tag_name" | cut -d : -f 2,3 | sed -E 's/.*"([^"]+)".*/\1/') +movementapilatestfile="MovementAPI-v${movementapilatestversion}.zip" +movementapilatestlink="https://github.com/danzayau/MovementAPI/releases/download/${movementapilatestversion}/${movementapilatestfile}" + # Oxide oxiderustlatestlink=$(curl --connect-timeout 10 -sL https://api.github.com/repos/OxideMod/Oxide.Rust/releases/latest | jq -r '.assets[]|select(.browser_download_url | contains("linux")) | .browser_download_url') oxidehurtworldlatestlink=$(curl --connect-timeout 10 -sL https://api.github.com/repos/OxideMod/Oxide.Hurtworld/releases/latest | jq -r '.assets[].browser_download_url') @@ -140,13 +147,13 @@ mod_info_steamworks=( MOD "steamworks" "SteamWorks" "${steamworksurl}" "${steamw mod_info_stripper=( MOD "stripper" "Stripper Source" "http://www.bailopan.net/stripper/snapshots/1.2/stripper-1.2.2-git129-linux.tar.gz" "stripper-1.2.2-git129-linux.tar.gz" "0" "LowercaseOff" "${systemdir}" "addons/stripper/maps;" "ENGINES" "Counter-Strike: Global Offensive;Counter-Strike: Source;Day of Defeat: Source;Half Life: Deathmatch;Half Life 2: Deathmatch;Insurgency;Left 4 Dead;Left 4 Dead 2;Nuclear Dawn;Team Fortress 2;" "NOTGAMES" "http://www.bailopan.net/stripper/" "Add or remove objects from map (requires MetaMod)") # CS:GO Mods -mod_info_gokz=( MOD "gokz" "GOKZ" "https://bitbucket.org/kztimerglobalteam/gokz/downloads/GOKZ-latest.zip" "gokz-latest.zip" "0" "LowercaseOff" "${systemdir}" "cfg;addons/sourcemod/configs;" "ENGINES" "Counter-Strike: Global Offensive;" "NOTGAMES" "https://bitbucket.org/kztimerglobalteam/gokz/src/master/" "Implements the KZ game mode (requires SourceMod and MetaMod)" ) +mod_info_gokz=( MOD "gokz" "GOKZ" "${gokzlatestlink}" "${gokzlatestfile}" "0" "LowercaseOff" "${systemdir}" "cfg;addons/sourcemod/configs;" "ENGINES" "Counter-Strike: Global Offensive;" "NOTGAMES" "https://github.com/KZGlobalTeam/gokz" "GOKZ ${gokzlatestversion} - Implements the KZ game mode (requires SourceMod and MetaMod)" ) mod_info_ttt=( MOD "ttt" "Trouble in Terrorist Town" "https://csgottt.com/downloads/ttt-latest-dev-${sourcemodversion}.zip" "ttt-latest.zip" "0" "LowercaseOff" "${systemdir}" "cfg;addons/sourcemod/configs;" "ENGINES" "Counter-Strike: Global Offensive;" "NOTGAMES" "https://github.com/Bara/TroubleinTerroristTown" "Implements the TTT game mode (requires SourceMod and MetaMod)" ) mod_info_get5=( MOD "get5" "Get 5" "${get5url}" "${get5latestfile}" "0" "LowercaseOff" "${systemdir}" "cfg;addons/sourcemod/configs;" "ENGINES" "Counter-Strike: Global Offensive;" "NOTGAMES" "https://github.com/splewis/get5" "Plugin for competitive matches/scrims (requires SourceMod and MetaMod)" ) mod_info_prac=( MOD "prac" "csgo practice mode" "${csgopracticelatestlink}" "${csgopracticelatestfile}" "0" "LowercaseOff" "${systemdir}" "cfg;addons/sourcemod/configs;" "ENGINES" "Counter-Strike: Global Offensive;" "NOTGAMES" "https://github.com/splewis/csgo-practice-mode" "Practice Mode is a sourcemod plugin for helping players/teams run practices." ) mod_info_pug=( MOD "pug" "PUG" "${csgopuglatestlink}" "${csgopuglatestfile}" "0" "LowercaseOff" "${systemdir}" "cfg;addons/sourcemod/configs;" "ENGINES" "Counter-Strike: Global Offensive;" "NOTGAMES" "https://github.com/splewis/csgo-pug-setup" "plugin for setting up private pug/10man games" ) mod_info_dhook=( MOD "dhook" "dhook" "https://forums.alliedmods.net/attachment.php?attachmentid=190123&d=1625050030" "dhooks-2.2.0d17.zip" "0" "LowercaseOff" "${systemdir}" "cfg;addons/sourcemod/configs;" "ENGINES" "Counter-Strike: Global Offensive;" "NOTGAMES" "https://forums.alliedmods.net/showpost.php?p=2588686&postcount=589" "DHooks 2.2.0 - Required for GOKZ" ) -mod_info_movement=( MOD "movementapi" "movementapi" "https://github.com/danzayau/MovementAPI/releases/download/2.1.0/MovementAPI-v2.1.0.zip" "MovementAPI-v2.1.0.zip" "0" "LowercaseOff" "${systemdir}" "cfg;addons/sourcemod/configs;" "ENGINES" "Counter-Strike: Global Offensive;" "NOTGAMES" "https://github.com/danzayau/MovementAPI" "Movement API 2.1.0 - Required for GOKZ" ) +mod_info_movement=( MOD "movementapi" "movementapi" "${movementapilatestlink}" "${movementapilatestfile}" "0" "LowercaseOff" "${systemdir}" "cfg;addons/sourcemod/configs;" "ENGINES" "Counter-Strike: Global Offensive;" "NOTGAMES" "https://github.com/danzayau/MovementAPI" "Movement API ${movementapilatestversion} - Required for GOKZ" ) mod_info_cleaner=( MOD "cleaner" "cleaner" "https://github.com/e54385991/console-cleaner/archive/refs/heads/master.zip" "console-cleaner.zip" "0" "LowercaseOff" "${systemdir}" "cfg;addons/sourcemod/configs;" "ENGINES" "Counter-Strike: Global Offensive;" "NOTGAMES" "https://github.com/e54385991/console-cleaner" "Console Cleaner - Optional for GOKZ" ) # Garry's Mod Addons From 60ae41da622c342440978498078d9390f50678de Mon Sep 17 00:00:00 2001 From: Chris Date: Tue, 26 Apr 2022 17:50:19 -0500 Subject: [PATCH 030/161] fix (arma3server): prevent multiple loading mods failing due to accidental line termination (#3845) Fixes loading multiple mods failing due to accidental line termination in the mod string when following the documentation. (Observed on Ubuntu 20.10) --- lgsm/config-default/config-lgsm/arma3server/_default.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lgsm/config-default/config-lgsm/arma3server/_default.cfg b/lgsm/config-default/config-lgsm/arma3server/_default.cfg index 1cdfe239a..7c4619c17 100644 --- a/lgsm/config-default/config-lgsm/arma3server/_default.cfg +++ b/lgsm/config-default/config-lgsm/arma3server/_default.cfg @@ -32,7 +32,7 @@ servermods="" bepath="" ## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters -startparameters="-ip=${ip} -port=${port} -cfg=${networkcfgfullpath} -config=${servercfgfullpath} -mod=${mods} -servermod=${servermods} -bepath=${bepath} -autoinit -loadmissiontomemory" +startparameters="-ip=${ip} -port=${port} -cfg=${networkcfgfullpath} -config=${servercfgfullpath} -mod='${mods}' -servermod=${servermods} -bepath=${bepath} -autoinit -loadmissiontomemory" #### LinuxGSM Settings #### From 0342adaa40d9fb7e1fdfd5e74c210cf83042f7a7 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Tue, 26 Apr 2022 23:51:05 +0100 Subject: [PATCH 031/161] feat(new server): Project Cars 2 (#3842) --- .../config-lgsm/pc2server/_default.cfg | 184 ++++++++++++++++++ lgsm/data/serverlist.csv | 1 + lgsm/functions/info_game.sh | 29 +++ lgsm/functions/info_messages.sh | 13 +- lgsm/functions/install_config.sh | 4 + 5 files changed, 230 insertions(+), 1 deletion(-) create mode 100644 lgsm/config-default/config-lgsm/pc2server/_default.cfg diff --git a/lgsm/config-default/config-lgsm/pc2server/_default.cfg b/lgsm/config-default/config-lgsm/pc2server/_default.cfg new file mode 100644 index 000000000..e43f150fd --- /dev/null +++ b/lgsm/config-default/config-lgsm/pc2server/_default.cfg @@ -0,0 +1,184 @@ +################################## +######## Default Settings ######## +################################## +# DO NOT EDIT, ANY CHANGES WILL BE OVERWRITTEN! +# Copy settings from here and use them in either: +# common.cfg - applies settings to every instance. +# [instance].cfg - applies settings to a specific instance. + +#### Game Server Settings #### + +## SteamCMD Login | https://docs.linuxgsm.com/steamcmd#steamcmd-login +steamuser="username" +steampass='password' + +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="--config ${servercfg}" + +#### LinuxGSM Settings #### + +## LinuxGSM Stats +# Send useful stats to LinuxGSM developers. +# https://docs.linuxgsm.com/configuration/linuxgsm-stats +# (on|off) +stats="off" + +## Notification Alerts +# (on|off) + +# Display IP | https://docs.linuxgsm.com/alerts#display-ip +displayip="" + +# More info | https://docs.linuxgsm.com/alerts#more-info +postalert="off" + +# Discord Alerts | https://docs.linuxgsm.com/alerts/discord +discordalert="off" +discordwebhook="webhook" + +# Email Alerts | https://docs.linuxgsm.com/alerts/email +emailalert="off" +email="email@example.com" +emailfrom="" + +# Gotify Alerts | https://docs.linuxgsm.com/alerts/gotify +gotifyalert="off" +gotifytoken="token" +gotifywebhook="webhook" + +# IFTTT Alerts | https://docs.linuxgsm.com/alerts/ifttt +iftttalert="off" +ifttttoken="accesstoken" +iftttevent="linuxgsm_alert" + +# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun +mailgunalert="off" +mailgunapiregion="us" +mailguntoken="accesstoken" +mailgundomain="example.com" +mailgunemailfrom="alert@example.com" +mailgunemail="email@myemail.com" + +# Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet +pushbulletalert="off" +pushbullettoken="accesstoken" +channeltag="" + +# Pushover Alerts | https://docs.linuxgsm.com/alerts/pushover +pushoveralert="off" +pushovertoken="accesstoken" +pushoveruserkey="userkey" + +# Rocket.Chat Alerts | https://docs.linuxgsm.com/alerts/rocket.chat +rocketchatalert="off" +rocketchatwebhook="webhook" +rocketchattoken="" + +# Slack Alerts | https://docs.linuxgsm.com/alerts/slack +slackalert="off" +slackwebhook="webhook" + +# Telegram Alerts | https://docs.linuxgsm.com/alerts/telegram +# You can add a custom cURL string eg proxy (useful in Russia) in "curlcustomstring". +# For example "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help". +telegramapi="api.telegram.org" +telegramalert="off" +telegramtoken="accesstoken" +telegramchatid="" +curlcustomstring="" + +## Updating | https://docs.linuxgsm.com/commands/update +updateonstart="off" + +## Backup | https://docs.linuxgsm.com/commands/backup +maxbackups="4" +maxbackupdays="30" +stoponbackup="on" + +## Logging | https://docs.linuxgsm.com/features/logging +consolelogging="on" +logdays="7" + +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + +## ANSI Colors | https://docs.linuxgsm.com/features/ansi-colors +ansi="on" + +#### Advanced Settings #### + +## Message Display Time | https://docs.linuxgsm.com/features/message-display-time +sleeptime="0.5" + +## SteamCMD Settings | https://docs.linuxgsm.com/steamcmd +# Server appid +appid="413770" +steamcmdforcewindows="no" +# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch +branch="" +betapassword="" +# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server +steammaster="false" + +## Stop Mode | https://docs.linuxgsm.com/features/stop-mode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: GoldSrc +# 10: Avorion +# 11: end +stopmode="2" + +## Query mode +# 1: session only +# 2: gamedig (gsquery fallback) +# 3: gamedig +# 4: gsquery +# 5: tcp +querymode="2" +querytype="protocol-valve" + +## Console type +consoleverbose="yes" +consoleinteract="no" + +## Game Server Details +# Do not edit +gamename="Project Cars 2" +engine="madness" +glibc="2.15" + +#### Directories #### +# Edit with care + +## Game Server Directories +systemdir="${serverfiles}" +executabledir="${serverfiles}" +executable="./DedicatedServerCmd.elf" +servercfgdir="${systemdir}" +servercfg="${selfname}.cfg" +servercfgdefault="config_sample/server.cfg" +servercfgfullpath="${servercfgdir}/${servercfg}" + +## Backup Directory +backupdir="${lgsmdir}/backup" + +## Logging Directories +logdir="${rootdir}/log" +gamelogdir="${systemdir}/logs" +lgsmlogdir="${logdir}/script" +consolelogdir="${logdir}/console" +lgsmlog="${lgsmlogdir}/${selfname}-script.log" +consolelog="${consolelogdir}/${selfname}-console.log" +alertlog="${lgsmlogdir}/${selfname}-alert.log" +postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" + +## Logs Naming +lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" +consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" diff --git a/lgsm/data/serverlist.csv b/lgsm/data/serverlist.csv index 7e71a94cc..8f4fde1b2 100644 --- a/lgsm/data/serverlist.csv +++ b/lgsm/data/serverlist.csv @@ -72,6 +72,7 @@ ns2c,ns2cserver,NS2: Combat onset,onsetserver,Onset opfor,opforserver,Opposing Force pc,pcserver,Project Cars +pc2,pc2server,Project Cars 2 pmc,pmcserver,PaperMC pstbs,pstbsserver,Post Scriptum: The Bloody Seventh pvkii,pvkiiserver,Pirates Vikings & Knights II diff --git a/lgsm/functions/info_game.sh b/lgsm/functions/info_game.sh index bb750559f..b2f5b7a24 100644 --- a/lgsm/functions/info_game.sh +++ b/lgsm/functions/info_game.sh @@ -1100,6 +1100,33 @@ fn_info_game_pc(){ fi } +fn_info_game_pc2(){ + # Config + if [ ! -f "${servercfgfullpath}" ]; then + servername="${unavailable}" + serverpassword="${unavailable}" + maxplayers="${zero}" + port="${zero}" + queryport="${zero}" + steamport="${zero}" + else + servername=$(grep "name" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/name//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + serverpassword=$(grep "password " "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + maxplayers=$(grep "MaxPlayers" "${servercfgfullpath}" | grep -v "//" | tr -cd '[:digit:]') + port=$(grep "hostPort" "${servercfgfullpath}" | grep -v "//" | tr -cd '[:digit:]') + queryport=$(grep "queryPort" "${servercfgfullpath}" | grep -v "//" | tr -cd '[:digit:]') + steamport=$(grep "steamPort" "${servercfgfullpath}" | grep -v "//" | tr -cd '[:digit:]') + + # Not set + servername=${servername:-"NOT SET"} + serverpassword=${serverpassword:-"NOT SET"} + maxplayers=${maxplayers:-"NOT SET"} + port=${port:-"NOT SET"} + queryport=${queryport:-"NOT SET"} + steamport=${steamport:-"NOT SET"} + fi +} + fn_info_game_pstbs(){ # Config if [ ! -f "${servercfgfullpath}" ]; then @@ -2329,6 +2356,8 @@ elif [ "${shortname}" == "onset" ]; then fn_info_game_onset elif [ "${shortname}" == "pc" ]; then fn_info_game_pc +elif [ "${shortname}" == "pc2" ]; then + fn_info_game_pc2 elif [ "${shortname}" == "pstbs" ]; then fn_info_game_pstbs elif [ "${shortname}" == "pvr" ];then diff --git a/lgsm/functions/info_messages.sh b/lgsm/functions/info_messages.sh index a5ad5852e..cf0f686b1 100755 --- a/lgsm/functions/info_messages.sh +++ b/lgsm/functions/info_messages.sh @@ -658,7 +658,7 @@ fn_info_message_ports_edit(){ startparameterslocation="${red}UNKNOWN${default}" # engines/games that require editing in the config file. - local ports_edit_array=( "ac" "arma3" "bo" "bt" "cd" "dst" "eco" "idtech2" "idtech3" "idtech3_ql" "jc2" "jc3" "lwjgl2" "mcb" "mumble" "pc" "pz" "qw" "refractor" "renderware" "rw" "sb" "sdtd" "st" "stn" "ts3" "tw" "terraria" "unreal" "unreal2" "unreal3" "vints" "wurm") + local ports_edit_array=( "ac" "arma3" "bo" "bt" "cd" "dst" "eco" "idtech2" "idtech3" "idtech3_ql" "jc2" "jc3" "lwjgl2" "mcb" "mumble" "pc" "pc2" "pz" "qw" "refractor" "renderware" "rw" "sb" "sdtd" "st" "stn" "ts3" "tw" "terraria" "unreal" "unreal2" "unreal3" "vints" "wurm") for port_edit in "${ports_edit_array[@]}"; do if [ "${shortname}" == "ut3" ]; then startparameterslocation="${servercfgdir}/UTWeb.ini" @@ -1178,6 +1178,15 @@ fn_info_message_pc(){ } | column -s $'\t' -t } +fn_info_message_pc2(){ + { + fn_port "header" + fn_port "Game" port udp + fn_port "Query" queryport udp + fn_port "Steam" steamport udp + } | column -s $'\t' -t +} + fn_info_message_pstbs(){ { fn_port "header" @@ -1708,6 +1717,8 @@ fn_info_message_select_engine(){ fn_info_message_onset elif [ "${shortname}" == "pc" ]; then fn_info_message_pc + elif [ "${shortname}" == "pc2" ]; then + fn_info_message_pc2 elif [ "${shortname}" == "pstbs" ]; then fn_info_message_pstbs elif [ "${shortname}" == "pvr" ]; then diff --git a/lgsm/functions/install_config.sh b/lgsm/functions/install_config.sh index 76de7867f..305a12f93 100755 --- a/lgsm/functions/install_config.sh +++ b/lgsm/functions/install_config.sh @@ -633,6 +633,10 @@ elif [ "${shortname}" == "pc" ]; then fn_default_config_remote fn_set_config_vars fn_list_config_locations +elif [ "${shortname}" == "pc2" ]; then + gamedirname="ProjectCars2" + fn_default_config_local + fn_list_config_locations elif [ "${shortname}" == "q2" ]; then gamedirname="Quake2" array_configs+=( server.cfg ) From 9e77ca2dd15b64437b94fcdeaacba47613c218e2 Mon Sep 17 00:00:00 2001 From: Christian Date: Wed, 27 Apr 2022 00:52:38 +0200 Subject: [PATCH 032/161] refactor: move steammaster check to info_game (#3821) --- lgsm/functions/info_distro.sh | 55 --------------------------------- lgsm/functions/info_game.sh | 57 +++++++++++++++++++++++++++++++++++ 2 files changed, 57 insertions(+), 55 deletions(-) diff --git a/lgsm/functions/info_distro.sh b/lgsm/functions/info_distro.sh index 148e2df48..f747b0d1b 100755 --- a/lgsm/functions/info_distro.sh +++ b/lgsm/functions/info_distro.sh @@ -267,61 +267,6 @@ fi netint=$(${ipcommand} -o addr | grep "${ip}" | awk '{print $2}') netlink=$(${ethtoolcommand} "${netint}" 2>/dev/null| grep Speed | awk '{print $2}') -# External IP address -if [ -z "${extip}" ]; then - extip="$(curl --connect-timeout 10 -s https://api.ipify.org 2>/dev/null)" - exitcode=$? - # Should ifconfig.co return an error will use last known IP. - if [ ${exitcode} -eq 0 ]; then - if [[ "${extip}" != *"DOCTYPE"* ]]; then - echo -e "${extip}" > "${tmpdir}/extip.txt" - else - if [ -f "${tmpdir}/extip.txt" ]; then - extip="$(cat "${tmpdir}/extip.txt")" - else - fn_print_error_nl "Unable to get external IP" - fi - fi - else - if [ -f "${tmpdir}/extip.txt" ]; then - extip="$(cat "${tmpdir}/extip.txt")" - else - fn_print_error_nl "Unable to get external IP" - fi - fi -fi - -# Alert IP address -if [ "${displayip}" ]; then - alertip="${displayip}" -elif [ "${extip}" ]; then - alertip="${extip}" -else - alertip="${ip}" -fi - -# Steam Master Server - checks if detected by master server. -if [ -z "${displaymasterserver}" ]; then - if [ "$(command -v jq 2>/dev/null)" ]; then - if [ "${ip}" ]&&[ "${port}" ]; then - if [ "${steammaster}" == "true" ]||[ "${commandname}" == "DEV-QUERY-RAW" ]; then - # Will query server IP addresses first. - for queryip in "${queryips[@]}"; do - masterserver="$(curl --connect-timeout 10 -m 3 -s "https://api.steampowered.com/ISteamApps/GetServersAtAddress/v0001?addr=${queryip}&format=json" | jq --arg port "${port}" --arg queryport "${queryport}" '.response.servers[] | select((.gameport == ($port|tonumber) or (.gameport == ($queryport|tonumber)))) | .addr' | wc -l 2>/dev/null)" - done - # Should that not work it will try the external IP. - if [ "${masterserver}" == "0" ]; then - masterserver="$(curl --connect-timeout 10 -m 3 -s "https://api.steampowered.com/ISteamApps/GetServersAtAddress/v0001?addr=${extip}&format=json" | jq --arg port "${port}" --arg queryport "${queryport}" '.response.servers[] | select((.gameport == ($port|tonumber) or (.gameport == ($queryport|tonumber)))) | .addr' | wc -l 2>/dev/null)" - fi - if [ "${masterserver}" == "0" ]; then - displaymasterserver="false" - else - displaymasterserver="true" - fi - fi - fi - fi -fi # Sets the SteamCMD glibc requirement if the game server requirement is less or not required. if [ "${appid}" ]; then if [ "${glibc}" = "null" ]||[ -z "${glibc}" ]||[ "$(printf '%s\n'${glibc}'\n' "2.14" | sort -V | head -n 1)" != "2.14" ]; then diff --git a/lgsm/functions/info_game.sh b/lgsm/functions/info_game.sh index b2f5b7a24..3b6910802 100644 --- a/lgsm/functions/info_game.sh +++ b/lgsm/functions/info_game.sh @@ -2441,3 +2441,60 @@ elif [ "${engine}" == "source" ]||[ "${engine}" == "goldsrc" ]; then elif [ "${engine}" == "unreal2" ]; then fn_info_game_unreal2 fi + +# External IP address +if [ -z "${extip}" ]; then + extip="$(curl --connect-timeout 10 -s https://api.ipify.org 2>/dev/null)" + exitcode=$? + # Should ifconfig.co return an error will use last known IP. + if [ ${exitcode} -eq 0 ]; then + if [[ "${extip}" != *"DOCTYPE"* ]]; then + echo -e "${extip}" > "${tmpdir}/extip.txt" + else + if [ -f "${tmpdir}/extip.txt" ]; then + extip="$(cat "${tmpdir}/extip.txt")" + else + fn_print_error_nl "Unable to get external IP" + fi + fi + else + if [ -f "${tmpdir}/extip.txt" ]; then + extip="$(cat "${tmpdir}/extip.txt")" + else + fn_print_error_nl "Unable to get external IP" + fi + fi +fi + +# Alert IP address +if [ "${displayip}" ]; then + alertip="${displayip}" +elif [ "${extip}" ]; then + alertip="${extip}" +else + alertip="${ip}" +fi + +# Steam Master Server - checks if detected by master server. +# Checked after config init, as the queryport is needed +if [ -z "${displaymasterserver}" ]; then + if [ "$(command -v jq 2>/dev/null)" ]; then + if [ "${ip}" ]&&[ "${port}" ]; then + if [ "${steammaster}" == "true" ]||[ "${commandname}" == "DEV-QUERY-RAW" ]; then + # Will query server IP addresses first. + for queryip in "${queryips[@]}"; do + masterserver="$(curl --connect-timeout 10 -m 3 -s "https://api.steampowered.com/ISteamApps/GetServersAtAddress/v0001?addr=${queryip}&format=json" | jq --arg port "${port}" --arg queryport "${queryport}" '.response.servers[] | select((.gameport == ($port|tonumber) or (.gameport == ($queryport|tonumber)))) | .addr' | wc -l 2>/dev/null)" + done + # Should that not work it will try the external IP. + if [ "${masterserver}" == "0" ]; then + masterserver="$(curl --connect-timeout 10 -m 3 -s "https://api.steampowered.com/ISteamApps/GetServersAtAddress/v0001?addr=${extip}&format=json" | jq --arg port "${port}" --arg queryport "${queryport}" '.response.servers[] | select((.gameport == ($port|tonumber) or (.gameport == ($queryport|tonumber)))) | .addr' | wc -l 2>/dev/null)" + fi + if [ "${masterserver}" == "0" ]; then + displaymasterserver="false" + else + displaymasterserver="true" + fi + fi + fi + fi +fi From ed12e6c8a041a57509e2d71f33a3c1de50cd5cbb Mon Sep 17 00:00:00 2001 From: Jonah Hirsch Date: Sat, 14 May 2022 16:20:34 -0700 Subject: [PATCH 033/161] fix: tfcserver/_default.cfg Ip flag (#3859) `_ip` => `+ip` --- lgsm/config-default/config-lgsm/tfcserver/_default.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lgsm/config-default/config-lgsm/tfcserver/_default.cfg b/lgsm/config-default/config-lgsm/tfcserver/_default.cfg index b22c10a7c..827b32736 100644 --- a/lgsm/config-default/config-lgsm/tfcserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/tfcserver/_default.cfg @@ -16,7 +16,7 @@ defaultmap="dustbowl" maxplayers="16" ## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters -startparameters="-game tfc -strictportbind _ip ${ip} -port ${port} +clientport ${clientport} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers ${maxplayers}" +startparameters="-game tfc -strictportbind +ip ${ip} -port ${port} +clientport ${clientport} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers ${maxplayers}" #### LinuxGSM Settings #### From 20eb96e8377863d122caebbd866eed02bb7b12ab Mon Sep 17 00:00:00 2001 From: nathannaveen <42319948+nathannaveen@users.noreply.github.com> Date: Sat, 14 May 2022 19:21:46 -0400 Subject: [PATCH 034/161] chore: Set permissions for GitHub actions (#3849) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Restrict the GitHub token permissions only to the required ones; this way, even if the attackers will succeed in compromising your workflow, they won’t be able to do much. - Included permissions for the action. https://github.com/ossf/scorecard/blob/main/docs/checks.md#token-permissions https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#permissions https://docs.github.com/en/actions/using-jobs/assigning-permissions-to-jobs [Keeping your GitHub Actions and workflows secure Part 1: Preventing pwn requests](https://securitylab.github.com/research/github-actions-preventing-pwn-requests/) Signed-off-by: nathannaveen <42319948+nathannaveen@users.noreply.github.com> --- .github/workflows/create-release.yml | 6 ++++++ .github/workflows/labeler.yml | 6 ++++++ .github/workflows/lock.yml | 6 ++++++ .github/workflows/version-check.yml | 3 +++ 4 files changed, 21 insertions(+) diff --git a/.github/workflows/create-release.yml b/.github/workflows/create-release.yml index c53f39d3d..fcc7fc837 100644 --- a/.github/workflows/create-release.yml +++ b/.github/workflows/create-release.yml @@ -5,8 +5,14 @@ on: # branches to consider in the event; optional, defaults to all branches: - master +permissions: + contents: read + jobs: update_release_draft: + permissions: + contents: write # for release-drafter/release-drafter to create a github release + pull-requests: write # for release-drafter/release-drafter to add label to PR runs-on: ubuntu-latest steps: # Drafts your next Release notes as Pull Requests are merged into "master" diff --git a/.github/workflows/labeler.yml b/.github/workflows/labeler.yml index 7b8e2668a..c5ea01d0a 100644 --- a/.github/workflows/labeler.yml +++ b/.github/workflows/labeler.yml @@ -3,8 +3,14 @@ on: issues: types: [opened, edited] +permissions: + contents: read + jobs: triage: + permissions: + contents: read # for github/issue-labeler to get repo contents + issues: write # for github/issue-labeler to create or remove labels runs-on: ubuntu-latest steps: - uses: github/issue-labeler@v2.4 diff --git a/.github/workflows/lock.yml b/.github/workflows/lock.yml index 0ec82b1f6..7c17c56bf 100644 --- a/.github/workflows/lock.yml +++ b/.github/workflows/lock.yml @@ -4,8 +4,14 @@ on: schedule: - cron: '0 0 * * *' +permissions: + contents: read + jobs: lock: + permissions: + issues: write # for dessant/lock-threads to lock issues + pull-requests: write # for dessant/lock-threads to lock PRs runs-on: ubuntu-latest steps: - uses: dessant/lock-threads@v3 diff --git a/.github/workflows/version-check.yml b/.github/workflows/version-check.yml index 2bf80f491..4c06d86d7 100644 --- a/.github/workflows/version-check.yml +++ b/.github/workflows/version-check.yml @@ -7,6 +7,9 @@ name: Version Check on: push # A workflow run is made up of one or more jobs that can run sequentially or in parallel +permissions: + contents: read + jobs: # This workflow contains a single job called "build" Version-Check: From d86a7095e517f35e7a199169c960166ea45f9c69 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 15 May 2022 00:24:01 +0100 Subject: [PATCH 035/161] build(deps): bump release-drafter/release-drafter from 5.19.0 to 5.20.0 (#3854) Bumps [release-drafter/release-drafter](https://github.com/release-drafter/release-drafter) from 5.19.0 to 5.20.0. - [Release notes](https://github.com/release-drafter/release-drafter/releases) - [Commits](https://github.com/release-drafter/release-drafter/compare/v5.19.0...v5.20.0) --- updated-dependencies: - dependency-name: release-drafter/release-drafter dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/create-release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/create-release.yml b/.github/workflows/create-release.yml index c53f39d3d..fe5998378 100644 --- a/.github/workflows/create-release.yml +++ b/.github/workflows/create-release.yml @@ -10,7 +10,7 @@ jobs: runs-on: ubuntu-latest steps: # Drafts your next Release notes as Pull Requests are merged into "master" - - uses: release-drafter/release-drafter@v5.19.0 + - uses: release-drafter/release-drafter@v5.20.0 with: config-name: release-drafter.yml env: From f78d707f2aaf95e64c91a0302267d1287d900395 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 26 May 2022 21:40:59 +0100 Subject: [PATCH 036/161] build(deps): bump github/issue-labeler from 2.4 to 2.5 (#3862) Bumps [github/issue-labeler](https://github.com/github/issue-labeler) from 2.4 to 2.5. - [Release notes](https://github.com/github/issue-labeler/releases) - [Commits](https://github.com/github/issue-labeler/compare/v2.4...v2.5) --- updated-dependencies: - dependency-name: github/issue-labeler dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/labeler.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/labeler.yml b/.github/workflows/labeler.yml index 7b8e2668a..a1fc859a5 100644 --- a/.github/workflows/labeler.yml +++ b/.github/workflows/labeler.yml @@ -7,7 +7,7 @@ jobs: triage: runs-on: ubuntu-latest steps: - - uses: github/issue-labeler@v2.4 + - uses: github/issue-labeler@v2.5 with: repo-token: "${{ secrets.GITHUB_TOKEN }}" configuration-path: .github/labeler.yml From 37ea2c99bc71817555457ad20aa048c54dcb6f7c Mon Sep 17 00:00:00 2001 From: Christian Date: Wed, 1 Jun 2022 00:12:34 +0200 Subject: [PATCH 037/161] fix(mcb): fix renaming whitelist to allowlist (#3883) --- lgsm/functions/update_minecraft_bedrock.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lgsm/functions/update_minecraft_bedrock.sh b/lgsm/functions/update_minecraft_bedrock.sh index f4054ae00..ad22a291d 100644 --- a/lgsm/functions/update_minecraft_bedrock.sh +++ b/lgsm/functions/update_minecraft_bedrock.sh @@ -17,7 +17,7 @@ fn_update_minecraft_dl(){ if [ "${firstcommandname}" == "INSTALL" ]; then unzip -oq "${tmpdir}/bedrock_server.${remotebuild}.zip" -x "server.properties" -d "${serverfiles}" else - unzip -oq "${tmpdir}/bedrock_server.${remotebuild}.zip" -x "permissions.json" "server.properties" "whitelist.json" -d "${serverfiles}" + unzip -oq "${tmpdir}/bedrock_server.${remotebuild}.zip" -x "permissions.json" "server.properties" "allowlist.json" -d "${serverfiles}" fi local exitcode=$? if [ "${exitcode}" == "0" ]; then From 14ca894cdcfe01dbae8c7449d7e4660dc345ce76 Mon Sep 17 00:00:00 2001 From: Christian Date: Wed, 1 Jun 2022 00:13:10 +0200 Subject: [PATCH 038/161] feat(mcb): allow to set hard a version for the server (#3881) --- lgsm/config-default/config-lgsm/mcbserver/_default.cfg | 3 +++ lgsm/functions/update_minecraft_bedrock.sh | 10 +++++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/lgsm/config-default/config-lgsm/mcbserver/_default.cfg b/lgsm/config-default/config-lgsm/mcbserver/_default.cfg index 8ccd2e658..bc64ee883 100644 --- a/lgsm/config-default/config-lgsm/mcbserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/mcbserver/_default.cfg @@ -11,6 +11,9 @@ ## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters startparameters="" +# Version (latest|1.18.33.02) +mcversion="latest" + #### LinuxGSM Settings #### ## LinuxGSM Stats diff --git a/lgsm/functions/update_minecraft_bedrock.sh b/lgsm/functions/update_minecraft_bedrock.sh index ad22a291d..f724679a9 100644 --- a/lgsm/functions/update_minecraft_bedrock.sh +++ b/lgsm/functions/update_minecraft_bedrock.sh @@ -11,8 +11,7 @@ functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" randnum=$((1 + RANDOM % 5000)) fn_update_minecraft_dl(){ - latestmcbuildurl=$(curl -H "Accept-Encoding: identity" -H "Accept-Language: en" -Ls -A "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.${randnum}.212 Safari/537.36" "https://www.minecraft.net/en-us/download/server/bedrock/" | grep -o 'https://minecraft.azureedge.net/bin-linux/[^"]*zip') - fn_fetch_file "${latestmcbuildurl}" "" "" "" "${tmpdir}" "bedrock_server.${remotebuild}.zip" + fn_fetch_file "https://minecraft.azureedge.net/bin-linux/bedrock-server-${remotebuild}.zip" "" "" "" "${tmpdir}" "bedrock_server.${remotebuild}.zip" echo -e "Extracting to ${serverfiles}...\c" if [ "${firstcommandname}" == "INSTALL" ]; then unzip -oq "${tmpdir}/bedrock_server.${remotebuild}.zip" -x "server.properties" -d "${serverfiles}" @@ -82,7 +81,12 @@ fn_update_minecraft_localbuild(){ fn_update_minecraft_remotebuild(){ # Gets remote build info. - remotebuild=$(curl -H "Accept-Encoding: identity" -H "Accept-Language: en" -Ls -A "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.${randnum}.212 Safari/537.36" "https://www.minecraft.net/en-us/download/server/bedrock/" | grep -o 'https://minecraft.azureedge.net/bin-linux/[^"]*' | sed 's/.*\///' | grep -Eo "[.0-9]+[0-9]") + if [ "${mcversion}" == "latest" ]; then + remotebuild=$(curl -H "Accept-Encoding: identity" -H "Accept-Language: en" -Ls -A "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.${randnum}.212 Safari/537.36" "https://www.minecraft.net/en-us/download/server/bedrock/" | grep -o 'https://minecraft.azureedge.net/bin-linux/[^"]*' | sed 's/.*\///' | grep -Eo "[.0-9]+[0-9]") + else + remotebuild="${mcversion}" + fi + if [ "${firstcommandname}" != "INSTALL" ]; then fn_print_dots "Checking remote build: ${remotelocation}" # Checks if remotebuild variable has been set. From 6816d396f82b24da5dbfacefbe5b5540dba73497 Mon Sep 17 00:00:00 2001 From: Christian Date: Wed, 1 Jun 2022 00:13:27 +0200 Subject: [PATCH 039/161] fix(ark): rework parsing of config (#3878) --- lgsm/functions/info_game.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lgsm/functions/info_game.sh b/lgsm/functions/info_game.sh index 3b6910802..75cef3c69 100644 --- a/lgsm/functions/info_game.sh +++ b/lgsm/functions/info_game.sh @@ -46,9 +46,9 @@ fn_info_game_ark(){ adminpassword="${unavailable}" serverpassword="${unavailable}" else - servername=$(grep "SessionName" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^--/d' -e 's/SessionName//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - adminpassword=$(grep "ServerAdminPassword" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^--/d' -e 's/ServerAdminPassword//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//' ) - serverpassword=$( grep "ServerPassword" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^--/d' -e 's/ServerPassword//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + servername=$(sed -nr 's/^SessionName=(.*)/\1/p' "${servercfgfullpath}") + adminpassword=$(sed -nr 's/^ServerAdminPassword=(.*)/\1/p' "${servercfgfullpath}") + serverpassword=$(sed -nr 's/^ServerPassword=(.*)/\1/p' "${servercfgfullpath}") # Not set servername=${servername:-"NOT SET"} From c68394ff626b33393c1402a3b1cd6e27629b1f0c Mon Sep 17 00:00:00 2001 From: Christian Date: Thu, 2 Jun 2022 22:58:07 +0200 Subject: [PATCH 040/161] feat(newserver): Arma Reforger (#3871) * feat(newserver): Arma Reforger * feat(armarserver): Add server profile name * feat(armarserver): Add fix for create profile directory * feat(armar): limit fps for the server to fix the performance * feat(armar): add dependencys Co-authored-by: FliesWithWind * feat(armar): move queryport to config parser and add adminpass * feat(armar): fix dependencys * change ss command for armar * add battleeyeport * bug * tcp Co-authored-by: Marcin Jakubowski Co-authored-by: FliesWithWind Co-authored-by: Daniel Gibbs --- .../config-lgsm/armarserver/_default.cfg | 187 ++++++++++++++++++ lgsm/data/almalinux-8.csv | 1 + lgsm/data/centos-7.csv | 1 + lgsm/data/centos-8.csv | 1 + lgsm/data/debian-10.csv | 1 + lgsm/data/debian-11.csv | 1 + lgsm/data/debian-9.csv | 1 + lgsm/data/rhel-7.csv | 1 + lgsm/data/rhel-8.csv | 1 + lgsm/data/rocky-8.csv | 1 + lgsm/data/serverlist.csv | 1 + lgsm/data/ubuntu-18.04.csv | 1 + lgsm/data/ubuntu-20.04.csv | 1 + lgsm/data/ubuntu-21.04.csv | 1 + lgsm/data/ubuntu-21.10.csv | 1 + lgsm/data/ubuntu-22.04.csv | 1 + lgsm/functions/core_functions.sh | 5 + lgsm/functions/fix.sh | 2 + lgsm/functions/fix_armar.sh | 17 ++ lgsm/functions/info_game.sh | 29 +++ lgsm/functions/info_messages.sh | 17 +- lgsm/functions/install_config.sh | 8 + 22 files changed, 278 insertions(+), 2 deletions(-) create mode 100644 lgsm/config-default/config-lgsm/armarserver/_default.cfg create mode 100755 lgsm/functions/fix_armar.sh diff --git a/lgsm/config-default/config-lgsm/armarserver/_default.cfg b/lgsm/config-default/config-lgsm/armarserver/_default.cfg new file mode 100644 index 000000000..9e2f88d7c --- /dev/null +++ b/lgsm/config-default/config-lgsm/armarserver/_default.cfg @@ -0,0 +1,187 @@ +################################## +######## Default Settings ######## +################################## +# DO NOT EDIT, ANY CHANGES WILL BE OVERWRITTEN! +# Copy settings from here and use them in either: +# common.cfg - applies settings to every instance. +# [instance].cfg - applies settings to a specific instance. + +#### Game Server Settings #### + +# https://community.bistudio.com/wiki/Arma_Reforger:Server_Hosting +# MaxFPS to limit the used Server resouces +maxfps="60" + +# Profile Name +serverprofile="server" +serverprofilefullpath="${serverfiles}/profiles/${serverprofile}" + +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="-config ${servercfgfullpath} -profile ${serverprofilefullpath} -maxFPS ${maxfps}" + +#### LinuxGSM Settings #### + +## LinuxGSM Stats +# Send useful stats to LinuxGSM developers. +# https://docs.linuxgsm.com/configuration/linuxgsm-stats +# (on|off) +stats="off" + +## Notification Alerts +# (on|off) + +# Display IP | https://docs.linuxgsm.com/alerts#display-ip +displayip="" + +# More info | https://docs.linuxgsm.com/alerts#more-info +postalert="off" + +# Discord Alerts | https://docs.linuxgsm.com/alerts/discord +discordalert="off" +discordwebhook="webhook" + +# Email Alerts | https://docs.linuxgsm.com/alerts/email +emailalert="off" +email="email@example.com" +emailfrom="" + +# Gotify Alerts | https://docs.linuxgsm.com/alerts/gotify +gotifyalert="off" +gotifytoken="token" +gotifywebhook="webhook" + +# IFTTT Alerts | https://docs.linuxgsm.com/alerts/ifttt +iftttalert="off" +ifttttoken="accesstoken" +iftttevent="linuxgsm_alert" + +# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun +mailgunalert="off" +mailgunapiregion="us" +mailguntoken="accesstoken" +mailgundomain="example.com" +mailgunemailfrom="alert@example.com" +mailgunemail="email@myemail.com" + +# Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet +pushbulletalert="off" +pushbullettoken="accesstoken" +channeltag="" + +# Pushover Alerts | https://docs.linuxgsm.com/alerts/pushover +pushoveralert="off" +pushovertoken="accesstoken" +pushoveruserkey="userkey" + +# Rocket.Chat Alerts | https://docs.linuxgsm.com/alerts/rocket.chat +rocketchatalert="off" +rocketchatwebhook="webhook" +rocketchattoken="" + +# Slack Alerts | https://docs.linuxgsm.com/alerts/slack +slackalert="off" +slackwebhook="webhook" + +# Telegram Alerts | https://docs.linuxgsm.com/alerts/telegram +# You can add a custom cURL string eg proxy (useful in Russia) in "curlcustomstring". +# For example "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help". +telegramapi="api.telegram.org" +telegramalert="off" +telegramtoken="accesstoken" +telegramchatid="" +curlcustomstring="" + +## Updating | https://docs.linuxgsm.com/commands/update +updateonstart="off" + +## Backup | https://docs.linuxgsm.com/commands/backup +maxbackups="4" +maxbackupdays="30" +stoponbackup="on" + +## Logging | https://docs.linuxgsm.com/features/logging +consolelogging="on" +logdays="7" + +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="5" + +## ANSI Colors | https://docs.linuxgsm.com/features/ansi-colors +ansi="on" + +#### Advanced Settings #### + +## Message Display Time | https://docs.linuxgsm.com/features/message-display-time +sleeptime="0.5" + +## SteamCMD Settings | https://docs.linuxgsm.com/steamcmd +# Server appid +appid="1874900" +steamcmdforcewindows="no" +# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch +branch="" +betapassword="" +# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server +steammaster="false" + +## Stop Mode | https://docs.linuxgsm.com/features/stop-mode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: GoldSrc +# 10: Avorion +# 11: end +stopmode="2" + +## Query mode +# 1: session only +# 2: gamedig (gsquery fallback) +# 3: gamedig +# 4: gsquery +# 5: tcp +querymode="2" +querytype="protocol-valve" + +## Console type +consoleverbose="yes" +consoleinteract="no" + +## Game Server Details +# Do not edit +gamename="Arma Reforger" +engine="enfusion" +glibc="2.27" + +#### Directories #### +# Edit with care + +## Game Server Directories +systemdir="${serverfiles}" +executabledir="${serverfiles}" +executable="./ArmaReforgerServer" +servercfgdir="${systemdir}" +servercfg="${selfname}_config.json" +servercfgdefault="server.json" +servercfgfullpath="${servercfgdir}/${servercfg}" + +## Backup Directory +backupdir="${lgsmdir}/backup" + +## Logging Directories +logdir="${rootdir}/log" +lgsmlogdir="${logdir}/script" +consolelogdir="${logdir}/console" +lgsmlog="${lgsmlogdir}/${selfname}-script.log" +consolelog="${consolelogdir}/${selfname}-console.log" +alertlog="${lgsmlogdir}/${selfname}-alert.log" +postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" + +## Logs Naming +lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" +consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" diff --git a/lgsm/data/almalinux-8.csv b/lgsm/data/almalinux-8.csv index 808267bb0..067b58378 100644 --- a/lgsm/data/almalinux-8.csv +++ b/lgsm/data/almalinux-8.csv @@ -5,6 +5,7 @@ ahl ahl2 ark arma3 +armar,libcurl,openssl-libs av bb bb2,libcurl.i686 diff --git a/lgsm/data/centos-7.csv b/lgsm/data/centos-7.csv index 9f989f42a..e8dc0a885 100644 --- a/lgsm/data/centos-7.csv +++ b/lgsm/data/centos-7.csv @@ -5,6 +5,7 @@ ahl ahl2 ark arma3 +armar,libcurl,openssl11-libs av bb bb2,libcurl.i686 diff --git a/lgsm/data/centos-8.csv b/lgsm/data/centos-8.csv index 79c45b8db..116d83bea 100644 --- a/lgsm/data/centos-8.csv +++ b/lgsm/data/centos-8.csv @@ -5,6 +5,7 @@ ahl ahl2 ark arma3 +armar,libcurl,openssl-libs av bb bb2,libcurl.i686 diff --git a/lgsm/data/debian-10.csv b/lgsm/data/debian-10.csv index 94f356412..30ca2df10 100644 --- a/lgsm/data/debian-10.csv +++ b/lgsm/data/debian-10.csv @@ -5,6 +5,7 @@ ahl ahl2 ark arma3 +armar,libcurl4,libssl1.1 av bb bb2,libcurl4-gnutls-dev:i386 diff --git a/lgsm/data/debian-11.csv b/lgsm/data/debian-11.csv index e0021c345..f96d48862 100644 --- a/lgsm/data/debian-11.csv +++ b/lgsm/data/debian-11.csv @@ -5,6 +5,7 @@ ahl ahl2 ark arma3 +armar,libcurl4,libssl1.1 av bb bb2,libcurl4-gnutls-dev:i386 diff --git a/lgsm/data/debian-9.csv b/lgsm/data/debian-9.csv index 9cb339c8e..fe55eb260 100644 --- a/lgsm/data/debian-9.csv +++ b/lgsm/data/debian-9.csv @@ -5,6 +5,7 @@ ahl ahl2 ark arma3 +armar,libcurl4,libssl1.1 av bb bb2,libcurl4-gnutls-dev:i386 diff --git a/lgsm/data/rhel-7.csv b/lgsm/data/rhel-7.csv index a7b3254ec..d4d3fbd30 100644 --- a/lgsm/data/rhel-7.csv +++ b/lgsm/data/rhel-7.csv @@ -5,6 +5,7 @@ ahl ahl2 ark arma3 +armar,libcurl,openssl11-libs av bb bb2,libcurl.i686 diff --git a/lgsm/data/rhel-8.csv b/lgsm/data/rhel-8.csv index a7b3254ec..5e7b622e9 100644 --- a/lgsm/data/rhel-8.csv +++ b/lgsm/data/rhel-8.csv @@ -5,6 +5,7 @@ ahl ahl2 ark arma3 +armar,libcurl,openssl-libs av bb bb2,libcurl.i686 diff --git a/lgsm/data/rocky-8.csv b/lgsm/data/rocky-8.csv index 808267bb0..067b58378 100644 --- a/lgsm/data/rocky-8.csv +++ b/lgsm/data/rocky-8.csv @@ -5,6 +5,7 @@ ahl ahl2 ark arma3 +armar,libcurl,openssl-libs av bb bb2,libcurl.i686 diff --git a/lgsm/data/serverlist.csv b/lgsm/data/serverlist.csv index 8f4fde1b2..f5463cd84 100644 --- a/lgsm/data/serverlist.csv +++ b/lgsm/data/serverlist.csv @@ -3,6 +3,7 @@ ahl,ahlserver,Action Half-Life ahl2,ahl2server,Action: Source ark,arkserver,ARK: Survival Evolved arma3,arma3server,ARMA 3 +armar,armarserver,Arma Reforger av,avserver,Avorion bb,bbserver,BrainBread bb2,bb2server,BrainBread 2 diff --git a/lgsm/data/ubuntu-18.04.csv b/lgsm/data/ubuntu-18.04.csv index 94f356412..30ca2df10 100644 --- a/lgsm/data/ubuntu-18.04.csv +++ b/lgsm/data/ubuntu-18.04.csv @@ -5,6 +5,7 @@ ahl ahl2 ark arma3 +armar,libcurl4,libssl1.1 av bb bb2,libcurl4-gnutls-dev:i386 diff --git a/lgsm/data/ubuntu-20.04.csv b/lgsm/data/ubuntu-20.04.csv index bf5a9601c..ccb1ca703 100644 --- a/lgsm/data/ubuntu-20.04.csv +++ b/lgsm/data/ubuntu-20.04.csv @@ -5,6 +5,7 @@ ahl ahl2 ark arma3 +armar,libcurl4,libssl1.1 av bb bb2,libcurl4-gnutls-dev:i386 diff --git a/lgsm/data/ubuntu-21.04.csv b/lgsm/data/ubuntu-21.04.csv index c2a4b959d..b2a277306 100644 --- a/lgsm/data/ubuntu-21.04.csv +++ b/lgsm/data/ubuntu-21.04.csv @@ -5,6 +5,7 @@ ahl ahl2 ark arma3 +armar,libcurl4,libssl1.1 av bb bb2,libcurl4-gnutls-dev:i386 diff --git a/lgsm/data/ubuntu-21.10.csv b/lgsm/data/ubuntu-21.10.csv index 8c66e2e26..836dfe53f 100644 --- a/lgsm/data/ubuntu-21.10.csv +++ b/lgsm/data/ubuntu-21.10.csv @@ -5,6 +5,7 @@ ahl ahl2 ark arma3 +armar,libcurl4,libssl1.1 av bb bb2,libcurl4-gnutls-dev:i386 diff --git a/lgsm/data/ubuntu-22.04.csv b/lgsm/data/ubuntu-22.04.csv index 8c66e2e26..836dfe53f 100644 --- a/lgsm/data/ubuntu-22.04.csv +++ b/lgsm/data/ubuntu-22.04.csv @@ -5,6 +5,7 @@ ahl ahl2 ark arma3 +armar,libcurl4,libssl1.1 av bb bb2,libcurl4-gnutls-dev:i386 diff --git a/lgsm/functions/core_functions.sh b/lgsm/functions/core_functions.sh index 4a72bf7d0..ad1307a73 100755 --- a/lgsm/functions/core_functions.sh +++ b/lgsm/functions/core_functions.sh @@ -341,6 +341,11 @@ functionfile="${FUNCNAME[0]}" fn_fetch_function } +fix_armar.sh(){ +functionfile="${FUNCNAME[0]}" +fn_fetch_function +} + fix_bo.sh(){ functionfile="${FUNCNAME[0]}" fn_fetch_function diff --git a/lgsm/functions/fix.sh b/lgsm/functions/fix.sh index b5cbcc77a..f9f61162f 100755 --- a/lgsm/functions/fix.sh +++ b/lgsm/functions/fix.sh @@ -39,6 +39,8 @@ if [ "${commandname}" != "INSTALL" ]&&[ -z "${fixbypass}" ]; then if [ "${shortname}" == "arma3" ]; then fix_arma3.sh + elif [ "${shortname}" == "armar" ]; then + fix_armar.sh elif [ "${shortname}" == "ark" ]; then fix_ark.sh elif [ "${shortname}" == "bo" ]; then diff --git a/lgsm/functions/fix_armar.sh b/lgsm/functions/fix_armar.sh new file mode 100755 index 000000000..9db42f51a --- /dev/null +++ b/lgsm/functions/fix_armar.sh @@ -0,0 +1,17 @@ +#!/bin/bash +# LinuxGSM fix_armar.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Resolves an issue with Arma Reforger. + +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +# Fixes: Profile directory doesn't exist. +# Issue Link: https://feedback.bistudio.com/T164845 +if [ ! -d "${serverprofilefullpath}" ]; then + fixname="Profile directory doesn't exist" + fn_fix_msg_start + mkdir -p "${serverprofilefullpath}" + fn_fix_msg_end +fi diff --git a/lgsm/functions/info_game.sh b/lgsm/functions/info_game.sh index 75cef3c69..db769f820 100644 --- a/lgsm/functions/info_game.sh +++ b/lgsm/functions/info_game.sh @@ -93,6 +93,33 @@ fn_info_game_arma3(){ battleeyeport=$((port+4)) } +fn_info_game_armar(){ + if [ -f "${servercfgfullpath}" ]; then + adminpassword=$(jq -r '.adminPassword' "${servercfgfullpath}") + configip=$(jq -r '.gameHostBindAddress' "${servercfgfullpath}") + maxplayers=$(jq -r '.game.playerCountLimit' "${servercfgfullpath}") + port=$(jq -r '.gameHostBindPort' "${servercfgfullpath}") + queryport=$(jq -r '.steamQueryPort' "${servercfgfullpath}") + servername=$(jq -r '.game.name' "${servercfgfullpath}") + serverpassword=$(jq -r '.game.password' "${servercfgfullpath}") + battleeyeport=1376 + + + # Not set + adminpassword=${adminpassword:-"NOT SET"} + configip=${configip:-"0.0.0.0"} + maxplayers=${maxplayers:-"0"} + port=${port:-"0"} + queryport=${queryport:-"0"} + servername=${servername:-"NOT SET"} + serverpassword=${serverpassword:-"NOT SET"} + else + port=${port:-"0"} + servername="${unavailable}" + serverpassword="${unavailable}" + fi +} + fn_info_game_av() { # Config if [ ! -f "${servercfgfullpath}" ]; then @@ -2282,6 +2309,8 @@ elif [ "${shortname}" == "ark" ]; then fn_info_game_ark elif [ "${shortname}" == "arma3" ]; then fn_info_game_arma3 +elif [ "${shortname}" == "armar" ]; then + fn_info_game_armar elif [ "${shortname}" == "av" ]; then fn_info_game_av elif [ "${shortname}" == "bf1942" ]; then diff --git a/lgsm/functions/info_messages.sh b/lgsm/functions/info_messages.sh index cf0f686b1..f0def5b0e 100755 --- a/lgsm/functions/info_messages.sh +++ b/lgsm/functions/info_messages.sh @@ -658,7 +658,7 @@ fn_info_message_ports_edit(){ startparameterslocation="${red}UNKNOWN${default}" # engines/games that require editing in the config file. - local ports_edit_array=( "ac" "arma3" "bo" "bt" "cd" "dst" "eco" "idtech2" "idtech3" "idtech3_ql" "jc2" "jc3" "lwjgl2" "mcb" "mumble" "pc" "pc2" "pz" "qw" "refractor" "renderware" "rw" "sb" "sdtd" "st" "stn" "ts3" "tw" "terraria" "unreal" "unreal2" "unreal3" "vints" "wurm") + local ports_edit_array=( "ac" "arma3" "armar" "bo" "bt" "cd" "dst" "eco" "idtech2" "idtech3" "idtech3_ql" "jc2" "jc3" "lwjgl2" "mcb" "mumble" "pc" "pc2" "pz" "qw" "refractor" "renderware" "rw" "sb" "sdtd" "st" "stn" "ts3" "tw" "terraria" "unreal" "unreal2" "unreal3" "vints" "wurm") for port_edit in "${ports_edit_array[@]}"; do if [ "${shortname}" == "ut3" ]; then startparameterslocation="${servercfgdir}/UTWeb.ini" @@ -681,7 +681,9 @@ fn_info_message_ports_edit(){ fn_info_message_ports(){ echo -e "${lightblue}Useful port diagnostic command:${default}" - if [ "${shortname}" == "av" ]; then + if [ "${shortname}" == "armar" ]; then + echo -e "ss -tuplwn | grep enfMain" + elif [ "${shortname}" == "av" ]; then echo -e "ss -tuplwn | grep AvorionServer" elif [ "${shortname}" == "bf1942" ]; then echo -e "ss -tuplwn | grep bf1942_lnxded" @@ -807,6 +809,15 @@ fn_info_message_arma3(){ } | column -s $'\t' -t } +fn_info_message_armar(){ + { + fn_port "header" + fn_port "Game" port udp + fn_port "Steam Query" queryport udp + fn_port "BattleEye" battleeyeport tcp + } | column -s $'\t' -t +} + fn_info_message_av(){ { fn_port "header" @@ -1639,6 +1650,8 @@ fn_info_message_select_engine(){ fn_info_message_ark elif [ "${shortname}" == "arma3" ]; then fn_info_message_arma3 + elif [ "${shortname}" == "armar" ]; then + fn_info_message_armar elif [ "${shortname}" == "av" ]; then fn_info_message_av elif [ "${shortname}" == "bf1942" ]; then diff --git a/lgsm/functions/install_config.sh b/lgsm/functions/install_config.sh index 305a12f93..a7c18b65d 100755 --- a/lgsm/functions/install_config.sh +++ b/lgsm/functions/install_config.sh @@ -202,6 +202,14 @@ elif [ "${shortname}" == "arma3" ]; then fn_default_config_remote fn_set_config_vars fn_list_config_locations +elif [ "${shortname}" == "armar" ]; then + gamedirname="ArmaReforger" + fn_check_cfgdir + array_configs+=( server.json ) + fn_fetch_default_config + fn_default_config_remote + fn_set_config_vars + fn_list_config_locations elif [ "${shortname}" == "bo" ]; then gamedirname="BallisticOverkill" array_configs+=( config.txt ) From 74020fb111d11f29c86535ff017b540cbc2fd4c1 Mon Sep 17 00:00:00 2001 From: Marcin Jakubowski Date: Thu, 2 Jun 2022 23:00:11 +0200 Subject: [PATCH 041/161] fix(arma3): rework parsing of config (#3886) --- lgsm/functions/info_game.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lgsm/functions/info_game.sh b/lgsm/functions/info_game.sh index db769f820..88c27b4c9 100644 --- a/lgsm/functions/info_game.sh +++ b/lgsm/functions/info_game.sh @@ -72,10 +72,10 @@ fn_info_game_arma3(){ serverpassword="${unavailable}" maxplayers="${zero}" else - servername=$(grep "hostname" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/hostname//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - adminpassword=$(grep "passwordAdmin" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/passwordAdmin//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - serverpassword=$(grep "password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - maxplayers=$(grep "maxPlayers" "${servercfgfullpath}" | grep -v "//" | tr -cd '[:digit:]') + servername=$(sed -nr 's/^hostname\s*=\s*"(.*)"\s*;/\1/p' "${servercfgfullpath}") + adminpassword=$(sed -nr 's/^passwordAdmin\s*=\s*"(.*)"\s*;/\1/p' "${servercfgfullpath}") + serverpassword=$(sed -nr 's/^password\s*=\s*"(.*)"\s*;/\1/p' "${servercfgfullpath}") + maxplayers=$(sed -nr 's/^maxPlayers\s*=\s*([0-9]+)\s*;/\1/p' "${servercfgfullpath}") # Not set servername=${servername:-"NOT SET"} From f34bae849b279c53394848ea54c036c11502fc26 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Thu, 2 Jun 2022 22:15:00 +0100 Subject: [PATCH 042/161] Release v22.1.0 --- lgsm/functions/core_functions.sh | 2 +- linuxgsm.sh | 2 +- tests/tests_fctrserver.sh | 2 +- tests/tests_jc2server.sh | 2 +- tests/tests_mcserver.sh | 2 +- tests/tests_ts3server.sh | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lgsm/functions/core_functions.sh b/lgsm/functions/core_functions.sh index ad1307a73..67ed2a59b 100755 --- a/lgsm/functions/core_functions.sh +++ b/lgsm/functions/core_functions.sh @@ -8,7 +8,7 @@ functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" -modulesversion="v21.5.1" +modulesversion="v22.1.0" # Core diff --git a/linuxgsm.sh b/linuxgsm.sh index c56d3e284..43c388571 100755 --- a/linuxgsm.sh +++ b/linuxgsm.sh @@ -20,7 +20,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="v21.5.1" +version="v22.1.0" shortname="core" gameservername="core" commandname="CORE" diff --git a/tests/tests_fctrserver.sh b/tests/tests_fctrserver.sh index c5c80590c..6a074861c 100644 --- a/tests/tests_fctrserver.sh +++ b/tests/tests_fctrserver.sh @@ -20,7 +20,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="v21.5.1" +version="v22.1.0" shortname="fctr" gameservername="fctrserver" commandname="CORE" diff --git a/tests/tests_jc2server.sh b/tests/tests_jc2server.sh index 89867b5fa..4bdadb59f 100644 --- a/tests/tests_jc2server.sh +++ b/tests/tests_jc2server.sh @@ -20,7 +20,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="v21.5.1" +version="v22.1.0" shortname="jc2" gameservername="jc2server" commandname="CORE" diff --git a/tests/tests_mcserver.sh b/tests/tests_mcserver.sh index 347646789..f9e64e07c 100644 --- a/tests/tests_mcserver.sh +++ b/tests/tests_mcserver.sh @@ -20,7 +20,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="v21.5.1" +version="v22.1.0" shortname="mc" gameservername="mcserver" commandname="CORE" diff --git a/tests/tests_ts3server.sh b/tests/tests_ts3server.sh index 01a705086..bb149ded7 100644 --- a/tests/tests_ts3server.sh +++ b/tests/tests_ts3server.sh @@ -20,7 +20,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="v21.5.1" +version="v22.1.0" shortname="ts3" gameservername="ts3server" commandname="CORE" From 38592424c8c132f24d54541fc2f85d965eece27a Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Mon, 6 Jun 2022 22:11:47 +0100 Subject: [PATCH 043/161] rename Arch to Architecture --- lgsm/functions/command_debug.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lgsm/functions/command_debug.sh b/lgsm/functions/command_debug.sh index b6ab14fe8..086b06588 100755 --- a/lgsm/functions/command_debug.sh +++ b/lgsm/functions/command_debug.sh @@ -32,7 +32,7 @@ info_game.sh fn_print_header { echo -e "${lightblue}Distro:\t\t${default}${distroname}" - echo -e "${lightblue}Arch:\t\t${default}${arch}" + echo -e "${lightblue}Architecture:\t\t${default}${arch}" echo -e "${lightblue}Kernel:\t\t${default}${kernel}" echo -e "${lightblue}Hostname:\t\t${default}${HOSTNAME}" echo -e "${lightblue}tmux:\t\t${default}${tmuxv}" From fd4a8a4fb0ae971a18dd631edf01676b9cefd4c3 Mon Sep 17 00:00:00 2001 From: Neouni Date: Wed, 22 Jun 2022 23:24:19 +0200 Subject: [PATCH 044/161] fix(st): Networking and server rebuild update (#3898) Networking and the server has been rebuild from scratch many commands have been lost and shutdown has changed. # Description Added: servername Modified: startparameters changed, transfered over commands to new format. stopmode changed, it needs a quit command now in the console. Removed: clearinterval default.ini got removed, it's now all in setting.xml # Comment Server has been rebuild from scratch commands and dependencies have changed as a result. --- lgsm/config-default/config-lgsm/stserver/_default.cfg | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/lgsm/config-default/config-lgsm/stserver/_default.cfg b/lgsm/config-default/config-lgsm/stserver/_default.cfg index 8c0f0dbf9..5c66fcca4 100644 --- a/lgsm/config-default/config-lgsm/stserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/stserver/_default.cfg @@ -10,16 +10,17 @@ ## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters ip="0.0.0.0" +servername="LinuxGSM" port="27500" queryport="27015" worldtype="Moon" +maxplayers="10" autosaveinterval=300 -clearinterval=60 worldname="moon_save" ## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters # Edit with care -startparameters="-batchmode -nographics -autostart -gameport=${port} -updateport=${queryport} -worldtype=${worldtype} -loadworld=${worldname} -worldname=${worldname} -autosaveinterval=${autosaveinterval} -clearallinterval=${clearinterval}" +startparameters="-NEWGAME ${worldtype} -LOADGAME ${worldname} -settings ServerName ${servername} StartLocalHost true ServerVisible true ServerMaxPlayers ${maxplayers} GamePort ${port} UpdatePort ${queryport} UPNPEnabled true AutoSave true SaveInterval ${autosaveinterval}" #### LinuxGSM Settings #### @@ -139,7 +140,7 @@ steammaster="false" # 9: GoldSrc # 10: Avorion # 11: end -stopmode="2" +stopmode="3" ## Query mode # 1: session only @@ -168,8 +169,8 @@ systemdir="${serverfiles}" executabledir="${serverfiles}" executable="./rocketstation_DedicatedServer.x86_64" servercfgdir="${systemdir}" -servercfg="default.ini" -servercfgdefault="default.ini" +servercfg="setting.xml" +servercfgdefault="setting.xml" servercfgfullpath="${servercfgdir}/${servercfg}" ## Backup Directory From 1c771795aead59b846f59185aa62c05312a7db19 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Wed, 22 Jun 2022 23:20:56 +0100 Subject: [PATCH 045/161] update .editorconfig --- .editorconfig | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/.editorconfig b/.editorconfig index ef3ef8bd9..f20e02e1c 100644 --- a/.editorconfig +++ b/.editorconfig @@ -11,3 +11,18 @@ indent_size = 4 trim_trailing_whitespace = true end_of_line = lf insert_final_newline = true + +# YAML Files +[*.{yml,yaml}] +indent_size = 2 +indent_style = space + +# JSON Files +[*.{json,json5,webmanifest}] +indent_size = 2 +indent_style = space + +# BASH Files +[*.{.sh}] +indent_style = tab +indent_size = 4 From 635f4bce52ce15c76374561ee7b749dfd12f4076 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Wed, 22 Jun 2022 23:29:49 +0100 Subject: [PATCH 046/161] chore: use prettier for code tidy (#3901) * feat: start using prettier linter https://prettier.io/ * feat: prettier code formatting * feat: add super linter --- .gitattributes | 18 +- .github/ISSUE_TEMPLATE/bug-report.md | 32 +- .github/ISSUE_TEMPLATE/feature-request.md | 31 +- .github/ISSUE_TEMPLATE/new-server-request.md | 13 +- .github/dependabot.yml | 1 - .github/labeler.yml | 92 +- .github/pull_request_template.md | 31 +- .github/workflows/create-release.yml | 4 +- .github/workflows/git-sync.yml | 24 +- .github/workflows/labeler.yml | 16 +- .github/workflows/linter.yml | 55 ++ .github/workflows/lock.yml | 8 +- .github/workflows/potential-duplicates.yml | 4 +- .github/workflows/version-check.sh | 4 +- .github/workflows/version-check.yml | 10 +- CODE_OF_CONDUCT.md | 41 +- CONTRIBUTING.md | 142 +-- README.md | 22 +- lgsm/functions/README.md | 19 +- lgsm/functions/alert.sh | 86 +- lgsm/functions/alert_discord.sh | 3 +- lgsm/functions/alert_gotify.sh | 3 +- lgsm/functions/alert_ifttt.sh | 3 +- lgsm/functions/alert_mailgun.sh | 12 +- lgsm/functions/alert_pushbullet.sh | 3 +- lgsm/functions/alert_pushover.sh | 2 +- lgsm/functions/alert_rocketchat.sh | 3 +- lgsm/functions/alert_slack.sh | 3 +- lgsm/functions/alert_telegram.sh | 3 +- lgsm/functions/check.sh | 20 +- lgsm/functions/check_config.sh | 10 +- lgsm/functions/check_deps.sh | 91 +- lgsm/functions/check_ip.sh | 36 +- lgsm/functions/check_last_update.sh | 4 +- lgsm/functions/check_logs.sh | 6 +- lgsm/functions/check_permissions.sh | 60 +- lgsm/functions/check_status.sh | 2 +- lgsm/functions/check_system_requirements.sh | 6 +- lgsm/functions/check_tmuxception.sh | 6 +- lgsm/functions/check_version.sh | 2 +- lgsm/functions/command_backup.sh | 46 +- lgsm/functions/command_debug.sh | 6 +- lgsm/functions/command_details.sh | 4 +- lgsm/functions/command_dev_detect_deps.sh | 36 +- lgsm/functions/command_dev_detect_glibc.sh | 33 +- lgsm/functions/command_dev_detect_ldd.sh | 26 +- lgsm/functions/command_dev_query_raw.sh | 283 +++--- lgsm/functions/command_fastdl.sh | 67 +- .../command_install_resources_mta.sh | 2 +- lgsm/functions/command_mods_install.sh | 22 +- lgsm/functions/command_mods_remove.sh | 13 +- lgsm/functions/command_mods_update.sh | 14 +- lgsm/functions/command_monitor.sh | 184 ++-- lgsm/functions/command_postdetails.sh | 5 +- lgsm/functions/command_send.sh | 2 +- lgsm/functions/command_skeleton.sh | 2 +- lgsm/functions/command_start.sh | 31 +- lgsm/functions/command_stop.sh | 30 +- lgsm/functions/command_ts3_server_pass.sh | 4 +- lgsm/functions/command_update.sh | 2 +- lgsm/functions/command_update_linuxgsm.sh | 20 +- lgsm/functions/command_validate.sh | 2 +- lgsm/functions/command_wipe.sh | 26 +- lgsm/functions/core_dl.sh | 92 +- lgsm/functions/core_exit.sh | 6 +- lgsm/functions/core_functions.sh | 912 +++++++++--------- lgsm/functions/core_getopt.sh | 159 ++- lgsm/functions/core_github.sh | 18 +- lgsm/functions/core_legacy.sh | 4 +- lgsm/functions/core_logs.sh | 13 +- lgsm/functions/core_messages.sh | 150 +-- lgsm/functions/core_steamcmd.sh | 46 +- lgsm/functions/core_trap.sh | 2 +- lgsm/functions/fix.sh | 64 +- lgsm/functions/fix_ark.sh | 8 +- lgsm/functions/fix_arma3.sh | 2 +- lgsm/functions/fix_dst.sh | 2 +- lgsm/functions/fix_lo.sh | 10 +- lgsm/functions/fix_onset.sh | 2 +- lgsm/functions/fix_samp.sh | 4 +- lgsm/functions/fix_squad.sh | 2 +- lgsm/functions/fix_steamcmd.sh | 4 +- lgsm/functions/fix_tf2.sh | 2 +- lgsm/functions/fix_ts3.sh | 4 +- lgsm/functions/fix_vh.sh | 6 +- lgsm/functions/info_distro.sh | 67 +- lgsm/functions/info_game.sh | 282 +++--- lgsm/functions/info_messages.sh | 264 ++--- lgsm/functions/info_stats.sh | 6 +- lgsm/functions/install_config.sh | 238 ++--- lgsm/functions/install_eula.sh | 4 +- lgsm/functions/install_gslt.sh | 2 +- lgsm/functions/install_logs.sh | 2 +- lgsm/functions/install_retry.sh | 3 +- lgsm/functions/install_server_files.sh | 195 +++- lgsm/functions/install_ts3db.sh | 18 +- lgsm/functions/mods_core.sh | 142 +-- lgsm/functions/mods_list.sh | 106 +- lgsm/functions/query_gamedig.sh | 8 +- lgsm/functions/update_factorio.sh | 14 +- lgsm/functions/update_jediknight2.sh | 18 +- lgsm/functions/update_minecraft.sh | 14 +- lgsm/functions/update_minecraft_bedrock.sh | 18 +- lgsm/functions/update_mta.sh | 14 +- lgsm/functions/update_mumble.sh | 16 +- lgsm/functions/update_papermc.sh | 14 +- lgsm/functions/update_ts3.sh | 22 +- lgsm/functions/update_vintagestory.sh | 14 +- linuxgsm.sh | 72 +- tests/tests_defaultcfg/tests_defaultcfg.sh | 82 +- tests/tests_fctrserver.sh | 147 +-- tests/tests_jc2server.sh | 169 ++-- tests/tests_mcserver.sh | 151 +-- tests/tests_shellcheck.sh | 4 +- tests/tests_ts3server.sh | 147 +-- 115 files changed, 2893 insertions(+), 2663 deletions(-) create mode 100644 .github/workflows/linter.yml diff --git a/.gitattributes b/.gitattributes index bbe6490d1..cfa570e67 100644 --- a/.gitattributes +++ b/.gitattributes @@ -7,16 +7,16 @@ *.so.6 binary # Custom for Visual Studio -*.cs diff=csharp +*.cs diff=csharp # Standard to msysgit -*.doc diff=astextplain -*.DOC diff=astextplain +*.doc diff=astextplain +*.DOC diff=astextplain *.docx diff=astextplain *.DOCX diff=astextplain -*.dot diff=astextplain -*.DOT diff=astextplain -*.pdf diff=astextplain -*.PDF diff=astextplain -*.rtf diff=astextplain -*.RTF diff=astextplain +*.dot diff=astextplain +*.DOT diff=astextplain +*.pdf diff=astextplain +*.PDF diff=astextplain +*.rtf diff=astextplain +*.RTF diff=astextplain diff --git a/.github/ISSUE_TEMPLATE/bug-report.md b/.github/ISSUE_TEMPLATE/bug-report.md index 31d08d206..f0b071753 100644 --- a/.github/ISSUE_TEMPLATE/bug-report.md +++ b/.github/ISSUE_TEMPLATE/bug-report.md @@ -2,25 +2,26 @@ name: Bug Report about: Found a bug? Raise a report. title: "[BUG]" -labels: 'type: bug' -assignees: '' - +labels: "type: bug" +assignees: "" --- Issues raised here are **ONLY** for: -* LinuxGSM bugs. -* Feature suggestions. -* Code contributions. + +- LinuxGSM bugs. +- Feature suggestions. +- Code contributions. Issues raised here are **NOT** for: -* General support. -* Specific game server issues (e.g CS:GO, TF2). -* Dedicated server issues (e.g Ubuntu, CentOS). -* Anything not directly related to LinuxGSM development. + +- General support. +- Specific game server issues (e.g CS:GO, TF2). +- Dedicated server issues (e.g Ubuntu, CentOS). +- Anything not directly related to LinuxGSM development. For general support visit the **[LinuxGSM-Support](https://linuxgsm.com/support)**. -***Please use the template below, deleting the above text*** +**_Please use the template below, deleting the above text_** ## User Story @@ -28,10 +29,10 @@ As a [user description], I want [desired action] so that [desired outcome]. ## Basic info -* **Distro:** [Ubuntu 18.04] -* **Game:** [Garry's Mod] -* **Command:** [Monitor] -* **LinuxGSM version:** [v20.1.3] +- **Distro:** [Ubuntu 18.04] +- **Game:** [Garry's Mod] +- **Command:** [Monitor] +- **LinuxGSM version:** [v20.1.3] ## Further Information @@ -40,6 +41,7 @@ A clear description of what the bug is and any ideas on how to resolve it. Plus ## To Reproduce Steps to reproduce the behaviour: + 1. Go to '...' 2. Click on '....' 3. Scroll down to '....' diff --git a/.github/ISSUE_TEMPLATE/feature-request.md b/.github/ISSUE_TEMPLATE/feature-request.md index 8ba27fa9f..992178f07 100644 --- a/.github/ISSUE_TEMPLATE/feature-request.md +++ b/.github/ISSUE_TEMPLATE/feature-request.md @@ -2,25 +2,26 @@ name: Feature Request about: Suggest an idea for LinuxGSM. title: "[FEATURE]" -labels: 'type: feature request' -assignees: '' - +labels: "type: feature request" +assignees: "" --- Issues raised here are **ONLY** for: -* LinuxGSM bugs. -* Feature suggestions. -* Code contributions. + +- LinuxGSM bugs. +- Feature suggestions. +- Code contributions. Issues raised here are **NOT** for: -* General support. -* Specific game server issues (e.g CS:GO, TF2). -* Dedicated server issues (e.g Ubuntu, CentOS). -* Anything not directly related to LinuxGSM development. + +- General support. +- Specific game server issues (e.g CS:GO, TF2). +- Dedicated server issues (e.g Ubuntu, CentOS). +- Anything not directly related to LinuxGSM development. For general support visit the **[LinuxGSM Support](https://linuxgsm.com/support)** page. -***Please use the template below, deleting the above text*** +**_Please use the template below, deleting the above text_** ## User Story @@ -28,10 +29,10 @@ As a [user description], I want [desired action] so that [desired outcome]. ## Basic info -* **Distro:** [Ubuntu 20.04] -* **Game:** [Garry's Mod] -* **Command:** [Monitor] -* **LinuxGSM version:** [v20.1.3] +- **Distro:** [Ubuntu 20.04] +- **Game:** [Garry's Mod] +- **Command:** [Monitor] +- **LinuxGSM version:** [v20.1.3] ## Further Information diff --git a/.github/ISSUE_TEMPLATE/new-server-request.md b/.github/ISSUE_TEMPLATE/new-server-request.md index 57bee9cbe..bedc4f506 100644 --- a/.github/ISSUE_TEMPLATE/new-server-request.md +++ b/.github/ISSUE_TEMPLATE/new-server-request.md @@ -2,9 +2,8 @@ name: New Server Request about: Suggest a new game server to be added. title: "[Server Request]" -labels: 'type: game server request' -assignees: '' - +labels: "type: game server request" +assignees: "" --- ## What game server would you like to add? @@ -17,8 +16,8 @@ Provide any useful documentation or resources that might help. ## Is the server on Steam? -* [ ] Yes -* [ ] No +- [ ] Yes +- [ ] No If yes Use SteamDB to get the appid. (https://steamdb.info). @@ -28,5 +27,5 @@ If yes Use SteamDB to get the appid. (https://steamdb.info). We only support Linux servers and do **not** support Wine. -* [ ] Yes -* [ ] No +- [ ] Yes +- [ ] No diff --git a/.github/dependabot.yml b/.github/dependabot.yml index c39f10ad4..443cf3bec 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -1,7 +1,6 @@ # Set update schedule for GitHub Actions version: 2 updates: - - package-ecosystem: "github-actions" directory: "/" schedule: diff --git a/.github/labeler.yml b/.github/labeler.yml index 5cd6740d4..0ceeeae72 100644 --- a/.github/labeler.yml +++ b/.github/labeler.yml @@ -1,98 +1,98 @@ # Add/remove 'critical' label if issue contains the words 'urgent' or 'critical' # Type "type: game server request": - - '/(Server Request)/i' + - "/(Server Request)/i" "type: bug": - - '/(bug)/i' + - "/(bug)/i" "type: feature request": - - '/(feature)/i' + - "/(feature)/i" # Commands "command: backup": - - '/(backup)/i' + - "/(backup)/i" "command: console": - - '/(console|tmux)/i' + - "/(console|tmux)/i" "command: debug": - - '/(debug)/i' + - "/(debug)/i" "command: details": - - '/(details)/i' + - "/(details)/i" "command: fast-dl": - - '/(fast-dl|fastdl)/i' + - "/(fast-dl|fastdl)/i" "command: install": - - '/(install)/i' + - "/(install)/i" "command: mods": - - '/(mods)/i' + - "/(mods)/i" "command: monitor": - - '/(monitor)/i' + - "/(monitor)/i" "command: post-details": - - '/(post-details)/i' + - "/(post-details)/i" "command: restart": - - '/(restart)/i' + - "/(restart)/i" "command: send": - - '/(send)/i' + - "/(send)/i" "command: skeleton": - - '/(skeleton)/i' + - "/(skeleton)/i" "command: start": - - '/(start)/i' + - "/(start)/i" "command: stop": - - '/(stop)/i' + - "/(stop)/i" "command: update-lgsm": - - '/(update-lgsm)/i' + - "/(update-lgsm)/i" "command: update": - - '/(update)/i' + - "/(update)/i" "command: validate": - - '/(validate)/i' + - "/(validate)/i" "command: wipe": - - '/(wipe)/i' + - "/(wipe)/i" # Distros "distro: AlmaLinux": - - '/(Alma)/i' + - "/(Alma)/i" "distro: Arch Linux": - - '/(Arch)/i' + - "/(Arch)/i" "distro: CentOS": - - '/(CentOS)/i' + - "/(CentOS)/i" "distro: Debian": - - '/(Debian)/i' + - "/(Debian)/i" "distro: Fedora": - - '/(Fedora)/i' + - "/(Fedora)/i" "distro: openSUSE": - - '/(openSUSE|suse)/i' + - "/(openSUSE|suse)/i" "distro: Rocky Linux": - - '/(Rocky)/i' + - "/(Rocky)/i" "distro: Slackware": - - '/(Slackware)/i' + - "/(Slackware)/i" "distro: Ubuntu": - - '/(Ubuntu)/i' + - "/(Ubuntu)/i" # Info "info: alerts": - - '/(alert)/i' + - "/(alert)/i" "info: dependency": - - '/(dependency|deps)/i' + - "/(dependency|deps)/i" "info: docker": - - '/(docker)/i' + - "/(docker)/i" "info: docs": - - '/(documentation|docs)/i' + - "/(documentation|docs)/i" "info: email": - - '/(postfix|sendmail|exim|smtp)/i' + - "/(postfix|sendmail|exim|smtp)/i" "info: query": - - '/(gamedig|gsquery)/i' + - "/(gamedig|gsquery)/i" "info: steamcmd": - - '/(steamcmd)/i' + - "/(steamcmd)/i" "info: systemd": - - '/(systemd)/i' + - "/(systemd)/i" "info: tmux": - - '/(tmux)/i' + - "/(tmux)/i" "info: website": - - '/(website)/i' + - "/(website)/i" # Games "game: Ark: Survival Evolved": - - '/(Ark: Survival Evolved|Ark)/i' + - "/(Ark: Survival Evolved|Ark)/i" "game: ARMA 3": - - '/(ARMA 3)/i' + - "/(ARMA 3)/i" "game: Assetto Corsa": - - '/(Assetto Corsa)/i' + - "/(Assetto Corsa)/i" "game: Avorion": - - '/(Avorion)/i' + - "/(Avorion)/i" "game: Ballistic Overkill": - - '/(Ballistic Overkill)/i' + - "/(Ballistic Overkill)/i" "game: Barotrauma": - - '/(Barotrauma)/i' + - "/(Barotrauma)/i" diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index af1c7faba..a0c40a150 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -6,29 +6,30 @@ Fixes #[issue] ## Type of change -* [ ] Bug fix (a change which fixes an issue). -* [ ] New feature (change which adds functionality). -* [ ] New Server (new server added). -* [ ] Refactor (restructures existing code). -* [ ] Comment update (typo, spelling, explanation, examples, etc). +- [ ] Bug fix (a change which fixes an issue). +- [ ] New feature (change which adds functionality). +- [ ] New Server (new server added). +- [ ] Refactor (restructures existing code). +- [ ] Comment update (typo, spelling, explanation, examples, etc). ## Checklist PR will not be merged until all steps are complete. -* [ ] This pull request links to an issue. -* [ ] This pull request uses the `develop` branch as its base. -* [ ] This pull request Subject follows the Conventional Commits standard. -* [ ] This code follows the style guidelines of this project. -* [ ] I have performed a self-review of my code. -* [ ] I have checked that this code is commented where required. -* [ ] I have provided a detailed with enough description of this PR. -* [ ] I have checked If documentation needs updating. +- [ ] This pull request links to an issue. +- [ ] This pull request uses the `develop` branch as its base. +- [ ] This pull request Subject follows the Conventional Commits standard. +- [ ] This code follows the style guidelines of this project. +- [ ] I have performed a self-review of my code. +- [ ] I have checked that this code is commented where required. +- [ ] I have provided a detailed with enough description of this PR. +- [ ] I have checked If documentation needs updating. ## Documentation If documentation does need updating either update it by creating a PR (preferred) or request a documentation update. -* User docs: https://github.com/GameServerManagers/LinuxGSM-Docs -* Dev docs: https://github.com/GameServerManagers/LinuxGSM-Dev-Docs + +- User docs: https://github.com/GameServerManagers/LinuxGSM-Docs +- Dev docs: https://github.com/GameServerManagers/LinuxGSM-Dev-Docs **Thank you for your Pull Request!** diff --git a/.github/workflows/create-release.yml b/.github/workflows/create-release.yml index fcc7fc837..ec426478a 100644 --- a/.github/workflows/create-release.yml +++ b/.github/workflows/create-release.yml @@ -11,8 +11,8 @@ permissions: jobs: update_release_draft: permissions: - contents: write # for release-drafter/release-drafter to create a github release - pull-requests: write # for release-drafter/release-drafter to add label to PR + contents: write # for release-drafter/release-drafter to create a github release + pull-requests: write # for release-drafter/release-drafter to add label to PR runs-on: ubuntu-latest steps: # Drafts your next Release notes as Pull Requests are merged into "master" diff --git a/.github/workflows/git-sync.yml b/.github/workflows/git-sync.yml index fb0b3c477..b43996dc6 100644 --- a/.github/workflows/git-sync.yml +++ b/.github/workflows/git-sync.yml @@ -10,16 +10,16 @@ jobs: GitHub-to-Bitbucket: runs-on: ubuntu-latest steps: - - name: webfactory/ssh-agent@v0.5.4 - uses: webfactory/ssh-agent@v0.5.4 - with: - ssh-private-key: ${{ secrets.BITBUCKET_SECRET }} + - name: webfactory/ssh-agent@v0.5.4 + uses: webfactory/ssh-agent@v0.5.4 + with: + ssh-private-key: ${{ secrets.BITBUCKET_SECRET }} - - name: wei/git-sync@v3.0.0 - uses: wei/git-sync@v3.0.0 - with: - ssh_private_key: ${{ secrets.BITBUCKET_SECRET }} - source_repo: "https://github.com/GameServerManagers/LinuxGSM" - source_branch: "refs/heads/*" - destination_repo: "git@bitbucket.org:GameServerManagers/linuxgsm.git" - destination_branch: "refs/heads/*" + - name: wei/git-sync@v3.0.0 + uses: wei/git-sync@v3.0.0 + with: + ssh_private_key: ${{ secrets.BITBUCKET_SECRET }} + source_repo: "https://github.com/GameServerManagers/LinuxGSM" + source_branch: "refs/heads/*" + destination_repo: "git@bitbucket.org:GameServerManagers/linuxgsm.git" + destination_branch: "refs/heads/*" diff --git a/.github/workflows/labeler.yml b/.github/workflows/labeler.yml index c5ea01d0a..40da37492 100644 --- a/.github/workflows/labeler.yml +++ b/.github/workflows/labeler.yml @@ -9,13 +9,13 @@ permissions: jobs: triage: permissions: - contents: read # for github/issue-labeler to get repo contents - issues: write # for github/issue-labeler to create or remove labels + contents: read # for github/issue-labeler to get repo contents + issues: write # for github/issue-labeler to create or remove labels runs-on: ubuntu-latest steps: - - uses: github/issue-labeler@v2.4 - with: - repo-token: "${{ secrets.GITHUB_TOKEN }}" - configuration-path: .github/labeler.yml - not-before: - enable-versioned-regex: 0 + - uses: github/issue-labeler@v2.4 + with: + repo-token: "${{ secrets.GITHUB_TOKEN }}" + configuration-path: .github/labeler.yml + not-before: + enable-versioned-regex: 0 diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml new file mode 100644 index 000000000..7f34c51b6 --- /dev/null +++ b/.github/workflows/linter.yml @@ -0,0 +1,55 @@ +--- +################################# +################################# +## Super Linter GitHub Actions ## +################################# +################################# +name: Lint Code Base + +# +# Documentation: +# https://docs.github.com/en/actions/learn-github-actions/workflow-syntax-for-github-actions +# + +############################# +# Start the job on all push # +############################# +on: + push: + branches-ignore: [master, main] + # Remove the line above to run when pushing to master + pull_request: + +############### +# Set the Job # +############### +jobs: + build: + # Name the Job + name: Lint Code Base + # Set the agent to run on + runs-on: ubuntu-latest + + ################## + # Load all steps # + ################## + steps: + ########################## + # Checkout the code base # + ########################## + - name: Checkout Code + uses: actions/checkout@v2 + with: + # Full git history is needed to get a proper list of changed files within `super-linter` + fetch-depth: 0 + + ################################ + # Run Linter against code base # + ################################ + - name: Lint Code Base + uses: github/super-linter@v4 + env: + VALIDATE_ALL_CODEBASE: false + # Change to 'master' if your main branch differs + DEFAULT_BRANCH: main + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/lock.yml b/.github/workflows/lock.yml index 7c17c56bf..320b851a1 100644 --- a/.github/workflows/lock.yml +++ b/.github/workflows/lock.yml @@ -1,8 +1,8 @@ -name: 'Lock Threads' +name: "Lock Threads" on: schedule: - - cron: '0 0 * * *' + - cron: "0 0 * * *" permissions: contents: read @@ -10,8 +10,8 @@ permissions: jobs: lock: permissions: - issues: write # for dessant/lock-threads to lock issues - pull-requests: write # for dessant/lock-threads to lock PRs + issues: write # for dessant/lock-threads to lock issues + pull-requests: write # for dessant/lock-threads to lock PRs runs-on: ubuntu-latest steps: - uses: dessant/lock-threads@v3 diff --git a/.github/workflows/potential-duplicates.yml b/.github/workflows/potential-duplicates.yml index 8c9fe7cc7..47356dba8 100644 --- a/.github/workflows/potential-duplicates.yml +++ b/.github/workflows/potential-duplicates.yml @@ -12,9 +12,9 @@ jobs: # Issue title filter work with anymatch https://www.npmjs.com/package/anymatch. # Any matched issue will stop detection immediately. # You can specify multi filters in each line. - filter: '' + filter: "" # Exclude keywords in title before detecting. - exclude: '' + exclude: "" # Label to set, when potential duplicates are detected. label: potential-duplicate # Get issues with state to compare. Supported state: 'all', 'closed', 'open'. diff --git a/.github/workflows/version-check.sh b/.github/workflows/version-check.sh index 44215385d..f470fd02b 100644 --- a/.github/workflows/version-check.sh +++ b/.github/workflows/version-check.sh @@ -1,5 +1,5 @@ -version=$(grep "version=" linuxgsm.sh | sed -e 's/version//g'| tr -d '="') -modulesversion=$(grep "modulesversion=" lgsm/functions/core_functions.sh | sed -e 's/modulesversion//g'| tr -d '="') +version=$(grep "version=" linuxgsm.sh | sed -e 's/version//g' | tr -d '="') +modulesversion=$(grep "modulesversion=" lgsm/functions/core_functions.sh | sed -e 's/modulesversion//g' | tr -d '="') if [ "${version}" != "${modulesversion}" ]; then echo "Error! LinuxGSM version mismatch" diff --git a/.github/workflows/version-check.yml b/.github/workflows/version-check.yml index 4c06d86d7..b2aac2f87 100644 --- a/.github/workflows/version-check.yml +++ b/.github/workflows/version-check.yml @@ -18,9 +18,9 @@ jobs: # Steps represent a sequence of tasks that will be executed as part of the job steps: - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v3 + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - uses: actions/checkout@v3 - # Runs a single command using the runners shell - - name: compare versions - run: chmod +x .github/workflows/version-check.sh; .github/workflows/version-check.sh + # Runs a single command using the runners shell + - name: compare versions + run: chmod +x .github/workflows/version-check.sh; .github/workflows/version-check.sh diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md index 65a0143f5..a69325281 100644 --- a/CODE_OF_CONDUCT.md +++ b/CODE_OF_CONDUCT.md @@ -1,4 +1,3 @@ - # Contributor Covenant Code of Conduct ## Our Pledge @@ -18,24 +17,24 @@ diverse, inclusive, and healthy community. Examples of behavior that contributes to a positive environment for our community include: -* Demonstrating empathy and kindness toward other people -* Being respectful of differing opinions, viewpoints, and experiences -* Giving and gracefully accepting constructive feedback -* Accepting responsibility and apologizing to those affected by our mistakes, - and learning from the experience -* Focusing on what is best not just for us as individuals, but for the - overall community +- Demonstrating empathy and kindness toward other people +- Being respectful of differing opinions, viewpoints, and experiences +- Giving and gracefully accepting constructive feedback +- Accepting responsibility and apologizing to those affected by our mistakes, + and learning from the experience +- Focusing on what is best not just for us as individuals, but for the + overall community Examples of unacceptable behavior include: -* The use of sexualized language or imagery, and sexual attention or - advances of any kind -* Trolling, insulting or derogatory comments, and personal or political attacks -* Public or private harassment -* Publishing others' private information, such as a physical or email - address, without their explicit permission -* Other conduct which could reasonably be considered inappropriate in a - professional setting +- The use of sexualized language or imagery, and sexual attention or + advances of any kind +- Trolling, insulting or derogatory comments, and personal or political attacks +- Public or private harassment +- Publishing others' private information, such as a physical or email + address, without their explicit permission +- Other conduct which could reasonably be considered inappropriate in a + professional setting ## Enforcement Responsibilities @@ -107,7 +106,7 @@ Violating these terms may lead to a permanent ban. ### 4. Permanent Ban **Community Impact**: Demonstrating a pattern of violation of community -standards, including sustained inappropriate behavior, harassment of an +standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals. **Consequence**: A permanent ban from any sort of public interaction within @@ -120,14 +119,14 @@ version 2.1, available at [https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1]. Community Impact Guidelines were inspired by -[Mozilla's code of conduct enforcement ladder][Mozilla CoC]. +[Mozilla's code of conduct enforcement ladder][mozilla coc]. For answers to common questions about this code of conduct, see the FAQ at -[https://www.contributor-covenant.org/faq][FAQ]. Translations are available +[https://www.contributor-covenant.org/faq][faq]. Translations are available at [https://www.contributor-covenant.org/translations][translations]. [homepage]: https://www.contributor-covenant.org [v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html -[Mozilla CoC]: https://github.com/mozilla/diversity -[FAQ]: https://www.contributor-covenant.org/faq +[mozilla coc]: https://github.com/mozilla/diversity +[faq]: https://www.contributor-covenant.org/faq [translations]: https://www.contributor-covenant.org/translations diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 1a2d7a3c8..7b549c795 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -6,32 +6,33 @@ The following is a set of guidelines for contributing to LinuxGSM, which are hos ## Table of Contents - [Contributing to LinuxGSM](#contributing-to-linuxgsm) - * [Table of Contents](#table-of-contents) - * [Code of Conduct](#code-of-conduct) - * [🎉 Bug/Enhancement Contributions 🐛](#bug-enhancement-contributions) - + [🐛Reporting Bugs](#reporting-bugs) - - [Before Submitting A Bug Report](#before-submitting-a-bug-report) - - [How Do I Submit A (Good) Bug Report?](#how-do-i-submit-a--good--bug-report-) - + [🎉Suggesting Features](#suggesting-features) - - [Before Submitting An Feature Suggestion](#before-submitting-an-feature-suggestion) - - [How Do I Submit A (Good) Feature Suggestion?](#how-do-i-submit-a--good--feature-suggestion-) - + [🎮 Game Server Requests](#game-server-requests) - - [Before Submitting a Game Server Request](#before-submitting-a-game-server-request) - - [How Do I Submit A (Good) Game Server Request?](#how-do-i-submit-a--good--game-server-request-) - + [🎮 Game Server Specific Issues](#game-server-specific-issues) - * [💻 Code Contributions](#code-contributions) - + [Pull Requests](#pull-requests) - - [Pull Request naming convention](#pull-request-naming-convention) - + [Testing](#testing) - - [Pull Request Status Checks](#pull-request-status-checks) - - [Test Environment](#test-environment) - + [:wine_glass: Styleguides](#-wine-glass--styleguides) - - [Git Commit Messages](#git-commit-messages) - - [BASH Styleguide](#bash-styleguide) - * [:blue_book: Document Contributions](#-blue-book--document-contributions) - + [Documentation Styleguide](#documentation-styleguide) - * [Issue and Pull Request Labels](#issue-and-pull-request-labels) +[Contributing to LinuxGSM](#contributing-to-linuxgsm) + +- [Table of Contents](#table-of-contents) +- [Code of Conduct](#code-of-conduct) +- [🎉 Bug/Enhancement Contributions 🐛](#bug-enhancement-contributions) + - [🐛Reporting Bugs](#reporting-bugs) + - [Before Submitting A Bug Report](#before-submitting-a-bug-report) + - [How Do I Submit A (Good) Bug Report?](#how-do-i-submit-a--good--bug-report-) + - [🎉Suggesting Features](#suggesting-features) + - [Before Submitting An Feature Suggestion](#before-submitting-an-feature-suggestion) + - [How Do I Submit A (Good) Feature Suggestion?](#how-do-i-submit-a--good--feature-suggestion-) + - [🎮 Game Server Requests](#game-server-requests) + - [Before Submitting a Game Server Request](#before-submitting-a-game-server-request) + - [How Do I Submit A (Good) Game Server Request?](#how-do-i-submit-a--good--game-server-request-) + - [🎮 Game Server Specific Issues](#game-server-specific-issues) +- [💻 Code Contributions](#code-contributions) + - [Pull Requests](#pull-requests) + - [Pull Request naming convention](#pull-request-naming-convention) + - [Testing](#testing) + - [Pull Request Status Checks](#pull-request-status-checks) + - [Test Environment](#test-environment) + - [:wine_glass: Styleguides](#-wine-glass--styleguides) + - [Git Commit Messages](#git-commit-messages) + - [BASH Styleguide](#bash-styleguide) +- [:blue_book: Document Contributions](#-blue-book--document-contributions) + - [Documentation Styleguide](#documentation-styleguide) +- [Issue and Pull Request Labels](#issue-and-pull-request-labels) ## Code of Conduct @@ -43,24 +44,24 @@ This project and everyone participating in it is governed by the [LinuxGSM Code This section guides you through submitting a bug report for LinuxGSM. Following these guidelines help maintainers and the community understand your report 📝, reproduce the behaviour💻, and find any related reports 🔎. -Before creating bug reports, please check [this list](https://github.com/GameServerManagers/linuxgsm/blob/master/CONTRIBUTING.md#before-submitting-a-bug-report) as you might find out that you don’t need to create one. When you are creating a bug report, please [include as many details as possible](https://github.com/GameServerManagers/linuxgsm/blob/master/CONTRIBUTING.md#how-do-i-submit-a-good-bug-report). Fill out [the required template]([https://github.com/GameServerManagers/LinuxGSM/issues/new/choose](https://github.com/GameServerManagers/LinuxGSM/issues/new/choose)), the information it asks for helps us resolve issues faster. +Before creating bug reports, please check [this list](https://github.com/GameServerManagers/linuxgsm/blob/master/CONTRIBUTING.md#before-submitting-a-bug-report) as you might find out that you don’t need to create one. When you are creating a bug report, please [include as many details as possible](https://github.com/GameServerManagers/linuxgsm/blob/master/CONTRIBUTING.md#how-do-i-submit-a-good-bug-report). Fill out [the required template](<[https://github.com/GameServerManagers/LinuxGSM/issues/new/choose](https://github.com/GameServerManagers/LinuxGSM/issues/new/choose)>), the information it asks for helps us resolve issues faster. #### Before Submitting A Bug Report -* **Check the [documentation](https://docs.linuxgsm.com).** You might be able to find the cause of the problem and fix things yourself. -* **Check the** [**support page**](https://linuxgsm.com/support) for links to other support options. -* **Perform a** [**cursory search**](https://github.com/search?q=org:GameServerManagers%20type:issues&type=Issues) to see if the problem has already been reported. If it has **and the issue is still open**, add a comment to the existing issue and give it a thumbs up instead of opening a new one. +- **Check the [documentation](https://docs.linuxgsm.com).** You might be able to find the cause of the problem and fix things yourself. +- **Check the** [**support page**](https://linuxgsm.com/support) for links to other support options. +- **Perform a** [**cursory search**](https://github.com/search?q=org:GameServerManagers%20type:issues&type=Issues) to see if the problem has already been reported. If it has **and the issue is still open**, add a comment to the existing issue and give it a thumbs up instead of opening a new one. #### How Do I Submit A (Good) Bug Report? Bugs are tracked as [GitHub issues](https://guides.github.com/features/issues/). Create an issue and provide the following information by filling in [the issues form](https://github.com/GameServerManagers/LinuxGSM/issues/new/choose). -* **Use a clear and descriptive title** for the issue to identify the problem. -* **Complete the user story** to give a summary of the issue. -* **Provide basic info** to help us understand the context of the issue. -* **Provide further info** to give specifics and more detail. -* **Give steps to reproduce** the issue, allowing developers to follow steps that lead to the issue. -* **Explain what you expect** to happen, so we know what you think should occur. +- **Use a clear and descriptive title** for the issue to identify the problem. +- **Complete the user story** to give a summary of the issue. +- **Provide basic info** to help us understand the context of the issue. +- **Provide further info** to give specifics and more detail. +- **Give steps to reproduce** the issue, allowing developers to follow steps that lead to the issue. +- **Explain what you expect** to happen, so we know what you think should occur. ### 🎉Suggesting Features @@ -68,31 +69,34 @@ This section guides you through submitting a feature suggestion for LinuxGSM, in #### Before Submitting An Feature Suggestion -* **Check the** [**documentation**](https://docs.linuxgsm.com/%5D(https://docs.linuxgsm.com/)) to confirm that the enhancement doesn’t already exist. -* **Check your** [**LinuxGSM version**](https://docs.linuxgsm.com/commands/update-lgsm)**.** A newer version of LinuxGSM may already have your enhancement. -* **Perform a** [**cursory search**](https://github.com/search?q=org:GameServerManagers%20type:issues&type=Issues) to see if the enhancement has already been suggested. If it has **and the enhancement is still open**, add a comment to the existing issue and give it a thumbs up instead of opening a new one. +- **Check the** [**documentation**]() to confirm that the enhancement doesn’t already exist. +- **Check your** [**LinuxGSM version**](https://docs.linuxgsm.com/commands/update-lgsm)**.** A newer version of LinuxGSM may already have your enhancement. +- **Perform a** [**cursory search**](https://github.com/search?q=org:GameServerManagers%20type:issues&type=Issues) to see if the enhancement has already been suggested. If it has **and the enhancement is still open**, add a comment to the existing issue and give it a thumbs up instead of opening a new one. #### How Do I Submit A (Good) Feature Suggestion? Features are tracked as [GitHub issues](https://guides.github.com/features/issues/). Create an issue and provide the following information by filling in [the issues form](https://github.com/GameServerManagers/LinuxGSM/issues/new/choose). -* **Use a clear and descriptive title** for the issue to identify the problem. -* **Complete the user story** to give a summary of the issue. -* **Provide basic info** to help us understand the context of the enhancement. -* **Provide further info** to give specifics and more detail. -* **Provide any further reading** materials that might assist in developing the enhancement. +- **Use a clear and descriptive title** for the issue to identify the problem. +- **Complete the user story** to give a summary of the issue. +- **Provide basic info** to help us understand the context of the enhancement. +- **Provide further info** to give specifics and more detail. +- **Provide any further reading** materials that might assist in developing the enhancement. ### 🎮 Game Server Requests This section guides you through submitting a game server request for LinuxGSM, Following these guidelines help maintainers and the community understand your game server request 📝. + #### Before Submitting a Game Server Request -* **Check for existing** [**game server requests**](https://github.com/GameServerManagers/LinuxGSM/labels/type%3A%20game%20server%20request) to see if the new game server has already been suggested. If it has **and if the new game server is still open**, give it a thumbs up. -* **Check the game server is supported on Linux**, this does not include Wine servers which we do not support. +- **Check for existing** [**game server requests**](https://github.com/GameServerManagers/LinuxGSM/labels/type%3A%20game%20server%20request) to see if the new game server has already been suggested. If it has **and if the new game server is still open**, give it a thumbs up. +- **Check the game server is supported on Linux**, this does not include Wine servers which we do not support. + #### How Do I Submit A (Good) Game Server Request? -* The title should be as follows: **[Server Request] Game Name** -* **Provide Steam App ID** if applicable -* **Supply any documentation/how-to guides** for the game server. + +- The title should be as follows: **[Server Request] Game Name** +- **Provide Steam App ID** if applicable +- **Supply any documentation/how-to guides** for the game server. ### 🎮 Game Server Specific Issues @@ -110,10 +114,10 @@ A [list](https://docs.linuxgsm.com/support/game-server) of known game developer The process described here has several goals: -* Maintain LinuxGSM quality. -* Fix problems that are important to users. -* Engage the community in working toward the best possible LinuxGSM. -* Enable a sustainable system for LinuxGSM maintainers to review contributions. +- Maintain LinuxGSM quality. +- Fix problems that are important to users. +- Engage the community in working toward the best possible LinuxGSM. +- Enable a sustainable system for LinuxGSM maintainers to review contributions. Please follow these steps to have your contribution considered by the maintainers: @@ -135,18 +139,18 @@ If applied, this commit will _your subject line here_ For example: -* If applied, this commit will **refactor subsystem X for readability** -* If applied, this commit will **update getting started documentation** -* If applied, this commit will **remove deprecated methods** -* If applied, this commit will **release version 1.0.0** -* If applied, this commit will **merge pull request #123 from user/branch** +- If applied, this commit will **refactor subsystem X for readability** +- If applied, this commit will **update getting started documentation** +- If applied, this commit will **remove deprecated methods** +- If applied, this commit will **release version 1.0.0** +- If applied, this commit will **merge pull request #123 from user/branch** Notice how this doesn’t work for the other non-imperative forms: -* If applied, this commit will **fixed bug with Y** -* If applied, this commit will **change the behaviour of X** -* If applied, this commit will **more fixes for broken stuff** -* If applied, this commit will **sweet new API methods** +- If applied, this commit will **fixed bug with Y** +- If applied, this commit will **change the behaviour of X** +- If applied, this commit will **more fixes for broken stuff** +- If applied, this commit will **sweet new API methods** Below is an example of the subject line for a pull request: @@ -157,10 +161,13 @@ Below is an example of the subject line for a pull request: ### Testing #### Pull Request Status Checks -When a Pull Request is submitted, a series of status check tests are conducted. These tests will assess the code quality, complete CI tests etc. To get your PR merged these status checks must pass. + +When a Pull Request is submitted, a series of status check tests are conducted. These tests will assess the code quality, complete CI tests etc. To get your PR merged these status checks must pass. #### Test Environment + It is recommended that you have a testing environment available to test your code during development. To test your own code you must change some variables within the `linuxgsm.sh` file. This will force the use of your own code branch. + ```bash ## GitHub Branch Select # Allows for the use of different function files @@ -203,10 +210,11 @@ Highlights the LinuxGSM command the Issue/PR relates to. Labels to help pinpoint what the issue or PR relates to. variants: -* _distro_ -* _engine_ -* _game_ -* _info_ + +- _distro_ +- _engine_ +- _game_ +- _info_ **outcome** Labels Labels that identify why an issue was closed. diff --git a/README.md b/README.md index 5164e0b86..70f3b9365 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ LinuxGSM -[![LinuxGSM](https://img.shields.io/badge/-LinuxGSM-2b2b2b.svg?logo=data%3Aimage%2Fpng%3Bbase64%2CiVBORw0KGgoAAAANSUhEUgAAACsAAABACAYAAACDbo5ZAAAGD0lEQVR4AcWYa2wUVRvHz75c2vJ2disXoUBEVIioRAx%2BMIFA1IRwUS6KCCiIKBrvhEYiiGm5iBgk8QOGEgUUDYTttmVZWFr2UmwURS6iYAoCtmisElSsdHdbkT7%2BTzoNy%2BGc2dm54C%2F5Rdkz85x%2FZ86ZOXOYXYhIg3Phx%2FA4PAcv6f%2Btg5vhHJjP3EcZsgsshufJHH%2FAJbDztQ7aG35J1vgCXn%2BtgvrgEbLHYei9FmE3kDOUuh10OGwjZ7gEh7kZ9gNyllK3gnrg7%2BQs56DHjbCDyB0GuRF2ArnDeDfCziF3mO1G2FfJHRa4EXYpuUOxG2GXkzuUuBH2TXKH5W6ELSV3eM%2BNsOUk5yQcAY8p2uvgSPitor3MjbB1UOQXOFBvHwpbhPYWOExvL4SNUOQ7p4P2JTlzhOPmCu0vCu1PQpE2WOhk2MdJjk9y7HNwP1wEPUJbAcmZ6WTYrYolnifbxZBiibnFySHQCkUaLdY7C0V4%2FT5OhF1JcuIW6%2B0lOcvsBi2Ezao3j8Ov7Quwj52w60jNKIs1R5GatVaDDoEXSU4D7GSxbidYT3IuwjusFK0mNUVMwaZNNbl%2B%2F87hoVCom0HthaQmnG3QB0lNPcxlCvz%2B0GtlZTuorCxYYlA%2FDzbY%2FnrAgV3hCVLzCDMgEAi9wMMi9IIM%2FUwnNXWwi5mwRaSmmmXA798xq%2F3Khp420VeE1LyS6eQeBhttSXgzywCCToIUCOyYZvKLOWWwkdfd6ORVpGYJM0F5efDe9mEQHGty2BWTmhVGO4PNBmOoKzMBxmo%2FhD25dWvljSbD5hjMkb9gT9lJq63Mzi1bKkbjloc7xBWtwiRrDASCVRi%2FRxA8if%2BvrawMTzYI%2FACpeUv2KFFtDcUyTKilCHcis8G1Ga7wHpLzG8wVFs1K7jaeUKHZfIxmkj9%2FM4S9x9RGiMEudo0QbCVu9Xqn5PWEwLUk5%2FP0iaXac53I0kAH9Sau4m54lo%2FdTMfyekLYKQZ7ub34AbMMlmw5irC2VYTN0fuVMYMf8JHxJ7L7YYXAlSRnI2%2F8RtH4siTsDMz%2BZ5yS15OEXUxyDjGD1%2BvEq8MG16CDzY6JepKwT6geYbzxb0XjGMl7vwGSgzZIwo4nOa1M8Yr9Afb%2Fj8L21%2FsXaeaNZ2A6KTiEASph%2F0vF80cn4tokqu79fzfCUk2vfF4%2FFdFGEjGPHvg2yWrsDG%2F4%2BqpZB8jPOiXjWk0y5iXdM3XhKUvxBTA9UvHuvNPh%2Bzb%2BWj10z6nwuHWBbQFMvNCjKnn7qd1jS%2Fnx9VX3b6jC%2BbwOr5eMe3%2B83IcW4%2F3qgT%2BUTbA9srGaiHsn8AKiF6Ld%2FxF%2FOx6eeAJXabvK78MTTornNMd6XJTVR7%2Fj9bBjhFxV%2FMc1kJOAy2AeA%2FgrV4mFVDZFCqm8rEJ6qysCAWqK9iaztRJRbWXa4moFTELOav7jY%2FqAvoXp0Gc9NX7bIZl17%2FZl0rC1wRLeno0NvP%2B0CTcYNnS8wW6CtzNANaxzKqo9hRNOQ8rGo7tmSsMe2zWdt2frqVRcm5s2fofCgawDNHRNxnyfqgsYez4y4ADCjRM9H73hsNWafILTQdaFiSTj%2BQ%2FxA6yH7d%2BCmR8XbYr0a7VTF2N4siSsb5qdos3R6%2FjGxpULFfw7EfORnbrI9TAToX0sD40%2F2ylcGdh2Rdhg%2BSf2gka9jRTqK9%2BGwgHz7RTfVbHxirDhivdthYUvMRX8aYAD9lstvi%2B0aDL2DUZ0eCBUNNVG0IP65FLTWqPdiqdC0koHTVXe7iyNRG23QotBEy1RbTAzQyrmnYUT2rLsoA13JpcB4eVC2daBM1g2JGLekmwf5On7EJfngfZTNnVSce8bFjaTmQdvs%2FXmO%2FJVpoXdx3RSUe9O00Fj3nUdy0RLgRHiHXOPGW1h2uKZ07c9rG%2Bxyefp23pQeyBIEQoavYlakrG8fnrY5yHn2fbxXzAgw7m8bT5zkkSk4C7cpmOK21esB%2FXAQ5DzFfTo43%2BF%2FDzf0eZ4wZ3MDSjMcvD6nIeOahGgia%2FyU3HforTPkWkwnakdn0cI9jqfbPjD%2FuQLJr6644snlgX%2FApOMoyd1R5%2FxAAAAAElFTkSuQmCC)](https://linuxgsm.com) [![Codacy Badge](https://app.codacy.com/project/badge/Grade/d19c5234dc3743d8a8a14093711ca52d)](https://www.codacy.com/gh/GameServerManagers/LinuxGSM/dashboard?utm_source=github.com&utm_medium=referral&utm_content=GameServerManagers/LinuxGSM&utm_campaign=Badge_Grade) [![Backup Repo](https://github.com/GameServerManagers/LinuxGSM/workflows/Backup%20Repo/badge.svg)](https://bitbucket.org/GameServerManagers/linuxgsm) [![Discord](https://discordapp.com/api/guilds/127498813903601664/widget.png?style=shield)](https://linuxgsm.com/discord) [![MIT Licence](https://badges.frapsoft.com/os/mit/mit.svg?v=103)](https://github.com/GameServerManagers/LinuxGSM/blob/master/LICENSE) [![made-with-bash](https://img.shields.io/badge/-Made%20with%20Bash-1f425f.svg?logo=image%2Fpng%3Bbase64%2CiVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyZpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw%2FeHBhY2tldCBiZWdpbj0i77u%2FIiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8%2BIDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTExIDc5LjE1ODMyNSwgMjAxNS8wOS8xMC0wMToxMDoyMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTUgKFdpbmRvd3MpIiB4bXBNTTpJbnN0YW5jZUlEPSJ4bXAuaWlkOkE3MDg2QTAyQUZCMzExRTVBMkQxRDMzMkJDMUQ4RDk3IiB4bXBNTTpEb2N1bWVudElEPSJ4bXAuZGlkOkE3MDg2QTAzQUZCMzExRTVBMkQxRDMzMkJDMUQ4RDk3Ij4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6QTcwODZBMDBBRkIzMTFFNUEyRDFEMzMyQkMxRDhEOTciIHN0UmVmOmRvY3VtZW50SUQ9InhtcC5kaWQ6QTcwODZBMDFBRkIzMTFFNUEyRDFEMzMyQkMxRDhEOTciLz4gPC9yZGY6RGVzY3JpcHRpb24%2BIDwvcmRmOlJERj4gPC94OnhtcG1ldGE%2BIDw%2FeHBhY2tldCBlbmQ9InIiPz6lm45hAAADkklEQVR42qyVa0yTVxzGn7d9Wy03MS2ii8s%2BeokYNQSVhCzOjXZOFNF4jx%2BMRmPUMEUEqVG36jo2thizLSQSMd4N8ZoQ8RKjJtooaCpK6ZoCtRXKpRempbTv5ey83bhkAUphz8fznvP8znn%2B%2F3NeEEJgNBoRRSmz0ub%2FfuxEacBg%2FDmYtiCjgo5NG2mBXq%2BH5I1ogMRk9Zbd%2BQU2e1ML6VPLOyf5tvBQ8yT1lG10imxsABm7SLs898GTpyYynEzP60hO3trHDKvMigUwdeaceacqzp7nOI4n0SSIIjl36ao4Z356OV07fSQAk6xJ3XGg%2BLCr1d1OYlVHp4eUHPnerU79ZA%2F1kuv1JQMAg%2BE4O2P23EumF3VkvHprsZKMzKwbRUXFEyTvSIEmTVbrysp%2BWr8wfQHGK6WChVa3bKUmdWou%2BjpArdGkzZ41c1zG%2Fu5uGH4swzd561F%2BuhIT4%2BLnSuPsv9%2BJKIpjNr9dXYOyk7%2FBZrcjIT4eCnoKgedJP4BEqhG77E3NKP31FO7cfQA5K0dSYuLgz2TwCWJSOBzG6crzKK%2BohNfni%2Bx6OMUMMNe%2Fgf7ocbw0v0acKg6J8Ql0q%2BT%2FAXR5PNi5dz9c71upuQqCKFAD%2BYhrZLEAmpodaHO3Qy6TI3NhBpbrshGtOWKOSMYwYGQM8nJzoFJNxP2HjyIQho4PewK6hBktoDcUwtIln4PjOWzflQ%2Be5yl0yCCYgYikTclGlxadio%2BBQCSiW1UXoVGrKYwH4RgMrjU1HAB4vR6LzWYfFUCKxfS8Ftk5qxHoCUQAUkRJaSEokkV6Y%2F%2BJUOC4hn6A39NVXVBYeNP8piH6HeA4fPbpdBQV5KOx0QaL1YppX3Jgk0TwH2Vg6S3u%2BdB91%2B%2FpuNYPYFl5uP5V7ZqvsrX7jxqMXR6ff3gCQSTzFI0a1TX3wIs8ul%2Bq4HuWAAiM39vhOuR1O1fQ2gT%2F26Z8Z5vrl2OHi9OXZn995nLV9aFfS6UC9JeJPfuK0NBohWpCHMSAAsFe74WWP%2BvT25wtP9Bpob6uGqqyDnOtaeumjRu%2ByFu36VntK%2FPA5umTJeUtPWZSU9BCgud661odVp3DZtkc7AnYR33RRC708PrVi1larW7XwZIjLnd7R6SgSqWSNjU1B3F72pz5TZbXmX5vV81Yb7Lg7XT%2FUXriu8XLVqw6c6XqWnBKiiYU%2BMt3wWF7u7i91XlSEITwSAZ%2FCzAAHsJVbwXYFFEAAAAASUVORK5CYII%3D)](https://www.gnu.org/software/bash/) +[![LinuxGSM](https://img.shields.io/badge/-LinuxGSM-2b2b2b.svg?logo=data%3Aimage%2Fpng%3Bbase64%2CiVBORw0KGgoAAAANSUhEUgAAACsAAABACAYAAACDbo5ZAAAGD0lEQVR4AcWYa2wUVRvHz75c2vJ2disXoUBEVIioRAx%2BMIFA1IRwUS6KCCiIKBrvhEYiiGm5iBgk8QOGEgUUDYTttmVZWFr2UmwURS6iYAoCtmisElSsdHdbkT7%2BTzoNy%2BGc2dm54C%2F5Rdkz85x%2FZ86ZOXOYXYhIg3Phx%2FA4PAcv6f%2Btg5vhHJjP3EcZsgsshufJHH%2FAJbDztQ7aG35J1vgCXn%2BtgvrgEbLHYei9FmE3kDOUuh10OGwjZ7gEh7kZ9gNyllK3gnrg7%2BQs56DHjbCDyB0GuRF2ArnDeDfCziF3mO1G2FfJHRa4EXYpuUOxG2GXkzuUuBH2TXKH5W6ELSV3eM%2BNsOUk5yQcAY8p2uvgSPitor3MjbB1UOQXOFBvHwpbhPYWOExvL4SNUOQ7p4P2JTlzhOPmCu0vCu1PQpE2WOhk2MdJjk9y7HNwP1wEPUJbAcmZ6WTYrYolnifbxZBiibnFySHQCkUaLdY7C0V4%2FT5OhF1JcuIW6%2B0lOcvsBi2Ezao3j8Ov7Quwj52w60jNKIs1R5GatVaDDoEXSU4D7GSxbidYT3IuwjusFK0mNUVMwaZNNbl%2B%2F87hoVCom0HthaQmnG3QB0lNPcxlCvz%2B0GtlZTuorCxYYlA%2FDzbY%2FnrAgV3hCVLzCDMgEAi9wMMi9IIM%2FUwnNXWwi5mwRaSmmmXA798xq%2F3Khp420VeE1LyS6eQeBhttSXgzywCCToIUCOyYZvKLOWWwkdfd6ORVpGYJM0F5efDe9mEQHGty2BWTmhVGO4PNBmOoKzMBxmo%2FhD25dWvljSbD5hjMkb9gT9lJq63Mzi1bKkbjloc7xBWtwiRrDASCVRi%2FRxA8if%2BvrawMTzYI%2FACpeUv2KFFtDcUyTKilCHcis8G1Ga7wHpLzG8wVFs1K7jaeUKHZfIxmkj9%2FM4S9x9RGiMEudo0QbCVu9Xqn5PWEwLUk5%2FP0iaXac53I0kAH9Sau4m54lo%2FdTMfyekLYKQZ7ub34AbMMlmw5irC2VYTN0fuVMYMf8JHxJ7L7YYXAlSRnI2%2F8RtH4siTsDMz%2BZ5yS15OEXUxyDjGD1%2BvEq8MG16CDzY6JepKwT6geYbzxb0XjGMl7vwGSgzZIwo4nOa1M8Yr9Afb%2Fj8L21%2FsXaeaNZ2A6KTiEASph%2F0vF80cn4tokqu79fzfCUk2vfF4%2FFdFGEjGPHvg2yWrsDG%2F4%2BqpZB8jPOiXjWk0y5iXdM3XhKUvxBTA9UvHuvNPh%2Bzb%2BWj10z6nwuHWBbQFMvNCjKnn7qd1jS%2Fnx9VX3b6jC%2BbwOr5eMe3%2B83IcW4%2F3qgT%2BUTbA9srGaiHsn8AKiF6Ld%2FxF%2FOx6eeAJXabvK78MTTornNMd6XJTVR7%2Fj9bBjhFxV%2FMc1kJOAy2AeA%2FgrV4mFVDZFCqm8rEJ6qysCAWqK9iaztRJRbWXa4moFTELOav7jY%2FqAvoXp0Gc9NX7bIZl17%2FZl0rC1wRLeno0NvP%2B0CTcYNnS8wW6CtzNANaxzKqo9hRNOQ8rGo7tmSsMe2zWdt2frqVRcm5s2fofCgawDNHRNxnyfqgsYez4y4ADCjRM9H73hsNWafILTQdaFiSTj%2BQ%2FxA6yH7d%2BCmR8XbYr0a7VTF2N4siSsb5qdos3R6%2FjGxpULFfw7EfORnbrI9TAToX0sD40%2F2ylcGdh2Rdhg%2BSf2gka9jRTqK9%2BGwgHz7RTfVbHxirDhivdthYUvMRX8aYAD9lstvi%2B0aDL2DUZ0eCBUNNVG0IP65FLTWqPdiqdC0koHTVXe7iyNRG23QotBEy1RbTAzQyrmnYUT2rLsoA13JpcB4eVC2daBM1g2JGLekmwf5On7EJfngfZTNnVSce8bFjaTmQdvs%2FXmO%2FJVpoXdx3RSUe9O00Fj3nUdy0RLgRHiHXOPGW1h2uKZ07c9rG%2Bxyefp23pQeyBIEQoavYlakrG8fnrY5yHn2fbxXzAgw7m8bT5zkkSk4C7cpmOK21esB%2FXAQ5DzFfTo43%2BF%2FDzf0eZ4wZ3MDSjMcvD6nIeOahGgia%2FyU3HforTPkWkwnakdn0cI9jqfbPjD%2FuQLJr6644snlgX%2FApOMoyd1R5%2FxAAAAAElFTkSuQmCC)](https://linuxgsm.com) [![Codacy Badge](https://app.codacy.com/project/badge/Grade/d19c5234dc3743d8a8a14093711ca52d)](https://www.codacy.com/gh/GameServerManagers/LinuxGSM/dashboard?utm_source=github.com&utm_medium=referral&utm_content=GameServerManagers/LinuxGSM&utm_campaign=Badge_Grade) [![Backup Repo](https://github.com/GameServerManagers/LinuxGSM/workflows/Backup%20Repo/badge.svg)](https://bitbucket.org/GameServerManagers/linuxgsm) [![Discord](https://discordapp.com/api/guilds/127498813903601664/widget.png?style=shield)](https://linuxgsm.com/discord) [![MIT Licence](https://badges.frapsoft.com/os/mit/mit.svg?v=103)](https://github.com/GameServerManagers/LinuxGSM/blob/master/LICENSE) [![made-with-bash](https://img.shields.io/badge/-Made%20with%20Bash-1f425f.svg?logo=image%2Fpng%3Bbase64%2CiVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyZpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw%2FeHBhY2tldCBiZWdpbj0i77u%2FIiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8%2BIDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTExIDc5LjE1ODMyNSwgMjAxNS8wOS8xMC0wMToxMDoyMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTUgKFdpbmRvd3MpIiB4bXBNTTpJbnN0YW5jZUlEPSJ4bXAuaWlkOkE3MDg2QTAyQUZCMzExRTVBMkQxRDMzMkJDMUQ4RDk3IiB4bXBNTTpEb2N1bWVudElEPSJ4bXAuZGlkOkE3MDg2QTAzQUZCMzExRTVBMkQxRDMzMkJDMUQ4RDk3Ij4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6QTcwODZBMDBBRkIzMTFFNUEyRDFEMzMyQkMxRDhEOTciIHN0UmVmOmRvY3VtZW50SUQ9InhtcC5kaWQ6QTcwODZBMDFBRkIzMTFFNUEyRDFEMzMyQkMxRDhEOTciLz4gPC9yZGY6RGVzY3JpcHRpb24%2BIDwvcmRmOlJERj4gPC94OnhtcG1ldGE%2BIDw%2FeHBhY2tldCBlbmQ9InIiPz6lm45hAAADkklEQVR42qyVa0yTVxzGn7d9Wy03MS2ii8s%2BeokYNQSVhCzOjXZOFNF4jx%2BMRmPUMEUEqVG36jo2thizLSQSMd4N8ZoQ8RKjJtooaCpK6ZoCtRXKpRempbTv5ey83bhkAUphz8fznvP8znn%2B%2F3NeEEJgNBoRRSmz0ub%2FfuxEacBg%2FDmYtiCjgo5NG2mBXq%2BH5I1ogMRk9Zbd%2BQU2e1ML6VPLOyf5tvBQ8yT1lG10imxsABm7SLs898GTpyYynEzP60hO3trHDKvMigUwdeaceacqzp7nOI4n0SSIIjl36ao4Z356OV07fSQAk6xJ3XGg%2BLCr1d1OYlVHp4eUHPnerU79ZA%2F1kuv1JQMAg%2BE4O2P23EumF3VkvHprsZKMzKwbRUXFEyTvSIEmTVbrysp%2BWr8wfQHGK6WChVa3bKUmdWou%2BjpArdGkzZ41c1zG%2Fu5uGH4swzd561F%2BuhIT4%2BLnSuPsv9%2BJKIpjNr9dXYOyk7%2FBZrcjIT4eCnoKgedJP4BEqhG77E3NKP31FO7cfQA5K0dSYuLgz2TwCWJSOBzG6crzKK%2BohNfni%2Bx6OMUMMNe%2Fgf7ocbw0v0acKg6J8Ql0q%2BT%2FAXR5PNi5dz9c71upuQqCKFAD%2BYhrZLEAmpodaHO3Qy6TI3NhBpbrshGtOWKOSMYwYGQM8nJzoFJNxP2HjyIQho4PewK6hBktoDcUwtIln4PjOWzflQ%2Be5yl0yCCYgYikTclGlxadio%2BBQCSiW1UXoVGrKYwH4RgMrjU1HAB4vR6LzWYfFUCKxfS8Ftk5qxHoCUQAUkRJaSEokkV6Y%2F%2BJUOC4hn6A39NVXVBYeNP8piH6HeA4fPbpdBQV5KOx0QaL1YppX3Jgk0TwH2Vg6S3u%2BdB91%2B%2FpuNYPYFl5uP5V7ZqvsrX7jxqMXR6ff3gCQSTzFI0a1TX3wIs8ul%2Bq4HuWAAiM39vhOuR1O1fQ2gT%2F26Z8Z5vrl2OHi9OXZn995nLV9aFfS6UC9JeJPfuK0NBohWpCHMSAAsFe74WWP%2BvT25wtP9Bpob6uGqqyDnOtaeumjRu%2ByFu36VntK%2FPA5umTJeUtPWZSU9BCgud661odVp3DZtkc7AnYR33RRC708PrVi1larW7XwZIjLnd7R6SgSqWSNjU1B3F72pz5TZbXmX5vV81Yb7Lg7XT%2FUXriu8XLVqw6c6XqWnBKiiYU%2BMt3wWF7u7i91XlSEITwSAZ%2FCzAAHsJVbwXYFFEAAAAASUVORK5CYII%3D)](https://www.gnu.org/software/bash/) [LinuxGSM](https://linuxgsm.com) is the command-line tool for quick, simple deployment and management of Linux dedicated game servers. @@ -15,21 +15,21 @@ Traditionally game servers are not easy to manage yourself. Admins often have to 100+ game servers supported -* :truck: Installer -* :mag: Monitor -* :phone: Alerts -* :cloud: Updater -* :blue_book: Server Details -* :floppy_disk: Backup -* :computer: Console +- :truck: Installer +- :mag: Monitor +- :phone: Alerts +- :cloud: Updater +- :blue_book: Server Details +- :floppy_disk: Backup +- :computer: Console ## :penguin: Compatibility LinuxGSM will run on popular distros as long as the minimum requirements are met. -* Ubuntu -* Debian -* CentOS +- Ubuntu +- Debian +- CentOS Other distros are likely to work but are not fully tested. diff --git a/lgsm/functions/README.md b/lgsm/functions/README.md index c1c823fac..de008ecfa 100755 --- a/lgsm/functions/README.md +++ b/lgsm/functions/README.md @@ -3,14 +3,15 @@ These modules are scripts that are called upon by the primary script linuxgsm.sh ## Module Names + Modules have been named to give an idea of what the function does. -* core: Essential modules that will always run first. -* command: Primary command function. -* check: Runs checks that will either halt on or fix an issue. -* dev: development modules. -* fix: Applies a game server specific fix. -* info: retrieves information from a source such as config file or the OS. -* install: modules related to the installer. -* monitor: modules related to monitor. -* update: modules that update the game server. +- core: Essential modules that will always run first. +- command: Primary command function. +- check: Runs checks that will either halt on or fix an issue. +- dev: development modules. +- fix: Applies a game server specific fix. +- info: retrieves information from a source such as config file or the OS. +- install: modules related to the installer. +- monitor: modules related to monitor. +- update: modules that update the game server. diff --git a/lgsm/functions/alert.sh b/lgsm/functions/alert.sh index c62c65556..8460209c4 100755 --- a/lgsm/functions/alert.sh +++ b/lgsm/functions/alert.sh @@ -9,7 +9,7 @@ functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" # Generates alert log of the details at the time of the alert. # Used with email alerts. -fn_alert_log(){ +fn_alert_log() { info_distro.sh info_game.sh info_messages.sh @@ -24,10 +24,10 @@ fn_alert_log(){ fn_info_message_gameserver_resource fn_info_message_gameserver fn_info_logs - } | sed -r "s/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]//g"| tee -a "${alertlog}" > /dev/null 2>&1 + } | sed -r "s/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]//g" | tee -a "${alertlog}" > /dev/null 2>&1 } -fn_alert_test(){ +fn_alert_test() { fn_script_log_info "Sending test alert" alertsubject="Alert - ${selfname} - Test" alertemoji="🚧" @@ -36,7 +36,7 @@ fn_alert_test(){ alertbody="Testing LinuxGSM Alert. No action to be taken." } -fn_alert_restart(){ +fn_alert_restart() { fn_script_log_info "Sending alert: Restarted: ${executable} not running" alertsubject="Alert - ${selfname} - Restarted" alertemoji="🚨" @@ -45,7 +45,7 @@ fn_alert_restart(){ alertbody="${selfname} ${executable} not running" } -fn_alert_restart_query(){ +fn_alert_restart_query() { fn_script_log_info "Sending alert: Restarted: ${selfname}" alertsubject="Alert - ${selfname} - Restarted" alertemoji="🚨" @@ -54,7 +54,7 @@ fn_alert_restart_query(){ alertbody="Unable to query: ${selfname}" } -fn_alert_update(){ +fn_alert_update() { fn_script_log_info "Sending alert: Updated" alertsubject="Alert - ${selfname} - Updated" alertemoji="🎮" @@ -63,7 +63,7 @@ fn_alert_update(){ alertbody="${gamename} received update" } -fn_alert_check_update(){ +fn_alert_check_update() { fn_script_log_info "Sending alert: Update available" alertsubject="Alert - ${selfname} - Update available" alertemoji="🎮" @@ -72,7 +72,7 @@ fn_alert_check_update(){ alertbody="${gamename} update available" } -fn_alert_permissions(){ +fn_alert_permissions() { fn_script_log_info "Sending alert: Permissions error" alertsubject="Alert - ${selfname}: Permissions error" alertemoji="❗" @@ -81,7 +81,7 @@ fn_alert_permissions(){ alertbody="${selfname} has permissions issues" } -fn_alert_config(){ +fn_alert_config() { fn_script_log_info "Sending alert: New _default.cfg" alertsubject="Alert - ${selfname} - New _default.cfg" alertemoji="🎮" @@ -110,128 +110,128 @@ fi fn_alert_log # Generates the more info link. -if [ "${postalert}" == "on" ]&&[ -n "${postalert}" ]; then +if [ "${postalert}" == "on" ] && [ -n "${postalert}" ]; then exitbypass=1 command_postdetails.sh fn_firstcommand_reset unset exitbypass -elif [ "${postalert}" != "on" ]&&[ "${commandname}" == "TEST-ALERT" ]; then +elif [ "${postalert}" != "on" ] && [ "${commandname}" == "TEST-ALERT" ]; then fn_print_warn_nl "More Info not enabled" fn_script_log_warn "More Info alerts not enabled" fi -if [ "${discordalert}" == "on" ]&&[ -n "${discordalert}" ]; then +if [ "${discordalert}" == "on" ] && [ -n "${discordalert}" ]; then alert_discord.sh -elif [ "${discordalert}" != "on" ]&&[ "${commandname}" == "TEST-ALERT" ]; then +elif [ "${discordalert}" != "on" ] && [ "${commandname}" == "TEST-ALERT" ]; then fn_print_warn_nl "Discord alerts not enabled" fn_script_log_warn "Discord alerts not enabled" -elif [ -z "${discordtoken}" ]&&[ "${commandname}" == "TEST-ALERT" ]; then +elif [ -z "${discordtoken}" ] && [ "${commandname}" == "TEST-ALERT" ]; then fn_print_error_nl "Discord token not set" echo -e "* https://docs.linuxgsm.com/alerts/discord" fn_script_error "Discord token not set" fi -if [ "${emailalert}" == "on" ]&&[ -n "${email}" ]; then +if [ "${emailalert}" == "on" ] && [ -n "${email}" ]; then alert_email.sh -elif [ "${emailalert}" != "on" ]&&[ "${commandname}" == "TEST-ALERT" ]; then +elif [ "${emailalert}" != "on" ] && [ "${commandname}" == "TEST-ALERT" ]; then fn_print_warn_nl "Email alerts not enabled" fn_script_log_warn "Email alerts not enabled" -elif [ -z "${email}" ]&&[ "${commandname}" == "TEST-ALERT" ]; then +elif [ -z "${email}" ] && [ "${commandname}" == "TEST-ALERT" ]; then fn_print_error_nl "Email not set" fn_script_log_error "Email not set" fi -if [ "${gotifyalert}" == "on" ]&&[ -n "${gotifyalert}" ]; then +if [ "${gotifyalert}" == "on" ] && [ -n "${gotifyalert}" ]; then alert_gotify.sh -elif [ "${gotifyalert}" != "on" ]&&[ "${commandname}" == "TEST-ALERT" ]; then +elif [ "${gotifyalert}" != "on" ] && [ "${commandname}" == "TEST-ALERT" ]; then fn_print_warn_nl "Gotify alerts not enabled" fn_script_log_warn "Gotify alerts not enabled" -elif [ -z "${gotifytoken}" ]&&[ "${commandname}" == "TEST-ALERT" ]; then +elif [ -z "${gotifytoken}" ] && [ "${commandname}" == "TEST-ALERT" ]; then fn_print_error_nl "Gotify token not set" echo -e "* https://docs.linuxgsm.com/alerts/gotify" fn_script_error "Gotify token not set" -elif [ -z "${gotifywebhook}" ]&&[ "${commandname}" == "TEST-ALERT" ]; then +elif [ -z "${gotifywebhook}" ] && [ "${commandname}" == "TEST-ALERT" ]; then fn_print_error_nl "Gotify webhook not set" echo -e "* https://docs.linuxgsm.com/alerts/gotify" fn_script_error "Gotify webhook not set" fi -if [ "${iftttalert}" == "on" ]&&[ -n "${iftttalert}" ]; then +if [ "${iftttalert}" == "on" ] && [ -n "${iftttalert}" ]; then alert_ifttt.sh -elif [ "${iftttalert}" != "on" ]&&[ "${commandname}" == "TEST-ALERT" ]; then +elif [ "${iftttalert}" != "on" ] && [ "${commandname}" == "TEST-ALERT" ]; then fn_print_warn_nl "IFTTT alerts not enabled" fn_script_log_warn "IFTTT alerts not enabled" -elif [ -z "${ifttttoken}" ]&&[ "${commandname}" == "TEST-ALERT" ]; then +elif [ -z "${ifttttoken}" ] && [ "${commandname}" == "TEST-ALERT" ]; then fn_print_error_nl "IFTTT token not set" echo -e "* https://docs.linuxgsm.com/alerts/ifttt" fn_script_error "IFTTT token not set" fi -if [ "${mailgunalert}" == "on" ]&&[ -n "${mailgunalert}" ]; then +if [ "${mailgunalert}" == "on" ] && [ -n "${mailgunalert}" ]; then alert_mailgun.sh -elif [ "${mailgunalert}" != "on" ]&&[ "${commandname}" == "TEST-ALERT" ]; then +elif [ "${mailgunalert}" != "on" ] && [ "${commandname}" == "TEST-ALERT" ]; then fn_print_warn_nl "Mailgun alerts not enabled" fn_script_log_warn "Mailgun alerts not enabled" -elif [ -z "${mailguntoken}" ]&&[ "${commandname}" == "TEST-ALERT" ]; then +elif [ -z "${mailguntoken}" ] && [ "${commandname}" == "TEST-ALERT" ]; then fn_print_error_nl "Mailgun token not set" echo -e "* https://docs.linuxgsm.com/alerts/mailgun" fn_script_error "Mailgun token not set" fi -if [ "${pushbulletalert}" == "on" ]&&[ -n "${pushbullettoken}" ]; then +if [ "${pushbulletalert}" == "on" ] && [ -n "${pushbullettoken}" ]; then alert_pushbullet.sh -elif [ "${pushbulletalert}" != "on" ]&&[ "${commandname}" == "TEST-ALERT" ]; then +elif [ "${pushbulletalert}" != "on" ] && [ "${commandname}" == "TEST-ALERT" ]; then fn_print_warn_nl "Pushbullet alerts not enabled" fn_script_log_warn "Pushbullet alerts not enabled" -elif [ -z "${pushbullettoken}" ]&&[ "${commandname}" == "TEST-ALERT" ]; then +elif [ -z "${pushbullettoken}" ] && [ "${commandname}" == "TEST-ALERT" ]; then fn_print_error_nl "Pushbullet token not set" echo -e "* https://docs.linuxgsm.com/alerts/pushbullet" fn_script_error "Pushbullet token not set" fi -if [ "${pushoveralert}" == "on" ]&&[ -n "${pushoveralert}" ]; then +if [ "${pushoveralert}" == "on" ] && [ -n "${pushoveralert}" ]; then alert_pushover.sh -elif [ "${pushoveralert}" != "on" ]&&[ "${commandname}" == "TEST-ALERT" ]; then +elif [ "${pushoveralert}" != "on" ] && [ "${commandname}" == "TEST-ALERT" ]; then fn_print_warn_nl "Pushover alerts not enabled" fn_script_log_warn "Pushover alerts not enabled" -elif [ -z "${pushovertoken}" ]&&[ "${commandname}" == "TEST-ALERT" ]; then +elif [ -z "${pushovertoken}" ] && [ "${commandname}" == "TEST-ALERT" ]; then fn_print_error_nl "Pushover token not set" echo -e "* https://docs.linuxgsm.com/alerts/pushover" fn_script_error "Pushover token not set" fi -if [ "${telegramalert}" == "on" ]&&[ -n "${telegramtoken}" ]; then +if [ "${telegramalert}" == "on" ] && [ -n "${telegramtoken}" ]; then alert_telegram.sh -elif [ "${telegramalert}" != "on" ]&&[ "${commandname}" == "TEST-ALERT" ]; then +elif [ "${telegramalert}" != "on" ] && [ "${commandname}" == "TEST-ALERT" ]; then fn_print_warn_nl "Telegram Messages not enabled" fn_script_log_warn "Telegram Messages not enabled" -elif [ -z "${telegramtoken}" ]&&[ "${commandname}" == "TEST-ALERT" ]; then +elif [ -z "${telegramtoken}" ] && [ "${commandname}" == "TEST-ALERT" ]; then fn_print_error_nl "Telegram token not set." echo -e "* https://docs.linuxgsm.com/alerts/telegram" fn_script_error "Telegram token not set." -elif [ -z "${telegramchatid}" ]&&[ "${commandname}" == "TEST-ALERT" ]; then +elif [ -z "${telegramchatid}" ] && [ "${commandname}" == "TEST-ALERT" ]; then fn_print_error_nl "Telegram chat id not set." echo -e "* https://docs.linuxgsm.com/alerts/telegram" fn_script_error "Telegram chat id not set." fi -if [ "${rocketchatalert}" == "on" ]&&[ -n "${rocketchatalert}" ]; then +if [ "${rocketchatalert}" == "on" ] && [ -n "${rocketchatalert}" ]; then alert_rocketchat.sh -elif [ "${rocketchatalert}" != "on" ]&&[ "${commandname}" == "TEST-ALERT" ]; then +elif [ "${rocketchatalert}" != "on" ] && [ "${commandname}" == "TEST-ALERT" ]; then fn_print_warn_nl "Rocketchat alerts not enabled" fn_script_log_warn "Rocketchat alerts not enabled" -elif [ -z "${rocketchattoken}" ]&&[ "${commandname}" == "TEST-ALERT" ]; then +elif [ -z "${rocketchattoken}" ] && [ "${commandname}" == "TEST-ALERT" ]; then fn_print_error_nl "Rocketchat token not set" #echo -e "* https://docs.linuxgsm.com/alerts/slack" fn_script_error "Rocketchat token not set" fi -if [ "${slackalert}" == "on" ]&&[ -n "${slackalert}" ]; then +if [ "${slackalert}" == "on" ] && [ -n "${slackalert}" ]; then alert_slack.sh -elif [ "${slackalert}" != "on" ]&&[ "${commandname}" == "TEST-ALERT" ]; then +elif [ "${slackalert}" != "on" ] && [ "${commandname}" == "TEST-ALERT" ]; then fn_print_warn_nl "Slack alerts not enabled" fn_script_log_warn "Slack alerts not enabled" -elif [ -z "${slacktoken}" ]&&[ "${commandname}" == "TEST-ALERT" ]; then +elif [ -z "${slacktoken}" ] && [ "${commandname}" == "TEST-ALERT" ]; then fn_print_error_nl "Slack token not set" echo -e "* https://docs.linuxgsm.com/alerts/slack" fn_script_error "Slack token not set" diff --git a/lgsm/functions/alert_discord.sh b/lgsm/functions/alert_discord.sh index 9db56da3f..770817516 100755 --- a/lgsm/functions/alert_discord.sh +++ b/lgsm/functions/alert_discord.sh @@ -7,7 +7,8 @@ functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" -json=$(cat </dev/null)" ]; then - array_deps_required+=( mailutils postfix ) - elif [ "$(command -v rpm 2>/dev/null)" ]; then - array_deps_required+=( mailx postfix ) + array_deps_required+=(sendmail) + elif [ "$(command -v dpkg-query 2> /dev/null)" ]; then + array_deps_required+=(mailutils postfix) + elif [ "$(command -v rpm 2> /dev/null)" ]; then + array_deps_required+=(mailx postfix) fi else - if [ "$(command -v dpkg-query 2>/dev/null)" ]; then - array_deps_required+=( mailutils postfix ) - elif [ "$(command -v rpm 2>/dev/null)" ]; then - array_deps_required+=( mailx postfix ) + if [ "$(command -v dpkg-query 2> /dev/null)" ]; then + array_deps_required+=(mailutils postfix) + elif [ "$(command -v rpm 2> /dev/null)" ]; then + array_deps_required+=(mailx postfix) fi fi fi } -fn_install_missing_deps(){ +fn_install_missing_deps() { # If any dependencies are not installed. if [ "${#array_deps_missing[*]}" != "0" ]; then if [ "${commandname}" == "INSTALL" ]; then @@ -143,9 +143,8 @@ fn_install_missing_deps(){ fi fi - # Add sudo dpkg --add-architecture i386 if using i386 packages. - if [ "$(command -v dpkg-query 2>/dev/null)" ]; then + if [ "$(command -v dpkg-query 2> /dev/null)" ]; then if printf '%s\n' "${array_deps_required[@]}" | grep -q -P 'i386'; then i386installcommand="sudo dpkg --add-architecture i386; " fi @@ -162,13 +161,13 @@ fn_install_missing_deps(){ echo -en "...\r" sleep 1 echo -en " \r" - if [ "$(command -v dpkg-query 2>/dev/null)" ]; then + if [ "$(command -v dpkg-query 2> /dev/null)" ]; then cmd="echo steamcmd steam/question select \"I AGREE\" | sudo debconf-set-selections; echo steamcmd steam/license note '' | sudo debconf-set-selections; ${i386installcommand}sudo apt-get update; sudo apt-get -y install ${array_deps_missing[*]}" eval "${cmd}" - elif [ "$(command -v dnf 2>/dev/null)" ]; then + elif [ "$(command -v dnf 2> /dev/null)" ]; then cmd="sudo dnf -y install ${array_deps_missing[*]}" eval "${cmd}" - elif [ "$(command -v yum 2>/dev/null)" ]; then + elif [ "$(command -v yum 2> /dev/null)" ]; then cmd="sudo yum -y install ${array_deps_missing[*]}" eval "${cmd}" fi @@ -182,11 +181,11 @@ fn_install_missing_deps(){ # If automatic dependency install is unavailable. if [ "${autodepinstall}" != "0" ]; then - if [ "$(command -v dpkg-query 2>/dev/null)" ]; then + if [ "$(command -v dpkg-query 2> /dev/null)" ]; then echo -e "${i386installcommand}sudo apt update; sudo apt install ${array_deps_missing[*]}" - elif [ "$(command -v dnf 2>/dev/null)" ]; then + elif [ "$(command -v dnf 2> /dev/null)" ]; then echo -e "sudo dnf install ${array_deps_missing[*]}" - elif [ "$(command -v yum 2>/dev/null)" ]; then + elif [ "$(command -v yum 2> /dev/null)" ]; then echo -e "sudo yum install ${array_deps_missing[*]}" fi fi @@ -210,7 +209,7 @@ fn_install_missing_deps(){ fi } -fn_check_loop(){ +fn_check_loop() { # Loop though required depenencies checking if they are installed. for deptocheck in ${array_deps_required[*]}; do fn_deps_detector @@ -221,21 +220,21 @@ fn_check_loop(){ } # Checks if dependency is installed or not. -fn_deps_detector(){ +fn_deps_detector() { ## Check. # SteamCMD: Will be removed from required array if no appid is present or non-free repo is not available. # This will cause SteamCMD to be installed using tar. - if [ "${deptocheck}" == "libsdl2-2.0-0:i386" ]&&[ -z "${appid}" ]; then - array_deps_required=( "${array_deps_required[@]/libsdl2-2.0-0:i386}" ) + if [ "${deptocheck}" == "libsdl2-2.0-0:i386" ] && [ -z "${appid}" ]; then + array_deps_required=("${array_deps_required[@]/libsdl2-2.0-0:i386/}") steamcmdstatus=1 - elif [ "${deptocheck}" == "steamcmd" ]&&[ -z "${appid}" ]; then - array_deps_required=( "${array_deps_required[@]/steamcmd}" ) + elif [ "${deptocheck}" == "steamcmd" ] && [ -z "${appid}" ]; then + array_deps_required=("${array_deps_required[@]/steamcmd/}") steamcmdstatus=1 - elif [ "${deptocheck}" == "steamcmd" ]&&[ "${distroid}" == "debian" ]&& ! grep -qE "^deb .*non-free" /etc/apt/sources.list; then - array_deps_required=( "${array_deps_required[@]/steamcmd}" ) + elif [ "${deptocheck}" == "steamcmd" ] && [ "${distroid}" == "debian" ] && ! grep -qE "^deb .*non-free" /etc/apt/sources.list; then + array_deps_required=("${array_deps_required[@]/steamcmd/}") steamcmdstatus=1 # Java: Added for users using Oracle JRE to bypass check. - elif [[ ${deptocheck} == "openjdk"* ]]||[[ ${deptocheck} == "java"* ]]; then + elif [[ ${deptocheck} == "openjdk"* ]] || [[ ${deptocheck} == "java"* ]]; then # Is java already installed? if [ -n "${javaversion}" ]; then # Added for users using Oracle JRE to bypass check. @@ -246,7 +245,7 @@ fn_deps_detector(){ fi # Mono: A Mono repo needs to be installed. elif [ "${deptocheck}" == "mono-complete" ]; then - if [ -n "${monoversion}" ]&&[ "${monoversion}" -ge "5" ]; then + if [ -n "${monoversion}" ] && [ "${monoversion}" -ge "5" ]; then # Mono >= 5.0.0 already installed. depstatus=0 monostatus=0 @@ -255,13 +254,13 @@ fn_deps_detector(){ depstatus=1 monostatus=1 fi - elif [ "$(command -v dpkg-query 2>/dev/null)" ]; then - dpkg-query -W -f='${Status}' "${deptocheck}" 2>/dev/null | grep -q -P '^install ok installed' + elif [ "$(command -v dpkg-query 2> /dev/null)" ]; then + dpkg-query -W -f='${Status}' "${deptocheck}" 2> /dev/null | grep -q -P '^install ok installed' depstatus=$? - elif [ "$(command -v dnf 2>/dev/null)" ]; then + elif [ "$(command -v dnf 2> /dev/null)" ]; then dnf list installed "${deptocheck}" > /dev/null 2>&1 depstatus=$? - elif [ "$(command -v rpm 2>/dev/null)" ]; then + elif [ "$(command -v rpm 2> /dev/null)" ]; then rpm -q "${deptocheck}" > /dev/null 2>&1 depstatus=$? fi @@ -286,11 +285,11 @@ 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 - if [ "${deptocheck}" != "steamcmd" ]&&[ "${deptocheck}" == "${steamcmddeptocheck}" ]; then - steamcmdfail=1 - fi - done + for steamcmddeptocheck in ${array_deps_required_steamcmd[*]}; do + if [ "${deptocheck}" != "steamcmd" ] && [ "${deptocheck}" == "${steamcmddeptocheck}" ]; then + steamcmdfail=1 + fi + done fi fi unset depstatus @@ -326,10 +325,10 @@ fi info_distro.sh -if [ ! -f "${tmpdir}/dependency-no-check.tmp" ]&&[ ! -f "${datadir}/${distroid}-${distroversioncsv}.csv" ]; then +if [ ! -f "${tmpdir}/dependency-no-check.tmp" ] && [ ! -f "${datadir}/${distroid}-${distroversioncsv}.csv" ]; then # Check that the distro dependency csv file exists. fn_check_file_github "lgsm/data" "${distroid}-${distroversioncsv}.csv" - if [ -n "${checkflag}" ]&&[ "${checkflag}" == "0" ]; then + if [ -n "${checkflag}" ] && [ "${checkflag}" == "0" ]; then fn_fetch_file_github "lgsm/data" "${distroid}-${distroversioncsv}.csv" "lgsm/data" "chmodx" "norun" "noforce" "nohash" fi fi @@ -338,7 +337,7 @@ fi if [ -f "${datadir}/${distroid}-${distroversioncsv}.csv" ]; then depall=$(awk -F, '$1=="all" {$1=""; print $0}' "${datadir}/${distroid}-${distroversioncsv}.csv") depsteamcmd=$(awk -F, '$1=="steamcmd" {$1=""; print $0}' "${datadir}/${distroid}-${distroversioncsv}.csv") - depshortname=$(awk -v shortname="$shortname" -F, '$1==shortname {$1=""; print $0}' "${datadir}/${distroid}-${distroversioncsv}.csv") + depshortname=$(awk -v shortname="$shortname" -F, '$1==shortname {$1=""; print $0}' "${datadir}/${distroid}-${distroversioncsv}.csv") # Generate array of missing deps. array_deps_missing=() @@ -351,11 +350,11 @@ if [ -f "${datadir}/${distroid}-${distroversioncsv}.csv" ]; then fn_check_loop # Warn the user that dependency checking is unavailable for their distro. -elif [ "${commandname}" == "INSTALL" ]||[ -n "${checkflag}" ]&&[ "${checkflag}" != "0" ]; then +elif [ "${commandname}" == "INSTALL" ] || [ -n "${checkflag}" ] && [ "${checkflag}" != "0" ]; then fn_print_warning_nl "LinuxGSM dependency checking currently unavailable for ${distroname}." # Prevent future dependency checking if unavailable for the distro. echo "${version}" > "${tmpdir}/dependency-no-check.tmp" -elif [ -f "${tmpdir}/dependency-no-check.tmp" ]; then +elif [ -f "${tmpdir}/dependency-no-check.tmp" ]; then # Allow LinuxGSM to try a dependency check if LinuxGSM has been recently updated. nocheckversion=$(cat "${tmpdir}/dependency-no-check.tmp") if [ "${version}" != "${nocheckversion}" ]; then diff --git a/lgsm/functions/check_ip.sh b/lgsm/functions/check_ip.sh index 0dafbbcdc..fc5d70f2c 100755 --- a/lgsm/functions/check_ip.sh +++ b/lgsm/functions/check_ip.sh @@ -10,17 +10,17 @@ functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" info_game.sh -ip_commands_array=( "/bin/ip" "/usr/sbin/ip" "ip") +ip_commands_array=("/bin/ip" "/usr/sbin/ip" "ip") for ip_command in "${ip_commands_array[@]}"; do - if [ "$(command -v ${ip_command} 2>/dev/null)" ]; then + if [ "$(command -v ${ip_command} 2> /dev/null)" ]; then ipcommand="${ip_command}" break fi done -ethtool_commands_array=( "/bin/ethtool" "/usr/sbin/ethtool" "ethtool") +ethtool_commands_array=("/bin/ethtool" "/usr/sbin/ethtool" "ethtool") for ethtool_command in "${ethtool_commands_array[@]}"; do - if [ "$(command -v ${ethtool_command} 2>/dev/null)" ]; then + if [ "$(command -v ${ethtool_command} 2> /dev/null)" ]; then ethtoolcommand="${ethtool_command}" break fi @@ -32,27 +32,27 @@ getipwc=$(${ipcommand} -o -4 addr | awk '{print $4}' | grep -oe '\([0-9]\{1,3\}\ # Check if server has multiple IP addresses # If the IP variable has been set by user. -if [ -n "${ip}" ]&&[ "${ip}" != "0.0.0.0" ]; then - queryips=( "${ip}" ) - webadminip=( "${ip}" ) - telnetip=( "${ip}" ) +if [ -n "${ip}" ] && [ "${ip}" != "0.0.0.0" ]; then + queryips=("${ip}") + webadminip=("${ip}") + telnetip=("${ip}") # If game config does have an IP set. -elif [ -n "${configip}" ]&&[ "${configip}" != "0.0.0.0" ];then - queryips=( "${configip}" ) +elif [ -n "${configip}" ] && [ "${configip}" != "0.0.0.0" ]; then + queryips=("${configip}") ip="${configip}" - webadminip=( "${configip}" ) - telnetip=( "${configip}" ) + webadminip=("${configip}") + telnetip=("${configip}") # If there is only 1 server IP address. # Some IP details can automaticly use the one IP elif [ "${getipwc}" == "1" ]; then - queryips=( $(echo "${getip}") ) + queryips=($(echo "${getip}")) ip="0.0.0.0" - webadminip=( "${getip}" ) - telnetip=( "${getip}" ) + webadminip=("${getip}") + telnetip=("${getip}") # If no ip is set by the user and server has more than one IP. else - queryips=( $(echo "${getip}") ) + queryips=($(echo "${getip}")) ip="0.0.0.0" - webadminip=( "${ip}" ) - telnetip=( "${ip}" ) + webadminip=("${ip}") + telnetip=("${ip}") fi diff --git a/lgsm/functions/check_last_update.sh b/lgsm/functions/check_last_update.sh index 07e9d3883..ee86c0ba1 100755 --- a/lgsm/functions/check_last_update.sh +++ b/lgsm/functions/check_last_update.sh @@ -16,8 +16,8 @@ if [ -f "${lockdir}/lastupdate.lock" ]; then fi check_status.sh -if [ -f "${lockdir}/lastupdate.lock" ]&&[ "${status}" != "0" ]; then - if [ ! -f "${lockdir}/${selfname}-laststart.lock" ]||[ "${laststart}" -lt "${lastupdate}" ]; then +if [ -f "${lockdir}/lastupdate.lock" ] && [ "${status}" != "0" ]; then + if [ ! -f "${lockdir}/${selfname}-laststart.lock" ] || [ "${laststart}" -lt "${lastupdate}" ]; then fn_print_info "${selfname} has not been restarted since last update" fn_script_log_info "${selfname} has not been restarted since last update" command_restart.sh diff --git a/lgsm/functions/check_logs.sh b/lgsm/functions/check_logs.sh index b8dad203c..fa3df92d1 100755 --- a/lgsm/functions/check_logs.sh +++ b/lgsm/functions/check_logs.sh @@ -7,7 +7,7 @@ functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" -fn_check_logs(){ +fn_check_logs() { fn_print_dots "Checking for log files" fn_print_info_nl "Checking for log files: Creating log files" checklogs=1 @@ -15,12 +15,12 @@ fn_check_logs(){ } # Create directories for the script and console logs. -if [ ! -d "${lgsmlogdir}" ]||[ ! -d "${consolelogdir}" ]; then +if [ ! -d "${lgsmlogdir}" ] || [ ! -d "${consolelogdir}" ]; then fn_check_logs fi # Create gamelogdir. # If variable exists gamelogdir exists and log/server does not. -if [ "${gamelogdir}" ]&&[ -d "${gamelogdir}" ]&&[ ! -d "${logdir}/server" ]; then +if [ "${gamelogdir}" ] && [ -d "${gamelogdir}" ] && [ ! -d "${logdir}/server" ]; then fn_check_logs fi diff --git a/lgsm/functions/check_permissions.sh b/lgsm/functions/check_permissions.sh index 4c8fda389..92a76600b 100755 --- a/lgsm/functions/check_permissions.sh +++ b/lgsm/functions/check_permissions.sh @@ -7,7 +7,7 @@ functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" -fn_check_ownership(){ +fn_check_ownership() { if [ -f "${rootdir}/${selfname}" ]; then if [ "$(find "${rootdir}/${selfname}" -not -user "$(whoami)" | wc -l)" -ne "0" ]; then selfownissue=1 @@ -23,7 +23,7 @@ fn_check_ownership(){ filesownissue=1 fi fi - if [ "${selfownissue}" == "1" ]||[ "${funcownissue}" == "1" ]||[ "${filesownissue}" == "1" ]; then + if [ "${selfownissue}" == "1" ] || [ "${funcownissue}" == "1" ] || [ "${filesownissue}" == "1" ]; then fn_print_fail_nl "Ownership issues found" fn_script_log_fatal "Ownership issues found" fn_print_information_nl "The current user ($(whoami)) does not have ownership of the following files:" @@ -36,7 +36,7 @@ fn_check_ownership(){ if [ "${funcownissue}" == "1" ]; then find "${functionsdir}" -not -user "$(whoami)" -printf "%u\t%g\t%p\n" fi - if [ "${filesownissue}" == "1" ]; then + if [ "${filesownissue}" == "1" ]; then find "${serverfiles}" -not -user "$(whoami)" -printf "%u\t%g\t%p\n" fi @@ -52,7 +52,7 @@ fn_check_ownership(){ fi } -fn_check_permissions(){ +fn_check_permissions() { if [ -d "${functionsdir}" ]; then if [ "$(find "${functionsdir}" -type f -not -executable | wc -l)" -ne "0" ]; then fn_print_fail_nl "Permissions issues found" @@ -78,7 +78,7 @@ fn_check_permissions(){ # Grab the first and second digit for user and group permission. userrootdirperm="${rootdirperm:0:1}" grouprootdirperm="${rootdirperm:1:1}" - if [ "${userrootdirperm}" != "7" ]&&[ "${grouprootdirperm}" != "7" ]; then + if [ "${userrootdirperm}" != "7" ] && [ "${grouprootdirperm}" != "7" ]; then fn_print_fail_nl "Permissions issues found" fn_script_log_fatal "Permissions issues found" fn_print_information_nl "The following directory does not have the correct permissions:" @@ -102,9 +102,9 @@ fn_check_permissions(){ userexecperm="${execperm:0:1}" groupexecperm="${execperm:1:1}" # Check for invalid user permission. - if [ "${userexecperm}" == "0" ]||[ "${userexecperm}" == "2" ]||[ "${userexecperm}" == "4" ]||[ "${userexecperm}" == "6" ]; then + if [ "${userexecperm}" == "0" ] || [ "${userexecperm}" == "2" ] || [ "${userexecperm}" == "4" ] || [ "${userexecperm}" == "6" ]; then # If user permission is invalid, then check for invalid group permissions. - if [ "${groupexecperm}" == "0" ]||[ "${groupexecperm}" == "2" ]||[ "${groupexecperm}" == "4" ]||[ "${groupexecperm}" == "6" ]; then + if [ "${groupexecperm}" == "0" ] || [ "${groupexecperm}" == "2" ] || [ "${groupexecperm}" == "4" ] || [ "${groupexecperm}" == "6" ]; then # If permission issues are found. fn_print_warn_nl "Permissions issue found" fn_script_log_warn "Permissions issue found" @@ -122,18 +122,18 @@ fn_check_permissions(){ # Grab the first and second digit for user and group permission. userexecperm="${execperm:0:1}" groupexecperm="${execperm:1:1}" - if [ "${userexecperm}" == "0" ]||[ "${userexecperm}" == "2" ]||[ "${userexecperm}" == "4" ]||[ "${userexecperm}" == "6" ]; then - if [ "${groupexecperm}" == "0" ]||[ "${groupexecperm}" == "2" ]||[ "${groupexecperm}" == "4" ]||[ "${groupexecperm}" == "6" ]; then - # If errors are still found. - fn_print_fail_nl "The following file could not be set executable:" - ls -l "${executabledir}/${execname}" - fn_script_log_warn "The following file could not be set executable:" - fn_script_log_info "${executabledir}/${execname}" - if [ "${monitorflag}" == "1" ]; then - alert="permissions" - alert.sh - fi - core_exit.sh + if [ "${userexecperm}" == "0" ] || [ "${userexecperm}" == "2" ] || [ "${userexecperm}" == "4" ] || [ "${userexecperm}" == "6" ]; then + if [ "${groupexecperm}" == "0" ] || [ "${groupexecperm}" == "2" ] || [ "${groupexecperm}" == "4" ] || [ "${groupexecperm}" == "6" ]; then + # If errors are still found. + fn_print_fail_nl "The following file could not be set executable:" + ls -l "${executabledir}/${execname}" + fn_script_log_warn "The following file could not be set executable:" + fn_script_log_info "${executabledir}/${execname}" + if [ "${monitorflag}" == "1" ]; then + alert="permissions" + alert.sh + fi + core_exit.sh fi fi fi @@ -144,26 +144,26 @@ fn_check_permissions(){ ## The following fn_sys_perm_* functions checks for permission errors in /sys directory. # Checks for permission errors in /sys directory. -fn_sys_perm_errors_detect(){ +fn_sys_perm_errors_detect() { # Reset test variables. sysdirpermerror="0" classdirpermerror="0" netdirpermerror="0" # Check permissions. # /sys, /sys/class and /sys/class/net should be readable & executable. - if [ ! -r "/sys" ]||[ ! -x "/sys" ]; then + if [ ! -r "/sys" ] || [ ! -x "/sys" ]; then sysdirpermerror="1" fi - if [ ! -r "/sys/class" ]||[ ! -x "/sys/class" ]; then + if [ ! -r "/sys/class" ] || [ ! -x "/sys/class" ]; then classdirpermerror="1" fi - if [ ! -r "/sys/class/net" ]||[ ! -x "/sys/class/net" ]; then + if [ ! -r "/sys/class/net" ] || [ ! -x "/sys/class/net" ]; then netdirpermerror="1" fi } # Display a message on how to fix the issue manually. -fn_sys_perm_fix_manually_msg(){ +fn_sys_perm_fix_manually_msg() { echo -e "" fn_print_information_nl "This error causes servers to fail starting properly" fn_script_log_info "This error causes servers to fail starting properly." @@ -180,7 +180,7 @@ fn_sys_perm_fix_manually_msg(){ } # Attempt to fix /sys related permission errors if sudo is available, exits otherwise. -fn_sys_perm_errors_fix(){ +fn_sys_perm_errors_fix() { if sudo -n true > /dev/null 2>&1; then fn_print_dots "Automatically fixing /sys permissions" fn_script_log_info "Automatically fixing /sys permissions." @@ -195,7 +195,7 @@ fn_sys_perm_errors_fix(){ fi # Run check again to see if it's fixed. fn_sys_perm_errors_detect - if [ "${sysdirpermerror}" == "1" ]||[ "${classdirpermerror}" == "1" ]||[ "${netdirpermerror}" == "1" ]; then + if [ "${sysdirpermerror}" == "1" ] || [ "${classdirpermerror}" == "1" ] || [ "${netdirpermerror}" == "1" ]; then fn_print_error "Could not fix /sys permissions" fn_script_log_error "Could not fix /sys permissions." fn_sleep_time @@ -206,16 +206,16 @@ fn_sys_perm_errors_fix(){ fn_script_log_pass "Permissions in /sys fixed" fi else - # Show the user how to fix. - fn_sys_perm_fix_manually_msg + # Show the user how to fix. + fn_sys_perm_fix_manually_msg fi } # Processes to the /sys related permission errors check & fix/info. -fn_sys_perm_error_process(){ +fn_sys_perm_error_process() { fn_sys_perm_errors_detect # If any error was found. - if [ "${sysdirpermerror}" == "1" ]||[ "${classdirpermerror}" == "1" ]||[ "${netdirpermerror}" == "1" ]; then + if [ "${sysdirpermerror}" == "1" ] || [ "${classdirpermerror}" == "1" ] || [ "${netdirpermerror}" == "1" ]; then fn_print_error_nl "Permission error(s) found in /sys" fn_script_log_error "Permission error(s) found in /sys" # Run the fix diff --git a/lgsm/functions/check_status.sh b/lgsm/functions/check_status.sh index 670669e50..28ec38eb2 100755 --- a/lgsm/functions/check_status.sh +++ b/lgsm/functions/check_status.sh @@ -7,4 +7,4 @@ functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" -status=$(tmux list-sessions -F "#{session_name}" 2>/dev/null | grep -Ecx "^${sessionname}") +status=$(tmux list-sessions -F "#{session_name}" 2> /dev/null | grep -Ecx "^${sessionname}") diff --git a/lgsm/functions/check_system_requirements.sh b/lgsm/functions/check_system_requirements.sh index cc72288fb..bfe597135 100755 --- a/lgsm/functions/check_system_requirements.sh +++ b/lgsm/functions/check_system_requirements.sh @@ -26,19 +26,19 @@ elif [ "${shortname}" == "arma3" ]; then elif [ "${shortname}" == "rust" ]; then ramrequirementmb="4000" ramrequirementgb="4" -elif [ "${shortname}" == "mc" ]||[ "${shortname}" == "pmc" ]||[ "${shortname}" == "wmc" ]; then +elif [ "${shortname}" == "mc" ] || [ "${shortname}" == "pmc" ] || [ "${shortname}" == "wmc" ]; then ramrequirementmb="1000" ramrequirementgb="1" elif [ "${shortname}" == "pstbs" ]; then ramrequirementmb="2000" ramrequirementgb="2" -elif [ "${shortname}" == "ns2" ]||[ "${shortname}" == "ns2c" ]; then +elif [ "${shortname}" == "ns2" ] || [ "${shortname}" == "ns2c" ]; then ramrequirementmb="1000" ramrequirementgb="1" elif [ "${shortname}" == "st" ]; then ramrequirementmb="1000" ramrequirementgb="1" -elif [ "${shortname}" == "pvr" ];then +elif [ "${shortname}" == "pvr" ]; then ramrequirementmb="2000" ramrequirementgb="2" fi diff --git a/lgsm/functions/check_tmuxception.sh b/lgsm/functions/check_tmuxception.sh index e11b55861..64705a3a8 100755 --- a/lgsm/functions/check_tmuxception.sh +++ b/lgsm/functions/check_tmuxception.sh @@ -7,8 +7,8 @@ functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" -fn_check_is_in_tmux(){ - if [ "${TMUX}" ]; then +fn_check_is_in_tmux() { + if [ "${TMUX}" ]; then fn_print_fail_nl "tmuxception error: Sorry Cobb you cannot start a tmux session inside of a tmux session." fn_script_log_fatal "Tmuxception error: Attempted to start a tmux session inside of a tmux session." fn_print_information_nl "LinuxGSM creates a tmux session when starting the server." @@ -18,7 +18,7 @@ fn_check_is_in_tmux(){ fi } -fn_check_is_in_screen(){ +fn_check_is_in_screen() { if [ "${STY}" ]; then fn_print_fail_nl "tmuxception error: Sorry Cobb you cannot start a tmux session inside of a screen session." fn_script_log_fatal "Tmuxception error: Attempted to start a tmux session inside of a screen session." diff --git a/lgsm/functions/check_version.sh b/lgsm/functions/check_version.sh index a0f3d4435..657e32b54 100755 --- a/lgsm/functions/check_version.sh +++ b/lgsm/functions/check_version.sh @@ -8,7 +8,7 @@ functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" -if [ -n "${modulesversion}" ]&&[ -n "${version}" ]&&[ "${version}" != "${modulesversion}" ]; then +if [ -n "${modulesversion}" ] && [ -n "${version}" ] && [ "${version}" != "${modulesversion}" ]; then exitbypass=1 echo -e "" fn_print_error_nl "LinuxGSM version mismatch" diff --git a/lgsm/functions/command_backup.sh b/lgsm/functions/command_backup.sh index adce957c9..0dfabcd03 100644 --- a/lgsm/functions/command_backup.sh +++ b/lgsm/functions/command_backup.sh @@ -13,7 +13,7 @@ fn_firstcommand_set check.sh # Trap to remove lockfile on quit. -fn_backup_trap(){ +fn_backup_trap() { echo -e "" echo -en "backup ${backupname}.tar.gz..." fn_print_canceled_eol_nl @@ -30,7 +30,7 @@ fn_backup_trap(){ } # Check if a backup is pending or has been aborted using backup.lock. -fn_backup_check_lockfile(){ +fn_backup_check_lockfile() { if [ -f "${lockdir}/backup.lock" ]; then fn_print_info_nl "Lock file found: Backup is currently running" fn_script_log_error "Lock file found: Backup is currently running: ${lockdir}/backup.lock" @@ -39,7 +39,7 @@ fn_backup_check_lockfile(){ } # Initialisation. -fn_backup_init(){ +fn_backup_init() { # Backup file name with selfname and current date. backupname="${selfname}-$(date '+%Y-%m-%d-%H%M%S')" @@ -47,7 +47,7 @@ fn_backup_init(){ fn_print_dots "Backup starting" fn_script_log_info "Backup starting" fn_print_ok_nl "Backup starting" - if [ ! -d "${backupdir}" ]||[ "${backupcount}" == "0" ]; then + if [ ! -d "${backupdir}" ] || [ "${backupcount}" == "0" ]; then fn_print_info_nl "There are no previous backups" else if [ "${lastbackupdaysago}" == "0" ]; then @@ -62,7 +62,7 @@ fn_backup_init(){ } # Check if server is started and whether to stop it. -fn_backup_stop_server(){ +fn_backup_stop_server() { check_status.sh # Server is running but will not be stopped. if [ "${stoponbackup}" == "off" ]; then @@ -82,7 +82,7 @@ fn_backup_stop_server(){ } # Create required folders. -fn_backup_dir(){ +fn_backup_dir() { # Create backupdir if it doesn't exist. if [ ! -d "${backupdir}" ]; then mkdir -p "${backupdir}" @@ -90,17 +90,17 @@ fn_backup_dir(){ } # Migrate Backups from old dir before refactor -fn_backup_migrate_olddir(){ +fn_backup_migrate_olddir() { # Check if old backup dir is there before the refactor and move the backups if [ -d "${rootdir}/backups" ]; then if [ "${rootdir}/backups" != "${backupdir}" ]; then fn_print_dots "Backup directory is being migrated" fn_script_log_info "Backup directory is being migrated" fn_script_log_info "${rootdir}/backups > ${backupdir}" - mv "${rootdir}/backups/"* "${backupdir}" 2>/dev/null + mv "${rootdir}/backups/"* "${backupdir}" 2> /dev/null exitcode=$? if [ "${exitcode}" -eq 0 ]; then - rmdir "${rootdir}/backups" 2>/dev/null + rmdir "${rootdir}/backups" 2> /dev/null exitcode=$? fi if [ "${exitcode}" -eq 0 ]; then @@ -114,7 +114,7 @@ fn_backup_migrate_olddir(){ fi } -fn_backup_create_lockfile(){ +fn_backup_create_lockfile() { # Create lockfile. date '+%s' > "${lockdir}/backup.lock" fn_script_log_info "Lockfile generated" @@ -124,7 +124,7 @@ fn_backup_create_lockfile(){ } # Compressing files. -fn_backup_compression(){ +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" @@ -133,7 +133,7 @@ fn_backup_compression(){ excludedir=$(fn_backup_relpath) # Check that excludedir is a valid path. - if [ ! -d "${excludedir}" ] ; then + if [ ! -d "${excludedir}" ]; then fn_print_fail_nl "Problem identifying the previous backup directory for exclusion." fn_script_log_fatal "Problem identifying the previous backup directory for exclusion" core_exit.sh @@ -157,17 +157,17 @@ fn_backup_compression(){ } # Clear old backups according to maxbackups and maxbackupdays variables. -fn_backup_prune(){ +fn_backup_prune() { # Clear if backup variables are set. - if [ "${maxbackups}" ]&&[ -n "${maxbackupdays}" ]; then + if [ "${maxbackups}" ] && [ -n "${maxbackupdays}" ]; then # How many backups there are. info_distro.sh # How many backups exceed maxbackups. - backupquotadiff=$((backupcount-maxbackups)) + backupquotadiff=$((backupcount - maxbackups)) # How many backups exceed maxbackupdays. - backupsoudatedcount=$(find "${backupdir}"/ -type f -name "*.tar.gz" -mtime +"${maxbackupdays}"|wc -l) + backupsoudatedcount=$(find "${backupdir}"/ -type f -name "*.tar.gz" -mtime +"${maxbackupdays}" | wc -l) # If anything can be cleared. - if [ "${backupquotadiff}" -gt "0" ]||[ "${backupsoudatedcount}" -gt "0" ]; then + if [ "${backupquotadiff}" -gt "0" ] || [ "${backupsoudatedcount}" -gt "0" ]; then fn_print_dots "Pruning" fn_script_log_info "Backup pruning activated" fn_print_ok_nl "Pruning" @@ -220,32 +220,32 @@ fn_backup_relpath() { # Compare the leading entries of each array. These common elements will be clipped off. # for the relative path output. - for ((base=0; base<${#rdirtoks[@]}; base++)); do + for ((base = 0; base < ${#rdirtoks[@]}; base++)); do [[ "${rdirtoks[$base]}" != "${bdirtoks[$base]}" ]] && break done # Next, climb out of the remaining rootdir location with updir references. - for ((x=base;x<${#rdirtoks[@]};x++)); do + for ((x = base; x < ${#rdirtoks[@]}; x++)); do echo -n "../" done # Climb down the remaining components of the backupdir location. - for ((x=base;x<$(( ${#bdirtoks[@]} - 1 ));x++)); do + for ((x = base; x < $((${#bdirtoks[@]} - 1)); x++)); do echo -n "${bdirtoks[$x]}/" done # In the event there were no directories left in the backupdir above to # traverse down, just add a newline. Otherwise at this point, there is # one remaining directory component in the backupdir to navigate. - if (( "$base" < "${#bdirtoks[@]}" )) ; then - echo -e "${bdirtoks[ $(( ${#bdirtoks[@]} - 1)) ]}" + if (("$base" < "${#bdirtoks[@]}")); then + echo -e "${bdirtoks[$((${#bdirtoks[@]} - 1))]}" else echo fi } # Start the server if it was stopped for the backup. -fn_backup_start_server(){ +fn_backup_start_server() { if [ -n "${startserver}" ]; then exitbypass=1 command_start.sh diff --git a/lgsm/functions/command_debug.sh b/lgsm/functions/command_debug.sh index 086b06588..190a8c527 100755 --- a/lgsm/functions/command_debug.sh +++ b/lgsm/functions/command_debug.sh @@ -11,7 +11,7 @@ functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_firstcommand_set # Trap to remove lockfile on quit. -fn_lockfile_trap(){ +fn_lockfile_trap() { # Remove lockfile. rm -f "${lockdir:?}/${selfname}.lock" # resets terminal. Servers can sometimes mess up the terminal on exit. @@ -70,7 +70,7 @@ fi fn_reload_startparameters echo -e "${lightblue}Start parameters:${default}" -if [ "${engine}" == "source" ]||[ "${engine}" == "goldsrc" ]; then +if [ "${engine}" == "source" ] || [ "${engine}" == "goldsrc" ]; then echo -e "${executable} ${startparameters} -debug" elif [ "${engine}" == "quake" ]; then echo -e "${executable} ${startparameters} -condebug" @@ -111,7 +111,7 @@ else fi # Note: do not add double quotes to ${executable} ${startparameters}. -if [ "${engine}" == "source" ]||[ "${engine}" == "goldsrc" ]; then +if [ "${engine}" == "source" ] || [ "${engine}" == "goldsrc" ]; then eval "${executable} ${startparameters} -debug" elif [ "${engine}" == "quake" ]; then eval "${executable} ${startparameters} -condebug" diff --git a/lgsm/functions/command_details.sh b/lgsm/functions/command_details.sh index 2daeeb2f7..08d9f031b 100755 --- a/lgsm/functions/command_details.sh +++ b/lgsm/functions/command_details.sh @@ -15,7 +15,7 @@ check.sh info_distro.sh info_game.sh info_messages.sh -if [ "${querymode}" == "2" ]||[ "${querymode}" == "3" ]; then +if [ "${querymode}" == "2" ] || [ "${querymode}" == "3" ]; then for queryip in "${queryips[@]}"; do query_gamedig.sh if [ "${querystatus}" == "0" ]; then @@ -30,7 +30,7 @@ fn_info_message_gameserver fn_info_message_script fn_info_message_backup # Some game servers do not have parms. -if [ "${shortname}" != "jc2" ]&&[ "${shortname}" != "dst" ]&&[ "${shortname}" != "pz" ]&&[ "${engine}" != "renderware" ]; then +if [ "${shortname}" != "jc2" ] && [ "${shortname}" != "dst" ] && [ "${shortname}" != "pz" ] && [ "${engine}" != "renderware" ]; then fn_info_message_commandlineparms fi fn_info_message_ports_edit diff --git a/lgsm/functions/command_dev_detect_deps.sh b/lgsm/functions/command_dev_detect_deps.sh index 976bf94dc..d16b74418 100755 --- a/lgsm/functions/command_dev_detect_deps.sh +++ b/lgsm/functions/command_dev_detect_deps.sh @@ -15,26 +15,26 @@ echo -e "Dependencies Checker" echo -e "=================================" echo -e "Checking directory: " echo -e "${serverfiles}" -if [ "$(command -v eu-readelf 2>/dev/null)" ]; then +if [ "$(command -v eu-readelf 2> /dev/null)" ]; then readelf=eu-readelf -elif [ "$(command -v readelf 2>/dev/null)" ]; then +elif [ "$(command -v readelf 2> /dev/null)" ]; then readelf=readelf else echo -e "readelf/eu-readelf not installed" fi files=$(find "${serverfiles}" | wc -l) -find "${serverfiles}" -type f -print0 | -while IFS= read -r -d $'\0' line; do - if [ "${readelf}" == "eu-readelf" ]; then - ${readelf} -d "${line}" 2>/dev/null | grep NEEDED| awk '{ print $4 }' | sed 's/\[//g;s/\]//g' >> "${tmpdir}/.depdetect_readelf" - else - ${readelf} -d "${line}" 2>/dev/null | grep NEEDED | awk '{ print $5 }' | sed 's/\[//g;s/\]//g' >> "${tmpdir}/.depdetect_readelf" - fi - echo -n "${i} / ${files}" $'\r' - ((i++)) -done +find "${serverfiles}" -type f -print0 \ + | while IFS= read -r -d $'\0' line; do + if [ "${readelf}" == "eu-readelf" ]; then + ${readelf} -d "${line}" 2> /dev/null | grep NEEDED | awk '{ print $4 }' | sed 's/\[//g;s/\]//g' >> "${tmpdir}/.depdetect_readelf" + else + ${readelf} -d "${line}" 2> /dev/null | grep NEEDED | awk '{ print $5 }' | sed 's/\[//g;s/\]//g' >> "${tmpdir}/.depdetect_readelf" + fi + echo -n "${i} / ${files}" $'\r' + ((i++)) + done -sort "${tmpdir}/.depdetect_readelf" |uniq >"${tmpdir}/.depdetect_readelf_uniq" +sort "${tmpdir}/.depdetect_readelf" | uniq > "${tmpdir}/.depdetect_readelf_uniq" touch "${tmpdir}/.depdetect_centos_list" touch "${tmpdir}/.depdetect_ubuntu_list" @@ -42,7 +42,7 @@ touch "${tmpdir}/.depdetect_debian_list" while read -r lib; do echo -e "${lib}" - libs_array=( libm.so.6 libc.so.6 libtcmalloc_minimal.so.4 libpthread.so.0 libdl.so.2 libnsl.so.1 libgcc_s.so.1 librt.so.1 ld-linux.so.2 libdbus-glib-1.so.2 libgio-2.0.so.0 libglib-2.0.so.0 libGL.so.1 libgobject-2.0.so.0 libnm-glib.so.4 libnm-util.so.2 ) + libs_array=(libm.so.6 libc.so.6 libtcmalloc_minimal.so.4 libpthread.so.0 libdl.so.2 libnsl.so.1 libgcc_s.so.1 librt.so.1 ld-linux.so.2 libdbus-glib-1.so.2 libgio-2.0.so.0 libglib-2.0.so.0 libGL.so.1 libgobject-2.0.so.0 libnm-glib.so.4 libnm-util.so.2) for lib_file in "${libs_array[@]}"; do if [ "${lib}" == "${lib_file}" ]; then echo -e "glibc.i686" >> "${tmpdir}/.depdetect_centos_list" @@ -52,7 +52,7 @@ while read -r lib; do fi done - libs_array=( libawt.so libjava.so libjli.so libjvm.so libnet.so libnio.so libverify.so ) + libs_array=(libawt.so libjava.so libjli.so libjvm.so libnet.so libnio.so libverify.so) for lib_file in "${libs_array[@]}"; do if [ "${lib}" == "${lib_file}" ]; then echo -e "java-1.8.0-openjdk" >> "${tmpdir}/.depdetect_centos_list" @@ -62,7 +62,7 @@ while read -r lib; do fi done - libs_array=( libtier0.so libtier0_srv.so libvstdlib_srv.so Core.so libvstdlib.so libtier0_s.so Editor.so Engine.so liblua.so libsteam_api.so ld-linux-x86-64.so.2 libPhysX3_x86.so libPhysX3Common_x86.so libPhysX3Cooking_x86.so) + libs_array=(libtier0.so libtier0_srv.so libvstdlib_srv.so Core.so libvstdlib.so libtier0_s.so Editor.so Engine.so liblua.so libsteam_api.so ld-linux-x86-64.so.2 libPhysX3_x86.so libPhysX3Common_x86.so libPhysX3Cooking_x86.so) for lib_file in "${libs_array[@]}"; do # Known shared libs what dont requires dependencies. if [ "${lib}" == "${lib_file}" ]; then @@ -85,12 +85,12 @@ while read -r lib; do echo -e "libcurl4-gnutls-dev:i386" >> "${tmpdir}/.depdetect_ubuntu_list" echo -e "libcurl4-gnutls-dev:i386" >> "${tmpdir}/.depdetect_debian_list" libdetected=1 - elif [ "${lib}" == "libspeex.so.1" ]||[ "${lib}" == "libspeexdsp.so.1" ]; then + elif [ "${lib}" == "libspeex.so.1" ] || [ "${lib}" == "libspeexdsp.so.1" ]; then echo -e "speex.i686" >> "${tmpdir}/.depdetect_centos_list" echo -e "speex:i386" >> "${tmpdir}/.depdetect_ubuntu_list" echo -e "speex:i386" >> "${tmpdir}/.depdetect_debian_list" libdetected=1 - elif [ "${lib}" == "./libSDL-1.2.so.0" ]||[ "${lib}" == "libSDL-1.2.so.0" ]; then + elif [ "${lib}" == "./libSDL-1.2.so.0" ] || [ "${lib}" == "libSDL-1.2.so.0" ]; then echo -e "SDL.i686" >> "${tmpdir}/.depdetect_centos_list" echo -e "libsdl1.2debian" >> "${tmpdir}/.depdetect_ubuntu_list" echo -e "libsdl1.2debian" >> "${tmpdir}/.depdetect_debian_list" diff --git a/lgsm/functions/command_dev_detect_glibc.sh b/lgsm/functions/command_dev_detect_glibc.sh index 304d255fd..73280e55d 100755 --- a/lgsm/functions/command_dev_detect_glibc.sh +++ b/lgsm/functions/command_dev_detect_glibc.sh @@ -34,8 +34,7 @@ elif [ -f "${serverfiles}" ]; then fi echo -e "" - -glibc_check_dir_array=( steamcmddir serverfiles ) +glibc_check_dir_array=(steamcmddir serverfiles) for glibc_check_var in "${glibc_check_dir_array[@]}"; do if [ "${glibc_check_var}" == "serverfiles" ]; then glibc_check_dir="${serverfiles}" @@ -47,23 +46,23 @@ for glibc_check_var in "${glibc_check_dir_array[@]}"; do if [ -d "${glibc_check_dir}" ]; then glibc_check_files=$(find "${glibc_check_dir}" | wc -l) - find "${glibc_check_dir}" -type f -print0 | - while IFS= read -r -d $'\0' line; do - glibcversion=$(objdump -T "${line}" 2>/dev/null | grep -oP "GLIBC[^ ]+" | grep -v GLIBCXX | sort | uniq | sort -r --version-sort | head -n 1) - if [ "${glibcversion}" ]; then - echo -e "${glibcversion}: ${line}" >>"${tmpdir}/detect_glibc_files_${glibc_check_var}.tmp" - fi - objdump -T "${line}" 2>/dev/null | grep -oP "GLIBC[^ ]+" >>"${tmpdir}/detect_glibc_${glibc_check_var}.tmp" - echo -n "${i} / ${glibc_check_files}" $'\r' - ((i++)) - done - echo -e "" - echo -e "" - echo -e "${glibc_check_name} glibc Requirements" - echo -e "=================================" + find "${glibc_check_dir}" -type f -print0 \ + | while IFS= read -r -d $'\0' line; do + glibcversion=$(objdump -T "${line}" 2> /dev/null | grep -oP "GLIBC[^ ]+" | grep -v GLIBCXX | sort | uniq | sort -r --version-sort | head -n 1) + if [ "${glibcversion}" ]; then + echo -e "${glibcversion}: ${line}" >> "${tmpdir}/detect_glibc_files_${glibc_check_var}.tmp" + fi + objdump -T "${line}" 2> /dev/null | grep -oP "GLIBC[^ ]+" >> "${tmpdir}/detect_glibc_${glibc_check_var}.tmp" + echo -n "${i} / ${glibc_check_files}" $'\r' + ((i++)) + done + echo -e "" + echo -e "" + echo -e "${glibc_check_name} glibc Requirements" + echo -e "=================================" if [ -f "${tmpdir}/detect_glibc_files_${glibc_check_var}.tmp" ]; then echo -e "Required glibc" - cat "${tmpdir}/detect_glibc_${glibc_check_var}.tmp" | sort | uniq | sort -r --version-sort | head -1 |tee -a "${tmpdir}/detect_glibc_highest.tmp" + cat "${tmpdir}/detect_glibc_${glibc_check_var}.tmp" | sort | uniq | sort -r --version-sort | head -1 | tee -a "${tmpdir}/detect_glibc_highest.tmp" echo -e "" echo -e "Files requiring GLIBC" echo -e "Highest verion required: filename" diff --git a/lgsm/functions/command_dev_detect_ldd.sh b/lgsm/functions/command_dev_detect_ldd.sh index 7d6e942a1..43630d4e9 100755 --- a/lgsm/functions/command_dev_detect_ldd.sh +++ b/lgsm/functions/command_dev_detect_ldd.sh @@ -31,21 +31,19 @@ touch "${tmpdir}/detect_ldd.tmp" touch "${tmpdir}/detect_ldd_not_found.tmp" files=$(find "${serverfiles}" | wc -l) -find "${serverfiles}" -type f -print0 | -while IFS= read -r -d $'\0' line; do - if ldd "${line}" 2>/dev/null | grep -v "not a dynamic executable" - then - echo -e "${line}" >> "${tmpdir}/detect_ldd.tmp" - ldd "${line}" 2>/dev/null | grep -v "not a dynamic executable" >> "${tmpdir}/detect_ldd.tmp" - if ldd "${line}" 2>/dev/null | grep -v "not a dynamic executable" | grep "not found" - then - echo -e "${line}" >> "${tmpdir}/detect_ldd_not_found.tmp" - ldd "${line}" 2>/dev/null | grep -v "not a dynamic executable" | grep "not found" >> "${tmpdir}/detect_ldd_not_found.tmp" +find "${serverfiles}" -type f -print0 \ + | while IFS= read -r -d $'\0' line; do + if ldd "${line}" 2> /dev/null | grep -v "not a dynamic executable"; then + echo -e "${line}" >> "${tmpdir}/detect_ldd.tmp" + ldd "${line}" 2> /dev/null | grep -v "not a dynamic executable" >> "${tmpdir}/detect_ldd.tmp" + if ldd "${line}" 2> /dev/null | grep -v "not a dynamic executable" | grep "not found"; then + echo -e "${line}" >> "${tmpdir}/detect_ldd_not_found.tmp" + ldd "${line}" 2> /dev/null | grep -v "not a dynamic executable" | grep "not found" >> "${tmpdir}/detect_ldd_not_found.tmp" + fi fi - fi - echo -n "$i / $files" $'\r' - ((i++)) -done + echo -n "$i / $files" $'\r' + ((i++)) + done echo -e "" echo -e "" echo -e "All" diff --git a/lgsm/functions/command_dev_query_raw.sh b/lgsm/functions/command_dev_query_raw.sh index c9123ebcb..91db16584 100755 --- a/lgsm/functions/command_dev_query_raw.sh +++ b/lgsm/functions/command_dev_query_raw.sh @@ -26,175 +26,174 @@ echo -e "" echo -e "${lightgreen}Game Server Ports${default}" echo -e "==================================================================" { -echo -e "${lightblue}Port Name \tPort Number \tStatus \tTCP \tUDP${default}" -if [ -v port ]; then - echo -e "Game: \t${port} \t$(ss -tupl|grep ${port}|wc -l) \t$(ss -tupl|grep ${port}|grep tcp|awk '{ print $2 }') \t$(ss -tupl|grep ${port}|grep udp|awk '{ print $2 }')" -else - echo -e "Game:" -fi -if [ "${shortname}" == "rw" ]; then - if [ -v port2 ]; then - echo -e "Game+1: \t${port2} \t$(ss -tupl|grep ${port}|wc -l) \t$(ss -tupl|grep ${port2}|grep tcp|awk '{ print $2 }') \t$(ss -tupl|grep ${port2}|grep udp|awk '{ print $2 }')" + echo -e "${lightblue}Port Name \tPort Number \tStatus \tTCP \tUDP${default}" + if [ -v port ]; then + echo -e "Game: \t${port} \t$(ss -tupl | grep ${port} | wc -l) \t$(ss -tupl | grep ${port} | grep tcp | awk '{ print $2 }') \t$(ss -tupl | grep ${port} | grep udp | awk '{ print $2 }')" else - echo -e "Game+1:" + echo -e "Game:" fi + if [ "${shortname}" == "rw" ]; then + if [ -v port2 ]; then + echo -e "Game+1: \t${port2} \t$(ss -tupl | grep ${port} | wc -l) \t$(ss -tupl | grep ${port2} | grep tcp | awk '{ print $2 }') \t$(ss -tupl | grep ${port2} | grep udp | awk '{ print $2 }')" + else + echo -e "Game+1:" + fi - if [ -v port3 ]; then - echo -e "Game+2: \t${port3} \t$(ss -tupl|grep ${port}|wc -l) \t$(ss -tupl|grep ${port3}|grep tcp|awk '{ print $2 }') \t$(ss -tupl|grep ${port3}|grep udp|awk '{ print $2 }')" - else - echo -e "Game+2:" + if [ -v port3 ]; then + echo -e "Game+2: \t${port3} \t$(ss -tupl | grep ${port} | wc -l) \t$(ss -tupl | grep ${port3} | grep tcp | awk '{ print $2 }') \t$(ss -tupl | grep ${port3} | grep udp | awk '{ print $2 }')" + else + echo -e "Game+2:" + fi + + if [ -v port4 ]; then + echo -e "Game+3: \t${port4} \t$(ss -tupl | grep ${port} | wc -l) \t$(ss -tupl | grep ${port4} | grep tcp | awk '{ print $2 }') \t$(ss -tupl | grep ${port4} | grep udp | awk '{ print $2 }')" + else + echo -e "Game+3:" + fi fi - if [ -v port4 ]; then - echo -e "Game+3: \t${port4} \t$(ss -tupl|grep ${port}|wc -l) \t$(ss -tupl|grep ${port4}|grep tcp|awk '{ print $2 }') \t$(ss -tupl|grep ${port4}|grep udp|awk '{ print $2 }')" + if [ -v port401 ]; then + echo -e "Game+400: \t${port401} \t$(ss -tupl | grep ${port401} | wc -l) \t$(ss -tupl | grep ${port401} | grep tcp | awk '{ print $2 }') \t$(ss -tupl | grep ${port401} | grep udp | awk '{ print $2 }')" else - echo -e "Game+3:" + echo -e "Game+400:" fi -fi - -if [ -v port401 ]; then - echo -e "Game+400: \t${port401} \t$(ss -tupl|grep ${port401}|wc -l) \t$(ss -tupl|grep ${port401}|grep tcp|awk '{ print $2 }') \t$(ss -tupl|grep ${port401}|grep udp|awk '{ print $2 }')" -else - echo -e "Game+400:" -fi - -if [ -v portipv6 ]; then - echo -e "Game ipv6: \t${portipv6} \t$(ss -tupl|grep ${portipv6}|wc -l) \t$(ss -tupl|grep ${portipv6}|grep tcp|awk '{ print $2 }') \t$(ss -tupl|grep ${portipv6}|grep udp|awk '{ print $2 }')" -else - echo -e "Game ipv6:" -fi -if [ -v queryport ]; then - echo -e "Query: \t${queryport} \t$(ss -tupl|grep ${queryport}|wc -l) \t$(ss -tupl|grep ${queryport}|grep tcp|awk '{ print $2 }') \t$(ss -tupl|grep ${queryport}|grep udp|awk '{ print $2 }')" -else - echo -e "Query:" -fi + if [ -v portipv6 ]; then + echo -e "Game ipv6: \t${portipv6} \t$(ss -tupl | grep ${portipv6} | wc -l) \t$(ss -tupl | grep ${portipv6} | grep tcp | awk '{ print $2 }') \t$(ss -tupl | grep ${portipv6} | grep udp | awk '{ print $2 }')" + else + echo -e "Game ipv6:" + fi -if [ -v httpport ]; then - echo -e "HTTP: \t${httpport} \t$(ss -tupl|grep ${httpport}|wc -l) \t$(ss -tupl|grep ${httpport}|grep tcp|awk '{ print $2 }') \t$(ss -tupl|grep ${httpport}|grep udp|awk '{ print $2 }')" -else - echo -e "HTTP:" -fi + if [ -v queryport ]; then + echo -e "Query: \t${queryport} \t$(ss -tupl | grep ${queryport} | wc -l) \t$(ss -tupl | grep ${queryport} | grep tcp | awk '{ print $2 }') \t$(ss -tupl | grep ${queryport} | grep udp | awk '{ print $2 }')" + else + echo -e "Query:" + fi -if [ -v httpqueryport ]; then - echo -e "HTTP Query: \t${httpqueryport} \t$(ss -tupl|grep ${httpqueryport}|wc -l) \t$(ss -tupl|grep ${httpqueryport}|grep tcp|awk '{ print $2 }') \t$(ss -tupl|grep ${httpqueryport}|grep udp|awk '{ print $2 }')" -else - echo -e "HTTP Query:" -fi + if [ -v httpport ]; then + echo -e "HTTP: \t${httpport} \t$(ss -tupl | grep ${httpport} | wc -l) \t$(ss -tupl | grep ${httpport} | grep tcp | awk '{ print $2 }') \t$(ss -tupl | grep ${httpport} | grep udp | awk '{ print $2 }')" + else + echo -e "HTTP:" + fi + if [ -v httpqueryport ]; then + echo -e "HTTP Query: \t${httpqueryport} \t$(ss -tupl | grep ${httpqueryport} | wc -l) \t$(ss -tupl | grep ${httpqueryport} | grep tcp | awk '{ print $2 }') \t$(ss -tupl | grep ${httpqueryport} | grep udp | awk '{ print $2 }')" + else + echo -e "HTTP Query:" + fi -if [ -v webadminport ]; then - echo -e "Web Admin: \t${webadminport} \t$(ss -tupl|grep ${webadminport}|wc -l) \t$(ss -tupl|grep ${webadminport}|grep tcp|awk '{ print $2 }') \t$(ss -tupl|grep ${webadminport}|grep udp|awk '{ print $2 }')" -else - echo -e "Web Admin:" -fi + if [ -v webadminport ]; then + echo -e "Web Admin: \t${webadminport} \t$(ss -tupl | grep ${webadminport} | wc -l) \t$(ss -tupl | grep ${webadminport} | grep tcp | awk '{ print $2 }') \t$(ss -tupl | grep ${webadminport} | grep udp | awk '{ print $2 }')" + else + echo -e "Web Admin:" + fi -if [ -v clientport ]; then - echo -e "Client: \t${clientport} \t$(ss -tupl|grep ${clientport}|wc -l) \t$(ss -tupl|grep ${clientport}|grep tcp|awk '{ print $2 }') \t$(ss -tupl|grep ${clientport}|grep udp|awk '{ print $2 }')" -else - echo -e "Client:" -fi + if [ -v clientport ]; then + echo -e "Client: \t${clientport} \t$(ss -tupl | grep ${clientport} | wc -l) \t$(ss -tupl | grep ${clientport} | grep tcp | awk '{ print $2 }') \t$(ss -tupl | grep ${clientport} | grep udp | awk '{ print $2 }')" + else + echo -e "Client:" + fi -if [ -v rconport ]; then - echo -e "RCON: \t${rconport} \t$(ss -tupl|grep ${rconport}|wc -l) \t$(ss -tupl|grep ${rconport}|grep tcp|awk '{ print $2 }') \t$(ss -tupl|grep ${rconport}|grep udp|awk '{ print $2 }')" -else - echo -e "RCON:" -fi + if [ -v rconport ]; then + echo -e "RCON: \t${rconport} \t$(ss -tupl | grep ${rconport} | wc -l) \t$(ss -tupl | grep ${rconport} | grep tcp | awk '{ print $2 }') \t$(ss -tupl | grep ${rconport} | grep udp | awk '{ print $2 }')" + else + echo -e "RCON:" + fi -if [ -v rawport ]; then - echo -e "RAW UDP Socket: \t${rawport} \t$(ss -tupl|grep ${rawport}|wc -l) \t$(ss -tupl|grep ${rawport}|grep tcp|awk '{ print $2 }') \t$(ss -tupl|grep ${rawport}|grep udp|awk '{ print $2 }')" -else - echo -e "RAW UDP Socket:" -fi + if [ -v rawport ]; then + echo -e "RAW UDP Socket: \t${rawport} \t$(ss -tupl | grep ${rawport} | wc -l) \t$(ss -tupl | grep ${rawport} | grep tcp | awk '{ print $2 }') \t$(ss -tupl | grep ${rawport} | grep udp | awk '{ print $2 }')" + else + echo -e "RAW UDP Socket:" + fi -if [ -v masterport ]; then - echo -e "Game: Master: \t${masterport} \t$(ss -tupl|grep ${masterport}|wc -l) \t$(ss -tupl|grep ${masterport}|grep tcp|awk '{ print $2 }') \t$(ss -tupl|grep ${masterport}|grep udp|awk '{ print $2 }')" -else - echo -e "Game: Master:" -fi + if [ -v masterport ]; then + echo -e "Game: Master: \t${masterport} \t$(ss -tupl | grep ${masterport} | wc -l) \t$(ss -tupl | grep ${masterport} | grep tcp | awk '{ print $2 }') \t$(ss -tupl | grep ${masterport} | grep udp | awk '{ print $2 }')" + else + echo -e "Game: Master:" + fi -if [ -v steamport ]; then - echo -e "Steam: \t${steamport} \t$(ss -tupl|grep ${steamport}|wc -l) \t$(ss -tupl|grep ${steamport}|grep tcp|awk '{ print $2 }') \t$(ss -tupl|grep ${steamport}|grep udp|awk '{ print $2 }')" -else - echo -e "Steam:" -fi + if [ -v steamport ]; then + echo -e "Steam: \t${steamport} \t$(ss -tupl | grep ${steamport} | wc -l) \t$(ss -tupl | grep ${steamport} | grep tcp | awk '{ print $2 }') \t$(ss -tupl | grep ${steamport} | grep udp | awk '{ print $2 }')" + else + echo -e "Steam:" + fi -if [ -v steamauthport ]; then - echo -e "Steam: Auth: \t${steamauthport} \t$(ss -tupl|grep ${steamauthport}|wc -l) \t$(ss -tupl|grep ${steamauthport}|grep tcp|awk '{ print $2 }') \t$(ss -tupl|grep ${steamauthport}|grep udp|awk '{ print $2 }')" -else - echo -e "Steam: Auth:" -fi + if [ -v steamauthport ]; then + echo -e "Steam: Auth: \t${steamauthport} \t$(ss -tupl | grep ${steamauthport} | wc -l) \t$(ss -tupl | grep ${steamauthport} | grep tcp | awk '{ print $2 }') \t$(ss -tupl | grep ${steamauthport} | grep udp | awk '{ print $2 }')" + else + echo -e "Steam: Auth:" + fi -if [ -v steammasterport ]; then - echo -e "Steam: Master: \t${steammasterport} \t$(ss -tupl|grep ${steammasterport}|wc -l) \t$(ss -tupl|grep ${steammasterport}|grep tcp|awk '{ print $2 }') \t$(ss -tupl|grep ${steammasterport}|grep udp|awk '{ print $2 }')" -else - echo -e "Steam: Master:" -fi + if [ -v steammasterport ]; then + echo -e "Steam: Master: \t${steammasterport} \t$(ss -tupl | grep ${steammasterport} | wc -l) \t$(ss -tupl | grep ${steammasterport} | grep tcp | awk '{ print $2 }') \t$(ss -tupl | grep ${steammasterport} | grep udp | awk '{ print $2 }')" + else + echo -e "Steam: Master:" + fi -if [ -v steamqueryport ]; then - echo -e "Steam: Query: \t${steamqueryport} \t$(ss -tupl|grep ${steamqueryport}|wc -l) \t$(ss -tupl|grep ${steamqueryport}|grep tcp|awk '{ print $2 }') \t$(ss -tupl|grep ${steamqueryport}|grep udp|awk '{ print $2 }')" -else - echo -e "Steam: Query:" -fi -if [ -v beaconport ]; then - echo -e "Beacon: \t${beaconport} \t$(ss -tupl|grep ${beaconport}|wc -l) \t$(ss -tupl|grep ${beaconport}|grep tcp|awk '{ print $2 }') \t$(ss -tupl|grep ${beaconport}|grep udp|awk '{ print $2 }')" -else - echo -e "Beacon:" -fi + if [ -v steamqueryport ]; then + echo -e "Steam: Query: \t${steamqueryport} \t$(ss -tupl | grep ${steamqueryport} | wc -l) \t$(ss -tupl | grep ${steamqueryport} | grep tcp | awk '{ print $2 }') \t$(ss -tupl | grep ${steamqueryport} | grep udp | awk '{ print $2 }')" + else + echo -e "Steam: Query:" + fi + if [ -v beaconport ]; then + echo -e "Beacon: \t${beaconport} \t$(ss -tupl | grep ${beaconport} | wc -l) \t$(ss -tupl | grep ${beaconport} | grep tcp | awk '{ print $2 }') \t$(ss -tupl | grep ${beaconport} | grep udp | awk '{ print $2 }')" + else + echo -e "Beacon:" + fi -if [ -v appport ]; then - echo -e "App: \t${appport} \t$(ss -tupl|grep ${appport}|wc -l) \t$(ss -tupl|grep ${appport}|grep tcp|awk '{ print $2 }') \t$(ss -tupl|grep ${appport}|grep udp|awk '{ print $2 }')" -else - echo -e "App:" -fi + if [ -v appport ]; then + echo -e "App: \t${appport} \t$(ss -tupl | grep ${appport} | wc -l) \t$(ss -tupl | grep ${appport} | grep tcp | awk '{ print $2 }') \t$(ss -tupl | grep ${appport} | grep udp | awk '{ print $2 }')" + else + echo -e "App:" + fi -if [ -v telnetport ]; then - echo -e "Telnet: \t${telnetport} \t$(ss -tupl|grep ${telnetport}|wc -l) \t$(ss -tupl|grep ${telnetport}|grep tcp|awk '{ print $2 }') \t$(ss -tupl|grep ${telnetport}|grep udp|awk '{ print $2 }')" -else - echo -e "Telnet:" -fi + if [ -v telnetport ]; then + echo -e "Telnet: \t${telnetport} \t$(ss -tupl | grep ${telnetport} | wc -l) \t$(ss -tupl | grep ${telnetport} | grep tcp | awk '{ print $2 }') \t$(ss -tupl | grep ${telnetport} | grep udp | awk '{ print $2 }')" + else + echo -e "Telnet:" + fi -if [ -v sourcetvport ]; then - echo -e "SourceTV: \t${sourcetvport} \t$(ss -tupl|grep ${sourcetvport}|wc -l) \t$(ss -tupl|grep ${sourcetvport}|grep tcp|awk '{ print $2 }') \t$(ss -tupl|grep ${sourcetvport}|grep udp|awk '{ print $2 }')" -else - echo -e "SourceTV:" -fi + if [ -v sourcetvport ]; then + echo -e "SourceTV: \t${sourcetvport} \t$(ss -tupl | grep ${sourcetvport} | wc -l) \t$(ss -tupl | grep ${sourcetvport} | grep tcp | awk '{ print $2 }') \t$(ss -tupl | grep ${sourcetvport} | grep udp | awk '{ print $2 }')" + else + echo -e "SourceTV:" + fi -if [ -v fileport ]; then - echo -e "File: \t${fileport} \t$(ss -tupl|grep ${fileport}|wc -l) \t$(ss -tupl|grep ${fileport}|grep tcp|awk '{ print $2 }') \t$(ss -tupl|grep ${fileport}|grep udp|awk '{ print $2 }')" -else - echo -e "File:" -fi + if [ -v fileport ]; then + echo -e "File: \t${fileport} \t$(ss -tupl | grep ${fileport} | wc -l) \t$(ss -tupl | grep ${fileport} | grep tcp | awk '{ print $2 }') \t$(ss -tupl | grep ${fileport} | grep udp | awk '{ print $2 }')" + else + echo -e "File:" + fi -if [ -v udplinkport ]; then - echo -e "UDP Link: \t${udplinkport} \t$(ss -tupl|grep ${udplinkport}|wc -l) \t$(ss -tupl|grep ${udplinkport}|grep tcp|awk '{ print $2 }') \t$(ss -tupl|grep ${udplinkport}|grep udp|awk '{ print $2 }')" -else - echo -e "UDP Link:" -fi + if [ -v udplinkport ]; then + echo -e "UDP Link: \t${udplinkport} \t$(ss -tupl | grep ${udplinkport} | wc -l) \t$(ss -tupl | grep ${udplinkport} | grep tcp | awk '{ print $2 }') \t$(ss -tupl | grep ${udplinkport} | grep udp | awk '{ print $2 }')" + else + echo -e "UDP Link:" + fi -if [ -v voiceport ]; then - echo -e "Voice: \t${voiceport} \t$(ss -tupl|grep ${voiceport}|wc -l) \t$(ss -tupl|grep ${voiceport}|grep tcp|awk '{ print $2 }') \t$(ss -tupl|grep ${voiceport}|grep udp|awk '{ print $2 }')" -else - echo -e "Voice:" -fi + if [ -v voiceport ]; then + echo -e "Voice: \t${voiceport} \t$(ss -tupl | grep ${voiceport} | wc -l) \t$(ss -tupl | grep ${voiceport} | grep tcp | awk '{ print $2 }') \t$(ss -tupl | grep ${voiceport} | grep udp | awk '{ print $2 }')" + else + echo -e "Voice:" + fi -if [ -v voiceunusedport ]; then - echo -e "Voice (Unused): \t${voiceunusedport} \t$(ss -tupl|grep ${voiceunusedport}|wc -l) \t$(ss -tupl|grep ${voiceunusedport}|grep tcp|awk '{ print $2 }') \t$(ss -tupl|grep ${voiceunusedport}|grep udp|awk '{ print $2 }')" -else - echo -e "Voice (Unused):" -fi + if [ -v voiceunusedport ]; then + echo -e "Voice (Unused): \t${voiceunusedport} \t$(ss -tupl | grep ${voiceunusedport} | wc -l) \t$(ss -tupl | grep ${voiceunusedport} | grep tcp | awk '{ print $2 }') \t$(ss -tupl | grep ${voiceunusedport} | grep udp | awk '{ print $2 }')" + else + echo -e "Voice (Unused):" + fi -if [ -v battleeyeport ]; then - echo -e "BattleEye: \t${battleeyeport} \t$(ss -tupl|grep ${battleeyeport}|wc -l) \t$(ss -tupl|grep ${battleeyeport}|grep tcp|awk '{ print $2 }') \t$(ss -tupl|grep ${battleeyeport}|grep udp|awk '{ print $2 }')" -else - echo -e "BattleEye:" -fi + if [ -v battleeyeport ]; then + echo -e "BattleEye: \t${battleeyeport} \t$(ss -tupl | grep ${battleeyeport} | wc -l) \t$(ss -tupl | grep ${battleeyeport} | grep tcp | awk '{ print $2 }') \t$(ss -tupl | grep ${battleeyeport} | grep udp | awk '{ print $2 }')" + else + echo -e "BattleEye:" + fi -if [ -v statsport ]; then - echo -e "Stats: \t${battleeyeport} \t$(ss -tupl|grep ${statsport}|wc -l) \t$(ss -tupl|grep ${statsport}|grep tcp|awk '{ print $2 }') \t$(ss -tupl|grep ${statsport}|grep udp|awk '{ print $2 }')" -else - echo -e "Stats:" -fi + if [ -v statsport ]; then + echo -e "Stats: \t${battleeyeport} \t$(ss -tupl | grep ${statsport} | wc -l) \t$(ss -tupl | grep ${statsport} | grep tcp | awk '{ print $2 }') \t$(ss -tupl | grep ${statsport} | grep udp | awk '{ print $2 }')" + else + echo -e "Stats:" + fi } | column -s $'\t' -t echo -e "" @@ -211,10 +210,10 @@ echo -e "" echo -e "${lightgreen}Gamedig Raw Output${default}" echo -e "=================================" echo -e "" -if [ ! "$(command -v gamedig 2>/dev/null)" ]; then +if [ ! "$(command -v gamedig 2> /dev/null)" ]; then fn_print_failure_nl "gamedig not installed" fi -if [ ! "$(command -v jq 2>/dev/null)" ]; then +if [ ! "$(command -v jq 2> /dev/null)" ]; then fn_print_failure_nl "jq not installed" fi for queryip in "${queryips[@]}"; do diff --git a/lgsm/functions/command_fastdl.sh b/lgsm/functions/command_fastdl.sh index d6ab960bd..e90ccc5e0 100755 --- a/lgsm/functions/command_fastdl.sh +++ b/lgsm/functions/command_fastdl.sh @@ -24,7 +24,7 @@ luafastdlfile="lgsm_cl_force_fastdl.lua" luafastdlfullpath="${luasvautorundir}/${luafastdlfile}" # Check if bzip2 is installed. -if [ ! "$(command -v bzip2 2>/dev/null)" ]; then +if [ ! "$(command -v bzip2 2> /dev/null)" ]; then fn_print_fail "bzip2 is not installed" fn_script_log_fatal "bzip2 is not installed" core_exit.sh @@ -64,7 +64,7 @@ if [ "${shortname}" == "gmod" ]; then fi # Clears any fastdl directory content. -fn_clear_old_fastdl(){ +fn_clear_old_fastdl() { # Clearing old FastDL. if [ -d "${fastdldir}" ]; then echo -en "clearing existing FastDL directory ${fastdldir}..." @@ -81,7 +81,7 @@ fn_clear_old_fastdl(){ fi } -fn_fastdl_dirs(){ +fn_fastdl_dirs() { # Check and create directories. if [ ! -d "${webdir}" ]; then echo -en "creating web directory ${webdir}..." @@ -112,7 +112,7 @@ fn_fastdl_dirs(){ } # Using this gist https://gist.github.com/agunnerson-ibm/efca449565a3e7356906 -fn_human_readable_file_size(){ +fn_human_readable_file_size() { local abbrevs=( $((1 << 60)):ZB $((1 << 50)):EB @@ -142,7 +142,7 @@ fn_human_readable_file_size(){ } # Provides info about the fastdl directory content and prompts for confirmation. -fn_fastdl_preview(){ +fn_fastdl_preview() { # Remove any file list. if [ -f "${tmpdir}/fastdl_files_to_compress.txt" ]; then rm -f "${tmpdir:?}/fastdl_files_to_compress.txt" @@ -152,13 +152,14 @@ fn_fastdl_preview(){ # Garry's Mod if [ "${shortname}" == "gmod" ]; then cd "${systemdir}" || exit - allowed_extentions_array=( "*.ain" "*.bsp" "*.mdl" "*.mp3" "*.ogg" "*.otf" "*.pcf" "*.phy" "*.png" "*.svg" "*.vtf" "*.vmt" "*.vtx" "*.vvd" "*.ttf" "*.wav" ) + allowed_extentions_array=("*.ain" "*.bsp" "*.mdl" "*.mp3" "*.ogg" "*.otf" "*.pcf" "*.phy" "*.png" "*.svg" "*.vtf" "*.vmt" "*.vtx" "*.vvd" "*.ttf" "*.wav") for allowed_extention in "${allowed_extentions_array[@]}"; do fileswc=0 tput sc while read -r ext; do ((fileswc++)) - tput rc; tput el + tput rc + tput el echo -e "gathering ${allowed_extention} : ${fileswc}..." echo -e "${ext}" >> "${tmpdir}/fastdl_files_to_compress.txt" done < <(find . -type f -iname "${allowed_extention}") @@ -170,30 +171,32 @@ fn_fastdl_preview(){ done # Source engine else - fastdl_directories_array=( "maps" "materials" "models" "particles" "sound" "resources" ) + fastdl_directories_array=("maps" "materials" "models" "particles" "sound" "resources") for directory in "${fastdl_directories_array[@]}"; do if [ -d "${systemdir}/${directory}" ]; then if [ "${directory}" == "maps" ]; then - local allowed_extentions_array=( "*.bsp" "*.ain" "*.nav" "*.jpg" "*.txt" ) + local allowed_extentions_array=("*.bsp" "*.ain" "*.nav" "*.jpg" "*.txt") elif [ "${directory}" == "materials" ]; then - local allowed_extentions_array=( "*.vtf" "*.vmt" "*.vbf" "*.png" "*.svg" ) + local allowed_extentions_array=("*.vtf" "*.vmt" "*.vbf" "*.png" "*.svg") elif [ "${directory}" == "models" ]; then - local allowed_extentions_array=( "*.vtx" "*.vvd" "*.mdl" "*.phy" "*.jpg" "*.png" "*.vmt" "*.vtf" ) + local allowed_extentions_array=("*.vtx" "*.vvd" "*.mdl" "*.phy" "*.jpg" "*.png" "*.vmt" "*.vtf") elif [ "${directory}" == "particles" ]; then - local allowed_extentions_array=( "*.pcf" ) + local allowed_extentions_array=("*.pcf") elif [ "${directory}" == "sound" ]; then - local allowed_extentions_array=( "*.wav" "*.mp3" "*.ogg" ) + local allowed_extentions_array=("*.wav" "*.mp3" "*.ogg") fi for allowed_extention in "${allowed_extentions_array[@]}"; do fileswc=0 tput sc while read -r ext; do ((fileswc++)) - tput rc; tput el + tput rc + tput el echo -e "gathering ${directory} ${allowed_extention} : ${fileswc}..." echo -e "${ext}" >> "${tmpdir}/fastdl_files_to_compress.txt" done < <(find "${systemdir}/${directory}" -type f -iname "${allowed_extention}") - tput rc; tput el + tput rc + tput el echo -e "gathering ${directory} ${allowed_extention} : ${fileswc}..." if [ ${fileswc} != 0 ]; then fn_print_ok_eol_nl @@ -211,14 +214,14 @@ fn_fastdl_preview(){ # Calculates total file size. while read -r dufile; do filesize=$(stat -c %s "${dufile}") - filesizetotal=$(( filesizetotal+filesize )) + filesizetotal=$((filesizetotal + filesize)) exitcode=$? if [ "${exitcode}" != 0 ]; then fn_print_fail_eol_nl fn_script_log_fatal "Calculating total file size." core_exit.sh fi - done <"${tmpdir}/fastdl_files_to_compress.txt" + done < "${tmpdir}/fastdl_files_to_compress.txt" else fn_print_fail_eol_nl "generating file list" fn_script_log_fatal "Generating file list." @@ -234,14 +237,15 @@ fn_fastdl_preview(){ } # Builds Garry's Mod fastdl directory content. -fn_fastdl_gmod(){ +fn_fastdl_gmod() { cd "${systemdir}" || exit for allowed_extention in "${allowed_extentions_array[@]}"; do fileswc=0 tput sc while read -r fastdlfile; do ((fileswc++)) - tput rc; tput el + tput rc + tput el echo -e "copying ${allowed_extention} : ${fileswc}..." cp --parents "${fastdlfile}" "${fastdldir}" exitcode=$? @@ -305,30 +309,31 @@ fn_fastdl_gmod(){ while read -r dufile; do filesize=$(du -b "${dufile}" | awk '{ print $1 }') filesizetotal=$((filesizetotal + filesize)) - done <"${tmpdir}/fastdl_files_to_compress.txt" + done < "${tmpdir}/fastdl_files_to_compress.txt" fi } -fn_fastdl_source(){ +fn_fastdl_source() { for directory in "${fastdl_directories_array[@]}"; do if [ -d "${systemdir}/${directory}" ]; then if [ "${directory}" == "maps" ]; then - local allowed_extentions_array=( "*.bsp" "*.ain" "*.nav" "*.jpg" "*.txt" ) + local allowed_extentions_array=("*.bsp" "*.ain" "*.nav" "*.jpg" "*.txt") elif [ "${directory}" == "materials" ]; then - local allowed_extentions_array=( "*.vtf" "*.vmt" "*.vbf" "*.png" "*.svg" ) + local allowed_extentions_array=("*.vtf" "*.vmt" "*.vbf" "*.png" "*.svg") elif [ "${directory}" == "models" ]; then - local allowed_extentions_array=( "*.vtx" "*.vvd" "*.mdl" "*.phy" "*.jpg" "*.png" ) + local allowed_extentions_array=("*.vtx" "*.vvd" "*.mdl" "*.phy" "*.jpg" "*.png") elif [ "${directory}" == "particles" ]; then - local allowed_extentions_array=( "*.pcf" ) + local allowed_extentions_array=("*.pcf") elif [ "${directory}" == "sound" ]; then - local allowed_extentions_array=( "*.wav" "*.mp3" "*.ogg" ) + local allowed_extentions_array=("*.wav" "*.mp3" "*.ogg") fi for allowed_extention in "${allowed_extentions_array[@]}"; do fileswc=0 tput sc while read -r fastdlfile; do ((fileswc++)) - tput rc; tput el + tput rc + tput el echo -e "copying ${directory} ${allowed_extention} : ${fileswc}..." fn_sleep_time # get relative path of file in the dir @@ -357,7 +362,7 @@ fn_fastdl_source(){ } # Builds the fastdl directory content. -fn_fastdl_build(){ +fn_fastdl_build() { # Copy all needed files for FastDL. echo -e "copying files to ${fastdldir}" fn_script_log_info "Copying files to ${fastdldir}" @@ -370,7 +375,7 @@ fn_fastdl_build(){ } # Generate lua file that will force download any file into the FastDL directory. -fn_fastdl_gmod_dl_enforcer(){ +fn_fastdl_gmod_dl_enforcer() { # Clear old lua file. if [ -f "${luafastdlfullpath}" ]; then echo -en "removing existing download enforcer: ${luafastdlfile}..." @@ -406,7 +411,7 @@ fn_fastdl_gmod_dl_enforcer(){ } # Compresses FastDL files using bzip2. -fn_fastdl_bzip2(){ +fn_fastdl_bzip2() { while read -r filetocompress; do echo -en "\r\033[Kcompressing ${filetocompress}..." bzip2 -f "${filetocompress}" @@ -418,7 +423,7 @@ fn_fastdl_bzip2(){ else fn_script_log_pass "Compressing ${filetocompress}" fi - done < <(find "${fastdldir:?}" \( -type f ! -name "*.bz2" \)) + done < <(find "${fastdldir:?}" \( -type f ! -name "*.bz2" \)) fn_print_ok_eol_nl } diff --git a/lgsm/functions/command_install_resources_mta.sh b/lgsm/functions/command_install_resources_mta.sh index 3a94444a3..15f5be22f 100755 --- a/lgsm/functions/command_install_resources_mta.sh +++ b/lgsm/functions/command_install_resources_mta.sh @@ -10,7 +10,7 @@ commandaction="Default Resources" functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_firstcommand_set -fn_install_resources(){ +fn_install_resources() { echo -e "" echo -e "Installing Default Resources" echo -e "=================================" diff --git a/lgsm/functions/command_mods_install.sh b/lgsm/functions/command_mods_install.sh index a5eaaf83c..0edbe5bc0 100755 --- a/lgsm/functions/command_mods_install.sh +++ b/lgsm/functions/command_mods_install.sh @@ -21,7 +21,7 @@ if [ "${installedmodscount}" -gt "0" ]; then echo -e "Installed addons/mods" echo -e "=================================" # Go through all available commands, get details and display them to the user. - for ((llindex=0; llindex < ${#installedmodslist[@]}; llindex++)); do + for ((llindex = 0; llindex < ${#installedmodslist[@]}; llindex++)); do # Current mod is the "llindex" value of the array we're going through. currentmod="${installedmodslist[llindex]}" fn_mod_get_info @@ -40,9 +40,9 @@ compatiblemodslistindex=0 while [ "${compatiblemodslistindex}" -lt "${#compatiblemodslist[@]}" ]; do # Set values for convenience. displayedmodname="${compatiblemodslist[compatiblemodslistindex]}" - displayedmodcommand="${compatiblemodslist[compatiblemodslistindex+1]}" - displayedmodsite="${compatiblemodslist[compatiblemodslistindex+2]}" - displayedmoddescription="${compatiblemodslist[compatiblemodslistindex+3]}" + displayedmodcommand="${compatiblemodslist[compatiblemodslistindex + 1]}" + displayedmodsite="${compatiblemodslist[compatiblemodslistindex + 2]}" + displayedmoddescription="${compatiblemodslist[compatiblemodslistindex + 3]}" # Output mods to the user. echo -e "${displayedmodname} - ${displayedmoddescription} - ${displayedmodsite}" echo -e " * ${cyan}${displayedmodcommand}${default}" @@ -65,8 +65,8 @@ while [[ ! " ${availablemodscommands[@]} " =~ " ${usermodselect} " ]]; do echo -en "Enter an ${cyan}addon/mod${default} to ${green}install${default} (or exit to abort): " read -r usermodselect # Exit if user says exit or abort. - if [ "${usermodselect}" == "exit" ]||[ "${usermodselect}" == "abort" ]; then - core_exit.sh + if [ "${usermodselect}" == "exit" ] || [ "${usermodselect}" == "abort" ]; then + core_exit.sh # Supplementary output upon invalid user input. elif [[ ! " ${availablemodscommands[@]} " =~ " ${usermodselect} " ]]; then fn_print_error2_nl "${usermodselect} is not a valid addon/mod." @@ -100,11 +100,11 @@ if [ "${modcommand}" == "amxmodx" ]; then fn_mod_exist "metamod" fi -if [ "${modcommand}" == "amxmodxcs" ] || - [ "${modcommand}" == "amxmodxdod" ] || - [ "${modcommand}" == "amxmodxtfc" ] || - [ "${modcommand}" == "amxmodxns" ] || - [ "${modcommand}" == "amxmodxts" ]; then +if [ "${modcommand}" == "amxmodxcs" ] \ + || [ "${modcommand}" == "amxmodxdod" ] \ + || [ "${modcommand}" == "amxmodxtfc" ] \ + || [ "${modcommand}" == "amxmodxns" ] \ + || [ "${modcommand}" == "amxmodxts" ]; then fn_mod_exist "amxmodx" fi diff --git a/lgsm/functions/command_mods_remove.sh b/lgsm/functions/command_mods_remove.sh index 8647a21ed..7127dcb3c 100755 --- a/lgsm/functions/command_mods_remove.sh +++ b/lgsm/functions/command_mods_remove.sh @@ -21,7 +21,7 @@ echo -e "=================================" # Displays list of installed mods. # Generates list to display to user. fn_mods_installed_list -for ((mlindex=0; mlindex < ${#installedmodslist[@]}; mlindex++)); do +for ((mlindex = 0; mlindex < ${#installedmodslist[@]}; mlindex++)); do # Current mod is the "mlindex" value of the array we are going through. currentmod="${installedmodslist[mlindex]}" # Get mod info. @@ -36,7 +36,7 @@ while [[ ! " ${installedmodslist[@]} " =~ " ${usermodselect} " ]]; do echo -en "Enter an ${cyan}addon/mod${default} to ${red}remove${default} (or exit to abort): " read -r usermodselect # Exit if user says exit or abort. - if [ "${usermodselect}" == "exit" ]||[ "${usermodselect}" == "abort" ]; then + if [ "${usermodselect}" == "exit" ] || [ "${usermodselect}" == "abort" ]; then core_exit.sh # Supplementary output upon invalid user input. elif [[ ! " ${availablemodscommands[@]} " =~ " ${usermodselect} " ]]; then @@ -68,9 +68,9 @@ while [ "${modfileline}" -le "${modsfilelistsize}" ]; do currentfileremove=$(sed "${modfileline}q;d" "${modsdir}/${modcommand}-files.txt") # If file or directory exists, then remove it. - if [ -f "${modinstalldir}/${currentfileremove}" ]||[ -d "${modinstalldir}/${currentfileremove}" ]; then + if [ -f "${modinstalldir}/${currentfileremove}" ] || [ -d "${modinstalldir}/${currentfileremove}" ]; then rm -rf "${modinstalldir:?}/${currentfileremove:?}" - ((exitcode=$?)) + ((exitcode = $?)) if [ "${exitcode}" != 0 ]; then fn_script_log_fatal "Removing ${modinstalldir}/${currentfileremove}" break @@ -78,7 +78,8 @@ while [ "${modfileline}" -le "${modsfilelistsize}" ]; do fn_script_log_pass "Removing ${modinstalldir}/${currentfileremove}" fi fi - tput rc; tput el + tput rc + tput el echo -e "removing ${modprettyname} ${modfileline} / ${modsfilelistsize} : ${currentfileremove}..." ((modfileline++)) done @@ -127,7 +128,7 @@ fi # Oxide fix # Oxide replaces server files, so a validate is required after uninstall. -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_script_log "Validating to restore original ${gamename} files replaced by Oxide" exitbypass="1" diff --git a/lgsm/functions/command_mods_update.sh b/lgsm/functions/command_mods_update.sh index 50bbf9d67..c2f7b42b5 100755 --- a/lgsm/functions/command_mods_update.sh +++ b/lgsm/functions/command_mods_update.sh @@ -15,25 +15,25 @@ mods_core.sh # Prevents specific files being overwritten upon update (set by ${modkeepfiles}). # For that matter, remove cfg files after extraction before copying them to destination. -fn_remove_cfg_files(){ - if [ "${modkeepfiles}" != "OVERWRITE" ]&&[ "${modkeepfiles}" != "NOUPDATE" ]; then +fn_remove_cfg_files() { + if [ "${modkeepfiles}" != "OVERWRITE" ] && [ "${modkeepfiles}" != "NOUPDATE" ]; then echo -e "the following files/directories will be preserved:" fn_sleep_time # Count how many files there are to remove. filestopreserve=$(echo -e "${modkeepfiles}" | awk -F ';' '{ print NF }') # Test all subvalues of "modkeepfiles" using the ";" separator. - for ((preservefilesindex=1; preservefilesindex < filestopreserve; preservefilesindex++)); do + for ((preservefilesindex = 1; preservefilesindex < filestopreserve; preservefilesindex++)); do # Put the current file we are looking for into a variable. - filetopreserve=$(echo -e "${modkeepfiles}" | awk -F ';' -v x=${preservefilesindex} '{ print $x }' ) + filetopreserve=$(echo -e "${modkeepfiles}" | awk -F ';' -v x=${preservefilesindex} '{ print $x }') echo -e " * serverfiles/${filetopreserve}" # If it matches an existing file that have been extracted delete the file. - if [ -f "${extractdir}/${filetopreserve}" ]||[ -d "${extractdir}/${filetopreserve}" ]; then + if [ -f "${extractdir}/${filetopreserve}" ] || [ -d "${extractdir}/${filetopreserve}" ]; then rm -r "${extractdir:?}/${filetopreserve}" # Write the file path in a tmp file, to rebuild a full file list as it is rebuilt upon update. if [ ! -f "${modsdir}/.removedfiles.tmp" ]; then touch "${modsdir}/.removedfiles.tmp" fi - echo -e "${filetopreserve}" >> "${modsdir}/.removedfiles.tmp" + echo -e "${filetopreserve}" >> "${modsdir}/.removedfiles.tmp" fi done fi @@ -45,7 +45,7 @@ fn_print_info_nl "Update addons/mods: ${installedmodscount} addons/mods will be fn_script_log_info "${installedmodscount} mods or addons will be updated" fn_mods_installed_list # Go through all available commands, get details and display them to the user. -for ((ulindex=0; ulindex < ${#installedmodslist[@]}; ulindex++)); do +for ((ulindex = 0; ulindex < ${#installedmodslist[@]}; ulindex++)); do # Current mod is the "ulindex" value of the array we're going through. currentmod="${installedmodslist[ulindex]}" fn_mod_get_info diff --git a/lgsm/functions/command_monitor.sh b/lgsm/functions/command_monitor.sh index 3f4e397e2..48d3d496a 100755 --- a/lgsm/functions/command_monitor.sh +++ b/lgsm/functions/command_monitor.sh @@ -11,7 +11,7 @@ commandaction="Monitoring" functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_firstcommand_set -fn_monitor_check_lockfile(){ +fn_monitor_check_lockfile() { # Monitor does not run it lockfile is not found. if [ ! -f "${lockdir}/${selfname}.lock" ]; then fn_print_dots "Checking lockfile: " @@ -25,14 +25,14 @@ fn_monitor_check_lockfile(){ fi # Fix if lockfile is not unix time or contains letters - if [ -f "${lockdir}/${selfname}.lock" ]&&[[ "$(head -n 1 "${lockdir}/${selfname}.lock")" =~ [A-Za-z] ]]; then + if [ -f "${lockdir}/${selfname}.lock" ] && [[ "$(head -n 1 "${lockdir}/${selfname}.lock")" =~ [A-Za-z] ]]; then date '+%s' > "${lockdir}/${selfname}.lock" echo "${version}" >> "${lockdir}/${selfname}.lock" echo "${port}" >> "${lockdir}/${selfname}.lock" fi } -fn_monitor_check_update(){ +fn_monitor_check_update() { # Monitor will check if update is already running. if [ "$(pgrep "${selfname} update" | wc -l)" != "0" ]; then fn_print_dots "Checking active updates: " @@ -45,7 +45,7 @@ fn_monitor_check_update(){ fi } -fn_monitor_check_session(){ +fn_monitor_check_session() { fn_print_dots "Checking session: " fn_print_checking_eol fn_script_log_info "Checking session: CHECKING" @@ -66,13 +66,13 @@ fn_monitor_check_session(){ fi } -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_checking_eol fn_script_log_info "Checking port: CHECKING" - if [ -n "${rconenabled}" ]&&[ "${rconenabled}" != "true" ]&&[ ${shortname} == "av" ]; then + if [ -n "${rconenabled}" ] && [ "${rconenabled}" != "true" ] && [ ${shortname} == "av" ]; then fn_print_warn "Checking port: Unable to query, rcon is not enabled" fn_script_log_warn "Checking port: Unable to query, rcon is not enabled" else @@ -83,7 +83,7 @@ fn_monitor_check_queryport(){ fi } -fn_query_gsquery(){ +fn_query_gsquery() { if [ ! -f "${functionsdir}/query_gsquery.py" ]; then fn_fetch_file_github "lgsm/functions" "query_gsquery.py" "${functionsdir}" "chmodx" "norun" "noforce" "nohash" fi @@ -91,93 +91,93 @@ fn_query_gsquery(){ querystatus="$?" } -fn_query_tcp(){ +fn_query_tcp() { bash -c 'exec 3<> /dev/tcp/'${queryip}'/'${queryport}'' > /dev/null 2>&1 querystatus="$?" } -fn_monitor_query(){ -# Will loop and query up to 5 times every 15 seconds. -# Query will wait up to 60 seconds to confirm server is down as server can become non-responsive during map changes. -totalseconds=0 -for queryattempt in {1..5}; do - for queryip in "${queryips[@]}"; do - fn_print_dots "Querying port: ${querymethod}: ${queryip}:${queryport} : ${totalseconds}/${queryattempt}: " - fn_print_querying_eol - fn_script_log_info "Querying port: ${querymethod}: ${queryip}:${queryport} : ${queryattempt} : QUERYING" - # querydelay - if [ "$(head -n 1 "${lockdir}/${selfname}.lock")" -gt "$(date "+%s" -d "${querydelay} mins ago")" ]; then - fn_print_ok "Querying port: ${querymethod}: ${ip}:${queryport} : ${totalseconds}/${queryattempt}: " - fn_print_delay_eol_nl - 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 "Server started: $(date -d @$(head -n 1 "${lockdir}/${selfname}.lock"))" - fn_script_log_info "Current time: $(date)" - monitorpass=1 - core_exit.sh - # will use query method selected in fn_monitor_loop - # gamedig - elif [ "${querymethod}" == "gamedig" ]; then - query_gamedig.sh - # gsquery - elif [ "${querymethod}" == "gsquery" ]; then - fn_query_gsquery - #tcp query - elif [ "${querymethod}" == "tcp" ]; then - fn_query_tcp - fi +fn_monitor_query() { + # Will loop and query up to 5 times every 15 seconds. + # Query will wait up to 60 seconds to confirm server is down as server can become non-responsive during map changes. + totalseconds=0 + for queryattempt in {1..5}; do + for queryip in "${queryips[@]}"; do + fn_print_dots "Querying port: ${querymethod}: ${queryip}:${queryport} : ${totalseconds}/${queryattempt}: " + fn_print_querying_eol + fn_script_log_info "Querying port: ${querymethod}: ${queryip}:${queryport} : ${queryattempt} : QUERYING" + # querydelay + if [ "$(head -n 1 "${lockdir}/${selfname}.lock")" -gt "$(date "+%s" -d "${querydelay} mins ago")" ]; then + fn_print_ok "Querying port: ${querymethod}: ${ip}:${queryport} : ${totalseconds}/${queryattempt}: " + fn_print_delay_eol_nl + 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 "Server started: $(date -d @$(head -n 1 "${lockdir}/${selfname}.lock"))" + fn_script_log_info "Current time: $(date)" + monitorpass=1 + core_exit.sh + # will use query method selected in fn_monitor_loop + # gamedig + elif [ "${querymethod}" == "gamedig" ]; then + query_gamedig.sh + # gsquery + elif [ "${querymethod}" == "gsquery" ]; then + fn_query_gsquery + #tcp query + elif [ "${querymethod}" == "tcp" ]; then + fn_query_tcp + fi - if [ "${querystatus}" == "0" ]; then - # Server query OK. - fn_print_ok "Querying port: ${querymethod}: ${queryip}:${queryport} : ${totalseconds}/${queryattempt}: " - fn_print_ok_eol_nl - fn_script_log_pass "Querying port: ${querymethod}: ${queryip}:${queryport} : ${queryattempt}: OK" - monitorpass=1 if [ "${querystatus}" == "0" ]; then - # Add query data to log. - if [ "${gdname}" ]; then - fn_script_log_info "Server name: ${gdname}" - fi - if [ "${gdplayers}" ]; then - fn_script_log_info "Players: ${gdplayers}/${gdmaxplayers}" - fi - if [ "${gdbots}" ]; then - fn_script_log_info "Bots: ${gdbots}" - fi - if [ "${gdmap}" ]; then - fn_script_log_info "Map: ${gdmap}" - fi - if [ "${gdgamemode}" ]; then - fn_script_log_info "Game Mode: ${gdgamemode}" - fi - - # send LinuxGSM stats if monitor is OK. - if [ "${stats}" == "on" ]||[ "${stats}" == "y" ]; then - info_stats.sh + # Server query OK. + fn_print_ok "Querying port: ${querymethod}: ${queryip}:${queryport} : ${totalseconds}/${queryattempt}: " + fn_print_ok_eol_nl + fn_script_log_pass "Querying port: ${querymethod}: ${queryip}:${queryport} : ${queryattempt}: OK" + monitorpass=1 + if [ "${querystatus}" == "0" ]; then + # Add query data to log. + if [ "${gdname}" ]; then + fn_script_log_info "Server name: ${gdname}" + fi + if [ "${gdplayers}" ]; then + fn_script_log_info "Players: ${gdplayers}/${gdmaxplayers}" + fi + if [ "${gdbots}" ]; then + fn_script_log_info "Bots: ${gdbots}" + fi + if [ "${gdmap}" ]; then + fn_script_log_info "Map: ${gdmap}" + fi + if [ "${gdgamemode}" ]; then + fn_script_log_info "Game Mode: ${gdgamemode}" + fi + + # send LinuxGSM stats if monitor is OK. + if [ "${stats}" == "on" ] || [ "${stats}" == "y" ]; then + info_stats.sh + fi fi - fi - core_exit.sh - else - # Server query FAIL. - fn_print_fail "Querying port: ${querymethod}: ${queryip}:${queryport} : ${totalseconds}/${queryattempt}: " - fn_print_fail_eol - fn_script_log_warn "Querying port: ${querymethod}: ${queryip}:${queryport} : ${queryattempt}: FAIL" - # Monitor will try gamedig (if supported) for first 30s then gsquery before restarting. - # gsquery will fail if longer than 60s - if [ "${totalseconds}" -ge "59" ]; then - # Monitor will FAIL if over 60s and trigger gane server reboot. + core_exit.sh + else + # Server query FAIL. fn_print_fail "Querying port: ${querymethod}: ${queryip}:${queryport} : ${totalseconds}/${queryattempt}: " - fn_print_fail_eol_nl + fn_print_fail_eol fn_script_log_warn "Querying port: ${querymethod}: ${queryip}:${queryport} : ${queryattempt}: FAIL" - # Send alert if enabled. - alert="restartquery" - alert.sh - command_restart.sh - fn_firstcommand_reset - core_exit.sh + # Monitor will try gamedig (if supported) for first 30s then gsquery before restarting. + # gsquery will fail if longer than 60s + if [ "${totalseconds}" -ge "59" ]; then + # Monitor will FAIL if over 60s and trigger gane server reboot. + fn_print_fail "Querying port: ${querymethod}: ${queryip}:${queryport} : ${totalseconds}/${queryattempt}: " + fn_print_fail_eol_nl + fn_script_log_warn "Querying port: ${querymethod}: ${queryip}:${queryport} : ${queryattempt}: FAIL" + # Send alert if enabled. + alert="restartquery" + alert.sh + command_restart.sh + fn_firstcommand_reset + core_exit.sh + fi fi - fi - done + done # Second counter will wait for 15s before breaking loop. for seconds in {1..15}; do fn_print_fail "Querying port: ${querymethod}: ${ip}:${queryport} : ${totalseconds}/${queryattempt}: ${cyan}WAIT${default}" @@ -187,25 +187,25 @@ for queryattempt in {1..5}; do break fi done -done + done } -fn_monitor_loop(){ +fn_monitor_loop() { # loop though query methods selected by querymode. totalseconds=0 if [ "${querymode}" == "2" ]; then - local query_methods_array=( gamedig gsquery ) + local query_methods_array=(gamedig gsquery) elif [ "${querymode}" == "3" ]; then - local query_methods_array=( gamedig ) + local query_methods_array=(gamedig) elif [ "${querymode}" == "4" ]; then - local query_methods_array=( gsquery ) + local query_methods_array=(gsquery) elif [ "${querymode}" == "5" ]; then - local query_methods_array=( tcp ) + local query_methods_array=(tcp) fi for querymethod in "${query_methods_array[@]}"; do # Will check if gamedig is installed and bypass if not. if [ "${querymethod}" == "gamedig" ]; then - if [ "$(command -v gamedig 2>/dev/null)" ]&&[ "$(command -v jq 2>/dev/null)" ]; then + if [ "$(command -v gamedig 2> /dev/null)" ] && [ "$(command -v jq 2> /dev/null)" ]; then if [ -z "${monitorpass}" ]; then fn_monitor_query fi diff --git a/lgsm/functions/command_postdetails.sh b/lgsm/functions/command_postdetails.sh index f8b36fb61..dad44d9af 100755 --- a/lgsm/functions/command_postdetails.sh +++ b/lgsm/functions/command_postdetails.sh @@ -34,8 +34,7 @@ else info_game.sh info_distro.sh info_messages.sh - for queryip in "${queryips[@]}" - do + for queryip in "${queryips[@]}"; do query_gamedig.sh if [ "${querystatus}" == "0" ]; then break @@ -50,7 +49,7 @@ else fn_info_message_script fn_info_message_backup # Some game servers do not have parms. - if [ "${shortname}" != "jc2" ]&&[ "${shortname}" != "jc3" ]&&[ "${shortname}" != "dst" ]&&[ "${shortname}" != "pz" ]&&[ "${engine}" != "renderware" ]; then + if [ "${shortname}" != "jc2" ] && [ "${shortname}" != "jc3" ] && [ "${shortname}" != "dst" ] && [ "${shortname}" != "pz" ] && [ "${engine}" != "renderware" ]; then fn_info_message_commandlineparms fi fn_info_message_ports_edit diff --git a/lgsm/functions/command_send.sh b/lgsm/functions/command_send.sh index 4b653c0be..c143276f6 100644 --- a/lgsm/functions/command_send.sh +++ b/lgsm/functions/command_send.sh @@ -22,7 +22,7 @@ if [ "${status}" != "0" ]; then commandtosend="${userinput2}" else echo "" - commandtosend=$( fn_prompt_message "send: " ) + commandtosend=$(fn_prompt_message "send: ") fi echo "" fn_print_dots "Sending command to console: \"${commandtosend}\"" diff --git a/lgsm/functions/command_skeleton.sh b/lgsm/functions/command_skeleton.sh index 7b7d67d5f..53c4ddec5 100644 --- a/lgsm/functions/command_skeleton.sh +++ b/lgsm/functions/command_skeleton.sh @@ -11,7 +11,7 @@ fn_print_dots "Creating skeleton directory" check.sh # Find all directorys and create them in the skel directory -find "${rootdir}" -type d -not \( -path ./skel -prune \) | cpio -pdvm skel 2>/dev/null +find "${rootdir}" -type d -not \( -path ./skel -prune \) | cpio -pdvm skel 2> /dev/null exitcode=$? if [ "${exitcode}" != 0 ]; then fn_print_fail_nl "Creating skeleton directory" diff --git a/lgsm/functions/command_start.sh b/lgsm/functions/command_start.sh index 58ecfcff7..d10240fa7 100755 --- a/lgsm/functions/command_start.sh +++ b/lgsm/functions/command_start.sh @@ -10,17 +10,17 @@ commandaction="Starting" functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_firstcommand_set -fn_start_teamspeak3(){ +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}" + echo " * Creating blank ${servercfg}" fn_script_log_info "Creating blank ${servercfg}" fn_sleep_time - echo " * ${servercfg} can remain blank by default." + 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}." + echo " * ${servercfg} is located in ${servercfgfullpath}." fn_script_log_info "${servercfg} is located in ${servercfgfullpath}." sleep 5 touch "${servercfgfullpath}" @@ -34,12 +34,12 @@ fn_start_teamspeak3(){ # This will allow the Jedi Knight 2 version to be printed in console on start. # Used to allow update to detect JK2MV server version. -fn_start_jk2(){ +fn_start_jk2() { fn_start_tmux tmux send -t "${sessionname}" version ENTER > /dev/null 2>&1 } -fn_start_tmux(){ +fn_start_tmux() { if [ "${parmsbypass}" ]; then startparameters="" fi @@ -57,7 +57,7 @@ fn_start_tmux(){ # Log rotation. fn_script_log_info "Rotating log files" - if [ "${engine}" == "unreal2" ]&&[ -f "${gamelog}" ]; then + if [ "${engine}" == "unreal2" ] && [ -f "${gamelog}" ]; then mv "${gamelog}" "${gamelogdate}" fi if [ -f "${lgsmlog}" ]; then @@ -91,7 +91,7 @@ fn_start_tmux(){ if [ "${tmuxv}" == "master" ]; then fn_script_log "tmux version: master (user compiled)" echo -e "tmux version: master (user compiled)" >> "${consolelog}" - if [ "${consolelogging}" == "on" ]||[ -z "${consolelogging}" ]; then + if [ "${consolelogging}" == "on" ] || [ -z "${consolelogging}" ]; then tmux pipe-pane -o -t "${sessionname}" "exec cat >> '${consolelog}'" fi elif [ -n "${tmuxv}" ]; then @@ -107,7 +107,7 @@ fn_start_tmux(){ https://linuxgsm.com/tmux-upgrade Currently installed: $(tmux -V)" > "${consolelog}" # Console logging enable or not set. - elif [ "${consolelogging}" == "on" ]||[ -z "${consolelogging}" ]; then + elif [ "${consolelogging}" == "on" ] || [ -z "${consolelogging}" ]; then tmux pipe-pane -o -t "${sessionname}" "exec cat >> '${consolelog}'" fi else @@ -140,11 +140,10 @@ fn_start_tmux(){ cat "${lgsmlogdir}/.${selfname}-tmux-error.tmp" | tee -a "${lgsmlog}" # Detected error https://linuxgsm.com/support - if grep -c "Operation not permitted" "${lgsmlogdir}/.${selfname}-tmux-error.tmp" - then - echo -e "" - echo -e "Fix" - echo -e "=================================" + if grep -c "Operation not permitted" "${lgsmlogdir}/.${selfname}-tmux-error.tmp"; then + echo -e "" + echo -e "Fix" + echo -e "=================================" if ! grep "tty:" /etc/group | grep "$(whoami)"; then echo -e "$(whoami) is not part of the tty group." fn_script_log_info "$(whoami) is not part of the tty group." @@ -172,7 +171,7 @@ fn_start_tmux(){ fn_print_ok "${servername}" fn_script_log_pass "Started ${servername}" fi - rm "${lgsmlogdir:?}/.${selfname}-tmux-error.tmp" 2>/dev/null + rm "${lgsmlogdir:?}/.${selfname}-tmux-error.tmp" 2> /dev/null echo -en "\n" } @@ -195,7 +194,7 @@ info_game.sh core_logs.sh # Will check for updates is updateonstart is yes. -if [ "${updateonstart}" == "yes" ]||[ "${updateonstart}" == "1" ]||[ "${updateonstart}" == "on" ]; then +if [ "${updateonstart}" == "yes" ] || [ "${updateonstart}" == "1" ] || [ "${updateonstart}" == "on" ]; then exitbypass=1 unset updateonstart command_update.sh diff --git a/lgsm/functions/command_stop.sh b/lgsm/functions/command_stop.sh index ef54b525c..b87185402 100644 --- a/lgsm/functions/command_stop.sh +++ b/lgsm/functions/command_stop.sh @@ -11,11 +11,11 @@ functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_firstcommand_set # Attempts graceful shutdown by sending 'CTRL+c'. -fn_stop_graceful_ctrlc(){ +fn_stop_graceful_ctrlc() { fn_print_dots "Graceful: CTRL+c" fn_script_log_info "Graceful: CTRL+c" # Sends quit. - tmux send-keys -t "${sessionname}" C-c > /dev/null 2>&1 + tmux send-keys -t "${sessionname}" C-c > /dev/null 2>&1 # Waits up to 30 seconds giving the server time to shutdown gracefuly. for seconds in {1..30}; do check_status.sh @@ -39,13 +39,13 @@ fn_stop_graceful_ctrlc(){ # Attempts graceful shutdown by sending a specified command. # Usage: fn_stop_graceful_cmd "console_command" "timeout_in_seconds" # e.g.: fn_stop_graceful_cmd "quit" "30" -fn_stop_graceful_cmd(){ +fn_stop_graceful_cmd() { fn_print_dots "Graceful: sending \"${1}\"" fn_script_log_info "Graceful: sending \"${1}\"" # Sends specific stop command. tmux send -t "${sessionname}" ENTER "${1}" ENTER > /dev/null 2>&1 # 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 if [ "${status}" == "0" ]; then fn_print_ok "Graceful: sending \"${1}\": ${seconds}: " @@ -67,7 +67,7 @@ fn_stop_graceful_cmd(){ # Attempts graceful shutdown of goldsrc using rcon 'quit' command. # There is only a 3 second delay before a forced a tmux shutdown # as GoldSrc servers 'quit' command does a restart rather than shutdown. -fn_stop_graceful_goldsrc(){ +fn_stop_graceful_goldsrc() { fn_print_dots "Graceful: sending \"quit\"" fn_script_log_info "Graceful: sending \"quit\"" # sends quit @@ -83,9 +83,9 @@ fn_stop_graceful_goldsrc(){ } # telnet command for sdtd graceful shutdown. -fn_stop_graceful_sdtd_telnet(){ - if [ -z "${telnetpass}" ]||[ "${telnetpass}" == "NOT SET" ]; then - sdtd_telnet_shutdown=$( expect -c ' +fn_stop_graceful_sdtd_telnet() { + if [ -z "${telnetpass}" ] || [ "${telnetpass}" == "NOT SET" ]; then + sdtd_telnet_shutdown=$(expect -c ' proc abort {} { puts "Timeout or EOF\n" exit 1 @@ -99,7 +99,7 @@ fn_stop_graceful_sdtd_telnet(){ puts "Completed.\n" ') else - sdtd_telnet_shutdown=$( expect -c ' + sdtd_telnet_shutdown=$(expect -c ' proc abort {} { puts "Timeout or EOF\n" exit 1 @@ -120,12 +120,12 @@ fn_stop_graceful_sdtd_telnet(){ } # Attempts graceful shutdown of 7 Days To Die using telnet. -fn_stop_graceful_sdtd(){ +fn_stop_graceful_sdtd() { fn_print_dots "Graceful: telnet" fn_script_log_info "Graceful: telnet" if [ "${telnetenabled}" == "false" ]; then fn_print_info_nl "Graceful: telnet: DISABLED: Enable in ${servercfg}" - elif [ "$(command -v expect 2>/dev/null)" ]; then + elif [ "$(command -v expect 2> /dev/null)" ]; then # Tries to shutdown with both localhost and server IP. for telnetip in 127.0.0.1 ${ip}; do fn_print_dots "Graceful: telnet: ${telnetip}:${telnetport}" @@ -180,7 +180,7 @@ fn_stop_graceful_sdtd(){ } # Attempts graceful shutdown by sending /save /stop. -fn_stop_graceful_avorion(){ +fn_stop_graceful_avorion() { fn_print_dots "Graceful: /save /stop" fn_script_log_info "Graceful: /save /stop" # Sends /save. @@ -208,7 +208,7 @@ fn_stop_graceful_avorion(){ fi } -fn_stop_graceful_select(){ +fn_stop_graceful_select() { if [ "${stopmode}" == "1" ]; then fn_stop_tmux elif [ "${stopmode}" == "2" ]; then @@ -234,7 +234,7 @@ fn_stop_graceful_select(){ fi } -fn_stop_tmux(){ +fn_stop_tmux() { fn_print_dots "${servername}" fn_script_log_info "tmux kill-session: ${sessionname}: ${servername}" # Kill tmux session. @@ -251,7 +251,7 @@ fn_stop_tmux(){ } # Checks if the server is already stopped. -fn_stop_pre_check(){ +fn_stop_pre_check() { if [ "${status}" == "0" ]; then fn_print_info_nl "${servername} is already stopped" fn_script_log_error "${servername} is already stopped" diff --git a/lgsm/functions/command_ts3_server_pass.sh b/lgsm/functions/command_ts3_server_pass.sh index 1e227f3de..be0816d15 100755 --- a/lgsm/functions/command_ts3_server_pass.sh +++ b/lgsm/functions/command_ts3_server_pass.sh @@ -10,7 +10,7 @@ commandaction="Changing password" functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_firstcommand_set -fn_serveradmin_password_prompt(){ +fn_serveradmin_password_prompt() { fn_print_header fn_print_information_nl "You are about to change the ${gamename} ServerAdmin password." fn_print_warning_nl "${gamename} will restart during this process." @@ -25,7 +25,7 @@ fn_serveradmin_password_prompt(){ fn_script_log_info "Changing password" } -fn_serveradmin_password_set(){ +fn_serveradmin_password_set() { # Start server in "new password mode". ts3serverpass="1" exitbypass="1" diff --git a/lgsm/functions/command_update.sh b/lgsm/functions/command_update.sh index 828c8c38d..5b9858e84 100755 --- a/lgsm/functions/command_update.sh +++ b/lgsm/functions/command_update.sh @@ -21,7 +21,7 @@ elif [ "${shortname}" == "mc" ]; then update_minecraft.sh elif [ "${shortname}" == "mcb" ]; then update_minecraft_bedrock.sh -elif [ "${shortname}" == "pmc" ]||[ "${shortname}" == "wmc" ]; then +elif [ "${shortname}" == "pmc" ] || [ "${shortname}" == "wmc" ]; then update_papermc.sh elif [ "${shortname}" == "mumble" ]; then update_mumble.sh diff --git a/lgsm/functions/command_update_linuxgsm.sh b/lgsm/functions/command_update_linuxgsm.sh index e7b70f327..39a441f59 100755 --- a/lgsm/functions/command_update_linuxgsm.sh +++ b/lgsm/functions/command_update_linuxgsm.sh @@ -19,9 +19,9 @@ fn_script_log_info "Updating LinuxGSM" fn_print_dots "Selecting repo" fn_script_log_info "Selecting repo" # Select remotereponame -curl --connect-timeout 10 -IsfL "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/linuxgsm.sh" 1>/dev/null +curl --connect-timeout 10 -IsfL "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/linuxgsm.sh" 1> /dev/null if [ $? != "0" ]; then - curl --connect-timeout 10 -IsfL "https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/linuxgsm.sh" 1>/dev/null + curl --connect-timeout 10 -IsfL "https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/linuxgsm.sh" 1> /dev/null if [ $? != "0" ]; then fn_print_fail_nl "Selecting repo: Unable to to access GitHub or Bitbucket repositories" fn_script_log_fatal "Selecting repo: Unable to to access GitHub or Bitbucket repositories" @@ -38,9 +38,9 @@ fi # Check linuxsm.sh echo -en "checking ${remotereponame} linuxgsm.sh...\c" if [ "${remotereponame}" == "GitHub" ]; then - curl --connect-timeout 10 -IsfL "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/linuxgsm.sh" 1>/dev/null + curl --connect-timeout 10 -IsfL "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/linuxgsm.sh" 1> /dev/null else - curl --connect-timeout 10 -IsfL "https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/linuxgsm.sh" 1>/dev/null + curl --connect-timeout 10 -IsfL "https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/linuxgsm.sh" 1> /dev/null fi if [ $? != "0" ]; then fn_print_fail_eol_nl @@ -118,9 +118,9 @@ fi echo -en "checking ${remotereponame} config _default.cfg...\c" fn_script_log_info "Checking ${remotereponame} config _default.cfg" if [ "${remotereponame}" == "GitHub" ]; then - curl --connect-timeout 10 -IsfL "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/lgsm/config-default/config-lgsm/${gameservername}/_default.cfg" 1>/dev/null + curl --connect-timeout 10 -IsfL "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/lgsm/config-default/config-lgsm/${gameservername}/_default.cfg" 1> /dev/null else - curl --connect-timeout 10 -IsfL "https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/lgsm/config-default/config-lgsm/${gameservername}/_default.cfg" 1>/dev/null + curl --connect-timeout 10 -IsfL "https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/lgsm/config-default/config-lgsm/${gameservername}/_default.cfg" 1> /dev/null fi if [ $? != "0" ]; then fn_print_fail_eol_nl @@ -152,9 +152,9 @@ if [ -f "${datadir}/${distroid}-${distroversioncsv}.csv" ]; then echo -en "checking ${remotereponame} config ${distroid}-${distroversioncsv}.csv...\c" fn_script_log_info "Checking ${remotereponame} ${distroid}-${distroversioncsv}.csv" if [ "${remotereponame}" == "GitHub" ]; then - curl --connect-timeout 10 -IsfL "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/lgsm/data/${distroid}-${distroversioncsv}.csv" 1>/dev/null + curl --connect-timeout 10 -IsfL "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/lgsm/data/${distroid}-${distroversioncsv}.csv" 1> /dev/null else - curl --connect-timeout 10 -IsfL "https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/lgsm/data/${distroid}-${distroversioncsv}.csv" 1>/dev/null + curl --connect-timeout 10 -IsfL "https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/lgsm/data/${distroid}-${distroversioncsv}.csv" 1> /dev/null fi if [ $? != "0" ]; then fn_print_fail_eol_nl @@ -189,9 +189,9 @@ if [ -n "${functionsdir}" ]; then echo -en "checking ${remotereponame} module ${functionfile}...\c" github_file_url_dir="lgsm/functions" if [ "${remotereponame}" == "GitHub" ]; then - curl --connect-timeout 10 -IsfL "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${functionfile}" 1>/dev/null + curl --connect-timeout 10 -IsfL "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${functionfile}" 1> /dev/null else - curl --connect-timeout 10 -IsfL "https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/${github_file_url_dir}/${functionfile}" 1>/dev/null + curl --connect-timeout 10 -IsfL "https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/${github_file_url_dir}/${functionfile}" 1> /dev/null fi if [ $? != 0 ]; then fn_print_error_eol_nl diff --git a/lgsm/functions/command_validate.sh b/lgsm/functions/command_validate.sh index 4c51bacb3..15257a3e2 100755 --- a/lgsm/functions/command_validate.sh +++ b/lgsm/functions/command_validate.sh @@ -10,7 +10,7 @@ commandaction="Validating" functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_firstcommand_set -fn_validate(){ +fn_validate() { fn_print_warn "Validate might overwrite some customised files" fn_script_log_warn "${commandaction} server: Validate might overwrite some customised files" totalseconds=3 diff --git a/lgsm/functions/command_wipe.sh b/lgsm/functions/command_wipe.sh index d2d05defc..29577984e 100755 --- a/lgsm/functions/command_wipe.sh +++ b/lgsm/functions/command_wipe.sh @@ -11,7 +11,7 @@ functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_firstcommand_set # Provides an exit code upon error. -fn_wipe_exit_code(){ +fn_wipe_exit_code() { exitcode=$? if [ "${exitcode}" != 0 ]; then fn_print_fail_eol_nl @@ -22,17 +22,17 @@ fn_wipe_exit_code(){ } # Removes files to wipe server. -fn_wipe_files(){ +fn_wipe_files() { fn_print_start_nl "${wipetype}" fn_script_log_info "${wipetype}" # Remove Map files - if [ -n "${serverwipe}" ]||[ -n "${mapwipe}" ]; then + if [ -n "${serverwipe}" ] || [ -n "${mapwipe}" ]; then if [ -n "$(find "${serveridentitydir}" -type f -name "*.map")" ]; then echo -en "removing .map file(s)..." fn_script_log_info "removing *.map file(s)" fn_sleep_time - find "${serveridentitydir:?}" -type f -name "*.map" -printf "%f\n" >> "${lgsmlog}" + find "${serveridentitydir:?}" -type f -name "*.map" -printf "%f\n" >> "${lgsmlog}" find "${serveridentitydir:?}" -type f -name "*.map" -delete | tee -a "${lgsmlog}" fn_wipe_exit_code else @@ -42,12 +42,12 @@ fn_wipe_files(){ fi fi # Remove Save files. - if [ -n "${serverwipe}" ]||[ -n "${mapwipe}" ]; then + if [ -n "${serverwipe}" ] || [ -n "${mapwipe}" ]; then if [ -n "$(find "${serveridentitydir}" -type f -name "*.sav*")" ]; then echo -en "removing .sav file(s)..." fn_script_log_info "removing .sav file(s)" fn_sleep_time - find "${serveridentitydir:?}" -type f -name "*.sav*" -printf "%f\n" >> "${lgsmlog}" + find "${serveridentitydir:?}" -type f -name "*.sav*" -printf "%f\n" >> "${lgsmlog}" find "${serveridentitydir:?}" -type f -name "*.sav*" -delete fn_wipe_exit_code else @@ -74,7 +74,7 @@ fn_wipe_files(){ fi } -fn_map_wipe_warning(){ +fn_map_wipe_warning() { fn_print_warn "Map wipe will reset the map data and keep blueprint data" fn_script_log_warn "Map wipe will reset the map data and keep blueprint data" totalseconds=3 @@ -89,7 +89,7 @@ fn_map_wipe_warning(){ fn_print_warn_nl "Map wipe will reset the map data and keep blueprint data" } -fn_full_wipe_warning(){ +fn_full_wipe_warning() { fn_print_warn "Server wipe will reset the map data and remove blueprint data" fn_script_log_warn "Server wipe will reset the map data and remove blueprint data" totalseconds=3 @@ -105,8 +105,8 @@ fn_full_wipe_warning(){ } # Will change the seed if the seed is not defined by the user. -fn_wipe_random_seed(){ - if [ -f "${datadir}/${selfname}-seed.txt" ]&&[ -n "${randomseed}" ]; then +fn_wipe_random_seed() { + if [ -f "${datadir}/${selfname}-seed.txt" ] && [ -n "${randomseed}" ]; then shuf -i 1-2147483647 -n 1 > "${datadir}/${selfname}-seed.txt" seed=$(cat "${datadir}/${selfname}-seed.txt") randomseed=1 @@ -118,10 +118,10 @@ fn_wipe_random_seed(){ } # A summary of what wipe is going to do. -fn_wipe_details(){ +fn_wipe_details() { fn_print_information_nl "Wipe does not remove Rust+ data." echo -en "* Wipe map data: " - if [ -n "${serverwipe}" ]||[ -n "${mapwipe}" ]; then + if [ -n "${serverwipe}" ] || [ -n "${mapwipe}" ]; then fn_print_yes_eol_nl else fn_print_no_eol_nl @@ -147,7 +147,7 @@ check.sh fix_rust.sh # Check if there is something to wipe. -if [ -n "$(find "${serveridentitydir}" -type f -name "*.map")" ]||[ -n "$(find "${serveridentitydir}" -type f -name "*.sav*")" ]&&[ -n "$(find "${serveridentitydir}" -type f ! -name 'player.tokens.db' -name "*.db")" ]; then +if [ -n "$(find "${serveridentitydir}" -type f -name "*.map")" ] || [ -n "$(find "${serveridentitydir}" -type f -name "*.sav*")" ] && [ -n "$(find "${serveridentitydir}" -type f ! -name 'player.tokens.db' -name "*.db")" ]; then if [ -n "${serverwipe}" ]; then wipetype="Full wipe" fn_full_wipe_warning diff --git a/lgsm/functions/core_dl.sh b/lgsm/functions/core_dl.sh index 297f4101f..cc5af1809 100755 --- a/lgsm/functions/core_dl.sh +++ b/lgsm/functions/core_dl.sh @@ -19,7 +19,7 @@ functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" -fn_dl_steamcmd(){ +fn_dl_steamcmd() { fn_print_start_nl "${remotelocation}" fn_script_log_info "${commandaction} ${selfname}: ${remotelocation}" if [ -n "${branch}" ]; then @@ -41,7 +41,7 @@ fn_dl_steamcmd(){ fi # Validate will be added as a parameter if required. - if [ "${commandname}" == "VALIDATE" ]||[ "${commandname}" == "INSTALL" ]; then + if [ "${commandname}" == "VALIDATE" ] || [ "${commandname}" == "INSTALL" ]; then validate="validate" fi @@ -53,13 +53,13 @@ fn_dl_steamcmd(){ rm -f "${steamcmdlog:?}" fi counter=0 - while [ "${counter}" == "0" ]||[ "${exitcode}" != "0" ]; do - counter=$((counter+1)) + while [ "${counter}" == "0" ] || [ "${exitcode}" != "0" ]; do + counter=$((counter + 1)) # Select SteamCMD parameters # If GoldSrc (appid 90) servers. GoldSrc (appid 90) require extra commands. if [ "${appid}" == "90" ]; then # If using a specific branch. - if [ -n "${branch}" ]&&[ -n "${betapassword}" ]; then + if [ -n "${branch}" ] && [ -n "${betapassword}" ]; then ${unbuffer} ${steamcmdcommand} +force_install_dir "${serverfiles}" +login "${steamuser}" "${steampass}" +app_set_config 90 mod "${appidmod}" +app_update "${appid}" -beta "${branch}" -betapassword "${betapassword}" ${validate} +quit | uniq | tee -a "${lgsmlog}" "${steamcmdlog}" elif [ -n "${branch}" ]; then ${unbuffer} ${steamcmdcommand} +force_install_dir "${serverfiles}" +login "${steamuser}" "${steampass}" +app_set_config 90 mod "${appidmod}" +app_update "${appid}" -beta "${branch}" ${validate} +quit | uniq | tee -a "${lgsmlog}" "${steamcmdlog}" @@ -68,7 +68,7 @@ fn_dl_steamcmd(){ fi # Force Windows Platform type. elif [ "${steamcmdforcewindows}" == "yes" ]; then - if [ -n "${branch}" ]&&[ -n "${betapassword}" ]; then + if [ -n "${branch}" ] && [ -n "${betapassword}" ]; then ${unbuffer} ${steamcmdcommand} +@sSteamCmdForcePlatformType windows +force_install_dir "${serverfiles}" +login "${steamuser}" "${steampass}" +app_update "${appid}" -beta "${branch}" -betapassword "${betapassword}" ${validate} +quit | uniq | tee -a "${lgsmlog}" "${steamcmdlog}" elif [ -n "${branch}" ]; then ${unbuffer} ${steamcmdcommand} +@sSteamCmdForcePlatformType windows +force_install_dir "${serverfiles}" +login "${steamuser}" "${steampass}" +app_update "${appid}" -beta "${branch}" ${validate} +quit | uniq | tee -a "${lgsmlog}" "${steamcmdlog}" @@ -77,7 +77,7 @@ fn_dl_steamcmd(){ fi # All other servers. else - if [ -n "${branch}" ]&&[ -n "${betapassword}" ]; then + if [ -n "${branch}" ] && [ -n "${betapassword}" ]; then ${unbuffer} ${steamcmdcommand} +force_install_dir "${serverfiles}" +login "${steamuser}" "${steampass}" +app_update "${appid}" -beta "${branch}" -betapassword "${betapassword}" ${validate} +quit | uniq | tee -a "${lgsmlog}" "${steamcmdlog}" elif [ -n "${branch}" ]; then ${unbuffer} ${steamcmdcommand} +force_install_dir "${serverfiles}" +login "${steamuser}" "${steampass}" +app_update "${appid}" -beta "${branch}" ${validate} +quit | uniq | tee -a "${lgsmlog}" "${steamcmdlog}" @@ -89,7 +89,7 @@ fn_dl_steamcmd(){ # Error checking for SteamCMD. Some errors will loop to try again and some will just exit. # Check also if we have more errors than retries to be sure that we do not loop to many times and error out. exitcode=$? - if [ -n "$(grep -i "Error!" "${steamcmdlog}" | tail -1)" ]&&[ "$(grep -ic "Error!" "${steamcmdlog}")" -ge "${counter}" ] ; then + if [ -n "$(grep -i "Error!" "${steamcmdlog}" | tail -1)" ] && [ "$(grep -ic "Error!" "${steamcmdlog}")" -ge "${counter}" ]; then # Not enough space. if [ -n "$(grep "0x202" "${steamcmdlog}" | tail -1)" ]; then fn_print_failure_nl "${commandaction} ${selfname}: ${remotelocation}: Not enough disk space to download server files" @@ -97,9 +97,9 @@ fn_dl_steamcmd(){ core_exit.sh # Not enough space. elif [ -n "$(grep "0x212" "${steamcmdlog}" | tail -1)" ]; then - fn_print_failure_nl "${commandaction} ${selfname}: ${remotelocation}: Not enough disk space to download server files" - fn_script_log_fatal "${commandaction} ${selfname}: ${remotelocation}: Not enough disk space to download server files" - core_exit.sh + fn_print_failure_nl "${commandaction} ${selfname}: ${remotelocation}: Not enough disk space to download server files" + fn_script_log_fatal "${commandaction} ${selfname}: ${remotelocation}: Not enough disk space to download server files" + core_exit.sh # Need tp purchase game. elif [ -n "$(grep "No subscription" "${steamcmdlog}" | tail -1)" ]; then fn_print_failure_nl "${commandaction} ${selfname}: ${remotelocation}: Steam account does not have a license for the required game" @@ -110,13 +110,13 @@ fn_dl_steamcmd(){ fn_print_failure_nl "${commandaction} ${selfname}: ${remotelocation}: Two-factor authentication failure" fn_script_log_fatal "${commandaction} ${selfname}: ${remotelocation}: Two-factor authentication failure" core_exit.sh - # Incorrect Branch password - elif [ -n "$(grep "Password check for AppId" "${steamcmdlog}" | tail -1)" ]; then - fn_print_failure_nl "${commandaction} ${selfname}: ${remotelocation}: betapassword is incorrect" - fn_script_log_fatal "${commandaction} ${selfname}: ${remotelocation}: betapassword is incorrect" - core_exit.sh + # Incorrect Branch password + elif [ -n "$(grep "Password check for AppId" "${steamcmdlog}" | tail -1)" ]; then + fn_print_failure_nl "${commandaction} ${selfname}: ${remotelocation}: betapassword is incorrect" + fn_script_log_fatal "${commandaction} ${selfname}: ${remotelocation}: betapassword is incorrect" + core_exit.sh # Update did not finish. - 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_script_log_error "${commandaction} ${selfname}: ${remotelocation}: Update required but not completed - check network" else @@ -141,7 +141,7 @@ fn_dl_steamcmd(){ } # Emptys contents of the LinuxGSM tmpdir. -fn_clear_tmp(){ +fn_clear_tmp() { echo -en "clearing LinuxGSM tmp directory..." if [ -d "${tmpdir}" ]; then rm -rf "${tmpdir:?}/"* @@ -156,9 +156,9 @@ fn_clear_tmp(){ fi } -fn_dl_hash(){ +fn_dl_hash() { # Runs Hash Check if available. - if [ "${hash}" != "0" ]&&[ "${hash}" != "nohash" ]&&[ "${hash}" != "nomd5" ]; then + if [ "${hash}" != "0" ] && [ "${hash}" != "nohash" ] && [ "${hash}" != "nomd5" ]; then # MD5 if [ "${#hash}" == "32" ]; then hashbin="md5sum" @@ -204,7 +204,7 @@ fn_dl_hash(){ # Extracts can be defined in code like so: # fn_dl_extract "${local_filedir}" "${local_filename}" "${extractdir}" # fn_dl_extract "/home/gameserver/lgsm/tmp" "file.tar.bz2" "/home/gamserver/serverfiles" -fn_dl_extract(){ +fn_dl_extract() { local_filedir="${1}" local_filename="${2}" extractdir="${3}" @@ -214,7 +214,7 @@ fn_dl_extract(){ if [ ! -d "${extractdir}" ]; then mkdir "${extractdir}" fi - if [ "${mime}" == "application/gzip" ]||[ "${mime}" == "application/x-gzip" ]; then + if [ "${mime}" == "application/gzip" ] || [ "${mime}" == "application/x-gzip" ]; then extractcmd=$(tar -zxf "${local_filedir}/${local_filename}" -C "${extractdir}") elif [ "${mime}" == "application/x-bzip2" ]; then extractcmd=$(tar -jxf "${local_filedir}/${local_filename}" -C "${extractdir}") @@ -239,7 +239,7 @@ fn_dl_extract(){ } # Trap to remove file download if canceled before completed. -fn_fetch_trap(){ +fn_fetch_trap() { echo -e "" echo -en "downloading ${local_filename}..." fn_print_canceled_eol_nl @@ -253,7 +253,7 @@ fn_fetch_trap(){ } # Will check a file exists and download it. Will not exit if fails to download. -fn_check_file(){ +fn_check_file() { remote_fileurl="${1}" remote_fileurl_backup="${2}" remote_fileurl_name="${3}" @@ -263,11 +263,11 @@ fn_check_file(){ if [ -n "${remote_fileurl_backup}" ]; then # counter set to 0 to allow second try counter=0 - remote_fileurls_array=( remote_fileurl remote_fileurl_backup ) + remote_fileurls_array=(remote_fileurl remote_fileurl_backup) else # counter set to 1 to not allow second try counter=1 - remote_fileurls_array=( remote_fileurl ) + remote_fileurls_array=(remote_fileurl) fi for remote_fileurl_array in "${remote_fileurls_array[@]}"; do if [ "${remote_fileurl_array}" == "remote_fileurl" ]; then @@ -277,7 +277,7 @@ fn_check_file(){ fileurl="${remote_fileurl_backup}" fileurl_name="${remote_fileurl_backup_name}" fi - counter=$((counter+1)) + counter=$((counter + 1)) echo -en "checking ${fileurl_name} ${remote_filename}...\c" curlcmd=$(curl --output /dev/null --silent --head --fail "${fileurl}" 2>&1) local exitcode=$? @@ -321,7 +321,7 @@ fn_check_file(){ fi } -fn_fetch_file(){ +fn_fetch_file() { remote_fileurl="${1}" remote_fileurl_backup="${2}" remote_fileurl_name="${3}" @@ -334,16 +334,16 @@ fn_fetch_file(){ hash="${10:-0}" # Download file if missing or download forced. - if [ ! -f "${local_filedir}/${local_filename}" ]||[ "${forcedl}" == "forcedl" ]; then + if [ ! -f "${local_filedir}/${local_filename}" ] || [ "${forcedl}" == "forcedl" ]; then # If backup fileurl exists include it. if [ -n "${remote_fileurl_backup}" ]; then # counter set to 0 to allow second try counter=0 - remote_fileurls_array=( remote_fileurl remote_fileurl_backup ) + remote_fileurls_array=(remote_fileurl remote_fileurl_backup) else # counter set to 1 to not allow second try counter=1 - remote_fileurls_array=( remote_fileurl ) + remote_fileurls_array=(remote_fileurl) fi for remote_fileurl_array in "${remote_fileurls_array[@]}"; do if [ "${remote_fileurl_array}" == "remote_fileurl" ]; then @@ -353,14 +353,14 @@ fn_fetch_file(){ fileurl="${remote_fileurl_backup}" fileurl_name="${remote_fileurl_backup_name}" fi - counter=$((counter+1)) + counter=$((counter + 1)) if [ ! -d "${local_filedir}" ]; then mkdir -p "${local_filedir}" fi # Trap will remove part downloaded files if canceled. trap fn_fetch_trap INT # Larger files show a progress bar. - if [ "${local_filename##*.}" == "bz2" ]||[ "${local_filename##*.}" == "gz" ]||[ "${local_filename##*.}" == "zip" ]||[ "${local_filename##*.}" == "jar" ]||[ "${local_filename##*.}" == "xz" ]; then + if [ "${local_filename##*.}" == "bz2" ] || [ "${local_filename##*.}" == "gz" ] || [ "${local_filename##*.}" == "zip" ] || [ "${local_filename##*.}" == "jar" ] || [ "${local_filename##*.}" == "xz" ]; then echo -en "downloading ${local_filename}..." fn_sleep_time echo -en "\033[1K" @@ -374,7 +374,7 @@ fn_fetch_file(){ # Download will fail if downloads a html file. if [ -f "${local_filedir}/${local_filename}" ]; then - if [ -n "$(head "${local_filedir}/${local_filename}" | grep "DOCTYPE" )" ]; then + if [ -n "$(head "${local_filedir}/${local_filename}" | grep "DOCTYPE")" ]; then rm "${local_filedir:?}/${local_filename:?}" local exitcode=2 fi @@ -443,7 +443,7 @@ fn_fetch_file(){ # hash: Optional, set an hash sum and will compare it against the file. # Fetches files from the Git repo. -fn_fetch_file_github(){ +fn_fetch_file_github() { github_fileurl_dir="${1}" github_fileurl_name="${2}" # For legacy versions - code can be removed at a future date @@ -451,7 +451,7 @@ fn_fetch_file_github(){ remote_fileurl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_fileurl_dir}/${github_fileurl_name}" remote_fileurl_backup="https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/${github_fileurl_dir}/${github_fileurl_name}" # If master branch will currently running LinuxGSM version to prevent "version mixing". This is ignored if a fork. - elif [ "${githubbranch}" == "master" ]&&[ "${githubuser}" == "GameServerManager" ]&&[ "${commandname}" != "UPDATE-LGSM" ]; then + elif [ "${githubbranch}" == "master" ] && [ "${githubuser}" == "GameServerManager" ] && [ "${commandname}" != "UPDATE-LGSM" ]; then remote_fileurl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${version}/${github_fileurl_dir}/${github_fileurl_name}" remote_fileurl_backup="https://bitbucket.org/${githubuser}/${githubrepo}/raw/${version}/${github_fileurl_dir}/${github_fileurl_name}" else @@ -470,10 +470,10 @@ fn_fetch_file_github(){ fn_fetch_file "${remote_fileurl}" "${remote_fileurl_backup}" "${remote_fileurl_name}" "${remote_fileurl_backup_name}" "${local_filedir}" "${local_filename}" "${chmodx}" "${run}" "${forcedl}" "${hash}" } -fn_check_file_github(){ +fn_check_file_github() { github_fileurl_dir="${1}" github_fileurl_name="${2}" - if [ "${githubbranch}" == "master" ]&&[ "${githubuser}" == "GameServerManager" ]&&[ "${commandname}" != "UPDATE-LGSM" ]; then + if [ "${githubbranch}" == "master" ] && [ "${githubuser}" == "GameServerManager" ] && [ "${commandname}" != "UPDATE-LGSM" ]; then remote_fileurl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${version}/${github_fileurl_dir}/${github_fileurl_name}" remote_fileurl_backup="https://bitbucket.org/${githubuser}/${githubrepo}/raw/${version}/${github_fileurl_dir}/${github_fileurl_name}" else @@ -486,11 +486,11 @@ fn_check_file_github(){ } # Fetches config files from the Git repo. -fn_fetch_config(){ +fn_fetch_config() { github_fileurl_dir="${1}" github_fileurl_name="${2}" # If master branch will currently running LinuxGSM version to prevent "version mixing". This is ignored if a fork. - if [ "${githubbranch}" == "master" ]&&[ "${githubuser}" == "GameServerManager" ]&&[ "${commandname}" != "UPDATE-LGSM" ]; then + if [ "${githubbranch}" == "master" ] && [ "${githubuser}" == "GameServerManager" ] && [ "${commandname}" != "UPDATE-LGSM" ]; then remote_fileurl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${version}/${github_fileurl_dir}/${github_fileurl_name}" remote_fileurl_backup="https://bitbucket.org/${githubuser}/${githubrepo}/raw/${version}/${github_fileurl_dir}/${github_fileurl_name}" else @@ -510,11 +510,11 @@ fn_fetch_config(){ } # Fetches modules from the Git repo during first download. -fn_fetch_function(){ +fn_fetch_function() { github_fileurl_dir="lgsm/functions" github_fileurl_name="${functionfile}" - # If master branch will currently running LinuxGSM version to prevent "version mixing". This is ignored if a fork. - if [ "${githubbranch}" == "master" ]&&[ "${githubuser}" == "GameServerManager" ]&&[ "${commandname}" != "UPDATE-LGSM" ]; then + # If master branch will currently running LinuxGSM version to prevent "version mixing". This is ignored if a fork. + if [ "${githubbranch}" == "master" ] && [ "${githubuser}" == "GameServerManager" ] && [ "${commandname}" != "UPDATE-LGSM" ]; then remote_fileurl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${version}/${github_fileurl_dir}/${github_fileurl_name}" remote_fileurl_backup="https://bitbucket.org/${githubuser}/${githubrepo}/raw/${version}/${github_fileurl_dir}/${github_fileurl_name}" else @@ -534,11 +534,11 @@ fn_fetch_function(){ } # Fetches modules from the Git repo during update-lgsm. -fn_update_function(){ +fn_update_function() { github_fileurl_dir="lgsm/functions" github_fileurl_name="${functionfile}" # If master branch will currently running LinuxGSM version to prevent "version mixing". This is ignored if a fork. - if [ "${githubbranch}" == "master" ]&&[ "${githubuser}" == "GameServerManager" ]&&[ "${commandname}" != "UPDATE-LGSM" ]; then + if [ "${githubbranch}" == "master" ] && [ "${githubuser}" == "GameServerManager" ] && [ "${commandname}" != "UPDATE-LGSM" ]; then remote_fileurl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${version}/${github_fileurl_dir}/${github_fileurl_name}" remote_fileurl_backup="https://bitbucket.org/${githubuser}/${githubrepo}/raw/${version}/${github_fileurl_dir}/${github_fileurl_name}" else @@ -563,7 +563,7 @@ fn_update_function(){ # $2 Repo name. # $3 Destination for download. # $4 Search string in releases (needed if there are more files that can be downloaded from the release pages). -fn_dl_latest_release_github(){ +fn_dl_latest_release_github() { local githubreleaseuser="${1}" local githubreleaserepo="${2}" local githubreleasedownloadpath="${3}" diff --git a/lgsm/functions/core_exit.sh b/lgsm/functions/core_exit.sh index 34379a486..93c37dfc7 100755 --- a/lgsm/functions/core_exit.sh +++ b/lgsm/functions/core_exit.sh @@ -7,7 +7,7 @@ functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" -fn_exit_dev_debug(){ +fn_exit_dev_debug() { if [ -f "${rootdir}/.dev-debug" ]; then echo -e "" echo -e "${functionselfname} exiting with code: ${exitcode}" @@ -25,7 +25,7 @@ fi if [ "${exitbypass}" ]; then unset exitbypass -elif [ "${exitcode}" ]&&[ "${exitcode}" != "0" ]; then +elif [ "${exitcode}" ] && [ "${exitcode}" != "0" ]; then # List LinuxGSM version in logs fn_script_log_info "LinuxGSM version: ${version}" if [ "${exitcode}" == "1" ]; then @@ -41,7 +41,7 @@ elif [ "${exitcode}" ]&&[ "${exitcode}" != "0" ]; then # remove trap. trap - INT exit "${exitcode}" -elif [ "${exitcode}" ]&&[ "${exitcode}" == "0" ]; then +elif [ "${exitcode}" ] && [ "${exitcode}" == "0" ]; then # List LinuxGSM version in logs fn_script_log_info "LinuxGSM version: ${version}" fn_script_log_pass "${functionselfname} exiting with code: ${exitcode}" diff --git a/lgsm/functions/core_functions.sh b/lgsm/functions/core_functions.sh index 67ed2a59b..29d2e2ebc 100755 --- a/lgsm/functions/core_functions.sh +++ b/lgsm/functions/core_functions.sh @@ -12,780 +12,780 @@ modulesversion="v22.1.0" # Core -core_dl.sh(){ -functionfile="${FUNCNAME[0]}" -if [ "$(type fn_fetch_core_dl 2>/dev/null)" ]; then - fn_fetch_core_dl "lgsm/functions" "core_dl.sh" "${functionsdir}" "chmodx" "run" "noforcedl" "nohash" -else - fn_bootstrap_fetch_file_github "lgsm/functions" "core_dl.sh" "${functionsdir}" "chmodx" "run" "noforcedl" "nohash" -fi +core_dl.sh() { + functionfile="${FUNCNAME[0]}" + if [ "$(type fn_fetch_core_dl 2> /dev/null)" ]; then + fn_fetch_core_dl "lgsm/functions" "core_dl.sh" "${functionsdir}" "chmodx" "run" "noforcedl" "nohash" + else + fn_bootstrap_fetch_file_github "lgsm/functions" "core_dl.sh" "${functionsdir}" "chmodx" "run" "noforcedl" "nohash" + fi } -core_messages.sh(){ -functionfile="${FUNCNAME[0]}" -if [ "$(type fn_fetch_core_dl 2>/dev/null)" ]; then - fn_fetch_core_dl "lgsm/functions" "core_messages.sh" "${functionsdir}" "chmodx" "run" "noforcedl" "nohash" -else - fn_bootstrap_fetch_file_github "lgsm/functions" "core_messages.sh" "${functionsdir}" "chmodx" "run" "noforcedl" "nohash" -fi +core_messages.sh() { + functionfile="${FUNCNAME[0]}" + if [ "$(type fn_fetch_core_dl 2> /dev/null)" ]; then + fn_fetch_core_dl "lgsm/functions" "core_messages.sh" "${functionsdir}" "chmodx" "run" "noforcedl" "nohash" + else + fn_bootstrap_fetch_file_github "lgsm/functions" "core_messages.sh" "${functionsdir}" "chmodx" "run" "noforcedl" "nohash" + fi } -core_legacy.sh(){ -functionfile="${FUNCNAME[0]}" -if [ "$(type fn_fetch_core_dl 2>/dev/null)" ]; then - fn_fetch_core_dl "lgsm/functions" "core_legacy.sh" "${functionsdir}" "chmodx" "run" "noforcedl" "nohash" -else - fn_bootstrap_fetch_file_github "lgsm/functions" "core_legacy.sh" "${functionsdir}" "chmodx" "run" "noforcedl" "nohash" -fi +core_legacy.sh() { + functionfile="${FUNCNAME[0]}" + if [ "$(type fn_fetch_core_dl 2> /dev/null)" ]; then + fn_fetch_core_dl "lgsm/functions" "core_legacy.sh" "${functionsdir}" "chmodx" "run" "noforcedl" "nohash" + else + fn_bootstrap_fetch_file_github "lgsm/functions" "core_legacy.sh" "${functionsdir}" "chmodx" "run" "noforcedl" "nohash" + fi } -core_exit.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function +core_exit.sh() { + functionfile="${FUNCNAME[0]}" + fn_fetch_function } -core_getopt.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function +core_getopt.sh() { + functionfile="${FUNCNAME[0]}" + fn_fetch_function } -core_trap.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function +core_trap.sh() { + functionfile="${FUNCNAME[0]}" + fn_fetch_function } -core_steamcmd.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function +core_steamcmd.sh() { + functionfile="${FUNCNAME[0]}" + fn_fetch_function } -core_github.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function +core_github.sh() { + functionfile="${FUNCNAME[0]}" + fn_fetch_function } # Commands -command_backup.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function +command_backup.sh() { + functionfile="${FUNCNAME[0]}" + fn_fetch_function } -command_console.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function +command_console.sh() { + functionfile="${FUNCNAME[0]}" + fn_fetch_function } -command_debug.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function +command_debug.sh() { + functionfile="${FUNCNAME[0]}" + fn_fetch_function } -command_details.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function +command_details.sh() { + functionfile="${FUNCNAME[0]}" + fn_fetch_function } -command_donate.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function +command_donate.sh() { + functionfile="${FUNCNAME[0]}" + fn_fetch_function } -command_postdetails.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function +command_postdetails.sh() { + functionfile="${FUNCNAME[0]}" + fn_fetch_function } -command_test_alert.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function +command_test_alert.sh() { + functionfile="${FUNCNAME[0]}" + fn_fetch_function } -command_monitor.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function +command_monitor.sh() { + functionfile="${FUNCNAME[0]}" + fn_fetch_function } -command_start.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function +command_start.sh() { + functionfile="${FUNCNAME[0]}" + fn_fetch_function } -command_stop.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function +command_stop.sh() { + functionfile="${FUNCNAME[0]}" + fn_fetch_function } -command_validate.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function +command_validate.sh() { + functionfile="${FUNCNAME[0]}" + fn_fetch_function } -command_install.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function +command_install.sh() { + functionfile="${FUNCNAME[0]}" + fn_fetch_function } -command_install_resources_mta.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function +command_install_resources_mta.sh() { + functionfile="${FUNCNAME[0]}" + fn_fetch_function } -install_squad_license.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function +install_squad_license.sh() { + functionfile="${FUNCNAME[0]}" + fn_fetch_function } -command_mods_install.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function +command_mods_install.sh() { + functionfile="${FUNCNAME[0]}" + fn_fetch_function } -command_mods_update.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function +command_mods_update.sh() { + functionfile="${FUNCNAME[0]}" + fn_fetch_function } -command_mods_remove.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function +command_mods_remove.sh() { + functionfile="${FUNCNAME[0]}" + fn_fetch_function } -command_fastdl.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function +command_fastdl.sh() { + functionfile="${FUNCNAME[0]}" + fn_fetch_function } -command_ts3_server_pass.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function +command_ts3_server_pass.sh() { + functionfile="${FUNCNAME[0]}" + fn_fetch_function } -command_restart.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function +command_restart.sh() { + functionfile="${FUNCNAME[0]}" + fn_fetch_function } -command_skeleton.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function +command_skeleton.sh() { + functionfile="${FUNCNAME[0]}" + fn_fetch_function } -command_wipe.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function +command_wipe.sh() { + functionfile="${FUNCNAME[0]}" + fn_fetch_function } -command_send.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function +command_send.sh() { + functionfile="${FUNCNAME[0]}" + fn_fetch_function } # Checks -check.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function +check.sh() { + functionfile="${FUNCNAME[0]}" + fn_fetch_function } -check_config.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function +check_config.sh() { + functionfile="${FUNCNAME[0]}" + fn_fetch_function } -check_deps.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function +check_deps.sh() { + functionfile="${FUNCNAME[0]}" + fn_fetch_function } -check_executable.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function +check_executable.sh() { + functionfile="${FUNCNAME[0]}" + fn_fetch_function } -check_glibc.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function +check_glibc.sh() { + functionfile="${FUNCNAME[0]}" + fn_fetch_function } -check_ip.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function +check_ip.sh() { + functionfile="${FUNCNAME[0]}" + fn_fetch_function } -check_last_update.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function +check_last_update.sh() { + functionfile="${FUNCNAME[0]}" + fn_fetch_function } -check_logs.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function +check_logs.sh() { + functionfile="${FUNCNAME[0]}" + fn_fetch_function } -check_permissions.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function +check_permissions.sh() { + functionfile="${FUNCNAME[0]}" + fn_fetch_function } -check_root.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function +check_root.sh() { + functionfile="${FUNCNAME[0]}" + fn_fetch_function } -check_status.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function +check_status.sh() { + functionfile="${FUNCNAME[0]}" + fn_fetch_function } -check_steamcmd.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function +check_steamcmd.sh() { + functionfile="${FUNCNAME[0]}" + fn_fetch_function } -check_system_dir.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function +check_system_dir.sh() { + functionfile="${FUNCNAME[0]}" + fn_fetch_function } -check_system_requirements.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function +check_system_requirements.sh() { + functionfile="${FUNCNAME[0]}" + fn_fetch_function } -check_tmuxception.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function +check_tmuxception.sh() { + functionfile="${FUNCNAME[0]}" + fn_fetch_function } -check_version.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function +check_version.sh() { + functionfile="${FUNCNAME[0]}" + fn_fetch_function } # Compress -compress_unreal2_maps.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function +compress_unreal2_maps.sh() { + functionfile="${FUNCNAME[0]}" + fn_fetch_function } -compress_ut99_maps.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function +compress_ut99_maps.sh() { + functionfile="${FUNCNAME[0]}" + fn_fetch_function } # Mods -mods_list.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function +mods_list.sh() { + functionfile="${FUNCNAME[0]}" + fn_fetch_function } -mods_core.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function +mods_core.sh() { + functionfile="${FUNCNAME[0]}" + fn_fetch_function } # Dev -command_dev_clear_functions.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function +command_dev_clear_functions.sh() { + functionfile="${FUNCNAME[0]}" + fn_fetch_function } -command_dev_debug.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function +command_dev_debug.sh() { + functionfile="${FUNCNAME[0]}" + fn_fetch_function } -command_dev_detect_deps.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function +command_dev_detect_deps.sh() { + functionfile="${FUNCNAME[0]}" + fn_fetch_function } -command_dev_detect_glibc.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function +command_dev_detect_glibc.sh() { + functionfile="${FUNCNAME[0]}" + fn_fetch_function } -command_dev_detect_ldd.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function +command_dev_detect_ldd.sh() { + functionfile="${FUNCNAME[0]}" + fn_fetch_function } -command_dev_query_raw.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function +command_dev_query_raw.sh() { + functionfile="${FUNCNAME[0]}" + fn_fetch_function } # Fix -fix.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function +fix.sh() { + functionfile="${FUNCNAME[0]}" + fn_fetch_function } -fix_ark.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function +fix_ark.sh() { + functionfile="${FUNCNAME[0]}" + fn_fetch_function } -fix_av.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function +fix_av.sh() { + functionfile="${FUNCNAME[0]}" + fn_fetch_function } -fix_arma3.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function +fix_arma3.sh() { + functionfile="${FUNCNAME[0]}" + fn_fetch_function } -fix_armar.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function +fix_armar.sh() { + functionfile="${FUNCNAME[0]}" + fn_fetch_function } -fix_bo.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function +fix_bo.sh() { + functionfile="${FUNCNAME[0]}" + fn_fetch_function } -fix_cmw.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function +fix_cmw.sh() { + functionfile="${FUNCNAME[0]}" + fn_fetch_function } -fix_csgo.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function +fix_csgo.sh() { + functionfile="${FUNCNAME[0]}" + fn_fetch_function } -fix_dst.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function +fix_dst.sh() { + functionfile="${FUNCNAME[0]}" + fn_fetch_function } -fix_hw.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function +fix_hw.sh() { + functionfile="${FUNCNAME[0]}" + fn_fetch_function } -fix_ins.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function +fix_ins.sh() { + functionfile="${FUNCNAME[0]}" + fn_fetch_function } -fix_kf.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function +fix_kf.sh() { + functionfile="${FUNCNAME[0]}" + fn_fetch_function } -fix_kf2.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function +fix_kf2.sh() { + functionfile="${FUNCNAME[0]}" + fn_fetch_function } -fix_lo.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function +fix_lo.sh() { + functionfile="${FUNCNAME[0]}" + fn_fetch_function } -fix_mcb.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function +fix_mcb.sh() { + functionfile="${FUNCNAME[0]}" + fn_fetch_function } -fix_mta.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function +fix_mta.sh() { + functionfile="${FUNCNAME[0]}" + fn_fetch_function } -fix_nmrih.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function +fix_nmrih.sh() { + functionfile="${FUNCNAME[0]}" + fn_fetch_function } -fix_onset.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function +fix_onset.sh() { + functionfile="${FUNCNAME[0]}" + fn_fetch_function } -fix_ro.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function +fix_ro.sh() { + functionfile="${FUNCNAME[0]}" + fn_fetch_function } -fix_rust.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function +fix_rust.sh() { + functionfile="${FUNCNAME[0]}" + fn_fetch_function } -fix_rw.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function +fix_rw.sh() { + functionfile="${FUNCNAME[0]}" + fn_fetch_function } -fix_sfc.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function +fix_sfc.sh() { + functionfile="${FUNCNAME[0]}" + fn_fetch_function } -fix_st.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function +fix_st.sh() { + functionfile="${FUNCNAME[0]}" + fn_fetch_function } -fix_steamcmd.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function +fix_steamcmd.sh() { + functionfile="${FUNCNAME[0]}" + fn_fetch_function } -fix_terraria.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function +fix_terraria.sh() { + functionfile="${FUNCNAME[0]}" + fn_fetch_function } -fix_tf2.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function +fix_tf2.sh() { + functionfile="${FUNCNAME[0]}" + fn_fetch_function } -fix_ut3.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function +fix_ut3.sh() { + functionfile="${FUNCNAME[0]}" + fn_fetch_function } -fix_rust.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function +fix_rust.sh() { + functionfile="${FUNCNAME[0]}" + fn_fetch_function } -fix_samp.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function +fix_samp.sh() { + functionfile="${FUNCNAME[0]}" + fn_fetch_function } -fix_sdtd.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function +fix_sdtd.sh() { + functionfile="${FUNCNAME[0]}" + fn_fetch_function } -fix_sof2.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function +fix_sof2.sh() { + functionfile="${FUNCNAME[0]}" + fn_fetch_function } -fix_squad.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function +fix_squad.sh() { + functionfile="${FUNCNAME[0]}" + fn_fetch_function } -fix_ts3.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function +fix_ts3.sh() { + functionfile="${FUNCNAME[0]}" + fn_fetch_function } -fix_ut2k4.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function +fix_ut2k4.sh() { + functionfile="${FUNCNAME[0]}" + fn_fetch_function } -fix_ut.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function +fix_ut.sh() { + functionfile="${FUNCNAME[0]}" + fn_fetch_function } -fix_unt.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function +fix_unt.sh() { + functionfile="${FUNCNAME[0]}" + fn_fetch_function } -fix_vh.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function +fix_vh.sh() { + functionfile="${FUNCNAME[0]}" + fn_fetch_function } -fix_wurm.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function +fix_wurm.sh() { + functionfile="${FUNCNAME[0]}" + fn_fetch_function } -fix_zmr.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function +fix_zmr.sh() { + functionfile="${FUNCNAME[0]}" + fn_fetch_function } # Info -info_distro.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function +info_distro.sh() { + functionfile="${FUNCNAME[0]}" + fn_fetch_function } -info_game.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function +info_game.sh() { + functionfile="${FUNCNAME[0]}" + fn_fetch_function } -info_messages.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function +info_messages.sh() { + functionfile="${FUNCNAME[0]}" + fn_fetch_function } -info_stats.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function +info_stats.sh() { + functionfile="${FUNCNAME[0]}" + fn_fetch_function } # Alert -alert.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function +alert.sh() { + functionfile="${FUNCNAME[0]}" + fn_fetch_function } -alert_discord.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function +alert_discord.sh() { + functionfile="${FUNCNAME[0]}" + fn_fetch_function } -alert_email.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function +alert_email.sh() { + functionfile="${FUNCNAME[0]}" + fn_fetch_function } -alert_ifttt.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function +alert_ifttt.sh() { + functionfile="${FUNCNAME[0]}" + fn_fetch_function } -alert_mailgun.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function +alert_mailgun.sh() { + functionfile="${FUNCNAME[0]}" + fn_fetch_function } -alert_pushbullet.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function +alert_pushbullet.sh() { + functionfile="${FUNCNAME[0]}" + fn_fetch_function } -alert_pushover.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function +alert_pushover.sh() { + functionfile="${FUNCNAME[0]}" + fn_fetch_function } -alert_gotify.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function +alert_gotify.sh() { + functionfile="${FUNCNAME[0]}" + fn_fetch_function } -alert_telegram.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function +alert_telegram.sh() { + functionfile="${FUNCNAME[0]}" + fn_fetch_function } -alert_rocketchat.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function +alert_rocketchat.sh() { + functionfile="${FUNCNAME[0]}" + fn_fetch_function } -alert_slack.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function +alert_slack.sh() { + functionfile="${FUNCNAME[0]}" + fn_fetch_function } # Logs -core_logs.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function +core_logs.sh() { + functionfile="${FUNCNAME[0]}" + fn_fetch_function } # Query -query_gamedig.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function +query_gamedig.sh() { + functionfile="${FUNCNAME[0]}" + fn_fetch_function } # Update -command_update_functions.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function +command_update_functions.sh() { + functionfile="${FUNCNAME[0]}" + fn_fetch_function } -command_update_linuxgsm.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function +command_update_linuxgsm.sh() { + functionfile="${FUNCNAME[0]}" + fn_fetch_function } -command_update.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function +command_update.sh() { + functionfile="${FUNCNAME[0]}" + fn_fetch_function } -command_check_update.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function +command_check_update.sh() { + functionfile="${FUNCNAME[0]}" + fn_fetch_function } -update_ts3.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function +update_ts3.sh() { + functionfile="${FUNCNAME[0]}" + fn_fetch_function } -update_minecraft.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function +update_minecraft.sh() { + functionfile="${FUNCNAME[0]}" + fn_fetch_function } -update_minecraft_bedrock.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function +update_minecraft_bedrock.sh() { + functionfile="${FUNCNAME[0]}" + fn_fetch_function } -update_papermc.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function +update_papermc.sh() { + functionfile="${FUNCNAME[0]}" + fn_fetch_function } -update_mumble.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function +update_mumble.sh() { + functionfile="${FUNCNAME[0]}" + fn_fetch_function } -update_mta.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function +update_mta.sh() { + functionfile="${FUNCNAME[0]}" + fn_fetch_function } -update_factorio.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function +update_factorio.sh() { + functionfile="${FUNCNAME[0]}" + fn_fetch_function } -update_jediknight2.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function +update_jediknight2.sh() { + functionfile="${FUNCNAME[0]}" + fn_fetch_function } -update_steamcmd.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function +update_steamcmd.sh() { + functionfile="${FUNCNAME[0]}" + fn_fetch_function } -update_vintagestory.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function +update_vintagestory.sh() { + functionfile="${FUNCNAME[0]}" + fn_fetch_function } -fn_update_functions.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function +fn_update_functions.sh() { + functionfile="${FUNCNAME[0]}" + fn_fetch_function } # ## Installer functions # -fn_autoinstall(){ -autoinstall=1 -command_install.sh +fn_autoinstall() { + autoinstall=1 + command_install.sh } -install_complete.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function +install_complete.sh() { + functionfile="${FUNCNAME[0]}" + fn_fetch_function } -install_config.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function +install_config.sh() { + functionfile="${FUNCNAME[0]}" + fn_fetch_function } -install_factorio_save.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function +install_factorio_save.sh() { + functionfile="${FUNCNAME[0]}" + fn_fetch_function } -install_dst_token.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function +install_dst_token.sh() { + functionfile="${FUNCNAME[0]}" + fn_fetch_function } -install_eula.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function +install_eula.sh() { + functionfile="${FUNCNAME[0]}" + fn_fetch_function } -install_gsquery.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function +install_gsquery.sh() { + functionfile="${FUNCNAME[0]}" + fn_fetch_function } -install_gslt.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function +install_gslt.sh() { + functionfile="${FUNCNAME[0]}" + fn_fetch_function } -install_header.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function +install_header.sh() { + functionfile="${FUNCNAME[0]}" + fn_fetch_function } -install_logs.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function +install_logs.sh() { + functionfile="${FUNCNAME[0]}" + fn_fetch_function } -install_retry.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function +install_retry.sh() { + functionfile="${FUNCNAME[0]}" + fn_fetch_function } -install_server_dir.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function +install_server_dir.sh() { + functionfile="${FUNCNAME[0]}" + fn_fetch_function } -install_server_files.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function +install_server_files.sh() { + functionfile="${FUNCNAME[0]}" + fn_fetch_function } -install_stats.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function +install_stats.sh() { + functionfile="${FUNCNAME[0]}" + fn_fetch_function } -install_steamcmd.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function +install_steamcmd.sh() { + functionfile="${FUNCNAME[0]}" + fn_fetch_function } -install_ts3.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function +install_ts3.sh() { + functionfile="${FUNCNAME[0]}" + fn_fetch_function } -install_ts3db.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function +install_ts3db.sh() { + functionfile="${FUNCNAME[0]}" + fn_fetch_function } -install_ut2k4.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function +install_ut2k4.sh() { + functionfile="${FUNCNAME[0]}" + fn_fetch_function } -install_dl_ut2k4.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function +install_dl_ut2k4.sh() { + functionfile="${FUNCNAME[0]}" + fn_fetch_function } -install_ut2k4_key.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function +install_ut2k4_key.sh() { + functionfile="${FUNCNAME[0]}" + fn_fetch_function } # Calls code required for legacy servers diff --git a/lgsm/functions/core_getopt.sh b/lgsm/functions/core_getopt.sh index 9594fa5ae..0a5a39c09 100755 --- a/lgsm/functions/core_getopt.sh +++ b/lgsm/functions/core_getopt.sh @@ -10,158 +10,157 @@ functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" ### Define all commands here. ## User commands | Trigger commands | Description # Standard commands. -cmd_install=( "i;install" "command_install.sh" "Install the server." ) -cmd_auto_install=( "ai;auto-install" "fn_autoinstall" "Install the server without prompts." ) -cmd_start=( "st;start" "command_start.sh" "Start the server." ) -cmd_stop=( "sp;stop" "command_stop.sh" "Stop the server." ) -cmd_restart=( "r;restart" "command_restart.sh" "Restart the server." ) -cmd_details=( "dt;details" "command_details.sh" "Display server information." ) -cmd_postdetails=( "pd;postdetails" "command_postdetails.sh" "Post details to termbin.com (removing passwords)." ) -cmd_backup=( "b;backup" "command_backup.sh" "Create backup archives of the server." ) -cmd_update_linuxgsm=( "ul;update-lgsm;uf;update-functions" "command_update_linuxgsm.sh" "Check and apply any LinuxGSM updates." ) -cmd_test_alert=( "ta;test-alert" "command_test_alert.sh" "Send a test alert." ) -cmd_monitor=( "m;monitor" "command_monitor.sh" "Check server status and restart if crashed." ) -cmd_skeleton=( "sk;skeleton" "command_skeleton.sh" "Create a skeleton directory." ) -cmd_donate=( "do;donate" "command_donate.sh" "Donation options." ) -cmd_send=( "sd;send" "command_send.sh" "Send command to game server console." ) +cmd_install=("i;install" "command_install.sh" "Install the server.") +cmd_auto_install=("ai;auto-install" "fn_autoinstall" "Install the server without prompts.") +cmd_start=("st;start" "command_start.sh" "Start the server.") +cmd_stop=("sp;stop" "command_stop.sh" "Stop the server.") +cmd_restart=("r;restart" "command_restart.sh" "Restart the server.") +cmd_details=("dt;details" "command_details.sh" "Display server information.") +cmd_postdetails=("pd;postdetails" "command_postdetails.sh" "Post details to termbin.com (removing passwords).") +cmd_backup=("b;backup" "command_backup.sh" "Create backup archives of the server.") +cmd_update_linuxgsm=("ul;update-lgsm;uf;update-functions" "command_update_linuxgsm.sh" "Check and apply any LinuxGSM updates.") +cmd_test_alert=("ta;test-alert" "command_test_alert.sh" "Send a test alert.") +cmd_monitor=("m;monitor" "command_monitor.sh" "Check server status and restart if crashed.") +cmd_skeleton=("sk;skeleton" "command_skeleton.sh" "Create a skeleton directory.") +cmd_donate=("do;donate" "command_donate.sh" "Donation options.") +cmd_send=("sd;send" "command_send.sh" "Send command to game server console.") # Console servers only. -cmd_console=( "c;console" "command_console.sh" "Access server console." ) -cmd_debug=( "d;debug" "command_debug.sh" "Start server directly in your terminal." ) +cmd_console=("c;console" "command_console.sh" "Access server console.") +cmd_debug=("d;debug" "command_debug.sh" "Start server directly in your terminal.") # Update servers only. -cmd_update=( "u;update" "command_update.sh" "Check and apply any server updates." ) -cmd_check_update=( "cu;check-update" "command_check_update.sh" "Check if a gameserver update is available" ) -cmd_force_update=( "fu;force-update;update-restart;ur" "forceupdate=1; command_update.sh" "Apply server updates bypassing check." ) +cmd_update=("u;update" "command_update.sh" "Check and apply any server updates.") +cmd_check_update=("cu;check-update" "command_check_update.sh" "Check if a gameserver update is available") +cmd_force_update=("fu;force-update;update-restart;ur" "forceupdate=1; command_update.sh" "Apply server updates bypassing check.") # SteamCMD servers only. -cmd_validate=( "v;validate" "command_validate.sh" "Validate server files with SteamCMD." ) +cmd_validate=("v;validate" "command_validate.sh" "Validate server files with SteamCMD.") # Server with mods-install. -cmd_mods_install=( "mi;mods-install" "command_mods_install.sh" "View and install available mods/addons." ) -cmd_mods_remove=( "mr;mods-remove" "command_mods_remove.sh" "View and remove an installed mod/addon." ) -cmd_mods_update=( "mu;mods-update" "command_mods_update.sh" "Update installed mods/addons." ) +cmd_mods_install=("mi;mods-install" "command_mods_install.sh" "View and install available mods/addons.") +cmd_mods_remove=("mr;mods-remove" "command_mods_remove.sh" "View and remove an installed mod/addon.") +cmd_mods_update=("mu;mods-update" "command_mods_update.sh" "Update installed mods/addons.") # Server specific. -cmd_change_password=( "pw;change-password" "command_ts3_server_pass.sh" "Change TS3 serveradmin password." ) -cmd_install_default_resources=( "ir;install-default-resources" "command_install_resources_mta.sh" "Install the MTA default resources." ) -cmd_fullwipe=( "fw;full-wipe;wa;wipeall" "serverwipe=1; command_wipe.sh" "Reset the map and remove blueprint data." ) -cmd_mapwipe=( "mw;map-wipe;w;wipe;wi" "mapwipe=1; command_wipe.sh" "Reset the map and keep blueprint data." ) -cmd_map_compressor_u99=( "mc;map-compressor" "compress_ut99_maps.sh" "Compresses all ${gamename} server maps." ) -cmd_map_compressor_u2=( "mc;map-compressor" "compress_unreal2_maps.sh" "Compresses all ${gamename} server maps." ) -cmd_install_cdkey=( "cd;server-cd-key" "install_ut2k4_key.sh" "Add your server cd key." ) -cmd_install_dst_token=( "ct;cluster-token" "install_dst_token.sh" "Configure cluster token." ) -cmd_install_squad_license=( "li;license" "install_squad_license.sh" "Add your Squad server license." ) -cmd_fastdl=( "fd;fastdl" "command_fastdl.sh" "Build a FastDL directory." ) +cmd_change_password=("pw;change-password" "command_ts3_server_pass.sh" "Change TS3 serveradmin password.") +cmd_install_default_resources=("ir;install-default-resources" "command_install_resources_mta.sh" "Install the MTA default resources.") +cmd_fullwipe=("fw;full-wipe;wa;wipeall" "serverwipe=1; command_wipe.sh" "Reset the map and remove blueprint data.") +cmd_mapwipe=("mw;map-wipe;w;wipe;wi" "mapwipe=1; command_wipe.sh" "Reset the map and keep blueprint data.") +cmd_map_compressor_u99=("mc;map-compressor" "compress_ut99_maps.sh" "Compresses all ${gamename} server maps.") +cmd_map_compressor_u2=("mc;map-compressor" "compress_unreal2_maps.sh" "Compresses all ${gamename} server maps.") +cmd_install_cdkey=("cd;server-cd-key" "install_ut2k4_key.sh" "Add your server cd key.") +cmd_install_dst_token=("ct;cluster-token" "install_dst_token.sh" "Configure cluster token.") +cmd_install_squad_license=("li;license" "install_squad_license.sh" "Add your Squad server license.") +cmd_fastdl=("fd;fastdl" "command_fastdl.sh" "Build a FastDL directory.") # Dev commands. -cmd_dev_debug=( "dev;developer" "command_dev_debug.sh" "Enable developer Mode." ) -cmd_dev_detect_deps=( "dd;detect-deps" "command_dev_detect_deps.sh" "Detect required dependencies." ) -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_query_raw=( "qr;query-raw" "command_dev_query_raw.sh" "The raw output of gamedig and gsquery." ) -cmd_dev_clear_functions=( "cf;clear-functions" "command_dev_clear_functions.sh" "Delete the contents of the functions dir." ) - +cmd_dev_debug=("dev;developer" "command_dev_debug.sh" "Enable developer Mode.") +cmd_dev_detect_deps=("dd;detect-deps" "command_dev_detect_deps.sh" "Detect required dependencies.") +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_query_raw=("qr;query-raw" "command_dev_query_raw.sh" "The raw output of gamedig and gsquery.") +cmd_dev_clear_functions=("cf;clear-functions" "command_dev_clear_functions.sh" "Delete the contents of the functions dir.") ### Set specific opt here. -currentopt=( "${cmd_start[@]}" "${cmd_stop[@]}" "${cmd_restart[@]}" "${cmd_monitor[@]}" "${cmd_test_alert[@]}" "${cmd_details[@]}" "${cmd_postdetails[@]}" "${cmd_skeleton[@]}" ) +currentopt=("${cmd_start[@]}" "${cmd_stop[@]}" "${cmd_restart[@]}" "${cmd_monitor[@]}" "${cmd_test_alert[@]}" "${cmd_details[@]}" "${cmd_postdetails[@]}" "${cmd_skeleton[@]}") # Update LinuxGSM. -currentopt+=( "${cmd_update_linuxgsm[@]}" ) +currentopt+=("${cmd_update_linuxgsm[@]}") # Exclude noupdate games here. -if [ "${shortname}" == "jk2" ]||[ "${engine}" != "idtech3" ];then - if [ "${shortname}" != "bf1942" ]&&[ "${shortname}" != "bfv" ]&&[ "${engine}" != "idtech2" ]&&[ "${engine}" != "iw2.0" ]&&[ "${engine}" != "iw3.0" ]&&[ "${engine}" != "quake" ]&&[ "${shortname}" != "samp" ]&&[ "${shortname}" != "ut2k4" ]&&[ "${shortname}" != "ut99" ]; then - currentopt+=( "${cmd_update[@]}" ) +if [ "${shortname}" == "jk2" ] || [ "${engine}" != "idtech3" ]; then + if [ "${shortname}" != "bf1942" ] && [ "${shortname}" != "bfv" ] && [ "${engine}" != "idtech2" ] && [ "${engine}" != "iw2.0" ] && [ "${engine}" != "iw3.0" ] && [ "${engine}" != "quake" ] && [ "${shortname}" != "samp" ] && [ "${shortname}" != "ut2k4" ] && [ "${shortname}" != "ut99" ]; then + currentopt+=("${cmd_update[@]}") # force update for SteamCMD or Multi Theft Auto only. - if [ "${appid}" ]||[ "${shortname}" == "mta" ]; then - currentopt+=( "${cmd_force_update[@]}" ) + if [ "${appid}" ] || [ "${shortname}" == "mta" ]; then + currentopt+=("${cmd_force_update[@]}") fi fi fi # Validate and check-update command. if [ "${appid}" ]; then - currentopt+=( "${cmd_validate[@]}" "${cmd_check_update[@]}" ) + currentopt+=("${cmd_validate[@]}" "${cmd_check_update[@]}") fi # Backup. -currentopt+=( "${cmd_backup[@]}" ) +currentopt+=("${cmd_backup[@]}") # Console & Debug. -currentopt+=( "${cmd_console[@]}" "${cmd_debug[@]}" ) +currentopt+=("${cmd_console[@]}" "${cmd_debug[@]}") # Console send. if [ "${consoleinteract}" == "yes" ]; then - currentopt+=( "${cmd_send[@]}" ) + currentopt+=("${cmd_send[@]}") fi ## Game server exclusive commands. # FastDL command. if [ "${engine}" == "source" ]; then - currentopt+=( "${cmd_fastdl[@]}" ) + currentopt+=("${cmd_fastdl[@]}") fi # TeamSpeak exclusive. if [ "${shortname}" == "ts3" ]; then - currentopt+=( "${cmd_change_password[@]}" ) + currentopt+=("${cmd_change_password[@]}") fi # Unreal exclusive. if [ "${shortname}" == "rust" ]; then - currentopt+=( "${cmd_fullwipe[@]}" "${cmd_mapwipe[@]}" ) + currentopt+=("${cmd_fullwipe[@]}" "${cmd_mapwipe[@]}") fi if [ "${engine}" == "unreal2" ]; then if [ "${shortname}" == "ut2k4" ]; then - currentopt+=( "${cmd_install_cdkey[@]}" "${cmd_map_compressor_u2[@]}" ) + currentopt+=("${cmd_install_cdkey[@]}" "${cmd_map_compressor_u2[@]}") else - currentopt+=( "${cmd_map_compressor_u2[@]}" ) + currentopt+=("${cmd_map_compressor_u2[@]}") fi fi if [ "${engine}" == "unreal" ]; then - currentopt+=( "${cmd_map_compressor_u99[@]}" ) + currentopt+=("${cmd_map_compressor_u99[@]}") fi # DST exclusive. if [ "${shortname}" == "dst" ]; then - currentopt+=( "${cmd_install_dst_token[@]}" ) + currentopt+=("${cmd_install_dst_token[@]}") fi # MTA exclusive. if [ "${shortname}" == "mta" ]; then - currentopt+=( "${cmd_install_default_resources[@]}" ) + currentopt+=("${cmd_install_default_resources[@]}") fi # Squad license exclusive. if [ "${shortname}" == "squad" ]; then - currentopt+=( "${cmd_install_squad_license[@]}" ) + currentopt+=("${cmd_install_squad_license[@]}") fi ## Mods commands. -if [ "${engine}" == "source" ]||[ "${shortname}" == "rust" ]||[ "${shortname}" == "hq" ]||[ "${shortname}" == "sdtd" ]||[ "${shortname}" == "cs" ]||[ "${shortname}" == "dod" ]||[ "${shortname}" == "tfc" ]||[ "${shortname}" == "ns" ]||[ "${shortname}" == "ts" ]||[ "${shortname}" == "hldm" ]||[ "${shortname}" == "vh" ]; then - currentopt+=( "${cmd_mods_install[@]}" "${cmd_mods_remove[@]}" "${cmd_mods_update[@]}" ) +if [ "${engine}" == "source" ] || [ "${shortname}" == "rust" ] || [ "${shortname}" == "hq" ] || [ "${shortname}" == "sdtd" ] || [ "${shortname}" == "cs" ] || [ "${shortname}" == "dod" ] || [ "${shortname}" == "tfc" ] || [ "${shortname}" == "ns" ] || [ "${shortname}" == "ts" ] || [ "${shortname}" == "hldm" ] || [ "${shortname}" == "vh" ]; then + currentopt+=("${cmd_mods_install[@]}" "${cmd_mods_remove[@]}" "${cmd_mods_update[@]}") fi ## Installer. -currentopt+=( "${cmd_install[@]}" "${cmd_auto_install[@]}" ) +currentopt+=("${cmd_install[@]}" "${cmd_auto_install[@]}") ## Developer commands. -currentopt+=( "${cmd_dev_debug[@]}" ) +currentopt+=("${cmd_dev_debug[@]}") if [ -f ".dev-debug" ]; then - currentopt+=( "${cmd_dev_detect_deps[@]}" "${cmd_dev_detect_glibc[@]}" "${cmd_dev_detect_ldd[@]}" "${cmd_dev_query_raw[@]}" "${cmd_dev_clear_functions[@]}" ) + currentopt+=("${cmd_dev_detect_deps[@]}" "${cmd_dev_detect_glibc[@]}" "${cmd_dev_detect_ldd[@]}" "${cmd_dev_query_raw[@]}" "${cmd_dev_clear_functions[@]}") fi ## Donate. -currentopt+=( "${cmd_donate[@]}" ) +currentopt+=("${cmd_donate[@]}") ### Build list of available commands. optcommands=() index="0" -for ((index="0"; index < ${#currentopt[@]}; index+=3)); do +for ((index = "0"; index < ${#currentopt[@]}; index += 3)); do cmdamount=$(echo -e "${currentopt[index]}" | awk -F ';' '{ print NF }') - for ((cmdindex=1; cmdindex <= cmdamount; cmdindex++)); do - optcommands+=( "$(echo -e "${currentopt[index]}" | awk -F ';' -v x=${cmdindex} '{ print $x }')" ) + for ((cmdindex = 1; cmdindex <= cmdamount; cmdindex++)); do + optcommands+=("$(echo -e "${currentopt[index]}" | awk -F ';' -v x=${cmdindex} '{ print $x }')") done done # Shows LinuxGSM usage. -fn_opt_usage(){ +fn_opt_usage() { echo -e "Usage: $0 [option]" echo -e "" echo -e "LinuxGSM - ${gamename} - Version ${version}" @@ -171,12 +170,12 @@ fn_opt_usage(){ # Display available commands. index="0" { - for ((index="0"; index < ${#currentopt[@]}; index+=3)); do - # Hide developer commands. - if [ "${currentopt[index+2]}" != "DEVCOMMAND" ]; then - echo -e "${cyan}$(echo -e "${currentopt[index]}" | awk -F ';' '{ print $2 }')\t${default}$(echo -e "${currentopt[index]}" | awk -F ';' '{ print $1 }')\t| ${currentopt[index+2]}" - fi - done + for ((index = "0"; index < ${#currentopt[@]}; index += 3)); do + # Hide developer commands. + if [ "${currentopt[index + 2]}" != "DEVCOMMAND" ]; then + echo -e "${cyan}$(echo -e "${currentopt[index]}" | awk -F ';' '{ print $2 }')\t${default}$(echo -e "${currentopt[index]}" | awk -F ';' '{ print $1 }')\t| ${currentopt[index + 2]}" + fi + done } | column -s $'\t' -t fn_script_log_pass "Display commands" core_exit.sh @@ -188,15 +187,15 @@ if [ -z "${getopt}" ]; then fi # If command exists. for i in "${optcommands[@]}"; do - if [ "${i}" == "${getopt}" ] ; then + if [ "${i}" == "${getopt}" ]; then # Seek and run command. index="0" - for ((index="0"; index < ${#currentopt[@]}; index+=3)); do + for ((index = "0"; index < ${#currentopt[@]}; index += 3)); do currcmdamount=$(echo -e "${currentopt[index]}" | awk -F ';' '{ print NF }') - for ((currcmdindex=1; currcmdindex <= currcmdamount; currcmdindex++)); do + for ((currcmdindex = 1; currcmdindex <= currcmdamount; currcmdindex++)); do if [ "$(echo -e "${currentopt[index]}" | awk -F ';' -v x=${currcmdindex} '{ print $x }')" == "${getopt}" ]; then # Run command. - eval "${currentopt[index+1]}" + eval "${currentopt[index + 1]}" # Exit should occur in modules. Should this not happen print an error fn_print_error2_nl "Command did not exit correctly: ${getopt}" fn_script_log_error "Command did not exit correctly: ${getopt}" diff --git a/lgsm/functions/core_github.sh b/lgsm/functions/core_github.sh index 5bd4bd730..0462e65bf 100644 --- a/lgsm/functions/core_github.sh +++ b/lgsm/functions/core_github.sh @@ -9,7 +9,7 @@ functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" github_api="https://api.github.com" -fn_githublocalversionfile(){ +fn_githublocalversionfile() { local githubreleaseuser="${1}" local githubreleaserepo="${2}" @@ -18,12 +18,12 @@ fn_githublocalversionfile(){ # $1 githubuser/group # $2 github repo name -fn_github_get_latest_release_version(){ +fn_github_get_latest_release_version() { local githubreleaseuser="${1}" local githubreleaserepo="${2}" local githublatestreleaseurl="${github_api}/repos/${githubreleaseuser}/${githubreleaserepo}/releases/latest" - githubreleaseversion=$(curl -s --connect-timeout 10 "${githublatestreleaseurl}" | jq '.tag_name' ) + githubreleaseversion=$(curl -s --connect-timeout 10 "${githublatestreleaseurl}" | jq '.tag_name') # error if no version is there if [ -z "${githubreleaseversion}" ]; then @@ -34,14 +34,14 @@ fn_github_get_latest_release_version(){ # $1 githubuser/group # $2 github repo name -fn_github_set_latest_release_version(){ +fn_github_set_latest_release_version() { local githubreleaseuser="${1}" local githubreleaserepo="${2}" fn_githublocalversionfile "${githubreleaseuser}" "${githubreleaserepo}" local githublatestreleaseurl="${github_api}/repos/${githubreleaseuser}/${githubreleaserepo}/releases/latest" - githubreleaseversion=$(curl -s "${githublatestreleaseurl}" | jq -r '.tag_name' ) + githubreleaseversion=$(curl -s "${githublatestreleaseurl}" | jq -r '.tag_name') # error if no version is there if [ -z "${githubreleaseversion}" ]; then @@ -54,7 +54,7 @@ fn_github_set_latest_release_version(){ # $1 githubuser/group # $2 github repo name -fn_github_get_installed_version(){ +fn_github_get_installed_version() { local githubreleaseuser="${1}" local githubreleaserepo="${2}" @@ -66,7 +66,7 @@ fn_github_get_installed_version(){ # $1 githubuser/group # $2 github repo name # if a update needs to be downloaded - updateneeded is set to 1 -fn_github_compare_version(){ +fn_github_compare_version() { local githubreleaseuser="${1}" local githubreleaserepo="${2}" exitcode=0 @@ -76,7 +76,7 @@ fn_github_compare_version(){ local githublatestreleaseurl="${github_api}/repos/${githubreleaseuser}/${githubreleaserepo}/releases/latest" githublocalversion=$(cat "${githublocalversionfile}") - githubreleaseversion=$(curl -s "${githublatestreleaseurl}" | jq '.tag_name' ) + githubreleaseversion=$(curl -s "${githublatestreleaseurl}" | jq '.tag_name') # error if no version is there if [ -z "${githubreleaseversion}" ]; then @@ -91,7 +91,7 @@ fn_github_compare_version(){ echo -en "\n" else # check if version that is installed is higher than the remote version to not override it - last_version=$(echo -e "${githublocalversion}\n${githubreleaseversion}" | sort -V | head -n1 ) + last_version=$(echo -e "${githublocalversion}\n${githubreleaseversion}" | sort -V | head -n1) if [ "${githubreleaseversion}" == "${last_version}" ]; then echo -en "\n" echo -e "Update from github.com/${githubreleaseuser}/${githubreleaserepo}/ available:" diff --git a/lgsm/functions/core_legacy.sh b/lgsm/functions/core_legacy.sh index 811acfbba..f9aa51455 100755 --- a/lgsm/functions/core_legacy.sh +++ b/lgsm/functions/core_legacy.sh @@ -8,7 +8,7 @@ functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" # This is to help the transition to v20.3.0 and above -legacy_versions_array=( v20.2.1 v20.2.0 v20.1.5 v20.1.4 v20.1.3 v20.1.2 v20.1.1 v20.1.0 v19.12.5 v19.12.4 v19.12.3 v19.12.2 v19.12.1 v19.12.0 ) +legacy_versions_array=(v20.2.1 v20.2.0 v20.1.5 v20.1.4 v20.1.3 v20.1.2 v20.1.1 v20.1.0 v19.12.5 v19.12.4 v19.12.3 v19.12.2 v19.12.1 v19.12.0) for legacy_version in "${legacy_versions_array[@]}"; do if [ "${version}" == "${legacy_version}" ]; then legacymode=1 @@ -78,7 +78,7 @@ if [ -z "${wsstartmap}" ]; then fi fi -fn_parms(){ +fn_parms() { fn_reload_startparameters parms="${startparameters}" } diff --git a/lgsm/functions/core_logs.sh b/lgsm/functions/core_logs.sh index b999cb347..1f0e27540 100755 --- a/lgsm/functions/core_logs.sh +++ b/lgsm/functions/core_logs.sh @@ -16,7 +16,7 @@ fi # For games not displaying a console, and having logs into their game directory. check_status.sh -if [ "${status}" != "0" ]&&[ "${commandname}" == "START" ]&&[ -n "${gamelogfile}" ]; then +if [ "${status}" != "0" ] && [ "${commandname}" == "START" ] && [ -n "${gamelogfile}" ]; then if [ "$(find "${systemdir}" -name "gamelog*.log")" ]; then fn_print_info "Moving game logs to ${gamelogdir}" fn_script_log_info "Moving game logs to ${gamelogdir}" @@ -38,7 +38,14 @@ if [ "$(find "${lgsmlogdir}"/ -type f -mtime +"${logdays}" | wc -l)" -ne "0" ]; darkrplogdir="${systemdir}/data/darkrp_logs" legacyserverlogdir="${logdir}/server" # Setting up counting variables - scriptcount="0" ; consolecount="0" ; gamecount="0" ; srcdscount="0" ; smcount="0" ; ulxcount="0" ; darkrpcount="0" ; legacycount="0" + scriptcount="0" + consolecount="0" + gamecount="0" + srcdscount="0" + smcount="0" + ulxcount="0" + darkrpcount="0" + legacycount="0" fn_sleep_time fn_print_info "Removing logs older than ${logdays} days" fn_script_log_info "Removing logs older than ${logdays} days" @@ -48,7 +55,7 @@ if [ "$(find "${lgsmlogdir}"/ -type f -mtime +"${logdays}" | wc -l)" -ne "0" ]; scriptcount=$(find "${lgsmlogdir}"/ -type f -mtime +"${logdays}" | wc -l) find "${lgsmlogdir}"/ -mtime +"${logdays}" -type f -exec rm -f {} \; # SRCDS and unreal logfiles. - if [ "${engine}" == "unreal2" ]||[ "${engine}" == "source" ]; then + if [ "${engine}" == "unreal2" ] || [ "${engine}" == "source" ]; then find "${gamelogdir}"/ -type f -mtime +"${logdays}" | tee >> "${lgsmlog}" gamecount=$(find "${gamelogdir}"/ -type f -mtime +"${logdays}" | wc -l) find "${gamelogdir}"/ -mtime +"${logdays}" -type f -exec rm -f {} \; diff --git a/lgsm/functions/core_messages.sh b/lgsm/functions/core_messages.sh index 463f833c2..5362dd3d3 100755 --- a/lgsm/functions/core_messages.sh +++ b/lgsm/functions/core_messages.sh @@ -9,7 +9,7 @@ functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" # nl: new line: message is following by a new line. # eol: end of line: message is placed at the end of the current line. -fn_ansi_loader(){ +fn_ansi_loader() { if [ "${ansi}" != "off" ]; then # echo colors default="\e[0m" @@ -34,8 +34,8 @@ fn_ansi_loader(){ creeol="\r\033[K" } -fn_sleep_time(){ - if [ "${sleeptime}" != "0" ]||[ "${travistest}" != "1" ]; then +fn_sleep_time() { + if [ "${sleeptime}" != "0" ] || [ "${travistest}" != "1" ]; then if [ -z "${sleeptime}" ]; then sleeptime=0.5 fi @@ -46,7 +46,7 @@ fn_sleep_time(){ # Log display ######################## ## Feb 28 14:56:58 ut99-server: Monitor: -fn_script_log(){ +fn_script_log() { if [ -d "${lgsmlogdir}" ]; then if [ -n "${commandname}" ]; then echo -e "$(date '+%b %d %H:%M:%S.%3N') ${selfname}: ${commandname}: ${1}" >> "${lgsmlog}" @@ -57,7 +57,7 @@ fn_script_log(){ } ## Feb 28 14:56:58 ut99-server: Monitor: PASS: -fn_script_log_pass(){ +fn_script_log_pass() { if [ -d "${lgsmlogdir}" ]; then if [ -n "${commandname}" ]; then @@ -70,7 +70,7 @@ fn_script_log_pass(){ } ## Feb 28 14:56:58 ut99-server: Monitor: FATAL: -fn_script_log_fatal(){ +fn_script_log_fatal() { if [ -d "${lgsmlogdir}" ]; then if [ -n "${commandname}" ]; then echo -e "$(date '+%b %d %H:%M:%S.%3N') ${selfname}: ${commandname}: FATAL: ${1}" >> "${lgsmlog}" @@ -82,7 +82,7 @@ fn_script_log_fatal(){ } ## Feb 28 14:56:58 ut99-server: Monitor: ERROR: -fn_script_log_error(){ +fn_script_log_error() { if [ -d "${lgsmlogdir}" ]; then if [ -n "${commandname}" ]; then echo -e "$(date '+%b %d %H:%M:%S.%3N') ${selfname}: ${commandname}: ERROR: ${1}" >> "${lgsmlog}" @@ -94,7 +94,7 @@ fn_script_log_error(){ } ## Feb 28 14:56:58 ut99-server: Monitor: WARN: -fn_script_log_warn(){ +fn_script_log_warn() { if [ -d "${lgsmlogdir}" ]; then if [ -n "${commandname}" ]; then echo -e "$(date '+%b %d %H:%M:%S.%3N') ${selfname}: ${commandname}: WARN: ${1}" >> "${lgsmlog}" @@ -106,7 +106,7 @@ fn_script_log_warn(){ } ## Feb 28 14:56:58 ut99-server: Monitor: INFO: -fn_script_log_info(){ +fn_script_log_info() { if [ -d "${lgsmlogdir}" ]; then if [ -n "${commandname}" ]; then echo -e "$(date '+%b %d %H:%M:%S.%3N') ${selfname}: ${commandname}: INFO: ${1}" >> "${lgsmlog}" @@ -117,7 +117,7 @@ fn_script_log_info(){ } ## Feb 28 14:56:58 ut99-server: Monitor: UPDATE: -fn_script_log_update(){ +fn_script_log_update() { if [ -d "${lgsmlogdir}" ]; then if [ -n "${commandname}" ]; then echo -e "$(date '+%b %d %H:%M:%S.%3N') ${selfname}: ${commandname}: UPDATE: ${1}" >> "${lgsmlog}" @@ -131,7 +131,7 @@ fn_script_log_update(){ ################################## # [ .... ] -fn_print_dots(){ +fn_print_dots() { if [ "${commandaction}" ]; then echo -en "${creeol}[ .... ] ${commandaction} ${selfname}: $*" else @@ -140,7 +140,7 @@ fn_print_dots(){ fn_sleep_time } -fn_print_dots_nl(){ +fn_print_dots_nl() { if [ "${commandaction}" ]; then echo -e "${creeol}[ .... ] ${commandaction} ${selfname}: $*" else @@ -151,7 +151,7 @@ fn_print_dots_nl(){ } # [ OK ] -fn_print_ok(){ +fn_print_ok() { if [ "${commandaction}" ]; then echo -en "${creeol}[${green} OK ${default}] ${commandaction} ${selfname}: $*" else @@ -160,7 +160,7 @@ fn_print_ok(){ fn_sleep_time } -fn_print_ok_nl(){ +fn_print_ok_nl() { if [ "${commandaction}" ]; then echo -en "${creeol}[${green} OK ${default}] ${commandaction} ${selfname}: $*" else @@ -171,7 +171,7 @@ fn_print_ok_nl(){ } # [ FAIL ] -fn_print_fail(){ +fn_print_fail() { if [ "${commandaction}" ]; then echo -en "${creeol}[${red} FAIL ${default}] ${commandaction} ${selfname}: $*" else @@ -180,7 +180,7 @@ fn_print_fail(){ fn_sleep_time } -fn_print_fail_nl(){ +fn_print_fail_nl() { if [ "${commandaction}" ]; then echo -en "${creeol}[${red} FAIL ${default}] ${commandaction} ${selfname}: $*" else @@ -191,7 +191,7 @@ fn_print_fail_nl(){ } # [ ERROR ] -fn_print_error(){ +fn_print_error() { if [ "${commandaction}" ]; then echo -en "${creeol}[${red} ERROR ${default}] ${commandaction} ${selfname}: $*" else @@ -200,7 +200,7 @@ fn_print_error(){ fn_sleep_time } -fn_print_error_nl(){ +fn_print_error_nl() { if [ "${commandaction}" ]; then echo -en "${creeol}[${red} ERROR ${default}] ${commandaction} ${selfname}: $*" else @@ -211,7 +211,7 @@ fn_print_error_nl(){ } # [ WARN ] -fn_print_warn(){ +fn_print_warn() { if [ "${commandaction}" ]; then echo -en "${creeol}[${lightyellow} WARN ${default}] ${commandaction} ${selfname}: $*" else @@ -220,7 +220,7 @@ fn_print_warn(){ fn_sleep_time } -fn_print_warn_nl(){ +fn_print_warn_nl() { if [ "${commandaction}" ]; then echo -en "${creeol}[${lightyellow} WARN ${default}] ${commandaction} ${selfname}: $*" else @@ -231,7 +231,7 @@ fn_print_warn_nl(){ } # [ INFO ] -fn_print_info(){ +fn_print_info() { if [ "${commandaction}" ]; then echo -en "${creeol}[${cyan} INFO ${default}] ${commandaction} ${selfname}: $*" else @@ -240,7 +240,7 @@ fn_print_info(){ fn_sleep_time } -fn_print_info_nl(){ +fn_print_info_nl() { if [ "${commandaction}" ]; then echo -en "${creeol}[${cyan} INFO ${default}] ${commandaction} ${selfname}: $*" else @@ -251,7 +251,7 @@ fn_print_info_nl(){ } # [ START ] -fn_print_start(){ +fn_print_start() { if [ "${commandaction}" ]; then echo -en "${creeol}[${lightgreen} START ${default}] ${commandaction} ${selfname}: $*" else @@ -260,7 +260,7 @@ fn_print_start(){ fn_sleep_time } -fn_print_start_nl(){ +fn_print_start_nl() { if [ "${commandaction}" ]; then echo -en "${creeol}[${lightgreen} START ${default}] ${commandaction} ${selfname}: $*" else @@ -275,69 +275,69 @@ fn_print_start_nl(){ # No More Room in Hell Debug # ================================= -fn_print_header(){ +fn_print_header() { echo -e "" echo -e "${lightyellow}${gamename} ${commandaction}${default}" echo -e "=================================${default}" } # Complete! -fn_print_complete(){ +fn_print_complete() { echo -en "${green}Complete!${default} $*" fn_sleep_time } -fn_print_complete_nl(){ +fn_print_complete_nl() { echo -e "${green}Complete!${default} $*" fn_sleep_time } # Failure! -fn_print_failure(){ +fn_print_failure() { echo -en "${red}Failure!${default} $*" fn_sleep_time } -fn_print_failure_nl(){ +fn_print_failure_nl() { echo -e "${red}Failure!${default} $*" fn_sleep_time } # Error! -fn_print_error2(){ +fn_print_error2() { echo -en "${red}Error!${default} $*" fn_sleep_time } -fn_print_error2_nl(){ +fn_print_error2_nl() { echo -e "${red}Error!${default} $*" fn_sleep_time } # Warning! -fn_print_warning(){ +fn_print_warning() { echo -en "${lightyellow}Warning!${default} $*" fn_sleep_time } -fn_print_warning_nl(){ +fn_print_warning_nl() { echo -e "${lightyellow}Warning!${default} $*" fn_sleep_time } # Information! -fn_print_information(){ +fn_print_information() { echo -en "${cyan}Information!${default} $*" fn_sleep_time } -fn_print_information_nl(){ +fn_print_information_nl() { echo -e "${cyan}Information!${default} $*" fn_sleep_time } # Y/N Prompt -fn_prompt_yn(){ +fn_prompt_yn() { local prompt="$1" local initial="$2" @@ -350,23 +350,23 @@ fn_prompt_yn(){ fi while true; do - read -e -i "${initial}" -p "${prompt}" -r yn + read -e -i "${initial}" -p "${prompt}" -r yn case "${yn}" in - [Yy]|[Yy][Ee][Ss]) return 0 ;; - [Nn]|[Nn][Oo]) return 1 ;; - *) echo -e "Please answer yes or no." ;; + [Yy] | [Yy][Ee][Ss]) return 0 ;; + [Nn] | [Nn][Oo]) return 1 ;; + *) echo -e "Please answer yes or no." ;; esac done } # Prompt for message -fn_prompt_message(){ +fn_prompt_message() { while true; do unset prompt local prompt="$1" - read -e -p "${prompt}" -r answer + read -e -p "${prompt}" -r answer if fn_prompt_yn "Continue" Y; then - break; + break fi done echo "${answer}" @@ -376,160 +376,160 @@ fn_prompt_message(){ ################################## # YES -fn_print_yes_eol(){ +fn_print_yes_eol() { echo -en "${cyan}YES${default}" fn_sleep_time } -fn_print_yes_eol_nl(){ +fn_print_yes_eol_nl() { echo -e "${cyan}YES${default}" fn_sleep_time } # NO -fn_print_no_eol(){ +fn_print_no_eol() { echo -en "${red}NO${default}" fn_sleep_time } -fn_print_no_eol_nl(){ +fn_print_no_eol_nl() { echo -e "${red}NO${default}" fn_sleep_time } # OK -fn_print_ok_eol(){ +fn_print_ok_eol() { echo -en "${green}OK${default}" fn_sleep_time } -fn_print_ok_eol_nl(){ +fn_print_ok_eol_nl() { echo -e "${green}OK${default}" fn_sleep_time } # FAIL -fn_print_fail_eol(){ +fn_print_fail_eol() { echo -en "${red}FAIL${default}" fn_sleep_time } -fn_print_fail_eol_nl(){ +fn_print_fail_eol_nl() { echo -e "${red}FAIL${default}" fn_sleep_time } # ERROR -fn_print_error_eol(){ +fn_print_error_eol() { echo -en "${red}ERROR${default}" fn_sleep_time } -fn_print_error_eol_nl(){ +fn_print_error_eol_nl() { echo -e "${red}ERROR${default}" fn_sleep_time } # WAIT -fn_print_wait_eol(){ +fn_print_wait_eol() { echo -en "${cyan}WAIT${default}" fn_sleep_time } -fn_print_wait_eol_nl(){ +fn_print_wait_eol_nl() { echo -e "${cyan}WAIT${default}" fn_sleep_time } # WARN -fn_print_warn_eol(){ +fn_print_warn_eol() { echo -en "${lightyellow}WARN${default}" fn_sleep_time } -fn_print_warn_eol_nl(){ +fn_print_warn_eol_nl() { echo -e "${lightyellow}WARN${default}" fn_sleep_time } # INFO -fn_print_info_eol(){ +fn_print_info_eol() { echo -en "${cyan}INFO${default}" fn_sleep_time } -fn_print_info_eol_nl(){ +fn_print_info_eol_nl() { echo -e "${cyan}INFO${default}" fn_sleep_time } # QUERYING -fn_print_querying_eol(){ +fn_print_querying_eol() { echo -en "${cyan}QUERYING${default}" fn_sleep_time } -fn_print_querying_eol_nl(){ +fn_print_querying_eol_nl() { echo -e "${cyan}QUERYING${default}" fn_sleep_time } # CHECKING -fn_print_checking_eol(){ +fn_print_checking_eol() { echo -en "${cyan}CHECKING${default}" fn_sleep_time } -fn_print_checking_eol_nl(){ +fn_print_checking_eol_nl() { echo -e "${cyan}CHECKING${default}" fn_sleep_time } # DELAY -fn_print_delay_eol(){ +fn_print_delay_eol() { echo -en "${green}DELAY${default}" fn_sleep_time } -fn_print_delay_eol_nl(){ +fn_print_delay_eol_nl() { echo -e "${green}DELAY${default}" fn_sleep_time } # CANCELED -fn_print_canceled_eol(){ +fn_print_canceled_eol() { echo -en "${lightyellow}CANCELED${default}" fn_sleep_time } -fn_print_canceled_eol_nl(){ +fn_print_canceled_eol_nl() { echo -e "${lightyellow}CANCELED${default}" fn_sleep_time } # REMOVED -fn_print_removed_eol(){ +fn_print_removed_eol() { echo -en "${red}REMOVED${default}" fn_sleep_time } -fn_print_removed_eol_nl(){ +fn_print_removed_eol_nl() { echo -e "${red}REMOVED${default}" fn_sleep_time } # UPDATE -fn_print_update_eol(){ +fn_print_update_eol() { echo -en "${cyan}UPDATE${default}" fn_sleep_time } -fn_print_update_eol_nl(){ +fn_print_update_eol_nl() { echo -e "${cyan}UPDATE${default}" fn_sleep_time } -fn_print_ascii_logo(){ +fn_print_ascii_logo() { echo -e "" echo -e " mdMMMMbm" echo -e " mMMMMMMMMMMm" @@ -565,7 +565,7 @@ fn_print_ascii_logo(){ echo -e "" } -fn_print_restart_warning(){ +fn_print_restart_warning() { fn_print_warn "${selfname} will be restarted" fn_script_log_warn "${selfname} will be restarted" totalseconds=3 @@ -584,7 +584,7 @@ fn_print_restart_warning(){ # Useful when a command has to call upon another command causing the other command to overrite commandname variables # Used to remember the command that ran first. -fn_firstcommand_set(){ +fn_firstcommand_set() { if [ -z "${firstcommandname}" ]; then firstcommandname="${commandname}" firstcommandaction="${commandaction}" @@ -592,7 +592,7 @@ fn_firstcommand_set(){ } # Used to reset commandname variables to the command the script ran first. -fn_firstcommand_reset(){ +fn_firstcommand_reset() { commandname="${firstcommandname}" commandaction="${firstcommandaction}" } diff --git a/lgsm/functions/core_steamcmd.sh b/lgsm/functions/core_steamcmd.sh index 5fbd5db9f..92c14136a 100755 --- a/lgsm/functions/core_steamcmd.sh +++ b/lgsm/functions/core_steamcmd.sh @@ -7,8 +7,8 @@ functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" -fn_install_steamcmd(){ - if [ "${shortname}" == "ark" ]&&[ "${installsteamcmd}" == "1" ]; then +fn_install_steamcmd() { + if [ "${shortname}" == "ark" ] && [ "${installsteamcmd}" == "1" ]; then steamcmddir="${serverfiles}/Engine/Binaries/ThirdParty/SteamCMD/Linux" fi if [ ! -d "${steamcmddir}" ]; then @@ -19,7 +19,7 @@ fn_install_steamcmd(){ chmod +x "${steamcmddir}/steamcmd.sh" } -fn_check_steamcmd_user(){ +fn_check_steamcmd_user() { # Checks if steamuser is setup. if [ "${steamuser}" == "username" ]; then fn_print_fail_nl "Steam login not set. Update steamuser in ${configdirserver}" @@ -39,10 +39,10 @@ fn_check_steamcmd_user(){ fi } -fn_check_steamcmd(){ +fn_check_steamcmd() { # Checks if SteamCMD exists when starting or updating a server. # Only install if steamcmd package is missing or steamcmd dir is missing. - if [ ! -f "${steamcmddir}/steamcmd.sh" ]&&[ -z "$(command -v steamcmd 2>/dev/null)" ]; then + if [ ! -f "${steamcmddir}/steamcmd.sh" ] && [ -z "$(command -v steamcmd 2> /dev/null)" ]; then if [ "${commandname}" == "INSTALL" ]; then fn_install_steamcmd else @@ -56,7 +56,7 @@ fn_check_steamcmd(){ fi } -fn_check_steamcmd_dir(){ +fn_check_steamcmd_dir() { # Worksround that pre-installs the correct steam directories to ensure all packages use the correct Standard. # https://github.com/ValveSoftware/steam-for-linux/issues/6976#issuecomment-610446347 @@ -86,25 +86,25 @@ fn_check_steamcmd_dir(){ fi } -fn_check_steamcmd_dir_legacy(){ +fn_check_steamcmd_dir_legacy() { # Remove old Steam installation directories ~/Steam and ${rootdir}/steamcmd - if [ -d "${rootdir}/steamcmd" ]&&[ "${steamcmddir}" == "${XDG_DATA_HOME:="${HOME}/.local/share"}/Steam" ]; then + if [ -d "${rootdir}/steamcmd" ] && [ "${steamcmddir}" == "${XDG_DATA_HOME:="${HOME}/.local/share"}/Steam" ]; then rm -rf "${rootdir:?}/steamcmd" fi - if [ -d "${HOME}/Steam" ]&&[ "${steamcmddir}" == "${XDG_DATA_HOME:="${HOME}/.local/share"}/Steam" ]; then + if [ -d "${HOME}/Steam" ] && [ "${steamcmddir}" == "${XDG_DATA_HOME:="${HOME}/.local/share"}/Steam" ]; then rm -rf "${HOME}/Steam" fi } -fn_check_steamcmd_steamapp(){ +fn_check_steamcmd_steamapp() { # Check that steamapp directory fixes issue #3481 if [ ! -d "${serverfiles}/steamapps" ]; then mkdir -p "${serverfiles}/steamapps" fi } -fn_check_steamcmd_ark(){ +fn_check_steamcmd_ark() { # Checks if SteamCMD exists in # Engine/Binaries/ThirdParty/SteamCMD/Linux # to allow ark mods to work @@ -123,9 +123,9 @@ fn_check_steamcmd_ark(){ fi } -fn_check_steamcmd_clear(){ +fn_check_steamcmd_clear() { # Will remove steamcmd dir if steamcmd package is installed. - if [ "$(command -v steamcmd 2>/dev/null)" ]&&[ -d "${rootdir}/steamcmd" ]; then + if [ "$(command -v steamcmd 2> /dev/null)" ] && [ -d "${rootdir}/steamcmd" ]; then rm -rf "${steamcmddir:?}" exitcode=$? if [ "${exitcode}" != 0 ]; then @@ -136,15 +136,15 @@ fn_check_steamcmd_clear(){ fi } -fn_check_steamcmd_exec(){ - if [ "$(command -v steamcmd 2>/dev/null)" ]; then +fn_check_steamcmd_exec() { + if [ "$(command -v steamcmd 2> /dev/null)" ]; then steamcmdcommand="steamcmd" else steamcmdcommand="./steamcmd.sh" fi } -fn_update_steamcmd_localbuild(){ +fn_update_steamcmd_localbuild() { # Gets local build info. fn_print_dots "Checking local build: ${remotelocation}" fn_appmanifest_check @@ -157,7 +157,7 @@ fn_update_steamcmd_localbuild(){ fi # Checks if localbuild variable has been set. - if [ -z "${localbuild}" ]||[ "${localbuild}" == "null" ]; then + if [ -z "${localbuild}" ] || [ "${localbuild}" == "null" ]; then fn_print_fail "Checking local build: ${remotelocation}" fn_script_log_fatal "Checking local build" core_exit.sh @@ -167,7 +167,7 @@ fn_update_steamcmd_localbuild(){ fi } -fn_update_steamcmd_remotebuild(){ +fn_update_steamcmd_remotebuild() { # Gets remote build info. if [ -d "${steamcmddir}" ]; then cd "${steamcmddir}" || exit @@ -184,7 +184,7 @@ fn_update_steamcmd_remotebuild(){ if [ "${firstcommandname}" != "INSTALL" ]; then fn_print_dots "Checking remote build: ${remotelocation}" # Checks if remotebuild variable has been set. - if [ -z "${remotebuild}" ]||[ "${remotebuild}" == "null" ]; then + if [ -z "${remotebuild}" ] || [ "${remotebuild}" == "null" ]; then fn_print_fail "Checking remote build: ${remotelocation}" fn_script_log_fatal "Checking remote build" core_exit.sh @@ -194,7 +194,7 @@ fn_update_steamcmd_remotebuild(){ fi else # Checks if remotebuild variable has been set. - if [ -z "${remotebuild}" ]||[ "${remotebuild}" == "null" ]; then + if [ -z "${remotebuild}" ] || [ "${remotebuild}" == "null" ]; then fn_print_failure "Unable to get remote build" fn_script_log_fatal "Unable to get remote build" core_exit.sh @@ -202,7 +202,7 @@ fn_update_steamcmd_remotebuild(){ fi } -fn_update_steamcmd_compare(){ +fn_update_steamcmd_compare() { fn_print_dots "Checking for update: ${remotelocation}" if [ "${localbuild}" != "${remotebuild}" ]; then fn_print_ok_nl "Checking for update: ${remotelocation}" @@ -280,12 +280,12 @@ fn_update_steamcmd_compare(){ fi } -fn_appmanifest_info(){ +fn_appmanifest_info() { appmanifestfile=$(find "${serverfiles}" -type f -name "appmanifest_${appid}.acf") appmanifestfilewc=$(find "${serverfiles}" -type f -name "appmanifest_${appid}.acf" | wc -l) } -fn_appmanifest_check(){ +fn_appmanifest_check() { fn_appmanifest_info # Multiple or no matching appmanifest files may sometimes be present. # This error is corrected if required. diff --git a/lgsm/functions/core_trap.sh b/lgsm/functions/core_trap.sh index a3eaf5675..ae2b79470 100755 --- a/lgsm/functions/core_trap.sh +++ b/lgsm/functions/core_trap.sh @@ -7,7 +7,7 @@ functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" -fn_exit_trap(){ +fn_exit_trap() { if [ -z "${exitcode}" ]; then exitcode=$? fi diff --git a/lgsm/functions/fix.sh b/lgsm/functions/fix.sh index f9f61162f..2d9af576e 100755 --- a/lgsm/functions/fix.sh +++ b/lgsm/functions/fix.sh @@ -9,19 +9,19 @@ functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" # Messages that are displayed for some fixes. -fn_fix_msg_start(){ +fn_fix_msg_start() { fn_print_dots "Applying ${fixname} fix: ${gamename}" fn_print_info "Applying ${fixname} fix: ${gamename}" fn_script_log_info "Applying ${fixname} fix: ${gamename}" } -fn_fix_msg_start_nl(){ +fn_fix_msg_start_nl() { fn_print_dots "Applying ${fixname} fix: ${gamename}" fn_print_info "Applying ${fixname} fix: ${gamename}" fn_script_log_info "Applying ${fixname} fix: ${gamename}" } -fn_fix_msg_end(){ +fn_fix_msg_end() { if [ $? != 0 ]; then fn_print_error_nl "Applying ${fixname} fix: ${gamename}" fn_script_log_error "Applying ${fixname} fix: ${gamename}" @@ -32,12 +32,12 @@ fn_fix_msg_end(){ } # Fixes that are run on start. -if [ "${commandname}" != "INSTALL" ]&&[ -z "${fixbypass}" ]; then +if [ "${commandname}" != "INSTALL" ] && [ -z "${fixbypass}" ]; then if [ "${appid}" ]; then fix_steamcmd.sh fi - if [ "${shortname}" == "arma3" ]; then + if [ "${shortname}" == "arma3" ]; then fix_arma3.sh elif [ "${shortname}" == "armar" ]; then fix_armar.sh @@ -96,32 +96,32 @@ fi # Fixes that are run on install only. if [ "${commandname}" == "INSTALL" ]; then - if [ "${shortname}" == "av" ]||[ "${shortname}" == "cmw" ]||[ "${shortname}" == "kf" ]||[ "${shortname}" == "kf2" ]||[ "${shortname}" == "lo" ]||[ "${shortname}" == "onset" ]||[ "${shortname}" == "ro" ]||[ "${shortname}" == "samp" ]||[ "${shortname}" == "ut2k4" ]||[ "${shortname}" == "ut" ]||[ "${shortname}" == "ut3" ]; then - echo -e "" - echo -e "${lightyellow}Applying Post-Install Fixes${default}" - echo -e "=================================" - fn_sleep_time - postinstall=1 - if [ "${shortname}" == "av" ]; then - fix_av.sh - elif [ "${shortname}" == "kf" ]; then - fix_kf.sh - elif [ "${shortname}" == "kf2" ]; then - fix_kf2.sh - elif [ "${shortname}" == "lo" ]; then - fix_lo.sh - elif [ "${shortname}" == "ro" ]; then - fix_ro.sh - elif [ "${shortname}" == "samp" ]; then - fix_samp.sh - elif [ "${shortname}" == "ut2k4" ]; then - fix_ut2k4.sh - elif [ "${shortname}" == "ut" ]; then - fix_ut.sh - elif [ "${shortname}" == "ut3" ]; then - fix_ut3.sh - else - fn_print_information_nl "No fixes required." - fi + if [ "${shortname}" == "av" ] || [ "${shortname}" == "cmw" ] || [ "${shortname}" == "kf" ] || [ "${shortname}" == "kf2" ] || [ "${shortname}" == "lo" ] || [ "${shortname}" == "onset" ] || [ "${shortname}" == "ro" ] || [ "${shortname}" == "samp" ] || [ "${shortname}" == "ut2k4" ] || [ "${shortname}" == "ut" ] || [ "${shortname}" == "ut3" ]; then + echo -e "" + echo -e "${lightyellow}Applying Post-Install Fixes${default}" + echo -e "=================================" + fn_sleep_time + postinstall=1 + if [ "${shortname}" == "av" ]; then + fix_av.sh + elif [ "${shortname}" == "kf" ]; then + fix_kf.sh + elif [ "${shortname}" == "kf2" ]; then + fix_kf2.sh + elif [ "${shortname}" == "lo" ]; then + fix_lo.sh + elif [ "${shortname}" == "ro" ]; then + fix_ro.sh + elif [ "${shortname}" == "samp" ]; then + fix_samp.sh + elif [ "${shortname}" == "ut2k4" ]; then + fix_ut2k4.sh + elif [ "${shortname}" == "ut" ]; then + fix_ut.sh + elif [ "${shortname}" == "ut3" ]; then + fix_ut3.sh + else + fn_print_information_nl "No fixes required." fi + fi fi diff --git a/lgsm/functions/fix_ark.sh b/lgsm/functions/fix_ark.sh index da0097cab..f8e0447e3 100755 --- a/lgsm/functions/fix_ark.sh +++ b/lgsm/functions/fix_ark.sh @@ -19,7 +19,11 @@ elif [ "${steamappsfilewc}" -eq "1" ]; then # This allows LinxuGSM to select either ~/.steam or ~/Steam. depending on what is being used steamappsfile=$(find "${HOME}" -name appworkshop_346110.acf) steamappsdir=$(dirname "${steamappsfile}") - steamappspath=$(cd "${steamappsdir}" || return; cd ../;pwd) + steamappspath=$( + cd "${steamappsdir}" || return + cd ../ + pwd + ) # removes the symlink if exists. # fixes issue with older versions of LinuxGSM linking to /home/arkserver/steamcmd @@ -41,7 +45,7 @@ elif [ "${steamappsfilewc}" -eq "1" ]; then fi # if the steamapps symlink is incorrect unlink it. - if [ -d "${serverfiles}/Engine/Binaries/ThirdParty/SteamCMD/Linux" ]&&[ -L "${serverfiles}/Engine/Binaries/ThirdParty/SteamCMD/Linux/steamapps" ]&&[ "$(readlink "${serverfiles}/Engine/Binaries/ThirdParty/SteamCMD/Linux/steamapps")" != "${steamappspath}" ]; then + if [ -d "${serverfiles}/Engine/Binaries/ThirdParty/SteamCMD/Linux" ] && [ -L "${serverfiles}/Engine/Binaries/ThirdParty/SteamCMD/Linux/steamapps" ] && [ "$(readlink "${serverfiles}/Engine/Binaries/ThirdParty/SteamCMD/Linux/steamapps")" != "${steamappspath}" ]; then fixname="incorrect steamapps symlink" fn_fix_msg_start unlink "${serverfiles:?}/Engine/Binaries/ThirdParty/SteamCMD/Linux/steamapps" diff --git a/lgsm/functions/fix_arma3.sh b/lgsm/functions/fix_arma3.sh index bdd85af71..bbf14c9d2 100755 --- a/lgsm/functions/fix_arma3.sh +++ b/lgsm/functions/fix_arma3.sh @@ -8,7 +8,7 @@ functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" # Fixes: 20150 Segmentation fault (core dumped) error. -if [ ! -d "${XDG_DATA_HOME:="${HOME}/.local/share"}/Arma 3" ]||[ ! -d "${XDG_DATA_HOME:="${HOME}/.local/share"}/Arma 3 - Other Profiles" ]; then +if [ ! -d "${XDG_DATA_HOME:="${HOME}/.local/share"}/Arma 3" ] || [ ! -d "${XDG_DATA_HOME:="${HOME}/.local/share"}/Arma 3 - Other Profiles" ]; then fixname="20150 Segmentation fault (core dumped)" fn_fix_msg_start mkdir -p "${XDG_DATA_HOME:="${HOME}/.local/share"}/Arma 3 - Other Profiles" diff --git a/lgsm/functions/fix_dst.sh b/lgsm/functions/fix_dst.sh index 49fce22e3..e30507dc9 100755 --- a/lgsm/functions/fix_dst.sh +++ b/lgsm/functions/fix_dst.sh @@ -9,7 +9,7 @@ functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" # Fixes: ./dontstarve_dedicated_server_nullrenderer: ./lib32/libcurl-gnutls.so.4: no version information available (required by ./dontstarve_dedicated_server_nullrenderer). # Issue only occures on CentOS as libcurl-gnutls.so.4 is called libcurl.so.4 on CentOS. -if [ -f "/etc/redhat-release" ]&&[ ! -f "${serverfiles}/bin/lib32/libcurl-gnutls.so.4" ]; then +if [ -f "/etc/redhat-release" ] && [ ! -f "${serverfiles}/bin/lib32/libcurl-gnutls.so.4" ]; then fixname="libcurl-gnutls.so.4" fn_fix_msg_start ln -s "/usr/lib/libcurl.so.4" "${serverfiles}/bin/lib32/libcurl-gnutls.so.4" diff --git a/lgsm/functions/fix_lo.sh b/lgsm/functions/fix_lo.sh index 466d6abd0..b868a55b4 100644 --- a/lgsm/functions/fix_lo.sh +++ b/lgsm/functions/fix_lo.sh @@ -8,10 +8,10 @@ functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" local APPID_FILE=${executabledir}/steam_appid.txt if [ ! -f "${APPID_FILE}" ]; then - fn_print_information "adding ${APPID_FILE} to ${gamename} server." - fn_sleep_time - echo "903950" > "${APPID_FILE}" + fn_print_information "adding ${APPID_FILE} to ${gamename} server." + fn_sleep_time + echo "903950" > "${APPID_FILE}" else - fn_print_information "${APPID_FILE} already exists. No action to be taken." - fn_sleep_time + fn_print_information "${APPID_FILE} already exists. No action to be taken." + fn_sleep_time fi diff --git a/lgsm/functions/fix_onset.sh b/lgsm/functions/fix_onset.sh index c444c1ae9..e4183999d 100755 --- a/lgsm/functions/fix_onset.sh +++ b/lgsm/functions/fix_onset.sh @@ -11,7 +11,7 @@ export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${serverfiles}" # Fixes: Failed loading "mariadb": libmariadbclient.so.18: cannot open shared object file: No such file or directory # Issue only occures on CentOS as libmariadbclient.so.18 is called libmariadb.so.3 on CentOS. -if [ -f "/etc/redhat-release" ]&&[ ! -f "${serverfiles}/libmariadbclient.so.18" ]&&[ -f "/usr/lib64/libmariadb.so.3" ]; then +if [ -f "/etc/redhat-release" ] && [ ! -f "${serverfiles}/libmariadbclient.so.18" ] && [ -f "/usr/lib64/libmariadb.so.3" ]; then fixname="libmariadbclient.so.18" fn_fix_msg_start ln -s "/usr/lib64/libmariadb.so.3" "${serverfiles}/libmariadbclient.so.18" diff --git a/lgsm/functions/fix_samp.sh b/lgsm/functions/fix_samp.sh index 7a62bd4d1..a88bf154f 100644 --- a/lgsm/functions/fix_samp.sh +++ b/lgsm/functions/fix_samp.sh @@ -9,14 +9,14 @@ functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" if [ -f "${servercfgfullpath}" ]; then # check if default password is set "changeme" - currentpass=$(grep -E "^rcon_password" "${servercfgfullpath}" | sed 's/^rcon_password //' ) + currentpass=$(grep -E "^rcon_password" "${servercfgfullpath}" | sed 's/^rcon_password //') defaultpass="changeme" # check if default password is set if [ "${currentpass}" == "${defaultpass}" ]; then fixname="change default rcon password" fn_fix_msg_start fn_script_log_info "changing rcon/admin password." - random=$(tr -dc A-Za-z0-9_ < /dev/urandom | head -c 8 | xargs) + random=$(tr -dc A-Za-z0-9_ < /dev/urandom | head -c 8 | xargs) rconpass="admin${random}" sed -i "s/rcon_password changeme/rcon_password ${rconpass}/g" "${servercfgfullpath}" fn_fix_msg_end diff --git a/lgsm/functions/fix_squad.sh b/lgsm/functions/fix_squad.sh index b1ba1fde2..7d5929b5d 100644 --- a/lgsm/functions/fix_squad.sh +++ b/lgsm/functions/fix_squad.sh @@ -9,7 +9,7 @@ functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" # As the server base dir changed for the game, we need to migrate the default config from the old to the new location oldservercfg="${serverfiles}/Squad/ServerConfig/${servercfg}" -if [ -f "${oldservercfg}" ]&&[ -f "${servercfgfullpath}" ]; then +if [ -f "${oldservercfg}" ] && [ -f "${servercfgfullpath}" ]; then # diff old and new config - if it is different move the old config over the new one if [ "$(diff -c "${oldservercfg}" "${servercfgfullpath}" | wc -l)" -gt 0 ]; then fixname="Migrate server config to new Game folder" diff --git a/lgsm/functions/fix_steamcmd.sh b/lgsm/functions/fix_steamcmd.sh index abac31cfb..0162a6495 100755 --- a/lgsm/functions/fix_steamcmd.sh +++ b/lgsm/functions/fix_steamcmd.sh @@ -10,7 +10,7 @@ functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" # function to simplify the steamclient.so fix # example # fn_fix_steamclient_so 32|64 (bit) "${serverfiles}/linux32/" -fn_fix_steamclient_so(){ +fn_fix_steamclient_so() { # $1 type of fix 32 or 64 as possible values # $2 as destination where the lib will be copied to if [ "$1" == "32" ]; then @@ -132,7 +132,7 @@ elif [ "${shortname}" == "pvr" ]; then fn_fix_steamclient_so "64" "${executabledir}" elif [ "${shortname}" == "ss3" ]; then fn_fix_steamclient_so "32" "${serverfiles}/Bin" -elif [ "${shortname}" == "tu" ];then +elif [ "${shortname}" == "tu" ]; then fn_fix_steamclient_so "64" "${executabledir}" elif [ "${shortname}" == "unt" ]; then fn_fix_steamclient_so "64" "${serverfiles}" diff --git a/lgsm/functions/fix_tf2.sh b/lgsm/functions/fix_tf2.sh index 27b35a0d2..77e41a969 100755 --- a/lgsm/functions/fix_tf2.sh +++ b/lgsm/functions/fix_tf2.sh @@ -8,7 +8,7 @@ functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" # Fixes: Team Fortress 2 Segmentation fault for Red-Hat Distros #2062. -if [ -f "/etc/redhat-release" ]&&[ ! -f "${serverfiles}/bin/libcurl-gnutls.so.4" ]; then +if [ -f "/etc/redhat-release" ] && [ ! -f "${serverfiles}/bin/libcurl-gnutls.so.4" ]; then fixname="libcurl-gnutls.so.4" fn_fix_msg_start ln -s "/usr/lib/libcurl.so.4" "${serverfiles}/bin/libcurl-gnutls.so.4" diff --git a/lgsm/functions/fix_ts3.sh b/lgsm/functions/fix_ts3.sh index 021f03764..7c7387cb6 100755 --- a/lgsm/functions/fix_ts3.sh +++ b/lgsm/functions/fix_ts3.sh @@ -17,9 +17,9 @@ fi # Fixes: failed to register local accounting service: No such file or directory. accountingfile="/dev/shm/7gbhujb54g8z9hu43jre8" -if [ -f "${accountingfile}" ]&&[ "${status}" == "0" ]; then +if [ -f "${accountingfile}" ] && [ "${status}" == "0" ]; then # Check permissions for the file if the current user owns it, if not exit. - if [ "$( stat -c %U ${accountingfile})" == "$(whoami)" ]; then + if [ "$(stat -c %U ${accountingfile})" == "$(whoami)" ]; then fixname="Delete file ${accountingfile}" fn_fix_msg_start rm -f "${accountingfile}" diff --git a/lgsm/functions/fix_vh.sh b/lgsm/functions/fix_vh.sh index 7d60916a4..ab0218873 100755 --- a/lgsm/functions/fix_vh.sh +++ b/lgsm/functions/fix_vh.sh @@ -12,10 +12,8 @@ export LD_LIBRARY_PATH=./linux64:$LD_LIBRARY_PATH modsdir="${lgsmdir}/mods" modsinstalledlistfullpath="${modsdir}/installed-mods.txt" if [ -f "${modsinstalledlistfullpath}" ]; then - if grep -qE "^valheimplus" "${modsinstalledlistfullpath}" - then - if ! grep -qE "^executable=\"./start_server_bepinex.sh\"" "${configdirserver}/${selfname}.cfg" - then + if grep -qE "^valheimplus" "${modsinstalledlistfullpath}"; then + if ! grep -qE "^executable=\"./start_server_bepinex.sh\"" "${configdirserver}/${selfname}.cfg"; then echo 'executable="./start_server_bepinex.sh"' >> "${configdirserver}/${selfname}.cfg" executable="./start_server_bepinex.sh" fi diff --git a/lgsm/functions/info_distro.sh b/lgsm/functions/info_distro.sh index f747b0d1b..f29e621d5 100755 --- a/lgsm/functions/info_distro.sh +++ b/lgsm/functions/info_distro.sh @@ -30,9 +30,9 @@ kernel="$(uname -r)" # Distro Codename - xenial # Gathers distro info from various sources filling in missing gaps. -distro_info_array=( os-release lsb_release hostnamectl debian_version redhat-release ) +distro_info_array=(os-release lsb_release hostnamectl debian_version redhat-release) for distro_info in "${distro_info_array[@]}"; do - if [ -f "/etc/os-release" ]&&[ "${distro_info}" == "os-release" ]; then + if [ -f "/etc/os-release" ] && [ "${distro_info}" == "os-release" ]; then distroname="$(grep "PRETTY_NAME" /etc/os-release | awk -F\= '{gsub(/"/,"",$2);print $2}')" distroversion="$(grep "VERSION_ID" /etc/os-release | awk -F\= '{gsub(/"/,"",$2);print $2}')" # Special var for rhel like distros to removed point in number e.g 8.4 to just 8. @@ -40,8 +40,8 @@ for distro_info in "${distro_info_array[@]}"; do distroid="$(grep "ID=" /etc/os-release | grep -v _ID | awk -F\= '{gsub(/"/,"",$2);print $2}')" distroidlike="$(grep "ID_LIKE=" /etc/os-release | grep -v _ID | awk -F\= '{gsub(/"/,"",$2);print $2}')" distrocodename="$(grep "VERSION_CODENAME" /etc/os-release | awk -F\= '{gsub(/"/,"",$2);print $2}')" - elif [ "$(command -v lsb_release 2>/dev/null)" ]&&[ "${distro_info}" == "lsb_release" ]; then - if [ -z "${distroname}" ];then + elif [ "$(command -v lsb_release 2> /dev/null)" ] && [ "${distro_info}" == "lsb_release" ]; then + if [ -z "${distroname}" ]; then distroname="$(lsb_release -sd)" elif [ -z "${distroversion}" ]; then distroversion="$(lsb_release -sr)" @@ -50,11 +50,11 @@ for distro_info in "${distro_info_array[@]}"; do elif [ -z "${distrocodename}" ]; then distrocodename="$(lsb_release -sc)" fi - elif [ "$(command -v hostnamectl 2>/dev/null)" ]&&[ "${distro_info}" == "hostnamectl" ]; then - if [ -z "${distroname}" ];then + elif [ "$(command -v hostnamectl 2> /dev/null)" ] && [ "${distro_info}" == "hostnamectl" ]; then + if [ -z "${distroname}" ]; then distroname="$(hostnamectl | grep "Operating System" | sed 's/Operating System: //g')" fi - elif [ -f "/etc/debian_version" ]&&[ "${distro_info}" == "debian_version" ]; then + elif [ -f "/etc/debian_version" ] && [ "${distro_info}" == "debian_version" ]; then if [ -z "${distroname}" ]; then distroname="Debian $(cat /etc/debian_version)" elif [ -z "${distroversion}" ]; then @@ -62,7 +62,7 @@ for distro_info in "${distro_info_array[@]}"; do elif [ -z "${distroid}" ]; then distroid="debian" fi - elif [ -f "/etc/redhat-release" ]&&[ "${distro_info}" == "redhat-release" ]; then + elif [ -f "/etc/redhat-release" ] && [ "${distro_info}" == "redhat-release" ]; then if [ -z "${distroname}" ]; then distroname="$(cat /etc/redhat-release)" elif [ -z "${distroversion}" ]; then @@ -74,16 +74,16 @@ for distro_info in "${distro_info_array[@]}"; do done # 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}" else distroversioncsv="${distroversion}" fi # Check if distro supported by distro vendor. -if [ "$(command -v distro-info 2>/dev/null)" ]; then +if [ "$(command -v distro-info 2> /dev/null)" ]; then distrosunsupported="$(distro-info --unsupported)" - distrosunsupported_array=( "${distrosunsupported}" ) + distrosunsupported_array=("${distrosunsupported}") for distrounsupported in "${distrosunsupported_array[@]}"; do if [ "${distrounsupported}" == "${distrocodename}" ]; then distrosupport=unsupported @@ -102,7 +102,7 @@ glibcversion="$(ldd --version | sed -n '1s/.* //p')" ## tmux version # e.g: tmux 1.6 -if [ ! "$(command -V tmux 2>/dev/null)" ]; then +if [ ! "$(command -V tmux 2> /dev/null)" ]; then tmuxv="${red}NOT INSTALLED!${default}" tmuxvdigit="0" else @@ -114,25 +114,25 @@ else fi fi -if [ "$(command -V java 2>/dev/null)" ]; then +if [ "$(command -V java 2> /dev/null)" ]; then javaversion="$(java -version 2>&1 | grep "version")" fi -if [ "$(command -v mono 2>/dev/null)" ]; then +if [ "$(command -v mono 2> /dev/null)" ]; then monoversion="$(mono --version 2>&1 | grep -Po '(?<=version )\d')" fi ## Uptime -uptime="$(/dev/null)" ]; then +if [ "$(command -v numfmt 2> /dev/null)" ]; then # Issue #2005 - Kernel 3.14+ contains MemAvailable which should be used. All others will be calculated. # get the raw KB values of these fields. @@ -162,31 +162,34 @@ if [ "$(command -v numfmt 2>/dev/null)" ]; then if grep -q ^MemAvailable /proc/meminfo; then physmemactualfreekb="$(grep ^MemAvailable /proc/meminfo | awk '{print $2}')" else - physmemactualfreekb="$((physmemfreekb+physmembufferskb+physmemcachedkb))" + physmemactualfreekb="$((physmemfreekb + physmembufferskb + physmemcachedkb))" fi # Available RAM and swap. - physmemtotalmb="$((physmemtotalkb/1024))" + physmemtotalmb="$((physmemtotalkb / 1024))" physmemtotal="$(numfmt --to=iec --from=iec --suffix=B "${physmemtotalkb}K")" physmemfree="$(numfmt --to=iec --from=iec --suffix=B "${physmemactualfreekb}K")" - physmemused="$(numfmt --to=iec --from=iec --suffix=B "$((physmemtotalkb-physmemfreekb-physmembufferskb-physmemcachedkb-physmemreclaimablekb))K")" + physmemused="$(numfmt --to=iec --from=iec --suffix=B "$((physmemtotalkb - physmemfreekb - physmembufferskb - physmemcachedkb - physmemreclaimablekb))K")" physmemavailable="$(numfmt --to=iec --from=iec --suffix=B "${physmemactualfreekb}K")" - physmemcached="$(numfmt --to=iec --from=iec --suffix=B "$((physmemcachedkb+physmemreclaimablekb))K")" + physmemcached="$(numfmt --to=iec --from=iec --suffix=B "$((physmemcachedkb + physmemreclaimablekb))K")" swaptotal="$(numfmt --to=iec --from=iec --suffix=B "$(grep ^SwapTotal /proc/meminfo | awk '{print $2}')K")" swapfree="$(numfmt --to=iec --from=iec --suffix=B "$(grep ^SwapFree /proc/meminfo | awk '{print $2}')K")" - swapused="$(numfmt --to=iec --from=iec --suffix=B "$(($(grep ^SwapTotal /proc/meminfo | awk '{print $2}')-$(grep ^SwapFree /proc/meminfo | awk '{print $2}')))K")" + swapused="$(numfmt --to=iec --from=iec --suffix=B "$(($(grep ^SwapTotal /proc/meminfo | awk '{print $2}') - $(grep ^SwapFree /proc/meminfo | awk '{print $2}')))K")" # RAM usage of the game server pid # MB if [ "${gameserverpid}" ]; then - memused="$(ps --forest -o rss -g "${gameserverpid}" | awk '{s+=$1} END {print s}'| awk '{$1/=1024;printf "%.0f",$1}{print $2}')" - # % + memused="$(ps --forest -o rss -g "${gameserverpid}" | awk '{s+=$1} END {print s}' | awk '{$1/=1024;printf "%.0f",$1}{print $2}')" + # % pmemused="$(ps --forest -o %mem -g "${gameserverpid}" | awk '{s+=$1} END {print s}')" fi else # Older distros will need to use free. # Older versions of free do not support -h option. - if [ "$(free -h > /dev/null 2>&1; echo $?)" -ne "0" ]; then + if [ "$( + free -h > /dev/null 2>&1 + echo $? + )" -ne "0" ]; then humanreadable="-m" else humanreadable="-h" @@ -257,7 +260,7 @@ if [ -d "${backupdir}" ]; then # date of most recent backup. lastbackupdate="$(date -r "${lastbackup}")" # no of days since last backup. - lastbackupdaysago="$(( ( $(date +'%s') - $(date -r "${lastbackup}" +'%s') )/60/60/24 ))" + lastbackupdaysago="$((($(date +'%s') - $(date -r "${lastbackup}" +'%s')) / 60 / 60 / 24))" # size of most recent backup. lastbackupsize="$(du -h "${lastbackup}" | awk '{print $1}')" fi @@ -265,11 +268,11 @@ fi # Network Interface name netint=$(${ipcommand} -o addr | grep "${ip}" | awk '{print $2}') -netlink=$(${ethtoolcommand} "${netint}" 2>/dev/null| grep Speed | awk '{print $2}') +netlink=$(${ethtoolcommand} "${netint}" 2> /dev/null | grep Speed | awk '{print $2}') # Sets the SteamCMD glibc requirement if the game server requirement is less or not required. if [ "${appid}" ]; then - if [ "${glibc}" = "null" ]||[ -z "${glibc}" ]||[ "$(printf '%s\n'${glibc}'\n' "2.14" | sort -V | head -n 1)" != "2.14" ]; then + if [ "${glibc}" = "null" ] || [ -z "${glibc}" ] || [ "$(printf '%s\n'${glibc}'\n' "2.14" | sort -V | head -n 1)" != "2.14" ]; then glibc="2.14" fi fi diff --git a/lgsm/functions/info_game.sh b/lgsm/functions/info_game.sh index 88c27b4c9..57d01237d 100644 --- a/lgsm/functions/info_game.sh +++ b/lgsm/functions/info_game.sh @@ -14,7 +14,7 @@ functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" # grep -v "foo" filter out lines that contain foo # cut -f1 -d "/" remove everything after / -fn_info_game_ac(){ +fn_info_game_ac() { # Config if [ ! -f "${servercfgfullpath}" ]; then httpport="${zero}" @@ -26,7 +26,7 @@ fn_info_game_ac(){ httpport=$(grep "HTTP_PORT" "${servercfgfullpath}" | tr -cd '[:digit:]') port=$(grep "TCP_PORT" "${servercfgfullpath}" | tr -cd '[:digit:]') queryport="${httpport}" - servername=$(grep "NAME" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/NAME//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//'| head -n 1) + servername=$(grep "NAME" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/NAME//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//' | head -n 1) adminpassword=$(grep "ADMIN_PASSWORD" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/ADMIN_PASSWORD//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') # Not set @@ -39,7 +39,7 @@ fn_info_game_ac(){ fi } -fn_info_game_ark(){ +fn_info_game_ark() { # Config if [ ! -f "${servercfgfullpath}" ]; then servername="${unavailable}" @@ -60,11 +60,11 @@ fn_info_game_ark(){ port=${port:-"0"} queryport=${queryport:-"0"} rconport=${rconport:-"0"} - rawport=$((port+1)) + rawport=$((port + 1)) maxplayers=${maxplayers:-"0"} } -fn_info_game_arma3(){ +fn_info_game_arma3() { # Config if [ ! -f "${servercfgfullpath}" ]; then servername="${unavailable}" @@ -87,13 +87,13 @@ fn_info_game_arma3(){ # Parameters port=${port:-"2302"} voiceport=${port:-"2302"} - queryport=$((port+1)) - steammasterport=$((port+2)) - voiceunusedport=$((port+3)) - battleeyeport=$((port+4)) + queryport=$((port + 1)) + steammasterport=$((port + 2)) + voiceunusedport=$((port + 3)) + battleeyeport=$((port + 4)) } -fn_info_game_armar(){ +fn_info_game_armar() { if [ -f "${servercfgfullpath}" ]; then adminpassword=$(jq -r '.adminPassword' "${servercfgfullpath}") configip=$(jq -r '.gameHostBindAddress' "${servercfgfullpath}") @@ -104,7 +104,6 @@ fn_info_game_armar(){ serverpassword=$(jq -r '.game.password' "${servercfgfullpath}") battleeyeport=1376 - # Not set adminpassword=${adminpassword:-"NOT SET"} configip=${configip:-"0.0.0.0"} @@ -138,9 +137,9 @@ fn_info_game_av() { servername=$(grep "name=" "${servercfgfullpath}" | sed 's/name=//') serverpassword=$(grep "password=" "${servercfgfullpath}" | sed 's/password=//') port=$(grep "port=" "${servercfgfullpath}" | sed 's/port=//') - queryport=$((port+3)) - steamqueryport=$((port+20)) - steammasterport=$((port+21)) + queryport=$((port + 3)) + steamqueryport=$((port + 20)) + steammasterport=$((port + 21)) rconport=$(grep "rconPort=" "${servercfgfullpath}" | sed 's/rconPort=//') rconpassword=$(grep "rconPassword=" "${servercfgfullpath}" | sed 's/rconPassword=//') @@ -162,7 +161,7 @@ fn_info_game_av() { fi } -fn_info_game_bf1942(){ +fn_info_game_bf1942() { # Config if [ ! -f "${servercfgfullpath}" ]; then servername="${unavailable}" @@ -188,7 +187,7 @@ fn_info_game_bf1942(){ fi } -fn_info_game_bfv(){ +fn_info_game_bfv() { # Config if [ ! -f "${servercfgfullpath}" ]; then servername="${unavailable}" @@ -214,7 +213,7 @@ fn_info_game_bfv(){ fi } -fn_info_game_bo(){ +fn_info_game_bo() { # Config if [ ! -f "${servercfgfullpath}" ]; then servername="${unavailable}" @@ -226,7 +225,7 @@ fn_info_game_bo(){ servername=$(grep "ServerName=" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/ServerName//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') serverpassword=$(grep "Password=" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/Password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') port=$(grep "ServerPort=" "${servercfgfullpath}" | tr -cd '[:digit:]') - queryport=$((port+1)) + queryport=$((port + 1)) maxplayers=$(grep "MaxPlayers=" "${servercfgfullpath}" | tr -cd '[:digit:]') # Not set @@ -238,7 +237,7 @@ fn_info_game_bo(){ fi } -fn_info_game_bt(){ +fn_info_game_bt() { # Config if [ ! -f "${servercfgfullpath}" ]; then servername="${unavailable}" @@ -247,7 +246,7 @@ fn_info_game_bt(){ queryport="${zero}" maxplayers="${unavailable}" else - servername=$(grep -Po 'name="\K.*(?=")' "${servercfgfullpath}") # Assuming GNU grep is used + servername=$(grep -Po 'name="\K.*(?=")' "${servercfgfullpath}") # Assuming GNU grep is used serverpassword=$(grep -Po 'password="\K.*(?=")' "${servercfgfullpath}") # Assuming GNU grep is used port=$(grep " port=" "${servercfgfullpath}" | tr -cd '[:digit:]') queryport=$(grep "queryport=" "${servercfgfullpath}" | tr -cd '[:digit:]') @@ -262,7 +261,7 @@ fn_info_game_bt(){ fi } -fn_info_game_bt1944(){ +fn_info_game_bt1944() { # Config if [ ! -f "${servercfgfullpath}" ]; then servername="${unavailable}" @@ -282,10 +281,10 @@ fn_info_game_bt1944(){ # Parameters port=${port:-"0"} queryport=${queryport:-"0"} - rconport=$((port+2)) + rconport=$((port + 2)) } -fn_info_game_cd(){ +fn_info_game_cd() { if [ ! -f "${servercfgfullpath}" ]; then servername="${unavailable}" port="${zero}" @@ -305,7 +304,7 @@ fn_info_game_cd(){ fi } -fn_info_game_cmw(){ +fn_info_game_cmw() { # Config if [ ! -f "${servercfgfullpath}" ]; then adminpassword="${unavailable}" @@ -332,7 +331,7 @@ fn_info_game_cmw(){ queryport=${queryport:-"0"} } -fn_info_game_cod(){ +fn_info_game_cod() { # Config if [ ! -f "${servercfgfullpath}" ]; then servername="${unavailable}" @@ -352,7 +351,7 @@ fn_info_game_cod(){ port=${port:-"0"} } -fn_info_game_coduo(){ +fn_info_game_coduo() { # Config if [ ! -f "${servercfgfullpath}" ]; then servername="${unavailable}" @@ -373,9 +372,7 @@ fn_info_game_coduo(){ queryport=${port:-"28960"} } - - -fn_info_game_cod2(){ +fn_info_game_cod2() { # Config if [ ! -f "${servercfgfullpath}" ]; then servername="${unavailable}" @@ -396,7 +393,7 @@ fn_info_game_cod2(){ queryport=${port:-"28960"} } -fn_info_game_cod4(){ +fn_info_game_cod4() { # Config if [ ! -f "${servercfgfullpath}" ]; then servername="${unavailable}" @@ -419,7 +416,7 @@ fn_info_game_cod4(){ queryport=${port:-"28960"} } -fn_info_game_codwaw(){ +fn_info_game_codwaw() { # Config if [ ! -f "${servercfgfullpath}" ]; then servername="${unavailable}" @@ -440,7 +437,7 @@ fn_info_game_codwaw(){ queryport=${port:-"28960"} } -fn_info_game_col(){ +fn_info_game_col() { # Config if [ ! -f "${servercfgfullpath}" ]; then servername="${unavailable}" @@ -472,7 +469,7 @@ fn_info_game_col(){ fi } -fn_info_game_dodr(){ +fn_info_game_dodr() { # Config if [ ! -f "${servercfgfullpath}" ]; then maxplayers="${zero}" @@ -489,7 +486,7 @@ fn_info_game_dodr(){ queryport=${queryport:-"27015"} } -fn_info_game_dayz(){ +fn_info_game_dayz() { # Config if [ ! -f "${servercfgfullpath}" ]; then servername="${unavailable}" @@ -513,11 +510,11 @@ fn_info_game_dayz(){ # Parameters port=${port:-"2302"} - steammasterport=$((port+2)) - battleeyeport=$((port+4)) + steammasterport=$((port + 2)) + battleeyeport=$((port + 4)) } -fn_info_game_dst(){ +fn_info_game_dst() { # Config if [ ! -f "${clustercfgfullpath}" ]; then servername="${unavailable}" @@ -568,7 +565,7 @@ fn_info_game_dst(){ cave=${cave:-"NOT SET"} } -fn_info_game_eco(){ +fn_info_game_eco() { # Config if [ ! -f "${servercfgfullpath}" ]; then servername="${unavailable}" @@ -597,7 +594,7 @@ fn_info_game_eco(){ fi } -fn_info_game_etl(){ +fn_info_game_etl() { # Config if [ ! -f "${servercfgfullpath}" ]; then rconpassword="${unavailable}" @@ -626,7 +623,7 @@ fn_info_game_etl(){ fi } -fn_info_game_fctr(){ +fn_info_game_fctr() { # Config if [ ! -f "${servercfgfullpath}" ]; then servername="Factorio Server" @@ -658,7 +655,7 @@ fn_info_game_fctr(){ rconpassword=${rconpassword:-"NOT SET"} } -fn_info_game_jc2(){ +fn_info_game_jc2() { # Config if [ ! -f "${servercfgfullpath}" ]; then servername="${unavailable}" @@ -687,7 +684,7 @@ fn_info_game_jc2(){ fi } -fn_info_game_hw(){ +fn_info_game_hw() { # Parameters servername=${servername:-"NOT SET"} port=${port:-"0"} @@ -697,7 +694,7 @@ fn_info_game_hw(){ creativemode=${creativemode:-"NOT SET"} } -fn_info_game_inss(){ +fn_info_game_inss() { # Parameters port=${port:-"0"} queryport=${queryport:-"0"} @@ -709,7 +706,7 @@ fn_info_game_inss(){ maxplayers=${maxplayers:-"0"} } -fn_info_game_jc3(){ +fn_info_game_jc3() { # Config if [ ! -f "${servercfgfullpath}" ]; then servername="${unavailable}" @@ -747,7 +744,7 @@ fn_info_game_jc3(){ fi } -fn_info_game_jk2(){ +fn_info_game_jk2() { # Config if [ ! -f "${servercfgfullpath}" ]; then rconpassword="${unavailable}" @@ -776,7 +773,7 @@ fn_info_game_jk2(){ defaultmap=${defaultmap:-"NOT SET"} } -fn_info_game_kf(){ +fn_info_game_kf() { # Config if [ ! -f "${servercfgfullpath}" ]; then servername="${unavailable}" @@ -797,7 +794,7 @@ fn_info_game_kf(){ serverpassword=$(sed -nr 's/^GamePassword=(.*)$/\1/p' "${servercfgfullpath}" | tr -d '=\";,:' | sed 's/\r$//') adminpassword=$(sed -nr 's/^AdminPassword=(.*)$/\1/p' "${servercfgfullpath}" | tr -d '=\";,:' | sed 's/\r$//') port=$(sed -nr 's/^Port=(.*)$/\1/p' "${servercfgfullpath}" | tr -cd '[:digit:]') - queryport=$((port+1)) + queryport=$((port + 1)) queryportgs=$(sed -nr 's/^OldQueryPortNumber=(.*)$/\1/p' "${servercfgfullpath}" | tr -cd '[:digit:]') steamport="20560" steammasterport="28852" @@ -827,7 +824,7 @@ fn_info_game_kf(){ defaultmap=${defaultmap:-"NOT SET"} } -fn_info_game_kf2(){ +fn_info_game_kf2() { # Config if [ ! -f "${servercfgfullpath}" ]; then servername="${unavailable}" @@ -865,7 +862,7 @@ fn_info_game_kf2(){ defaultmap=${defaultmap:-"NOT SET"} } -fn_info_game_lo(){ +fn_info_game_lo() { # Parameters servername=${servername:-"NOT SET"} port=${port:-"0"} @@ -873,7 +870,7 @@ fn_info_game_lo(){ maxplayers=${slots:-"0"} } -fn_info_game_mc(){ +fn_info_game_mc() { # Config if [ ! -f "${servercfgfullpath}" ]; then servername="${unavailable}" @@ -914,7 +911,7 @@ fn_info_game_mc(){ fi } -fn_info_game_mcb(){ +fn_info_game_mcb() { # Config if [ ! -f "${servercfgfullpath}" ]; then servername="${unavailable}" @@ -944,7 +941,7 @@ fn_info_game_mcb(){ fi } -fn_info_game_mh(){ +fn_info_game_mh() { # Config if [ ! -f "${servercfgfullpath}" ]; then servername="${unavailable}" @@ -970,7 +967,7 @@ fn_info_game_mh(){ beaconport=${beaconport:-"0"} } -fn_info_game_mohaa(){ +fn_info_game_mohaa() { # Config if [ ! -f "${servercfgfullpath}" ]; then rconpassword="${unavailable}" @@ -996,7 +993,7 @@ fn_info_game_mohaa(){ defaultmap=${defaultmap:-"NOT SET"} } -fn_info_game_mom(){ +fn_info_game_mom() { # Config if [ ! -f "${servercfgfullpath}" ]; then servername="${unavailable}" @@ -1021,7 +1018,7 @@ fn_info_game_mom(){ beaconport=${queryport:-"15000"} } -fn_info_game_mta(){ +fn_info_game_mta() { # Config if [ ! -f "${servercfgfullpath}" ]; then port=${zero} @@ -1033,7 +1030,7 @@ fn_info_game_mta(){ maxplayers="${zero}" else port=$(grep -m 1 "serverport" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's///g' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//' | cut -f1 -d "<" | tr -cd '[:digit:]') - queryport=$((port+123)) + queryport=$((port + 123)) httpport=$(grep -m 1 "httpport" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's///g' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//' | cut -f1 -d "<" | tr -cd '[:digit:]') servername=$(grep -m 1 "servername" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's///g' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//' | cut -f1 -d "<") serverpassword=$(grep -m 1 "password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's///g' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//' | cut -f1 -d "<") @@ -1057,7 +1054,7 @@ fn_info_game_mta(){ } -fn_info_game_mumble(){ +fn_info_game_mumble() { # Config if [ ! -f "${servercfgfullpath}" ]; then port="64738" @@ -1076,7 +1073,7 @@ fn_info_game_mumble(){ fi } -fn_info_game_onset(){ +fn_info_game_onset() { # Config if [ ! -f "${servercfgfullpath}" ]; then servername="${unavailable}" @@ -1085,11 +1082,11 @@ fn_info_game_onset(){ httpport="${zero}" queryport="${zero}" else - servername=$(grep -v "servername_short" "${servercfgfullpath}" | grep "servername" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/servername//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//' ) + servername=$(grep -v "servername_short" "${servercfgfullpath}" | grep "servername" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/servername//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') maxplayers=$(grep "maxplayers" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') port=$(grep "port" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') - httpport=$((port-2)) - queryport=$((port-1)) + httpport=$((port - 2)) + queryport=$((port - 1)) # Not set servername=${servername:-"NOT SET"} @@ -1100,7 +1097,7 @@ fn_info_game_onset(){ fi } -fn_info_game_pc(){ +fn_info_game_pc() { # Config if [ ! -f "${servercfgfullpath}" ]; then servername="${unavailable}" @@ -1127,7 +1124,7 @@ fn_info_game_pc(){ fi } -fn_info_game_pc2(){ +fn_info_game_pc2() { # Config if [ ! -f "${servercfgfullpath}" ]; then servername="${unavailable}" @@ -1154,7 +1151,7 @@ fn_info_game_pc2(){ fi } -fn_info_game_pstbs(){ +fn_info_game_pstbs() { # Config if [ ! -f "${servercfgfullpath}" ]; then servername="${unavailable}" @@ -1180,7 +1177,7 @@ fn_info_game_pstbs(){ # Not set rconport=${rconport:-"0"} - if [ -z "${rconpassword}" ]||[ ${#rconpassword} == 1 ]; then + if [ -z "${rconpassword}" ] || [ ${#rconpassword} == 1 ]; then rconpassword="NOT SET" fi fi @@ -1196,7 +1193,7 @@ fn_info_game_pstbs(){ reservedslots=${reservedslots:-"0"} } -fn_info_game_pvr(){ +fn_info_game_pvr() { # Config if [ ! -f "${servercfgfullpath}" ]; then servername="${unavailable}" @@ -1212,11 +1209,11 @@ fn_info_game_pvr(){ # Parameters port=${port:-"0"} - port401=$((port+400)) + port401=$((port + 400)) queryport=${port:-"0"} } -fn_info_game_pz(){ +fn_info_game_pz() { # Config if [ ! -f "${servercfgfullpath}" ]; then servername="${unavailable}" @@ -1228,7 +1225,7 @@ fn_info_game_pz(){ gameworld="${unavailable}" else servername=$(grep "PublicName" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/PublicName//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - serverpassword=$(grep "Password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' | grep "^Password" | sed -e '/^#/d' -e 's/Password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + serverpassword=$(grep "Password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' | grep "^Password" | sed -e '/^#/d' -e 's/Password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') rconpassword=$(grep "RCONPassword" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/RCONPassword//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') maxplayers=$(grep "MaxPlayers" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') port=$(grep "DefaultPort" "${servercfgfullpath}" | tr -cd '[:digit:]') @@ -1250,7 +1247,7 @@ fn_info_game_pz(){ } -fn_info_game_q2(){ +fn_info_game_q2() { # Config if [ ! -f "${servercfgfullpath}" ]; then rconpassword="${unavailable}" @@ -1273,7 +1270,7 @@ fn_info_game_q2(){ defaultmap=${defaultmap:-"NOT SET"} } -fn_info_game_q3(){ +fn_info_game_q3() { # Config if [ ! -f "${servercfgfullpath}" ]; then rconpassword="${unavailable}" @@ -1299,7 +1296,7 @@ fn_info_game_q3(){ defaultmap=${defaultmap:-"NOT SET"} } -fn_info_game_ql(){ +fn_info_game_ql() { # Config if [ ! -f "${servercfgfullpath}" ]; then rconpassword="${unavailable}" @@ -1334,7 +1331,7 @@ fn_info_game_ql(){ fi } -fn_info_game_qw(){ +fn_info_game_qw() { # Config if [ ! -f "${servercfgfullpath}" ]; then rconpassword="${unavailable}" @@ -1358,7 +1355,7 @@ fn_info_game_qw(){ queryport=${port} } -fn_info_game_ro(){ +fn_info_game_ro() { # Config if [ ! -f "${servercfgfullpath}" ]; then servername="${unavailable}" @@ -1378,7 +1375,7 @@ fn_info_game_ro(){ serverpassword=$(sed -nr 's/^GamePassword=(.*)$/\1/p' "${servercfgfullpath}" | tr -d '=\";,:' | sed 's/\r$//') adminpassword=$(sed -nr 's/^AdminPassword=(.*)$/\1/p' "${servercfgfullpath}" | tr -d '=\";,:' | sed 's/\r$//') port=$(sed -nr 's/^Port=(.*)$/\1/p' "${servercfgfullpath}" | tr -cd '[:digit:]') - queryport=$((port+1)) + queryport=$((port + 1)) steamport="20610" steammasterport="28902" lanport=$(grep "LANServerPort=" "${servercfgfullpath}" | tr -cd '[:digit:]') @@ -1406,7 +1403,7 @@ fn_info_game_ro(){ defaultmap=${defaultmap:-"NOT SET"} } -fn_info_game_rtcw(){ +fn_info_game_rtcw() { # Config if [ ! -f "${servercfgfullpath}" ]; then rconpassword="${unavailable}" @@ -1432,7 +1429,7 @@ fn_info_game_rtcw(){ defaultmap=${defaultmap:-"NOT SET"} } -fn_info_game_rust(){ +fn_info_game_rust() { # Parameters servername=${servername:-"NOT SET"} port=${port:-"0"} @@ -1452,7 +1449,7 @@ fn_info_game_rust(){ salt=${salt:-"0"} } -fn_info_game_rw(){ +fn_info_game_rw() { # Config if [ ! -f "${servercfgfullpath}" ]; then servername="${unavailable}" @@ -1474,12 +1471,12 @@ fn_info_game_rw(){ 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)) + 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]*$//') + 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]*$//') gameworld=$(grep "server_world_name" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/server_world_name//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') 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]*$//') @@ -1501,7 +1498,7 @@ fn_info_game_rw(){ fi } -fn_info_game_samp(){ +fn_info_game_samp() { # Config if [ ! -f "${servercfgfullpath}" ]; then servername="unnamed server" @@ -1527,7 +1524,7 @@ fn_info_game_samp(){ fi } -fn_info_game_sb(){ +fn_info_game_sb() { # Config if [ ! -f "${servercfgfullpath}" ]; then servername="${unavailable}" @@ -1560,7 +1557,7 @@ fn_info_game_sb(){ fi } -fn_info_game_sbots(){ +fn_info_game_sbots() { # Config if [ ! -f "${servercfgfullpath}" ]; then servername="${unavailable}" @@ -1583,7 +1580,7 @@ fn_info_game_sbots(){ maxplayers=${maxplayers:-"0"} } -fn_info_game_scpsl(){ +fn_info_game_scpsl() { # Config if [ -f "${servercfgfullpath}" ]; then servername=$(sed -nr 's/^server_name: (.*)$/\1/p' "${servercfgfullpath}") @@ -1604,7 +1601,7 @@ fn_info_game_scpsl(){ queryport=${port} } -fn_info_game_sdtd(){ +fn_info_game_sdtd() { # Config if [ ! -f "${servercfgfullpath}" ]; then servername="${unavailable}" @@ -1626,7 +1623,7 @@ fn_info_game_sdtd(){ servername=$(grep "ServerName" "${servercfgfullpath}" | sed 's/^.*value="//' | cut -f1 -d"\"") serverpassword=$(grep "ServerPassword" "${servercfgfullpath}" | sed 's/^.*value="//' | cut -f1 -d"\"") port=$(grep "ServerPort" "${servercfgfullpath}" | grep -Eo 'value="[0-9]+"' | tr -cd '[:digit:]') - port3=$((port+2)) + port3=$((port + 2)) queryport=${port:-"0"} webadminenabled=$(grep "ControlPanelEnabled" "${servercfgfullpath}" | sed 's/^.*value="//' | cut -f1 -d"\"") webadminport=$(grep "ControlPanelPort" "${servercfgfullpath}" | tr -cd '[:digit:]') @@ -1660,7 +1657,7 @@ fn_info_game_sdtd(){ fi } -fn_info_game_sf(){ +fn_info_game_sf() { # Parameters servername=${selfname:-"NOT SET"} port=${port:-"0"} @@ -1668,7 +1665,7 @@ fn_info_game_sf(){ beaconport=${beaconport:-"0"} } -fn_info_game_sof2(){ +fn_info_game_sof2() { # Config if [ ! -f "${servercfgfullpath}" ]; then rconpassword="${unavailable}" @@ -1694,7 +1691,7 @@ fn_info_game_sof2(){ defaultmap=${defaultmap:-"NOT SET"} } -fn_info_game_sol(){ +fn_info_game_sol() { # Config if [ ! -f "${servercfgfullpath}" ]; then adminpassword="${unavailable}" @@ -1708,7 +1705,7 @@ fn_info_game_sol(){ maxplayers=$(grep "Max_Players=" "${servercfgfullpath}" | tr -cd '[:digit:]') port=$(grep "Port=" "${servercfgfullpath}" | tr -cd '[:digit:]') queryport="${port}" - filesport=$((port+10)) + filesport=$((port + 10)) servername=$(grep "Server_Name=" "${servercfgfullpath}" | awk -F '=' '{print $2}') serverpassword=$(grep "Game_Password=" "${servercfgfullpath}" | awk -F '=' '{print $2}') @@ -1722,7 +1719,7 @@ fn_info_game_sol(){ fi } -fn_info_game_source(){ +fn_info_game_source() { # Config if [ ! -f "${servercfgfullpath}" ]; then servername="${unavailable}" @@ -1748,16 +1745,16 @@ fn_info_game_source(){ clientport=${clientport:-"0"} # Steamport can be between 26901-26910 and is normaly automatically set. # Some servers might support -steamport parameter to set - if [ "${steamport}" == "0" ]||[ -v "${steamport}" ]; then + if [ "${steamport}" == "0" ] || [ -v "${steamport}" ]; then steamport="$(echo "${ssinfo}" | grep "${srcdslinuxpid}" | awk '{print $5}' | grep ":269" | cut -d ":" -f2)" fi } -fn_info_game_spark(){ +fn_info_game_spark() { defaultmap=${defaultmap:-"NOT SET"} maxplayers=${maxplayers:-"0"} port=${port:-"0"} - queryport=$((port+1)) + queryport=$((port + 1)) servername=${servername:-"NOT SET"} serverpassword=${serverpassword:-"NOT SET"} webadminuser=${webadminuser:-"NOT SET"} @@ -1767,7 +1764,7 @@ fn_info_game_spark(){ #mods=${mods:-"NOT SET"} } -fn_info_game_squad(){ +fn_info_game_squad() { # Config if [ ! -f "${servercfgfullpath}" ]; then servername="${unavailable}" @@ -1788,7 +1785,7 @@ fn_info_game_squad(){ rconpassword=$(grep "Password=" "${servercfgdir}/Rcon.cfg" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/Password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') rconport=${rconport:-"0"} - if [ -z "${rconpassword}" ]||[ ${#rconpassword} == 1 ]; then + if [ -z "${rconpassword}" ] || [ ${#rconpassword} == 1 ]; then rconpassword="NOT SET" fi @@ -1799,7 +1796,7 @@ fn_info_game_squad(){ queryport=${queryport:-"0"} } -fn_info_game_st(){ +fn_info_game_st() { # Config if [ ! -f "${servercfgfullpath}" ]; then servername="${unavailable}" @@ -1829,7 +1826,7 @@ fn_info_game_st(){ worldname=${worldname:-"NOT SET"} } -fn_info_game_terraria(){ +fn_info_game_terraria() { # Config if [ ! -f "${servercfgfullpath}" ]; then servername="${unavailable}" @@ -1853,7 +1850,7 @@ fn_info_game_terraria(){ fi } -fn_info_game_stn(){ +fn_info_game_stn() { # Config if [ -f "${servercfgfullpath}" ]; then servername=$(sed -nr 's/^ServerName="(.*)"/\1/p' "${servercfgfullpath}") @@ -1873,7 +1870,7 @@ fn_info_game_stn(){ fi } -fn_info_game_ti(){ +fn_info_game_ti() { if [ -f "${servercfgfullpath}" ]; then servername=$(sed -nr 's/^ServerName="(.*)"/\1/p' "${servercfgfullpath}") maxplayers=$(sed -nr 's/^MaxPlayerCount=([0-9]+)/\1/' "${servercfgfullpath}") @@ -1883,7 +1880,7 @@ fn_info_game_ti(){ fi } -fn_info_game_ts3(){ +fn_info_game_ts3() { # Config if [ ! -f "${servercfgfullpath}" ]; then dbplugin="${unavailable}" @@ -1918,7 +1915,7 @@ fn_info_game_ts3(){ fi } -fn_info_game_tu(){ +fn_info_game_tu() { # Config if [ ! -f "${servercfgfullpath}" ]; then servername="${unavailable}" @@ -1934,11 +1931,11 @@ fn_info_game_tu(){ # Parameters port=${port:-"0"} - steamport=$((port+1)) + steamport=$((port + 1)) queryport=${queryport:-"0"} } -fn_info_game_tw(){ +fn_info_game_tw() { # Config if [ ! -f "${servercfgfullpath}" ]; then servername="unnamed server" @@ -1965,7 +1962,7 @@ fn_info_game_tw(){ fi } -fn_info_game_ut99(){ +fn_info_game_ut99() { # Config if [ ! -f "${servercfgfullpath}" ]; then servername="${unavailable}" @@ -1979,17 +1976,17 @@ fn_info_game_ut99(){ webadminuser="${unavailable}" webadminpass="${unavailable}" else - servername=$(grep "ServerName" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/ServerName//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//'| sed 's/\r$//') - serverpassword=$(grep "GamePassword" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/GamePassword//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//'| sed 's/\r$//') - adminpassword=$(grep "AdminPassword" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/AdminPassword//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//'| sed 's/\r$//') + servername=$(grep "ServerName" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/ServerName//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//' | sed 's/\r$//') + serverpassword=$(grep "GamePassword" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/GamePassword//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//' | sed 's/\r$//') + adminpassword=$(grep "AdminPassword" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/AdminPassword//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//' | sed 's/\r$//') port=$(grep "Port" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' | grep "^Port" | grep -v "#" | tr -cd '[:digit:]') - queryport=$((port+1)) + queryport=$((port + 1)) queryportgs=$(grep "OldQueryPortNumber" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') beaconport=$(grep "ServerBeaconPort" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') - webadminenabled=$(grep "bEnabled" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/bEnabled//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//'| sed 's/\r$//') + webadminenabled=$(grep "bEnabled" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/bEnabled//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//' | sed 's/\r$//') httpport=$(grep "ListenPort" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') - webadminuser=$(grep "AdminUsername" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/AdminUsername//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//'| sed 's/\r$//') - webadminpass=$(grep "UTServerAdmin.UTServerAdmin" "${servercfgfullpath}" -A 4 | grep "AdminPassword" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/AdminPassword//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//'| sed 's/\r$//') + webadminuser=$(grep "AdminUsername" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/AdminUsername//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//' | sed 's/\r$//') + webadminpass=$(grep "UTServerAdmin.UTServerAdmin" "${servercfgfullpath}" -A 4 | grep "AdminPassword" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/AdminPassword//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//' | sed 's/\r$//') # Not set servername=${servername:-"NOT SET"} @@ -2009,7 +2006,7 @@ fn_info_game_ut99(){ defaultmap=${defaultmap:-"NOT SET"} } -fn_info_game_unreal2(){ +fn_info_game_unreal2() { # Config if [ ! -f "${servercfgfullpath}" ]; then servername="${unavailable}" @@ -2027,7 +2024,7 @@ fn_info_game_unreal2(){ serverpassword=$(sed -nr 's/^GamePassword=(.*)$/\1/p' "${servercfgfullpath}" | tr -d '=\";,:' | sed 's/\r$//') adminpassword=$(sed -nr 's/^AdminPassword=(.*)$/\1/p' "${servercfgfullpath}" | tr -d '=\";,:' | sed 's/\r$//') port=$(sed -nr 's/^Port=(.*)$/\1/p' "${servercfgfullpath}" | tr -cd '[:digit:]') - queryport=$((port+1)) + queryport=$((port + 1)) queryportgs=$(sed -nr 's/^OldQueryPortNumber=(.*)$/\1/p' "${servercfgfullpath}" | tr -cd '[:digit:]') webadminenabled=$(sed -nr 's/^bEnabled=(.*)$/\1/p' "${servercfgfullpath}" | tr -d '=\";,:' | sed 's/\r$//') webadminport=$(sed -nr 's/^ListenPort=(.*)$/\1/p' "${servercfgfullpath}" | tr -cd '[:digit:]') @@ -2051,15 +2048,15 @@ fn_info_game_unreal2(){ defaultmap=${defaultmap:-"NOT SET"} } -fn_info_game_unt(){ +fn_info_game_unt() { # Parameters servername=${selfname:-"NOT SET"} port=${port:-"0"} queryport=${port} - steamport=$((port+1)) + steamport=$((port + 1)) } -fn_info_game_ut(){ +fn_info_game_ut() { # Config if [ ! -f "${servercfgfullpath}" ]; then servername="${unavailable}" @@ -2072,10 +2069,10 @@ fn_info_game_ut(){ # Parameters port=${port:-"0"} - queryport=$((port+1)) + queryport=$((port + 1)) } -fn_info_game_unreal2k4(){ +fn_info_game_unreal2k4() { # Config if [ ! -f "${servercfgfullpath}" ]; then servername="${unavailable}" @@ -2094,7 +2091,7 @@ fn_info_game_unreal2k4(){ serverpassword=$(sed -nr 's/^GamePassword=(.*)$/\1/p' "${servercfgfullpath}" | tr -d '=\";,:' | sed 's/\r$//') adminpassword=$(sed -nr 's/^AdminPassword=(.*)$/\1/p' "${servercfgfullpath}" | tr -d '=\";,:' | sed 's/\r$//') port=$(sed -nr 's/^Port=(.*)$/\1/p' "${servercfgfullpath}" | tr -cd '[:digit:]') - queryport=$((port+1)) + queryport=$((port + 1)) queryportgs=$(sed -nr 's/^OldQueryPortNumber=(.*)$/\1/p' "${servercfgfullpath}" | tr -cd '[:digit:]') lanport=$(grep "LANServerPort=" "${servercfgfullpath}" | tr -cd '[:digit:]') webadminenabled=$(sed -nr 's/^bEnabled=(.*)$/\1/p' "${servercfgfullpath}" | tr -d '=\";,:' | sed 's/\r$//') @@ -2117,7 +2114,7 @@ fn_info_game_unreal2k4(){ fi } -fn_info_game_ut3(){ +fn_info_game_ut3() { # Config if [ ! -f "${servercfgfullpath}" ]; then servername="${unavailable}" @@ -2155,12 +2152,12 @@ fn_info_game_ut3(){ defaultmap=${defaultmap:-"NOT SET"} } -fn_info_game_vh(){ +fn_info_game_vh() { # Parameters port=${port:-"0"} # Query port only enabled if public server if [ "${public}" != "0" ]; then - queryport=$((port+1)) + queryport=$((port + 1)) else querymode="1" fi @@ -2169,7 +2166,7 @@ fn_info_game_vh(){ servername=${servername:-"NOT SET"} } -fn_info_game_vints(){ +fn_info_game_vints() { if [ ! -f "${servercfgfullpath}" ]; then servername="${unavailable}" maxplayers="${unavailable}" @@ -2190,7 +2187,7 @@ fn_info_game_vints(){ fi } -fn_info_game_wet(){ +fn_info_game_wet() { # Config if [ ! -f "${servercfgfullpath}" ]; then rconpassword="${unavailable}" @@ -2219,7 +2216,7 @@ fn_info_game_wet(){ fi } -fn_info_game_wf(){ +fn_info_game_wf() { # Config if [ ! -f "${servercfgfullpath}" ]; then rconpassword="${unavailable}" @@ -2242,8 +2239,7 @@ fn_info_game_wf(){ webadminport=${webadminport:-"0"} } - -fn_info_game_wmc(){ +fn_info_game_wmc() { if [ ! -f "${servercfgfullpath}" ]; then servername="${unavailable}" maxplayers="${zero}" @@ -2259,7 +2255,7 @@ fn_info_game_wmc(){ maxplayers=$(sed -nr 's/^player_limit: ([-]*[0-9])/\1/p' "${servercfgfullpath}") configip=$(sed -nr 's/^[ ]+host: ([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+):[0-9]+/\1/p' "${servercfgfullpath}") - if [ "${maxplayers}" == "-1" ]||[ "${maxplayers}" == "0" ]; then + if [ "${maxplayers}" == "-1" ] || [ "${maxplayers}" == "0" ]; then maxplayers="UNLIMITED" fi @@ -2271,7 +2267,7 @@ fn_info_game_wmc(){ fi } -fn_info_game_wurm(){ +fn_info_game_wurm() { # Config if [ ! -f "${servercfgfullpath}" ]; then port="${zero}" @@ -2367,7 +2363,7 @@ elif [ "${shortname}" == "kf2" ]; then fn_info_game_kf2 elif [ "${shortname}" == "lo" ]; then fn_info_game_lo -elif [ "${shortname}" == "mc" ]||[ "${shortname}" == "pmc" ]; then +elif [ "${shortname}" == "mc" ] || [ "${shortname}" == "pmc" ]; then fn_info_game_mc elif [ "${shortname}" == "mcb" ]; then fn_info_game_mcb @@ -2389,7 +2385,7 @@ elif [ "${shortname}" == "pc2" ]; then fn_info_game_pc2 elif [ "${shortname}" == "pstbs" ]; then fn_info_game_pstbs -elif [ "${shortname}" == "pvr" ];then +elif [ "${shortname}" == "pvr" ]; then fn_info_game_pvr elif [ "${shortname}" == "pz" ]; then fn_info_game_pz @@ -2415,7 +2411,7 @@ elif [ "${shortname}" == "sb" ]; then fn_info_game_sb elif [ "${shortname}" == "sbots" ]; then fn_info_game_sbots -elif [ "${shortname}" == "scpsl" ]||[ "${shortname}" == "scpslsm" ]; then +elif [ "${shortname}" == "scpsl" ] || [ "${shortname}" == "scpslsm" ]; then fn_info_game_scpsl elif [ "${shortname}" == "sdtd" ]; then fn_info_game_sdtd @@ -2465,7 +2461,7 @@ elif [ "${shortname}" == "wmc" ]; then fn_info_game_wmc elif [ "${shortname}" == "wurm" ]; then fn_info_game_wurm -elif [ "${engine}" == "source" ]||[ "${engine}" == "goldsrc" ]; then +elif [ "${engine}" == "source" ] || [ "${engine}" == "goldsrc" ]; then fn_info_game_source elif [ "${engine}" == "unreal2" ]; then fn_info_game_unreal2 @@ -2473,7 +2469,7 @@ fi # External IP address if [ -z "${extip}" ]; then - extip="$(curl --connect-timeout 10 -s https://api.ipify.org 2>/dev/null)" + extip="$(curl --connect-timeout 10 -s https://api.ipify.org 2> /dev/null)" exitcode=$? # Should ifconfig.co return an error will use last known IP. if [ ${exitcode} -eq 0 ]; then @@ -2507,16 +2503,16 @@ fi # Steam Master Server - checks if detected by master server. # Checked after config init, as the queryport is needed if [ -z "${displaymasterserver}" ]; then - if [ "$(command -v jq 2>/dev/null)" ]; then - if [ "${ip}" ]&&[ "${port}" ]; then - if [ "${steammaster}" == "true" ]||[ "${commandname}" == "DEV-QUERY-RAW" ]; then + if [ "$(command -v jq 2> /dev/null)" ]; then + if [ "${ip}" ] && [ "${port}" ]; then + if [ "${steammaster}" == "true" ] || [ "${commandname}" == "DEV-QUERY-RAW" ]; then # Will query server IP addresses first. for queryip in "${queryips[@]}"; do - masterserver="$(curl --connect-timeout 10 -m 3 -s "https://api.steampowered.com/ISteamApps/GetServersAtAddress/v0001?addr=${queryip}&format=json" | jq --arg port "${port}" --arg queryport "${queryport}" '.response.servers[] | select((.gameport == ($port|tonumber) or (.gameport == ($queryport|tonumber)))) | .addr' | wc -l 2>/dev/null)" + masterserver="$(curl --connect-timeout 10 -m 3 -s "https://api.steampowered.com/ISteamApps/GetServersAtAddress/v0001?addr=${queryip}&format=json" | jq --arg port "${port}" --arg queryport "${queryport}" '.response.servers[] | select((.gameport == ($port|tonumber) or (.gameport == ($queryport|tonumber)))) | .addr' | wc -l 2> /dev/null)" done # Should that not work it will try the external IP. if [ "${masterserver}" == "0" ]; then - masterserver="$(curl --connect-timeout 10 -m 3 -s "https://api.steampowered.com/ISteamApps/GetServersAtAddress/v0001?addr=${extip}&format=json" | jq --arg port "${port}" --arg queryport "${queryport}" '.response.servers[] | select((.gameport == ($port|tonumber) or (.gameport == ($queryport|tonumber)))) | .addr' | wc -l 2>/dev/null)" + masterserver="$(curl --connect-timeout 10 -m 3 -s "https://api.steampowered.com/ISteamApps/GetServersAtAddress/v0001?addr=${extip}&format=json" | jq --arg port "${port}" --arg queryport "${queryport}" '.response.servers[] | select((.gameport == ($port|tonumber) or (.gameport == ($queryport|tonumber)))) | .addr' | wc -l 2> /dev/null)" fi if [ "${masterserver}" == "0" ]; then displaymasterserver="false" diff --git a/lgsm/functions/info_messages.sh b/lgsm/functions/info_messages.sh index f0def5b0e..cfad349ac 100755 --- a/lgsm/functions/info_messages.sh +++ b/lgsm/functions/info_messages.sh @@ -8,7 +8,7 @@ functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" # Separator is different for details. -fn_messages_separator(){ +fn_messages_separator() { if [ "${commandname}" == "DETAILS" ]; then printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' = else @@ -17,7 +17,7 @@ fn_messages_separator(){ } # Removes the passwords form all but details. -fn_info_message_password_strip(){ +fn_info_message_password_strip() { if [ "${commandname}" != "DETAILS" ]; then if [ "${serverpassword}" ]; then serverpassword="********" @@ -55,7 +55,7 @@ fn_info_message_password_strip(){ # Alert Summary # used with alertlog -fn_info_message_head(){ +fn_info_message_head() { echo -e "" echo -e "${lightyellow}Alert Summary${default}" fn_messages_separator @@ -75,7 +75,7 @@ fn_info_message_head(){ echo -e "${ip}:${port}" } -fn_info_message_distro(){ +fn_info_message_distro() { # # Distro Details # ================================= @@ -106,7 +106,7 @@ fn_info_message_distro(){ } | column -s $'\t' -t } -fn_info_message_server_resource(){ +fn_info_message_server_resource() { # # Server Resource # ================================= @@ -172,7 +172,7 @@ fn_info_message_server_resource(){ } | column -s $'\t' -t } -fn_info_message_gameserver_resource(){ +fn_info_message_gameserver_resource() { # # Game Server Resource Usage # ================================= @@ -188,7 +188,7 @@ fn_info_message_gameserver_resource(){ echo -e "${lightyellow}Game Server Resource Usage${default}" fn_messages_separator { - if [ "${status}" != "0" ]&&[ -v status ]; then + if [ "${status}" != "0" ] && [ -v status ]; then if [ -n "${cpuused}" ]; then echo -e "${lightblue}CPU Used:\t${default}${cpuused}%${default}" else @@ -204,7 +204,7 @@ fn_info_message_gameserver_resource(){ echo -e "${lightblue}Mem Used:\t${default}0%\t0MB${default}" fi } | column -s $'\t' -t - echo -e "" + echo -e "" { echo -e "${lightyellow}Storage${default}" echo -e "${lightblue}Total:\t${default}${rootdirdu}" @@ -215,7 +215,7 @@ fn_info_message_gameserver_resource(){ } | column -s $'\t' -t } -fn_info_message_gameserver(){ +fn_info_message_gameserver() { # # Counter-Strike: Global Offensive Server Details # ================================= @@ -326,15 +326,15 @@ fn_info_message_gameserver(){ echo -e "${lightblue}Maxplayers:\t${default}${maxplayers}" fi else - if [ -n "${gdplayers}" ]&&[ -n "${gdmaxplayers}" ]; then + if [ -n "${gdplayers}" ] && [ -n "${gdmaxplayers}" ]; then echo -e "${lightblue}Players:\t${default}${gdplayers}/${gdmaxplayers}" - elif [ -n "${gdplayers}" ]&&[ -n "${maxplayers}" ]; then + elif [ -n "${gdplayers}" ] && [ -n "${maxplayers}" ]; then echo -e "${lightblue}Players:\t${default}${gdplayers}/${maxplayers}" - elif [ -z "${gdplayers}" ]&&[ -n "${gdmaxplayers}" ]; then + elif [ -z "${gdplayers}" ] && [ -n "${gdmaxplayers}" ]; then echo -e "${lightblue}Players:\t${default}0/${gdmaxplayers}" - elif [ -n "${gdplayers}" ]&&[ -z "${gdmaxplayers}" ]; then + elif [ -n "${gdplayers}" ] && [ -z "${gdmaxplayers}" ]; then echo -e "${lightblue}Players:\t${default}${gdplayers}/∞" - elif [ -z "${gdplayers}" ]&&[ -z "${gdmaxplayers}" ]&&[ -n "${maxplayers}" ]; then + elif [ -z "${gdplayers}" ] && [ -z "${gdmaxplayers}" ] && [ -n "${maxplayers}" ]; then echo -e "${lightblue}Maxplayers:\t${default}${maxplayers}" fi fi @@ -500,7 +500,7 @@ fn_info_message_gameserver(){ echo -e "" } -fn_info_message_script(){ +fn_info_message_script() { # csgoserver Script Details # ================================= # Script name: csgoserver @@ -596,7 +596,7 @@ fn_info_message_script(){ } | column -s $'\t' -t } -fn_info_message_backup(){ +fn_info_message_backup() { # # Backups # ================================= @@ -609,7 +609,7 @@ fn_info_message_backup(){ echo -e "" echo -e "${lightgreen}Backups${default}" fn_messages_separator - if [ ! -d "${backupdir}" ]||[ "${backupcount}" == "0" ]; then + if [ ! -d "${backupdir}" ] || [ "${backupcount}" == "0" ]; then echo -e "No Backups created" else { @@ -628,7 +628,7 @@ fn_info_message_backup(){ fi } -fn_info_message_commandlineparms(){ +fn_info_message_commandlineparms() { # # Command-line Parameters # ================================= @@ -645,7 +645,7 @@ fn_info_message_commandlineparms(){ echo -e "${preexecutable} ${executable} ${startparameters}" } -fn_info_message_ports_edit(){ +fn_info_message_ports_edit() { # # Ports # ================================= @@ -658,20 +658,20 @@ fn_info_message_ports_edit(){ startparameterslocation="${red}UNKNOWN${default}" # engines/games that require editing in the config file. - local ports_edit_array=( "ac" "arma3" "armar" "bo" "bt" "cd" "dst" "eco" "idtech2" "idtech3" "idtech3_ql" "jc2" "jc3" "lwjgl2" "mcb" "mumble" "pc" "pc2" "pz" "qw" "refractor" "renderware" "rw" "sb" "sdtd" "st" "stn" "ts3" "tw" "terraria" "unreal" "unreal2" "unreal3" "vints" "wurm") + local ports_edit_array=("ac" "arma3" "armar" "bo" "bt" "cd" "dst" "eco" "idtech2" "idtech3" "idtech3_ql" "jc2" "jc3" "lwjgl2" "mcb" "mumble" "pc" "pc2" "pz" "qw" "refractor" "renderware" "rw" "sb" "sdtd" "st" "stn" "ts3" "tw" "terraria" "unreal" "unreal2" "unreal3" "vints" "wurm") for port_edit in "${ports_edit_array[@]}"; do if [ "${shortname}" == "ut3" ]; then startparameterslocation="${servercfgdir}/UTWeb.ini" elif [ "${shortname}" == "kf2" ]; then startparameterslocation="${servercfgdir}/LinuxServer-KFEngine.ini\n${servercfgdir}/KFWeb.ini" - elif [ "${engine}" == "${port_edit}" ]||[ "${gamename}" == "${port_edit}" ]||[ "${shortname}" == "${port_edit}" ]; then + elif [ "${engine}" == "${port_edit}" ] || [ "${gamename}" == "${port_edit}" ] || [ "${shortname}" == "${port_edit}" ]; then startparameterslocation="${servercfgfullpath}" fi done # engines/games that require editing the start parameters. - local ports_edit_array=( "av" "col" "fctr" "goldsrc" "hw" "iw3.0" "ioquake3" "qfusion" "rust" "scpsl" "scpslsm" "sol" "spark" "source" "unreal4" "arma3" "dayz" "unt" "vh" ) + local ports_edit_array=("av" "col" "fctr" "goldsrc" "hw" "iw3.0" "ioquake3" "qfusion" "rust" "scpsl" "scpslsm" "sol" "spark" "source" "unreal4" "arma3" "dayz" "unt" "vh") for port_edit in "${ports_edit_array[@]}"; do - if [ "${engine}" == "${port_edit}" ]||[ "${gamename}" == "${port_edit}" ]||[ "${shortname}" == "${port_edit}" ]; then + if [ "${engine}" == "${port_edit}" ] || [ "${gamename}" == "${port_edit}" ] || [ "${shortname}" == "${port_edit}" ]; then startparameterslocation="${configdirserver}" fi done @@ -679,7 +679,7 @@ fn_info_message_ports_edit(){ echo -e "" } -fn_info_message_ports(){ +fn_info_message_ports() { echo -e "${lightblue}Useful port diagnostic command:${default}" if [ "${shortname}" == "armar" ]; then echo -e "ss -tuplwn | grep enfMain" @@ -687,7 +687,7 @@ fn_info_message_ports(){ echo -e "ss -tuplwn | grep AvorionServer" elif [ "${shortname}" == "bf1942" ]; then echo -e "ss -tuplwn | grep bf1942_lnxded" - elif [ "${shortname}" == "mc" ]||[ "${shortname}" == "pmc" ]||[ "${shortname}" == "rw" ]||[ "${shortname}" == "wmc" ]; then + elif [ "${shortname}" == "mc" ] || [ "${shortname}" == "pmc" ] || [ "${shortname}" == "rw" ] || [ "${shortname}" == "wmc" ]; then echo -e "ss -tuplwn | grep java" elif [ "${shortname}" == "terraria" ]; then echo -e "ss -tuplwn | grep Main" @@ -702,7 +702,7 @@ fn_info_message_ports(){ echo -e "" } -fn_info_message_statusbottom(){ +fn_info_message_statusbottom() { echo -e "" if [ "${status}" == "0" ]; then echo -e "${lightblue}Status:\t${red}STOPPED${default}" @@ -712,7 +712,7 @@ fn_info_message_statusbottom(){ echo -e "" } -fn_info_logs(){ +fn_info_logs() { echo -e "" echo -e "${selfname} Logs" echo -e "=================================" @@ -750,7 +750,7 @@ fn_info_logs(){ else echo -e "${gamelogdir}" # dos2unix sed 's/\r//' - tail "${gamelogdir}"/* 2>/dev/null | grep -v "==>" | sed '/^$/d' | sed 's/\r//' | tail -25 + tail "${gamelogdir}"/* 2> /dev/null | grep -v "==>" | sed '/^$/d' | sed 's/\r//' | tail -25 fi echo -e "" fi @@ -766,7 +766,7 @@ fn_info_logs(){ # Query 27015 udp 1 # RCON 27020 tcp 1 -fn_port(){ +fn_port() { if [ "${1}" == "header" ]; then echo -e "${lightblue}DESCRIPTION\tPORT\tPROTOCOL\tLISTEN${default}" else @@ -777,7 +777,7 @@ fn_port(){ fi } -fn_info_message_ac(){ +fn_info_message_ac() { { fn_port "header" fn_port "Game" port udp @@ -787,7 +787,7 @@ fn_info_message_ac(){ } | column -s $'\t' -t } -fn_info_message_ark(){ +fn_info_message_ark() { { fn_port "header" fn_port "Game" port udp @@ -797,7 +797,7 @@ fn_info_message_ark(){ } | column -s $'\t' -t } -fn_info_message_arma3(){ +fn_info_message_arma3() { { fn_port "header" fn_port "Game" port udp @@ -809,7 +809,7 @@ fn_info_message_arma3(){ } | column -s $'\t' -t } -fn_info_message_armar(){ +fn_info_message_armar() { { fn_port "header" fn_port "Game" port udp @@ -818,7 +818,7 @@ fn_info_message_armar(){ } | column -s $'\t' -t } -fn_info_message_av(){ +fn_info_message_av() { { fn_port "header" fn_port "Game" port udp @@ -829,7 +829,7 @@ fn_info_message_av(){ } | column -s $'\t' -t } -fn_info_message_bf1942(){ +fn_info_message_bf1942() { { fn_port "header" fn_port "Game" port udp @@ -837,7 +837,7 @@ fn_info_message_bf1942(){ } | column -s $'\t' -t } -fn_info_message_bfv(){ +fn_info_message_bfv() { { fn_port "header" fn_port "Game" port udp @@ -845,7 +845,7 @@ fn_info_message_bfv(){ } | column -s $'\t' -t } -fn_info_message_bo(){ +fn_info_message_bo() { { fn_port "header" fn_port "Game" port udp @@ -853,7 +853,7 @@ fn_info_message_bo(){ } | column -s $'\t' -t } -fn_info_message_bt(){ +fn_info_message_bt() { { fn_port "header" fn_port "Game" port udp @@ -861,7 +861,7 @@ fn_info_message_bt(){ } | column -s $'\t' -t } -fn_info_message_bt1944(){ +fn_info_message_bt1944() { { fn_port "header" fn_port "Game" port udp @@ -870,7 +870,7 @@ fn_info_message_bt1944(){ } | column -s $'\t' -t } -fn_info_messages_cd(){ +fn_info_messages_cd() { { fn_port "header" fn_port "Game" port udp @@ -879,7 +879,7 @@ fn_info_messages_cd(){ } | column -s $'\t' -t } -fn_info_message_cmw(){ +fn_info_message_cmw() { fn_info_message_password_strip { fn_port "header" @@ -889,7 +889,7 @@ fn_info_message_cmw(){ } | column -s $'\t' -t } -fn_info_message_cod(){ +fn_info_message_cod() { { fn_port "header" fn_port "Game" port udp @@ -897,7 +897,7 @@ fn_info_message_cod(){ } | column -s $'\t' -t } -fn_info_message_coduo(){ +fn_info_message_coduo() { { fn_port "header" fn_port "Game" port udp @@ -905,7 +905,7 @@ fn_info_message_coduo(){ } | column -s $'\t' -t } -fn_info_message_cod2(){ +fn_info_message_cod2() { { fn_port "header" fn_port "Game" port udp @@ -913,7 +913,7 @@ fn_info_message_cod2(){ } | column -s $'\t' -t } -fn_info_message_cod4(){ +fn_info_message_cod4() { { fn_port "header" fn_port "Game" port udp @@ -921,7 +921,7 @@ fn_info_message_cod4(){ } | column -s $'\t' -t } -fn_info_message_codwaw(){ +fn_info_message_codwaw() { { fn_port "header" fn_port "Game" port udp @@ -929,7 +929,7 @@ fn_info_message_codwaw(){ } | column -s $'\t' -t } -fn_info_message_col(){ +fn_info_message_col() { { fn_port "header" fn_port "Game" port udp @@ -938,7 +938,7 @@ fn_info_message_col(){ } | column -s $'\t' -t } -fn_info_message_csgo(){ +fn_info_message_csgo() { { fn_port "header" fn_port "Game" port udp @@ -949,7 +949,7 @@ fn_info_message_csgo(){ } | column -s $'\t' -t } -fn_info_message_dayz(){ +fn_info_message_dayz() { { fn_port "header" fn_port "Game" port udp @@ -959,7 +959,7 @@ fn_info_message_dayz(){ } | column -s $'\t' -t } -fn_info_message_dodr(){ +fn_info_message_dodr() { { fn_port "header" fn_port "Game" port udp @@ -967,7 +967,7 @@ fn_info_message_dodr(){ } | column -s $'\t' -t } -fn_info_message_dst(){ +fn_info_message_dst() { { fn_port "header" fn_port "Game: Server" port udp @@ -977,7 +977,7 @@ fn_info_message_dst(){ } | column -s $'\t' -t } -fn_info_message_eco(){ +fn_info_message_eco() { { fn_port "header" fn_port "Game" port udp @@ -985,7 +985,7 @@ fn_info_message_eco(){ } | column -s $'\t' -t } -fn_info_message_etl(){ +fn_info_message_etl() { { fn_port "header" fn_port "Game" port udp @@ -993,7 +993,7 @@ fn_info_message_etl(){ } | column -s $'\t' -t } -fn_info_message_fctr(){ +fn_info_message_fctr() { { fn_port "header" fn_port "Game" port udp @@ -1001,7 +1001,7 @@ fn_info_message_fctr(){ } | column -s $'\t' -t } -fn_info_message_goldsrc(){ +fn_info_message_goldsrc() { { fn_port "header" fn_port "Game" port udp @@ -1009,7 +1009,7 @@ fn_info_message_goldsrc(){ } | column -s $'\t' -t } -fn_info_message_hw(){ +fn_info_message_hw() { { fn_port "header" fn_port "Game" port udp @@ -1017,7 +1017,7 @@ fn_info_message_hw(){ } | column -s $'\t' -t } -fn_info_message_ins(){ +fn_info_message_ins() { { fn_port "header" fn_port "Game" port udp @@ -1028,7 +1028,7 @@ fn_info_message_ins(){ } | column -s $'\t' -t } -fn_info_message_inss(){ +fn_info_message_inss() { { fn_port "header" fn_port "Game" port udp @@ -1037,7 +1037,7 @@ fn_info_message_inss(){ } | column -s $'\t' -t } -fn_info_message_jc2(){ +fn_info_message_jc2() { { fn_port "header" fn_port "Game" port udp @@ -1045,7 +1045,7 @@ fn_info_message_jc2(){ } | column -s $'\t' -t } -fn_info_message_jc3(){ +fn_info_message_jc3() { { fn_port "header" fn_port "Game" port udp @@ -1055,23 +1055,23 @@ fn_info_message_jc3(){ } | column -s $'\t' -t } -fn_info_message_jk2(){ +fn_info_message_jk2() { { fn_port "header" fn_port "Game" port udp } | column -s $'\t' -t } -fn_info_message_kf(){ +fn_info_message_kf() { { - fn_port "header" - fn_port "Game" port udp - fn_port "Query" queryport udp - fn_port "Query (GameSpy)" queryportgs udp - fn_port "Web Admin" webadminport tcp - fn_port "LAN" lanport udp - fn_port "Steam" steamport udp - fn_port "Steam Master" steammasterport udp + fn_port "header" + fn_port "Game" port udp + fn_port "Query" queryport udp + fn_port "Query (GameSpy)" queryportgs udp + fn_port "Web Admin" webadminport tcp + fn_port "LAN" lanport udp + fn_port "Steam" steamport udp + fn_port "Steam Master" steammasterport udp } | column -s $'\t' -t echo -e "" echo -e "${lightgreen}${servername} Web Admin${default}" @@ -1084,7 +1084,7 @@ fn_info_message_kf(){ } | column -s $'\t' -t } -fn_info_message_kf2(){ +fn_info_message_kf2() { fn_info_message_password_strip { fn_port "header" @@ -1103,7 +1103,7 @@ fn_info_message_kf2(){ } | column -s $'\t' -t } -fn_info_message_lo(){ +fn_info_message_lo() { { fn_port "header" fn_port "Game" port udp @@ -1111,7 +1111,7 @@ fn_info_message_lo(){ } | column -s $'\t' -t } -fn_info_message_mc(){ +fn_info_message_mc() { { fn_port "header" fn_port "Game" port tcp @@ -1120,7 +1120,7 @@ fn_info_message_mc(){ } | column -s $'\t' -t } -fn_info_message_mcb(){ +fn_info_message_mcb() { { fn_port "header" fn_port "Game" port udp @@ -1128,7 +1128,7 @@ fn_info_message_mcb(){ } | column -s $'\t' -t } -fn_info_message_mh(){ +fn_info_message_mh() { { fn_port "header" fn_port "Game" port udp @@ -1137,14 +1137,14 @@ fn_info_message_mh(){ } | column -s $'\t' -t } -fn_info_message_mohaa(){ +fn_info_message_mohaa() { { fn_port "header" fn_port "Game" port udp } | column -s $'\t' -t } -fn_info_message_mom(){ +fn_info_message_mom() { { fn_port "header" fn_port "Game" port udp @@ -1152,7 +1152,7 @@ fn_info_message_mom(){ } | column -s $'\t' -t } -fn_info_message_mta(){ +fn_info_message_mta() { { fn_port "header" fn_port "Game" port udp @@ -1163,7 +1163,7 @@ fn_info_message_mta(){ } | column -s $'\t' -t } -fn_info_message_mumble(){ +fn_info_message_mumble() { { fn_port "header" fn_port "Voice" port udp @@ -1171,7 +1171,7 @@ fn_info_message_mumble(){ } | column -s $'\t' -t } -fn_info_message_onset(){ +fn_info_message_onset() { { fn_port "header" fn_port "Game" port udp @@ -1180,7 +1180,7 @@ fn_info_message_onset(){ } | column -s $'\t' -t } -fn_info_message_pc(){ +fn_info_message_pc() { { fn_port "header" fn_port "Game" port udp @@ -1189,7 +1189,7 @@ fn_info_message_pc(){ } | column -s $'\t' -t } -fn_info_message_pc2(){ +fn_info_message_pc2() { { fn_port "header" fn_port "Game" port udp @@ -1198,7 +1198,7 @@ fn_info_message_pc2(){ } | column -s $'\t' -t } -fn_info_message_pstbs(){ +fn_info_message_pstbs() { { fn_port "header" fn_port "Game" port udp @@ -1207,7 +1207,7 @@ fn_info_message_pstbs(){ } | column -s $'\t' -t } -fn_info_message_pvr(){ +fn_info_message_pvr() { { fn_port "header" fn_port "Game" port udp @@ -1217,7 +1217,7 @@ fn_info_message_pvr(){ } | column -s $'\t' -t } -fn_info_message_pz(){ +fn_info_message_pz() { { fn_port "header" fn_port "Game" port udp @@ -1225,28 +1225,28 @@ fn_info_message_pz(){ } | column -s $'\t' -t } -fn_info_message_qw(){ +fn_info_message_qw() { { fn_port "header" fn_port "Game" port udp } | column -s $'\t' -t } -fn_info_message_q2(){ +fn_info_message_q2() { { fn_port "header" fn_port "Game" port udp } | column -s $'\t' -t } -fn_info_message_q3(){ +fn_info_message_q3() { { fn_port "header" fn_port "Game" port udp } | column -s $'\t' -t } -fn_info_message_ql(){ +fn_info_message_ql() { { fn_port "header" fn_port "Game" port udp @@ -1256,7 +1256,7 @@ fn_info_message_ql(){ } | column -s $'\t' -t } -fn_info_message_ro(){ +fn_info_message_ro() { { fn_port "header" fn_port "Game" port udp @@ -1277,14 +1277,14 @@ fn_info_message_ro(){ } | column -s $'\t' -t } -fn_info_message_rtcw(){ +fn_info_message_rtcw() { { fn_port "header" fn_port "Game" port udp } | column -s $'\t' -t } -fn_info_message_rust(){ +fn_info_message_rust() { { fn_port "header" fn_port "Game" port udp @@ -1294,7 +1294,7 @@ fn_info_message_rust(){ } | column -s $'\t' -t } -fn_info_message_rw(){ +fn_info_message_rw() { { fn_port "header" fn_port "Game" port udp @@ -1310,7 +1310,7 @@ fn_info_message_rw(){ } | column -s $'\t' -t } -fn_info_message_samp(){ +fn_info_message_samp() { { fn_port "header" fn_port "Game" port udp @@ -1318,7 +1318,7 @@ fn_info_message_samp(){ } | column -s $'\t' -t } -fn_info_message_sb(){ +fn_info_message_sb() { { fn_port "header" fn_port "Game" port udp @@ -1327,7 +1327,7 @@ fn_info_message_sb(){ } | column -s $'\t' -t } -fn_info_message_sbots(){ +fn_info_message_sbots() { { fn_port "header" fn_port "Game" port udp @@ -1335,14 +1335,14 @@ fn_info_message_sbots(){ } | column -s $'\t' -t } -fn_info_message_scpsl(){ +fn_info_message_scpsl() { { fn_port "header" fn_port "Game" port tcp } | column -s $'\t' -t } -fn_info_message_sdtd(){ +fn_info_message_sdtd() { fn_info_message_password_strip { fn_port "header" @@ -1371,7 +1371,7 @@ fn_info_message_sdtd(){ } | column -s $'\t' -t } -fn_info_message_sf(){ +fn_info_message_sf() { { fn_port "header" fn_port "Game" port udp @@ -1380,7 +1380,7 @@ fn_info_message_sf(){ } | column -s $'\t' -t } -fn_info_message_sof2(){ +fn_info_message_sof2() { { fn_port "header" fn_port "Game" port udp @@ -1388,7 +1388,7 @@ fn_info_message_sof2(){ } | column -s $'\t' -t } -fn_info_message_sol(){ +fn_info_message_sol() { { fn_port "header" fn_port "Game" port udp @@ -1396,7 +1396,7 @@ fn_info_message_sol(){ fn_port "Files" filesport tcp } | column -s $'\t' -t } -fn_info_message_source(){ +fn_info_message_source() { { fn_port "header" fn_port "Game" port udp @@ -1404,14 +1404,14 @@ fn_info_message_source(){ fn_port "RCON" rconport tcp fn_port "SourceTV" sourcetvport udp # Will not show if unaviable - if [ "${steamport}" == "0" ]||[ -v "${steamport}" ]; then + if [ "${steamport}" == "0" ] || [ -v "${steamport}" ]; then fn_port "Steam" steamport udp fi fn_port "Client" clientport udp } | column -s $'\t' -t } -fn_info_message_spark(){ +fn_info_message_spark() { fn_info_message_password_strip { fn_port "header" @@ -1429,7 +1429,7 @@ fn_info_message_spark(){ } | column -s $'\t' -t } -fn_info_message_squad(){ +fn_info_message_squad() { { fn_port "header" fn_port "Game" port udp @@ -1438,7 +1438,7 @@ fn_info_message_squad(){ } | column -s $'\t' -t } -fn_info_message_st(){ +fn_info_message_st() { { fn_port "header" fn_port "Game" port udp @@ -1453,7 +1453,7 @@ fn_info_message_st(){ } | column -s $'\t' -t } -fn_info_message_ti(){ +fn_info_message_ti() { { fn_port "header" fn_port "Game" port udp @@ -1461,7 +1461,7 @@ fn_info_message_ti(){ } | column -s $'\t' -t } -fn_info_message_ts3(){ +fn_info_message_ts3() { { fn_port "header" fn_port "Voice" port udp @@ -1474,7 +1474,7 @@ fn_info_message_ts3(){ } | column -s $'\t' -t } -fn_info_message_tw(){ +fn_info_message_tw() { { fn_port "header" fn_port "Game" port udp @@ -1482,7 +1482,7 @@ fn_info_message_tw(){ } | column -s $'\t' -t } -fn_info_message_terraria(){ +fn_info_message_terraria() { { fn_port "header" fn_port "Game" port tcp @@ -1490,7 +1490,7 @@ fn_info_message_terraria(){ } | column -s $'\t' -t } -fn_info_message_tu(){ +fn_info_message_tu() { { fn_port "header" fn_port "Game" port udp @@ -1499,7 +1499,7 @@ fn_info_message_tu(){ } | column -s $'\t' -t } -fn_info_message_unreal(){ +fn_info_message_unreal() { fn_info_message_password_strip { fn_port "header" @@ -1519,14 +1519,14 @@ fn_info_message_unreal(){ } | column -s $'\t' -t } -fn_info_message_ut2k4(){ +fn_info_message_ut2k4() { { - fn_port "header" - fn_port "Game" port udp - fn_port "Query" queryport udp - fn_port "Query (GameSpy)" queryportgs udp - fn_port "Web Admin" webadminport tcp - fn_port "LAN" lanport udp + fn_port "header" + fn_port "Game" port udp + fn_port "Query" queryport udp + fn_port "Query (GameSpy)" queryportgs udp + fn_port "Web Admin" webadminport tcp + fn_port "LAN" lanport udp } | column -s $'\t' -t echo -e "" echo -e "${lightgreen}${servername} Web Admin${default}" @@ -1539,7 +1539,7 @@ fn_info_message_ut2k4(){ } | column -s $'\t' -t } -fn_info_message_unreal(){ +fn_info_message_unreal() { fn_info_message_password_strip { fn_port "header" @@ -1559,7 +1559,7 @@ fn_info_message_unreal(){ } | column -s $'\t' -t } -fn_info_message_unt(){ +fn_info_message_unt() { { fn_port "header" fn_port "Game" port udp @@ -1568,7 +1568,7 @@ fn_info_message_unt(){ } | column -s $'\t' -t } -fn_info_message_ut(){ +fn_info_message_ut() { { fn_port "header" fn_port "Game" port udp @@ -1576,7 +1576,7 @@ fn_info_message_ut(){ } | column -s $'\t' -t } -fn_info_message_ut3(){ +fn_info_message_ut3() { fn_info_message_password_strip { fn_port "header" @@ -1595,7 +1595,7 @@ fn_info_message_ut3(){ } | column -s $'\t' -t } -fn_info_message_vh(){ +fn_info_message_vh() { { fn_port "header" fn_port "Game" port udp @@ -1603,14 +1603,14 @@ fn_info_message_vh(){ } | column -s $'\t' -t } -fn_info_message_vints(){ +fn_info_message_vints() { { fn_port "header" fn_port "Game" port tcp } | column -s $'\t' -t } -fn_info_message_wet(){ +fn_info_message_wet() { { fn_port "header" fn_port "Game" port udp @@ -1618,7 +1618,7 @@ fn_info_message_wet(){ } | column -s $'\t' -t } -fn_info_message_wf(){ +fn_info_message_wf() { { fn_port "header" fn_port "Game" port udp @@ -1626,7 +1626,7 @@ fn_info_message_wf(){ } | column -s $'\t' -t } -fn_info_message_wurm(){ +fn_info_message_wurm() { { fn_port "header" fn_port "Game" port tcp @@ -1634,7 +1634,7 @@ fn_info_message_wurm(){ } | column -s $'\t' -t } -fn_info_message_stn(){ +fn_info_message_stn() { { fn_port "header" fn_port "Game" port udp @@ -1642,7 +1642,7 @@ fn_info_message_stn(){ } | column -s $'\t' -t } -fn_info_message_select_engine(){ +fn_info_message_select_engine() { # Display details depending on game or engine. if [ "${shortname}" == "ac" ]; then fn_info_message_ac @@ -1712,7 +1712,7 @@ fn_info_message_select_engine(){ fn_info_message_kf2 elif [ "${shortname}" == "lo" ]; then fn_info_message_lo - elif [ "${shortname}" == "mc" ]||[ "${shortname}" == "pmc" ]||[ "${shortname}" == "wmc" ]; then + elif [ "${shortname}" == "mc" ] || [ "${shortname}" == "pmc" ] || [ "${shortname}" == "wmc" ]; then fn_info_message_mc elif [ "${shortname}" == "mcb" ]; then fn_info_message_mcb @@ -1756,7 +1756,7 @@ fn_info_message_select_engine(){ fn_info_message_sb elif [ "${shortname}" == "sbots" ]; then fn_info_message_sbots - elif [ "${shortname}" == "scpsl" ]||[ "${shortname}" == "scpslsm" ]; then + elif [ "${shortname}" == "scpsl" ] || [ "${shortname}" == "scpslsm" ]; then fn_info_message_scpsl elif [ "${shortname}" == "sdtd" ]; then fn_info_message_sdtd diff --git a/lgsm/functions/info_stats.sh b/lgsm/functions/info_stats.sh index 03bebe420..93c01cf32 100755 --- a/lgsm/functions/info_stats.sh +++ b/lgsm/functions/info_stats.sh @@ -20,7 +20,7 @@ fi # to allow human readable uuid's. # e.g angry_proskuriakova_38a9ef76-4ae3-46a6-a895-7af474831eba -if [ ! -f "${datadir}/uuid-${selfname}.txt" ]||[ ! -f "${datadir}/uuid-install.txt" ]; then +if [ ! -f "${datadir}/uuid-${selfname}.txt" ] || [ ! -f "${datadir}/uuid-install.txt" ]; then # download dictionary words if [ ! -f "${datadir}/name-left.csv" ]; then fn_fetch_file_github "lgsm/data" "name-left.csv" "${datadir}" "nochmodx" "norun" "forcedl" "nohash" @@ -30,7 +30,7 @@ if [ ! -f "${datadir}/uuid-${selfname}.txt" ]||[ ! -f "${datadir}/uuid-install.t fi # generate instance uuid - if [ -n "$(command -v uuidgen 2>/dev/null)" ]; then + if [ -n "$(command -v uuidgen 2> /dev/null)" ]; then uuid="$(uuidgen)" else uuid="$(cat /proc/sys/kernel/random/uuid)" @@ -40,7 +40,7 @@ if [ ! -f "${datadir}/uuid-${selfname}.txt" ]||[ ! -f "${datadir}/uuid-install.t nameright="$(shuf -n 1 "${datadir}/name-right.csv")" echo "instance_${nameleft}_${nameright}_${uuid}" > "${datadir}/uuid-${selfname}.txt" # generate install uuid if missing - if [ ! -f "${datadir}/uuid-install.txt" ];then + if [ ! -f "${datadir}/uuid-install.txt" ]; then echo "${nameleft}_${nameright}_${uuid}" > "${datadir}/uuid-install.txt" fi fi diff --git a/lgsm/functions/install_config.sh b/lgsm/functions/install_config.sh index a7c18b65d..597cc93c0 100755 --- a/lgsm/functions/install_config.sh +++ b/lgsm/functions/install_config.sh @@ -8,7 +8,7 @@ functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" # Checks if server cfg dir exists, creates it if it doesn't. -fn_check_cfgdir(){ +fn_check_cfgdir() { if [ ! -d "${servercfgdir}" ]; then echo -e "creating ${servercfgdir} config directory." fn_script_log_info "creating ${servercfgdir} config directory." @@ -17,7 +17,7 @@ fn_check_cfgdir(){ } # Downloads default configs from Game-Server-Configs repo to lgsm/config-default. -fn_fetch_default_config(){ +fn_fetch_default_config() { echo -e "" echo -e "${lightyellow}Downloading ${gamename} Configs${default}" echo -e "=================================" @@ -31,7 +31,7 @@ fn_fetch_default_config(){ } # Copys default configs from Game-Server-Configs repo to server config location. -fn_default_config_remote(){ +fn_default_config_remote() { for config in "${array_configs[@]}"; do # every config is copied echo -e "copying ${config} config file." @@ -39,10 +39,10 @@ fn_default_config_remote(){ if [ "${config}" == "${servercfgdefault}" ]; then mkdir -p "${servercfgdir}" cp -nv "${lgsmdir}/config-default/config-game/${config}" "${servercfgfullpath}" - elif [ "${shortname}" == "arma3" ]&&[ "${config}" == "${networkcfgdefault}" ]; then + elif [ "${shortname}" == "arma3" ] && [ "${config}" == "${networkcfgdefault}" ]; then mkdir -p "${servercfgdir}" cp -nv "${lgsmdir}/config-default/config-game/${config}" "${networkcfgfullpath}" - elif [ "${shortname}" == "dst" ]&&[ "${config}" == "${clustercfgdefault}" ]; then + elif [ "${shortname}" == "dst" ] && [ "${config}" == "${clustercfgdefault}" ]; then cp -nv "${lgsmdir}/config-default/config-game/${clustercfgdefault}" "${clustercfgfullpath}" else mkdir -p "${servercfgdir}" @@ -53,7 +53,7 @@ fn_default_config_remote(){ } # Copys local default config to server config location. -fn_default_config_local(){ +fn_default_config_local() { echo -e "copying ${servercfgdefault} config file." cp -nv "${servercfgdir}/${servercfgdefault}" "${servercfgfullpath}" fn_sleep_time @@ -62,7 +62,7 @@ fn_default_config_local(){ # Changes some variables within the default configs. # SERVERNAME to LinuxGSM # PASSWORD to random password -fn_set_config_vars(){ +fn_set_config_vars() { if [ -f "${servercfgfullpath}" ]; then random=$(tr -dc A-Za-z0-9_ < /dev/urandom | head -c 8 | xargs) servername="LinuxGSM" @@ -71,9 +71,9 @@ fn_set_config_vars(){ fn_script_log_info "changing hostname." fn_sleep_time # prevents var from being overwritten with the servername. - if grep -q "SERVERNAME=SERVERNAME" "${lgsmdir}/config-default/config-game/${config}" 2>/dev/null; then + if grep -q "SERVERNAME=SERVERNAME" "${lgsmdir}/config-default/config-game/${config}" 2> /dev/null; then sed -i "s/SERVERNAME=SERVERNAME/SERVERNAME=${servername}/g" "${servercfgfullpath}" - elif grep -q "SERVERNAME=\"SERVERNAME\"" "${lgsmdir}/config-default/config-game/${config}" 2>/dev/null; then + elif grep -q "SERVERNAME=\"SERVERNAME\"" "${lgsmdir}/config-default/config-game/${config}" 2> /dev/null; then sed -i "s/SERVERNAME=\"SERVERNAME\"/SERVERNAME=\"${servername}\"/g" "${servercfgfullpath}" else sed -i "s/SERVERNAME/${servername}/g" "${servercfgfullpath}" @@ -94,7 +94,7 @@ fn_set_config_vars(){ } # Changes some variables within the default Don't Starve Together configs. -fn_set_dst_config_vars(){ +fn_set_dst_config_vars() { ## cluster.ini if grep -Fq "SERVERNAME" "${clustercfgfullpath}"; then echo -e "changing server name." @@ -144,7 +144,7 @@ fn_set_dst_config_vars(){ } # Lists local config file locations -fn_list_config_locations(){ +fn_list_config_locations() { echo -e "" echo -e "${lightyellow}Config File Locations${default}" echo -e "=================================" @@ -167,21 +167,21 @@ if [ "${shortname}" == "sdtd" ]; then fn_list_config_locations elif [ "${shortname}" == "ac" ]; then gamedirname="AssettoCorsa" - array_configs+=( server_cfg.ini ) + array_configs+=(server_cfg.ini) fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "ahl" ]; then gamedirname="ActionHalfLife" - array_configs+=( server.cfg ) + array_configs+=(server.cfg) fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "ahl2" ]; then gamedirname="ActionSource" - array_configs+=( server.cfg ) + array_configs+=(server.cfg) fn_fetch_default_config fn_default_config_remote fn_set_config_vars @@ -189,7 +189,7 @@ elif [ "${shortname}" == "ahl2" ]; then elif [ "${shortname}" == "ark" ]; then gamedirname="ARKSurvivalEvolved" fn_check_cfgdir - array_configs+=( GameUserSettings.ini ) + array_configs+=(GameUserSettings.ini) fn_fetch_default_config fn_default_config_remote fn_set_config_vars @@ -197,7 +197,7 @@ elif [ "${shortname}" == "ark" ]; then elif [ "${shortname}" == "arma3" ]; then gamedirname="Arma3" fn_check_cfgdir - array_configs+=( server.cfg network.cfg ) + array_configs+=(server.cfg network.cfg) fn_fetch_default_config fn_default_config_remote fn_set_config_vars @@ -205,21 +205,21 @@ elif [ "${shortname}" == "arma3" ]; then elif [ "${shortname}" == "armar" ]; then gamedirname="ArmaReforger" fn_check_cfgdir - array_configs+=( server.json ) + array_configs+=(server.json) fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "bo" ]; then gamedirname="BallisticOverkill" - array_configs+=( config.txt ) + array_configs+=(config.txt) fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "bo" ]; then gamedirname="BaseDefense" - array_configs+=( server.cfg ) + array_configs+=(server.cfg) fn_fetch_default_config fn_default_config_remote fn_set_config_vars @@ -227,7 +227,7 @@ elif [ "${shortname}" == "bo" ]; then elif [ "${shortname}" == "bt" ]; then gamedirname="Barotrauma" fn_check_cfgdir - array_configs+=( serversettings.xml ) + array_configs+=(serversettings.xml) fn_fetch_default_config fn_default_config_remote fn_set_config_vars @@ -235,133 +235,133 @@ elif [ "${shortname}" == "bt" ]; then elif [ "${shortname}" == "bt1944" ]; then gamedirname="Battalion1944" fn_check_cfgdir - array_configs+=( DefaultGame.ini ) + array_configs+=(DefaultGame.ini) fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "bf1942" ]; then gamedirname="Battlefield1942" - array_configs+=( serversettings.con ) + array_configs+=(serversettings.con) fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "bfv" ]; then gamedirname="BattlefieldVietnam" - array_configs+=( serversettings.con ) + array_configs+=(serversettings.con) fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "bs" ]; then gamedirname="BladeSymphony" - array_configs+=( server.cfg ) + array_configs+=(server.cfg) fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "bb" ]; then gamedirname="BrainBread" - array_configs+=( server.cfg ) + array_configs+=(server.cfg) fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "bb2" ]; then gamedirname="BrainBread2" - array_configs+=( server.cfg ) + array_configs+=(server.cfg) fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "bmdm" ]; then gamedirname="BlackMesa" - array_configs+=( server.cfg ) + array_configs+=(server.cfg) fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "cd" ]; then gamedirname="CraftingDead" - array_configs+=( properties.json ) + array_configs+=(properties.json) fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "cod" ]; then gamedirname="CallOfDuty" - array_configs+=( server.cfg ) + array_configs+=(server.cfg) fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "coduo" ]; then gamedirname="CallOfDutyUnitedOffensive" - array_configs+=( server.cfg ) + array_configs+=(server.cfg) fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "cod2" ]; then gamedirname="CallOfDuty2" - array_configs+=( server.cfg ) + array_configs+=(server.cfg) fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "cod4" ]; then gamedirname="CallOfDuty4" - array_configs+=( server.cfg ) + array_configs+=(server.cfg) fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "codwaw" ]; then gamedirname="CallOfDutyWorldAtWar" - array_configs+=( server.cfg ) + array_configs+=(server.cfg) fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "cc" ]; then gamedirname="CodenameCURE" - array_configs+=( server.cfg ) + array_configs+=(server.cfg) fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "col" ]; then gamedirname="ColonySurvival" - array_configs+=( colserver.json ) + array_configs+=(colserver.json) fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "cs" ]; then gamedirname="CounterStrike" - array_configs+=( server.cfg ) + array_configs+=(server.cfg) fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "cscz" ]; then gamedirname="CounterStrikeConditionZero" - array_configs+=( server.cfg ) + array_configs+=(server.cfg) fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "csgo" ]; then gamedirname="CounterStrikeGlobalOffensive" - array_configs+=( server.cfg ) + array_configs+=(server.cfg) fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "css" ]; then gamedirname="CounterStrikeSource" - array_configs+=( server.cfg ) + array_configs+=(server.cfg) fn_fetch_default_config fn_default_config_remote fn_set_config_vars @@ -369,41 +369,41 @@ elif [ "${shortname}" == "css" ]; then elif [ "${shortname}" == "dayz" ]; then gamedirname="DayZ" fn_check_cfgdir - array_configs+=( server.cfg ) + array_configs+=(server.cfg) fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "dod" ]; then gamedirname="DayOfDefeat" - array_configs+=( server.cfg ) + array_configs+=(server.cfg) fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "dodr" ]; then gamedirname="DayOfDragons" - array_configs+=( Game.ini ) + array_configs+=(Game.ini) fn_fetch_default_config fn_default_config_remote fn_list_config_locations elif [ "${shortname}" == "dods" ]; then gamedirname="DayOfDefeatSource" - array_configs+=( server.cfg ) + array_configs+=(server.cfg) fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "doi" ]; then gamedirname="DayOfInfamy" - array_configs+=( server.cfg ) + array_configs+=(server.cfg) fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "dmc" ]; then gamedirname="DeathmatchClassic" - array_configs+=( server.cfg ) + array_configs+=(server.cfg) fn_fetch_default_config fn_default_config_remote fn_set_config_vars @@ -411,154 +411,154 @@ elif [ "${shortname}" == "dmc" ]; then elif [ "${shortname}" == "dst" ]; then gamedirname="DontStarveTogether" fn_check_cfgdir - array_configs+=( cluster.ini server.ini ) + array_configs+=(cluster.ini server.ini) fn_fetch_default_config fn_default_config_remote fn_set_dst_config_vars fn_list_config_locations elif [ "${shortname}" == "dab" ]; then gamedirname="DoubleActionBoogaloo" - array_configs+=( server.cfg ) + array_configs+=(server.cfg) fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "dys" ]; then gamedirname="Dystopia" - array_configs+=( server.cfg ) + array_configs+=(server.cfg) fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "eco" ]; then gamedirname="Eco" - array_configs+=( Network.eco ) + array_configs+=(Network.eco) fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "etl" ]; then gamedirname="ETLegacy" - array_configs+=( server.cfg ) + array_configs+=(server.cfg) fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "fctr" ]; then gamedirname="Factorio" - array_configs+=( server-settings.json ) + array_configs+=(server-settings.json) fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "fof" ]; then gamedirname="FistfulofFrags" - array_configs+=( server.cfg ) + array_configs+=(server.cfg) fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "gmod" ]; then gamedirname="GarrysMod" - array_configs+=( server.cfg ) + array_configs+=(server.cfg) fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "hldm" ]; then gamedirname="HalfLifeDeathmatch" - array_configs+=( server.cfg ) + array_configs+=(server.cfg) fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "hldms" ]; then gamedirname="HalfLifeDeathmatchSource" - array_configs+=( server.cfg ) + array_configs+=(server.cfg) fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "opfor" ]; then gamedirname="OpposingForce" - array_configs+=( server.cfg ) + array_configs+=(server.cfg) fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "hl2dm" ]; then gamedirname="HalfLife2Deathmatch" - array_configs+=( server.cfg ) + array_configs+=(server.cfg) fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "ins" ]; then gamedirname="Insurgency" - array_configs+=( server.cfg ) + array_configs+=(server.cfg) fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "ios" ]; then gamedirname="IOSoccer" - array_configs+=( server.cfg ) + array_configs+=(server.cfg) fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "jc2" ]; then gamedirname="JustCause2" - array_configs+=( config.lua ) + array_configs+=(config.lua) fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "jc3" ]; then gamedirname="JustCause3" - array_configs+=( config.json ) + array_configs+=(config.json) fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "kf" ]; then gamedirname="KillingFloor" - array_configs+=( Default.ini ) + array_configs+=(Default.ini) fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "l4d" ]; then gamedirname="Left4Dead" - array_configs+=( server.cfg ) + array_configs+=(server.cfg) fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "l4d2" ]; then gamedirname="Left4Dead2" - array_configs+=( server.cfg ) + array_configs+=(server.cfg) fn_fetch_default_config fn_default_config_remote fn_set_config_vars 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_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "mcb" ]; then gamedirname="MinecraftBedrock" - array_configs+=( server.properties ) + array_configs+=(server.properties) fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "mohaa" ]; then gamedirname="MedalOfHonorAlliedAssault" - array_configs+=( server.cfg ) + array_configs+=(server.cfg) fn_fetch_default_config fn_default_config_remote fn_set_config_vars @@ -566,28 +566,28 @@ elif [ "${shortname}" == "mohaa" ]; then elif [ "${shortname}" == "mh" ]; then gamedirname="Mordhau" fn_check_cfgdir - array_configs+=( Game.ini ) + array_configs+=(Game.ini) fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "ns" ]; then gamedirname="NaturalSelection" - array_configs+=( server.cfg ) + array_configs+=(server.cfg) fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "nmrih" ]; then gamedirname="NoMoreRoominHell" - array_configs+=( server.cfg ) + array_configs+=(server.cfg) fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "nd" ]; then gamedirname="NuclearDawn" - array_configs+=( server.cfg ) + array_configs+=(server.cfg) fn_fetch_default_config fn_default_config_remote fn_set_config_vars @@ -595,33 +595,33 @@ elif [ "${shortname}" == "nd" ]; then elif [ "${shortname}" == "mta" ]; then gamedirname="MultiTheftAuto" fn_check_cfgdir - array_configs+=( acl.xml mtaserver.conf vehiclecolors.conf ) + array_configs+=(acl.xml mtaserver.conf vehiclecolors.conf) fn_fetch_default_config fn_default_config_remote 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_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "mumble" ]; then gamedirname="Mumble" - array_configs+=( murmur.ini ) + array_configs+=(murmur.ini) fn_fetch_default_config fn_default_config_remote fn_list_config_locations elif [ "${shortname}" == "pvr" ]; then gamedirname="PavlovVR" fn_check_cfgdir - array_configs+=( Game.ini ) + array_configs+=(Game.ini) fn_fetch_default_config fn_default_config_remote fn_set_config_vars elif [ "${shortname}" == "pvkii" ]; then gamedirname="PiratesVikingandKnightsII" - array_configs+=( server.cfg ) + array_configs+=(server.cfg) fn_fetch_default_config fn_default_config_remote fn_set_config_vars @@ -629,14 +629,14 @@ elif [ "${shortname}" == "pvkii" ]; then elif [ "${shortname}" == "pz" ]; then gamedirname="ProjectZomboid" fn_check_cfgdir - array_configs+=( server.ini ) + array_configs+=(server.ini) fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "pc" ]; then gamedirname="ProjectCars" - array_configs+=( server.cfg ) + array_configs+=(server.cfg) fn_fetch_default_config fn_default_config_remote fn_set_config_vars @@ -647,48 +647,48 @@ elif [ "${shortname}" == "pc2" ]; then fn_list_config_locations elif [ "${shortname}" == "q2" ]; then gamedirname="Quake2" - array_configs+=( server.cfg ) + array_configs+=(server.cfg) fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "q3" ]; then gamedirname="Quake3Arena" - array_configs+=( server.cfg ) + array_configs+=(server.cfg) fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "ql" ]; then gamedirname="QuakeLive" - array_configs+=( server.cfg ) + array_configs+=(server.cfg) fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "jk2" ]; then gamedirname="JediKnightIIJediOutcast" - array_configs+=( server.cfg ) + array_configs+=(server.cfg) fn_fetch_default_config fn_default_config_remote fn_set_config_vars elif [ "${shortname}" == "qw" ]; then gamedirname="QuakeWorld" - array_configs+=( server.cfg ) + array_configs+=(server.cfg) fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "ricochet" ]; then gamedirname="Ricochet" - array_configs+=( server.cfg ) + array_configs+=(server.cfg) fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "rtcw" ]; then gamedirname="ReturnToCastleWolfenstein" - array_configs+=( server.cfg ) + array_configs+=(server.cfg) fn_fetch_default_config fn_default_config_remote fn_set_config_vars @@ -696,124 +696,124 @@ elif [ "${shortname}" == "rtcw" ]; then elif [ "${shortname}" == "rust" ]; then gamedirname="Rust" fn_check_cfgdir - array_configs+=( server.cfg ) + array_configs+=(server.cfg) fn_fetch_default_config fn_default_config_remote 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_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "sf" ]; then gamedirname="Satisfactory" - array_configs+=( GameUserSettings.ini ) + array_configs+=(GameUserSettings.ini) fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "sol" ]; then gamedirname="Soldat" - array_configs+=( soldat.ini ) + array_configs+=(soldat.ini) fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "sof2" ]; then gamedirname="SoldierOfFortune2Gold" - array_configs+=( server.cfg mapcycle.txt) + array_configs+=(server.cfg mapcycle.txt) fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "sfc" ]; then gamedirname="SourceFortsClassic" - array_configs+=( server.cfg ) + array_configs+=(server.cfg) fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations 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_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "sb" ]; then gamedirname="Starbound" - array_configs+=( starbound_server.config ) + array_configs+=(starbound_server.config) fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "st" ]; then gamedirname="Stationeers" - array_configs+=( default.ini ) + array_configs+=(default.ini) fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations 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_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "sven" ]; then gamedirname="SvenCoop" - array_configs+=( server.cfg ) + array_configs+=(server.cfg) fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "tf2" ]; then gamedirname="TeamFortress2" - array_configs+=( server.cfg ) + array_configs+=(server.cfg) fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "tfc" ]; then gamedirname="TeamFortressClassic" - array_configs+=( server.cfg ) + array_configs+=(server.cfg) fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "ti" ]; then gamedirname="TheIsle" - array_configs+=( Game.ini ) + array_configs+=(Game.ini) fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "ts" ]; then gamedirname="TheSpecialists" - array_configs+=( server.cfg ) + array_configs+=(server.cfg) fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "ts3" ]; then gamedirname="TeamSpeak3" - array_configs+=( ts3server.ini ) + array_configs+=(ts3server.ini) fn_fetch_default_config fn_default_config_remote fn_list_config_locations 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_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "terraria" ]; then gamedirname="Terraria" - array_configs+=( serverconfig.txt ) + array_configs+=(serverconfig.txt) fn_fetch_default_config fn_default_config_remote fn_set_config_vars @@ -821,90 +821,90 @@ elif [ "${shortname}" == "terraria" ]; then elif [ "${shortname}" == "tu" ]; then gamedirname="TowerUnite" fn_check_cfgdir - array_configs+=( TowerServer.ini ) + array_configs+=(TowerServer.ini) fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "ut" ]; then gamedirname="UnrealTournament" - array_configs+=( Game.ini Engine.ini ) + array_configs+=(Game.ini Engine.ini) fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "ut2k4" ]; then gamedirname="UnrealTournament2004" - array_configs+=( UT2004.ini ) + array_configs+=(UT2004.ini) fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "ut99" ]; then gamedirname="UnrealTournament99" - array_configs+=( Default.ini ) + array_configs+=(Default.ini) fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "unt" ]; then gamedirname="Unturned" - array_configs+=( Config.json ) + array_configs+=(Config.json) fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "vints" ]; then gamedirname="VintageStory" - array_configs+=( serverconfig.json ) + array_configs+=(serverconfig.json) fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "vs" ]; then gamedirname="VampireSlayer" - array_configs+=( server.cfg ) + array_configs+=(server.cfg) fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "wet" ]; then gamedirname="WolfensteinEnemyTerritory" - array_configs+=( server.cfg ) + array_configs+=(server.cfg) fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "wf" ]; then gamedirname="Warfork" - array_configs+=( server.cfg ) + array_configs+=(server.cfg) fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "wmc" ]; then gamedirname="Waterfall" - array_configs+=( config.yml ) + array_configs+=(config.yml) fn_fetch_default_config fn_default_config_remote fn_set_config_vars elif [ "${shortname}" == "wurm" ]; then gamedirname="WurmUnlimited" - array_configs+=( server.cfg ) + array_configs+=(server.cfg) fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "zmr" ]; then gamedirname="ZombieMasterReborn" - array_configs+=( server.cfg ) + array_configs+=(server.cfg) fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "zps" ]; then gamedirname="ZombiePanicSource" - array_configs+=( server.cfg ) + array_configs+=(server.cfg) fn_fetch_default_config fn_default_config_remote fn_set_config_vars diff --git a/lgsm/functions/install_eula.sh b/lgsm/functions/install_eula.sh index d7c0b0b7a..5b8b4db5d 100755 --- a/lgsm/functions/install_eula.sh +++ b/lgsm/functions/install_eula.sh @@ -9,7 +9,7 @@ functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" if [ "${shortname}" == "ts3" ]; then eulaurl="https://www.teamspeak.com/en/privacy-and-terms" -elif [ "${shortname}" == "mc" ]||[ "${shortname}" == "pmc" ]; then +elif [ "${shortname}" == "mc" ] || [ "${shortname}" == "pmc" ]; then eulaurl="https://account.mojang.com/documents/minecraft_eula" elif [ "${shortname}" == "ut" ]; then eulaurl="https://www.epicgames.com/unrealtournament/unreal-tournament-pre-alpha-test-development-build-eula" @@ -41,7 +41,7 @@ fi if [ "${shortname}" == "ts3" ]; then touch "${executabledir}/.ts3server_license_accepted" -elif [ "${shortname}" == "mc" ]||[ "${shortname}" == "pmc" ]; then +elif [ "${shortname}" == "mc" ] || [ "${shortname}" == "pmc" ]; then touch "${serverfiles}/eula.txt" echo -e "eula=true" > "${serverfiles}/eula.txt" elif [ "${shortname}" == "ut" ]; then diff --git a/lgsm/functions/install_gslt.sh b/lgsm/functions/install_gslt.sh index a8f8065c2..1ae1ef3b0 100755 --- a/lgsm/functions/install_gslt.sh +++ b/lgsm/functions/install_gslt.sh @@ -11,7 +11,7 @@ echo -e "" echo -e "${lightyellow}Game Server Login Token${default}" echo -e "=================================" fn_sleep_time -if [ "${shortname}" == "csgo" ]||[ "${shortname}" == "css" ]||[ "${shortname}" == "nmrih" ]||[ "${shortname}" == "bs" ]; then +if [ "${shortname}" == "csgo" ] || [ "${shortname}" == "css" ] || [ "${shortname}" == "nmrih" ] || [ "${shortname}" == "bs" ]; then echo -e "GSLT is required to run a public ${gamename} server" fn_script_log_info "GSLT is required to run a public ${gamename} server" else diff --git a/lgsm/functions/install_logs.sh b/lgsm/functions/install_logs.sh index 57a41500c..80a55fb94 100755 --- a/lgsm/functions/install_logs.sh +++ b/lgsm/functions/install_logs.sh @@ -59,7 +59,7 @@ if [ "${consolelogdir}" ]; then fi # Create Game logs. -if [ "${gamelogdir}" ]&&[ ! -d "${gamelogdir}" ]; then +if [ "${gamelogdir}" ] && [ ! -d "${gamelogdir}" ]; then echo -en "installing game log dir: ${gamelogdir}..." if ! mkdir -p "${gamelogdir}"; then fn_print_fail_eol_nl diff --git a/lgsm/functions/install_retry.sh b/lgsm/functions/install_retry.sh index 080f864a2..a36b4fb38 100755 --- a/lgsm/functions/install_retry.sh +++ b/lgsm/functions/install_retry.sh @@ -8,7 +8,8 @@ functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" if fn_prompt_yn "Retry install?" Y; then - command_install.sh; core_exit.sh + command_install.sh + core_exit.sh else exitcode=0 core_exit.sh diff --git a/lgsm/functions/install_server_files.sh b/lgsm/functions/install_server_files.sh index 91fb1743a..395d48c68 100755 --- a/lgsm/functions/install_server_files.sh +++ b/lgsm/functions/install_server_files.sh @@ -7,61 +7,196 @@ functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" -fn_install_server_files(){ +fn_install_server_files() { if [ "${shortname}" == "ahl" ]; then - remote_fileurl="http://linuxgsm.download/ActionHalfLife/action_halflife-1.0.tar.xz"; local_filedir="${tmpdir}"; local_filename="action_halflife-1.0.tar.xz"; chmodx="nochmodx" run="norun"; force="noforce"; md5="61d7b79fd714888b6d65944fdaafa94a" + remote_fileurl="http://linuxgsm.download/ActionHalfLife/action_halflife-1.0.tar.xz" + local_filedir="${tmpdir}" + local_filename="action_halflife-1.0.tar.xz" + chmodx="nochmodx" run="norun" + force="noforce" + md5="61d7b79fd714888b6d65944fdaafa94a" elif [ "${shortname}" == "bf1942" ]; then - remote_fileurl="http://linuxgsm.download/BattleField1942/bf1942_lnxded-1.61-hacked-to-1.612.full.tar.xz"; local_filedir="${tmpdir}"; local_filename="bf1942_lnxded-1.61-hacked-to-1.612.full.tar.xz"; chmodx="nochmodx" run="norun"; force="noforce"; md5="4223bf4ed85f5162c24b2cba51249b9e" - elif [ "${shortname}" == "bfv" ];then - remote_fileurl="http://linuxgsm.download/BattlefieldVietnam/bfv_linded-v1.21-20041207_patch.tar.xz"; local_filedir="${tmpdir}"; local_filename="bfv_linded-v1.21-20041207_patch.tar.xz"; chmodx="nochmodx" run="norun"; force="noforce"; md5="e3b4962cdd9d41e23c6fed65101bccde" + remote_fileurl="http://linuxgsm.download/BattleField1942/bf1942_lnxded-1.61-hacked-to-1.612.full.tar.xz" + local_filedir="${tmpdir}" + local_filename="bf1942_lnxded-1.61-hacked-to-1.612.full.tar.xz" + chmodx="nochmodx" run="norun" + force="noforce" + md5="4223bf4ed85f5162c24b2cba51249b9e" + elif [ "${shortname}" == "bfv" ]; then + remote_fileurl="http://linuxgsm.download/BattlefieldVietnam/bfv_linded-v1.21-20041207_patch.tar.xz" + local_filedir="${tmpdir}" + local_filename="bfv_linded-v1.21-20041207_patch.tar.xz" + chmodx="nochmodx" run="norun" + force="noforce" + md5="e3b4962cdd9d41e23c6fed65101bccde" elif [ "${shortname}" == "bb" ]; then - remote_fileurl="http://linuxgsm.download/BrainBread/brainbread-v1.2-linuxserver.tar.xz"; local_filedir="${tmpdir}"; local_filename="brainbread-v1.2-linuxserver.tar.xz"; chmodx="nochmodx" run="norun"; force="noforce"; md5="55f227183b736397806d5b6db6143f15" + remote_fileurl="http://linuxgsm.download/BrainBread/brainbread-v1.2-linuxserver.tar.xz" + local_filedir="${tmpdir}" + local_filename="brainbread-v1.2-linuxserver.tar.xz" + chmodx="nochmodx" run="norun" + force="noforce" + md5="55f227183b736397806d5b6db6143f15" elif [ "${shortname}" == "cod" ]; then - remote_fileurl="http://linuxgsm.download/CallOfDuty/cod-lnxded-1.5b-full.tar.xz"; local_filedir="${tmpdir}"; local_filename="cod-lnxded-1.5-large.tar.xz"; chmodx="nochmodx" run="norun"; force="noforce"; md5="ee0ad1ccbfa1fd27fde01a4a431a5c2f" + remote_fileurl="http://linuxgsm.download/CallOfDuty/cod-lnxded-1.5b-full.tar.xz" + local_filedir="${tmpdir}" + local_filename="cod-lnxded-1.5-large.tar.xz" + chmodx="nochmodx" run="norun" + force="noforce" + md5="ee0ad1ccbfa1fd27fde01a4a431a5c2f" elif [ "${shortname}" == "coduo" ]; then - remote_fileurl="http://linuxgsm.download/CallOfDutyUnitedOffensive/coduo-lnxded-1.51b-full.tar.xz"; local_filedir="${tmpdir}"; local_filename="coduo-lnxded-1.51b-full.tar.xz"; chmodx="nochmodx" run="norun"; force="noforce"; md5="35cabccd67adcda44aaebc59405915b9" + remote_fileurl="http://linuxgsm.download/CallOfDutyUnitedOffensive/coduo-lnxded-1.51b-full.tar.xz" + local_filedir="${tmpdir}" + local_filename="coduo-lnxded-1.51b-full.tar.xz" + chmodx="nochmodx" run="norun" + force="noforce" + md5="35cabccd67adcda44aaebc59405915b9" elif [ "${shortname}" == "cod2" ]; then - remote_fileurl="http://linuxgsm.download/CallOfDuty2/cod2-lnxded-1.3-full.tar.xz"; local_filedir="${tmpdir}"; local_filename="cod2-lnxded-1.3-full.tar.xz"; chmodx="nochmodx" run="norun"; force="noforce"; md5="b8c4c611f01627dd43348e78478a3d41" + remote_fileurl="http://linuxgsm.download/CallOfDuty2/cod2-lnxded-1.3-full.tar.xz" + local_filedir="${tmpdir}" + local_filename="cod2-lnxded-1.3-full.tar.xz" + chmodx="nochmodx" run="norun" + force="noforce" + md5="b8c4c611f01627dd43348e78478a3d41" elif [ "${shortname}" == "cod4" ]; then - remote_fileurl="http://linuxgsm.download/CallOfDuty4/cod4x18_1790_lnxded.tar.xz"; local_filedir="${tmpdir}"; local_filename="cod4x18_1790_lnxded.tar.xz"; chmodx="nochmodx" run="norun"; force="noforce"; md5="30609db2afde09d22498fbab3a427d11" + remote_fileurl="http://linuxgsm.download/CallOfDuty4/cod4x18_1790_lnxded.tar.xz" + local_filedir="${tmpdir}" + local_filename="cod4x18_1790_lnxded.tar.xz" + chmodx="nochmodx" run="norun" + force="noforce" + md5="30609db2afde09d22498fbab3a427d11" elif [ "${shortname}" == "codwaw" ]; then - remote_fileurl="http://linuxgsm.download/CallOfDutyWorldAtWar/codwaw-lnxded-1.7-full.tar.xz"; local_filedir="${tmpdir}"; local_filename="codwaw-lnxded-1.7-full.tar.xz"; chmodx="nochmodx" run="norun"; force="noforce"; md5="2c6be1bb66ea631b9b2e7ae6216c6680" + remote_fileurl="http://linuxgsm.download/CallOfDutyWorldAtWar/codwaw-lnxded-1.7-full.tar.xz" + local_filedir="${tmpdir}" + local_filename="codwaw-lnxded-1.7-full.tar.xz" + chmodx="nochmodx" run="norun" + force="noforce" + md5="2c6be1bb66ea631b9b2e7ae6216c6680" elif [ "${shortname}" == "etl" ]; then - remote_fileurl="http://linuxgsm.download/WolfensteinEnemyTerritory/etlegacy-v2.78.1-i386-et-260b.tar.xz"; local_filedir="${tmpdir}"; local_filename="etlegacy-v2.78.1-i386-et-260b.tar.xz"; chmodx="nochmodx" run="norun"; force="noforce"; md5="7c08b52cb09b30eadb98ea05ef780fc7" + remote_fileurl="http://linuxgsm.download/WolfensteinEnemyTerritory/etlegacy-v2.78.1-i386-et-260b.tar.xz" + local_filedir="${tmpdir}" + local_filename="etlegacy-v2.78.1-i386-et-260b.tar.xz" + chmodx="nochmodx" run="norun" + force="noforce" + md5="7c08b52cb09b30eadb98ea05ef780fc7" elif [ "${shortname}" == "mohaa" ]; then - remote_fileurl="http://linuxgsm.download/MedalofHonorAlliedAssault/moh_revival_v1.12_RC3.5.1.tar.xz"; local_filedir="${tmpdir}"; local_filename="moh_revival_v1.12_RC3.5.1.tar.xz"; chmodx="nochmodx" run="norun"; force="noforce"; md5="7c664538999252eeaf2b6d9949416480" + remote_fileurl="http://linuxgsm.download/MedalofHonorAlliedAssault/moh_revival_v1.12_RC3.5.1.tar.xz" + local_filedir="${tmpdir}" + local_filename="moh_revival_v1.12_RC3.5.1.tar.xz" + chmodx="nochmodx" run="norun" + force="noforce" + md5="7c664538999252eeaf2b6d9949416480" elif [ "${shortname}" == "ns" ]; then - remote_fileurl="http://linuxgsm.download/NaturalSelection/ns_dedicated_server_v32.tar.xz"; local_filedir="${tmpdir}"; local_filename="ns_dedicated_server_v32.tar.xz"; chmodx="nochmodx" run="norun"; force="noforce"; md5="23ec3cadd93d8bb1c475bad5b9cce370" + remote_fileurl="http://linuxgsm.download/NaturalSelection/ns_dedicated_server_v32.tar.xz" + local_filedir="${tmpdir}" + local_filename="ns_dedicated_server_v32.tar.xz" + chmodx="nochmodx" run="norun" + force="noforce" + md5="23ec3cadd93d8bb1c475bad5b9cce370" elif [ "${shortname}" == "q2" ]; then - remote_fileurl="http://linuxgsm.download/Quake2/quake2-3.20-glibc-i386-full-linux2.0.tar.xz"; local_filedir="${tmpdir}"; local_filename="quake2-3.20-glibc-i386-full-linux2.0.tar.xz"; chmodx="nochmodx" run="norun"; force="noforce"; md5="2908164a32d4808bb720f2161f6b0c82" + remote_fileurl="http://linuxgsm.download/Quake2/quake2-3.20-glibc-i386-full-linux2.0.tar.xz" + local_filedir="${tmpdir}" + local_filename="quake2-3.20-glibc-i386-full-linux2.0.tar.xz" + chmodx="nochmodx" run="norun" + force="noforce" + md5="2908164a32d4808bb720f2161f6b0c82" elif [ "${shortname}" == "q3" ]; then - remote_fileurl="http://linuxgsm.download/Quake3/quake3-1.32c-x86-full-linux.tar.xz"; local_filedir="${tmpdir}"; local_filename="quake3-1.32c-x86-full-linux.tar.xz"; chmodx="nochmodx" run="norun"; force="noforce"; md5="b0e26d8919fe9313fb9d8ded2360f3db" + remote_fileurl="http://linuxgsm.download/Quake3/quake3-1.32c-x86-full-linux.tar.xz" + local_filedir="${tmpdir}" + local_filename="quake3-1.32c-x86-full-linux.tar.xz" + chmodx="nochmodx" run="norun" + force="noforce" + md5="b0e26d8919fe9313fb9d8ded2360f3db" elif [ "${shortname}" == "qw" ]; then - remote_fileurl="http://linuxgsm.download/QuakeWorld/nquake.server.linux.190506.full.tar.xz"; local_filedir="${tmpdir}"; local_filename="nquake.server.linux.190506.full.tar.xz"; chmodx="nochmodx" run="norun"; force="noforce"; md5="82055b7d973206c13a606db8ba288d03" + remote_fileurl="http://linuxgsm.download/QuakeWorld/nquake.server.linux.190506.full.tar.xz" + local_filedir="${tmpdir}" + local_filename="nquake.server.linux.190506.full.tar.xz" + chmodx="nochmodx" run="norun" + force="noforce" + md5="82055b7d973206c13a606db8ba288d03" elif [ "${shortname}" == "rtcw" ]; then - remote_fileurl="http://linuxgsm.download/ReturnToCastleWolfenstein/iortcw-1.51c-x86_64-server-linux-20190507.tar.xz"; local_filedir="${tmpdir}"; local_filename="iortcw-1.51c-x86_64-server-linux-20190507.tar.xz"; chmodx="nochmodx" run="norun"; force="noforce"; md5="df6ff664d37dd0d22787848bdb3cac5f" + remote_fileurl="http://linuxgsm.download/ReturnToCastleWolfenstein/iortcw-1.51c-x86_64-server-linux-20190507.tar.xz" + local_filedir="${tmpdir}" + local_filename="iortcw-1.51c-x86_64-server-linux-20190507.tar.xz" + chmodx="nochmodx" run="norun" + force="noforce" + md5="df6ff664d37dd0d22787848bdb3cac5f" elif [ "${shortname}" == "sfc" ]; then - remote_fileurl="http://linuxgsm.download/SourceFortsClassic/SFClassic-1.0-RC7-fix.tar.xz"; local_filedir="${tmpdir}"; local_filename="SFClassic-1.0-RC7-fix.tar.xz"; chmodx="nochmodx" run="norun"; force="noforce"; md5="70077137185700e28fe6bbb6021d12bc" + remote_fileurl="http://linuxgsm.download/SourceFortsClassic/SFClassic-1.0-RC7-fix.tar.xz" + local_filedir="${tmpdir}" + local_filename="SFClassic-1.0-RC7-fix.tar.xz" + chmodx="nochmodx" run="norun" + force="noforce" + md5="70077137185700e28fe6bbb6021d12bc" elif [ "${shortname}" == "sof2" ]; then - remote_fileurl="http://linuxgsm.download/SoldierOfFortune2/sof2gold-1.03.tar.xz"; local_filedir="${tmpdir}"; local_filename="sof2gold-1.03.tar.xz"; chmodx="nochmodx" run="norun"; force="noforce"; md5="201e23bab04207d00ce813d001c483d9" + remote_fileurl="http://linuxgsm.download/SoldierOfFortune2/sof2gold-1.03.tar.xz" + local_filedir="${tmpdir}" + local_filename="sof2gold-1.03.tar.xz" + chmodx="nochmodx" run="norun" + force="noforce" + md5="201e23bab04207d00ce813d001c483d9" elif [ "${shortname}" == "ts" ]; then - remote_fileurl="http://linuxgsm.download/TheSpecialists/ts-3-linux-final.tar.xz"; local_filedir="${tmpdir}"; local_filename="ts-3-linux-final.tar.xz"; chmodx="nochmodx" run="norun"; force="noforce"; md5="3c66ecff6e3644f7ac88015732a0fb93" + remote_fileurl="http://linuxgsm.download/TheSpecialists/ts-3-linux-final.tar.xz" + local_filedir="${tmpdir}" + local_filename="ts-3-linux-final.tar.xz" + chmodx="nochmodx" run="norun" + force="noforce" + md5="3c66ecff6e3644f7ac88015732a0fb93" elif [ "${shortname}" == "ut2k4" ]; then - remote_fileurl="http://linuxgsm.download/UnrealTournament2004/ut2004-server-3369-3-ultimate-linux.tar.xz"; local_filedir="${tmpdir}"; local_filename="ut2004-server-3369-3-ultimate-linux.tar.xz"; chmodx="nochmodx" run="norun"; force="noforce"; md5="9fceaab68554749f4b45be66613b9a15" + remote_fileurl="http://linuxgsm.download/UnrealTournament2004/ut2004-server-3369-3-ultimate-linux.tar.xz" + local_filedir="${tmpdir}" + local_filename="ut2004-server-3369-3-ultimate-linux.tar.xz" + chmodx="nochmodx" run="norun" + force="noforce" + md5="9fceaab68554749f4b45be66613b9a15" elif [ "${shortname}" == "ut99" ]; then - remote_fileurl="http://linuxgsm.download/UnrealTournament99/ut99-server-469b-ultimate-linux.tar.xz"; local_filedir="${tmpdir}"; local_filename="ut99-server-469b-ultimate-linux.tar.xz"; chmodx="nochmodx" run="norun"; force="noforce"; md5="dba3f1122a5e60ee45ece7422fcf78f5" + remote_fileurl="http://linuxgsm.download/UnrealTournament99/ut99-server-469b-ultimate-linux.tar.xz" + local_filedir="${tmpdir}" + local_filename="ut99-server-469b-ultimate-linux.tar.xz" + chmodx="nochmodx" run="norun" + force="noforce" + md5="dba3f1122a5e60ee45ece7422fcf78f5" elif [ "${shortname}" == "ut" ]; then - remote_fileurl="http://linuxgsm.download/UnrealTournament/UnrealTournament-Server-XAN-3525360-Linux.tar.xz"; local_filedir="${tmpdir}"; local_filename="UnrealTournament-Server-XAN-3525360-Linux.tar.xz"; chmodx="noexecute" run="norun"; force="noforce"; md5="41dd92015713a78211eaccf503b72393" + remote_fileurl="http://linuxgsm.download/UnrealTournament/UnrealTournament-Server-XAN-3525360-Linux.tar.xz" + local_filedir="${tmpdir}" + local_filename="UnrealTournament-Server-XAN-3525360-Linux.tar.xz" + chmodx="noexecute" run="norun" + force="noforce" + md5="41dd92015713a78211eaccf503b72393" elif [ "${shortname}" == "ut3" ]; then - remote_fileurl="http://linuxgsm.download/UnrealTournament3/UT3-linux-server-2.1.tar.xz"; local_filedir="${tmpdir}"; local_filename="UT3-linux-server-2.1.tar.xz"; chmodx="nochmodx" run="norun"; force="noforce"; md5="8876cca61e3f83ea08db25208bde6ac6" + remote_fileurl="http://linuxgsm.download/UnrealTournament3/UT3-linux-server-2.1.tar.xz" + local_filedir="${tmpdir}" + local_filename="UT3-linux-server-2.1.tar.xz" + chmodx="nochmodx" run="norun" + force="noforce" + md5="8876cca61e3f83ea08db25208bde6ac6" elif [ "${shortname}" == "vs" ]; then - remote_fileurl="http://linuxgsm.download/VampireSlayer/vs_l-6.0_full.tar.xz"; local_filedir="${tmpdir}"; local_filename="vs_l-6.0_full.tar.xz"; chmodx="nochmodx" run="norun"; force="noforce"; md5="b322f79e0abd31847493c52acf802667" + remote_fileurl="http://linuxgsm.download/VampireSlayer/vs_l-6.0_full.tar.xz" + local_filedir="${tmpdir}" + local_filename="vs_l-6.0_full.tar.xz" + chmodx="nochmodx" run="norun" + force="noforce" + md5="b322f79e0abd31847493c52acf802667" elif [ "${shortname}" == "wet" ]; then - remote_fileurl="http://linuxgsm.download/WolfensteinEnemyTerritory/enemy-territory.260b.tar.xz"; local_filedir="${tmpdir}"; local_filename="enemy-territory.260b.tar.xz"; chmodx="nochmodx" run="norun"; force="noforce"; md5="581a333cc7eacda2f56d5a00fe11eafa" + remote_fileurl="http://linuxgsm.download/WolfensteinEnemyTerritory/enemy-territory.260b.tar.xz" + local_filedir="${tmpdir}" + local_filename="enemy-territory.260b.tar.xz" + chmodx="nochmodx" run="norun" + force="noforce" + md5="581a333cc7eacda2f56d5a00fe11eafa" elif [ "${shortname}" == "samp" ]; then - remote_fileurl="https://files.sa-mp.com/samp037svr_R2-1.tar.gz"; local_filedir="${tmpdir}"; local_filename="samp037svr_R2-1.tar.gz"; chmodx="nochmodx" run="norun"; force="noforce"; md5="93705e165550c97484678236749198a4" + remote_fileurl="https://files.sa-mp.com/samp037svr_R2-1.tar.gz" + local_filedir="${tmpdir}" + local_filename="samp037svr_R2-1.tar.gz" + chmodx="nochmodx" run="norun" + force="noforce" + md5="93705e165550c97484678236749198a4" elif [ "${shortname}" == "zmr" ]; then - remote_fileurl="http://linuxgsm.download/ZombieMasterReborn/zombie_master_reborn_b5_2.tar.xz"; local_filedir="${tmpdir}"; local_filename="zombie_master_reborn_b5_2.tar.xz"; chmodx="nochmodx" run="norun"; force="noforce"; md5="4b9b9832e863d03981a40c26065792a6" + remote_fileurl="http://linuxgsm.download/ZombieMasterReborn/zombie_master_reborn_b5_2.tar.xz" + local_filedir="${tmpdir}" + local_filename="zombie_master_reborn_b5_2.tar.xz" + chmodx="nochmodx" run="norun" + force="noforce" + md5="4b9b9832e863d03981a40c26065792a6" fi fn_fetch_file "${remote_fileurl}" "" "" "" "${local_filedir}" "${local_filename}" "${chmodx}" "${run}" "${forcedl}" "${md5}" fn_dl_extract "${local_filedir}" "${local_filename}" "${serverfiles}" @@ -100,7 +235,7 @@ elif [ "${shortname}" == "jk2" ]; then update_jediknight2.sh elif [ "${shortname}" == "vints" ]; then update_vintagestory.sh -elif [ -z "${appid}" ]||[ "${shortname}" == "ahl" ]||[ "${shortname}" == "bd" ]||[ "${shortname}" == "bb" ]||[ "${shortname}" == "ns" ]||[ "${shortname}" == "sfc" ]||[ "${shortname}" == "ts" ]||[ "${shortname}" == "vs" ]||[ "${shortname}" == "zmr" ]; then +elif [ -z "${appid}" ] || [ "${shortname}" == "ahl" ] || [ "${shortname}" == "bd" ] || [ "${shortname}" == "bb" ] || [ "${shortname}" == "ns" ] || [ "${shortname}" == "sfc" ] || [ "${shortname}" == "ts" ] || [ "${shortname}" == "vs" ] || [ "${shortname}" == "zmr" ]; then if [ "${shortname}" == "ut" ]; then install_eula.sh fi diff --git a/lgsm/functions/install_ts3db.sh b/lgsm/functions/install_ts3db.sh index 07ab7a111..e394296de 100755 --- a/lgsm/functions/install_ts3db.sh +++ b/lgsm/functions/install_ts3db.sh @@ -7,7 +7,7 @@ functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" -fn_install_ts3db_mariadb(){ +fn_install_ts3db_mariadb() { if [ ! -f "${serverfiles}/libts3db_mariadb.so" ]; then echo -e "copying libmariadb.so.2...\c" cp "${serverfiles}/redist/libmariadb.so.2" "${serverfiles}" @@ -34,13 +34,13 @@ fn_install_ts3db_mariadb(){ read -rp "Enter MariaDB socket path: " mariadbsocket { - echo -e "[config]" - echo -e "host='${mariahostname}'" - echo -e "port='${mariaport}'" - echo -e "username='${mariausername}'" - echo -e "password='${mariapassword}'" - echo -e "database='${mariadbname}'" - echo -e "socket='${mariadbsocket}'" + echo -e "[config]" + echo -e "host='${mariahostname}'" + echo -e "port='${mariaport}'" + echo -e "username='${mariausername}'" + echo -e "password='${mariapassword}'" + echo -e "database='${mariadbname}'" + echo -e "socket='${mariadbsocket}'" } >> "${servercfgdir}/ts3db_mariadb.ini" sed -i "s/dbplugin=ts3db_sqlite3/dbplugin=ts3db_mariadb/g" "${servercfgfullpath}" sed -i "s/dbpluginparameter=/dbpluginparameter=ts3db_mariadb.ini/g" "${servercfgfullpath}" @@ -58,7 +58,7 @@ if [ -z "${autoinstall}" ]; then fn_install_ts3db_mariadb fi else -fn_print_information_nl "./${selfname} auto-install is uses sqlite. For MariaDB use ./${selfname} install" + fn_print_information_nl "./${selfname} auto-install is uses sqlite. For MariaDB use ./${selfname} install" fi install_eula.sh diff --git a/lgsm/functions/mods_core.sh b/lgsm/functions/mods_core.sh index 47ac70cb2..7e2d097a7 100755 --- a/lgsm/functions/mods_core.sh +++ b/lgsm/functions/mods_core.sh @@ -17,7 +17,7 @@ modsinstalledlistfullpath="${modsdir}/${modsinstalledlist}" ## Installation. # Download management. -fn_mod_install_files(){ +fn_mod_install_files() { fn_fetch_file "${modurl}" "" "" "" "${modstmpdir}" "${modfilename}" # Check if variable is valid checking if file has been downloaded and exists. if [ ! -f "${modstmpdir}/${modfilename}" ]; then @@ -32,7 +32,7 @@ fn_mod_install_files(){ } # Convert mod files to lowercase if needed. -fn_mod_lowercase(){ +fn_mod_lowercase() { # Checking lowercase settings from mods array definition if [ "${modlowercase}" == "LowercaseOn" ]; then echo -en "converting ${modprettyname} files to lowercase..." @@ -63,13 +63,13 @@ fn_mod_lowercase(){ core_exit.sh fi fi - done < <(find "${extractdir}" -depth -name '*[[:upper:]]*') - fn_print_ok_eol_nl - fi + done < <(find "${extractdir}" -depth -name '*[[:upper:]]*') + fn_print_ok_eol_nl + fi } # Create ${modcommand}-files.txt containing the full extracted file/directory list. -fn_mod_create_filelist(){ +fn_mod_create_filelist() { echo -en "building ${modcommand}-files.txt..." fn_sleep_time # ${modsdir}/${modcommand}-files.txt. @@ -90,7 +90,7 @@ fn_mod_create_filelist(){ } # Copy the mod into serverfiles. -fn_mod_copy_destination(){ +fn_mod_copy_destination() { echo -en "copying ${modprettyname} to ${modinstalldir}..." fn_sleep_time cp -Rf "${extractdir}/." "${modinstalldir}/" @@ -105,7 +105,7 @@ fn_mod_copy_destination(){ } # Add the mod to the installed-mods.txt. -fn_mod_add_list(){ +fn_mod_add_list() { if [ -z "$(sed -n "/^${modcommand}$/p" "${modsinstalledlistfullpath}")" ]; then echo -e "${modcommand}" >> "${modsinstalledlistfullpath}" fn_script_log_info "${modcommand} added to ${modsinstalledlist}" @@ -113,7 +113,7 @@ fn_mod_add_list(){ } # Prevent sensitive directories from being erased upon uninstall by removing them from: ${modcommand}-files.txt. -fn_mod_tidy_files_list(){ +fn_mod_tidy_files_list() { # Check file list validity. fn_check_mod_files_list # Output to the user @@ -126,7 +126,7 @@ fn_mod_tidy_files_list(){ # generate elements to remove from list. removefromlistamount=$(echo -e "${removefromlist}" | awk -F ';' '{ print NF }') # Test all subvalue of "removefromlist" using the ";" separator. - for ((filesindex=1; filesindex < removefromlistamount; filesindex++)); do + for ((filesindex = 1; filesindex < removefromlistamount; filesindex++)); do # Put current file into test variable. removefilevar=$(echo -e "${removefromlist}" | awk -F ';' -v x=${filesindex} '{ print $x }') # Delete line(s) matching exactly. @@ -193,15 +193,15 @@ fn_mod_tidy_files_list(){ ## Information Gathering. # Get details of a mod any (relevant and unique, such as full mod name or install command) value. -fn_mod_get_info(){ +fn_mod_get_info() { # Variable to know when job is done. modinfocommand="0" # Find entry in global array. - for ((index=0; index <= ${#mods_global_array[@]}; index++)); do + for ((index = 0; index <= ${#mods_global_array[@]}; index++)); do # When entry is found. if [ "${mods_global_array[index]}" == "${currentmod}" ]; then # Go back to the previous "MOD" separator. - for ((index=index; index <= ${#mods_global_array[@]}; index--)); do + for ((index = index; index <= ${#mods_global_array[@]}; index--)); do # When "MOD" is found. if [ "${mods_global_array[index]}" == "MOD" ]; then # Get info. @@ -226,31 +226,31 @@ fn_mod_get_info(){ } # Define all variables for a mod at once when index is set to a separator. -fn_mods_define(){ -if [ -z "$index" ]; then - fn_script_log_fatal "index variable not set. Please report an issue." - fn_print_error "index variable not set. Please report an issue." - echo -e "* https://github.com/GameServerManagers/LinuxGSM/issues" - core_exit.sh -fi - modcommand="${mods_global_array[index+1]}" - modprettyname="${mods_global_array[index+2]}" - modurl="${mods_global_array[index+3]}" - modfilename="${mods_global_array[index+4]}" - modsubdirs="${mods_global_array[index+5]}" - modlowercase="${mods_global_array[index+6]}" - modinstalldir="${mods_global_array[index+7]}" - modkeepfiles="${mods_global_array[index+8]}" - modengines="${mods_global_array[index+9]}" - modgames="${mods_global_array[index+10]}" - modexcludegames="${mods_global_array[index+11]}" - modsite="${mods_global_array[index+12]}" - moddescription="${mods_global_array[index+13]}" +fn_mods_define() { + if [ -z "$index" ]; then + fn_script_log_fatal "index variable not set. Please report an issue." + fn_print_error "index variable not set. Please report an issue." + echo -e "* https://github.com/GameServerManagers/LinuxGSM/issues" + core_exit.sh + fi + modcommand="${mods_global_array[index + 1]}" + modprettyname="${mods_global_array[index + 2]}" + modurl="${mods_global_array[index + 3]}" + modfilename="${mods_global_array[index + 4]}" + modsubdirs="${mods_global_array[index + 5]}" + modlowercase="${mods_global_array[index + 6]}" + modinstalldir="${mods_global_array[index + 7]}" + modkeepfiles="${mods_global_array[index + 8]}" + modengines="${mods_global_array[index + 9]}" + modgames="${mods_global_array[index + 10]}" + modexcludegames="${mods_global_array[index + 11]}" + modsite="${mods_global_array[index + 12]}" + moddescription="${mods_global_array[index + 13]}" } # Builds list of installed mods. # using installed-mods.txt grabing mod info from mods_list.sh. -fn_mods_installed_list(){ +fn_mods_installed_list() { fn_mods_count_installed # Set/reset variables. installedmodsline="1" @@ -265,7 +265,7 @@ fn_mods_installed_list(){ # Get mod info to make sure mod exists. fn_mod_get_info # Add the mod to available commands. - installedmodslist+=( "${modcommand}" ) + installedmodslist+=("${modcommand}") # Increment line check. ((installedmodsline++)) done @@ -275,13 +275,13 @@ fn_mods_installed_list(){ } # Loops through mods_global_array to define available mods & provide available commands for mods installation. -fn_mods_available(){ +fn_mods_available() { # First, reset variables. compatiblemodslist=() availablemodscommands=() # Find compatible games. # Find separators through the global array. - for ((index="0"; index <= ${#mods_global_array[@]}; index++)); do + for ((index = "0"; index <= ${#mods_global_array[@]}; index++)); do # If current value is a separator; then. if [ "${mods_global_array[index]}" == "${modseparator}" ]; then # Set mod variables. @@ -291,9 +291,9 @@ fn_mods_available(){ # If game is compatible. if [ "${modcompatibility}" == "1" ]; then # Put it into an array to prepare user output. - compatiblemodslist+=( "${modprettyname}" "${modcommand}" "${modsite}" "${moddescription}" ) + compatiblemodslist+=("${modprettyname}" "${modcommand}" "${modsite}" "${moddescription}") # Keep available commands in an array to make life easier. - availablemodscommands+=( "${modcommand}" ) + availablemodscommands+=("${modcommand}") fi fi done @@ -302,7 +302,7 @@ fn_mods_available(){ ## Mod compatibility check. # Find out if a game is compatible with a mod from a modgames (list of games supported by a mod) variable. -fn_compatible_mod_games(){ +fn_compatible_mod_games() { # Reset test value. modcompatiblegame="0" # If value is set to GAMES (ignore). @@ -310,9 +310,9 @@ fn_compatible_mod_games(){ # How many games we need to test. gamesamount=$(echo -e "${modgames}" | awk -F ';' '{ print NF }') # Test all subvalue of "modgames" using the ";" separator. - for ((gamevarindex=1; gamevarindex < gamesamount; gamevarindex++)); do + for ((gamevarindex = 1; gamevarindex < gamesamount; gamevarindex++)); do # Put current game name into modtest variable. - gamemodtest=$( echo -e "${modgames}" | awk -F ';' -v x=${gamevarindex} '{ print $x }' ) + gamemodtest=$(echo -e "${modgames}" | awk -F ';' -v x=${gamevarindex} '{ print $x }') # If game name matches. if [ "${gamemodtest}" == "${gamename}" ]; then # Mod is compatible. @@ -323,7 +323,7 @@ fn_compatible_mod_games(){ } # Find out if an engine is compatible with a mod from a modengines (list of engines supported by a mod) variable. -fn_compatible_mod_engines(){ +fn_compatible_mod_engines() { # Reset test value. modcompatibleengine="0" # If value is set to ENGINES (ignore). @@ -331,9 +331,9 @@ fn_compatible_mod_engines(){ # How many engines we need to test. enginesamount=$(echo -e "${modengines}" | awk -F ';' '{ print NF }') # Test all subvalue of "modengines" using the ";" separator. - for ((gamevarindex=1; gamevarindex < ${enginesamount}; gamevarindex++)); do + for ((gamevarindex = 1; gamevarindex < ${enginesamount}; gamevarindex++)); do # Put current engine name into modtest variable. - enginemodtest=$( echo -e "${modengines}" | awk -F ';' -v x=${gamevarindex} '{ print $x }' ) + enginemodtest=$(echo -e "${modengines}" | awk -F ';' -v x=${gamevarindex} '{ print $x }') # If engine name matches. if [ "${enginemodtest}" == "${engine}" ]; then # Mod is compatible. @@ -344,7 +344,7 @@ fn_compatible_mod_engines(){ } # Find out if a game is not compatible with a mod from a modnotgames (list of games not supported by a mod) variable. -fn_not_compatible_mod_games(){ +fn_not_compatible_mod_games() { # Reset test value. modeincompatiblegame="0" # If value is set to NOTGAMES (ignore). @@ -352,9 +352,9 @@ fn_not_compatible_mod_games(){ # How many engines we need to test. excludegamesamount=$(echo -e "${modexcludegames}" | awk -F ';' '{ print NF }') # Test all subvalue of "modexcludegames" using the ";" separator. - for ((gamevarindex=1; gamevarindex < excludegamesamount; gamevarindex++)); do + for ((gamevarindex = 1; gamevarindex < excludegamesamount; gamevarindex++)); do # Put current engine name into modtest variable. - excludegamemodtest=$( echo -e "${modexcludegames}" | awk -F ';' -v x=${gamevarindex} '{ print $x }' ) + excludegamemodtest=$(echo -e "${modexcludegames}" | awk -F ';' -v x=${gamevarindex} '{ print $x }') # If engine name matches. if [ "${excludegamemodtest}" == "${gamename}" ]; then # Mod is compatible. @@ -365,14 +365,14 @@ fn_not_compatible_mod_games(){ } # Sums up if a mod is compatible or not with modcompatibility=0/1. -fn_mod_compatible_test(){ +fn_mod_compatible_test() { # Test game and engine compatibility. fn_compatible_mod_games fn_compatible_mod_engines fn_not_compatible_mod_games if [ "${modeincompatiblegame}" == "1" ]; then modcompatibility="0" - elif [ "${modcompatibleengine}" == "1" ]||[ "${modcompatiblegame}" == "1" ]; then + elif [ "${modcompatibleengine}" == "1" ] || [ "${modcompatiblegame}" == "1" ]; then modcompatibility="1" else modcompatibility="0" @@ -382,7 +382,7 @@ fn_mod_compatible_test(){ ## Directory management. # Create mods files and directories if it doesn't exist. -fn_create_mods_dir(){ +fn_create_mods_dir() { # Create lgsm data modsdir. if [ ! -d "${modsdir}" ]; then echo -en "creating LinuxGSM mods data directory ${modsdir}..." @@ -420,7 +420,7 @@ fn_create_mods_dir(){ } # Create tmp download mod directory. -fn_mods_create_tmp_dir(){ +fn_mods_create_tmp_dir() { if [ ! -d "${modstmpdir}" ]; then mkdir -p "${modstmpdir}" exitcode=$? @@ -437,7 +437,7 @@ fn_mods_create_tmp_dir(){ } # Remove the tmp mod download directory when finished. -fn_mods_clear_tmp_dir(){ +fn_mods_clear_tmp_dir() { if [ -d "${modstmpdir}" ]; then echo -en "clearing mod download directory ${modstmpdir}..." rm -fr "${modstmpdir:?}" @@ -459,7 +459,7 @@ fn_mods_clear_tmp_dir(){ } # Counts how many mods were installed. -fn_mods_count_installed(){ +fn_mods_count_installed() { if [ -f "${modsinstalledlistfullpath}" ]; then installedmodscount=$(wc -l < "${modsinstalledlistfullpath}") else @@ -468,7 +468,7 @@ fn_mods_count_installed(){ } # Exits if no mods were installed. -fn_mods_check_installed(){ +fn_mods_check_installed() { # Count installed mods. fn_mods_count_installed # If no mods are found. @@ -482,10 +482,10 @@ fn_mods_check_installed(){ } # Checks that mod files list exists and isn't empty. -fn_check_mod_files_list(){ +fn_check_mod_files_list() { # File list must exist and be valid before any operation on it. if [ -f "${modsdir}/${modcommand}-files.txt" ]; then - # How many lines is the file list. + # How many lines is the file list. modsfilelistsize=$(wc -l < "${modsdir}/${modcommand}-files.txt") # If file list is empty. if [ "${modsfilelistsize}" -eq 0 ]; then @@ -501,7 +501,7 @@ fn_check_mod_files_list(){ fi } -fn_mod_exist(){ +fn_mod_exist() { modreq=$1 # requires one parameter, the mod if [ -f "${modsdir}/${modreq}-files.txt" ]; then @@ -516,7 +516,7 @@ fn_mod_exist(){ fi } -fn_mod_required_fail_exist(){ +fn_mod_required_fail_exist() { modreq=$1 # requires one parameter, the mod fn_script_log_fatal "${modreq}-files.txt is empty: unable to find ${modreq} installed" @@ -525,7 +525,7 @@ fn_mod_required_fail_exist(){ core_exit.sh } -fn_mod_liblist_gam_filenames(){ +fn_mod_liblist_gam_filenames() { # clear variables just in case moddll="" modso="" @@ -537,37 +537,37 @@ fn_mod_liblist_gam_filenames(){ moddll="mp.dll" modso="cs.so" moddylib="cs.dylib" - ;; + ;; "Day of Defeat") moddll="dod.dll" modso="dod.so" moddylib="dod.dylib" - ;; + ;; "Team Fortress Classic") moddll="tfc.dll" modso="tfc.so" moddylib="tfc.dylib" - ;; + ;; "Natural Selection") moddll="ns.dll" modso="ns_i386.so" moddylib="" - ;; + ;; "The Specialists") moddll="mp.dll" modso="ts_i386.so" moddylib="" - ;; + ;; "Half-Life: Deathmatch") moddll="hl.dll" modso="hl.so" moddylib="hl.dylib" - ;; + ;; esac } # modifers for liblist.gam to add/remote metamod binaries -fn_mod_install_liblist_gam_file(){ +fn_mod_install_liblist_gam_file() { fn_mod_liblist_gam_filenames @@ -625,7 +625,7 @@ fn_mod_install_liblist_gam_file(){ fi } -fn_mod_remove_liblist_gam_file(){ +fn_mod_remove_liblist_gam_file() { fn_mod_liblist_gam_filenames @@ -683,7 +683,7 @@ fn_mod_remove_liblist_gam_file(){ fi } -fn_mod_install_amxmodx_file(){ +fn_mod_install_amxmodx_file() { # does plugins.ini exist? if [ -f "${modinstalldir}/addons/metamod/plugins.ini" ]; then # since it does exist, is the entry already in plugins.ini @@ -718,9 +718,9 @@ fn_mod_install_amxmodx_file(){ fi } -fn_mod_remove_amxmodx_file(){ +fn_mod_remove_amxmodx_file() { if [ -f "${modinstalldir}/addons/metamod/plugins.ini" ]; then - # since it does exist, is the entry already in plugins.ini + # since it does exist, is the entry already in plugins.ini logentry="line (linux addons/amxmodx/dlls/amxmodx_mm_i386.so) removed from ${modinstalldir}/addons/metamod/plugins.ini" echo -en "removing amxmodx_mm_i386.so in plugins.ini..." grep -q "linux addons/amxmodx/dlls/amxmodx_mm_i386.so" "${modinstalldir}/addons/metamod/plugins.ini" diff --git a/lgsm/functions/mods_list.sh b/lgsm/functions/mods_list.sh index ed9be2121..8ea31561f 100755 --- a/lgsm/functions/mods_list.sh +++ b/lgsm/functions/mods_list.sh @@ -92,7 +92,7 @@ movementapilatestlink="https://github.com/danzayau/MovementAPI/releases/download # Oxide oxiderustlatestlink=$(curl --connect-timeout 10 -sL https://api.github.com/repos/OxideMod/Oxide.Rust/releases/latest | jq -r '.assets[]|select(.browser_download_url | contains("linux")) | .browser_download_url') oxidehurtworldlatestlink=$(curl --connect-timeout 10 -sL https://api.github.com/repos/OxideMod/Oxide.Hurtworld/releases/latest | jq -r '.assets[].browser_download_url') -oxidesdtdlatestlink=$(curl --connect-timeout 10 -sL https://api.github.com/repos/OxideMod/Oxide.SevenDaysToDie/releases/latest | jq -r '.assets[]|select(.browser_download_url | contains("linux")) | .browser_download_url' ) +oxidesdtdlatestlink=$(curl --connect-timeout 10 -sL https://api.github.com/repos/OxideMod/Oxide.SevenDaysToDie/releases/latest | jq -r '.assets[]|select(.browser_download_url | contains("linux")) | .browser_download_url') # Valheim Plus valeimpluslatestlink=$(curl --connect-timeout 10 -sL https://api.github.com/repos/valheimPlus/ValheimPlus/releases/latest | jq -r '.assets[]|select(.browser_download_url | contains("UnixServer.tar.gz")) | .browser_download_url') @@ -122,77 +122,77 @@ modseparator="MOD" # [13] | "Short Description" a description showed to the user upon installation/removal # Half-life 1 Engine Mods -mod_info_metamod=( MOD "metamod" "Metamod" "${metamodurl}" "${metamodlatestfile}" "0" "LowercaseOff" "${systemdir}" "addons/metamod/plugins.ini;" "ENGINES" "Counter-Strike 1.6;Day of Defeat;Team Fortress Classic;Natural Selection;The Specialists;Half-Life: Deathmatch;" "NOTGAMES" "https://github.com/alliedmodders/metamod-hl1" "Plugins Framework" ) -mod_info_base_amxx=( MOD "amxmodx" "AMX Mod X: Base" "${amxxbaseurl}" "${amxxbaselatestfile}" "0" "LowercaseOff" "${systemdir}" "addons/amxmodx/configs;" "ENGINES" "Counter-Strike 1.6;Day of Defeat;Team Fortress Classic;Natural Selection;The Specialists;Half-Life: Deathmatch;" "NOTGAMES" "https://www.amxmodx.org" "Admin Features (requires Metamod)" ) +mod_info_metamod=(MOD "metamod" "Metamod" "${metamodurl}" "${metamodlatestfile}" "0" "LowercaseOff" "${systemdir}" "addons/metamod/plugins.ini;" "ENGINES" "Counter-Strike 1.6;Day of Defeat;Team Fortress Classic;Natural Selection;The Specialists;Half-Life: Deathmatch;" "NOTGAMES" "https://github.com/alliedmodders/metamod-hl1" "Plugins Framework") +mod_info_base_amxx=(MOD "amxmodx" "AMX Mod X: Base" "${amxxbaseurl}" "${amxxbaselatestfile}" "0" "LowercaseOff" "${systemdir}" "addons/amxmodx/configs;" "ENGINES" "Counter-Strike 1.6;Day of Defeat;Team Fortress Classic;Natural Selection;The Specialists;Half-Life: Deathmatch;" "NOTGAMES" "https://www.amxmodx.org" "Admin Features (requires Metamod)") # CS 1.6 (HL1) Engine Mods -mod_info_cs_amxx=( MOD "amxmodxcs" "AMX Mod X: Counter-Strike" "${amxxcsurl}" "${amxxcslatestfile}" "0" "LowercaseOff" "${systemdir}" "addons/amxmodx/configs;" "ENGINES" "Counter-Strike 1.6;" "NOTGAMES" "https://www.amxmodx.org" "Admin Features (requires Metamod & AMX Mod X: Base)" ) +mod_info_cs_amxx=(MOD "amxmodxcs" "AMX Mod X: Counter-Strike" "${amxxcsurl}" "${amxxcslatestfile}" "0" "LowercaseOff" "${systemdir}" "addons/amxmodx/configs;" "ENGINES" "Counter-Strike 1.6;" "NOTGAMES" "https://www.amxmodx.org" "Admin Features (requires Metamod & AMX Mod X: Base)") # DOD (HL1) Engine Mods -mod_info_dod_amxx=( MOD "amxmodxdod" "AMX Mod X: Day of Defeat" "${amxxdodurl}" "${amxxdodlatestfile}" "0" "LowercaseOff" "${systemdir}" "addons/amxmodx/configs;" "ENGINES" "Day of Defeat;" "NOTGAMES" "https://www.amxmodx.org" "Admin Features (requires Metamod & AMX Mod X: Base)" ) +mod_info_dod_amxx=(MOD "amxmodxdod" "AMX Mod X: Day of Defeat" "${amxxdodurl}" "${amxxdodlatestfile}" "0" "LowercaseOff" "${systemdir}" "addons/amxmodx/configs;" "ENGINES" "Day of Defeat;" "NOTGAMES" "https://www.amxmodx.org" "Admin Features (requires Metamod & AMX Mod X: Base)") # TFC (HL1) Engine Mods -mod_info_tfc_amxx=( MOD "amxmodxtfc" "AMX Mod X: Team Fortress Classic" "${amxxtfcurl}" "${amxxtfclatestfile}" "0" "LowercaseOff" "${systemdir}" "addons/amxmodx/configs;" "ENGINES" "Team Fortress Classic;" "NOTGAMES" "https://www.amxmodx.org" "Admin Features (requires Metamod & AMX Mod X: Base)" ) +mod_info_tfc_amxx=(MOD "amxmodxtfc" "AMX Mod X: Team Fortress Classic" "${amxxtfcurl}" "${amxxtfclatestfile}" "0" "LowercaseOff" "${systemdir}" "addons/amxmodx/configs;" "ENGINES" "Team Fortress Classic;" "NOTGAMES" "https://www.amxmodx.org" "Admin Features (requires Metamod & AMX Mod X: Base)") # NS (Natural Selection) (HL1) Engine Mods -mod_info_ns_amxx=( MOD "amxmodxns" "AMX Mod X: Natural Selection" "${amxxnsurl}" "${amxxnslatestfile}" "0" "LowercaseOff" "${systemdir}" "addons/amxmodx/configs;" "ENGINES" "Natural Selection;" "NOTGAMES" "https://www.amxmodx.org" "Admin Features (requires Metamod & AMX Mod X: Base)" ) +mod_info_ns_amxx=(MOD "amxmodxns" "AMX Mod X: Natural Selection" "${amxxnsurl}" "${amxxnslatestfile}" "0" "LowercaseOff" "${systemdir}" "addons/amxmodx/configs;" "ENGINES" "Natural Selection;" "NOTGAMES" "https://www.amxmodx.org" "Admin Features (requires Metamod & AMX Mod X: Base)") # TS (The Specialists) (HL1) Engine Mods -mod_info_ts_amxx=( MOD "amxmodxts" "AMX Mod X: The Specialists" "${amxxtsurl}" "${amxxtslatestfile}" "0" "LowercaseOff" "${systemdir}" "addons/amxmodx/configs;" "ENGINES" "The Specialists;" "NOTGAMES" "https://www.amxmodx.org" "Admin Features (requires Metamod & AMX Mod X: Base)" ) +mod_info_ts_amxx=(MOD "amxmodxts" "AMX Mod X: The Specialists" "${amxxtsurl}" "${amxxtslatestfile}" "0" "LowercaseOff" "${systemdir}" "addons/amxmodx/configs;" "ENGINES" "The Specialists;" "NOTGAMES" "https://www.amxmodx.org" "Admin Features (requires Metamod & AMX Mod X: Base)") # Source mods -mod_info_metamodsource=( MOD "metamodsource" "Metamod: Source" "${metamodsourceurl}" "${metamodsourcelatestfile}" "0" "LowercaseOff" "${systemdir}" "addons/metamod/metaplugins.ini;" "source;" "GAMES" "NOTGAMES" "https://www.sourcemm.net" "Plugins Framework" ) -mod_info_sourcemod=( MOD "sourcemod" "SourceMod" "${sourcemodurl}" "${sourcemodlatestfile}" "0" "LowercaseOff" "${systemdir}" "cfg;addons/sourcemod/configs;" "source;" "GAMES" "NOTGAMES" "http://www.sourcemod.net" "Admin Features (requires Metamod: Source)" ) -mod_info_steamworks=( MOD "steamworks" "SteamWorks" "${steamworksurl}" "${steamworkslatestfile}" "0" "LowercaseOff" "${systemdir}" "OVERWRITE" "ENGINES" "Counter-Strike: Global Offensive;" "NOTGAMES" "https://github.com/KyleSanderson/SteamWorks" "Exposing SteamWorks functions to SourcePawn" ) -mod_info_stripper=( MOD "stripper" "Stripper Source" "http://www.bailopan.net/stripper/snapshots/1.2/stripper-1.2.2-git129-linux.tar.gz" "stripper-1.2.2-git129-linux.tar.gz" "0" "LowercaseOff" "${systemdir}" "addons/stripper/maps;" "ENGINES" "Counter-Strike: Global Offensive;Counter-Strike: Source;Day of Defeat: Source;Half Life: Deathmatch;Half Life 2: Deathmatch;Insurgency;Left 4 Dead;Left 4 Dead 2;Nuclear Dawn;Team Fortress 2;" "NOTGAMES" "http://www.bailopan.net/stripper/" "Add or remove objects from map (requires MetaMod)") +mod_info_metamodsource=(MOD "metamodsource" "Metamod: Source" "${metamodsourceurl}" "${metamodsourcelatestfile}" "0" "LowercaseOff" "${systemdir}" "addons/metamod/metaplugins.ini;" "source;" "GAMES" "NOTGAMES" "https://www.sourcemm.net" "Plugins Framework") +mod_info_sourcemod=(MOD "sourcemod" "SourceMod" "${sourcemodurl}" "${sourcemodlatestfile}" "0" "LowercaseOff" "${systemdir}" "cfg;addons/sourcemod/configs;" "source;" "GAMES" "NOTGAMES" "http://www.sourcemod.net" "Admin Features (requires Metamod: Source)") +mod_info_steamworks=(MOD "steamworks" "SteamWorks" "${steamworksurl}" "${steamworkslatestfile}" "0" "LowercaseOff" "${systemdir}" "OVERWRITE" "ENGINES" "Counter-Strike: Global Offensive;" "NOTGAMES" "https://github.com/KyleSanderson/SteamWorks" "Exposing SteamWorks functions to SourcePawn") +mod_info_stripper=(MOD "stripper" "Stripper Source" "http://www.bailopan.net/stripper/snapshots/1.2/stripper-1.2.2-git129-linux.tar.gz" "stripper-1.2.2-git129-linux.tar.gz" "0" "LowercaseOff" "${systemdir}" "addons/stripper/maps;" "ENGINES" "Counter-Strike: Global Offensive;Counter-Strike: Source;Day of Defeat: Source;Half Life: Deathmatch;Half Life 2: Deathmatch;Insurgency;Left 4 Dead;Left 4 Dead 2;Nuclear Dawn;Team Fortress 2;" "NOTGAMES" "http://www.bailopan.net/stripper/" "Add or remove objects from map (requires MetaMod)") # CS:GO Mods -mod_info_gokz=( MOD "gokz" "GOKZ" "${gokzlatestlink}" "${gokzlatestfile}" "0" "LowercaseOff" "${systemdir}" "cfg;addons/sourcemod/configs;" "ENGINES" "Counter-Strike: Global Offensive;" "NOTGAMES" "https://github.com/KZGlobalTeam/gokz" "GOKZ ${gokzlatestversion} - Implements the KZ game mode (requires SourceMod and MetaMod)" ) -mod_info_ttt=( MOD "ttt" "Trouble in Terrorist Town" "https://csgottt.com/downloads/ttt-latest-dev-${sourcemodversion}.zip" "ttt-latest.zip" "0" "LowercaseOff" "${systemdir}" "cfg;addons/sourcemod/configs;" "ENGINES" "Counter-Strike: Global Offensive;" "NOTGAMES" "https://github.com/Bara/TroubleinTerroristTown" "Implements the TTT game mode (requires SourceMod and MetaMod)" ) -mod_info_get5=( MOD "get5" "Get 5" "${get5url}" "${get5latestfile}" "0" "LowercaseOff" "${systemdir}" "cfg;addons/sourcemod/configs;" "ENGINES" "Counter-Strike: Global Offensive;" "NOTGAMES" "https://github.com/splewis/get5" "Plugin for competitive matches/scrims (requires SourceMod and MetaMod)" ) -mod_info_prac=( MOD "prac" "csgo practice mode" "${csgopracticelatestlink}" "${csgopracticelatestfile}" "0" "LowercaseOff" "${systemdir}" "cfg;addons/sourcemod/configs;" "ENGINES" "Counter-Strike: Global Offensive;" "NOTGAMES" "https://github.com/splewis/csgo-practice-mode" "Practice Mode is a sourcemod plugin for helping players/teams run practices." ) -mod_info_pug=( MOD "pug" "PUG" "${csgopuglatestlink}" "${csgopuglatestfile}" "0" "LowercaseOff" "${systemdir}" "cfg;addons/sourcemod/configs;" "ENGINES" "Counter-Strike: Global Offensive;" "NOTGAMES" "https://github.com/splewis/csgo-pug-setup" "plugin for setting up private pug/10man games" ) -mod_info_dhook=( MOD "dhook" "dhook" "https://forums.alliedmods.net/attachment.php?attachmentid=190123&d=1625050030" "dhooks-2.2.0d17.zip" "0" "LowercaseOff" "${systemdir}" "cfg;addons/sourcemod/configs;" "ENGINES" "Counter-Strike: Global Offensive;" "NOTGAMES" "https://forums.alliedmods.net/showpost.php?p=2588686&postcount=589" "DHooks 2.2.0 - Required for GOKZ" ) -mod_info_movement=( MOD "movementapi" "movementapi" "${movementapilatestlink}" "${movementapilatestfile}" "0" "LowercaseOff" "${systemdir}" "cfg;addons/sourcemod/configs;" "ENGINES" "Counter-Strike: Global Offensive;" "NOTGAMES" "https://github.com/danzayau/MovementAPI" "Movement API ${movementapilatestversion} - Required for GOKZ" ) -mod_info_cleaner=( MOD "cleaner" "cleaner" "https://github.com/e54385991/console-cleaner/archive/refs/heads/master.zip" "console-cleaner.zip" "0" "LowercaseOff" "${systemdir}" "cfg;addons/sourcemod/configs;" "ENGINES" "Counter-Strike: Global Offensive;" "NOTGAMES" "https://github.com/e54385991/console-cleaner" "Console Cleaner - Optional for GOKZ" ) +mod_info_gokz=(MOD "gokz" "GOKZ" "${gokzlatestlink}" "${gokzlatestfile}" "0" "LowercaseOff" "${systemdir}" "cfg;addons/sourcemod/configs;" "ENGINES" "Counter-Strike: Global Offensive;" "NOTGAMES" "https://github.com/KZGlobalTeam/gokz" "GOKZ ${gokzlatestversion} - Implements the KZ game mode (requires SourceMod and MetaMod)") +mod_info_ttt=(MOD "ttt" "Trouble in Terrorist Town" "https://csgottt.com/downloads/ttt-latest-dev-${sourcemodversion}.zip" "ttt-latest.zip" "0" "LowercaseOff" "${systemdir}" "cfg;addons/sourcemod/configs;" "ENGINES" "Counter-Strike: Global Offensive;" "NOTGAMES" "https://github.com/Bara/TroubleinTerroristTown" "Implements the TTT game mode (requires SourceMod and MetaMod)") +mod_info_get5=(MOD "get5" "Get 5" "${get5url}" "${get5latestfile}" "0" "LowercaseOff" "${systemdir}" "cfg;addons/sourcemod/configs;" "ENGINES" "Counter-Strike: Global Offensive;" "NOTGAMES" "https://github.com/splewis/get5" "Plugin for competitive matches/scrims (requires SourceMod and MetaMod)") +mod_info_prac=(MOD "prac" "csgo practice mode" "${csgopracticelatestlink}" "${csgopracticelatestfile}" "0" "LowercaseOff" "${systemdir}" "cfg;addons/sourcemod/configs;" "ENGINES" "Counter-Strike: Global Offensive;" "NOTGAMES" "https://github.com/splewis/csgo-practice-mode" "Practice Mode is a sourcemod plugin for helping players/teams run practices.") +mod_info_pug=(MOD "pug" "PUG" "${csgopuglatestlink}" "${csgopuglatestfile}" "0" "LowercaseOff" "${systemdir}" "cfg;addons/sourcemod/configs;" "ENGINES" "Counter-Strike: Global Offensive;" "NOTGAMES" "https://github.com/splewis/csgo-pug-setup" "plugin for setting up private pug/10man games") +mod_info_dhook=(MOD "dhook" "dhook" "https://forums.alliedmods.net/attachment.php?attachmentid=190123&d=1625050030" "dhooks-2.2.0d17.zip" "0" "LowercaseOff" "${systemdir}" "cfg;addons/sourcemod/configs;" "ENGINES" "Counter-Strike: Global Offensive;" "NOTGAMES" "https://forums.alliedmods.net/showpost.php?p=2588686&postcount=589" "DHooks 2.2.0 - Required for GOKZ") +mod_info_movement=(MOD "movementapi" "movementapi" "${movementapilatestlink}" "${movementapilatestfile}" "0" "LowercaseOff" "${systemdir}" "cfg;addons/sourcemod/configs;" "ENGINES" "Counter-Strike: Global Offensive;" "NOTGAMES" "https://github.com/danzayau/MovementAPI" "Movement API ${movementapilatestversion} - Required for GOKZ") +mod_info_cleaner=(MOD "cleaner" "cleaner" "https://github.com/e54385991/console-cleaner/archive/refs/heads/master.zip" "console-cleaner.zip" "0" "LowercaseOff" "${systemdir}" "cfg;addons/sourcemod/configs;" "ENGINES" "Counter-Strike: Global Offensive;" "NOTGAMES" "https://github.com/e54385991/console-cleaner" "Console Cleaner - Optional for GOKZ") # Garry's Mod Addons -mod_info_ulib=( MOD "ulib" "ULib" "https://codeload.github.com/TeamUlysses/ulib/zip/master" "ulib-master.zip" "0" "LowercaseOff" "${systemdir}/addons" "OVERWRITE" "ENGINES" "Garry's Mod;" "NOTGAMES" "http://ulyssesmod.net" "Complete Framework" ) -mod_info_ulx=( MOD "ulx" "ULX" "https://codeload.github.com/TeamUlysses/ulx/zip/master" "ulx-master.zip" "0" "LowercaseOff" "${systemdir}/addons" "OVERWRITE" "ENGINES" "Garry's Mod;" "NOTGAMES" "http://ulyssesmod.net" "Admin Panel (requires ULib)" ) -mod_info_utime=( MOD "utime" "UTime" "https://github.com/TeamUlysses/utime/archive/master.zip" "utime-master.zip" "0" "LowercaseOff" "${systemdir}/addons" "OVERWRITE" "ENGINES" "Garry's Mod;" "NOTGAMES" "http://ulyssesmod.net" "Keep track of players play time" ) -mod_info_uclip=( MOD "uclip" "UClip" "https://github.com/TeamUlysses/uclip/archive/master.zip" "uclip-master.zip" "0" "LowercaseOff" "${systemdir}/addons" "OVERWRITE" "ENGINES" "Garry's Mod;" "NOTGAMES" "http://ulyssesmod.net" "An alternative to noclip" ) -mod_info_acf=( MOD "acf" "Armoured Combat Framework" "https://github.com/nrlulz/ACF/archive/master.zip" "acf-master.zip" "0" "LowercaseOn" "${systemdir}/addons" "acf-master/lua/acf/shared/guns;" "ENGINES" "Garry's Mod;" "NOTGAMES" "https://github.com/nrlulz/ACF" "Realistic Wepons & Engines" ) -mod_info_acf_missiles=( MOD "acfmissiles" "ACF Missiles" "https://github.com/Bubbus/ACF-Missiles/archive/master.zip" "acf-missiles-master.zip" "0" "LowercaseOn" "${systemdir}/addons" "OVERWRITE" "ENGINES" "Garry's Mod;" "NOTGAMES" "https://github.com/Bubbus/ACF-Missiles" "More missiles for ACF" ) -mod_info_advdupe2=( MOD "advdupe2" "Advanced Duplicator 2" "https://github.com/wiremod/advdupe2/archive/master.zip" "advdupe2-master.zip" "0" "LowercaseOn" "${systemdir}/addons" "OVERWRITE" "ENGINES" "Garry's Mod;" "NOTGAMES" "http://www.wiremod.com" "Save your constructions. Second version" ) -mod_info_pac3=( MOD "pac3" "PAC3" "https://github.com/CapsAdmin/pac3/archive/master.zip" "pac3-master.zip" "0" "LowercaseOff" "${systemdir}/addons" "OVERWRITE" "ENGINES" "Garry's Mod;" "NOTGAMES" "https://github.com/CapsAdmin/pac3" "Advanced player model customization" ) -mod_info_wiremod=( MOD "wiremod" "Wiremod" "https://github.com/wiremod/wire/archive/master.zip" "wire-master.zip" "0" "LowercaseOff" "${systemdir}/addons" "OVERWRITE" "ENGINES" "Garry's Mod;" "NOTGAMES" "https://github.com/wiremod/wire" "Base Wiremod Addon") -mod_info_wiremodextras=( MOD "wiremod-extras" "Wiremod Extras" "https://github.com/wiremod/wire-extras/archive/master.zip" "wire-extras-master.zip" "0" "LowercaseOff" "${systemdir}/addons" "OVERWRITE" "ENGINES" "Garry's Mod;" "NOTGAMES" "https://github.com/wiremod/wire-extras/" "Addition to Wiremod, Extra Content") -mod_info_advduplicator=( MOD "advdupe1" "Advanced Duplicator 1" "https://github.com/wiremod/advduplicator/archive/master.zip" "advduplicator-master.zip" "0" "LowercaseOn" "${systemdir}/addons" "OVERWRITE" "ENGINES" "Garry's Mod;" "NOTGAMES" "https://github.com/wiremod/advduplicator" "Save your constructions. First version" ) -mod_info_trackassemblytool=( MOD "trackassemblytool" "Track Assembly Tool" "https://github.com/dvdvideo1234/trackassemblytool/archive/master.zip" "trackassemblytool-master.zip" "0" "LowercaseOn" "${systemdir}/addons" "OVERWRITE" "ENGINES" "Garry's Mod;" "NOTGAMES" "https://github.com/dvdvideo1234/TrackAssemblyTool" "Assembles segmented track. Supports wire" ) -mod_info_physpropertiesadv=( MOD "physpropertiesadv" "Phys Properties Adv" "https://github.com/dvdvideo1234/physpropertiesadv/archive/master.zip" "physpropertiesadv-master.zip" "0" "LowercaseOn" "${systemdir}/addons" "OVERWRITE" "ENGINES" "Garry's Mod;" "NOTGAMES" "https://github.com/dvdvideo1234/PhysPropertiesAdv" "Advanced configurable properties" ) -mod_info_controlsystemse2=( MOD "controlsystemse2" "Control Systems E2" "https://github.com/dvdvideo1234/controlsystemse2/archive/master.zip" "controlsystemse2-master.zip" "0" "LowercaseOn" "${systemdir}/addons" "OVERWRITE" "ENGINES" "Garry's Mod;" "NOTGAMES" "https://github.com/dvdvideo1234/ControlSystemsE2" "PID controllers and fast traces for E2. Minor included in wire-extas" ) -mod_info_e2pistontiming=( MOD "e2pistontiming" "E2 Piston Timing" "https://github.com/dvdvideo1234/e2pistontiming/archive/master.zip" "e2pistontiming-master.zip" "0" "LowercaseOn" "${systemdir}/addons" "OVERWRITE" "ENGINES" "Garry's Mod;" "NOTGAMES" "https://github.com/dvdvideo1234/E2PistonTiming" "Routine driven piston engine timings for E2" ) -mod_info_propcannontool=( MOD "propcannontool" "Prop Cannon Tool" "https://github.com/dvdvideo1234/propcannontool/archive/master.zip" "propcannontool-master.zip" "0" "LowercaseOn" "${systemdir}/addons" "OVERWRITE" "ENGINES" "Garry's Mod;" "NOTGAMES" "https://github.com/dvdvideo1234/PropCannonTool" "Cannon entity that can fire props. Supports wire" ) -mod_info_gearassemblytool=( MOD "gearassemblytool" "Gear Assembly Tool" "https://github.com/dvdvideo1234/gearassemblytool/archive/master.zip" "gearassemblytool-master.zip" "0" "LowercaseOn" "${systemdir}/addons" "OVERWRITE" "ENGINES" "Garry's Mod;" "NOTGAMES" "https://github.com/dvdvideo1234/GearAssemblyTool" "Assembles segmented gearbox" ) -mod_info_spinnertool=( MOD "spinnertool" "Spinner Tool" "https://github.com/dvdvideo1234/spinnertool/archive/master.zip" "spinnertool-master.zip" "0" "LowercaseOn" "${systemdir}/addons" "OVERWRITE" "ENGINES" "Garry's Mod;" "NOTGAMES" "https://github.com/dvdvideo1234/SpinnerTool" "Torque lever controlled spinner. Supports wire" ) -mod_info_surfacefrictiontool=( MOD "surfacefrictiontool" "Surface Friction Tool" "https://github.com/dvdvideo1234/surfacefrictiontool/archive/master.zip" "surfacefrictiontool-master.zip" "0" "LowercaseOn" "${systemdir}/addons" "OVERWRITE" "ENGINES" "Garry's Mod;" "NOTGAMES" "https://github.com/dvdvideo1234/SurfaceFrictionTool" "Controls the surface friction of a prop" ) -mod_info_magneticdipole=( MOD "magneticdipole" "Magnetic Dipole" "https://github.com/dvdvideo1234/magneticdipole/archive/master.zip" "magneticdipole-master.zip" "0" "LowercaseOn" "${systemdir}/addons" "OVERWRITE" "ENGINES" "Garry's Mod;" "NOTGAMES" "https://github.com/dvdvideo1234/MagneticDipole" "Magnet entity that runs forces on its poles. Supports wire" ) -mod_info_environmentorganizer=( MOD "environmentorganizer" "Environment Organizer" "https://github.com/dvdvideo1234/environmentorganizer/archive/master.zip" "environmentorganizer-master.zip" "0" "LowercaseOn" "${systemdir}/addons" "OVERWRITE" "ENGINES" "Garry's Mod;" "NOTGAMES" "https://github.com/dvdvideo1234/EnvironmentOrganizer" "Installs routines designed for server settings adjustment" ) -mod_info_precision_alignment=( MOD "precision-alignment" "Precision Alignment" "https://github.com/Mista-Tea/precision-alignment/archive/master.zip" "precision-alignment-master.zip" "0" "LowercaseOn" "${systemdir}/addons" "OVERWRITE" "ENGINES" "Garry's Mod;" "NOTGAMES" "https://github.com/Mista-Tea/precision-alignment" "Creates precise constraints and aligments" ) -mod_info_improved_stacker=( MOD "improved-stacker" "Improved Stacker" "https://github.com/Mista-Tea/improved-stacker/archive/master.zip" "improved-stacker-master.zip" "0" "LowercaseOn" "${systemdir}/addons" "OVERWRITE" "ENGINES" "Garry's Mod;" "NOTGAMES" "https://github.com/Mista-Tea/improved-stacker" "Stacks entities in the direction chosen" ) -mod_info_improved_weight=( MOD "improved-weight" "Improved Weight" "https://github.com/Mista-Tea/improved-weight/archive/master.zip" "improved-weight-master.zip" "0" "LowercaseOn" "${systemdir}/addons" "OVERWRITE" "ENGINES" "Garry's Mod;" "NOTGAMES" "https://github.com/Mista-Tea/improved-weight" "Weight tool but with more features" ) -mod_info_improved_antinoclip=( MOD "improved-antinoclip" "Improved Antinoclip" "https://github.com/Mista-Tea/improved-antinoclip/archive/master.zip" "improved-antinoclip-master.zip" "0" "LowercaseOn" "${systemdir}/addons" "OVERWRITE" "ENGINES" "Garry's Mod;" "NOTGAMES" "https://github.com/Mista-Tea/improved-antinoclip" "Controls clipping trough an object" ) -mod_info_darkrp=( MOD "darkrp" "DarkRP" "https://github.com/FPtje/DarkRP/archive/master.zip" "darkrp-master.zip" "0" "LowercaseOn" "${systemdir}/gamemodes" "OVERWRITE" "ENGINES" "Garry's Mod;" "NOTGAMES" "http://darkrp.com" "Most popular gamemode" ) -mod_info_darkrpmodification=( MOD "darkrpmodification" "DarkRP Modification" "https://github.com/FPtje/darkrpmodification/archive/master.zip" "darkrpmodification-master.zip" "0" "LowercaseOff" "${systemdir}/addons" "NOUPDATE" "ENGINES" "Garry's Mod;" "NOTGAMES" "http://darkrp.com" "Customize DarkRP settings" ) -mod_info_laserstool=( MOD "laserstool" "Laser STool" "https://github.com/dvdvideo1234/laserstool/archive/main.zip" "laserstool-main.zip" "0" "LowercaseOn" "${systemdir}/addons" "OVERWRITE" "ENGINES" "Garry's Mod;" "NOTGAMES" "https://github.com/dvdvideo1234/LaserSTool" "Scripted tool that spawns laser entities, simulates light rays and even kill players" ) +mod_info_ulib=(MOD "ulib" "ULib" "https://codeload.github.com/TeamUlysses/ulib/zip/master" "ulib-master.zip" "0" "LowercaseOff" "${systemdir}/addons" "OVERWRITE" "ENGINES" "Garry's Mod;" "NOTGAMES" "http://ulyssesmod.net" "Complete Framework") +mod_info_ulx=(MOD "ulx" "ULX" "https://codeload.github.com/TeamUlysses/ulx/zip/master" "ulx-master.zip" "0" "LowercaseOff" "${systemdir}/addons" "OVERWRITE" "ENGINES" "Garry's Mod;" "NOTGAMES" "http://ulyssesmod.net" "Admin Panel (requires ULib)") +mod_info_utime=(MOD "utime" "UTime" "https://github.com/TeamUlysses/utime/archive/master.zip" "utime-master.zip" "0" "LowercaseOff" "${systemdir}/addons" "OVERWRITE" "ENGINES" "Garry's Mod;" "NOTGAMES" "http://ulyssesmod.net" "Keep track of players play time") +mod_info_uclip=(MOD "uclip" "UClip" "https://github.com/TeamUlysses/uclip/archive/master.zip" "uclip-master.zip" "0" "LowercaseOff" "${systemdir}/addons" "OVERWRITE" "ENGINES" "Garry's Mod;" "NOTGAMES" "http://ulyssesmod.net" "An alternative to noclip") +mod_info_acf=(MOD "acf" "Armoured Combat Framework" "https://github.com/nrlulz/ACF/archive/master.zip" "acf-master.zip" "0" "LowercaseOn" "${systemdir}/addons" "acf-master/lua/acf/shared/guns;" "ENGINES" "Garry's Mod;" "NOTGAMES" "https://github.com/nrlulz/ACF" "Realistic Wepons & Engines") +mod_info_acf_missiles=(MOD "acfmissiles" "ACF Missiles" "https://github.com/Bubbus/ACF-Missiles/archive/master.zip" "acf-missiles-master.zip" "0" "LowercaseOn" "${systemdir}/addons" "OVERWRITE" "ENGINES" "Garry's Mod;" "NOTGAMES" "https://github.com/Bubbus/ACF-Missiles" "More missiles for ACF") +mod_info_advdupe2=(MOD "advdupe2" "Advanced Duplicator 2" "https://github.com/wiremod/advdupe2/archive/master.zip" "advdupe2-master.zip" "0" "LowercaseOn" "${systemdir}/addons" "OVERWRITE" "ENGINES" "Garry's Mod;" "NOTGAMES" "http://www.wiremod.com" "Save your constructions. Second version") +mod_info_pac3=(MOD "pac3" "PAC3" "https://github.com/CapsAdmin/pac3/archive/master.zip" "pac3-master.zip" "0" "LowercaseOff" "${systemdir}/addons" "OVERWRITE" "ENGINES" "Garry's Mod;" "NOTGAMES" "https://github.com/CapsAdmin/pac3" "Advanced player model customization") +mod_info_wiremod=(MOD "wiremod" "Wiremod" "https://github.com/wiremod/wire/archive/master.zip" "wire-master.zip" "0" "LowercaseOff" "${systemdir}/addons" "OVERWRITE" "ENGINES" "Garry's Mod;" "NOTGAMES" "https://github.com/wiremod/wire" "Base Wiremod Addon") +mod_info_wiremodextras=(MOD "wiremod-extras" "Wiremod Extras" "https://github.com/wiremod/wire-extras/archive/master.zip" "wire-extras-master.zip" "0" "LowercaseOff" "${systemdir}/addons" "OVERWRITE" "ENGINES" "Garry's Mod;" "NOTGAMES" "https://github.com/wiremod/wire-extras/" "Addition to Wiremod, Extra Content") +mod_info_advduplicator=(MOD "advdupe1" "Advanced Duplicator 1" "https://github.com/wiremod/advduplicator/archive/master.zip" "advduplicator-master.zip" "0" "LowercaseOn" "${systemdir}/addons" "OVERWRITE" "ENGINES" "Garry's Mod;" "NOTGAMES" "https://github.com/wiremod/advduplicator" "Save your constructions. First version") +mod_info_trackassemblytool=(MOD "trackassemblytool" "Track Assembly Tool" "https://github.com/dvdvideo1234/trackassemblytool/archive/master.zip" "trackassemblytool-master.zip" "0" "LowercaseOn" "${systemdir}/addons" "OVERWRITE" "ENGINES" "Garry's Mod;" "NOTGAMES" "https://github.com/dvdvideo1234/TrackAssemblyTool" "Assembles segmented track. Supports wire") +mod_info_physpropertiesadv=(MOD "physpropertiesadv" "Phys Properties Adv" "https://github.com/dvdvideo1234/physpropertiesadv/archive/master.zip" "physpropertiesadv-master.zip" "0" "LowercaseOn" "${systemdir}/addons" "OVERWRITE" "ENGINES" "Garry's Mod;" "NOTGAMES" "https://github.com/dvdvideo1234/PhysPropertiesAdv" "Advanced configurable properties") +mod_info_controlsystemse2=(MOD "controlsystemse2" "Control Systems E2" "https://github.com/dvdvideo1234/controlsystemse2/archive/master.zip" "controlsystemse2-master.zip" "0" "LowercaseOn" "${systemdir}/addons" "OVERWRITE" "ENGINES" "Garry's Mod;" "NOTGAMES" "https://github.com/dvdvideo1234/ControlSystemsE2" "PID controllers and fast traces for E2. Minor included in wire-extas") +mod_info_e2pistontiming=(MOD "e2pistontiming" "E2 Piston Timing" "https://github.com/dvdvideo1234/e2pistontiming/archive/master.zip" "e2pistontiming-master.zip" "0" "LowercaseOn" "${systemdir}/addons" "OVERWRITE" "ENGINES" "Garry's Mod;" "NOTGAMES" "https://github.com/dvdvideo1234/E2PistonTiming" "Routine driven piston engine timings for E2") +mod_info_propcannontool=(MOD "propcannontool" "Prop Cannon Tool" "https://github.com/dvdvideo1234/propcannontool/archive/master.zip" "propcannontool-master.zip" "0" "LowercaseOn" "${systemdir}/addons" "OVERWRITE" "ENGINES" "Garry's Mod;" "NOTGAMES" "https://github.com/dvdvideo1234/PropCannonTool" "Cannon entity that can fire props. Supports wire") +mod_info_gearassemblytool=(MOD "gearassemblytool" "Gear Assembly Tool" "https://github.com/dvdvideo1234/gearassemblytool/archive/master.zip" "gearassemblytool-master.zip" "0" "LowercaseOn" "${systemdir}/addons" "OVERWRITE" "ENGINES" "Garry's Mod;" "NOTGAMES" "https://github.com/dvdvideo1234/GearAssemblyTool" "Assembles segmented gearbox") +mod_info_spinnertool=(MOD "spinnertool" "Spinner Tool" "https://github.com/dvdvideo1234/spinnertool/archive/master.zip" "spinnertool-master.zip" "0" "LowercaseOn" "${systemdir}/addons" "OVERWRITE" "ENGINES" "Garry's Mod;" "NOTGAMES" "https://github.com/dvdvideo1234/SpinnerTool" "Torque lever controlled spinner. Supports wire") +mod_info_surfacefrictiontool=(MOD "surfacefrictiontool" "Surface Friction Tool" "https://github.com/dvdvideo1234/surfacefrictiontool/archive/master.zip" "surfacefrictiontool-master.zip" "0" "LowercaseOn" "${systemdir}/addons" "OVERWRITE" "ENGINES" "Garry's Mod;" "NOTGAMES" "https://github.com/dvdvideo1234/SurfaceFrictionTool" "Controls the surface friction of a prop") +mod_info_magneticdipole=(MOD "magneticdipole" "Magnetic Dipole" "https://github.com/dvdvideo1234/magneticdipole/archive/master.zip" "magneticdipole-master.zip" "0" "LowercaseOn" "${systemdir}/addons" "OVERWRITE" "ENGINES" "Garry's Mod;" "NOTGAMES" "https://github.com/dvdvideo1234/MagneticDipole" "Magnet entity that runs forces on its poles. Supports wire") +mod_info_environmentorganizer=(MOD "environmentorganizer" "Environment Organizer" "https://github.com/dvdvideo1234/environmentorganizer/archive/master.zip" "environmentorganizer-master.zip" "0" "LowercaseOn" "${systemdir}/addons" "OVERWRITE" "ENGINES" "Garry's Mod;" "NOTGAMES" "https://github.com/dvdvideo1234/EnvironmentOrganizer" "Installs routines designed for server settings adjustment") +mod_info_precision_alignment=(MOD "precision-alignment" "Precision Alignment" "https://github.com/Mista-Tea/precision-alignment/archive/master.zip" "precision-alignment-master.zip" "0" "LowercaseOn" "${systemdir}/addons" "OVERWRITE" "ENGINES" "Garry's Mod;" "NOTGAMES" "https://github.com/Mista-Tea/precision-alignment" "Creates precise constraints and aligments") +mod_info_improved_stacker=(MOD "improved-stacker" "Improved Stacker" "https://github.com/Mista-Tea/improved-stacker/archive/master.zip" "improved-stacker-master.zip" "0" "LowercaseOn" "${systemdir}/addons" "OVERWRITE" "ENGINES" "Garry's Mod;" "NOTGAMES" "https://github.com/Mista-Tea/improved-stacker" "Stacks entities in the direction chosen") +mod_info_improved_weight=(MOD "improved-weight" "Improved Weight" "https://github.com/Mista-Tea/improved-weight/archive/master.zip" "improved-weight-master.zip" "0" "LowercaseOn" "${systemdir}/addons" "OVERWRITE" "ENGINES" "Garry's Mod;" "NOTGAMES" "https://github.com/Mista-Tea/improved-weight" "Weight tool but with more features") +mod_info_improved_antinoclip=(MOD "improved-antinoclip" "Improved Antinoclip" "https://github.com/Mista-Tea/improved-antinoclip/archive/master.zip" "improved-antinoclip-master.zip" "0" "LowercaseOn" "${systemdir}/addons" "OVERWRITE" "ENGINES" "Garry's Mod;" "NOTGAMES" "https://github.com/Mista-Tea/improved-antinoclip" "Controls clipping trough an object") +mod_info_darkrp=(MOD "darkrp" "DarkRP" "https://github.com/FPtje/DarkRP/archive/master.zip" "darkrp-master.zip" "0" "LowercaseOn" "${systemdir}/gamemodes" "OVERWRITE" "ENGINES" "Garry's Mod;" "NOTGAMES" "http://darkrp.com" "Most popular gamemode") +mod_info_darkrpmodification=(MOD "darkrpmodification" "DarkRP Modification" "https://github.com/FPtje/darkrpmodification/archive/master.zip" "darkrpmodification-master.zip" "0" "LowercaseOff" "${systemdir}/addons" "NOUPDATE" "ENGINES" "Garry's Mod;" "NOTGAMES" "http://darkrp.com" "Customize DarkRP settings") +mod_info_laserstool=(MOD "laserstool" "Laser STool" "https://github.com/dvdvideo1234/laserstool/archive/main.zip" "laserstool-main.zip" "0" "LowercaseOn" "${systemdir}/addons" "OVERWRITE" "ENGINES" "Garry's Mod;" "NOTGAMES" "https://github.com/dvdvideo1234/LaserSTool" "Scripted tool that spawns laser entities, simulates light rays and even kill players") # Oxidemod -mod_info_rustoxide=( MOD "rustoxide" "Oxide for Rust" "${oxiderustlatestlink}" "Oxide.Rust-linux.zip" "0" "LowercaseOff" "${systemdir}" "OVERWRITE" "ENGINES" "Rust;" "NOTGAMES" "https://umod.org/games/rust" "Allows for the use of plugins" ) -mod_info_hwoxide=( MOD "hwoxide" "Oxide for Hurtworld" "${oxidehurtworldlatestlink}" "Oxide.Hurtworld.zip" "0" "LowercaseOff" "${systemdir}" "OVERWRITE" "ENGINES" "Hurtworld;" "NOTGAMES" "https://umod.org/games/hurtworld" "Allows for the use of plugins" ) -mod_info_sdtdoxide=( MOD "sdtdoxide" "Oxide for 7 Days To Die" "${oxidesdtdlatestlink}" "Oxide.SevenDaysToDie.zip" "0" "LowercaseOff" "${systemdir}" "OVERWRITE" "ENGINES" "7 Days To Die;" "NOTGAMES" "https://umod.org/games/7-days-to-die" "Allows for the use of plugins" ) +mod_info_rustoxide=(MOD "rustoxide" "Oxide for Rust" "${oxiderustlatestlink}" "Oxide.Rust-linux.zip" "0" "LowercaseOff" "${systemdir}" "OVERWRITE" "ENGINES" "Rust;" "NOTGAMES" "https://umod.org/games/rust" "Allows for the use of plugins") +mod_info_hwoxide=(MOD "hwoxide" "Oxide for Hurtworld" "${oxidehurtworldlatestlink}" "Oxide.Hurtworld.zip" "0" "LowercaseOff" "${systemdir}" "OVERWRITE" "ENGINES" "Hurtworld;" "NOTGAMES" "https://umod.org/games/hurtworld" "Allows for the use of plugins") +mod_info_sdtdoxide=(MOD "sdtdoxide" "Oxide for 7 Days To Die" "${oxidesdtdlatestlink}" "Oxide.SevenDaysToDie.zip" "0" "LowercaseOff" "${systemdir}" "OVERWRITE" "ENGINES" "7 Days To Die;" "NOTGAMES" "https://umod.org/games/7-days-to-die" "Allows for the use of plugins") # ValheimPlus -mod_info_valheimplus=( MOD "valheimplus" "Valheim PLUS" "${valeimpluslatestlink}" "ValheimPlus.tar.gz" "0" "LowercaseOff" "${systemdir}" "OVERWRITE" "ENGINES" "Valheim;" "NOTGAMES" "https://github.com/valheimPlus/ValheimPlus" "Mod to improve Valheim gameplay") +mod_info_valheimplus=(MOD "valheimplus" "Valheim PLUS" "${valeimpluslatestlink}" "ValheimPlus.tar.gz" "0" "LowercaseOff" "${systemdir}" "OVERWRITE" "ENGINES" "Valheim;" "NOTGAMES" "https://github.com/valheimPlus/ValheimPlus" "Mod to improve Valheim gameplay") # REQUIRED: Set all mods info into the global array -mods_global_array=( "${mod_info_metamod[@]}" "${mod_info_base_amxx[@]}" "${mod_info_cs_amxx[@]}" "${mod_info_dod_amxx[@]}" "${mod_info_tfc_amxx[@]}" "${mod_info_ns_amxx[@]}" "${mod_info_ts_amxx[@]}" "${mod_info_metamodsource[@]}" "${mod_info_sourcemod[@]}" "${mod_info_steamworks[@]}" "${mod_info_gokz[@]}" "${mod_info_ttt[@]}" "${mod_info_get5[@]}" "${mod_info_prac[@]}" "${mod_info_pug[@]}" "${mod_info_dhook[@]}" "${mod_info_movement[@]}" "${mod_info_cleaner[@]}" "${mod_info_ulib[@]}" "${mod_info_ulx[@]}" "${mod_info_utime[@]}" "${mod_info_uclip[@]}" "${mod_info_acf[@]}" "${mod_info_acf_missiles[@]}" "${mod_info_acf_sweps[@]}" "${mod_info_advdupe2[@]}" "${mod_info_pac3[@]}" "${mod_info_wiremod[@]}" "${mod_info_wiremodextras[@]}" "${mod_info_darkrp[@]}" "${mod_info_darkrpmodification[@]}" "${mod_info_rustoxide[@]}" "${mod_info_hwoxide[@]}" "${mod_info_sdtdoxide[@]}" "${mod_info_advduplicator[@]}" "${mod_info_trackassemblytool[@]}" "${mod_info_physpropertiesadv[@]}" "${mod_info_controlsystemse2[@]}" "${mod_info_e2pistontiming[@]}" "${mod_info_propcannontool[@]}" "${mod_info_gearassemblytool[@]}" "${mod_info_spinnertool[@]}" "${mod_info_surfacefrictiontool[@]}" "${mod_info_magneticdipole[@]}" "${mod_info_environmentorganizer[@]}" "${mod_info_precision_alignment[@]}" "${mod_info_improved_stacker[@]}" "${mod_info_improved_weight[@]}" "${mod_info_improved_antinoclip[@]}" "${mod_info_laserstool[@]}" "${mod_info_valheimplus[@]}" ) +mods_global_array=("${mod_info_metamod[@]}" "${mod_info_base_amxx[@]}" "${mod_info_cs_amxx[@]}" "${mod_info_dod_amxx[@]}" "${mod_info_tfc_amxx[@]}" "${mod_info_ns_amxx[@]}" "${mod_info_ts_amxx[@]}" "${mod_info_metamodsource[@]}" "${mod_info_sourcemod[@]}" "${mod_info_steamworks[@]}" "${mod_info_gokz[@]}" "${mod_info_ttt[@]}" "${mod_info_get5[@]}" "${mod_info_prac[@]}" "${mod_info_pug[@]}" "${mod_info_dhook[@]}" "${mod_info_movement[@]}" "${mod_info_cleaner[@]}" "${mod_info_ulib[@]}" "${mod_info_ulx[@]}" "${mod_info_utime[@]}" "${mod_info_uclip[@]}" "${mod_info_acf[@]}" "${mod_info_acf_missiles[@]}" "${mod_info_acf_sweps[@]}" "${mod_info_advdupe2[@]}" "${mod_info_pac3[@]}" "${mod_info_wiremod[@]}" "${mod_info_wiremodextras[@]}" "${mod_info_darkrp[@]}" "${mod_info_darkrpmodification[@]}" "${mod_info_rustoxide[@]}" "${mod_info_hwoxide[@]}" "${mod_info_sdtdoxide[@]}" "${mod_info_advduplicator[@]}" "${mod_info_trackassemblytool[@]}" "${mod_info_physpropertiesadv[@]}" "${mod_info_controlsystemse2[@]}" "${mod_info_e2pistontiming[@]}" "${mod_info_propcannontool[@]}" "${mod_info_gearassemblytool[@]}" "${mod_info_spinnertool[@]}" "${mod_info_surfacefrictiontool[@]}" "${mod_info_magneticdipole[@]}" "${mod_info_environmentorganizer[@]}" "${mod_info_precision_alignment[@]}" "${mod_info_improved_stacker[@]}" "${mod_info_improved_weight[@]}" "${mod_info_improved_antinoclip[@]}" "${mod_info_laserstool[@]}" "${mod_info_valheimplus[@]}") diff --git a/lgsm/functions/query_gamedig.sh b/lgsm/functions/query_gamedig.sh index 32b70aac2..43f748bcc 100755 --- a/lgsm/functions/query_gamedig.sh +++ b/lgsm/functions/query_gamedig.sh @@ -9,7 +9,7 @@ functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" # Check if gamedig and jq are installed. -if [ "$(command -v gamedig 2>/dev/null)" ]&&[ "$(command -v jq 2>/dev/null)" ]; then +if [ "$(command -v gamedig 2> /dev/null)" ] && [ "$(command -v jq 2> /dev/null)" ]; then # will bypass query if server offline. check_status.sh @@ -49,7 +49,7 @@ if [ "$(command -v gamedig 2>/dev/null)" ]&&[ "$(command -v jq 2>/dev/null)" ]; fi if [ "${gdplayers}" == "null" ]; then unset gdplayers - elif [ "${gdplayers}" == "[]" ]||[ "${gdplayers}" == "-1" ]; then + elif [ "${gdplayers}" == "[]" ] || [ "${gdplayers}" == "-1" ]; then gdplayers=0 fi @@ -75,7 +75,7 @@ if [ "$(command -v gamedig 2>/dev/null)" ]&&[ "$(command -v jq 2>/dev/null)" ]; # numbots. gdbots=$(echo "${gamedigraw}" | jq -re '.bots | length') - if [ "${gdbots}" == "null" ]||[ "${gdbots}" == "0" ]; then + if [ "${gdbots}" == "null" ] || [ "${gdbots}" == "0" ]; then unset gdbots fi @@ -86,7 +86,7 @@ if [ "$(command -v gamedig 2>/dev/null)" ]&&[ "$(command -v jq 2>/dev/null)" ]; gdversion=$(echo "${gamedigraw}" | jq -re '.raw.version') fi - if [ "${gdversion}" == "null" ]||[ "${gdversion}" == "0" ]; then + if [ "${gdversion}" == "null" ] || [ "${gdversion}" == "0" ]; then unset gdversion fi fi diff --git a/lgsm/functions/update_factorio.sh b/lgsm/functions/update_factorio.sh index 47ccefe1b..2c8bf0d01 100644 --- a/lgsm/functions/update_factorio.sh +++ b/lgsm/functions/update_factorio.sh @@ -7,7 +7,7 @@ functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" -fn_update_factorio_dl(){ +fn_update_factorio_dl() { fn_fetch_file "https://factorio.com/get-download/${downloadbranch}/headless/${factorioarch}" "" "" "" "${tmpdir}" "factorio_headless_${factorioarch}-${remotebuild}.tar.xz" "" "norun" "noforce" "nohash" fn_dl_extract "${tmpdir}" "factorio_headless_${factorioarch}-${remotebuild}.tar.xz" "${tmpdir}" echo -e "copying to ${serverfiles}...\c" @@ -25,7 +25,7 @@ fn_update_factorio_dl(){ fi } -fn_update_factorio_localbuild(){ +fn_update_factorio_localbuild() { # Gets local build info. fn_print_dots "Checking local build: ${remotelocation}" # Uses executable to find local build. @@ -41,13 +41,13 @@ fn_update_factorio_localbuild(){ fi } -fn_update_factorio_remotebuild(){ +fn_update_factorio_remotebuild() { # Gets remote build info. remotebuild=$(curl -s "https://factorio.com/get-download/${downloadbranch}/headless/${factorioarch}" | grep -o '[0-9]\.[0-9]\{1,\}\.[0-9]\{1,\}' | head -1) if [ "${firstcommandname}" != "INSTALL" ]; then fn_print_dots "Checking remote build: ${remotelocation}" # Checks if remotebuild variable has been set. - if [ -z "${remotebuild}" ]||[ "${remotebuild}" == "null" ]; then + if [ -z "${remotebuild}" ] || [ "${remotebuild}" == "null" ]; then fn_print_fail "Checking remote build: ${remotelocation}" fn_script_log_fatal "Checking remote build" core_exit.sh @@ -57,7 +57,7 @@ fn_update_factorio_remotebuild(){ fi else # Checks if remotebuild variable has been set. - if [ -z "${remotebuild}" ]||[ "${remotebuild}" == "null" ]; then + if [ -z "${remotebuild}" ] || [ "${remotebuild}" == "null" ]; then fn_print_failure "Unable to get remote build" fn_script_log_fatal "Unable to get remote build" core_exit.sh @@ -65,13 +65,13 @@ fn_update_factorio_remotebuild(){ fi } -fn_update_factorio_compare(){ +fn_update_factorio_compare() { fn_print_dots "Checking for update: ${remotelocation}" # Removes dots so if statement can compare version numbers. fn_print_dots "Checking for update: ${remotelocation}" localbuilddigit=$(echo -e "${localbuild}" | tr -cd '[:digit:]') remotebuilddigit=$(echo -e "${remotebuild}" | tr -cd '[:digit:]') - if [ "${localbuilddigit}" -ne "${remotebuilddigit}" ]||[ "${forceupdate}" == "1" ]; then + if [ "${localbuilddigit}" -ne "${remotebuilddigit}" ] || [ "${forceupdate}" == "1" ]; then fn_print_ok_nl "Checking for update: ${remotelocation}" echo -en "\n" echo -e "Update available" diff --git a/lgsm/functions/update_jediknight2.sh b/lgsm/functions/update_jediknight2.sh index 3a3c40f14..421bc543f 100644 --- a/lgsm/functions/update_jediknight2.sh +++ b/lgsm/functions/update_jediknight2.sh @@ -7,7 +7,7 @@ functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" -fn_update_jk2_dl(){ +fn_update_jk2_dl() { fn_fetch_file "https://github.com/mvdevs/jk2mv/releases/download/${remotebuild}/jk2mv-v${remotebuild}-dedicated.zip" "" "" "" "${tmpdir}" "jk2mv-${remotebuild}-dedicated.zip" "" "norun" "noforce" "nohash" fn_dl_extract "${tmpdir}" "jk2mv-${remotebuild}-dedicated.zip" "${tmpdir}/jk2mv-v${remotebuild}-dedicated" echo -e "copying to ${serverfiles}...\c" @@ -24,13 +24,13 @@ fn_update_jk2_dl(){ fi } -fn_update_jk2_localbuild(){ +fn_update_jk2_localbuild() { # Gets local build info. fn_print_dots "Checking local build: ${remotelocation}" # Uses log file to gather info. # Log is generated and cleared on startup but filled on shutdown. requirerestart=1 - localbuild=$(grep "\"version\"" "${consolelogdir}"/* 2>/dev/null | sed 's/.*://' | awk '{print $1}' | head -n 1) + localbuild=$(grep "\"version\"" "${consolelogdir}"/* 2> /dev/null | sed 's/.*://' | awk '{print $1}' | head -n 1) if [ -z "${localbuild}" ]; then fn_print_error "Checking local build: ${remotelocation}" fn_print_error_nl "Checking local build: ${remotelocation}: no log files containing version info" @@ -57,7 +57,7 @@ fn_update_jk2_localbuild(){ fi if [ -z "${localbuild}" ]; then - localbuild=$(grep Version "$(ls -tr "${consolelogdir}"/* 2>/dev/null)" | tail -1 | sed 's/.*Version //') + localbuild=$(grep Version "$(ls -tr "${consolelogdir}"/* 2> /dev/null)" | tail -1 | sed 's/.*Version //') fi if [ -z "${localbuild}" ]; then @@ -71,13 +71,13 @@ fn_update_jk2_localbuild(){ fi } -fn_update_jk2_remotebuild(){ +fn_update_jk2_remotebuild() { # Gets remote build info. remotebuild=$(curl -s "https://api.github.com/repos/mvdevs/jk2mv/releases/latest" | grep dedicated.zip | tail -1 | awk -F"/" '{ print $8 }') if [ "${firstcommandname}" != "INSTALL" ]; then fn_print_dots "Checking remote build: ${remotelocation}" # Checks if remotebuild variable has been set. - if [ -z "${remotebuild}" ]||[ "${remotebuild}" == "null" ]; then + if [ -z "${remotebuild}" ] || [ "${remotebuild}" == "null" ]; then fn_print_fail "Checking remote build: ${remotelocation}" fn_script_log_fatal "Checking remote build" core_exit.sh @@ -87,7 +87,7 @@ fn_update_jk2_remotebuild(){ fi else # Checks if remotebuild variable has been set. - if [ -z "${remotebuild}" ]||[ "${remotebuild}" == "null" ]; then + if [ -z "${remotebuild}" ] || [ "${remotebuild}" == "null" ]; then fn_print_failure "Unable to get remote build" fn_script_log_fatal "Unable to get remote build" core_exit.sh @@ -95,12 +95,12 @@ fn_update_jk2_remotebuild(){ fi } -fn_update_jk2_compare(){ +fn_update_jk2_compare() { # Removes dots so if statement can compare version numbers. fn_print_dots "Checking for update: ${remotelocation}" localbuilddigit=$(echo -e "${localbuild}" | tr -cd '[:digit:]') remotebuilddigit=$(echo -e "${remotebuild}" | tr -cd '[:digit:]') - if [ "${localbuilddigit}" -ne "${remotebuilddigit}" ]||[ "${forceupdate}" == "1" ]; then + if [ "${localbuilddigit}" -ne "${remotebuilddigit}" ] || [ "${forceupdate}" == "1" ]; then fn_print_ok_nl "Checking for update: ${remotelocation}" echo -en "\n" echo -e "Update available" diff --git a/lgsm/functions/update_minecraft.sh b/lgsm/functions/update_minecraft.sh index 63a2fd51c..d20b98ef4 100644 --- a/lgsm/functions/update_minecraft.sh +++ b/lgsm/functions/update_minecraft.sh @@ -7,7 +7,7 @@ functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" -fn_update_minecraft_dl(){ +fn_update_minecraft_dl() { # Generate link to version manifest json. remotebuildlink=$(curl -s "https://launchermeta.${remotelocation}/mc/game/version_manifest.json" | jq -r --arg branch ${branch} --arg mcversion ${remotebuild} '.versions | .[] | select(.type==$branch and .id==$mcversion) | .url') # Generate link to server.jar @@ -30,7 +30,7 @@ fn_update_minecraft_dl(){ fi } -fn_update_minecraft_localbuild(){ +fn_update_minecraft_localbuild() { # Gets local build info. fn_print_dots "Checking local build: ${remotelocation}" # Uses executable to find local build. @@ -46,7 +46,7 @@ fn_update_minecraft_localbuild(){ fi } -fn_update_minecraft_remotebuild(){ +fn_update_minecraft_remotebuild() { # Gets remote build info. # Latest release. if [ "${branch}" == "release" ] && [ "${mcversion}" == "latest" ]; then @@ -62,7 +62,7 @@ fn_update_minecraft_remotebuild(){ if [ "${firstcommandname}" != "INSTALL" ]; then fn_print_dots "Checking remote build: ${remotelocation}" # Checks if remotebuild variable has been set. - if [ -z "${remotebuild}" ]||[ "${remotebuild}" == "null" ]; then + if [ -z "${remotebuild}" ] || [ "${remotebuild}" == "null" ]; then fn_print_fail "Checking remote build: ${remotelocation}" fn_script_log_fatal "Checking remote build" core_exit.sh @@ -72,7 +72,7 @@ fn_update_minecraft_remotebuild(){ fi else # Checks if remotebuild variable has been set. - if [ -z "${remotebuild}" ]||[ "${remotebuild}" == "null" ]; then + if [ -z "${remotebuild}" ] || [ "${remotebuild}" == "null" ]; then fn_print_failure "Unable to get remote build" fn_script_log_fatal "Unable to get remote build" core_exit.sh @@ -80,10 +80,10 @@ fn_update_minecraft_remotebuild(){ fi } -fn_update_minecraft_compare(){ +fn_update_minecraft_compare() { # Removes dots so if statement can compare version numbers. fn_print_dots "Checking for update: ${remotelocation}" - if [ "${localbuild}" != "${remotebuild}" ]||[ "${forceupdate}" == "1" ]; then + if [ "${localbuild}" != "${remotebuild}" ] || [ "${forceupdate}" == "1" ]; then fn_print_ok_nl "Checking for update: ${remotelocation}" echo -en "\n" echo -e "Update available" diff --git a/lgsm/functions/update_minecraft_bedrock.sh b/lgsm/functions/update_minecraft_bedrock.sh index f724679a9..163e076aa 100644 --- a/lgsm/functions/update_minecraft_bedrock.sh +++ b/lgsm/functions/update_minecraft_bedrock.sh @@ -10,7 +10,7 @@ functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" #random number for userAgent randnum=$((1 + RANDOM % 5000)) -fn_update_minecraft_dl(){ +fn_update_minecraft_dl() { fn_fetch_file "https://minecraft.azureedge.net/bin-linux/bedrock-server-${remotebuild}.zip" "" "" "" "${tmpdir}" "bedrock_server.${remotebuild}.zip" echo -e "Extracting to ${serverfiles}...\c" if [ "${firstcommandname}" == "INSTALL" ]; then @@ -32,13 +32,13 @@ fn_update_minecraft_dl(){ fi } -fn_update_minecraft_localbuild(){ +fn_update_minecraft_localbuild() { # Gets local build info. fn_print_dots "Checking local build: ${remotelocation}" # Uses log file to gather info. # Log is generated and cleared on startup but filled on shutdown. requirerestart=1 - localbuild=$(grep Version "${consolelogdir}"/* 2>/dev/null | tail -1 | sed 's/.*Version //') + localbuild=$(grep Version "${consolelogdir}"/* 2> /dev/null | tail -1 | sed 's/.*Version //') if [ -z "${localbuild}" ]; then fn_print_error "Checking local build: ${remotelocation}" fn_print_error_nl "Checking local build: ${remotelocation}: no log files containing version info" @@ -65,7 +65,7 @@ fn_update_minecraft_localbuild(){ fi if [ -z "${localbuild}" ]; then - localbuild=$(grep Version "$(ls -tr "${consolelogdir}"/* 2>/dev/null)" | tail -1 | sed 's/.*Version //') + localbuild=$(grep Version "$(ls -tr "${consolelogdir}"/* 2> /dev/null)" | tail -1 | sed 's/.*Version //') fi if [ -z "${localbuild}" ]; then @@ -79,7 +79,7 @@ fn_update_minecraft_localbuild(){ fi } -fn_update_minecraft_remotebuild(){ +fn_update_minecraft_remotebuild() { # Gets remote build info. if [ "${mcversion}" == "latest" ]; then remotebuild=$(curl -H "Accept-Encoding: identity" -H "Accept-Language: en" -Ls -A "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.${randnum}.212 Safari/537.36" "https://www.minecraft.net/en-us/download/server/bedrock/" | grep -o 'https://minecraft.azureedge.net/bin-linux/[^"]*' | sed 's/.*\///' | grep -Eo "[.0-9]+[0-9]") @@ -90,7 +90,7 @@ fn_update_minecraft_remotebuild(){ if [ "${firstcommandname}" != "INSTALL" ]; then fn_print_dots "Checking remote build: ${remotelocation}" # Checks if remotebuild variable has been set. - if [ -z "${remotebuild}" ]||[ "${remotebuild}" == "null" ]; then + if [ -z "${remotebuild}" ] || [ "${remotebuild}" == "null" ]; then fn_print_fail "Checking remote build: ${remotelocation}" fn_script_log_fatal "Checking remote build" core_exit.sh @@ -100,7 +100,7 @@ fn_update_minecraft_remotebuild(){ fi else # Checks if remotebuild variable has been set. - if [ -z "${remotebuild}" ]||[ "${remotebuild}" == "null" ]; then + if [ -z "${remotebuild}" ] || [ "${remotebuild}" == "null" ]; then fn_print_failure "Unable to get remote build" fn_script_log_fatal "Unable to get remote build" core_exit.sh @@ -108,12 +108,12 @@ fn_update_minecraft_remotebuild(){ fi } -fn_update_minecraft_compare(){ +fn_update_minecraft_compare() { # Removes dots so if statement can compare version numbers. fn_print_dots "Checking for update: ${remotelocation}" localbuilddigit=$(echo -e "${localbuild}" | tr -cd '[:digit:]') remotebuilddigit=$(echo -e "${remotebuild}" | tr -cd '[:digit:]') - if [ "${localbuilddigit}" -ne "${remotebuilddigit}" ]||[ "${forceupdate}" == "1" ]; then + if [ "${localbuilddigit}" -ne "${remotebuilddigit}" ] || [ "${forceupdate}" == "1" ]; then fn_print_ok_nl "Checking for update: ${remotelocation}" echo -en "\n" echo -e "Update available" diff --git a/lgsm/functions/update_mta.sh b/lgsm/functions/update_mta.sh index c789a3c21..61216b809 100644 --- a/lgsm/functions/update_mta.sh +++ b/lgsm/functions/update_mta.sh @@ -7,7 +7,7 @@ functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" -fn_update_mta_dl(){ +fn_update_mta_dl() { fn_fetch_file "http://linux.mtasa.com/dl/multitheftauto_linux_x64.tar.gz" "" "" "" "${tmpdir}" "multitheftauto_linux_x64.tar.gz" "" "norun" "noforce" "nohash" mkdir "${tmpdir}/multitheftauto_linux_x64" fn_dl_extract "${tmpdir}" "multitheftauto_linux_x64.tar.gz" "${tmpdir}/multitheftauto_linux_x64" @@ -26,7 +26,7 @@ fn_update_mta_dl(){ fi } -fn_update_mta_localbuild(){ +fn_update_mta_localbuild() { # Gets local build info. fn_print_dots "Checking local build: ${remotelocation}" # Uses log file to gather info. @@ -97,13 +97,13 @@ fn_update_mta_localbuild(){ fi } -fn_update_mta_remotebuild(){ +fn_update_mta_remotebuild() { # Gets remote build info. remotebuild=$(curl -s "https://api.github.com/repos/multitheftauto/mtasa-blue/releases/latest" | jq -r '.tag_name') if [ "${firstcommandname}" != "INSTALL" ]; then fn_print_dots "Checking remote build: ${remotelocation}" # Checks if remotebuild variable has been set. - if [ -z "${remotebuild}" ]||[ "${remotebuild}" == "null" ]; then + if [ -z "${remotebuild}" ] || [ "${remotebuild}" == "null" ]; then fn_print_fail "Checking remote build: ${remotelocation}" fn_script_log_fatal "Checking remote build" core_exit.sh @@ -113,7 +113,7 @@ fn_update_mta_remotebuild(){ fi else # Checks if remotebuild variable has been set. - if [ -z "${remotebuild}" ]||[ "${remotebuild}" == "null" ]; then + if [ -z "${remotebuild}" ] || [ "${remotebuild}" == "null" ]; then fn_print_failure "Unable to get remote build" fn_script_log_fatal "Unable to get remote build" core_exit.sh @@ -121,12 +121,12 @@ fn_update_mta_remotebuild(){ fi } -fn_update_mta_compare(){ +fn_update_mta_compare() { # Removes dots so if statement can compare version numbers. fn_print_dots "Checking for update: ${remotelocation}" localbuilddigit=$(echo -e "${localbuild}" | tr -cd '[:digit:]') remotebuilddigit=$(echo -e "${remotebuild}" | tr -cd '[:digit:]') - if [ "${localbuilddigit}" -ne "${remotebuilddigit}" ]||[ "${forceupdate}" == "1" ]; then + if [ "${localbuilddigit}" -ne "${remotebuilddigit}" ] || [ "${forceupdate}" == "1" ]; then fn_print_ok_nl "Checking for update: ${remotelocation}" if [ "${forceupdate}" == "1" ]; then # forceupdate bypasses checks, useful for small build changes diff --git a/lgsm/functions/update_mumble.sh b/lgsm/functions/update_mumble.sh index 8a54e7df2..77e64d3c0 100644 --- a/lgsm/functions/update_mumble.sh +++ b/lgsm/functions/update_mumble.sh @@ -7,7 +7,7 @@ functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" -fn_update_mumble_dl(){ +fn_update_mumble_dl() { fn_fetch_file "https://github.com/mumble-voip/mumble/releases/download/${remotebuild}/murmur-static_${mumblearch}-${remotebuild}.tar.bz2" "" "" "" "${tmpdir}" "murmur-static_${mumblearch}-${remotebuild}.tar.bz2" "" "norun" "noforce" "nohash" fn_dl_extract "${tmpdir}" "murmur-static_${mumblearch}-${remotebuild}.tar.bz2" "${tmpdir}" echo -e "copying to ${serverfiles}...\c" @@ -25,13 +25,13 @@ fn_update_mumble_dl(){ fi } -fn_update_mumble_localbuild(){ +fn_update_mumble_localbuild() { # Gets local build info. fn_print_dots "Checking local build: ${remotelocation}" # Uses executable to find local build. cd "${executabledir}" || exit if [ -f "${executable}" ]; then - localbuild=$(${executable} -version 2>&1 >/dev/null | awk '{print $5}') + localbuild=$(${executable} -version 2>&1 > /dev/null | awk '{print $5}') fn_print_ok "Checking local build: ${remotelocation}" fn_script_log_pass "Checking local build" else @@ -41,13 +41,13 @@ fn_update_mumble_localbuild(){ fi } -fn_update_mumble_remotebuild(){ +fn_update_mumble_remotebuild() { # Gets remote build info. remotebuild=$(curl -s "https://api.github.com/repos/mumble-voip/mumble/releases/latest" | grep 'murmur-static_x86.*\.bz2"' | tail -1 | awk -F"/" '{ print $8 }') if [ "${firstcommandname}" != "INSTALL" ]; then fn_print_dots "Checking remote build: ${remotelocation}" # Checks if remotebuild variable has been set. - if [ -z "${remotebuild}" ]||[ "${remotebuild}" == "null" ]; then + if [ -z "${remotebuild}" ] || [ "${remotebuild}" == "null" ]; then fn_print_fail "Checking remote build: ${remotelocation}" fn_script_log_fatal "Checking remote build" core_exit.sh @@ -57,7 +57,7 @@ fn_update_mumble_remotebuild(){ fi else # Checks if remotebuild variable has been set. - if [ -z "${remotebuild}" ]||[ "${remotebuild}" == "null" ]; then + if [ -z "${remotebuild}" ] || [ "${remotebuild}" == "null" ]; then fn_print_failure "Unable to get remote build" fn_script_log_fatal "Unable to get remote build" core_exit.sh @@ -65,12 +65,12 @@ fn_update_mumble_remotebuild(){ fi } -fn_update_mumble_compare(){ +fn_update_mumble_compare() { # Removes dots so if statement can compare version numbers. fn_print_dots "Checking for update: ${remotelocation}" localbuilddigit=$(echo -e "${localbuild}" | tr -cd '[:digit:]') remotebuilddigit=$(echo -e "${remotebuild}" | tr -cd '[:digit:]') - if [ "${localbuilddigit}" -ne "${remotebuilddigit}" ]||[ "${forceupdate}" == "1" ]; then + if [ "${localbuilddigit}" -ne "${remotebuilddigit}" ] || [ "${forceupdate}" == "1" ]; then fn_print_ok_nl "Checking for update: ${remotelocation}" echo -en "\n" echo -e "Update available" diff --git a/lgsm/functions/update_papermc.sh b/lgsm/functions/update_papermc.sh index 2e669d93d..881e912d3 100644 --- a/lgsm/functions/update_papermc.sh +++ b/lgsm/functions/update_papermc.sh @@ -9,9 +9,9 @@ local commandname="UPDATE" local commandaction="Update" local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" -fn_update_papermc_dl(){ +fn_update_papermc_dl() { # get build info - builddata=$(curl -s "https://${remotelocation}/api/v2/projects/${paperproject}/versions/${paperversion}/builds/${remotebuild}" | jq '.downloads' ) + builddata=$(curl -s "https://${remotelocation}/api/v2/projects/${paperproject}/versions/${paperversion}/builds/${remotebuild}" | jq '.downloads') buildname=$(echo -e "${builddata}" | jq -r '.application.name') buildsha256=$(echo -e "${builddata}" | jq -r '.application.sha256') @@ -33,7 +33,7 @@ fn_update_papermc_dl(){ fi } -fn_update_papermc_localbuild(){ +fn_update_papermc_localbuild() { # Gets local build info. fn_print_dots "Checking for update: ${remotelocation}: checking local build" sleep 0.5 @@ -56,12 +56,12 @@ fn_update_papermc_localbuild(){ sleep 0.5 } -fn_update_papermc_remotebuild(){ +fn_update_papermc_remotebuild() { # Gets remote build info. remotebuild=$(curl -s "https://${remotelocation}/api/v2/projects/${paperproject}/versions/${paperversion}" | jq -r '.builds[-1]') # Checks if remotebuild variable has been set. - if [ -z "${remotebuild}" ]||[ "${remotebuild}" == "null" ]; then + if [ -z "${remotebuild}" ] || [ "${remotebuild}" == "null" ]; then fn_print_failure "Unable to get remote build" fn_script_log_fatal "Unable to get remote build" core_exit.sh @@ -71,10 +71,10 @@ fn_update_papermc_remotebuild(){ fi } -fn_update_papermc_compare(){ +fn_update_papermc_compare() { fn_print_dots "Checking for update: ${remotelocation}" sleep 0.5 - if [ "${localbuild}" != "${remotebuild}" ]||[ "${forceupdate}" == "1" ]; then + if [ "${localbuild}" != "${remotebuild}" ] || [ "${forceupdate}" == "1" ]; then fn_print_ok_nl "Checking for update: ${remotelocation}" echo -en "\n" echo -e "Update available for version ${paperversion}" diff --git a/lgsm/functions/update_ts3.sh b/lgsm/functions/update_ts3.sh index 782a138d1..77ed61838 100644 --- a/lgsm/functions/update_ts3.sh +++ b/lgsm/functions/update_ts3.sh @@ -7,7 +7,7 @@ functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" -fn_update_ts3_dl(){ +fn_update_ts3_dl() { if [ "${ts3arch}" == "amd64" ]; then remotebuildurl=$(curl -s 'https://www.teamspeak.com/versions/server.json' | jq -r '.linux.x86_64.mirrors."teamspeak.com"') elif [ "${ts3arch}" == "x86" ]; then @@ -30,13 +30,13 @@ fn_update_ts3_dl(){ fi } -fn_update_ts3_localbuild(){ +fn_update_ts3_localbuild() { # Gets local build info. fn_print_dots "Checking local build: ${remotelocation}" # Uses log file to gather info. # Gives time for log file to generate. requirerestart=1 - if [ ! -d "${serverfiles}/logs" ]||[ -z "$(find "${serverfiles}/logs/"* -name 'ts3server*_0.log' 2> /dev/null)" ]; then + if [ ! -d "${serverfiles}/logs" ] || [ -z "$(find "${serverfiles}/logs/"* -name 'ts3server*_0.log' 2> /dev/null)" ]; then fn_print_error "Checking local build: ${remotelocation}" fn_print_error_nl "Checking local build: ${remotelocation}: no log files containing version info" fn_print_info_nl "Checking local build: ${remotelocation}: forcing server restart" @@ -49,7 +49,7 @@ fn_update_ts3_localbuild(){ fn_firstcommand_reset totalseconds=0 # Check again, allow time to generate logs. - while [ ! -d "${serverfiles}/logs" ]||[ -z "$(find "${serverfiles}/logs/"* -name 'ts3server*_0.log' 2> /dev/null)" ]; do + while [ ! -d "${serverfiles}/logs" ] || [ -z "$(find "${serverfiles}/logs/"* -name 'ts3server*_0.log' 2> /dev/null)" ]; do sleep 1 fn_print_info "Checking local build: ${remotelocation}: waiting for log file: ${totalseconds}" if [ -v "${loopignore}" ]; then @@ -82,7 +82,7 @@ fn_update_ts3_localbuild(){ fn_script_log_info "Waiting for local build to generate" fi localbuild=$(cat "$(find ./* -name "ts3server*_0.log" 2> /dev/null | sort | tail -1)" | grep -Eo "TeamSpeak 3 Server ((\.)?[0-9]{1,3}){1,3}\.[0-9]{1,3}" | grep -Eo "((\.)?[0-9]{1,3}){1,3}\.[0-9]{1,3}" | tail -1) - if [ "${localbuild}" ]||[ "${seconds}" == "120" ]; then + if [ "${localbuild}" ] || [ "${seconds}" == "120" ]; then break fi sleep 1 @@ -101,7 +101,7 @@ fn_update_ts3_localbuild(){ fi } -fn_update_ts3_remotebuild(){ +fn_update_ts3_remotebuild() { # Gets remote build info. if [ "${ts3arch}" == "amd64" ]; then remotebuild=$(curl -s "https://www.teamspeak.com/versions/server.json" | jq -r '.linux.x86_64.version') @@ -111,7 +111,7 @@ fn_update_ts3_remotebuild(){ if [ "${firstcommandname}" != "INSTALL" ]; then fn_print_dots "Checking remote build: ${remotelocation}" # Checks if remotebuild variable has been set. - if [ -z "${remotebuild}" ]||[ "${remotebuild}" == "null" ]; then + if [ -z "${remotebuild}" ] || [ "${remotebuild}" == "null" ]; then fn_print_fail "Checking remote build: ${remotelocation}" fn_script_log_fatal "Checking remote build" core_exit.sh @@ -121,7 +121,7 @@ fn_update_ts3_remotebuild(){ fi else # Checks if remotebuild variable has been set. - if [ -z "${remotebuild}" ]||[ "${remotebuild}" == "null" ]; then + if [ -z "${remotebuild}" ] || [ "${remotebuild}" == "null" ]; then fn_print_failure "Unable to get remote build" fn_script_log_fatal "Unable to get remote build" core_exit.sh @@ -129,12 +129,12 @@ fn_update_ts3_remotebuild(){ fi } -fn_update_ts3_compare(){ +fn_update_ts3_compare() { # Removes dots so if statement can compare version numbers. fn_print_dots "Checking for update: ${remotelocation}" localbuilddigit=$(echo -e "${localbuild}" | tr -cd '[:digit:]') remotebuilddigit=$(echo -e "${remotebuild}" | tr -cd '[:digit:]') - if [ "${localbuilddigit}" -ne "${remotebuilddigit}" ]||[ "${forceupdate}" == "1" ]; then + if [ "${localbuilddigit}" -ne "${remotebuilddigit}" ] || [ "${forceupdate}" == "1" ]; then fn_print_ok_nl "Checking for update: ${remotelocation}" echo -en "\n" echo -e "Update available" @@ -192,7 +192,7 @@ fn_update_ts3_compare(){ info_distro.sh if [ "${arch}" == "x86_64" ]; then ts3arch="amd64" -elif [ "${arch}" == "i386" ]||[ "${arch}" == "i686" ]; then +elif [ "${arch}" == "i386" ] || [ "${arch}" == "i686" ]; then ts3arch="x86" else fn_print_failure "Unknown or unsupported architecture: ${arch}" diff --git a/lgsm/functions/update_vintagestory.sh b/lgsm/functions/update_vintagestory.sh index b2231c66e..905384922 100755 --- a/lgsm/functions/update_vintagestory.sh +++ b/lgsm/functions/update_vintagestory.sh @@ -7,7 +7,7 @@ functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" -fn_update_vs_dl(){ +fn_update_vs_dl() { # get version info for download remotebuildresponse=$(curl -s "${apiurl}" | jq --arg version "${remotebuild}" '.[$version].server') remotebuildfile=$(echo -e "${remotebuildresponse}" | jq -r '.filename') @@ -20,7 +20,7 @@ fn_update_vs_dl(){ fn_clear_tmp } -fn_update_vs_localbuild(){ +fn_update_vs_localbuild() { # Gets local build info. fn_print_dots "Checking local build: ${remotelocation}" # Uses executable to find local build. @@ -36,7 +36,7 @@ fn_update_vs_localbuild(){ fi } -fn_update_vs_remotebuild(){ +fn_update_vs_remotebuild() { if [ "${branch}" == "stable" ]; then remotebuild=$(curl -s "${apiurl}" | jq -r '[ to_entries[] ] | .[].key' | grep -Ev "\-rc|\-pre" | sort -r -V | head -1) else @@ -46,7 +46,7 @@ fn_update_vs_remotebuild(){ if [ "${firstcommandname}" != "INSTALL" ]; then fn_print_dots "Checking remote build: ${remotelocation}" # Checks if remotebuild variable has been set. - if [ -z "${remotebuild}" ]||[ "${remotebuild}" == "null" ]; then + if [ -z "${remotebuild}" ] || [ "${remotebuild}" == "null" ]; then fn_print_fail "Checking remote build: ${remotelocation}" fn_script_log_fatal "Checking remote build" core_exit.sh @@ -56,7 +56,7 @@ fn_update_vs_remotebuild(){ fi else # Checks if remotebuild variable has been set. - if [ -z "${remotebuild}" ]||[ "${remotebuild}" == "null" ]; then + if [ -z "${remotebuild}" ] || [ "${remotebuild}" == "null" ]; then fn_print_failure "Unable to get remote build" fn_script_log_fatal "Unable to get remote build" core_exit.sh @@ -64,10 +64,10 @@ fn_update_vs_remotebuild(){ fi } -fn_update_vs_compare(){ +fn_update_vs_compare() { # Removes dots so if statement can compare version numbers. fn_print_dots "Checking for update: ${remotelocation}" - if [ "${localbuild}" != "${remotebuild}" ]||[ "${forceupdate}" == "1" ]; then + if [ "${localbuild}" != "${remotebuild}" ] || [ "${forceupdate}" == "1" ]; then fn_print_ok_nl "Checking for update: ${remotelocation}" echo -en "\n" echo -e "Update available" diff --git a/linuxgsm.sh b/linuxgsm.sh index 43c388571..6a4209b32 100755 --- a/linuxgsm.sh +++ b/linuxgsm.sh @@ -15,7 +15,7 @@ # Debugging if [ -f ".dev-debug" ]; then - exec 5>dev-debug.log + exec 5> dev-debug.log BASH_XTRACEFD="5" set -x fi @@ -52,20 +52,20 @@ userinput2="${2}" [ -n "${LGSM_GITHUBBRANCH}" ] && githubbranch="${LGSM_GITHUBBRANCH}" || githubbranch="master" # Check that curl is installed before doing anything -if [ ! "$(command -v curl 2>/dev/null)" ]; then +if [ ! "$(command -v curl 2> /dev/null)" ]; then echo -e "[ FAIL ] Curl is not installed" exit 1 fi # Core function that is required first. -core_functions.sh(){ +core_functions.sh() { functionfile="${FUNCNAME[0]}" fn_bootstrap_fetch_file_github "lgsm/functions" "core_functions.sh" "${functionsdir}" "chmodx" "run" "noforcedl" "nomd5" } # Bootstrap # Fetches the core functions required before passed off to core_dl.sh. -fn_bootstrap_fetch_file(){ +fn_bootstrap_fetch_file() { remote_fileurl="${1}" remote_fileurl_backup="${2}" remote_fileurl_name="${3}" @@ -77,16 +77,16 @@ fn_bootstrap_fetch_file(){ forcedl="${9:-0}" md5="${10:-0}" # Download file if missing or download forced. - if [ ! -f "${local_filedir}/${local_filename}" ]||[ "${forcedl}" == "forcedl" ]; then + if [ ! -f "${local_filedir}/${local_filename}" ] || [ "${forcedl}" == "forcedl" ]; then # If backup fileurl exists include it. if [ -n "${remote_fileurl_backup}" ]; then # counter set to 0 to allow second try counter=0 - remote_fileurls_array=( remote_fileurl remote_fileurl_backup ) + remote_fileurls_array=(remote_fileurl remote_fileurl_backup) else # counter set to 1 to not allow second try counter=1 - remote_fileurls_array=( remote_fileurl ) + remote_fileurls_array=(remote_fileurl) fi for remote_fileurl_array in "${remote_fileurls_array[@]}"; do @@ -97,7 +97,7 @@ fn_bootstrap_fetch_file(){ fileurl="${remote_fileurl_backup}" fileurl_name="${remote_fileurl_backup_name}" fi - counter=$((counter+1)) + counter=$((counter + 1)) if [ ! -d "${local_filedir}" ]; then mkdir -p "${local_filedir}" fi @@ -112,7 +112,7 @@ fn_bootstrap_fetch_file(){ # Download will fail if downloads a html file. if [ -f "${local_filedir}/${local_filename}" ]; then - if [ -n "$(head "${local_filedir}/${local_filename}" | grep "DOCTYPE" )" ]; then + if [ -n "$(head "${local_filedir}/${local_filename}" | grep "DOCTYPE")" ]; then rm "${local_filedir:?}/${local_filename:?}" local exitcode=2 fi @@ -164,11 +164,11 @@ fn_bootstrap_fetch_file(){ fi } -fn_bootstrap_fetch_file_github(){ +fn_bootstrap_fetch_file_github() { github_file_url_dir="${1}" github_file_url_name="${2}" # If master branch will currently running LinuxGSM version to prevent "version mixing". This is ignored if a fork. - if [ "${githubbranch}" == "master" ]&&[ "${githubuser}" == "GameServerManager" ]&&[ "${commandname}" != "UPDATE-LGSM" ]; then + if [ "${githubbranch}" == "master" ] && [ "${githubuser}" == "GameServerManager" ] && [ "${commandname}" != "UPDATE-LGSM" ]; then remote_fileurl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${version}/${github_file_url_dir}/${github_file_url_name}" remote_fileurl_backup="https://bitbucket.org/${githubuser}/${githubrepo}/raw/${version}/${github_file_url_dir}/${github_file_url_name}" else @@ -192,10 +192,10 @@ fn_bootstrap_fetch_file_github(){ fn_print_center() { columns=$(tput cols) line="$*" - printf "%*s\n" $(( (${#line} + columns) / 2)) "${line}" + printf "%*s\n" $(((${#line} + columns) / 2)) "${line}" } -fn_print_horizontal(){ +fn_print_horizontal() { printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' "=" } @@ -212,11 +212,11 @@ fn_install_menu_bash() { menu_options=() while read -r line || [[ -n "${line}" ]]; do var=$(echo -e "${line}" | awk -F "," '{print $2 " - " $3}') - menu_options+=( "${var}" ) + menu_options+=("${var}") done < "${options}" - menu_options+=( "Cancel" ) + menu_options+=("Cancel") select option in "${menu_options[@]}"; do - if [ "${option}" ]&&[ "${option}" != "Cancel" ]; then + if [ "${option}" ] && [ "${option}" != "Cancel" ]; then eval "$resultvar=\"${option/%\ */}\"" fi break @@ -238,7 +238,7 @@ fn_install_menu_whiptail() { while read -r line; do key=$(echo -e "${line}" | awk -F "," '{print $3}') val=$(echo -e "${line}" | awk -F "," '{print $2}') - menu_options+=( "${val//\"}" "${key//\"}" ) + menu_options+=("${val//\"/}" "${key//\"/}") done < "${options}" OPTION=$(${menucmd} --title "${title}" --menu "${caption}" "${height}" "${width}" "${menuheight}" "${menu_options[@]}" 3>&1 1>&2 2>&3) if [ $? == 0 ]; then @@ -263,24 +263,26 @@ fn_install_menu() { fi done case "$(basename "${menucmd}")" in - whiptail|dialog) - fn_install_menu_whiptail "${menucmd}" selection "${title}" "${caption}" "${options}" 40 80 30;; + whiptail | dialog) + fn_install_menu_whiptail "${menucmd}" selection "${title}" "${caption}" "${options}" 40 80 30 + ;; *) - fn_install_menu_bash selection "${title}" "${caption}" "${options}";; + fn_install_menu_bash selection "${title}" "${caption}" "${options}" + ;; esac eval "$resultvar=\"${selection}\"" } # Gets server info from serverlist.csv and puts in to array. -fn_server_info(){ +fn_server_info() { IFS="," server_info_array=($(grep -aw "${userinput}" "${serverlist}")) - shortname="${server_info_array[0]}" # csgo + shortname="${server_info_array[0]}" # csgo gameservername="${server_info_array[1]}" # csgoserver - gamename="${server_info_array[2]}" # Counter Strike: Global Offensive + gamename="${server_info_array[2]}" # Counter Strike: Global Offensive } -fn_install_getopt(){ +fn_install_getopt() { userinput="empty" echo -e "Usage: $0 [option]" echo -e "" @@ -294,13 +296,13 @@ fn_install_getopt(){ exit } -fn_install_file(){ +fn_install_file() { local_filename="${gameservername}" if [ -e "${local_filename}" ]; then i=2 - while [ -e "${local_filename}-${i}" ] ; do - (( i++ )) - done + while [ -e "${local_filename}-${i}" ]; do + ((i++)) + done local_filename="${local_filename}-${i}" fi cp -R "${selfname}" "${local_filename}" @@ -320,12 +322,12 @@ fn_install_file(){ # Prevent LinuxGSM from running as root. Except if doing a dependency install. if [ "$(whoami)" == "root" ]; then - if [ "${userinput}" == "install" ]||[ "${userinput}" == "auto-install" ]||[ "${userinput}" == "i" ]||[ "${userinput}" == "ai" ]; then + if [ "${userinput}" == "install" ] || [ "${userinput}" == "auto-install" ] || [ "${userinput}" == "i" ] || [ "${userinput}" == "ai" ]; then if [ "${shortname}" == "core" ]; then echo -e "[ FAIL ] Do NOT run this script as root!" exit 1 fi - elif [ ! -f "${functionsdir}/core_functions.sh" ]||[ ! -f "${functionsdir}/check_root.sh" ]||[ ! -f "${functionsdir}/core_messages.sh" ]; then + elif [ ! -f "${functionsdir}/core_functions.sh" ] || [ ! -f "${functionsdir}/check_root.sh" ] || [ ! -f "${functionsdir}/core_messages.sh" ]; then echo -e "[ FAIL ] Do NOT run this script as root!" exit 1 else @@ -343,12 +345,12 @@ if [ "${shortname}" == "core" ]; then exit 1 fi - if [ "${userinput}" == "list" ]||[ "${userinput}" == "l" ]; then + if [ "${userinput}" == "list" ] || [ "${userinput}" == "l" ]; then { tail -n +1 "${serverlist}" | awk -F "," '{print $2 "\t" $3}' } | column -s $'\t' -t | more exit - elif [ "${userinput}" == "install" ]||[ "${userinput}" == "i" ]; then + elif [ "${userinput}" == "install" ] || [ "${userinput}" == "i" ]; then tail -n +1 "${serverlist}" | awk -F "," '{print $1 "," $2 "," $3}' > "${serverlistmenu}" fn_install_menu result "LinuxGSM" "Select game server to install." "${serverlistmenu}" userinput="${result}" @@ -364,7 +366,7 @@ if [ "${shortname}" == "core" ]; then fi elif [ "${userinput}" ]; then fn_server_info - if [ "${userinput}" == "${gameservername}" ]||[ "${userinput}" == "${gamename}" ]||[ "${userinput}" == "${shortname}" ]; then + if [ "${userinput}" == "${gameservername}" ] || [ "${userinput}" == "${gamename}" ] || [ "${userinput}" == "${shortname}" ]; then fn_install_file else echo -e "[ FAIL ] unknown game server" @@ -453,7 +455,7 @@ else # Reloads start parameter to ensure all vars in startparameters are set. # Will reload the last defined startparameter. - fn_reload_startparameters(){ + fn_reload_startparameters() { # reload Wurm config. if [ "${shortname}" == "wurm" ]; then # shellcheck source=/dev/null @@ -472,7 +474,7 @@ else eval startparameters="$(sed -nr 's/^ *startparameters=(.*)$/\1/p' "${configdirserver}/_default.cfg")" fi -# reload preexecutable. + # reload preexecutable. if grep -qE "^[[:blank:]]*preexecutable=" "${configdirserver}/secrets-${selfname}.cfg"; then eval preexecutable="$(sed -nr 's/^ *preexecutable=(.*)$/\1/p' "${configdirserver}/secrets-${selfname}.cfg")" elif grep -qE "^[[:blank:]]*preexecutable=" "${configdirserver}/${selfname}.cfg"; then diff --git a/tests/tests_defaultcfg/tests_defaultcfg.sh b/tests/tests_defaultcfg/tests_defaultcfg.sh index 4039d90e7..5f97f9a33 100644 --- a/tests/tests_defaultcfg/tests_defaultcfg.sh +++ b/tests/tests_defaultcfg/tests_defaultcfg.sh @@ -6,20 +6,20 @@ echo -e "Description:" echo -e "test checks that vars present in ALL _default.cfg files are correct." echo -e "" echo -e "In master config < | > In game config" -find "lgsm/config-default/config-lgsm/" ! -name '*template.cfg' -name "*.cfg" -type f -print0 | -while IFS= read -r -d $'\0' line; do - grep "=" "${line}" | cut -f1 -d"=" > defaultcfgtemp.txt - diffoutput=$(diff tests/tests_defaultcfg/defaultcfg_0.txt defaultcfgtemp.txt) - if [ "${diffoutput}" ]; then - echo "File with errors:" - echo "${line}" - echo -e "=================================" - echo -e "In master config < | > In game config" - echo "${diffoutput}" - echo "" - fi - rm -f defaultcfgtemp.txt -done +find "lgsm/config-default/config-lgsm/" ! -name '*template.cfg' -name "*.cfg" -type f -print0 \ + | while IFS= read -r -d $'\0' line; do + grep "=" "${line}" | cut -f1 -d"=" > defaultcfgtemp.txt + diffoutput=$(diff tests/tests_defaultcfg/defaultcfg_0.txt defaultcfgtemp.txt) + if [ "${diffoutput}" ]; then + echo "File with errors:" + echo "${line}" + echo -e "=================================" + echo -e "In master config < | > In game config" + echo "${diffoutput}" + echo "" + fi + rm -f defaultcfgtemp.txt + done echo -e "" echo -e "1.0 - Master Comparison" @@ -28,20 +28,20 @@ echo -e "Description:" echo -e "test checks that vars present in ALL _default.cfg files are correct." echo -e "" echo -e "In master config < | > In game config" -find lgsm/config-default/config-lgsm/ ! -name '*template.cfg' -name "*.cfg" -type f -print0 | -while IFS= read -r -d $'\0' line; do - grep "=" "${line}" | cut -f1 -d"=" > defaultcfgtemp.txt - diffoutput=$(diff tests/tests_defaultcfg/defaultcfg_0.txt defaultcfgtemp.txt | grep '^<') - if [ "${diffoutput}" ]; then - echo "File with errors:" - echo "${line}" - echo -e "=================================" - echo -e "In master config < | > In game config" - echo "${diffoutput}" - echo "" - fi - rm -f defaultcfgtemp.txt -done +find lgsm/config-default/config-lgsm/ ! -name '*template.cfg' -name "*.cfg" -type f -print0 \ + | while IFS= read -r -d $'\0' line; do + grep "=" "${line}" | cut -f1 -d"=" > defaultcfgtemp.txt + diffoutput=$(diff tests/tests_defaultcfg/defaultcfg_0.txt defaultcfgtemp.txt | grep '^<') + if [ "${diffoutput}" ]; then + echo "File with errors:" + echo "${line}" + echo -e "=================================" + echo -e "In master config < | > In game config" + echo "${diffoutput}" + echo "" + fi + rm -f defaultcfgtemp.txt + done echo -e "" echo -e "2.0 - Check Comment" @@ -50,16 +50,16 @@ echo -e "Description:" echo -e "test checks that comments in ALL _default.cfg files are correct." echo -e "" echo -e "In master config < | > In game config" -find lgsm/config-default/config-lgsm/ ! -name '*template.cfg' -name "*.cfg" -type f -print0 | -while IFS= read -r -d $'\0' line; do - grep "#" "${line}" > defaultcfgtemp.txt - diffoutput=$(diff tests/tests_defaultcfg/defaultcfg_1.txt defaultcfgtemp.txt | grep '^<') - if [ "${diffoutput}" ]; then - echo "File with errors:" - echo "${line}" - echo -e "=================================" - echo "${diffoutput}" - echo "" - fi - rm -f defaultcfgtemp.txt -done +find lgsm/config-default/config-lgsm/ ! -name '*template.cfg' -name "*.cfg" -type f -print0 \ + | while IFS= read -r -d $'\0' line; do + grep "#" "${line}" > defaultcfgtemp.txt + diffoutput=$(diff tests/tests_defaultcfg/defaultcfg_1.txt defaultcfgtemp.txt | grep '^<') + if [ "${diffoutput}" ]; then + echo "File with errors:" + echo "${line}" + echo -e "=================================" + echo "${diffoutput}" + echo "" + fi + rm -f defaultcfgtemp.txt + done diff --git a/tests/tests_fctrserver.sh b/tests/tests_fctrserver.sh index 6a074861c..9a27daf91 100644 --- a/tests/tests_fctrserver.sh +++ b/tests/tests_fctrserver.sh @@ -15,7 +15,7 @@ # Debugging if [ -f ".dev-debug" ]; then - exec 5>dev-debug.log + exec 5> dev-debug.log BASH_XTRACEFD="5" set -x fi @@ -58,14 +58,14 @@ githubrepo="LinuxGSM" githubbranch="${TRAVIS_BRANCH}" # Core function that is required first. -core_functions.sh(){ +core_functions.sh() { functionfile="${FUNCNAME[0]}" fn_bootstrap_fetch_file_github "lgsm/functions" "core_functions.sh" "${functionsdir}" "chmodx" "run" "noforcedl" "nohash" } # Bootstrap # Fetches the core functions required before passed off to core_dl.sh. -fn_bootstrap_fetch_file(){ +fn_bootstrap_fetch_file() { remote_fileurl="${1}" remote_fileurl_backup="${2}" remote_fileurl_name="${3}" @@ -77,16 +77,16 @@ fn_bootstrap_fetch_file(){ forcedl="${9:-0}" md5="${10:-0}" # Download file if missing or download forced. - if [ ! -f "${local_filedir}/${local_filename}" ]||[ "${forcedl}" == "forcedl" ]; then + if [ ! -f "${local_filedir}/${local_filename}" ] || [ "${forcedl}" == "forcedl" ]; then # If backup fileurl exists include it. if [ -n "${remote_fileurl_backup}" ]; then # counter set to 0 to allow second try counter=0 - remote_fileurls_array=( remote_fileurl remote_fileurl_backup ) + remote_fileurls_array=(remote_fileurl remote_fileurl_backup) else # counter set to 1 to not allow second try counter=1 - remote_fileurls_array=( remote_fileurl ) + remote_fileurls_array=(remote_fileurl) fi for remote_fileurl_array in "${remote_fileurls_array[@]}"; do @@ -97,7 +97,7 @@ fn_bootstrap_fetch_file(){ fileurl="${remote_fileurl_backup}" fileurl_name="${remote_fileurl_backup_name}" fi - counter=$((counter+1)) + counter=$((counter + 1)) if [ ! -d "${local_filedir}" ]; then mkdir -p "${local_filedir}" fi @@ -111,7 +111,7 @@ fn_bootstrap_fetch_file(){ local exitcode=$? # Download will fail if downloads a html file. if [ -f "${local_filedir}/${local_filename}" ]; then - if [ -n "$(head "${local_filedir}/${local_filename}" | grep "DOCTYPE" )" ]; then + if [ -n "$(head "${local_filedir}/${local_filename}" | grep "DOCTYPE")" ]; then rm "${local_filedir:?}/${local_filename:?}" local exitcode=2 fi @@ -164,11 +164,11 @@ fn_bootstrap_fetch_file(){ fi } -fn_bootstrap_fetch_file_github(){ +fn_bootstrap_fetch_file_github() { github_file_url_dir="${1}" github_file_url_name="${2}" # If master branch will currently running LinuxGSM version to prevent "version mixing". This is ignored if a fork. - if [ "${githubbranch}" == "master" ]&&[ "${githubuser}" == "GameServerManager" ]&&[ "${commandname}" != "UPDATE-LGSM" ]; then + if [ "${githubbranch}" == "master" ] && [ "${githubuser}" == "GameServerManager" ] && [ "${commandname}" != "UPDATE-LGSM" ]; then remote_fileurl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${version}/${github_file_url_dir}/${github_file_url_name}" remote_fileurl_backup="https://bitbucket.org/${githubuser}/${githubrepo}/raw/${version}/${github_file_url_dir}/${github_file_url_name}" else @@ -192,10 +192,10 @@ fn_bootstrap_fetch_file_github(){ fn_print_center() { columns=$(tput cols) line="$*" - printf "%*s\n" $(( (${#line} + columns) / 2)) "${line}" + printf "%*s\n" $(((${#line} + columns) / 2)) "${line}" } -fn_print_horizontal(){ +fn_print_horizontal() { printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' "=" } @@ -212,11 +212,11 @@ fn_install_menu_bash() { menu_options=() while read -r line || [[ -n "${line}" ]]; do var=$(echo -e "${line}" | awk -F "," '{print $2 " - " $3}') - menu_options+=( "${var}" ) + menu_options+=("${var}") done < "${options}" - menu_options+=( "Cancel" ) + menu_options+=("Cancel") select option in "${menu_options[@]}"; do - if [ "${option}" ]&&[ "${option}" != "Cancel" ]; then + if [ "${option}" ] && [ "${option}" != "Cancel" ]; then eval "$resultvar=\"${option/%\ */}\"" fi break @@ -238,7 +238,7 @@ fn_install_menu_whiptail() { while read -r line; do key=$(echo -e "${line}" | awk -F "," '{print $3}') val=$(echo -e "${line}" | awk -F "," '{print $2}') - menu_options+=( "${val//\"}" "${key//\"}" ) + menu_options+=("${val//\"/}" "${key//\"/}") done < "${options}" OPTION=$(${menucmd} --title "${title}" --menu "${caption}" "${height}" "${width}" "${menuheight}" "${menu_options[@]}" 3>&1 1>&2 2>&3) if [ $? == 0 ]; then @@ -263,24 +263,26 @@ fn_install_menu() { fi done case "$(basename "${menucmd}")" in - whiptail|dialog) - fn_install_menu_whiptail "${menucmd}" selection "${title}" "${caption}" "${options}" 40 80 30;; + whiptail | dialog) + fn_install_menu_whiptail "${menucmd}" selection "${title}" "${caption}" "${options}" 40 80 30 + ;; *) - fn_install_menu_bash selection "${title}" "${caption}" "${options}";; + fn_install_menu_bash selection "${title}" "${caption}" "${options}" + ;; esac eval "$resultvar=\"${selection}\"" } # Gets server info from serverlist.csv and puts in to array. -fn_server_info(){ +fn_server_info() { IFS="," server_info_array=($(grep -aw "${userinput}" "${serverlist}")) - shortname="${server_info_array[0]}" # csgo + shortname="${server_info_array[0]}" # csgo gameservername="${server_info_array[1]}" # csgoserver - gamename="${server_info_array[2]}" # Counter Strike: Global Offensive + gamename="${server_info_array[2]}" # Counter Strike: Global Offensive } -fn_install_getopt(){ +fn_install_getopt() { userinput="empty" echo -e "Usage: $0 [option]" echo -e "" @@ -294,13 +296,13 @@ fn_install_getopt(){ exit } -fn_install_file(){ +fn_install_file() { local_filename="${gameservername}" if [ -e "${local_filename}" ]; then i=2 - while [ -e "${local_filename}-${i}" ] ; do - (( i++ )) - done + while [ -e "${local_filename}-${i}" ]; do + ((i++)) + done local_filename="${local_filename}-${i}" fi cp -R "${selfname}" "${local_filename}" @@ -320,12 +322,12 @@ fn_install_file(){ # Prevent LinuxGSM from running as root. Except if doing a dependency install. if [ "$(whoami)" == "root" ]; then - if [ "${userinput}" == "install" ]||[ "${userinput}" == "auto-install" ]||[ "${userinput}" == "i" ]||[ "${userinput}" == "ai" ]; then + if [ "${userinput}" == "install" ] || [ "${userinput}" == "auto-install" ] || [ "${userinput}" == "i" ] || [ "${userinput}" == "ai" ]; then if [ "${shortname}" == "core" ]; then echo -e "[ FAIL ] Do NOT run this script as root!" exit 1 fi - elif [ ! -f "${functionsdir}/core_functions.sh" ]||[ ! -f "${functionsdir}/check_root.sh" ]||[ ! -f "${functionsdir}/core_messages.sh" ]; then + elif [ ! -f "${functionsdir}/core_functions.sh" ] || [ ! -f "${functionsdir}/check_root.sh" ] || [ ! -f "${functionsdir}/core_messages.sh" ]; then echo -e "[ FAIL ] Do NOT run this script as root!" exit 1 else @@ -343,12 +345,12 @@ if [ "${shortname}" == "core" ]; then exit 1 fi - if [ "${userinput}" == "list" ]||[ "${userinput}" == "l" ]; then + if [ "${userinput}" == "list" ] || [ "${userinput}" == "l" ]; then { tail -n +2 "${serverlist}" | awk -F "," '{print $2 "\t" $3}' } | column -s $'\t' -t | more exit - elif [ "${userinput}" == "install" ]||[ "${userinput}" == "i" ]; then + elif [ "${userinput}" == "install" ] || [ "${userinput}" == "i" ]; then tail -n +2 "${serverlist}" | awk -F "," '{print $1 "," $2 "," $3}' > "${serverlistmenu}" fn_install_menu result "LinuxGSM" "Select game server to install." "${serverlistmenu}" userinput="${result}" @@ -364,7 +366,7 @@ if [ "${shortname}" == "core" ]; then fi elif [ "${userinput}" ]; then fn_server_info - if [ "${userinput}" == "${gameservername}" ]||[ "${userinput}" == "${gamename}" ]||[ "${userinput}" == "${shortname}" ]; then + if [ "${userinput}" == "${gameservername}" ] || [ "${userinput}" == "${gamename}" ] || [ "${userinput}" == "${shortname}" ]; then fn_install_file else echo -e "[ FAIL ] unknown game server" @@ -463,7 +465,7 @@ else fi fi -fn_currentstatus_tmux(){ +fn_currentstatus_tmux() { check_status.sh if [ "${status}" != "0" ]; then currentstatus="STARTED" @@ -472,14 +474,14 @@ fn_currentstatus_tmux(){ fi } -fn_setstatus(){ +fn_setstatus() { fn_currentstatus_tmux echo"" echo -e "Required status: ${requiredstatus}" counter=0 echo -e "Current status: ${currentstatus}" - while [ "${requiredstatus}" != "${currentstatus}" ]; do - counter=$((counter+1)) + while [ "${requiredstatus}" != "${currentstatus}" ]; do + counter=$((counter + 1)) fn_currentstatus_tmux echo -en "New status: ${currentstatus}\\r" @@ -505,7 +507,7 @@ fn_setstatus(){ # End of every test will expect the result to either pass or fail # If the script does not do as intended the whole test will fail # if expecting a pass -fn_test_result_pass(){ +fn_test_result_pass() { if [ $? != 0 ]; then echo -e "=================================" echo -e "Expected result: PASS" @@ -523,7 +525,7 @@ fn_test_result_pass(){ } # if expecting a fail -fn_test_result_fail(){ +fn_test_result_fail() { if [ $? == 0 ]; then echo -e "=================================" echo -e "Expected result: FAIL" @@ -541,7 +543,7 @@ fn_test_result_fail(){ } # test result n/a -fn_test_result_na(){ +fn_test_result_na() { echo -e "=================================" echo -e "Expected result: N/A" echo -e "Actual result: N/A" @@ -627,7 +629,7 @@ echo -e "0.1 - Create log dir's" echo -e "=================================" echo -e "" ( - exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + exec 5> "${TRAVIS_BUILD_DIR}/dev-debug.log" BASH_XTRACEFD="5" set -x install_logs.sh @@ -643,7 +645,7 @@ echo -e "Description:" echo -e "Enable dev-debug" echo -e "" ( - exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + exec 5> "${TRAVIS_BUILD_DIR}/dev-debug.log" BASH_XTRACEFD="5" set -x command_dev_debug.sh @@ -666,13 +668,13 @@ echo -e "Command: ./${gameservername} start" echo -e "" # Allows for testing not on Travis CI if [ -z "${TRAVIS}" ]; then -( - exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" - BASH_XTRACEFD="5" - set -x - command_start.sh -) -fn_test_result_fail + ( + exec 5> "${TRAVIS_BUILD_DIR}/dev-debug.log" + BASH_XTRACEFD="5" + set -x + command_start.sh + ) + fn_test_result_fail else echo -e "Test bypassed" fi @@ -689,7 +691,7 @@ echo -e "displaying options messages." echo -e "Command: ./${gameservername}" echo -e "" ( - exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + exec 5> "${TRAVIS_BUILD_DIR}/dev-debug.log" BASH_XTRACEFD="5" set -x core_getopt.sh @@ -708,7 +710,7 @@ echo -e "Command: ./${gameservername} abc123" echo -e "" getopt="abc123" ( - exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + exec 5> "${TRAVIS_BUILD_DIR}/dev-debug.log" BASH_XTRACEFD="5" set -x core_getopt.sh @@ -729,7 +731,7 @@ echo -e "Description:" echo -e "install ${gamename} server." echo -e "Command: ./${gameservername} auto-install" ( - exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + exec 5> "${TRAVIS_BUILD_DIR}/dev-debug.log" BASH_XTRACEFD="5" set -x fn_autoinstall @@ -752,7 +754,7 @@ echo -e "Command: ./${gameservername} start" requiredstatus="STOPPED" fn_setstatus ( - exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + exec 5> "${TRAVIS_BUILD_DIR}/dev-debug.log" BASH_XTRACEFD="5" set -x command_start.sh @@ -771,7 +773,7 @@ echo -e "Command: ./${gameservername} start" requiredstatus="STARTED" fn_setstatus ( - exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + exec 5> "${TRAVIS_BUILD_DIR}/dev-debug.log" BASH_XTRACEFD="5" set -x command_start.sh @@ -790,10 +792,11 @@ echo -e "Command: ./${gameservername} start" requiredstatus="STOPPED" fn_setstatus ( - exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + exec 5> "${TRAVIS_BUILD_DIR}/dev-debug.log" BASH_XTRACEFD="5" set -x - updateonstart="on";command_start.sh + updateonstart="on" + command_start.sh ) fn_test_result_pass echo -e "run order" @@ -809,7 +812,7 @@ echo -e "Command: ./${gameservername} stop" requiredstatus="STARTED" fn_setstatus ( - exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + exec 5> "${TRAVIS_BUILD_DIR}/dev-debug.log" BASH_XTRACEFD="5" set -x command_stop.sh @@ -828,7 +831,7 @@ echo -e "Command: ./${gameservername} stop" requiredstatus="STOPPED" fn_setstatus ( - exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + exec 5> "${TRAVIS_BUILD_DIR}/dev-debug.log" BASH_XTRACEFD="5" set -x command_stop.sh @@ -847,7 +850,7 @@ echo -e "Command: ./${gameservername} restart" requiredstatus="STARTED" fn_setstatus ( - exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + exec 5> "${TRAVIS_BUILD_DIR}/dev-debug.log" BASH_XTRACEFD="5" set -x command_restart.sh @@ -866,7 +869,7 @@ echo -e "Command: ./${gameservername} restart" requiredstatus="STOPPED" fn_setstatus ( - exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + exec 5> "${TRAVIS_BUILD_DIR}/dev-debug.log" BASH_XTRACEFD="5" set -x command_restart.sh @@ -889,7 +892,7 @@ echo -e "Command: ./${gameservername} update" requiredstatus="STOPPED" fn_setstatus ( - exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + exec 5> "${TRAVIS_BUILD_DIR}/dev-debug.log" BASH_XTRACEFD="5" set -x command_update.sh @@ -909,7 +912,7 @@ echo -e "Command: ./jc2server update-lgam" requiredstatus="STARTED" fn_setstatus ( - exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + exec 5> "${TRAVIS_BUILD_DIR}/dev-debug.log" BASH_XTRACEFD="5" set -x command_update_linuxgsm.sh @@ -936,7 +939,7 @@ echo -e "Command: ./${gameservername} monitor" requiredstatus="STARTED" fn_setstatus ( - exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + exec 5> "${TRAVIS_BUILD_DIR}/dev-debug.log" BASH_XTRACEFD="5" set -x command_monitor.sh @@ -959,7 +962,7 @@ date '+%s' > "${lockdir}/${selfname}.lock" echo "${version}" >> "${lockdir}/${selfname}.lock" echo "${port}" >> "${lockdir}/${selfname}.lock" ( - exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + exec 5> "${TRAVIS_BUILD_DIR}/dev-debug.log" BASH_XTRACEFD="5" set -x command_monitor.sh @@ -978,7 +981,7 @@ echo -e "Command: ./${gameservername} monitor" requiredstatus="STOPPED" fn_setstatus ( - exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + exec 5> "${TRAVIS_BUILD_DIR}/dev-debug.log" BASH_XTRACEFD="5" set -x command_monitor.sh @@ -997,7 +1000,7 @@ echo -e "Command: ./${gameservername} test-alert" requiredstatus="STOPPED" fn_setstatus ( - exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + exec 5> "${TRAVIS_BUILD_DIR}/dev-debug.log" BASH_XTRACEFD="5" set -x command_test_alert.sh @@ -1020,7 +1023,7 @@ echo -e "Command: ./${gameservername} details" requiredstatus="STARTED" fn_setstatus ( - exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + exec 5> "${TRAVIS_BUILD_DIR}/dev-debug.log" BASH_XTRACEFD="5" set -x command_details.sh @@ -1039,7 +1042,7 @@ echo -e "Command: ./${gameservername} postdetails" requiredstatus="STARTED" fn_setstatus ( - exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + exec 5> "${TRAVIS_BUILD_DIR}/dev-debug.log" BASH_XTRACEFD="5" set -x command_postdetails.sh @@ -1081,7 +1084,7 @@ echo -e "Command: ./${gameservername} detect-glibc" requiredstatus="STARTED" fn_setstatus ( - exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + exec 5> "${TRAVIS_BUILD_DIR}/dev-debug.log" BASH_XTRACEFD="5" set -x command_dev_detect_glibc.sh @@ -1100,7 +1103,7 @@ echo -e "Command: ./${gameservername} detect-ldd" requiredstatus="STARTED" fn_setstatus ( - exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + exec 5> "${TRAVIS_BUILD_DIR}/dev-debug.log" BASH_XTRACEFD="5" set -x command_dev_detect_ldd.sh @@ -1119,7 +1122,7 @@ echo -e "Command: ./${gameservername} detect-deps" requiredstatus="STARTED" fn_setstatus ( - exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + exec 5> "${TRAVIS_BUILD_DIR}/dev-debug.log" BASH_XTRACEFD="5" set -x command_dev_detect_deps.sh @@ -1138,7 +1141,7 @@ echo -e "Command: ./${gameservername} query-raw" requiredstatus="STARTED" fn_setstatus ( - exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + exec 5> "${TRAVIS_BUILD_DIR}/dev-debug.log" BASH_XTRACEFD="5" set -x command_dev_query_raw.sh @@ -1162,7 +1165,7 @@ echo -e "Command: ./${gameservername} donate" requiredstatus="STARTED" fn_setstatus ( - exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + exec 5> "${TRAVIS_BUILD_DIR}/dev-debug.log" BASH_XTRACEFD="5" set -x command_donate.sh diff --git a/tests/tests_jc2server.sh b/tests/tests_jc2server.sh index 4bdadb59f..c86e6dbb9 100644 --- a/tests/tests_jc2server.sh +++ b/tests/tests_jc2server.sh @@ -15,7 +15,7 @@ # Debugging if [ -f ".dev-debug" ]; then - exec 5>dev-debug.log + exec 5> dev-debug.log BASH_XTRACEFD="5" set -x fi @@ -59,14 +59,14 @@ githubrepo="LinuxGSM" githubbranch="${TRAVIS_BRANCH}" # Core function that is required first. -core_functions.sh(){ +core_functions.sh() { functionfile="${FUNCNAME[0]}" fn_bootstrap_fetch_file_github "lgsm/functions" "core_functions.sh" "${functionsdir}" "chmodx" "run" "noforcedl" "nohash" } # Bootstrap # Fetches the core functions required before passed off to core_dl.sh. -fn_bootstrap_fetch_file(){ +fn_bootstrap_fetch_file() { remote_fileurl="${1}" remote_fileurl_backup="${2}" remote_fileurl_name="${3}" @@ -78,16 +78,16 @@ fn_bootstrap_fetch_file(){ forcedl="${9:-0}" md5="${10:-0}" # Download file if missing or download forced. - if [ ! -f "${local_filedir}/${local_filename}" ]||[ "${forcedl}" == "forcedl" ]; then + if [ ! -f "${local_filedir}/${local_filename}" ] || [ "${forcedl}" == "forcedl" ]; then # If backup fileurl exists include it. if [ -n "${remote_fileurl_backup}" ]; then # counter set to 0 to allow second try counter=0 - remote_fileurls_array=( remote_fileurl remote_fileurl_backup ) + remote_fileurls_array=(remote_fileurl remote_fileurl_backup) else # counter set to 1 to not allow second try counter=1 - remote_fileurls_array=( remote_fileurl ) + remote_fileurls_array=(remote_fileurl) fi for remote_fileurl_array in "${remote_fileurls_array[@]}"; do @@ -98,7 +98,7 @@ fn_bootstrap_fetch_file(){ fileurl="${remote_fileurl_backup}" fileurl_name="${remote_fileurl_backup_name}" fi - counter=$((counter+1)) + counter=$((counter + 1)) if [ ! -d "${local_filedir}" ]; then mkdir -p "${local_filedir}" fi @@ -112,7 +112,7 @@ fn_bootstrap_fetch_file(){ local exitcode=$? # Download will fail if downloads a html file. if [ -f "${local_filedir}/${local_filename}" ]; then - if [ -n "$(head "${local_filedir}/${local_filename}" | grep "DOCTYPE" )" ]; then + if [ -n "$(head "${local_filedir}/${local_filename}" | grep "DOCTYPE")" ]; then rm "${local_filedir:?}/${local_filename:?}" local exitcode=2 fi @@ -165,11 +165,11 @@ fn_bootstrap_fetch_file(){ fi } -fn_bootstrap_fetch_file_github(){ +fn_bootstrap_fetch_file_github() { github_file_url_dir="${1}" github_file_url_name="${2}" # If master branch will currently running LinuxGSM version to prevent "version mixing". This is ignored if a fork. - if [ "${githubbranch}" == "master" ]&&[ "${githubuser}" == "GameServerManager" ]&&[ "${commandname}" != "UPDATE-LGSM" ]; then + if [ "${githubbranch}" == "master" ] && [ "${githubuser}" == "GameServerManager" ] && [ "${commandname}" != "UPDATE-LGSM" ]; then remote_fileurl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${version}/${github_file_url_dir}/${github_file_url_name}" remote_fileurl_backup="https://bitbucket.org/${githubuser}/${githubrepo}/raw/${version}/${github_file_url_dir}/${github_file_url_name}" else @@ -193,10 +193,10 @@ fn_bootstrap_fetch_file_github(){ fn_print_center() { columns=$(tput cols) line="$*" - printf "%*s\n" $(( (${#line} + columns) / 2)) "${line}" + printf "%*s\n" $(((${#line} + columns) / 2)) "${line}" } -fn_print_horizontal(){ +fn_print_horizontal() { printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' "=" } @@ -213,11 +213,11 @@ fn_install_menu_bash() { menu_options=() while read -r line || [[ -n "${line}" ]]; do var=$(echo -e "${line}" | awk -F "," '{print $2 " - " $3}') - menu_options+=( "${var}" ) + menu_options+=("${var}") done < "${options}" - menu_options+=( "Cancel" ) + menu_options+=("Cancel") select option in "${menu_options[@]}"; do - if [ "${option}" ]&&[ "${option}" != "Cancel" ]; then + if [ "${option}" ] && [ "${option}" != "Cancel" ]; then eval "$resultvar=\"${option/%\ */}\"" fi break @@ -239,7 +239,7 @@ fn_install_menu_whiptail() { while read -r line; do key=$(echo -e "${line}" | awk -F "," '{print $3}') val=$(echo -e "${line}" | awk -F "," '{print $2}') - menu_options+=( "${val//\"}" "${key//\"}" ) + menu_options+=("${val//\"/}" "${key//\"/}") done < "${options}" OPTION=$(${menucmd} --title "${title}" --menu "${caption}" "${height}" "${width}" "${menuheight}" "${menu_options[@]}" 3>&1 1>&2 2>&3) if [ $? == 0 ]; then @@ -264,24 +264,26 @@ fn_install_menu() { fi done case "$(basename "${menucmd}")" in - whiptail|dialog) - fn_install_menu_whiptail "${menucmd}" selection "${title}" "${caption}" "${options}" 40 80 30;; + whiptail | dialog) + fn_install_menu_whiptail "${menucmd}" selection "${title}" "${caption}" "${options}" 40 80 30 + ;; *) - fn_install_menu_bash selection "${title}" "${caption}" "${options}";; + fn_install_menu_bash selection "${title}" "${caption}" "${options}" + ;; esac eval "$resultvar=\"${selection}\"" } # Gets server info from serverlist.csv and puts in to array. -fn_server_info(){ +fn_server_info() { IFS="," server_info_array=($(grep -aw "${userinput}" "${serverlist}")) - shortname="${server_info_array[0]}" # csgo + shortname="${server_info_array[0]}" # csgo gameservername="${server_info_array[1]}" # csgoserver - gamename="${server_info_array[2]}" # Counter Strike: Global Offensive + gamename="${server_info_array[2]}" # Counter Strike: Global Offensive } -fn_install_getopt(){ +fn_install_getopt() { userinput="empty" echo -e "Usage: $0 [option]" echo -e "" @@ -295,13 +297,13 @@ fn_install_getopt(){ exit } -fn_install_file(){ +fn_install_file() { local_filename="${gameservername}" if [ -e "${local_filename}" ]; then i=2 - while [ -e "${local_filename}-${i}" ] ; do - (( i++ )) - done + while [ -e "${local_filename}-${i}" ]; do + ((i++)) + done local_filename="${local_filename}-${i}" fi cp -R "${selfname}" "${local_filename}" @@ -321,12 +323,12 @@ fn_install_file(){ # Prevent LinuxGSM from running as root. Except if doing a dependency install. if [ "$(whoami)" == "root" ]; then - if [ "${userinput}" == "install" ]||[ "${userinput}" == "auto-install" ]||[ "${userinput}" == "i" ]||[ "${userinput}" == "ai" ]; then + if [ "${userinput}" == "install" ] || [ "${userinput}" == "auto-install" ] || [ "${userinput}" == "i" ] || [ "${userinput}" == "ai" ]; then if [ "${shortname}" == "core" ]; then echo -e "[ FAIL ] Do NOT run this script as root!" exit 1 fi - elif [ ! -f "${functionsdir}/core_functions.sh" ]||[ ! -f "${functionsdir}/check_root.sh" ]||[ ! -f "${functionsdir}/core_messages.sh" ]; then + elif [ ! -f "${functionsdir}/core_functions.sh" ] || [ ! -f "${functionsdir}/check_root.sh" ] || [ ! -f "${functionsdir}/core_messages.sh" ]; then echo -e "[ FAIL ] Do NOT run this script as root!" exit 1 else @@ -344,12 +346,12 @@ if [ "${shortname}" == "core" ]; then exit 1 fi - if [ "${userinput}" == "list" ]||[ "${userinput}" == "l" ]; then + if [ "${userinput}" == "list" ] || [ "${userinput}" == "l" ]; then { tail -n +2 "${serverlist}" | awk -F "," '{print $2 "\t" $3}' } | column -s $'\t' -t | more exit - elif [ "${userinput}" == "install" ]||[ "${userinput}" == "i" ]; then + elif [ "${userinput}" == "install" ] || [ "${userinput}" == "i" ]; then tail -n +2 "${serverlist}" | awk -F "," '{print $1 "," $2 "," $3}' > "${serverlistmenu}" fn_install_menu result "LinuxGSM" "Select game server to install." "${serverlistmenu}" userinput="${result}" @@ -365,7 +367,7 @@ if [ "${shortname}" == "core" ]; then fi elif [ "${userinput}" ]; then fn_server_info - if [ "${userinput}" == "${gameservername}" ]||[ "${userinput}" == "${gamename}" ]||[ "${userinput}" == "${shortname}" ]; then + if [ "${userinput}" == "${gameservername}" ] || [ "${userinput}" == "${gamename}" ] || [ "${userinput}" == "${shortname}" ]; then fn_install_file else echo -e "[ FAIL ] unknown game server" @@ -464,7 +466,7 @@ else fi fi -fn_currentstatus_tmux(){ +fn_currentstatus_tmux() { check_status.sh if [ "${status}" != "0" ]; then currentstatus="STARTED" @@ -473,14 +475,14 @@ fn_currentstatus_tmux(){ fi } -fn_setstatus(){ +fn_setstatus() { fn_currentstatus_tmux echo"" echo -e "Required status: ${requiredstatus}" counter=0 echo -e "Current status: ${currentstatus}" - while [ "${requiredstatus}" != "${currentstatus}" ]; do - counter=$((counter+1)) + while [ "${requiredstatus}" != "${currentstatus}" ]; do + counter=$((counter + 1)) fn_currentstatus_tmux echo -en "New status: ${currentstatus}\\r" @@ -506,7 +508,7 @@ fn_setstatus(){ # End of every test will expect the result to either pass or fail # If the script does not do as intended the whole test will fail # if expecting a pass -fn_test_result_pass(){ +fn_test_result_pass() { if [ $? != 0 ]; then echo -e "=================================" echo -e "Expected result: PASS" @@ -524,7 +526,7 @@ fn_test_result_pass(){ } # if expecting a fail -fn_test_result_fail(){ +fn_test_result_fail() { if [ $? == 0 ]; then echo -e "=================================" echo -e "Expected result: FAIL" @@ -542,7 +544,7 @@ fn_test_result_fail(){ } # test result n/a -fn_test_result_na(){ +fn_test_result_na() { echo -e "=================================" echo -e "Expected result: N/A" echo -e "Actual result: N/A" @@ -632,7 +634,7 @@ echo -e "0.1 - Create log dir's" echo -e "=================================" echo -e "" ( - exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + exec 5> "${TRAVIS_BUILD_DIR}/dev-debug.log" BASH_XTRACEFD="5" set -x install_logs.sh @@ -648,7 +650,7 @@ echo -e "Description:" echo -e "Enable dev-debug" echo -e "" ( - exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + exec 5> "${TRAVIS_BUILD_DIR}/dev-debug.log" BASH_XTRACEFD="5" set -x command_dev_debug.sh @@ -671,13 +673,13 @@ echo -e "Command: ./${gameservername} start" echo -e "" # Allows for testing not on Travis CI if [ -z "${TRAVIS}" ]; then -( - exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" - BASH_XTRACEFD="5" - set -x - command_start.sh -) -fn_test_result_fail + ( + exec 5> "${TRAVIS_BUILD_DIR}/dev-debug.log" + BASH_XTRACEFD="5" + set -x + command_start.sh + ) + fn_test_result_fail else echo -e "Test bypassed" fi @@ -694,7 +696,7 @@ echo -e "displaying options messages." echo -e "Command: ./${gameservername}" echo -e "" ( - exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + exec 5> "${TRAVIS_BUILD_DIR}/dev-debug.log" BASH_XTRACEFD="5" set -x core_getopt.sh @@ -713,7 +715,7 @@ echo -e "Command: ./${gameservername} abc123" echo -e "" getopt="abc123" ( - exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + exec 5> "${TRAVIS_BUILD_DIR}/dev-debug.log" BASH_XTRACEFD="5" set -x core_getopt.sh @@ -734,7 +736,7 @@ echo -e "Description:" echo -e "install ${gamename} server." echo -e "Command: ./${gameservername} auto-install" ( - exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + exec 5> "${TRAVIS_BUILD_DIR}/dev-debug.log" BASH_XTRACEFD="5" set -x fn_autoinstall @@ -757,7 +759,7 @@ echo -e "Command: ./${gameservername} start" requiredstatus="STOPPED" fn_setstatus ( - exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + exec 5> "${TRAVIS_BUILD_DIR}/dev-debug.log" BASH_XTRACEFD="5" set -x command_start.sh @@ -776,7 +778,7 @@ echo -e "Command: ./${gameservername} start" requiredstatus="STARTED" fn_setstatus ( - exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + exec 5> "${TRAVIS_BUILD_DIR}/dev-debug.log" BASH_XTRACEFD="5" set -x command_start.sh @@ -795,10 +797,11 @@ echo -e "Command: ./${gameservername} start" requiredstatus="STOPPED" fn_setstatus ( - exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + exec 5> "${TRAVIS_BUILD_DIR}/dev-debug.log" BASH_XTRACEFD="5" set -x - updateonstart="on";command_start.sh + updateonstart="on" + command_start.sh ) fn_test_result_pass echo -e "run order" @@ -814,7 +817,7 @@ echo -e "Command: ./${gameservername} stop" requiredstatus="STARTED" fn_setstatus ( - exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + exec 5> "${TRAVIS_BUILD_DIR}/dev-debug.log" BASH_XTRACEFD="5" set -x command_stop.sh @@ -833,7 +836,7 @@ echo -e "Command: ./${gameservername} stop" requiredstatus="STOPPED" fn_setstatus ( - exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + exec 5> "${TRAVIS_BUILD_DIR}/dev-debug.log" BASH_XTRACEFD="5" set -x command_stop.sh @@ -852,7 +855,7 @@ echo -e "Command: ./${gameservername} restart" requiredstatus="STARTED" fn_setstatus ( - exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + exec 5> "${TRAVIS_BUILD_DIR}/dev-debug.log" BASH_XTRACEFD="5" set -x command_restart.sh @@ -871,7 +874,7 @@ echo -e "Command: ./${gameservername} restart" requiredstatus="STOPPED" fn_setstatus ( - exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + exec 5> "${TRAVIS_BUILD_DIR}/dev-debug.log" BASH_XTRACEFD="5" set -x command_restart.sh @@ -894,7 +897,7 @@ echo -e "Command: ./${gameservername} update" requiredstatus="STOPPED" fn_setstatus ( - exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + exec 5> "${TRAVIS_BUILD_DIR}/dev-debug.log" BASH_XTRACEFD="5" set -x command_update.sh @@ -915,7 +918,7 @@ fn_setstatus fn_print_info_nl "changed buildid to 0." sed -i 's/[0-9]\+/0/' "${serverfiles}/steamapps/appmanifest_${appid}.acf" ( - exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + exec 5> "${TRAVIS_BUILD_DIR}/dev-debug.log" BASH_XTRACEFD="5" set -x command_update.sh @@ -936,7 +939,7 @@ fn_setstatus fn_print_info_nl "changed buildid to 0." sed -i 's/[0-9]\+/0/' "${serverfiles}/steamapps/appmanifest_${appid}.acf" ( - exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + exec 5> "${TRAVIS_BUILD_DIR}/dev-debug.log" BASH_XTRACEFD="5" set -x command_update.sh @@ -957,7 +960,7 @@ fn_setstatus fn_print_info_nl "removed appmanifest_${appid}.acf." rm --verbose "${serverfiles:?}/steamapps/appmanifest_${appid}.acf" ( - exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + exec 5> "${TRAVIS_BUILD_DIR}/dev-debug.log" BASH_XTRACEFD="5" set -x command_update.sh @@ -976,10 +979,11 @@ echo -e "Command: ./jc2server force-update" requiredstatus="STOPPED" fn_setstatus ( - exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + exec 5> "${TRAVIS_BUILD_DIR}/dev-debug.log" BASH_XTRACEFD="5" set -x - forceupdate=1;command_update.sh + forceupdate=1 + command_update.sh ) fn_test_result_pass echo -e "run order" @@ -995,10 +999,11 @@ echo -e "Command: ./jc2server force-update" requiredstatus="STARTED" fn_setstatus ( - exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + exec 5> "${TRAVIS_BUILD_DIR}/dev-debug.log" BASH_XTRACEFD="5" set -x - forceupdate=1;command_update.sh + forceupdate=1 + command_update.sh ) fn_test_result_pass echo -e "run order" @@ -1014,7 +1019,7 @@ echo -e "Command: ./jc2server validate" requiredstatus="STOPPED" fn_setstatus ( - exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + exec 5> "${TRAVIS_BUILD_DIR}/dev-debug.log" BASH_XTRACEFD="5" set -x command_validate.sh @@ -1034,7 +1039,7 @@ echo -e "Command: ./jc2server validate" requiredstatus="STARTED" fn_setstatus ( - exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + exec 5> "${TRAVIS_BUILD_DIR}/dev-debug.log" BASH_XTRACEFD="5" set -x command_validate.sh @@ -1054,7 +1059,7 @@ echo -e "Command: ./jc2server update-lgam" requiredstatus="STARTED" fn_setstatus ( - exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + exec 5> "${TRAVIS_BUILD_DIR}/dev-debug.log" BASH_XTRACEFD="5" set -x command_update_linuxgsm.sh @@ -1070,7 +1075,7 @@ echo -e "=================================" echo -e "Description:" echo -e "Inserting Travis IP in to config." echo -e "Allows monitor to work" -if [ "$(${ipcommand}-o -4 addr|grep eth0)" ]; then +if [ "$(${ipcommand}-o -4 addr | grep eth0)" ]; then travisip=$(${ipcommand}-o -4 addr | grep eth0 | awk '{print $4}' | grep -oe '\([0-9]\{1,3\}\.\?\)\{4\}' | grep -v 127.0.0) else travisip=$(${ipcommand}-o -4 addr | grep ens | awk '{print $4}' | grep -oe '\([0-9]\{1,3\}\.\?\)\{4\}' | sort -u | grep -v 127.0.0) @@ -1095,7 +1100,7 @@ echo -e "Command: ./${gameservername} monitor" requiredstatus="STARTED" fn_setstatus ( - exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + exec 5> "${TRAVIS_BUILD_DIR}/dev-debug.log" BASH_XTRACEFD="5" set -x command_monitor.sh @@ -1118,7 +1123,7 @@ date '+%s' > "${lockdir}/${selfname}.lock" echo "${version}" >> "${lockdir}/${selfname}.lock" echo "${port}" >> "${lockdir}/${selfname}.lock" ( - exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + exec 5> "${TRAVIS_BUILD_DIR}/dev-debug.log" BASH_XTRACEFD="5" set -x command_monitor.sh @@ -1137,7 +1142,7 @@ echo -e "Command: ./${gameservername} monitor" requiredstatus="STOPPED" fn_setstatus ( - exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + exec 5> "${TRAVIS_BUILD_DIR}/dev-debug.log" BASH_XTRACEFD="5" set -x command_monitor.sh @@ -1158,7 +1163,7 @@ fn_setstatus cp "${servercfgfullpath}" "config.lua" sed -i 's/[0-9]\+/0/' "${servercfgfullpath}" ( - exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + exec 5> "${TRAVIS_BUILD_DIR}/dev-debug.log" BASH_XTRACEFD="5" set -x command_test_alert.sh @@ -1186,7 +1191,7 @@ echo -e "Command: ./${gameservername} details" requiredstatus="STARTED" fn_setstatus ( - exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + exec 5> "${TRAVIS_BUILD_DIR}/dev-debug.log" BASH_XTRACEFD="5" set -x command_details.sh @@ -1205,7 +1210,7 @@ echo -e "Command: ./${gameservername} postdetails" requiredstatus="STARTED" fn_setstatus ( - exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + exec 5> "${TRAVIS_BUILD_DIR}/dev-debug.log" BASH_XTRACEFD="5" set -x command_postdetails.sh @@ -1247,7 +1252,7 @@ echo -e "Command: ./${gameservername} detect-glibc" requiredstatus="STARTED" fn_setstatus ( - exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + exec 5> "${TRAVIS_BUILD_DIR}/dev-debug.log" BASH_XTRACEFD="5" set -x command_dev_detect_glibc.sh @@ -1266,7 +1271,7 @@ echo -e "Command: ./${gameservername} detect-ldd" requiredstatus="STARTED" fn_setstatus ( - exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + exec 5> "${TRAVIS_BUILD_DIR}/dev-debug.log" BASH_XTRACEFD="5" set -x command_dev_detect_ldd.sh @@ -1285,7 +1290,7 @@ echo -e "Command: ./${gameservername} detect-deps" requiredstatus="STARTED" fn_setstatus ( - exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + exec 5> "${TRAVIS_BUILD_DIR}/dev-debug.log" BASH_XTRACEFD="5" set -x command_dev_detect_deps.sh @@ -1304,7 +1309,7 @@ echo -e "Command: ./${gameservername} query-raw" requiredstatus="STARTED" fn_setstatus ( - exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + exec 5> "${TRAVIS_BUILD_DIR}/dev-debug.log" BASH_XTRACEFD="5" set -x command_dev_query_raw.sh @@ -1327,7 +1332,7 @@ echo -e "Command: ./${gameservername} donate" requiredstatus="STARTED" fn_setstatus ( - exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + exec 5> "${TRAVIS_BUILD_DIR}/dev-debug.log" BASH_XTRACEFD="5" set -x command_donate.sh diff --git a/tests/tests_mcserver.sh b/tests/tests_mcserver.sh index f9e64e07c..36f3349cd 100644 --- a/tests/tests_mcserver.sh +++ b/tests/tests_mcserver.sh @@ -15,7 +15,7 @@ # Debugging if [ -f ".dev-debug" ]; then - exec 5>dev-debug.log + exec 5> dev-debug.log BASH_XTRACEFD="5" set -x fi @@ -59,14 +59,14 @@ githubrepo="LinuxGSM" githubbranch="${TRAVIS_BRANCH}" # Core function that is required first. -core_functions.sh(){ +core_functions.sh() { functionfile="${FUNCNAME[0]}" fn_bootstrap_fetch_file_github "lgsm/functions" "core_functions.sh" "${functionsdir}" "chmodx" "run" "noforcedl" "nohash" } # Bootstrap # Fetches the core functions required before passed off to core_dl.sh. -fn_bootstrap_fetch_file(){ +fn_bootstrap_fetch_file() { remote_fileurl="${1}" remote_fileurl_backup="${2}" remote_fileurl_name="${3}" @@ -78,16 +78,16 @@ fn_bootstrap_fetch_file(){ forcedl="${9:-0}" md5="${10:-0}" # Download file if missing or download forced. - if [ ! -f "${local_filedir}/${local_filename}" ]||[ "${forcedl}" == "forcedl" ]; then + if [ ! -f "${local_filedir}/${local_filename}" ] || [ "${forcedl}" == "forcedl" ]; then # If backup fileurl exists include it. if [ -n "${remote_fileurl_backup}" ]; then # counter set to 0 to allow second try counter=0 - remote_fileurls_array=( remote_fileurl remote_fileurl_backup ) + remote_fileurls_array=(remote_fileurl remote_fileurl_backup) else # counter set to 1 to not allow second try counter=1 - remote_fileurls_array=( remote_fileurl ) + remote_fileurls_array=(remote_fileurl) fi for remote_fileurl_array in "${remote_fileurls_array[@]}"; do @@ -98,7 +98,7 @@ fn_bootstrap_fetch_file(){ fileurl="${remote_fileurl_backup}" fileurl_name="${remote_fileurl_backup_name}" fi - counter=$((counter+1)) + counter=$((counter + 1)) if [ ! -d "${local_filedir}" ]; then mkdir -p "${local_filedir}" fi @@ -112,7 +112,7 @@ fn_bootstrap_fetch_file(){ local exitcode=$? # Download will fail if downloads a html file. if [ -f "${local_filedir}/${local_filename}" ]; then - if [ -n "$(head "${local_filedir}/${local_filename}" | grep "DOCTYPE" )" ]; then + if [ -n "$(head "${local_filedir}/${local_filename}" | grep "DOCTYPE")" ]; then rm "${local_filedir:?}/${local_filename:?}" local exitcode=2 fi @@ -165,11 +165,11 @@ fn_bootstrap_fetch_file(){ fi } -fn_bootstrap_fetch_file_github(){ +fn_bootstrap_fetch_file_github() { github_file_url_dir="${1}" github_file_url_name="${2}" # If master branch will currently running LinuxGSM version to prevent "version mixing". This is ignored if a fork. - if [ "${githubbranch}" == "master" ]&&[ "${githubuser}" == "GameServerManager" ]&&[ "${commandname}" != "UPDATE-LGSM" ]; then + if [ "${githubbranch}" == "master" ] && [ "${githubuser}" == "GameServerManager" ] && [ "${commandname}" != "UPDATE-LGSM" ]; then remote_fileurl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${version}/${github_file_url_dir}/${github_file_url_name}" remote_fileurl_backup="https://bitbucket.org/${githubuser}/${githubrepo}/raw/${version}/${github_file_url_dir}/${github_file_url_name}" else @@ -193,10 +193,10 @@ fn_bootstrap_fetch_file_github(){ fn_print_center() { columns=$(tput cols) line="$*" - printf "%*s\n" $(( (${#line} + columns) / 2)) "${line}" + printf "%*s\n" $(((${#line} + columns) / 2)) "${line}" } -fn_print_horizontal(){ +fn_print_horizontal() { printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' "=" } @@ -213,11 +213,11 @@ fn_install_menu_bash() { menu_options=() while read -r line || [[ -n "${line}" ]]; do var=$(echo -e "${line}" | awk -F "," '{print $2 " - " $3}') - menu_options+=( "${var}" ) + menu_options+=("${var}") done < "${options}" - menu_options+=( "Cancel" ) + menu_options+=("Cancel") select option in "${menu_options[@]}"; do - if [ "${option}" ]&&[ "${option}" != "Cancel" ]; then + if [ "${option}" ] && [ "${option}" != "Cancel" ]; then eval "$resultvar=\"${option/%\ */}\"" fi break @@ -239,7 +239,7 @@ fn_install_menu_whiptail() { while read -r line; do key=$(echo -e "${line}" | awk -F "," '{print $3}') val=$(echo -e "${line}" | awk -F "," '{print $2}') - menu_options+=( "${val//\"}" "${key//\"}" ) + menu_options+=("${val//\"/}" "${key//\"/}") done < "${options}" OPTION=$(${menucmd} --title "${title}" --menu "${caption}" "${height}" "${width}" "${menuheight}" "${menu_options[@]}" 3>&1 1>&2 2>&3) if [ $? == 0 ]; then @@ -264,24 +264,26 @@ fn_install_menu() { fi done case "$(basename "${menucmd}")" in - whiptail|dialog) - fn_install_menu_whiptail "${menucmd}" selection "${title}" "${caption}" "${options}" 40 80 30;; + whiptail | dialog) + fn_install_menu_whiptail "${menucmd}" selection "${title}" "${caption}" "${options}" 40 80 30 + ;; *) - fn_install_menu_bash selection "${title}" "${caption}" "${options}";; + fn_install_menu_bash selection "${title}" "${caption}" "${options}" + ;; esac eval "$resultvar=\"${selection}\"" } # Gets server info from serverlist.csv and puts in to array. -fn_server_info(){ +fn_server_info() { IFS="," server_info_array=($(grep -aw "${userinput}" "${serverlist}")) - shortname="${server_info_array[0]}" # csgo + shortname="${server_info_array[0]}" # csgo gameservername="${server_info_array[1]}" # csgoserver - gamename="${server_info_array[2]}" # Counter Strike: Global Offensive + gamename="${server_info_array[2]}" # Counter Strike: Global Offensive } -fn_install_getopt(){ +fn_install_getopt() { userinput="empty" echo -e "Usage: $0 [option]" echo -e "" @@ -295,13 +297,13 @@ fn_install_getopt(){ exit } -fn_install_file(){ +fn_install_file() { local_filename="${gameservername}" if [ -e "${local_filename}" ]; then i=2 - while [ -e "${local_filename}-${i}" ] ; do - (( i++ )) - done + while [ -e "${local_filename}-${i}" ]; do + ((i++)) + done local_filename="${local_filename}-${i}" fi cp -R "${selfname}" "${local_filename}" @@ -321,12 +323,12 @@ fn_install_file(){ # Prevent LinuxGSM from running as root. Except if doing a dependency install. if [ "$(whoami)" == "root" ]; then - if [ "${userinput}" == "install" ]||[ "${userinput}" == "auto-install" ]||[ "${userinput}" == "i" ]||[ "${userinput}" == "ai" ]; then + if [ "${userinput}" == "install" ] || [ "${userinput}" == "auto-install" ] || [ "${userinput}" == "i" ] || [ "${userinput}" == "ai" ]; then if [ "${shortname}" == "core" ]; then echo -e "[ FAIL ] Do NOT run this script as root!" exit 1 fi - elif [ ! -f "${functionsdir}/core_functions.sh" ]||[ ! -f "${functionsdir}/check_root.sh" ]||[ ! -f "${functionsdir}/core_messages.sh" ]; then + elif [ ! -f "${functionsdir}/core_functions.sh" ] || [ ! -f "${functionsdir}/check_root.sh" ] || [ ! -f "${functionsdir}/core_messages.sh" ]; then echo -e "[ FAIL ] Do NOT run this script as root!" exit 1 else @@ -344,12 +346,12 @@ if [ "${shortname}" == "core" ]; then exit 1 fi - if [ "${userinput}" == "list" ]||[ "${userinput}" == "l" ]; then + if [ "${userinput}" == "list" ] || [ "${userinput}" == "l" ]; then { tail -n +2 "${serverlist}" | awk -F "," '{print $2 "\t" $3}' } | column -s $'\t' -t | more exit - elif [ "${userinput}" == "install" ]||[ "${userinput}" == "i" ]; then + elif [ "${userinput}" == "install" ] || [ "${userinput}" == "i" ]; then tail -n +2 "${serverlist}" | awk -F "," '{print $1 "," $2 "," $3}' > "${serverlistmenu}" fn_install_menu result "LinuxGSM" "Select game server to install." "${serverlistmenu}" userinput="${result}" @@ -365,7 +367,7 @@ if [ "${shortname}" == "core" ]; then fi elif [ "${userinput}" ]; then fn_server_info - if [ "${userinput}" == "${gameservername}" ]||[ "${userinput}" == "${gamename}" ]||[ "${userinput}" == "${shortname}" ]; then + if [ "${userinput}" == "${gameservername}" ] || [ "${userinput}" == "${gamename}" ] || [ "${userinput}" == "${shortname}" ]; then fn_install_file else echo -e "[ FAIL ] unknown game server" @@ -464,7 +466,7 @@ else fi fi -fn_currentstatus_tmux(){ +fn_currentstatus_tmux() { check_status.sh if [ "${status}" != "0" ]; then currentstatus="STARTED" @@ -473,14 +475,14 @@ fn_currentstatus_tmux(){ fi } -fn_setstatus(){ +fn_setstatus() { fn_currentstatus_tmux echo"" echo -e "Required status: ${requiredstatus}" counter=0 echo -e "Current status: ${currentstatus}" - while [ "${requiredstatus}" != "${currentstatus}" ]; do - counter=$((counter+1)) + while [ "${requiredstatus}" != "${currentstatus}" ]; do + counter=$((counter + 1)) fn_currentstatus_tmux echo -en "New status: ${currentstatus}\\r" @@ -506,7 +508,7 @@ fn_setstatus(){ # End of every test will expect the result to either pass or fail # If the script does not do as intended the whole test will fail # if expecting a pass -fn_test_result_pass(){ +fn_test_result_pass() { if [ $? != 0 ]; then echo -e "=================================" echo -e "Expected result: PASS" @@ -524,7 +526,7 @@ fn_test_result_pass(){ } # if expecting a fail -fn_test_result_fail(){ +fn_test_result_fail() { if [ $? == 0 ]; then echo -e "=================================" echo -e "Expected result: FAIL" @@ -542,7 +544,7 @@ fn_test_result_fail(){ } # test result n/a -fn_test_result_na(){ +fn_test_result_na() { echo -e "=================================" echo -e "Expected result: N/A" echo -e "Actual result: N/A" @@ -626,7 +628,7 @@ echo -e "0.1 - Create log dir's" echo -e "=================================" echo -e "" ( - exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + exec 5> "${TRAVIS_BUILD_DIR}/dev-debug.log" BASH_XTRACEFD="5" set -x install_logs.sh @@ -642,7 +644,7 @@ echo -e "Description:" echo -e "Enable dev-debug" echo -e "" ( - exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + exec 5> "${TRAVIS_BUILD_DIR}/dev-debug.log" BASH_XTRACEFD="5" set -x command_dev_debug.sh @@ -665,13 +667,13 @@ echo -e "Command: ./${gameservername} start" echo -e "" # Allows for testing not on Travis CI if [ -z "${TRAVIS}" ]; then -( - exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" - BASH_XTRACEFD="5" - set -x - command_start.sh -) -fn_test_result_fail + ( + exec 5> "${TRAVIS_BUILD_DIR}/dev-debug.log" + BASH_XTRACEFD="5" + set -x + command_start.sh + ) + fn_test_result_fail else echo -e "Test bypassed" fi @@ -688,7 +690,7 @@ echo -e "displaying options messages." echo -e "Command: ./${gameservername}" echo -e "" ( - exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + exec 5> "${TRAVIS_BUILD_DIR}/dev-debug.log" BASH_XTRACEFD="5" set -x core_getopt.sh @@ -707,7 +709,7 @@ echo -e "Command: ./${gameservername} abc123" echo -e "" getopt="abc123" ( - exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + exec 5> "${TRAVIS_BUILD_DIR}/dev-debug.log" BASH_XTRACEFD="5" set -x core_getopt.sh @@ -728,7 +730,7 @@ echo -e "Description:" echo -e "install ${gamename} server." echo -e "Command: ./${gameservername} auto-install" ( - exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + exec 5> "${TRAVIS_BUILD_DIR}/dev-debug.log" BASH_XTRACEFD="5" set -x fn_autoinstall @@ -751,7 +753,7 @@ echo -e "Command: ./${gameservername} start" requiredstatus="STOPPED" fn_setstatus ( - exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + exec 5> "${TRAVIS_BUILD_DIR}/dev-debug.log" BASH_XTRACEFD="5" set -x command_start.sh @@ -770,7 +772,7 @@ echo -e "Command: ./${gameservername} start" requiredstatus="STARTED" fn_setstatus ( - exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + exec 5> "${TRAVIS_BUILD_DIR}/dev-debug.log" BASH_XTRACEFD="5" set -x command_start.sh @@ -789,10 +791,11 @@ echo -e "Command: ./${gameservername} start" requiredstatus="STOPPED" fn_setstatus ( - exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + exec 5> "${TRAVIS_BUILD_DIR}/dev-debug.log" BASH_XTRACEFD="5" set -x - updateonstart="on";command_start.sh + updateonstart="on" + command_start.sh ) fn_test_result_pass echo -e "run order" @@ -817,7 +820,7 @@ echo -e "Command: ./${gameservername} stop" requiredstatus="STARTED" fn_setstatus ( - exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + exec 5> "${TRAVIS_BUILD_DIR}/dev-debug.log" BASH_XTRACEFD="5" set -x command_stop.sh @@ -836,7 +839,7 @@ echo -e "Command: ./${gameservername} stop" requiredstatus="STOPPED" fn_setstatus ( - exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + exec 5> "${TRAVIS_BUILD_DIR}/dev-debug.log" BASH_XTRACEFD="5" set -x command_stop.sh @@ -855,7 +858,7 @@ echo -e "Command: ./${gameservername} restart" requiredstatus="STARTED" fn_setstatus ( - exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + exec 5> "${TRAVIS_BUILD_DIR}/dev-debug.log" BASH_XTRACEFD="5" set -x command_restart.sh @@ -874,7 +877,7 @@ echo -e "Command: ./${gameservername} restart" requiredstatus="STOPPED" fn_setstatus ( - exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + exec 5> "${TRAVIS_BUILD_DIR}/dev-debug.log" BASH_XTRACEFD="5" set -x command_restart.sh @@ -897,7 +900,7 @@ echo -e "Command: ./${gameservername} update" requiredstatus="STOPPED" fn_setstatus ( - exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + exec 5> "${TRAVIS_BUILD_DIR}/dev-debug.log" BASH_XTRACEFD="5" set -x command_update.sh @@ -917,7 +920,7 @@ echo -e "Command: ./jc2server update-lgam" requiredstatus="STARTED" fn_setstatus ( - exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + exec 5> "${TRAVIS_BUILD_DIR}/dev-debug.log" BASH_XTRACEFD="5" set -x command_update_linuxgsm.sh @@ -933,7 +936,7 @@ echo -e "=================================" echo -e "Description:" echo -e "Inserting Travis IP in to config." echo -e "Allows monitor to work" -if [ "$(${ipcommand}-o -4 addr|grep eth0)" ]; then +if [ "$(${ipcommand}-o -4 addr | grep eth0)" ]; then travisip=$(${ipcommand}-o -4 addr | grep eth0 | awk '{print $4}' | grep -oe '\([0-9]\{1,3\}\.\?\)\{4\}' | grep -v 127.0.0) else travisip=$(${ipcommand}-o -4 addr | grep ens | awk '{print $4}' | grep -oe '\([0-9]\{1,3\}\.\?\)\{4\}' | sort -u | grep -v 127.0.0) @@ -968,7 +971,7 @@ echo -e "Command: ./${gameservername} monitor" requiredstatus="STARTED" fn_setstatus ( - exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + exec 5> "${TRAVIS_BUILD_DIR}/dev-debug.log" BASH_XTRACEFD="5" set -x command_monitor.sh @@ -991,7 +994,7 @@ date '+%s' > "${lockdir}/${selfname}.lock" echo "${version}" >> "${lockdir}/${selfname}.lock" echo "${port}" >> "${lockdir}/${selfname}.lock" ( - exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + exec 5> "${TRAVIS_BUILD_DIR}/dev-debug.log" BASH_XTRACEFD="5" set -x command_monitor.sh @@ -1010,7 +1013,7 @@ echo -e "Command: ./${gameservername} monitor" requiredstatus="STOPPED" fn_setstatus ( - exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + exec 5> "${TRAVIS_BUILD_DIR}/dev-debug.log" BASH_XTRACEFD="5" set -x command_monitor.sh @@ -1029,7 +1032,7 @@ echo -e "Command: ./${gameservername} test-alert" requiredstatus="STOPPED" fn_setstatus ( - exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + exec 5> "${TRAVIS_BUILD_DIR}/dev-debug.log" BASH_XTRACEFD="5" set -x command_test_alert.sh @@ -1052,7 +1055,7 @@ echo -e "Command: ./${gameservername} details" requiredstatus="STARTED" fn_setstatus ( - exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + exec 5> "${TRAVIS_BUILD_DIR}/dev-debug.log" BASH_XTRACEFD="5" set -x command_details.sh @@ -1071,7 +1074,7 @@ echo -e "Command: ./${gameservername} postdetails" requiredstatus="STARTED" fn_setstatus ( - exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + exec 5> "${TRAVIS_BUILD_DIR}/dev-debug.log" BASH_XTRACEFD="5" set -x command_postdetails.sh @@ -1113,7 +1116,7 @@ echo -e "Command: ./${gameservername} detect-glibc" requiredstatus="STARTED" fn_setstatus ( - exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + exec 5> "${TRAVIS_BUILD_DIR}/dev-debug.log" BASH_XTRACEFD="5" set -x command_dev_detect_glibc.sh @@ -1132,7 +1135,7 @@ echo -e "Command: ./${gameservername} detect-ldd" requiredstatus="STARTED" fn_setstatus ( - exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + exec 5> "${TRAVIS_BUILD_DIR}/dev-debug.log" BASH_XTRACEFD="5" set -x command_dev_detect_ldd.sh @@ -1151,7 +1154,7 @@ echo -e "Command: ./${gameservername} detect-deps" requiredstatus="STARTED" fn_setstatus ( - exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + exec 5> "${TRAVIS_BUILD_DIR}/dev-debug.log" BASH_XTRACEFD="5" set -x command_dev_detect_deps.sh @@ -1167,7 +1170,7 @@ echo -e "=================================" echo -e "Description:" echo -e "Inserting Travis IP in to config." echo -e "Allows monitor to work" -if [ "$(${ipcommand}-o -4 addr|grep eth0)" ]; then +if [ "$(${ipcommand}-o -4 addr | grep eth0)" ]; then travisip=$(${ipcommand}-o -4 addr | grep eth0 | awk '{print $4}' | grep -oe '\([0-9]\{1,3\}\.\?\)\{4\}' | grep -v 127.0.0) else travisip=$(${ipcommand}-o -4 addr | grep ens | awk '{print $4}' | grep -oe '\([0-9]\{1,3\}\.\?\)\{4\}' | sort -u | grep -v 127.0.0) @@ -1184,7 +1187,7 @@ echo -e "Command: ./${gameservername} query-raw" requiredstatus="STARTED" fn_setstatus ( - exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + exec 5> "${TRAVIS_BUILD_DIR}/dev-debug.log" BASH_XTRACEFD="5" set -x command_dev_query_raw.sh @@ -1207,7 +1210,7 @@ echo -e "Command: ./${gameservername} donate" requiredstatus="STARTED" fn_setstatus ( - exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + exec 5> "${TRAVIS_BUILD_DIR}/dev-debug.log" BASH_XTRACEFD="5" set -x command_donate.sh diff --git a/tests/tests_shellcheck.sh b/tests/tests_shellcheck.sh index f4bbf4868..c277a5177 100644 --- a/tests/tests_shellcheck.sh +++ b/tests/tests_shellcheck.sh @@ -21,10 +21,10 @@ echo -e "Using: Shellcheck" echo -e "Testing Branch: $TRAVIS_BRANCH" echo -e "=================================" echo -e "" -scissues=$(find . -type f \( -name "*.sh" -o -name "*.cfg" \) -not -path "./shunit2-2.1.6/*" -exec shellcheck --shell=bash --exclude=SC2154,SC2034 {} \; | grep -F "^--" | wc -l) +scissues=$(find . -type f \( -name "*.sh" -o -name "*.cfg" \) -not -path "./shunit2-2.1.6/*" -exec shellcheck --shell=bash --exclude=SC2154,SC2034 {} \; | grep -F "^--" | wc -l) echo -e "Found issues: ${scissues}" echo -e "=================================" -find . -type f \( -name "*.sh" -o -name "*.cfg" \) -not -path "./shunit2-2.1.6/*" -exec shellcheck --shell=bash --exclude=SC2154,SC2034 {} \; +find . -type f \( -name "*.sh" -o -name "*.cfg" \) -not -path "./shunit2-2.1.6/*" -exec shellcheck --shell=bash --exclude=SC2154,SC2034 {} \; echo -e "" echo -e "=================================" echo -e "Bash Analysis Tests - Complete!" diff --git a/tests/tests_ts3server.sh b/tests/tests_ts3server.sh index bb149ded7..466753e3d 100644 --- a/tests/tests_ts3server.sh +++ b/tests/tests_ts3server.sh @@ -15,7 +15,7 @@ # Debugging if [ -f ".dev-debug" ]; then - exec 5>dev-debug.log + exec 5> dev-debug.log BASH_XTRACEFD="5" set -x fi @@ -59,14 +59,14 @@ githubrepo="LinuxGSM" githubbranch="${TRAVIS_BRANCH}" # Core function that is required first. -core_functions.sh(){ +core_functions.sh() { functionfile="${FUNCNAME[0]}" fn_bootstrap_fetch_file_github "lgsm/functions" "core_functions.sh" "${functionsdir}" "chmodx" "run" "noforcedl" "nohash" } # Bootstrap # Fetches the core functions required before passed off to core_dl.sh. -fn_bootstrap_fetch_file(){ +fn_bootstrap_fetch_file() { remote_fileurl="${1}" remote_fileurl_backup="${2}" remote_fileurl_name="${3}" @@ -78,16 +78,16 @@ fn_bootstrap_fetch_file(){ forcedl="${9:-0}" md5="${10:-0}" # Download file if missing or download forced. - if [ ! -f "${local_filedir}/${local_filename}" ]||[ "${forcedl}" == "forcedl" ]; then + if [ ! -f "${local_filedir}/${local_filename}" ] || [ "${forcedl}" == "forcedl" ]; then # If backup fileurl exists include it. if [ -n "${remote_fileurl_backup}" ]; then # counter set to 0 to allow second try counter=0 - remote_fileurls_array=( remote_fileurl remote_fileurl_backup ) + remote_fileurls_array=(remote_fileurl remote_fileurl_backup) else # counter set to 1 to not allow second try counter=1 - remote_fileurls_array=( remote_fileurl ) + remote_fileurls_array=(remote_fileurl) fi for remote_fileurl_array in "${remote_fileurls_array[@]}"; do @@ -98,7 +98,7 @@ fn_bootstrap_fetch_file(){ fileurl="${remote_fileurl_backup}" fileurl_name="${remote_fileurl_backup_name}" fi - counter=$((counter+1)) + counter=$((counter + 1)) if [ ! -d "${local_filedir}" ]; then mkdir -p "${local_filedir}" fi @@ -112,7 +112,7 @@ fn_bootstrap_fetch_file(){ local exitcode=$? # Download will fail if downloads a html file. if [ -f "${local_filedir}/${local_filename}" ]; then - if [ -n "$(head "${local_filedir}/${local_filename}" | grep "DOCTYPE" )" ]; then + if [ -n "$(head "${local_filedir}/${local_filename}" | grep "DOCTYPE")" ]; then rm "${local_filedir:?}/${local_filename:?}" local exitcode=2 fi @@ -165,11 +165,11 @@ fn_bootstrap_fetch_file(){ fi } -fn_bootstrap_fetch_file_github(){ +fn_bootstrap_fetch_file_github() { github_file_url_dir="${1}" github_file_url_name="${2}" # If master branch will currently running LinuxGSM version to prevent "version mixing". This is ignored if a fork. - if [ "${githubbranch}" == "master" ]&&[ "${githubuser}" == "GameServerManager" ]&&[ "${commandname}" != "UPDATE-LGSM" ]; then + if [ "${githubbranch}" == "master" ] && [ "${githubuser}" == "GameServerManager" ] && [ "${commandname}" != "UPDATE-LGSM" ]; then remote_fileurl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${version}/${github_file_url_dir}/${github_file_url_name}" remote_fileurl_backup="https://bitbucket.org/${githubuser}/${githubrepo}/raw/${version}/${github_file_url_dir}/${github_file_url_name}" else @@ -193,10 +193,10 @@ fn_bootstrap_fetch_file_github(){ fn_print_center() { columns=$(tput cols) line="$*" - printf "%*s\n" $(( (${#line} + columns) / 2)) "${line}" + printf "%*s\n" $(((${#line} + columns) / 2)) "${line}" } -fn_print_horizontal(){ +fn_print_horizontal() { printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' "=" } @@ -213,11 +213,11 @@ fn_install_menu_bash() { menu_options=() while read -r line || [[ -n "${line}" ]]; do var=$(echo -e "${line}" | awk -F "," '{print $2 " - " $3}') - menu_options+=( "${var}" ) + menu_options+=("${var}") done < "${options}" - menu_options+=( "Cancel" ) + menu_options+=("Cancel") select option in "${menu_options[@]}"; do - if [ "${option}" ]&&[ "${option}" != "Cancel" ]; then + if [ "${option}" ] && [ "${option}" != "Cancel" ]; then eval "$resultvar=\"${option/%\ */}\"" fi break @@ -239,7 +239,7 @@ fn_install_menu_whiptail() { while read -r line; do key=$(echo -e "${line}" | awk -F "," '{print $3}') val=$(echo -e "${line}" | awk -F "," '{print $2}') - menu_options+=( "${val//\"}" "${key//\"}" ) + menu_options+=("${val//\"/}" "${key//\"/}") done < "${options}" OPTION=$(${menucmd} --title "${title}" --menu "${caption}" "${height}" "${width}" "${menuheight}" "${menu_options[@]}" 3>&1 1>&2 2>&3) if [ $? == 0 ]; then @@ -264,24 +264,26 @@ fn_install_menu() { fi done case "$(basename "${menucmd}")" in - whiptail|dialog) - fn_install_menu_whiptail "${menucmd}" selection "${title}" "${caption}" "${options}" 40 80 30;; + whiptail | dialog) + fn_install_menu_whiptail "${menucmd}" selection "${title}" "${caption}" "${options}" 40 80 30 + ;; *) - fn_install_menu_bash selection "${title}" "${caption}" "${options}";; + fn_install_menu_bash selection "${title}" "${caption}" "${options}" + ;; esac eval "$resultvar=\"${selection}\"" } # Gets server info from serverlist.csv and puts in to array. -fn_server_info(){ +fn_server_info() { IFS="," server_info_array=($(grep -aw "${userinput}" "${serverlist}")) - shortname="${server_info_array[0]}" # csgo + shortname="${server_info_array[0]}" # csgo gameservername="${server_info_array[1]}" # csgoserver - gamename="${server_info_array[2]}" # Counter Strike: Global Offensive + gamename="${server_info_array[2]}" # Counter Strike: Global Offensive } -fn_install_getopt(){ +fn_install_getopt() { userinput="empty" echo -e "Usage: $0 [option]" echo -e "" @@ -295,13 +297,13 @@ fn_install_getopt(){ exit } -fn_install_file(){ +fn_install_file() { local_filename="${gameservername}" if [ -e "${local_filename}" ]; then i=2 - while [ -e "${local_filename}-${i}" ] ; do - (( i++ )) - done + while [ -e "${local_filename}-${i}" ]; do + ((i++)) + done local_filename="${local_filename}-${i}" fi cp -R "${selfname}" "${local_filename}" @@ -321,12 +323,12 @@ fn_install_file(){ # Prevent LinuxGSM from running as root. Except if doing a dependency install. if [ "$(whoami)" == "root" ]; then - if [ "${userinput}" == "install" ]||[ "${userinput}" == "auto-install" ]||[ "${userinput}" == "i" ]||[ "${userinput}" == "ai" ]; then + if [ "${userinput}" == "install" ] || [ "${userinput}" == "auto-install" ] || [ "${userinput}" == "i" ] || [ "${userinput}" == "ai" ]; then if [ "${shortname}" == "core" ]; then echo -e "[ FAIL ] Do NOT run this script as root!" exit 1 fi - elif [ ! -f "${functionsdir}/core_functions.sh" ]||[ ! -f "${functionsdir}/check_root.sh" ]||[ ! -f "${functionsdir}/core_messages.sh" ]; then + elif [ ! -f "${functionsdir}/core_functions.sh" ] || [ ! -f "${functionsdir}/check_root.sh" ] || [ ! -f "${functionsdir}/core_messages.sh" ]; then echo -e "[ FAIL ] Do NOT run this script as root!" exit 1 else @@ -344,12 +346,12 @@ if [ "${shortname}" == "core" ]; then exit 1 fi - if [ "${userinput}" == "list" ]||[ "${userinput}" == "l" ]; then + if [ "${userinput}" == "list" ] || [ "${userinput}" == "l" ]; then { tail -n +2 "${serverlist}" | awk -F "," '{print $2 "\t" $3}' } | column -s $'\t' -t | more exit - elif [ "${userinput}" == "install" ]||[ "${userinput}" == "i" ]; then + elif [ "${userinput}" == "install" ] || [ "${userinput}" == "i" ]; then tail -n +2 "${serverlist}" | awk -F "," '{print $1 "," $2 "," $3}' > "${serverlistmenu}" fn_install_menu result "LinuxGSM" "Select game server to install." "${serverlistmenu}" userinput="${result}" @@ -365,7 +367,7 @@ if [ "${shortname}" == "core" ]; then fi elif [ "${userinput}" ]; then fn_server_info - if [ "${userinput}" == "${gameservername}" ]||[ "${userinput}" == "${gamename}" ]||[ "${userinput}" == "${shortname}" ]; then + if [ "${userinput}" == "${gameservername}" ] || [ "${userinput}" == "${gamename}" ] || [ "${userinput}" == "${shortname}" ]; then fn_install_file else echo -e "[ FAIL ] unknown game server" @@ -464,7 +466,7 @@ else fi fi -fn_currentstatus_tmux(){ +fn_currentstatus_tmux() { check_status.sh if [ "${status}" != "0" ]; then currentstatus="STARTED" @@ -473,14 +475,14 @@ fn_currentstatus_tmux(){ fi } -fn_setstatus(){ +fn_setstatus() { fn_currentstatus_tmux echo"" echo -e "Required status: ${requiredstatus}" counter=0 echo -e "Current status: ${currentstatus}" - while [ "${requiredstatus}" != "${currentstatus}" ]; do - counter=$((counter+1)) + while [ "${requiredstatus}" != "${currentstatus}" ]; do + counter=$((counter + 1)) fn_currentstatus_tmux echo -en "New status: ${currentstatus}\\r" @@ -506,7 +508,7 @@ fn_setstatus(){ # End of every test will expect the result to either pass or fail # If the script does not do as intended the whole test will fail # if expecting a pass -fn_test_result_pass(){ +fn_test_result_pass() { if [ $? != 0 ]; then echo -e "=================================" echo -e "Expected result: PASS" @@ -524,7 +526,7 @@ fn_test_result_pass(){ } # if expecting a fail -fn_test_result_fail(){ +fn_test_result_fail() { if [ $? == 0 ]; then echo -e "=================================" echo -e "Expected result: FAIL" @@ -542,7 +544,7 @@ fn_test_result_fail(){ } # test result n/a -fn_test_result_na(){ +fn_test_result_na() { echo -e "=================================" echo -e "Expected result: N/A" echo -e "Actual result: N/A" @@ -626,7 +628,7 @@ echo -e "0.1 - Create log dir's" echo -e "=================================" echo -e "" ( - exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + exec 5> "${TRAVIS_BUILD_DIR}/dev-debug.log" BASH_XTRACEFD="5" set -x install_logs.sh @@ -642,7 +644,7 @@ echo -e "Description:" echo -e "Enable dev-debug" echo -e "" ( - exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + exec 5> "${TRAVIS_BUILD_DIR}/dev-debug.log" BASH_XTRACEFD="5" set -x command_dev_debug.sh @@ -665,13 +667,13 @@ echo -e "Command: ./${gameservername} start" echo -e "" # Allows for testing not on Travis CI if [ -z "${TRAVIS}" ]; then -( - exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" - BASH_XTRACEFD="5" - set -x - command_start.sh -) -fn_test_result_fail + ( + exec 5> "${TRAVIS_BUILD_DIR}/dev-debug.log" + BASH_XTRACEFD="5" + set -x + command_start.sh + ) + fn_test_result_fail else echo -e "Test bypassed" fi @@ -688,7 +690,7 @@ echo -e "displaying options messages." echo -e "Command: ./${gameservername}" echo -e "" ( - exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + exec 5> "${TRAVIS_BUILD_DIR}/dev-debug.log" BASH_XTRACEFD="5" set -x core_getopt.sh @@ -707,7 +709,7 @@ echo -e "Command: ./${gameservername} abc123" echo -e "" getopt="abc123" ( - exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + exec 5> "${TRAVIS_BUILD_DIR}/dev-debug.log" BASH_XTRACEFD="5" set -x core_getopt.sh @@ -728,7 +730,7 @@ echo -e "Description:" echo -e "install ${gamename} server." echo -e "Command: ./${gameservername} auto-install" ( - exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + exec 5> "${TRAVIS_BUILD_DIR}/dev-debug.log" BASH_XTRACEFD="5" set -x fn_autoinstall @@ -751,7 +753,7 @@ echo -e "Command: ./${gameservername} start" requiredstatus="STOPPED" fn_setstatus ( - exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + exec 5> "${TRAVIS_BUILD_DIR}/dev-debug.log" BASH_XTRACEFD="5" set -x command_start.sh @@ -770,7 +772,7 @@ echo -e "Command: ./${gameservername} start" requiredstatus="STARTED" fn_setstatus ( - exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + exec 5> "${TRAVIS_BUILD_DIR}/dev-debug.log" BASH_XTRACEFD="5" set -x command_start.sh @@ -789,10 +791,11 @@ echo -e "Command: ./${gameservername} start" requiredstatus="STOPPED" fn_setstatus ( - exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + exec 5> "${TRAVIS_BUILD_DIR}/dev-debug.log" BASH_XTRACEFD="5" set -x - updateonstart="on";command_start.sh + updateonstart="on" + command_start.sh ) fn_test_result_pass echo -e "run order" @@ -808,7 +811,7 @@ echo -e "Command: ./${gameservername} stop" requiredstatus="STARTED" fn_setstatus ( - exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + exec 5> "${TRAVIS_BUILD_DIR}/dev-debug.log" BASH_XTRACEFD="5" set -x command_stop.sh @@ -827,7 +830,7 @@ echo -e "Command: ./${gameservername} stop" requiredstatus="STOPPED" fn_setstatus ( - exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + exec 5> "${TRAVIS_BUILD_DIR}/dev-debug.log" BASH_XTRACEFD="5" set -x command_stop.sh @@ -846,7 +849,7 @@ echo -e "Command: ./${gameservername} restart" requiredstatus="STARTED" fn_setstatus ( - exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + exec 5> "${TRAVIS_BUILD_DIR}/dev-debug.log" BASH_XTRACEFD="5" set -x command_restart.sh @@ -865,7 +868,7 @@ echo -e "Command: ./${gameservername} restart" requiredstatus="STOPPED" fn_setstatus ( - exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + exec 5> "${TRAVIS_BUILD_DIR}/dev-debug.log" BASH_XTRACEFD="5" set -x command_restart.sh @@ -888,7 +891,7 @@ echo -e "Command: ./${gameservername} update" requiredstatus="STOPPED" fn_setstatus ( - exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + exec 5> "${TRAVIS_BUILD_DIR}/dev-debug.log" BASH_XTRACEFD="5" set -x command_update.sh @@ -908,7 +911,7 @@ echo -e "Command: ./jc2server update-lgam" requiredstatus="STARTED" fn_setstatus ( - exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + exec 5> "${TRAVIS_BUILD_DIR}/dev-debug.log" BASH_XTRACEFD="5" set -x command_update_linuxgsm.sh @@ -935,7 +938,7 @@ echo -e "Command: ./${gameservername} monitor" requiredstatus="STARTED" fn_setstatus ( - exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + exec 5> "${TRAVIS_BUILD_DIR}/dev-debug.log" BASH_XTRACEFD="5" set -x command_monitor.sh @@ -958,7 +961,7 @@ date '+%s' > "${lockdir}/${selfname}.lock" echo "${version}" >> "${lockdir}/${selfname}.lock" echo "${port}" >> "${lockdir}/${selfname}.lock" ( - exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + exec 5> "${TRAVIS_BUILD_DIR}/dev-debug.log" BASH_XTRACEFD="5" set -x command_monitor.sh @@ -977,7 +980,7 @@ echo -e "Command: ./${gameservername} monitor" requiredstatus="STOPPED" fn_setstatus ( - exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + exec 5> "${TRAVIS_BUILD_DIR}/dev-debug.log" BASH_XTRACEFD="5" set -x command_monitor.sh @@ -996,7 +999,7 @@ echo -e "Command: ./${gameservername} test-alert" requiredstatus="STOPPED" fn_setstatus ( - exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + exec 5> "${TRAVIS_BUILD_DIR}/dev-debug.log" BASH_XTRACEFD="5" set -x command_test_alert.sh @@ -1019,7 +1022,7 @@ echo -e "Command: ./${gameservername} details" requiredstatus="STARTED" fn_setstatus ( - exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + exec 5> "${TRAVIS_BUILD_DIR}/dev-debug.log" BASH_XTRACEFD="5" set -x command_details.sh @@ -1038,7 +1041,7 @@ echo -e "Command: ./${gameservername} postdetails" requiredstatus="STARTED" fn_setstatus ( - exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + exec 5> "${TRAVIS_BUILD_DIR}/dev-debug.log" BASH_XTRACEFD="5" set -x command_postdetails.sh @@ -1080,7 +1083,7 @@ echo -e "Command: ./${gameservername} detect-glibc" requiredstatus="STARTED" fn_setstatus ( - exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + exec 5> "${TRAVIS_BUILD_DIR}/dev-debug.log" BASH_XTRACEFD="5" set -x command_dev_detect_glibc.sh @@ -1099,7 +1102,7 @@ echo -e "Command: ./${gameservername} detect-ldd" requiredstatus="STARTED" fn_setstatus ( - exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + exec 5> "${TRAVIS_BUILD_DIR}/dev-debug.log" BASH_XTRACEFD="5" set -x command_dev_detect_ldd.sh @@ -1118,7 +1121,7 @@ echo -e "Command: ./${gameservername} detect-deps" requiredstatus="STARTED" fn_setstatus ( - exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + exec 5> "${TRAVIS_BUILD_DIR}/dev-debug.log" BASH_XTRACEFD="5" set -x command_dev_detect_deps.sh @@ -1137,7 +1140,7 @@ echo -e "Command: ./${gameservername} query-raw" requiredstatus="STARTED" fn_setstatus ( - exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + exec 5> "${TRAVIS_BUILD_DIR}/dev-debug.log" BASH_XTRACEFD="5" set -x command_dev_query_raw.sh @@ -1160,7 +1163,7 @@ echo -e "Command: ./${gameservername} donate" requiredstatus="STARTED" fn_setstatus ( - exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + exec 5> "${TRAVIS_BUILD_DIR}/dev-debug.log" BASH_XTRACEFD="5" set -x command_donate.sh From 50c2cef8a65a772a213461646d589cf342b59e31 Mon Sep 17 00:00:00 2001 From: Christian Date: Tue, 23 Aug 2022 21:31:11 +0200 Subject: [PATCH 047/161] fix(bd): install loop due old condition and config (#3962) --- lgsm/functions/install_config.sh | 2 +- lgsm/functions/install_server_files.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lgsm/functions/install_config.sh b/lgsm/functions/install_config.sh index 597cc93c0..8feb8655e 100755 --- a/lgsm/functions/install_config.sh +++ b/lgsm/functions/install_config.sh @@ -217,7 +217,7 @@ elif [ "${shortname}" == "bo" ]; then fn_default_config_remote fn_set_config_vars fn_list_config_locations -elif [ "${shortname}" == "bo" ]; then +elif [ "${shortname}" == "bd" ]; then gamedirname="BaseDefense" array_configs+=(server.cfg) fn_fetch_default_config diff --git a/lgsm/functions/install_server_files.sh b/lgsm/functions/install_server_files.sh index 395d48c68..aafb47242 100755 --- a/lgsm/functions/install_server_files.sh +++ b/lgsm/functions/install_server_files.sh @@ -235,7 +235,7 @@ elif [ "${shortname}" == "jk2" ]; then update_jediknight2.sh elif [ "${shortname}" == "vints" ]; then update_vintagestory.sh -elif [ -z "${appid}" ] || [ "${shortname}" == "ahl" ] || [ "${shortname}" == "bd" ] || [ "${shortname}" == "bb" ] || [ "${shortname}" == "ns" ] || [ "${shortname}" == "sfc" ] || [ "${shortname}" == "ts" ] || [ "${shortname}" == "vs" ] || [ "${shortname}" == "zmr" ]; then +elif [ -z "${appid}" ] || [ "${shortname}" == "ahl" ] || [ "${shortname}" == "bb" ] || [ "${shortname}" == "ns" ] || [ "${shortname}" == "sfc" ] || [ "${shortname}" == "ts" ] || [ "${shortname}" == "vs" ] || [ "${shortname}" == "zmr" ]; then if [ "${shortname}" == "ut" ]; then install_eula.sh fi From 09698492ae78ac9d49e194387d84a0d3003e4616 Mon Sep 17 00:00:00 2001 From: Christian Date: Tue, 23 Aug 2022 21:31:54 +0200 Subject: [PATCH 048/161] fix(csgo): move away old libgcc_s.so.1 file to fix server with ubuntu 22.04 (#3959) --- lgsm/functions/fix_csgo.sh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lgsm/functions/fix_csgo.sh b/lgsm/functions/fix_csgo.sh index be59c42ec..a393f2fd9 100755 --- a/lgsm/functions/fix_csgo.sh +++ b/lgsm/functions/fix_csgo.sh @@ -31,3 +31,12 @@ if [ -f "${servercfgdir}/valve.rc" ] && grep -E '^\s*exec\s*(default|joystick)\. sed -i 's/^\s*exec\s*joystick.cfg/\/\/exec joystick.cfg/g' "${servercfgdir}/valve.rc" > /dev/null 2>&1 fn_fix_msg_end fi + +# Fixes: Detected engine 11 but could not load: /home/csgo/serverfiles/bin/libgcc_s.so.1: version `GCC_7.0.0' not found (required by /lib/i386-linux-gnu/libstdc++.so.6) +libgccc_so="${serverfiles}/bin/libgcc_s.so.1" +if [ -f "${libgccc_so}" ]; then + fixname="libgcc_s.so.1 move away" + fn_fix_msg_start + mv -v "${libgccc_so}" "${libgccc_so}.bck" + fn_fix_msg_end +fi From f3ad2f16558e6737e867c42ac26949c5dc4361da Mon Sep 17 00:00:00 2001 From: Christian Date: Tue, 23 Aug 2022 21:32:22 +0200 Subject: [PATCH 049/161] fix(deps): remove duplicate dependencys what was added with 490cd3fa5aeadd63180fab5379f49d78748ec8ef (#3957) --- lgsm/data/almalinux-8.csv | 2 +- lgsm/data/centos-7.csv | 2 +- lgsm/data/centos-8.csv | 2 +- lgsm/data/rhel-7.csv | 2 +- lgsm/data/rhel-8.csv | 2 +- lgsm/data/rocky-8.csv | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lgsm/data/almalinux-8.csv b/lgsm/data/almalinux-8.csv index 067b58378..7c4eb59f5 100644 --- a/lgsm/data/almalinux-8.csv +++ b/lgsm/data/almalinux-8.csv @@ -1,4 +1,4 @@ -all,bc,binutils,bzip2,bzip2,cpio,curl,epel-release,file,glibc.i686,gzip,hostname,jq,libstdc++.i686,nmap-ncat,python36,tar,tmux,unzip,util-linux,wget,xz +all,bc,binutils,bzip2,cpio,curl,epel-release,file,glibc.i686,gzip,hostname,jq,libstdc++.i686,nmap-ncat,python36,tar,tmux,unzip,util-linux,wget,xz steamcmd,glibc.i686,libstdc++.i686 ac ahl diff --git a/lgsm/data/centos-7.csv b/lgsm/data/centos-7.csv index e8dc0a885..3d4b0a366 100644 --- a/lgsm/data/centos-7.csv +++ b/lgsm/data/centos-7.csv @@ -1,4 +1,4 @@ -all,bc,binutils,bzip2,bzip2,cpio,curl,epel-release,file,glibc.i686,gzip,hostname,jq,libstdc++.i686,nmap-ncat,python3,tar,tmux,unzip,util-linux,wget,xz +all,bc,binutils,bzip2,cpio,curl,epel-release,file,glibc.i686,gzip,hostname,jq,libstdc++.i686,nmap-ncat,python3,tar,tmux,unzip,util-linux,wget,xz steamcmd,glibc.i686,libstdc++.i686 ac ahl diff --git a/lgsm/data/centos-8.csv b/lgsm/data/centos-8.csv index 116d83bea..8ece428a5 100644 --- a/lgsm/data/centos-8.csv +++ b/lgsm/data/centos-8.csv @@ -1,4 +1,4 @@ -all,bc,binutils,bzip2,bzip2,cpio,curl,epel-release,file,glibc.i686,gzip,hostname,jq,libstdc++,libstdc++.i686,nmap-ncat,python36,tar,tmux,unzip,util-linux,wget,xz +all,bc,binutils,bzip2,cpio,curl,epel-release,file,glibc.i686,gzip,hostname,jq,libstdc++,libstdc++.i686,nmap-ncat,python36,tar,tmux,unzip,util-linux,wget,xz steamcmd,glibc.i686,libstdc++.i686 ac ahl diff --git a/lgsm/data/rhel-7.csv b/lgsm/data/rhel-7.csv index d4d3fbd30..e9801a845 100644 --- a/lgsm/data/rhel-7.csv +++ b/lgsm/data/rhel-7.csv @@ -1,4 +1,4 @@ -all,bc,binutils,bzip2,bzip2,cpio,curl,epel-release,file,glibc.i686,gzip,hostname,jq,libstdc++.i686,nmap-ncat,python36,tar,tmux,unzip,util-linux,wget,xz +all,bc,binutils,bzip2,cpio,curl,epel-release,file,glibc.i686,gzip,hostname,jq,libstdc++.i686,nmap-ncat,python36,tar,tmux,unzip,util-linux,wget,xz steamcmd,glibc.i686,libstdc++.i686 ac ahl diff --git a/lgsm/data/rhel-8.csv b/lgsm/data/rhel-8.csv index 5e7b622e9..88b1babba 100644 --- a/lgsm/data/rhel-8.csv +++ b/lgsm/data/rhel-8.csv @@ -1,4 +1,4 @@ -all,bc,binutils,bzip2,bzip2,cpio,curl,epel-release,file,glibc.i686,gzip,hostname,jq,libstdc++.i686,nmap-ncat,python36,tar,tmux,unzip,util-linux,wget,xz +all,bc,binutils,bzip2,cpio,curl,epel-release,file,glibc.i686,gzip,hostname,jq,libstdc++.i686,nmap-ncat,python36,tar,tmux,unzip,util-linux,wget,xz steamcmd,glibc.i686,libstdc++.i686 ac ahl diff --git a/lgsm/data/rocky-8.csv b/lgsm/data/rocky-8.csv index 067b58378..7c4eb59f5 100644 --- a/lgsm/data/rocky-8.csv +++ b/lgsm/data/rocky-8.csv @@ -1,4 +1,4 @@ -all,bc,binutils,bzip2,bzip2,cpio,curl,epel-release,file,glibc.i686,gzip,hostname,jq,libstdc++.i686,nmap-ncat,python36,tar,tmux,unzip,util-linux,wget,xz +all,bc,binutils,bzip2,cpio,curl,epel-release,file,glibc.i686,gzip,hostname,jq,libstdc++.i686,nmap-ncat,python36,tar,tmux,unzip,util-linux,wget,xz steamcmd,glibc.i686,libstdc++.i686 ac ahl From ff606a596899d4c4dfffbac5ab507b93b562bcd5 Mon Sep 17 00:00:00 2001 From: Christian Date: Tue, 23 Aug 2022 21:33:08 +0200 Subject: [PATCH 050/161] feat(fctr): add function to get the server version via the details command (#3956) --- lgsm/functions/info_game.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lgsm/functions/info_game.sh b/lgsm/functions/info_game.sh index 57d01237d..2d704a2ba 100644 --- a/lgsm/functions/info_game.sh +++ b/lgsm/functions/info_game.sh @@ -653,6 +653,12 @@ fn_info_game_fctr() { port=${port:-"0"} rconport=${rconport:-"0"} rconpassword=${rconpassword:-"NOT SET"} + + # get server version if installed + local factoriobin="${executabledir}${executable:1}" + if [ -f "${factoriobin}" ]; then + serverversion=$(${factoriobin} --version | grep "Version:" | awk '{print $2}') + fi } fn_info_game_jc2() { From 920657e7742fe79391a7e6a19d2a9f2320de7815 Mon Sep 17 00:00:00 2001 From: Christian Date: Tue, 23 Aug 2022 21:33:28 +0200 Subject: [PATCH 051/161] fix(vints): refactor to fix it when there is no config for the server (#3955) --- lgsm/functions/info_game.sh | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/lgsm/functions/info_game.sh b/lgsm/functions/info_game.sh index 2d704a2ba..3a62c67dd 100644 --- a/lgsm/functions/info_game.sh +++ b/lgsm/functions/info_game.sh @@ -2177,20 +2177,17 @@ fn_info_game_vints() { servername="${unavailable}" maxplayers="${unavailable}" serverpassword="${unavailable}" - port="${unavailable}" - queryport="${unavailable}" - configip="${unavailable}" + port="${port:-"0"}" else servername=$(jq -r '.ServerName' "${servercfgfullpath}") maxplayers=$(jq -r '.MaxClients' "${servercfgfullpath}") serverpassword=$(jq -r 'select(.Password != null) | .Password' "${servercfgfullpath}") port=$(jq -r '.Port' "${servercfgfullpath}") - queryport=${port:-"0"} configip=$(jq -r 'select(.Ip != null) | .Ip' "${servercfgfullpath}") - - serverpassword=${serverpassword:-"NOT SET"} - configip=${configip:-"0.0.0.0"} fi + queryport=${port:-"0"} + serverpassword=${serverpassword:-"NOT SET"} + configip=${configip:-"0.0.0.0"} } fn_info_game_wet() { From 7be12c41b503dcd1d6b35dd7b0b728066a170227 Mon Sep 17 00:00:00 2001 From: Christian Date: Tue, 23 Aug 2022 21:33:47 +0200 Subject: [PATCH 052/161] fix(squad): fix to use the proper default config (#3954) --- lgsm/config-default/config-lgsm/squadserver/_default.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lgsm/config-default/config-lgsm/squadserver/_default.cfg b/lgsm/config-default/config-lgsm/squadserver/_default.cfg index 85affef38..0a343cfdf 100644 --- a/lgsm/config-default/config-lgsm/squadserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/squadserver/_default.cfg @@ -163,7 +163,7 @@ systemdir="${serverfiles}/SquadGame" executabledir="${serverfiles}" executable="./SquadGameServer.sh" servercfgdir="${systemdir}/ServerConfig" -servercfg="${selfname}.cfg" +servercfg="Server.cfg" servercfgdefault="Server.cfg" servercfgfullpath="${servercfgdir}/${servercfg}" From 8f68989a16eeb21a4601851b5683b94907201bff Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 23 Aug 2022 20:34:03 +0100 Subject: [PATCH 053/161] build(deps): bump release-drafter/release-drafter from 5.20.0 to 5.20.1 (#3950) Bumps [release-drafter/release-drafter](https://github.com/release-drafter/release-drafter) from 5.20.0 to 5.20.1. - [Release notes](https://github.com/release-drafter/release-drafter/releases) - [Commits](https://github.com/release-drafter/release-drafter/compare/v5.20.0...v5.20.1) --- updated-dependencies: - dependency-name: release-drafter/release-drafter dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/create-release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/create-release.yml b/.github/workflows/create-release.yml index 182b32a78..d5bd4bec6 100644 --- a/.github/workflows/create-release.yml +++ b/.github/workflows/create-release.yml @@ -16,7 +16,7 @@ jobs: runs-on: ubuntu-latest steps: # Drafts your next Release notes as Pull Requests are merged into "master" - - uses: release-drafter/release-drafter@v5.20.0 + - uses: release-drafter/release-drafter@v5.20.1 with: config-name: release-drafter.yml env: From 27ab0923ab24dab00aaf9685f04d214bbdbda7bf Mon Sep 17 00:00:00 2001 From: Neouni Date: Tue, 23 Aug 2022 21:36:28 +0200 Subject: [PATCH 054/161] feat(st): switch parameters to loadlatest (#3924) There are some unforseen issues if you both specify load and new together. Loadlatest will also grab the last backup of that same save. --- lgsm/config-default/config-lgsm/stserver/_default.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lgsm/config-default/config-lgsm/stserver/_default.cfg b/lgsm/config-default/config-lgsm/stserver/_default.cfg index 5c66fcca4..26da17f43 100644 --- a/lgsm/config-default/config-lgsm/stserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/stserver/_default.cfg @@ -20,7 +20,7 @@ worldname="moon_save" ## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters # Edit with care -startparameters="-NEWGAME ${worldtype} -LOADGAME ${worldname} -settings ServerName ${servername} StartLocalHost true ServerVisible true ServerMaxPlayers ${maxplayers} GamePort ${port} UpdatePort ${queryport} UPNPEnabled true AutoSave true SaveInterval ${autosaveinterval}" +startparameters="-LOADLATEST ${worldname} ${worldtype} -settings ServerName ${servername} StartLocalHost true ServerVisible true ServerMaxPlayers ${maxplayers} GamePort ${port} UpdatePort ${queryport} UPNPEnabled true AutoSave true SaveInterval ${autosaveinterval}" #### LinuxGSM Settings #### From bf46fdcfc6dc4c452347ce5bcd261ea9f2e3ee38 Mon Sep 17 00:00:00 2001 From: Christian Date: Tue, 23 Aug 2022 21:36:47 +0200 Subject: [PATCH 055/161] feat(mods): update sourcemod to 1.11 (#3919) --- lgsm/functions/mods_list.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lgsm/functions/mods_list.sh b/lgsm/functions/mods_list.sh index 8ea31561f..151a98cbe 100755 --- a/lgsm/functions/mods_list.sh +++ b/lgsm/functions/mods_list.sh @@ -61,7 +61,7 @@ metamodsourcelatestfile=$(wget "${metamodsourcescrapeurl}" -q -O -) metamodsourcedownloadurl="https://www.metamodsource.net/latest.php?os=linux&version=${metamodsourceversion}" metamodsourceurl="${metamodsourcedownloadurl}" # Sourcemod -sourcemodversion="1.10" +sourcemodversion="1.11" sourcemodscrapeurl="https://sm.alliedmods.net/smdrop/${sourcemodversion}/sourcemod-latest-linux" sourcemodlatestfile=$(wget "${sourcemodscrapeurl}" -q -O -) sourcemoddownloadurl="https://www.sourcemod.net/latest.php?os=linux&version=${sourcemodversion}" From 9fc6244fc3bbe21c425ba82d85880b05edad3718 Mon Sep 17 00:00:00 2001 From: Marcin Jakubowski Date: Tue, 23 Aug 2022 21:37:17 +0200 Subject: [PATCH 056/161] fix(bt): missing user data directory (#3916) --- lgsm/functions/core_functions.sh | 5 +++++ lgsm/functions/fix.sh | 2 ++ lgsm/functions/fix_bt.sh | 16 ++++++++++++++++ 3 files changed, 23 insertions(+) create mode 100755 lgsm/functions/fix_bt.sh diff --git a/lgsm/functions/core_functions.sh b/lgsm/functions/core_functions.sh index 29d2e2ebc..03deac001 100755 --- a/lgsm/functions/core_functions.sh +++ b/lgsm/functions/core_functions.sh @@ -346,6 +346,11 @@ fix_armar.sh() { fn_fetch_function } +fix_bt.sh() { + functionfile="${FUNCNAME[0]}" + fn_fetch_function +} + fix_bo.sh() { functionfile="${FUNCNAME[0]}" fn_fetch_function diff --git a/lgsm/functions/fix.sh b/lgsm/functions/fix.sh index 2d9af576e..0ed9fdf70 100755 --- a/lgsm/functions/fix.sh +++ b/lgsm/functions/fix.sh @@ -43,6 +43,8 @@ if [ "${commandname}" != "INSTALL" ] && [ -z "${fixbypass}" ]; then fix_armar.sh elif [ "${shortname}" == "ark" ]; then fix_ark.sh + elif [ "${shortname}" == "bt" ]; then + fix_bt.sh elif [ "${shortname}" == "bo" ]; then fix_bo.sh elif [ "${shortname}" == "csgo" ]; then diff --git a/lgsm/functions/fix_bt.sh b/lgsm/functions/fix_bt.sh new file mode 100755 index 000000000..094c2617c --- /dev/null +++ b/lgsm/functions/fix_bt.sh @@ -0,0 +1,16 @@ +#!/bin/bash +# LinuxGSM fix_bt.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Resolves an issue with Barotrauma. + +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +# Fixes: Missing user data directory error. +if [ ! -d "${XDG_DATA_HOME:="${HOME}/.local/share"}/Daedalic Entertainment GmbH/Barotrauma" ]; then + fixname="Missing user data directory error." + fn_fix_msg_start + mkdir -p "${XDG_DATA_HOME:="${HOME}/.local/share"}/Daedalic Entertainment GmbH/Barotrauma" + fn_fix_msg_end +fi From dc420668a2e31cf9f8b809fc22f54280fbfa1ad6 Mon Sep 17 00:00:00 2001 From: Christian Date: Tue, 23 Aug 2022 21:37:39 +0200 Subject: [PATCH 057/161] fix(deps): fix java and rng dependency for pz and rw (#3911) --- lgsm/data/ubuntu-20.04.csv | 4 ++-- lgsm/data/ubuntu-21.04.csv | 4 ++-- lgsm/data/ubuntu-21.10.csv | 4 ++-- lgsm/data/ubuntu-22.04.csv | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/lgsm/data/ubuntu-20.04.csv b/lgsm/data/ubuntu-20.04.csv index ccb1ca703..6f9bec4c0 100644 --- a/lgsm/data/ubuntu-20.04.csv +++ b/lgsm/data/ubuntu-20.04.csv @@ -79,7 +79,7 @@ pmc,openjdk-17-jre pstbs,libgconf-2-4 pvkii pvr,libc++1 -pz,openjdk-16-jre,rng-tools +pz,openjdk-17-jre,rng-tools q2 q3 ql @@ -88,7 +88,7 @@ ricochet ro rtcw rust,lib32z1 -rw,openjdk-16-jre +rw,openjdk-17-jre samp sb sbots diff --git a/lgsm/data/ubuntu-21.04.csv b/lgsm/data/ubuntu-21.04.csv index b2a277306..678c06f28 100644 --- a/lgsm/data/ubuntu-21.04.csv +++ b/lgsm/data/ubuntu-21.04.csv @@ -79,7 +79,7 @@ pmc,openjdk-17-jre pstbs,libgconf-2-4 pvkii pvr,libc++1 -pz,openjdk-16-jre,rng-tools +pz,openjdk-17-jre,rng-tools q2 q3 ql @@ -88,7 +88,7 @@ ricochet ro rtcw rust,lib32z1 -rw,openjdk-16-jre +rw,openjdk-17-jre samp sb sbots diff --git a/lgsm/data/ubuntu-21.10.csv b/lgsm/data/ubuntu-21.10.csv index 836dfe53f..f99d2f46d 100644 --- a/lgsm/data/ubuntu-21.10.csv +++ b/lgsm/data/ubuntu-21.10.csv @@ -77,7 +77,7 @@ pmc,openjdk-17-jre pstbs,libgconf-2-4 pvkii pvr,libc++1 -pz,openjdk-16-jre,rng-tools +pz,openjdk-17-jre,rng-tools q2 q3 ql @@ -86,7 +86,7 @@ ricochet ro rtcw rust,lib32z1 -rw,openjdk-16-jre +rw,openjdk-17-jre samp sb sbots diff --git a/lgsm/data/ubuntu-22.04.csv b/lgsm/data/ubuntu-22.04.csv index 836dfe53f..18af1192f 100644 --- a/lgsm/data/ubuntu-22.04.csv +++ b/lgsm/data/ubuntu-22.04.csv @@ -77,7 +77,7 @@ pmc,openjdk-17-jre pstbs,libgconf-2-4 pvkii pvr,libc++1 -pz,openjdk-16-jre,rng-tools +pz,openjdk-17-jre,rng-tools5 q2 q3 ql @@ -86,7 +86,7 @@ ricochet ro rtcw rust,lib32z1 -rw,openjdk-16-jre +rw,openjdk-17-jre samp sb sbots From 81998f73c7fcf4ae0155c6cc577f473f0fceed9d Mon Sep 17 00:00:00 2001 From: eggplants Date: Wed, 24 Aug 2022 04:38:39 +0900 Subject: [PATCH 058/161] fix: replace deprecated optparse with argparse (#3913) --- lgsm/functions/query_gsquery.py | 139 +++++++++++++++++--------------- 1 file changed, 72 insertions(+), 67 deletions(-) diff --git a/lgsm/functions/query_gsquery.py b/lgsm/functions/query_gsquery.py index 4d6b01828..2e28bd58a 100755 --- a/lgsm/functions/query_gsquery.py +++ b/lgsm/functions/query_gsquery.py @@ -6,66 +6,66 @@ # Website: https://linuxgsm.com # Description: Allows querying of various game servers. -import optparse +import argparse import socket import sys +engine_types=('protocol-valve','protocol-quake3', 'protocol-quake3','protocol-gamespy1','protocol-unreal2','ut3 minecraft','minecraftbe','jc2mp','mumbleping','soldat','teeworlds') + class gsquery: - def __init__(self, options, arguments): - self.option = options + server_response_timeout = 5 + default_buffer_length = 1024 + sourcequery=('protocol-valve','avalanche3.0','barotrauma','madness','quakelive','realvirtuality','refractor','source','goldsrc','spark','starbound','unity3d','unreal4','wurm') + idtech2query=('protocol-quake3','idtech2','quake','iw2.0') + idtech3query=('protocol-quake3','iw3.0','ioquake3','qfusion') + minecraftquery=('minecraft','lwjgl2') + minecraftbequery=('minecraftbe',) + jc2mpquery=('jc2mp',) + mumblequery=('mumbleping',) + soldatquery=('soldat',) + twquery=('teeworlds',) + unrealquery=('protocol-gamespy1','unreal') + unreal2query=('protocol-unreal2','unreal2') + unreal3query=('ut3','unreal3') + + def __init__(self, arguments): self.argument = arguments # - self.server_response_timeout = 5 - self.default_buffer_length = 1024 - # - sourcequery=['protocol-valve','avalanche3.0','barotrauma','madness','quakelive','realvirtuality','refractor','source','goldsrc','spark','starbound','unity3d','unreal4','wurm'] - idtech2query=['protocol-quake3','idtech2','quake','iw2.0'] - idtech3query=['protocol-quake3','iw3.0','ioquake3','qfusion'] - minecraftquery=['minecraft','lwjgl2'] - minecraftbequery=['minecraftbe'] - jc2mpquery=['jc2mp'] - mumblequery=['mumbleping'] - soldatquery=['soldat'] - twquery=['teeworlds'] - unrealquery=['protocol-gamespy1','unreal'] - unreal2query=['protocol-unreal2','unreal2'] - unreal3query=['ut3','unreal3'] - if self.option.engine in sourcequery: + if self.argument.engine in self.sourcequery: self.query_prompt_string = b'\xFF\xFF\xFF\xFFTSource Engine Query\0' - elif self.option.engine in idtech2query: + elif self.argument.engine in self.idtech2query: self.query_prompt_string = b'\xff\xff\xff\xffstatus\x00' - elif self.option.engine in idtech3query: + elif self.argument.engine in self.idtech3query: self.query_prompt_string = b'\xff\xff\xff\xffgetstatus' - elif self.option.engine in jc2mpquery: + elif self.argument.engine in self.jc2mpquery: self.query_prompt_string = b'\xFE\xFD\x09\x10\x20\x30\x40' - elif self.option.engine in minecraftquery: + elif self.argument.engine in self.minecraftquery: self.query_prompt_string = b'\xFE\xFD\x09\x3d\x54\x1f\x93' - elif self.option.engine in minecraftbequery: + elif self.argument.engine in self.minecraftbequery: self.query_prompt_string = b'\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\xff\xff\x00\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfd\x12\x34\x56\x78\x00\x00\x00\x00\x00\x00\x00\x00' - elif self.option.engine in mumblequery: + elif self.argument.engine in self.mumblequery: self.query_prompt_string = b'\x00\x00\x00\x00\x01\x02\x03\x04\x05\x06\x07\x08' - elif self.option.engine in soldatquery: + elif self.argument.engine in self.soldatquery: self.query_prompt_string = b'\x69\x00' - elif self.option.engine in twquery: - self.query_prompt_string = b"\x04\x00\x00\xff\xff\xff\xff\x05" + bytearray(511) - elif self.option.engine in unrealquery: + elif self.argument.engine in self.twquery: + self.query_prompt_string = b'\x04\x00\x00\xff\xff\xff\xff\x05' + bytearray(511) + elif self.argument.engine in self.unrealquery: self.query_prompt_string = b'\x5C\x69\x6E\x66\x6F\x5C' - elif self.option.engine in unreal2query: + elif self.argument.engine in self.unreal2query: self.query_prompt_string = b'\x79\x00\x00\x00\x00' - elif self.option.engine in unreal3query: + elif self.argument.engine in self.unreal3query: self.query_prompt_string = b'\xFE\xFD\x09\x00\x00\x00\x00' self.connected = False self.response = None - self.sanity_checks() @staticmethod - def fatal_error(self, error_message, error_code=1): + def fatal_error(error_message, error_code=1): sys.stderr.write('ERROR: ' + str(error_message) + '\n') sys.exit(error_code) @staticmethod - def exit_success(self, success_message=''): + def exit_success(success_message=''): sys.stdout.write('OK: ' + str(success_message) + '\n') sys.exit(0) @@ -74,10 +74,10 @@ class gsquery: connection = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) connection.settimeout(self.server_response_timeout) try: - self.connected = connection.connect((self.option.address, int(self.option.port))) + self.connected = connection.connect((self.argument.address, int(self.argument.port))) except socket.timeout: self.fatal_error('Request timed out', 1) - except: + except Exception: self.fatal_error('Unable to connect', 1) # Send. connection.send(self.query_prompt_string) @@ -95,52 +95,57 @@ class gsquery: else: self.exit_success(str(self.response)) - def sanity_checks(self): - if not self.option.address: - self.fatal_error('No IPv4 address supplied.', 4) - if not self.option.port: - self.fatal_error('No port supplied.', 4) - -if __name__ == '__main__': - parser = optparse.OptionParser( - usage='usage: python3 %prog [options]', - version='%prog 0.0.1' +def parse_args(): + parser = argparse.ArgumentParser( + description='Allows querying of various game servers.', + usage='usage: python3 %(prog)s [options]', + add_help=False ) - parser.add_option( + parser.add_argument( '-a', '--address', - action='store', - dest='address', - default=False, + type=str, + required=True, help='The IPv4 address of the server.' ) - parser.add_option( + parser.add_argument( '-p', '--port', - action='store', - dest='port', - default=False, + type=int, + required=True, help='The IPv4 port of the server.' ) - parser.add_option( + parser.add_argument( '-e', '--engine', - action='store', - dest='engine', - default=False, - help='Engine type: protocol-valve protocol-quake3 protocol-quake3 protocol-gamespy1 protocol-unreal2 ut3 minecraft minecraftbe jc2mp mumbleping soldat teeworlds' + metavar='ENGINE', + choices=engine_types, + help='Engine type: ' + ' '.join(engine_types) ) - parser.add_option( + parser.add_argument( '-v', '--verbose', action='store_true', - dest='verbose', - default=False, help='Display verbose output.' ) - parser.add_option( + parser.add_argument( '-d', '--debug', action='store_true', - dest='debug', - default=False, help='Display debugging output.' ) - options, arguments = parser.parse_args() - server = gsquery(options, arguments) + parser.add_argument( + '-V', '--version', + action='version', + version='%(prog)s 0.0.1', + help='Display version and exit.' + ) + parser.add_argument( + '-h', '--help', + action='help', + help='Display help and exit.' + ) + return parser.parse_args() + +def main(): + arguments = parse_args() + server = gsquery(arguments) server.responding() + +if __name__ == '__main__': + main() From 8571d9f374d0ae61eab007f61a5b1381660af3b7 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Tue, 23 Aug 2022 21:01:45 +0100 Subject: [PATCH 059/161] chore: update licence and add prettier --- ...update-copyright-years-in-license-file.yml | 17 + .gitignore | 1 + .prettierrc.json | 3 + LICENSE | 4 +- package-lock.json | 466 ++++++++++++++++++ package.json | 24 + 6 files changed, 513 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/update-copyright-years-in-license-file.yml create mode 100644 .prettierrc.json create mode 100644 package-lock.json create mode 100644 package.json diff --git a/.github/workflows/update-copyright-years-in-license-file.yml b/.github/workflows/update-copyright-years-in-license-file.yml new file mode 100644 index 000000000..01af6dd3c --- /dev/null +++ b/.github/workflows/update-copyright-years-in-license-file.yml @@ -0,0 +1,17 @@ +--- +name: Update copyright year(s) in license file + +on: + schedule: + - cron: "0 3 1 1 *" # 03:00 AM on January 1 + +jobs: + update-license-year: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + - uses: FantasticFiasco/action-update-license-year@v2 + with: + token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.gitignore b/.gitignore index 12218bea3..8bb6a5b32 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ *.db .idea +/node_modules diff --git a/.prettierrc.json b/.prettierrc.json new file mode 100644 index 000000000..02d542d50 --- /dev/null +++ b/.prettierrc.json @@ -0,0 +1,3 @@ +{ + "plugins": ["prettier-plugin-sh"] +} diff --git a/LICENSE b/LICENSE index bda7cb6ee..88c1caac5 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ -MIT License +# The MIT License (MIT) -Copyright (c) 2012-2021 Daniel Gibbs +Copyright (c) 2012-2022 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 diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 000000000..d0deca3ec --- /dev/null +++ b/package-lock.json @@ -0,0 +1,466 @@ +{ + "name": "linuxgsm", + "lockfileVersion": 2, + "requires": true, + "packages": { + "": { + "name": "linuxgsm", + "license": "MIT", + "devDependencies": { + "prettier": "^2.7.1", + "prettier-plugin-sh": "^0.12.8" + } + }, + "node_modules/@pkgr/utils": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/@pkgr/utils/-/utils-2.3.0.tgz", + "integrity": "sha512-7dIJ9CRVzBnqyEl7diUHPUFJf/oty2SeoVzcMocc5PeOUDK9KGzvgIBjGRRzzlRDaOjh3ADwH0WeibQvi3ls2Q==", + "dev": true, + "dependencies": { + "cross-spawn": "^7.0.3", + "is-glob": "^4.0.3", + "open": "^8.4.0", + "picocolors": "^1.0.0", + "tiny-glob": "^0.2.9", + "tslib": "^2.4.0" + }, + "engines": { + "node": "^12.20.0 || ^14.18.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/unts" + } + }, + "node_modules/cross-spawn": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", + "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "dev": true, + "dependencies": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/define-lazy-prop": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/define-lazy-prop/-/define-lazy-prop-2.0.0.tgz", + "integrity": "sha512-Ds09qNh8yw3khSjiJjiUInaGX9xlqZDY7JVryGxdxV7NPeuqQfplOpQ66yJFZut3jLa5zOwkXw1g9EI2uKh4Og==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/globalyzer": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/globalyzer/-/globalyzer-0.1.0.tgz", + "integrity": "sha512-40oNTM9UfG6aBmuKxk/giHn5nQ8RVz/SS4Ir6zgzOv9/qC3kKZ9v4etGTcJbEl/NyVQH7FGU7d+X1egr57Md2Q==", + "dev": true + }, + "node_modules/globrex": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/globrex/-/globrex-0.1.2.tgz", + "integrity": "sha512-uHJgbwAMwNFf5mLst7IWLNg14x1CkeqglJb/K3doi4dw6q2IvAAmM/Y81kevy83wP+Sst+nutFTYOGg3d1lsxg==", + "dev": true + }, + "node_modules/is-docker": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/is-docker/-/is-docker-2.2.1.tgz", + "integrity": "sha512-F+i2BKsFrH66iaUFc0woD8sLy8getkwTwtOBjvs56Cx4CgJDeKQeqfz8wAYiSb8JOprWhHH5p77PbmYCvvUuXQ==", + "dev": true, + "bin": { + "is-docker": "cli.js" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-glob": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "dev": true, + "dependencies": { + "is-extglob": "^2.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-wsl": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-2.2.0.tgz", + "integrity": "sha512-fKzAra0rGJUUBwGBgNkHZuToZcn+TtXHpeCgmkMJMMYx1sQDYaCSyjJBSCa2nH1DGm7s3n1oBnohoVTBaN7Lww==", + "dev": true, + "dependencies": { + "is-docker": "^2.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", + "dev": true + }, + "node_modules/mvdan-sh": { + "version": "0.10.1", + "resolved": "https://registry.npmjs.org/mvdan-sh/-/mvdan-sh-0.10.1.tgz", + "integrity": "sha512-kMbrH0EObaKmK3nVRKUIIya1dpASHIEusM13S4V1ViHFuxuNxCo+arxoa6j/dbV22YBGjl7UKJm9QQKJ2Crzhg==", + "dev": true + }, + "node_modules/open": { + "version": "8.4.0", + "resolved": "https://registry.npmjs.org/open/-/open-8.4.0.tgz", + "integrity": "sha512-XgFPPM+B28FtCCgSb9I+s9szOC1vZRSwgWsRUA5ylIxRTgKozqjOCrVOqGsYABPYK5qnfqClxZTFBa8PKt2v6Q==", + "dev": true, + "dependencies": { + "define-lazy-prop": "^2.0.0", + "is-docker": "^2.1.1", + "is-wsl": "^2.2.0" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/picocolors": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz", + "integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==", + "dev": true + }, + "node_modules/prettier": { + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.7.1.tgz", + "integrity": "sha512-ujppO+MkdPqoVINuDFDRLClm7D78qbDt0/NR+wp5FqEZOoTNAjPHWj17QRhu7geIHJfcNhRk1XVQmF8Bp3ye+g==", + "dev": true, + "bin": { + "prettier": "bin-prettier.js" + }, + "engines": { + "node": ">=10.13.0" + }, + "funding": { + "url": "https://github.com/prettier/prettier?sponsor=1" + } + }, + "node_modules/prettier-plugin-sh": { + "version": "0.12.8", + "resolved": "https://registry.npmjs.org/prettier-plugin-sh/-/prettier-plugin-sh-0.12.8.tgz", + "integrity": "sha512-VOq8h2Gn5UzrCIKm4p/nAScXJbN09HdyFDknAcxt6Qu/tv/juu9bahxSrcnM9XWYA+Spz1F1ANJ4LhfwB7+Q1Q==", + "dev": true, + "dependencies": { + "mvdan-sh": "^0.10.1", + "sh-syntax": "^0.3.6", + "synckit": "^0.8.1" + }, + "engines": { + "node": "^12.20.0 || ^14.18.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/unts" + }, + "peerDependencies": { + "prettier": "^2.0.0" + } + }, + "node_modules/sh-syntax": { + "version": "0.3.7", + "resolved": "https://registry.npmjs.org/sh-syntax/-/sh-syntax-0.3.7.tgz", + "integrity": "sha512-xIB/uRniZ9urxAuXp1Ouh/BKSI1VK8RSqfwGj7cV57HvGrFo3vHdJfv8Tdp/cVcxJgXQTkmHr5mG5rqJW8r4wQ==", + "dev": true, + "dependencies": { + "tslib": "^2.4.0" + }, + "engines": { + "node": "^12.20.0 || ^14.18.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/unts" + } + }, + "node_modules/shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dev": true, + "dependencies": { + "shebang-regex": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/synckit": { + "version": "0.8.3", + "resolved": "https://registry.npmjs.org/synckit/-/synckit-0.8.3.tgz", + "integrity": "sha512-1goXnDYNJlKwCM37f5MTzRwo+8SqutgVtg2d37D6YnHHT4E3IhQMRfKiGdfTZU7LBlI6T8inCQUxnMBFHrbqWw==", + "dev": true, + "dependencies": { + "@pkgr/utils": "^2.3.0", + "tslib": "^2.4.0" + }, + "engines": { + "node": "^14.18.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/unts" + } + }, + "node_modules/tiny-glob": { + "version": "0.2.9", + "resolved": "https://registry.npmjs.org/tiny-glob/-/tiny-glob-0.2.9.tgz", + "integrity": "sha512-g/55ssRPUjShh+xkfx9UPDXqhckHEsHr4Vd9zX55oSdGZc/MD0m3sferOkwWtp98bv+kcVfEHtRJgBVJzelrzg==", + "dev": true, + "dependencies": { + "globalyzer": "0.1.0", + "globrex": "^0.1.2" + } + }, + "node_modules/tslib": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.0.tgz", + "integrity": "sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ==", + "dev": true + }, + "node_modules/which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" + }, + "engines": { + "node": ">= 8" + } + } + }, + "dependencies": { + "@pkgr/utils": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/@pkgr/utils/-/utils-2.3.0.tgz", + "integrity": "sha512-7dIJ9CRVzBnqyEl7diUHPUFJf/oty2SeoVzcMocc5PeOUDK9KGzvgIBjGRRzzlRDaOjh3ADwH0WeibQvi3ls2Q==", + "dev": true, + "requires": { + "cross-spawn": "^7.0.3", + "is-glob": "^4.0.3", + "open": "^8.4.0", + "picocolors": "^1.0.0", + "tiny-glob": "^0.2.9", + "tslib": "^2.4.0" + } + }, + "cross-spawn": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", + "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "dev": true, + "requires": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + } + }, + "define-lazy-prop": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/define-lazy-prop/-/define-lazy-prop-2.0.0.tgz", + "integrity": "sha512-Ds09qNh8yw3khSjiJjiUInaGX9xlqZDY7JVryGxdxV7NPeuqQfplOpQ66yJFZut3jLa5zOwkXw1g9EI2uKh4Og==", + "dev": true + }, + "globalyzer": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/globalyzer/-/globalyzer-0.1.0.tgz", + "integrity": "sha512-40oNTM9UfG6aBmuKxk/giHn5nQ8RVz/SS4Ir6zgzOv9/qC3kKZ9v4etGTcJbEl/NyVQH7FGU7d+X1egr57Md2Q==", + "dev": true + }, + "globrex": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/globrex/-/globrex-0.1.2.tgz", + "integrity": "sha512-uHJgbwAMwNFf5mLst7IWLNg14x1CkeqglJb/K3doi4dw6q2IvAAmM/Y81kevy83wP+Sst+nutFTYOGg3d1lsxg==", + "dev": true + }, + "is-docker": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/is-docker/-/is-docker-2.2.1.tgz", + "integrity": "sha512-F+i2BKsFrH66iaUFc0woD8sLy8getkwTwtOBjvs56Cx4CgJDeKQeqfz8wAYiSb8JOprWhHH5p77PbmYCvvUuXQ==", + "dev": true + }, + "is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", + "dev": true + }, + "is-glob": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "dev": true, + "requires": { + "is-extglob": "^2.1.1" + } + }, + "is-wsl": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-2.2.0.tgz", + "integrity": "sha512-fKzAra0rGJUUBwGBgNkHZuToZcn+TtXHpeCgmkMJMMYx1sQDYaCSyjJBSCa2nH1DGm7s3n1oBnohoVTBaN7Lww==", + "dev": true, + "requires": { + "is-docker": "^2.0.0" + } + }, + "isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", + "dev": true + }, + "mvdan-sh": { + "version": "0.10.1", + "resolved": "https://registry.npmjs.org/mvdan-sh/-/mvdan-sh-0.10.1.tgz", + "integrity": "sha512-kMbrH0EObaKmK3nVRKUIIya1dpASHIEusM13S4V1ViHFuxuNxCo+arxoa6j/dbV22YBGjl7UKJm9QQKJ2Crzhg==", + "dev": true + }, + "open": { + "version": "8.4.0", + "resolved": "https://registry.npmjs.org/open/-/open-8.4.0.tgz", + "integrity": "sha512-XgFPPM+B28FtCCgSb9I+s9szOC1vZRSwgWsRUA5ylIxRTgKozqjOCrVOqGsYABPYK5qnfqClxZTFBa8PKt2v6Q==", + "dev": true, + "requires": { + "define-lazy-prop": "^2.0.0", + "is-docker": "^2.1.1", + "is-wsl": "^2.2.0" + } + }, + "path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "dev": true + }, + "picocolors": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz", + "integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==", + "dev": true + }, + "prettier": { + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.7.1.tgz", + "integrity": "sha512-ujppO+MkdPqoVINuDFDRLClm7D78qbDt0/NR+wp5FqEZOoTNAjPHWj17QRhu7geIHJfcNhRk1XVQmF8Bp3ye+g==", + "dev": true + }, + "prettier-plugin-sh": { + "version": "0.12.8", + "resolved": "https://registry.npmjs.org/prettier-plugin-sh/-/prettier-plugin-sh-0.12.8.tgz", + "integrity": "sha512-VOq8h2Gn5UzrCIKm4p/nAScXJbN09HdyFDknAcxt6Qu/tv/juu9bahxSrcnM9XWYA+Spz1F1ANJ4LhfwB7+Q1Q==", + "dev": true, + "requires": { + "mvdan-sh": "^0.10.1", + "sh-syntax": "^0.3.6", + "synckit": "^0.8.1" + } + }, + "sh-syntax": { + "version": "0.3.7", + "resolved": "https://registry.npmjs.org/sh-syntax/-/sh-syntax-0.3.7.tgz", + "integrity": "sha512-xIB/uRniZ9urxAuXp1Ouh/BKSI1VK8RSqfwGj7cV57HvGrFo3vHdJfv8Tdp/cVcxJgXQTkmHr5mG5rqJW8r4wQ==", + "dev": true, + "requires": { + "tslib": "^2.4.0" + } + }, + "shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dev": true, + "requires": { + "shebang-regex": "^3.0.0" + } + }, + "shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "dev": true + }, + "synckit": { + "version": "0.8.3", + "resolved": "https://registry.npmjs.org/synckit/-/synckit-0.8.3.tgz", + "integrity": "sha512-1goXnDYNJlKwCM37f5MTzRwo+8SqutgVtg2d37D6YnHHT4E3IhQMRfKiGdfTZU7LBlI6T8inCQUxnMBFHrbqWw==", + "dev": true, + "requires": { + "@pkgr/utils": "^2.3.0", + "tslib": "^2.4.0" + } + }, + "tiny-glob": { + "version": "0.2.9", + "resolved": "https://registry.npmjs.org/tiny-glob/-/tiny-glob-0.2.9.tgz", + "integrity": "sha512-g/55ssRPUjShh+xkfx9UPDXqhckHEsHr4Vd9zX55oSdGZc/MD0m3sferOkwWtp98bv+kcVfEHtRJgBVJzelrzg==", + "dev": true, + "requires": { + "globalyzer": "0.1.0", + "globrex": "^0.1.2" + } + }, + "tslib": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.0.tgz", + "integrity": "sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ==", + "dev": true + }, + "which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "requires": { + "isexe": "^2.0.0" + } + } + } +} diff --git a/package.json b/package.json new file mode 100644 index 000000000..c62ce3175 --- /dev/null +++ b/package.json @@ -0,0 +1,24 @@ +{ + "name": "linuxgsm", + "description": "


\"LinuxGSM\"

", + "directories": { + "test": "tests" + }, + "devDependencies": { + "prettier": "^2.7.1", + "prettier-plugin-sh": "^0.12.8" + }, + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/GameServerManagers/LinuxGSM.git" + }, + "author": "", + "license": "MIT", + "bugs": { + "url": "https://github.com/GameServerManagers/LinuxGSM/issues" + }, + "homepage": "https://github.com/GameServerManagers/LinuxGSM#readme" +} From 6838d1d4bd25303b6b4edd5ff58d731da86c15d0 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Tue, 23 Aug 2022 21:26:14 +0100 Subject: [PATCH 060/161] chore: add recommended extensions for vscode --- .vscode/extensions.json | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 .vscode/extensions.json diff --git a/.vscode/extensions.json b/.vscode/extensions.json new file mode 100644 index 000000000..0ceb99088 --- /dev/null +++ b/.vscode/extensions.json @@ -0,0 +1,11 @@ +{ + "recommendations": [ + "ms-python.python", + "editorconfig.editorconfig", + "yzhang.markdown-all-in-one", + "esbenp.prettier-vscode", + "timonwong.shellcheck", + "foxundermoon.shell-format", + "redhat.vscode-yaml" + ] +} From 04262324aef15f30dfda2fac7bc63abfd86c589c Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Tue, 23 Aug 2022 21:51:53 +0100 Subject: [PATCH 061/161] feat(cod4): update server download to v21.2 (#3963) --- lgsm/functions/check_steamcmd.sh | 2 +- lgsm/functions/install_server_files.sh | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lgsm/functions/check_steamcmd.sh b/lgsm/functions/check_steamcmd.sh index 030cbbf03..d41e8669f 100755 --- a/lgsm/functions/check_steamcmd.sh +++ b/lgsm/functions/check_steamcmd.sh @@ -12,7 +12,7 @@ core_steamcmd.sh fn_check_steamcmd_clear fn_check_steamcmd -if [ ${shortname} == "ark" ]; then +if [ "${shortname}" == "ark" ]; then fn_check_steamcmd_ark fi fn_check_steamcmd_dir diff --git a/lgsm/functions/install_server_files.sh b/lgsm/functions/install_server_files.sh index aafb47242..fe9353ad8 100755 --- a/lgsm/functions/install_server_files.sh +++ b/lgsm/functions/install_server_files.sh @@ -58,12 +58,12 @@ fn_install_server_files() { force="noforce" md5="b8c4c611f01627dd43348e78478a3d41" elif [ "${shortname}" == "cod4" ]; then - remote_fileurl="http://linuxgsm.download/CallOfDuty4/cod4x18_1790_lnxded.tar.xz" + remote_fileurl="http://linuxgsm.download/CallOfDuty4/cod4x18_lnxded.tar.xz" local_filedir="${tmpdir}" - local_filename="cod4x18_1790_lnxded.tar.xz" + local_filename="cod4x18_lnxded.tar.xz" chmodx="nochmodx" run="norun" force="noforce" - md5="30609db2afde09d22498fbab3a427d11" + md5="d255b59b9756d7dbead67718208512ee" elif [ "${shortname}" == "codwaw" ]; then remote_fileurl="http://linuxgsm.download/CallOfDutyWorldAtWar/codwaw-lnxded-1.7-full.tar.xz" local_filedir="${tmpdir}" From 4bc349c362079e1a96e06fa112f9974d0ff477e1 Mon Sep 17 00:00:00 2001 From: Christian Date: Wed, 24 Aug 2022 19:36:22 +0200 Subject: [PATCH 062/161] feat(ts3): check checksum for downloaded file (#3969) --- lgsm/functions/update_ts3.sh | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/lgsm/functions/update_ts3.sh b/lgsm/functions/update_ts3.sh index 77ed61838..d7aff9b48 100644 --- a/lgsm/functions/update_ts3.sh +++ b/lgsm/functions/update_ts3.sh @@ -8,13 +8,17 @@ functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_update_ts3_dl() { + ts3latestdata=$(curl -s "https://www.${remotelocation}/versions/server.json" | jq '.linux') if [ "${ts3arch}" == "amd64" ]; then - remotebuildurl=$(curl -s 'https://www.teamspeak.com/versions/server.json' | jq -r '.linux.x86_64.mirrors."teamspeak.com"') + remotebuildurl=$(echo -e "${ts3latestdata}" | jq -r '.x86_64.mirrors."teamspeak.com"') + remotehash=$(echo -e "${ts3latestdata}" | jq -r '.x86_64.checksum') elif [ "${ts3arch}" == "x86" ]; then - remotebuildurl=$(curl -s 'https://www.teamspeak.com/versions/server.json' | jq -r '.linux.x86.mirrors."teamspeak.com"') + remotebuildurl=$(echo -e "${ts3latestdata}" | jq -r '.x86.mirrors."teamspeak.com"') + remotehash=$(echo -e "${ts3latestdata}" | jq -r '.x86.checksum') fi - fn_fetch_file "${remotebuildurl}" "" "" "" "${tmpdir}" "teamspeak3-server_linux_${ts3arch}-${remotebuild}.tar.bz2" "" "norun" "noforce" "nohash" - fn_dl_extract "${tmpdir}" "teamspeak3-server_linux_${ts3arch}-${remotebuild}.tar.bz2" "${tmpdir}" + remotefile=$(basename "${remotebuildurl}") + fn_fetch_file "${remotebuildurl}" "" "" "" "${tmpdir}" "${remotefile}" "" "norun" "noforce" "${remotehash}" + fn_dl_extract "${tmpdir}" "${remotefile}" "${tmpdir}" echo -e "copying to ${serverfiles}...\c" cp -R "${tmpdir}/teamspeak3-server_linux_${ts3arch}/"* "${serverfiles}" local exitcode=$? @@ -103,10 +107,11 @@ fn_update_ts3_localbuild() { fn_update_ts3_remotebuild() { # Gets remote build info. + ts3latestdata=$(curl -s "https://www.${remotelocation}/versions/server.json" | jq '.linux') if [ "${ts3arch}" == "amd64" ]; then - remotebuild=$(curl -s "https://www.teamspeak.com/versions/server.json" | jq -r '.linux.x86_64.version') + remotebuild=$(echo -e "${ts3latestdata}" | jq -r '.x86_64.version') elif [ "${ts3arch}" == "x86" ]; then - remotebuild=$(curl -s "https://www.teamspeak.com/versions/server.json" | jq -r '.linux.x86.version') + remotebuild=$(echo -e "${ts3latestdata}" | jq -r '.x86.version') fi if [ "${firstcommandname}" != "INSTALL" ]; then fn_print_dots "Checking remote build: ${remotelocation}" From 8871030ca2f3b6cd37a3c5958d5918e85262e8b6 Mon Sep 17 00:00:00 2001 From: ethzero Date: Fri, 9 Sep 2022 09:33:01 +0100 Subject: [PATCH 063/161] fix(em): update default map (#3977) Changed defaultmap value from "emp_district" to "con_district402" as this map was renamed years ago and would otherwise cause the server to fail on startup. --- lgsm/config-default/config-lgsm/emserver/_default.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lgsm/config-default/config-lgsm/emserver/_default.cfg b/lgsm/config-default/config-lgsm/emserver/_default.cfg index f10a8a437..16db942a4 100644 --- a/lgsm/config-default/config-lgsm/emserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/emserver/_default.cfg @@ -13,7 +13,7 @@ ip="0.0.0.0" port="27015" clientport="27005" sourcetvport="27020" -defaultmap="emp_district" +defaultmap="con_district402" maxplayers="62" ## Game Server Login Token (GSLT): Optional From 819a4b3ec3345fa9095c6abbc4ea420a63f80f22 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 22 Sep 2022 20:55:37 +0100 Subject: [PATCH 064/161] build(deps): bump release-drafter/release-drafter from 5.20.1 to 5.21.0 (#3985) Bumps [release-drafter/release-drafter](https://github.com/release-drafter/release-drafter) from 5.20.1 to 5.21.0. - [Release notes](https://github.com/release-drafter/release-drafter/releases) - [Commits](https://github.com/release-drafter/release-drafter/compare/v5.20.1...v5.21.0) --- updated-dependencies: - dependency-name: release-drafter/release-drafter dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/create-release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/create-release.yml b/.github/workflows/create-release.yml index d5bd4bec6..44e841ec1 100644 --- a/.github/workflows/create-release.yml +++ b/.github/workflows/create-release.yml @@ -16,7 +16,7 @@ jobs: runs-on: ubuntu-latest steps: # Drafts your next Release notes as Pull Requests are merged into "master" - - uses: release-drafter/release-drafter@v5.20.1 + - uses: release-drafter/release-drafter@v5.21.0 with: config-name: release-drafter.yml env: From 28101a7295d8de2d31a04b7d4f897954ecb4bf58 Mon Sep 17 00:00:00 2001 From: Christian Date: Thu, 22 Sep 2022 21:56:05 +0200 Subject: [PATCH 065/161] fix(query_gsquery): fix regression from 81998f73c7fcf4ae0155c6cc577f473f0fceed9d (#3966) --- lgsm/functions/query_gsquery.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lgsm/functions/query_gsquery.py b/lgsm/functions/query_gsquery.py index 2e28bd58a..62c92082e 100755 --- a/lgsm/functions/query_gsquery.py +++ b/lgsm/functions/query_gsquery.py @@ -10,7 +10,7 @@ import argparse import socket import sys -engine_types=('protocol-valve','protocol-quake3', 'protocol-quake3','protocol-gamespy1','protocol-unreal2','ut3 minecraft','minecraftbe','jc2mp','mumbleping','soldat','teeworlds') +engine_types=('protocol-valve','protocol-quake3','protocol-quake3','protocol-gamespy1','protocol-unreal2','ut3','minecraft','minecraftbe','jc2mp','mumbleping','soldat','teeworlds') class gsquery: server_response_timeout = 5 From 9984f956b327d916b28f13b36465a505c190914d Mon Sep 17 00:00:00 2001 From: Christian Date: Thu, 22 Sep 2022 21:56:49 +0200 Subject: [PATCH 066/161] feat(ts3): add check-update function (#3967) --- lgsm/functions/command_check_update.sh | 14 +++++--- lgsm/functions/core_getopt.sh | 2 +- lgsm/functions/update_ts3.sh | 50 ++++++++++++++------------ 3 files changed, 37 insertions(+), 29 deletions(-) diff --git a/lgsm/functions/command_check_update.sh b/lgsm/functions/command_check_update.sh index 9648dd49e..59b29d6e9 100755 --- a/lgsm/functions/command_check_update.sh +++ b/lgsm/functions/command_check_update.sh @@ -14,12 +14,16 @@ fn_print_dots "" check.sh core_logs.sh -core_steamcmd.sh +if [ "${appid}" ]; then + core_steamcmd.sh -check_steamcmd.sh + check_steamcmd.sh -fn_update_steamcmd_localbuild -fn_update_steamcmd_remotebuild -fn_update_steamcmd_compare + fn_update_steamcmd_localbuild + fn_update_steamcmd_remotebuild + fn_update_steamcmd_compare +elif [ "${shortname}" == "ts3" ]; then + update_ts3.sh +fi core_exit.sh diff --git a/lgsm/functions/core_getopt.sh b/lgsm/functions/core_getopt.sh index 0a5a39c09..3c44931b9 100755 --- a/lgsm/functions/core_getopt.sh +++ b/lgsm/functions/core_getopt.sh @@ -75,7 +75,7 @@ if [ "${shortname}" == "jk2" ] || [ "${engine}" != "idtech3" ]; then fi # Validate and check-update command. -if [ "${appid}" ]; then +if [ "${appid}" ]||[ "${shortname}" == "ts3" ]; then currentopt+=("${cmd_validate[@]}" "${cmd_check_update[@]}") fi diff --git a/lgsm/functions/update_ts3.sh b/lgsm/functions/update_ts3.sh index d7aff9b48..be5c9e06f 100644 --- a/lgsm/functions/update_ts3.sh +++ b/lgsm/functions/update_ts3.sh @@ -150,35 +150,39 @@ fn_update_ts3_compare() { fn_script_log_info "Remote build: ${remotebuild}" fn_script_log_info "${localbuild} > ${remotebuild}" - unset updateonstart - check_status.sh - # If server stopped. - if [ "${status}" == "0" ]; then - exitbypass=1 - fn_update_ts3_dl - if [ "${requirerestart}" == "1" ]; then + if [ "${commandname}" == "UPDATE" ]; then + unset updateonstart + check_status.sh + # If server stopped. + if [ "${status}" == "0" ]; then exitbypass=1 - command_start.sh - fn_firstcommand_reset + fn_update_ts3_dl + if [ "${requirerestart}" == "1" ]; then + exitbypass=1 + command_start.sh + fn_firstcommand_reset + exitbypass=1 + command_stop.sh + fn_firstcommand_reset + fi + # If server started. + else + fn_print_restart_warning exitbypass=1 command_stop.sh fn_firstcommand_reset + exitbypass=1 + fn_update_ts3_dl + exitbypass=1 + command_start.sh + fn_firstcommand_reset fi - # If server started. - else - fn_print_restart_warning - exitbypass=1 - command_stop.sh - fn_firstcommand_reset - exitbypass=1 - fn_update_ts3_dl - exitbypass=1 - command_start.sh - fn_firstcommand_reset + unset exitbypass + date +%s > "${lockdir}/lastupdate.lock" + alert="update" + elif [ "${commandname}" == "CHECK-UPDATE" ]; then + alert="check-update" fi - unset exitbypass - date +%s > "${lockdir}/lastupdate.lock" - alert="update" alert.sh else fn_print_ok_nl "Checking for update: ${remotelocation}" From b291066c2c34af0f784ca0b86c4c6bd50915512f Mon Sep 17 00:00:00 2001 From: Frisasky Date: Fri, 23 Sep 2022 03:58:25 +0800 Subject: [PATCH 067/161] fix(zmr): Update to beta 6 (#3965) * Update install_server_files.sh * Update install_server_files.sh --- lgsm/functions/install_server_files.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lgsm/functions/install_server_files.sh b/lgsm/functions/install_server_files.sh index fe9353ad8..a81b75aea 100755 --- a/lgsm/functions/install_server_files.sh +++ b/lgsm/functions/install_server_files.sh @@ -191,12 +191,12 @@ fn_install_server_files() { force="noforce" md5="93705e165550c97484678236749198a4" elif [ "${shortname}" == "zmr" ]; then - remote_fileurl="http://linuxgsm.download/ZombieMasterReborn/zombie_master_reborn_b5_2.tar.xz" + remote_fileurl="http://linuxgsm.download/ZombieMasterReborn/zombie_master_reborn_b6_1.tar.xz" local_filedir="${tmpdir}" - local_filename="zombie_master_reborn_b5_2.tar.xz" + local_filename="zombie_master_reborn_b6_1.tar.xz" chmodx="nochmodx" run="norun" force="noforce" - md5="4b9b9832e863d03981a40c26065792a6" + md5="0188ae86dbc9376f11ae3032dba2d665" fi fn_fetch_file "${remote_fileurl}" "" "" "" "${local_filedir}" "${local_filename}" "${chmodx}" "${run}" "${forcedl}" "${md5}" fn_dl_extract "${local_filedir}" "${local_filename}" "${serverfiles}" From d3cdf63d9431d23cdda29824197db60a0ee2f892 Mon Sep 17 00:00:00 2001 From: Xenorio Date: Thu, 22 Sep 2022 22:03:05 +0200 Subject: [PATCH 068/161] fix(wmcserver): fix not being able to read query port (#3982) queryport was being overwritten with rconpassword or "NOT SET" --- lgsm/functions/info_game.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lgsm/functions/info_game.sh b/lgsm/functions/info_game.sh index 3a62c67dd..7efc6008f 100644 --- a/lgsm/functions/info_game.sh +++ b/lgsm/functions/info_game.sh @@ -2264,7 +2264,7 @@ fn_info_game_wmc() { # Not set servername=${servername:-"NOT SET"} - queryport=${rconpassword:-"NOT SET"} + queryport=${queryport:-"25577"} maxplayers=${maxplayers:-"0"} configip=${configip:-"0.0.0.0"} fi From bf1fc1833b752bc574f80d69fbf0ef6d886032c0 Mon Sep 17 00:00:00 2001 From: Christian Date: Thu, 22 Sep 2022 22:26:19 +0200 Subject: [PATCH 069/161] feat(newserver): add Velocity Proxy (#3904) --- .../config-lgsm/vpmcserver/_default.cfg | 179 ++++++++++++++++++ lgsm/data/almalinux-8.csv | 1 + lgsm/data/centos-8.csv | 1 + lgsm/data/debian-10.csv | 1 + lgsm/data/debian-11.csv | 1 + lgsm/data/rhel-7.csv | 1 + lgsm/data/rhel-8.csv | 1 + lgsm/data/rocky-8.csv | 1 + lgsm/data/serverlist.csv | 1 + lgsm/data/ubuntu-18.04.csv | 1 + lgsm/data/ubuntu-20.04.csv | 1 + lgsm/data/ubuntu-21.04.csv | 1 + lgsm/data/ubuntu-21.10.csv | 1 + lgsm/data/ubuntu-22.04.csv | 1 + lgsm/functions/command_stop.sh | 2 + lgsm/functions/command_update.sh | 2 +- lgsm/functions/info_game.sh | 18 ++ lgsm/functions/info_messages.sh | 11 +- lgsm/functions/install_server_files.sh | 2 +- lgsm/functions/update_papermc.sh | 2 + 20 files changed, 226 insertions(+), 3 deletions(-) create mode 100644 lgsm/config-default/config-lgsm/vpmcserver/_default.cfg diff --git a/lgsm/config-default/config-lgsm/vpmcserver/_default.cfg b/lgsm/config-default/config-lgsm/vpmcserver/_default.cfg new file mode 100644 index 000000000..6755e0e51 --- /dev/null +++ b/lgsm/config-default/config-lgsm/vpmcserver/_default.cfg @@ -0,0 +1,179 @@ +################################## +######## Default Settings ######## +################################## +# DO NOT EDIT, ANY CHANGES WILL BE OVERWRITTEN! +# Copy settings from here and use them in either: +# common.cfg - applies settings to every instance. +# [instance].cfg - applies settings to a specific instance. + +#### Game Server Settings #### + +## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters +javaram="1024" # -Xmx$1024M + +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="" + +## Release Settings | https://docs.linuxgsm.com/game-servers/minecraft#release-settings +# Version (latest|3.1.1) +mcversion="latest" + +#### LinuxGSM Settings #### + +## LinuxGSM Stats +# Send useful stats to LinuxGSM developers. +# https://docs.linuxgsm.com/configuration/linuxgsm-stats +# (on|off) +stats="off" + +## Notification Alerts +# (on|off) + +# Display IP | https://docs.linuxgsm.com/alerts#display-ip +displayip="" + +# More info | https://docs.linuxgsm.com/alerts#more-info +postalert="off" + +# Discord Alerts | https://docs.linuxgsm.com/alerts/discord +discordalert="off" +discordwebhook="webhook" + +# Email Alerts | https://docs.linuxgsm.com/alerts/email +emailalert="off" +email="email@example.com" +emailfrom="" + +# Gotify Alerts | https://docs.linuxgsm.com/alerts/gotify +gotifyalert="off" +gotifytoken="token" +gotifywebhook="webhook" + +# IFTTT Alerts | https://docs.linuxgsm.com/alerts/ifttt +iftttalert="off" +ifttttoken="accesstoken" +iftttevent="linuxgsm_alert" + +# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun +mailgunalert="off" +mailgunapiregion="us" +mailguntoken="accesstoken" +mailgundomain="example.com" +mailgunemailfrom="alert@example.com" +mailgunemail="email@myemail.com" + +# Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet +pushbulletalert="off" +pushbullettoken="accesstoken" +channeltag="" + +# Pushover Alerts | https://docs.linuxgsm.com/alerts/pushover +pushoveralert="off" +pushovertoken="accesstoken" +pushoveruserkey="userkey" + +# Rocket.Chat Alerts | https://docs.linuxgsm.com/alerts/rocket.chat +rocketchatalert="off" +rocketchatwebhook="webhook" +rocketchattoken="" + +# Slack Alerts | https://docs.linuxgsm.com/alerts/slack +slackalert="off" +slackwebhook="webhook" + +# Telegram Alerts | https://docs.linuxgsm.com/alerts/telegram +# You can add a custom cURL string eg proxy (useful in Russia) in "curlcustomstring". +# For example "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help". +telegramapi="api.telegram.org" +telegramalert="off" +telegramtoken="accesstoken" +telegramchatid="" +curlcustomstring="" + +## Updating | https://docs.linuxgsm.com/commands/update +updateonstart="off" + +## Backup | https://docs.linuxgsm.com/commands/backup +maxbackups="4" +maxbackupdays="30" +stoponbackup="on" + +## Logging | https://docs.linuxgsm.com/features/logging +consolelogging="on" +logdays="7" + +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + +## ANSI Colors | https://docs.linuxgsm.com/features/ansi-colors +ansi="on" + +#### Advanced Settings #### + +## Message Display Time | https://docs.linuxgsm.com/features/message-display-time +sleeptime="0.5" + +## Stop Mode | https://docs.linuxgsm.com/features/stop-mode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: GoldSrc +# 10: Avorion +# 11: end +# 12: shutdown +stopmode="12" + +## Query mode +# 1: session only +# 2: gamedig (gsquery fallback) +# 3: gamedig +# 4: gsquery +# 5: tcp +querymode="2" +querytype="minecraft" + +## Console type +consoleverbose="yes" +consoleinteract="yes" + +## Game Server Details +# Do not edit +gamename="Velocity Proxy" +engine="lwjgl2" +glibc="null" + +#### Directories #### +# Edit with care + +## Game Server Directories +systemdir="${serverfiles}" +executabledir="${serverfiles}" +preexecutable="java -Xmx${javaram}M -XX:+UseG1GC -XX:G1HeapRegionSize=4M -XX:+UnlockExperimentalVMOptions -XX:+ParallelRefProcEnabled -XX:+AlwaysPreTouch -XX:MaxInlineLevel=15 -jar" +executable="./velocity.jar" +servercfgdir="${systemdir}" +servercfg="velocity.toml" +servercfgdefault="velocity.toml" +servercfgfullpath="${servercfgdir}/${servercfg}" + +## Backup Directory +backupdir="${lgsmdir}/backup" + +## Logging Directories +logdir="${rootdir}/log" +gamelogdir="${systemdir}/logs" +lgsmlogdir="${logdir}/script" +consolelogdir="${logdir}/console" +lgsmlog="${lgsmlogdir}/${selfname}-script.log" +consolelog="${consolelogdir}/${selfname}-console.log" +alertlog="${lgsmlogdir}/${selfname}-alert.log" +postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" + +## Logs Naming +lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" +consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" diff --git a/lgsm/data/almalinux-8.csv b/lgsm/data/almalinux-8.csv index 7c4eb59f5..9910acb8d 100644 --- a/lgsm/data/almalinux-8.csv +++ b/lgsm/data/almalinux-8.csv @@ -119,6 +119,7 @@ ut99 vh,glibc-devel vs vints,mono-complete +vpmc,java-11-openjdk wet wf wmc,java-11-openjdk diff --git a/lgsm/data/centos-8.csv b/lgsm/data/centos-8.csv index 8ece428a5..7d3095ba4 100644 --- a/lgsm/data/centos-8.csv +++ b/lgsm/data/centos-8.csv @@ -118,6 +118,7 @@ ut99 vh,glibc-devel vs vints,mono-complete +vpmc,java-11-openjdk wet wf wmc,java-11-openjdk diff --git a/lgsm/data/debian-10.csv b/lgsm/data/debian-10.csv index 30ca2df10..443c35cf0 100644 --- a/lgsm/data/debian-10.csv +++ b/lgsm/data/debian-10.csv @@ -119,6 +119,7 @@ ut99 vh,libc6-dev vs vints,mono-complete +vpmc,openjdk-11-jre wet wf wmc,openjdk-11-jre diff --git a/lgsm/data/debian-11.csv b/lgsm/data/debian-11.csv index f96d48862..58db53762 100644 --- a/lgsm/data/debian-11.csv +++ b/lgsm/data/debian-11.csv @@ -119,6 +119,7 @@ ut99 vh,libc6-dev vs vints,mono-complete +vpmc,openjdk-11-jre wet wf wmc,openjdk-17-jre diff --git a/lgsm/data/rhel-7.csv b/lgsm/data/rhel-7.csv index e9801a845..968c4dc98 100644 --- a/lgsm/data/rhel-7.csv +++ b/lgsm/data/rhel-7.csv @@ -119,6 +119,7 @@ ut99 vh,glibc-devel vs vints,mono-complete +vpmc,java-11-openjdk wet wf wmc,java-11-openjdk diff --git a/lgsm/data/rhel-8.csv b/lgsm/data/rhel-8.csv index 88b1babba..002db75fd 100644 --- a/lgsm/data/rhel-8.csv +++ b/lgsm/data/rhel-8.csv @@ -119,6 +119,7 @@ ut99 vh,glibc-devel vs vints,mono-complete +vpmc,java-11-openjdk wet wf wmc,java-11-openjdk diff --git a/lgsm/data/rocky-8.csv b/lgsm/data/rocky-8.csv index 7c4eb59f5..9910acb8d 100644 --- a/lgsm/data/rocky-8.csv +++ b/lgsm/data/rocky-8.csv @@ -119,6 +119,7 @@ ut99 vh,glibc-devel vs vints,mono-complete +vpmc,java-11-openjdk wet wf wmc,java-11-openjdk diff --git a/lgsm/data/serverlist.csv b/lgsm/data/serverlist.csv index f5463cd84..4c80f538a 100644 --- a/lgsm/data/serverlist.csv +++ b/lgsm/data/serverlist.csv @@ -117,6 +117,7 @@ ut3,ut3server,Unreal Tournament 3 ut99,ut99server,Unreal Tournament 99 vh,vhserver,Valheim vints,vintsserver,Vintage Story +vpmc,vpmcserver,Velocity Proxy MC vs,vsserver,Vampire Slayer wet,wetserver,Wolfenstein: Enemy Territory wf,wfserver,Warfork diff --git a/lgsm/data/ubuntu-18.04.csv b/lgsm/data/ubuntu-18.04.csv index 30ca2df10..443c35cf0 100644 --- a/lgsm/data/ubuntu-18.04.csv +++ b/lgsm/data/ubuntu-18.04.csv @@ -119,6 +119,7 @@ ut99 vh,libc6-dev vs vints,mono-complete +vpmc,openjdk-11-jre wet wf wmc,openjdk-11-jre diff --git a/lgsm/data/ubuntu-20.04.csv b/lgsm/data/ubuntu-20.04.csv index 6f9bec4c0..49f64348d 100644 --- a/lgsm/data/ubuntu-20.04.csv +++ b/lgsm/data/ubuntu-20.04.csv @@ -119,6 +119,7 @@ ut99 vh,libc6-dev vs vints,mono-complete +vpmc,openjdk-11-jre wet wf wmc,openjdk-17-jre diff --git a/lgsm/data/ubuntu-21.04.csv b/lgsm/data/ubuntu-21.04.csv index 678c06f28..f1b28acd2 100644 --- a/lgsm/data/ubuntu-21.04.csv +++ b/lgsm/data/ubuntu-21.04.csv @@ -119,6 +119,7 @@ ut99 vh,libc6-dev vs vints,mono-complete +vpmc,openjdk-11-jre wet wf wmc,openjdk-17-jre diff --git a/lgsm/data/ubuntu-21.10.csv b/lgsm/data/ubuntu-21.10.csv index f99d2f46d..1ced64fc7 100644 --- a/lgsm/data/ubuntu-21.10.csv +++ b/lgsm/data/ubuntu-21.10.csv @@ -117,6 +117,7 @@ ut99 vh,libc6-dev vs vints,mono-complete +vpmc,openjdk-11-jre wet wf wmc,openjdk-17-jre diff --git a/lgsm/data/ubuntu-22.04.csv b/lgsm/data/ubuntu-22.04.csv index 18af1192f..dd567bf7b 100644 --- a/lgsm/data/ubuntu-22.04.csv +++ b/lgsm/data/ubuntu-22.04.csv @@ -117,6 +117,7 @@ ut99 vh,libc6-dev vs vints,mono-complete +vpmc,openjdk-11-jre wet wf wmc,openjdk-17-jre diff --git a/lgsm/functions/command_stop.sh b/lgsm/functions/command_stop.sh index b87185402..d18ef7c23 100644 --- a/lgsm/functions/command_stop.sh +++ b/lgsm/functions/command_stop.sh @@ -231,6 +231,8 @@ fn_stop_graceful_select() { fn_stop_graceful_avorion elif [ "${stopmode}" == "11" ]; then fn_stop_graceful_cmd "end" 30 + elif [ "${stopmode}" == "12" ]; then + fn_stop_graceful_cmd "shutdown" 30 fi } diff --git a/lgsm/functions/command_update.sh b/lgsm/functions/command_update.sh index 5b9858e84..07b65e5fa 100755 --- a/lgsm/functions/command_update.sh +++ b/lgsm/functions/command_update.sh @@ -21,7 +21,7 @@ elif [ "${shortname}" == "mc" ]; then update_minecraft.sh elif [ "${shortname}" == "mcb" ]; then update_minecraft_bedrock.sh -elif [ "${shortname}" == "pmc" ] || [ "${shortname}" == "wmc" ]; then +elif [ "${shortname}" == "pmc" ] || [ "${shortname}" == "vpmc" ] || [ "${shortname}" == "wmc" ]; then update_papermc.sh elif [ "${shortname}" == "mumble" ]; then update_mumble.sh diff --git a/lgsm/functions/info_game.sh b/lgsm/functions/info_game.sh index 7efc6008f..dcec74b31 100644 --- a/lgsm/functions/info_game.sh +++ b/lgsm/functions/info_game.sh @@ -2190,6 +2190,22 @@ fn_info_game_vints() { configip=${configip:-"0.0.0.0"} } +fn_info_game_vpmc() { + if [ ! -f "${servercfgfullpath}" ]; then + servername="${unavailable}" + configip="0.0.0.0" + port="25577" + else + servername=$(sed -nr 's/^motd\s*=\s*"(.*)"/\1/p' "${servercfgfullpath}") + bindaddress=$(sed -nr 's/^bind\s*=\s*"([0-9.:]+)"/\1/p' "${servercfgfullpath}") + configip=$(echo "${bindaddress}" | cut -d ':' -f 1) + port=$(echo "${bindaddress}" | cut -d ':' -f 2) + + servername=${servername:-"NOT SET"} + fi + queryport=${port:-"25577"} +} + fn_info_game_wet() { # Config if [ ! -f "${servercfgfullpath}" ]; then @@ -2456,6 +2472,8 @@ elif [ "${shortname}" == "vh" ]; then fn_info_game_vh elif [ "${shortname}" == "vints" ]; then fn_info_game_vints +elif [ "${shortname}" == "vpmc" ]; then + fn_info_game_vpmc elif [ "${shortname}" == "wet" ]; then fn_info_game_wet elif [ "${shortname}" == "wf" ]; then diff --git a/lgsm/functions/info_messages.sh b/lgsm/functions/info_messages.sh index cfad349ac..a216327c9 100755 --- a/lgsm/functions/info_messages.sh +++ b/lgsm/functions/info_messages.sh @@ -687,7 +687,7 @@ fn_info_message_ports() { echo -e "ss -tuplwn | grep AvorionServer" elif [ "${shortname}" == "bf1942" ]; then echo -e "ss -tuplwn | grep bf1942_lnxded" - elif [ "${shortname}" == "mc" ] || [ "${shortname}" == "pmc" ] || [ "${shortname}" == "rw" ] || [ "${shortname}" == "wmc" ]; then + elif [ "${shortname}" == "mc" ] || [ "${shortname}" == "pmc" ] || [ "${shortname}" == "rw" ] || [ "${shortname}" == "vpmc" ] || [ "${shortname}" == "wmc" ]; then echo -e "ss -tuplwn | grep java" elif [ "${shortname}" == "terraria" ]; then echo -e "ss -tuplwn | grep Main" @@ -1610,6 +1610,13 @@ fn_info_message_vints() { } | column -s $'\t' -t } +fn_info_message_vpmc() { + { + fn_port "header" + fn_port "Game" port tcp + } | column -s $'\t' -t +} + fn_info_message_wet() { { fn_port "header" @@ -1798,6 +1805,8 @@ fn_info_message_select_engine() { fn_info_message_ut2k4 elif [ "${shortname}" == "ut3" ]; then fn_info_message_ut3 + elif [ "${shortname}" == "vpmc" ]; then + fn_info_message_vpmc elif [ "${shortname}" == "wet" ]; then fn_info_message_wet elif [ "${shortname}" == "wf" ]; then diff --git a/lgsm/functions/install_server_files.sh b/lgsm/functions/install_server_files.sh index a81b75aea..c9faf643a 100755 --- a/lgsm/functions/install_server_files.sh +++ b/lgsm/functions/install_server_files.sh @@ -222,7 +222,7 @@ elif [ "${shortname}" == "mcb" ]; then elif [ "${shortname}" == "pmc" ]; then install_eula.sh update_papermc.sh -elif [ "${shortname}" == "wmc" ]; then +elif [ "${shortname}" == "wmc" ]||[ "${shortname}" == "vpmc" ]; then update_papermc.sh elif [ "${shortname}" == "mumble" ]; then update_mumble.sh diff --git a/lgsm/functions/update_papermc.sh b/lgsm/functions/update_papermc.sh index 881e912d3..1f334549c 100644 --- a/lgsm/functions/update_papermc.sh +++ b/lgsm/functions/update_papermc.sh @@ -122,6 +122,8 @@ remotelocation="papermc.io" if [ "${shortname}" == "pmc" ]; then paperproject="paper" +elif [ "${shortname}" == "vpmc" ]; then + paperproject="velocity" elif [ "${shortname}" == "wmc" ]; then paperproject="waterfall" fi From 4c52885ae32b87cca5359aafef9c99e481f856b0 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Wed, 5 Oct 2022 21:04:53 +0100 Subject: [PATCH 070/161] Release v22.2.0 --- lgsm/functions/core_functions.sh | 2 +- linuxgsm.sh | 2 +- tests/tests_fctrserver.sh | 2 +- tests/tests_jc2server.sh | 2 +- tests/tests_mcserver.sh | 2 +- tests/tests_ts3server.sh | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lgsm/functions/core_functions.sh b/lgsm/functions/core_functions.sh index 03deac001..20d26de05 100755 --- a/lgsm/functions/core_functions.sh +++ b/lgsm/functions/core_functions.sh @@ -8,7 +8,7 @@ functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" -modulesversion="v22.1.0" +modulesversion="v22.2.0" # Core diff --git a/linuxgsm.sh b/linuxgsm.sh index 6a4209b32..01c71d68c 100755 --- a/linuxgsm.sh +++ b/linuxgsm.sh @@ -20,7 +20,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="v22.1.0" +version="v22.2.0" shortname="core" gameservername="core" commandname="CORE" diff --git a/tests/tests_fctrserver.sh b/tests/tests_fctrserver.sh index 9a27daf91..0a7c0893f 100644 --- a/tests/tests_fctrserver.sh +++ b/tests/tests_fctrserver.sh @@ -20,7 +20,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="v22.1.0" +version="v22.2.0" shortname="fctr" gameservername="fctrserver" commandname="CORE" diff --git a/tests/tests_jc2server.sh b/tests/tests_jc2server.sh index c86e6dbb9..58e8da188 100644 --- a/tests/tests_jc2server.sh +++ b/tests/tests_jc2server.sh @@ -20,7 +20,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="v22.1.0" +version="v22.2.0" shortname="jc2" gameservername="jc2server" commandname="CORE" diff --git a/tests/tests_mcserver.sh b/tests/tests_mcserver.sh index 36f3349cd..3fbbc3bf3 100644 --- a/tests/tests_mcserver.sh +++ b/tests/tests_mcserver.sh @@ -20,7 +20,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="v22.1.0" +version="v22.2.0" shortname="mc" gameservername="mcserver" commandname="CORE" diff --git a/tests/tests_ts3server.sh b/tests/tests_ts3server.sh index 466753e3d..d4857765e 100644 --- a/tests/tests_ts3server.sh +++ b/tests/tests_ts3server.sh @@ -20,7 +20,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="v22.1.0" +version="v22.2.0" shortname="ts3" gameservername="ts3server" commandname="CORE" From 501798943e8613159229fc05a98f1cc0d59f76d1 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Wed, 19 Oct 2022 14:26:14 +0100 Subject: [PATCH 071/161] update actions --- .github/workflows/codacy-analysis.yml | 61 +++++++++++++++++++++++++++ .github/workflows/linter.yml | 55 ------------------------ .github/workflows/super-linter.yml | 29 +++++++++++++ 3 files changed, 90 insertions(+), 55 deletions(-) create mode 100644 .github/workflows/codacy-analysis.yml delete mode 100644 .github/workflows/linter.yml create mode 100644 .github/workflows/super-linter.yml diff --git a/.github/workflows/codacy-analysis.yml b/.github/workflows/codacy-analysis.yml new file mode 100644 index 000000000..473255efd --- /dev/null +++ b/.github/workflows/codacy-analysis.yml @@ -0,0 +1,61 @@ +# This workflow uses actions that are not certified by GitHub. +# They are provided by a third-party and are governed by +# separate terms of service, privacy policy, and support +# documentation. + +# This workflow checks out code, performs a Codacy security scan +# and integrates the results with the +# GitHub Advanced Security code scanning feature. For more information on +# the Codacy security scan action usage and parameters, see +# https://github.com/codacy/codacy-analysis-cli-action. +# For more information on Codacy Analysis CLI in general, see +# https://github.com/codacy/codacy-analysis-cli. + +name: Codacy Security Scan + +on: + push: + branches: ["main","master"] + pull_request: + # The branches below must be a subset of the branches above + branches: ["main","master"] + schedule: + - cron: "28 22 * * 4" + +permissions: + contents: read + +jobs: + codacy-security-scan: + permissions: + contents: read # for actions/checkout to fetch code + security-events: write # for github/codeql-action/upload-sarif to upload SARIF results + actions: read # only required for a private repository by github/codeql-action/upload-sarif to get the Action run status + name: Codacy Security Scan + runs-on: ubuntu-latest + steps: + # Checkout the repository to the GitHub Actions runner + - name: Checkout code + uses: actions/checkout@v3 + + # Execute Codacy Analysis CLI and generate a SARIF output with the security issues identified during the analysis + - name: Run Codacy Analysis CLI + uses: codacy/codacy-analysis-cli-action@v4.2.0 + with: + # Check https://github.com/codacy/codacy-analysis-cli#project-token to get your project token from your Codacy repository + # You can also omit the token and run the tools that support default configurations + project-token: ${{ secrets.CODACY_PROJECT_TOKEN }} + verbose: true + output: results.sarif + format: sarif + # Adjust severity of non-security issues + gh-code-scanning-compat: true + # Force 0 exit code to allow SARIF file generation + # This will handover control about PR rejection to the GitHub side + max-allowed-issues: 2147483647 + + # Upload the SARIF file generated in the previous step + - name: Upload SARIF results file + uses: github/codeql-action/upload-sarif@v2 + with: + sarif_file: results.sarif diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml deleted file mode 100644 index 7f34c51b6..000000000 --- a/.github/workflows/linter.yml +++ /dev/null @@ -1,55 +0,0 @@ ---- -################################# -################################# -## Super Linter GitHub Actions ## -################################# -################################# -name: Lint Code Base - -# -# Documentation: -# https://docs.github.com/en/actions/learn-github-actions/workflow-syntax-for-github-actions -# - -############################# -# Start the job on all push # -############################# -on: - push: - branches-ignore: [master, main] - # Remove the line above to run when pushing to master - pull_request: - -############### -# Set the Job # -############### -jobs: - build: - # Name the Job - name: Lint Code Base - # Set the agent to run on - runs-on: ubuntu-latest - - ################## - # Load all steps # - ################## - steps: - ########################## - # Checkout the code base # - ########################## - - name: Checkout Code - uses: actions/checkout@v2 - with: - # Full git history is needed to get a proper list of changed files within `super-linter` - fetch-depth: 0 - - ################################ - # Run Linter against code base # - ################################ - - name: Lint Code Base - uses: github/super-linter@v4 - env: - VALIDATE_ALL_CODEBASE: false - # Change to 'master' if your main branch differs - DEFAULT_BRANCH: main - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/super-linter.yml b/.github/workflows/super-linter.yml new file mode 100644 index 000000000..4fb36f74e --- /dev/null +++ b/.github/workflows/super-linter.yml @@ -0,0 +1,29 @@ +# This workflow executes several linters on changed files based on languages used in your code base whenever +# you push a code or open a pull request. +# +# You can adjust the behavior by modifying this file. +# For more information, see: +# https://github.com/github/super-linter +name: Lint Code Base + +on: + push: + branches: ["main","master"] + pull_request: + branches: ["main","master"] +jobs: + run-lint: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v3 + with: + # Full git history is needed to get a proper list of changed files within `super-linter` + fetch-depth: 0 + + - name: Lint Code Base + uses: github/super-linter@v4 + env: + VALIDATE_ALL_CODEBASE: false + DEFAULT_BRANCH: "main" + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 2257be4a8ec7dfd39d7a11305af8d7fe3e54302c Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sat, 22 Oct 2022 22:40:35 +0100 Subject: [PATCH 072/161] fix: add docker compatibility fix: allow find to search in symlinks --- lgsm/functions/check.sh | 4 ++-- lgsm/functions/check_deps.sh | 2 +- lgsm/functions/check_permissions.sh | 2 +- lgsm/functions/check_root.sh | 2 +- lgsm/functions/command_install.sh | 2 +- lgsm/functions/core_exit.sh | 2 +- lgsm/functions/core_steamcmd.sh | 6 +++--- linuxgsm.sh | 24 ++++++++++++------------ 8 files changed, 22 insertions(+), 22 deletions(-) diff --git a/lgsm/functions/check.sh b/lgsm/functions/check.sh index 6f9859822..239a24140 100755 --- a/lgsm/functions/check.sh +++ b/lgsm/functions/check.sh @@ -21,7 +21,7 @@ fi check_tmuxception.sh -if [ "$(whoami)" != "root" ]; then +if [ "$(whoami)" != "root" ] || [ -f /.dockerenv ]; then if [ "${commandname}" != "MONITOR" ]; then check_permissions.sh fi @@ -38,7 +38,7 @@ for allowed_command in "${allowed_commands_array[@]}"; do fi done -if [ "$(whoami)" != "root" ]; then +if [ "$(whoami)" != "root" ] || [ -f /.dockerenv ]; then allowed_commands_array=(DEBUG START INSTALL) for allowed_command in "${allowed_commands_array[@]}"; do if [ "${allowed_command}" == "${commandname}" ]; then diff --git a/lgsm/functions/check_deps.sh b/lgsm/functions/check_deps.sh index ff4863e2c..194f5541e 100755 --- a/lgsm/functions/check_deps.sh +++ b/lgsm/functions/check_deps.sh @@ -301,7 +301,7 @@ fn_deps_detector() { } if [ "${commandname}" == "INSTALL" ]; then - if [ "$(whoami)" == "root" ]; then + if [ "$(whoami)" == "root" ] && [ ! -f /.dockerenv ]; then echo -e "" echo -e "${lightyellow}Checking Dependencies as root${default}" echo -e "=================================" diff --git a/lgsm/functions/check_permissions.sh b/lgsm/functions/check_permissions.sh index 92a76600b..46642f7fb 100755 --- a/lgsm/functions/check_permissions.sh +++ b/lgsm/functions/check_permissions.sh @@ -226,7 +226,7 @@ fn_sys_perm_error_process() { # Run perm error detect & fix/alert functions on /sys directories. ## Run checks. -if [ "$(whoami)" != "root" ]; then +if [ "$(whoami)" != "root" ] || [ -f /.dockerenv ]; then fn_check_ownership fn_check_permissions if [ "${commandname}" == "START" ]; then diff --git a/lgsm/functions/check_root.sh b/lgsm/functions/check_root.sh index 13942cbd4..dab033148 100755 --- a/lgsm/functions/check_root.sh +++ b/lgsm/functions/check_root.sh @@ -7,7 +7,7 @@ functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" -if [ "$(whoami)" = "root" ]; then +if [ "$(whoami)" == "root" ] && [ ! -f /.dockerenv ]; then if [ "${commandname}" != "INSTALL" ]; then fn_print_fail_nl "Do NOT run this script as root!" if [ -d "${lgsmlogdir}" ]; then diff --git a/lgsm/functions/command_install.sh b/lgsm/functions/command_install.sh index e56890b4d..19dc59c7e 100755 --- a/lgsm/functions/command_install.sh +++ b/lgsm/functions/command_install.sh @@ -11,7 +11,7 @@ functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_firstcommand_set check.sh -if [ "$(whoami)" = "root" ]; then +if [ "$(whoami)" == "root" ] && [ ! -f /.dockerenv ]; then check_deps.sh else install_header.sh diff --git a/lgsm/functions/core_exit.sh b/lgsm/functions/core_exit.sh index 93c37dfc7..2d2f5b8fa 100755 --- a/lgsm/functions/core_exit.sh +++ b/lgsm/functions/core_exit.sh @@ -18,7 +18,7 @@ fn_exit_dev_debug() { } # If running dependency check as root will remove any files that belong to root user. -if [ "$(whoami)" == "root" ]; then +if [ "$(whoami)" == "root" ] && [ ! -f /.dockerenv ]; then find "${lgsmdir}"/ -group root -prune -exec rm -rf {} + > /dev/null 2>&1 find "${logdir}"/ -group root -prune -exec rm -rf {} + > /dev/null 2>&1 fi diff --git a/lgsm/functions/core_steamcmd.sh b/lgsm/functions/core_steamcmd.sh index 92c14136a..453a8b77e 100755 --- a/lgsm/functions/core_steamcmd.sh +++ b/lgsm/functions/core_steamcmd.sh @@ -174,7 +174,7 @@ fn_update_steamcmd_remotebuild() { fi # Removes appinfo.vdf as a fix for not always getting up to date version info from SteamCMD. - if [ "$(find "${HOME}" -type f -name "appinfo.vdf" | wc -l)" -ne "0" ]; then + if [ "$(find -L "${HOME}" -type f -name "appinfo.vdf" | wc -l)" -ne "0" ]; then find "${HOME}" -type f -name "appinfo.vdf" -exec rm -f {} \; fi @@ -281,8 +281,8 @@ fn_update_steamcmd_compare() { } fn_appmanifest_info() { - appmanifestfile=$(find "${serverfiles}" -type f -name "appmanifest_${appid}.acf") - appmanifestfilewc=$(find "${serverfiles}" -type f -name "appmanifest_${appid}.acf" | wc -l) + appmanifestfile=$(find -L "${serverfiles}" -type f -name "appmanifest_${appid}.acf") + appmanifestfilewc=$(find -L "${serverfiles}" -type f -name "appmanifest_${appid}.acf" | wc -l) } fn_appmanifest_check() { diff --git a/linuxgsm.sh b/linuxgsm.sh index 01c71d68c..0748b2d86 100755 --- a/linuxgsm.sh +++ b/linuxgsm.sh @@ -15,7 +15,7 @@ # Debugging if [ -f ".dev-debug" ]; then - exec 5> dev-debug.log + exec 5>dev-debug.log BASH_XTRACEFD="5" set -x fi @@ -52,7 +52,7 @@ userinput2="${2}" [ -n "${LGSM_GITHUBBRANCH}" ] && githubbranch="${LGSM_GITHUBBRANCH}" || githubbranch="master" # Check that curl is installed before doing anything -if [ ! "$(command -v curl 2> /dev/null)" ]; then +if [ ! "$(command -v curl 2>/dev/null)" ]; then echo -e "[ FAIL ] Curl is not installed" exit 1 fi @@ -213,7 +213,7 @@ fn_install_menu_bash() { while read -r line || [[ -n "${line}" ]]; do var=$(echo -e "${line}" | awk -F "," '{print $2 " - " $3}') menu_options+=("${var}") - done < "${options}" + done <"${options}" menu_options+=("Cancel") select option in "${menu_options[@]}"; do if [ "${option}" ] && [ "${option}" != "Cancel" ]; then @@ -239,7 +239,7 @@ fn_install_menu_whiptail() { key=$(echo -e "${line}" | awk -F "," '{print $3}') val=$(echo -e "${line}" | awk -F "," '{print $2}') menu_options+=("${val//\"/}" "${key//\"/}") - done < "${options}" + done <"${options}" OPTION=$(${menucmd} --title "${title}" --menu "${caption}" "${height}" "${width}" "${menuheight}" "${menu_options[@]}" 3>&1 1>&2 2>&3) if [ $? == 0 ]; then eval "$resultvar=\"${OPTION}\"" @@ -263,12 +263,12 @@ fn_install_menu() { fi done case "$(basename "${menucmd}")" in - whiptail | dialog) - fn_install_menu_whiptail "${menucmd}" selection "${title}" "${caption}" "${options}" 40 80 30 - ;; - *) - fn_install_menu_bash selection "${title}" "${caption}" "${options}" - ;; + whiptail | dialog) + fn_install_menu_whiptail "${menucmd}" selection "${title}" "${caption}" "${options}" 40 80 30 + ;; + *) + fn_install_menu_bash selection "${title}" "${caption}" "${options}" + ;; esac eval "$resultvar=\"${selection}\"" } @@ -321,7 +321,7 @@ fn_install_file() { } # Prevent LinuxGSM from running as root. Except if doing a dependency install. -if [ "$(whoami)" == "root" ]; then +if [ "$(whoami)" == "root" ] && [ ! -f /.dockerenv ]; then if [ "${userinput}" == "install" ] || [ "${userinput}" == "auto-install" ] || [ "${userinput}" == "i" ] || [ "${userinput}" == "ai" ]; then if [ "${shortname}" == "core" ]; then echo -e "[ FAIL ] Do NOT run this script as root!" @@ -351,7 +351,7 @@ if [ "${shortname}" == "core" ]; then } | column -s $'\t' -t | more exit elif [ "${userinput}" == "install" ] || [ "${userinput}" == "i" ]; then - tail -n +1 "${serverlist}" | awk -F "," '{print $1 "," $2 "," $3}' > "${serverlistmenu}" + tail -n +1 "${serverlist}" | awk -F "," '{print $1 "," $2 "," $3}' >"${serverlistmenu}" fn_install_menu result "LinuxGSM" "Select game server to install." "${serverlistmenu}" userinput="${result}" fn_server_info From a6ae012f124ee678a3bc11bb4237676c6f25ffec Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sat, 22 Oct 2022 22:55:22 +0100 Subject: [PATCH 073/161] Release v22.2.1 --- lgsm/functions/core_functions.sh | 2 +- linuxgsm.sh | 2 +- tests/tests_fctrserver.sh | 2 +- tests/tests_jc2server.sh | 2 +- tests/tests_mcserver.sh | 2 +- tests/tests_ts3server.sh | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lgsm/functions/core_functions.sh b/lgsm/functions/core_functions.sh index 20d26de05..4edd50ca7 100755 --- a/lgsm/functions/core_functions.sh +++ b/lgsm/functions/core_functions.sh @@ -8,7 +8,7 @@ functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" -modulesversion="v22.2.0" +modulesversion="v22.2.1" # Core diff --git a/linuxgsm.sh b/linuxgsm.sh index 0748b2d86..7d9f21d0b 100755 --- a/linuxgsm.sh +++ b/linuxgsm.sh @@ -20,7 +20,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="v22.2.0" +version="v22.2.1" shortname="core" gameservername="core" commandname="CORE" diff --git a/tests/tests_fctrserver.sh b/tests/tests_fctrserver.sh index 0a7c0893f..2246bdeb1 100644 --- a/tests/tests_fctrserver.sh +++ b/tests/tests_fctrserver.sh @@ -20,7 +20,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="v22.2.0" +version="v22.2.1" shortname="fctr" gameservername="fctrserver" commandname="CORE" diff --git a/tests/tests_jc2server.sh b/tests/tests_jc2server.sh index 58e8da188..e408420b8 100644 --- a/tests/tests_jc2server.sh +++ b/tests/tests_jc2server.sh @@ -20,7 +20,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="v22.2.0" +version="v22.2.1" shortname="jc2" gameservername="jc2server" commandname="CORE" diff --git a/tests/tests_mcserver.sh b/tests/tests_mcserver.sh index 3fbbc3bf3..984f522f0 100644 --- a/tests/tests_mcserver.sh +++ b/tests/tests_mcserver.sh @@ -20,7 +20,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="v22.2.0" +version="v22.2.1" shortname="mc" gameservername="mcserver" commandname="CORE" diff --git a/tests/tests_ts3server.sh b/tests/tests_ts3server.sh index d4857765e..6bc89c9fe 100644 --- a/tests/tests_ts3server.sh +++ b/tests/tests_ts3server.sh @@ -20,7 +20,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="v22.2.0" +version="v22.2.1" shortname="ts3" gameservername="ts3server" commandname="CORE" From 76392b54a3263dedfae0d5b5b1768a23c135bee0 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Mon, 24 Oct 2022 16:14:02 +0100 Subject: [PATCH 074/161] revert: find -L causing infinate loop #4015 --- lgsm/functions/core_steamcmd.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lgsm/functions/core_steamcmd.sh b/lgsm/functions/core_steamcmd.sh index 453a8b77e..5b95adc81 100755 --- a/lgsm/functions/core_steamcmd.sh +++ b/lgsm/functions/core_steamcmd.sh @@ -174,7 +174,7 @@ fn_update_steamcmd_remotebuild() { fi # Removes appinfo.vdf as a fix for not always getting up to date version info from SteamCMD. - if [ "$(find -L "${HOME}" -type f -name "appinfo.vdf" | wc -l)" -ne "0" ]; then + if [ "$(find "${HOME}" -type f -name "appinfo.vdf" | wc -l)" -ne "0" ]; then find "${HOME}" -type f -name "appinfo.vdf" -exec rm -f {} \; fi From bbf56a04eeb86ae6d7d3d5739775c0f4305c13a1 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sat, 29 Oct 2022 11:21:30 +0100 Subject: [PATCH 075/161] fix: don't run permissions checks when root or docker --- lgsm/functions/check_permissions.sh | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/lgsm/functions/check_permissions.sh b/lgsm/functions/check_permissions.sh index 46642f7fb..1091cbc6e 100755 --- a/lgsm/functions/check_permissions.sh +++ b/lgsm/functions/check_permissions.sh @@ -181,7 +181,7 @@ fn_sys_perm_fix_manually_msg() { # Attempt to fix /sys related permission errors if sudo is available, exits otherwise. fn_sys_perm_errors_fix() { - if sudo -n true > /dev/null 2>&1; then + if sudo -n true >/dev/null 2>&1; then fn_print_dots "Automatically fixing /sys permissions" fn_script_log_info "Automatically fixing /sys permissions." if [ "${sysdirpermerror}" == "1" ]; then @@ -223,10 +223,8 @@ fn_sys_perm_error_process() { fi } -# Run perm error detect & fix/alert functions on /sys directories. - -## Run checks. -if [ "$(whoami)" != "root" ] || [ -f /.dockerenv ]; then +## Run permisions checks when not root or docker. +if [ "$(whoami)" != "root" ] && [ ! -f /.dockerenv ]; then fn_check_ownership fn_check_permissions if [ "${commandname}" == "START" ]; then From e5402d41ef94e014015ab84748a96c2dc675e0ac Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sat, 29 Oct 2022 12:14:50 +0100 Subject: [PATCH 076/161] feat: trigger docker image build --- .github/workflows/codacy-analysis.yml | 61 ---------------------- .github/workflows/super-linter.yml | 29 ---------- .github/workflows/trigger_docker_build.yml | 28 ++++++++++ 3 files changed, 28 insertions(+), 90 deletions(-) delete mode 100644 .github/workflows/codacy-analysis.yml delete mode 100644 .github/workflows/super-linter.yml create mode 100644 .github/workflows/trigger_docker_build.yml diff --git a/.github/workflows/codacy-analysis.yml b/.github/workflows/codacy-analysis.yml deleted file mode 100644 index 473255efd..000000000 --- a/.github/workflows/codacy-analysis.yml +++ /dev/null @@ -1,61 +0,0 @@ -# This workflow uses actions that are not certified by GitHub. -# They are provided by a third-party and are governed by -# separate terms of service, privacy policy, and support -# documentation. - -# This workflow checks out code, performs a Codacy security scan -# and integrates the results with the -# GitHub Advanced Security code scanning feature. For more information on -# the Codacy security scan action usage and parameters, see -# https://github.com/codacy/codacy-analysis-cli-action. -# For more information on Codacy Analysis CLI in general, see -# https://github.com/codacy/codacy-analysis-cli. - -name: Codacy Security Scan - -on: - push: - branches: ["main","master"] - pull_request: - # The branches below must be a subset of the branches above - branches: ["main","master"] - schedule: - - cron: "28 22 * * 4" - -permissions: - contents: read - -jobs: - codacy-security-scan: - permissions: - contents: read # for actions/checkout to fetch code - security-events: write # for github/codeql-action/upload-sarif to upload SARIF results - actions: read # only required for a private repository by github/codeql-action/upload-sarif to get the Action run status - name: Codacy Security Scan - runs-on: ubuntu-latest - steps: - # Checkout the repository to the GitHub Actions runner - - name: Checkout code - uses: actions/checkout@v3 - - # Execute Codacy Analysis CLI and generate a SARIF output with the security issues identified during the analysis - - name: Run Codacy Analysis CLI - uses: codacy/codacy-analysis-cli-action@v4.2.0 - with: - # Check https://github.com/codacy/codacy-analysis-cli#project-token to get your project token from your Codacy repository - # You can also omit the token and run the tools that support default configurations - project-token: ${{ secrets.CODACY_PROJECT_TOKEN }} - verbose: true - output: results.sarif - format: sarif - # Adjust severity of non-security issues - gh-code-scanning-compat: true - # Force 0 exit code to allow SARIF file generation - # This will handover control about PR rejection to the GitHub side - max-allowed-issues: 2147483647 - - # Upload the SARIF file generated in the previous step - - name: Upload SARIF results file - uses: github/codeql-action/upload-sarif@v2 - with: - sarif_file: results.sarif diff --git a/.github/workflows/super-linter.yml b/.github/workflows/super-linter.yml deleted file mode 100644 index 4fb36f74e..000000000 --- a/.github/workflows/super-linter.yml +++ /dev/null @@ -1,29 +0,0 @@ -# This workflow executes several linters on changed files based on languages used in your code base whenever -# you push a code or open a pull request. -# -# You can adjust the behavior by modifying this file. -# For more information, see: -# https://github.com/github/super-linter -name: Lint Code Base - -on: - push: - branches: ["main","master"] - pull_request: - branches: ["main","master"] -jobs: - run-lint: - runs-on: ubuntu-latest - steps: - - name: Checkout code - uses: actions/checkout@v3 - with: - # Full git history is needed to get a proper list of changed files within `super-linter` - fetch-depth: 0 - - - name: Lint Code Base - uses: github/super-linter@v4 - env: - VALIDATE_ALL_CODEBASE: false - DEFAULT_BRANCH: "main" - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/trigger_docker_build.yml b/.github/workflows/trigger_docker_build.yml new file mode 100644 index 000000000..0f1055c7d --- /dev/null +++ b/.github/workflows/trigger_docker_build.yml @@ -0,0 +1,28 @@ +name: Trigger Docker Build +on: + push: + branches: + - master + - develop +jobs: + trigger_build_docker-linuxgsm: + name: Trigger Build docker-linuxgsm + runs-on: ubuntu-latest + steps: + - uses: convictional/trigger-workflow-and-wait@v1.3.0 + with: + owner: GameServerManagers + repo: docker-linuxgsm + github_token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} + workflow_file_name: docker-publish.yml + + trigger_build_docker-gameserver: + name: Trigger Build docker-linuxgsm + runs-on: ubuntu-latest + steps: + - uses: convictional/trigger-workflow-and-wait@v1.3.0 + with: + owner: GameServerManagers + repo: docker-gameserver + github_token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} + workflow_file_name: docker-publish.yml From 8a5c28ae9c1ee6c65becdfc3c23a615de0c081fd Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sat, 29 Oct 2022 12:41:17 +0100 Subject: [PATCH 077/161] fix: add execname to check_executable --- lgsm/functions/check_executable.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/lgsm/functions/check_executable.sh b/lgsm/functions/check_executable.sh index 252c6c8d2..d1b5c3efd 100755 --- a/lgsm/functions/check_executable.sh +++ b/lgsm/functions/check_executable.sh @@ -8,6 +8,7 @@ functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" # Check if executable exists +execname=$(basename "${executable}") if [ ! -f "${executabledir}/${execname}" ]; then fn_print_fail_nl "executable was not found" echo -e "* ${executabledir}/${execname}" From cfbb64137d613789a97f54d24040ecc5632558c3 Mon Sep 17 00:00:00 2001 From: timm0e <11885527+timm0e@users.noreply.github.com> Date: Sun, 30 Oct 2022 02:47:49 +0200 Subject: [PATCH 078/161] feat(csgoserver): add all game mode related cvars to CS:GO LGSM config (#4005) * feat(csgoserver): add parameters for gamemodeflags and skirmishid to lgsm config * docs(csgoserver): add parameter examples for all gamemodes in lgsm config Co-authored-by: Daniel Gibbs --- .../config-lgsm/csgoserver/_default.cfg | 30 ++++++++++++------- 1 file changed, 20 insertions(+), 10 deletions(-) diff --git a/lgsm/config-default/config-lgsm/csgoserver/_default.cfg b/lgsm/config-default/config-lgsm/csgoserver/_default.cfg index ae82d2a94..30ba7b8c5 100644 --- a/lgsm/config-default/config-lgsm/csgoserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/csgoserver/_default.cfg @@ -10,17 +10,27 @@ ## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters # https://docs.linuxgsm.com/game-servers/counter-strike-global-offensive -# [Game Modes] gametype gamemode mapgroup (you can mix these across all Game Modes except Danger Zone, but use only one) -# Arms Race 1 0 mg_armsrace -# Classic Casual 0 0 mg_casualsigma, mg_casualdelta -# Classic Competitive 0 1 mg_active, mg_reserves, mg_hostage, mg_de_dust2 -# Custom 3 0 -# Deathmatch 1 2 mg_deathmatch -# Demolition 1 1 mg_demolition -# Wingman 0 2 -# Danger Zone 6 0 mg_dz_blacksite (map: dz_blacksite), mg_dz_sirocco (map: dz_sirocco) +# [Game Modes] gametype gamemode gamemodeflags skirmishid mapgroup (you can mix these across all Game Modes except Danger Zone, but use only one) +# Arms Race 1 0 0 0 mg_armsrace +# Boom! Headshot! 1 2 0 6 mg_skirmish_headshots +# Classic Casual 0 0 0 0 mg_casualsigma, mg_casualdelta +# Classic Competitive (Default) 0 1 0 0 mg_active, mg_reserves, mg_hostage, mg_de_dust2, ... +# Classic Competitive (Short Match) 0 1 32 0 mg_active, mg_reserves, mg_hostage, mg_de_dust2, ... +# Danger Zone 6 0 0 0 mg_dz_blacksite (map: dz_blacksite), mg_dz_sirocco (map: dz_sirocco) +# Deathmatch (Default) 1 2 0 0 mg_deathmatch +# Deathmatch (Free For All) 1 2 32 0 mg_deathmatch +# Deathmatch (Team vs Team) 1 2 4 0 mg_deathmatch +# Demolition 1 1 0 0 mg_demolition +# Flying Scoutsman 0 0 0 3 mg_skirmish_flyingscoutsman +# Hunter-Gatherers 1 2 0 7 mg_skirmish_huntergatherers +# Retakes 0 0 0 12 mg_skirmish_retakes +# Stab Stab Zap 0 0 0 1 mg_skirmish_stabstabzap +# Trigger Discipline 0 0 0 4 mg_skirmish_triggerdiscipline +# Wingman 0 2 0 0 mg_de_prime, mg_de_blagai, mg_de_vertigo, mg_de_inferno, mg_de_overpass, mg_de_cbble, mg_de_train, mg_de_shortnuke, mg_de_shortdust, mg_de_lake gametype="0" gamemode="0" +gamemodeflags="0" +skirmishid="0" mapgroup="mg_active" ip="0.0.0.0" port="27015" @@ -43,7 +53,7 @@ wscollectionid="" wsstartmap="" ## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters -startparameters="-game csgo -usercon -strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +tv_port ${sourcetvport} +sv_setsteamaccount ${gslt} -tickrate ${tickrate} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers_override ${maxplayers} +mapgroup ${mapgroup} +game_type ${gametype} +game_mode ${gamemode} +host_workshop_collection ${wscollectionid} +workshop_start_map ${wsstartmap} -authkey ${wsapikey} -nobreakpad" +startparameters="-game csgo -usercon -strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +tv_port ${sourcetvport} +sv_setsteamaccount ${gslt} -tickrate ${tickrate} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers_override ${maxplayers} +mapgroup ${mapgroup} +game_type ${gametype} +game_mode ${gamemode} +sv_game_mode_flags ${gamemodeflags} +sv_skirmish_id ${skirmishid} +host_workshop_collection ${wscollectionid} +workshop_start_map ${wsstartmap} -authkey ${wsapikey} -nobreakpad" #### LinuxGSM Settings #### From 8dc7861c630c52d530f290c4f927c1073f42eac8 Mon Sep 17 00:00:00 2001 From: Christian Date: Sun, 30 Oct 2022 02:52:16 +0200 Subject: [PATCH 079/161] fix(bt): add convertion of the startscript to LF (#4008) Co-authored-by: Daniel Gibbs --- lgsm/data/almalinux-8.csv | 2 +- lgsm/data/centos-7.csv | 2 +- lgsm/data/centos-8.csv | 2 +- lgsm/data/debian-10.csv | 2 +- lgsm/data/debian-11.csv | 2 +- lgsm/data/debian-9.csv | 2 +- lgsm/data/rocky-8.csv | 2 +- lgsm/data/ubuntu-16.04.csv | 2 +- lgsm/data/ubuntu-18.04.csv | 2 +- lgsm/data/ubuntu-20.04.csv | 2 +- lgsm/data/ubuntu-21.04.csv | 2 +- lgsm/data/ubuntu-22.04.csv | 2 +- lgsm/functions/fix_bt.sh | 8 ++++++++ 13 files changed, 20 insertions(+), 12 deletions(-) diff --git a/lgsm/data/almalinux-8.csv b/lgsm/data/almalinux-8.csv index 9910acb8d..d00fcd887 100644 --- a/lgsm/data/almalinux-8.csv +++ b/lgsm/data/almalinux-8.csv @@ -15,7 +15,7 @@ bfv,compat-libstdc++-33.i686,glibc.i686 bmdm,ncurses-libs.i686 bo bs -bt,libicu +bt,libicu,dos2unix bt1944 cc cd diff --git a/lgsm/data/centos-7.csv b/lgsm/data/centos-7.csv index 3d4b0a366..560740dd5 100644 --- a/lgsm/data/centos-7.csv +++ b/lgsm/data/centos-7.csv @@ -15,7 +15,7 @@ bfv,compat-libstdc++-33.i686,glibc.i686 bmdm,ncurses-libs.i686 bo bs -bt,libicu +bt,libicu,dos2unix bt1944 cc cd diff --git a/lgsm/data/centos-8.csv b/lgsm/data/centos-8.csv index 7d3095ba4..8ef35fa03 100644 --- a/lgsm/data/centos-8.csv +++ b/lgsm/data/centos-8.csv @@ -15,7 +15,7 @@ bfv,compat-libstdc++-33.i686,glibc.i686 bmdm,ncurses-libs.i686 bo bs -bt,libicu +bt,libicu,dos2unix bt1944 cc cd diff --git a/lgsm/data/debian-10.csv b/lgsm/data/debian-10.csv index 443c35cf0..036eb625c 100644 --- a/lgsm/data/debian-10.csv +++ b/lgsm/data/debian-10.csv @@ -15,7 +15,7 @@ bfv,libncurses5:i386,libstdc++5:i386 bmdm,libncurses5:i386 bo bs -bt,libicu-dev +bt,libicu-dev,dos2unix bt1944 cc cd diff --git a/lgsm/data/debian-11.csv b/lgsm/data/debian-11.csv index 58db53762..468990c5f 100644 --- a/lgsm/data/debian-11.csv +++ b/lgsm/data/debian-11.csv @@ -15,7 +15,7 @@ bfv,libncurses5:i386,libstdc++5:i386 bmdm,libncurses5:i386 bo bs -bt,libicu-dev +bt,libicu-dev,dos2unix bt1944 cc cd diff --git a/lgsm/data/debian-9.csv b/lgsm/data/debian-9.csv index fe55eb260..69773506f 100644 --- a/lgsm/data/debian-9.csv +++ b/lgsm/data/debian-9.csv @@ -15,7 +15,7 @@ bfv,libncurses5:i386,libstdc++5:i386 bmdm,libncurses5:i386 bo bs -bt,libicu-dev +bt,libicu-dev,dos2unix bt1944 cc cd diff --git a/lgsm/data/rocky-8.csv b/lgsm/data/rocky-8.csv index 9910acb8d..d00fcd887 100644 --- a/lgsm/data/rocky-8.csv +++ b/lgsm/data/rocky-8.csv @@ -15,7 +15,7 @@ bfv,compat-libstdc++-33.i686,glibc.i686 bmdm,ncurses-libs.i686 bo bs -bt,libicu +bt,libicu,dos2unix bt1944 cc cd diff --git a/lgsm/data/ubuntu-16.04.csv b/lgsm/data/ubuntu-16.04.csv index 1b23b1836..8dc3bd77a 100644 --- a/lgsm/data/ubuntu-16.04.csv +++ b/lgsm/data/ubuntu-16.04.csv @@ -14,7 +14,7 @@ bfv,libncurses5:i386,libstdc++5:i386 bmdm,libncurses5:i386 bo bs -bt,libicu-dev +bt,libicu-dev,dos2unix bt1944 cc cd diff --git a/lgsm/data/ubuntu-18.04.csv b/lgsm/data/ubuntu-18.04.csv index 443c35cf0..036eb625c 100644 --- a/lgsm/data/ubuntu-18.04.csv +++ b/lgsm/data/ubuntu-18.04.csv @@ -15,7 +15,7 @@ bfv,libncurses5:i386,libstdc++5:i386 bmdm,libncurses5:i386 bo bs -bt,libicu-dev +bt,libicu-dev,dos2unix bt1944 cc cd diff --git a/lgsm/data/ubuntu-20.04.csv b/lgsm/data/ubuntu-20.04.csv index 49f64348d..9f984bde9 100644 --- a/lgsm/data/ubuntu-20.04.csv +++ b/lgsm/data/ubuntu-20.04.csv @@ -15,7 +15,7 @@ bfv,libncurses5:i386,libstdc++5:i386 bmdm,libncurses5:i386 bo bs -bt,libicu-dev +bt,libicu-dev,dos2unix bt1944 cc cd diff --git a/lgsm/data/ubuntu-21.04.csv b/lgsm/data/ubuntu-21.04.csv index f1b28acd2..aabfa98ef 100644 --- a/lgsm/data/ubuntu-21.04.csv +++ b/lgsm/data/ubuntu-21.04.csv @@ -15,7 +15,7 @@ bfv,libncurses5:i386,libstdc++5:i386 bmdm,libncurses5:i386 bo bs -bt,libicu-dev +bt,libicu-dev,dos2unix bt1944 cc cd diff --git a/lgsm/data/ubuntu-22.04.csv b/lgsm/data/ubuntu-22.04.csv index dd567bf7b..e6b1e33a6 100644 --- a/lgsm/data/ubuntu-22.04.csv +++ b/lgsm/data/ubuntu-22.04.csv @@ -15,7 +15,7 @@ bfv,libncurses5:i386,libstdc++5:i386 bmdm,libncurses5:i386 bo bs -bt,libicu-dev +bt,libicu-dev,dos2unix bt1944 cc cmw diff --git a/lgsm/functions/fix_bt.sh b/lgsm/functions/fix_bt.sh index 094c2617c..07fd61ce5 100755 --- a/lgsm/functions/fix_bt.sh +++ b/lgsm/functions/fix_bt.sh @@ -14,3 +14,11 @@ if [ ! -d "${XDG_DATA_HOME:="${HOME}/.local/share"}/Daedalic Entertainment GmbH/ mkdir -p "${XDG_DATA_HOME:="${HOME}/.local/share"}/Daedalic Entertainment GmbH/Barotrauma" fn_fix_msg_end fi + +# check if startscript is with windows line endings and reformat it +if file -b "${serverfiles}${executable:1}" | grep -q CRLF; then + fixname="Convert ${executable:2} to unix file format" + fn_fix_msg_start + dos2unix -q "${serverfiles}${executable:1}" + fn_fix_msg_end +fi From 5bf35975b807d6fc5f737d3962c0d0264e5a0534 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 30 Oct 2022 01:52:44 +0100 Subject: [PATCH 080/161] build(deps): bump release-drafter/release-drafter from 5.21.0 to 5.21.1 (#4006) Bumps [release-drafter/release-drafter](https://github.com/release-drafter/release-drafter) from 5.21.0 to 5.21.1. - [Release notes](https://github.com/release-drafter/release-drafter/releases) - [Commits](https://github.com/release-drafter/release-drafter/compare/v5.21.0...v5.21.1) --- updated-dependencies: - dependency-name: release-drafter/release-drafter dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/create-release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/create-release.yml b/.github/workflows/create-release.yml index ad5a88a7d..e43f58c51 100644 --- a/.github/workflows/create-release.yml +++ b/.github/workflows/create-release.yml @@ -16,7 +16,7 @@ jobs: runs-on: ubuntu-latest steps: # Drafts your next Release notes as Pull Requests are merged into "master" - - uses: release-drafter/release-drafter@v5.21.0 + - uses: release-drafter/release-drafter@v5.21.1 with: config-name: release-drafter.yml env: From 930c7c8cac21de9fbf4e108e2324aa79c35b08c7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 30 Oct 2022 01:52:55 +0100 Subject: [PATCH 081/161] build(deps): bump webfactory/ssh-agent from 0.5.4 to 0.7.0 (#4009) Bumps [webfactory/ssh-agent](https://github.com/webfactory/ssh-agent) from 0.5.4 to 0.7.0. - [Release notes](https://github.com/webfactory/ssh-agent/releases) - [Changelog](https://github.com/webfactory/ssh-agent/blob/master/CHANGELOG.md) - [Commits](https://github.com/webfactory/ssh-agent/compare/v0.5.4...v0.7.0) --- updated-dependencies: - dependency-name: webfactory/ssh-agent dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/git-sync.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/git-sync.yml b/.github/workflows/git-sync.yml index b43996dc6..f07d1f3b4 100644 --- a/.github/workflows/git-sync.yml +++ b/.github/workflows/git-sync.yml @@ -10,8 +10,8 @@ jobs: GitHub-to-Bitbucket: runs-on: ubuntu-latest steps: - - name: webfactory/ssh-agent@v0.5.4 - uses: webfactory/ssh-agent@v0.5.4 + - name: webfactory/ssh-agent@v0.7.0 + uses: webfactory/ssh-agent@v0.7.0 with: ssh-private-key: ${{ secrets.BITBUCKET_SECRET }} From 9caeeb6f2e5d337a1fb0be07ba0f1acd2619e1a5 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sun, 30 Oct 2022 11:26:16 +0000 Subject: [PATCH 082/161] update README.md buttons (#4019) --- README.md | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 70f3b9365..f0a9713cf 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,11 @@ -

-
- LinuxGSM -

- -[![LinuxGSM](https://img.shields.io/badge/-LinuxGSM-2b2b2b.svg?logo=data%3Aimage%2Fpng%3Bbase64%2CiVBORw0KGgoAAAANSUhEUgAAACsAAABACAYAAACDbo5ZAAAGD0lEQVR4AcWYa2wUVRvHz75c2vJ2disXoUBEVIioRAx%2BMIFA1IRwUS6KCCiIKBrvhEYiiGm5iBgk8QOGEgUUDYTttmVZWFr2UmwURS6iYAoCtmisElSsdHdbkT7%2BTzoNy%2BGc2dm54C%2F5Rdkz85x%2FZ86ZOXOYXYhIg3Phx%2FA4PAcv6f%2Btg5vhHJjP3EcZsgsshufJHH%2FAJbDztQ7aG35J1vgCXn%2BtgvrgEbLHYei9FmE3kDOUuh10OGwjZ7gEh7kZ9gNyllK3gnrg7%2BQs56DHjbCDyB0GuRF2ArnDeDfCziF3mO1G2FfJHRa4EXYpuUOxG2GXkzuUuBH2TXKH5W6ELSV3eM%2BNsOUk5yQcAY8p2uvgSPitor3MjbB1UOQXOFBvHwpbhPYWOExvL4SNUOQ7p4P2JTlzhOPmCu0vCu1PQpE2WOhk2MdJjk9y7HNwP1wEPUJbAcmZ6WTYrYolnifbxZBiibnFySHQCkUaLdY7C0V4%2FT5OhF1JcuIW6%2B0lOcvsBi2Ezao3j8Ov7Quwj52w60jNKIs1R5GatVaDDoEXSU4D7GSxbidYT3IuwjusFK0mNUVMwaZNNbl%2B%2F87hoVCom0HthaQmnG3QB0lNPcxlCvz%2B0GtlZTuorCxYYlA%2FDzbY%2FnrAgV3hCVLzCDMgEAi9wMMi9IIM%2FUwnNXWwi5mwRaSmmmXA798xq%2F3Khp420VeE1LyS6eQeBhttSXgzywCCToIUCOyYZvKLOWWwkdfd6ORVpGYJM0F5efDe9mEQHGty2BWTmhVGO4PNBmOoKzMBxmo%2FhD25dWvljSbD5hjMkb9gT9lJq63Mzi1bKkbjloc7xBWtwiRrDASCVRi%2FRxA8if%2BvrawMTzYI%2FACpeUv2KFFtDcUyTKilCHcis8G1Ga7wHpLzG8wVFs1K7jaeUKHZfIxmkj9%2FM4S9x9RGiMEudo0QbCVu9Xqn5PWEwLUk5%2FP0iaXac53I0kAH9Sau4m54lo%2FdTMfyekLYKQZ7ub34AbMMlmw5irC2VYTN0fuVMYMf8JHxJ7L7YYXAlSRnI2%2F8RtH4siTsDMz%2BZ5yS15OEXUxyDjGD1%2BvEq8MG16CDzY6JepKwT6geYbzxb0XjGMl7vwGSgzZIwo4nOa1M8Yr9Afb%2Fj8L21%2FsXaeaNZ2A6KTiEASph%2F0vF80cn4tokqu79fzfCUk2vfF4%2FFdFGEjGPHvg2yWrsDG%2F4%2BqpZB8jPOiXjWk0y5iXdM3XhKUvxBTA9UvHuvNPh%2Bzb%2BWj10z6nwuHWBbQFMvNCjKnn7qd1jS%2Fnx9VX3b6jC%2BbwOr5eMe3%2B83IcW4%2F3qgT%2BUTbA9srGaiHsn8AKiF6Ld%2FxF%2FOx6eeAJXabvK78MTTornNMd6XJTVR7%2Fj9bBjhFxV%2FMc1kJOAy2AeA%2FgrV4mFVDZFCqm8rEJ6qysCAWqK9iaztRJRbWXa4moFTELOav7jY%2FqAvoXp0Gc9NX7bIZl17%2FZl0rC1wRLeno0NvP%2B0CTcYNnS8wW6CtzNANaxzKqo9hRNOQ8rGo7tmSsMe2zWdt2frqVRcm5s2fofCgawDNHRNxnyfqgsYez4y4ADCjRM9H73hsNWafILTQdaFiSTj%2BQ%2FxA6yH7d%2BCmR8XbYr0a7VTF2N4siSsb5qdos3R6%2FjGxpULFfw7EfORnbrI9TAToX0sD40%2F2ylcGdh2Rdhg%2BSf2gka9jRTqK9%2BGwgHz7RTfVbHxirDhivdthYUvMRX8aYAD9lstvi%2B0aDL2DUZ0eCBUNNVG0IP65FLTWqPdiqdC0koHTVXe7iyNRG23QotBEy1RbTAzQyrmnYUT2rLsoA13JpcB4eVC2daBM1g2JGLekmwf5On7EJfngfZTNnVSce8bFjaTmQdvs%2FXmO%2FJVpoXdx3RSUe9O00Fj3nUdy0RLgRHiHXOPGW1h2uKZ07c9rG%2Bxyefp23pQeyBIEQoavYlakrG8fnrY5yHn2fbxXzAgw7m8bT5zkkSk4C7cpmOK21esB%2FXAQ5DzFfTo43%2BF%2FDzf0eZ4wZ3MDSjMcvD6nIeOahGgia%2FyU3HforTPkWkwnakdn0cI9jqfbPjD%2FuQLJr6644snlgX%2FApOMoyd1R5%2FxAAAAAElFTkSuQmCC)](https://linuxgsm.com) [![Codacy Badge](https://app.codacy.com/project/badge/Grade/d19c5234dc3743d8a8a14093711ca52d)](https://www.codacy.com/gh/GameServerManagers/LinuxGSM/dashboard?utm_source=github.com&utm_medium=referral&utm_content=GameServerManagers/LinuxGSM&utm_campaign=Badge_Grade) [![Backup Repo](https://github.com/GameServerManagers/LinuxGSM/workflows/Backup%20Repo/badge.svg)](https://bitbucket.org/GameServerManagers/linuxgsm) [![Discord](https://discordapp.com/api/guilds/127498813903601664/widget.png?style=shield)](https://linuxgsm.com/discord) [![MIT Licence](https://badges.frapsoft.com/os/mit/mit.svg?v=103)](https://github.com/GameServerManagers/LinuxGSM/blob/master/LICENSE) [![made-with-bash](https://img.shields.io/badge/-Made%20with%20Bash-1f425f.svg?logo=image%2Fpng%3Bbase64%2CiVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyZpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw%2FeHBhY2tldCBiZWdpbj0i77u%2FIiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8%2BIDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTExIDc5LjE1ODMyNSwgMjAxNS8wOS8xMC0wMToxMDoyMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTUgKFdpbmRvd3MpIiB4bXBNTTpJbnN0YW5jZUlEPSJ4bXAuaWlkOkE3MDg2QTAyQUZCMzExRTVBMkQxRDMzMkJDMUQ4RDk3IiB4bXBNTTpEb2N1bWVudElEPSJ4bXAuZGlkOkE3MDg2QTAzQUZCMzExRTVBMkQxRDMzMkJDMUQ4RDk3Ij4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6QTcwODZBMDBBRkIzMTFFNUEyRDFEMzMyQkMxRDhEOTciIHN0UmVmOmRvY3VtZW50SUQ9InhtcC5kaWQ6QTcwODZBMDFBRkIzMTFFNUEyRDFEMzMyQkMxRDhEOTciLz4gPC9yZGY6RGVzY3JpcHRpb24%2BIDwvcmRmOlJERj4gPC94OnhtcG1ldGE%2BIDw%2FeHBhY2tldCBlbmQ9InIiPz6lm45hAAADkklEQVR42qyVa0yTVxzGn7d9Wy03MS2ii8s%2BeokYNQSVhCzOjXZOFNF4jx%2BMRmPUMEUEqVG36jo2thizLSQSMd4N8ZoQ8RKjJtooaCpK6ZoCtRXKpRempbTv5ey83bhkAUphz8fznvP8znn%2B%2F3NeEEJgNBoRRSmz0ub%2FfuxEacBg%2FDmYtiCjgo5NG2mBXq%2BH5I1ogMRk9Zbd%2BQU2e1ML6VPLOyf5tvBQ8yT1lG10imxsABm7SLs898GTpyYynEzP60hO3trHDKvMigUwdeaceacqzp7nOI4n0SSIIjl36ao4Z356OV07fSQAk6xJ3XGg%2BLCr1d1OYlVHp4eUHPnerU79ZA%2F1kuv1JQMAg%2BE4O2P23EumF3VkvHprsZKMzKwbRUXFEyTvSIEmTVbrysp%2BWr8wfQHGK6WChVa3bKUmdWou%2BjpArdGkzZ41c1zG%2Fu5uGH4swzd561F%2BuhIT4%2BLnSuPsv9%2BJKIpjNr9dXYOyk7%2FBZrcjIT4eCnoKgedJP4BEqhG77E3NKP31FO7cfQA5K0dSYuLgz2TwCWJSOBzG6crzKK%2BohNfni%2Bx6OMUMMNe%2Fgf7ocbw0v0acKg6J8Ql0q%2BT%2FAXR5PNi5dz9c71upuQqCKFAD%2BYhrZLEAmpodaHO3Qy6TI3NhBpbrshGtOWKOSMYwYGQM8nJzoFJNxP2HjyIQho4PewK6hBktoDcUwtIln4PjOWzflQ%2Be5yl0yCCYgYikTclGlxadio%2BBQCSiW1UXoVGrKYwH4RgMrjU1HAB4vR6LzWYfFUCKxfS8Ftk5qxHoCUQAUkRJaSEokkV6Y%2F%2BJUOC4hn6A39NVXVBYeNP8piH6HeA4fPbpdBQV5KOx0QaL1YppX3Jgk0TwH2Vg6S3u%2BdB91%2B%2FpuNYPYFl5uP5V7ZqvsrX7jxqMXR6ff3gCQSTzFI0a1TX3wIs8ul%2Bq4HuWAAiM39vhOuR1O1fQ2gT%2F26Z8Z5vrl2OHi9OXZn995nLV9aFfS6UC9JeJPfuK0NBohWpCHMSAAsFe74WWP%2BvT25wtP9Bpob6uGqqyDnOtaeumjRu%2ByFu36VntK%2FPA5umTJeUtPWZSU9BCgud661odVp3DZtkc7AnYR33RRC708PrVi1larW7XwZIjLnd7R6SgSqWSNjU1B3F72pz5TZbXmX5vV81Yb7Lg7XT%2FUXriu8XLVqw6c6XqWnBKiiYU%2BMt3wWF7u7i91XlSEITwSAZ%2FCzAAHsJVbwXYFFEAAAAASUVORK5CYII%3D)](https://www.gnu.org/software/bash/) +

+ LinuxGSM + Codacy grade + GitHub Workflow Status + Discord + SteamCMD + MIT License +

[LinuxGSM](https://linuxgsm.com) is the command-line tool for quick, simple deployment and management of Linux dedicated game servers. From fbaed943242a716cacf593e26eb699527a64e7b0 Mon Sep 17 00:00:00 2001 From: crawforc3 Date: Sun, 30 Oct 2022 15:24:07 -0700 Subject: [PATCH 083/161] feat(newserver): Necesse (#3997) * Add Necesse game server * change github info for testing * add defaul config * fix config * Update config * revery github repo * remove artifact * Update _default.cfg * Update install sequence * Update servercfg * Add post install * Update nec post isntall * update fixes * Remove config checks * update install config * fix typo * Add config check * add config checks to post install * fix install config * update fix.sh * Clean up * correct dependencies * add details * add nec * config * update dependencies * prettier Co-authored-by: Daniel Gibbs --- .../config-lgsm/necserver/_default.cfg | 180 ++++++++++++++++++ lgsm/data/almalinux-8.csv | 7 +- lgsm/data/almalinux-9.csv | 129 +++++++++++++ lgsm/data/centos-7.csv | 7 +- lgsm/data/centos-8.csv | 7 +- lgsm/data/centos-9.csv | 128 +++++++++++++ lgsm/data/debian-10.csv | 7 +- lgsm/data/debian-11.csv | 7 +- lgsm/data/debian-9.csv | 7 +- lgsm/data/rhel-7.csv | 7 +- lgsm/data/rhel-8.csv | 7 +- lgsm/data/rhel-9.csv | 129 +++++++++++++ lgsm/data/rocky-8.csv | 7 +- lgsm/data/rocky-9.csv | 129 +++++++++++++ lgsm/data/serverlist.csv | 5 +- lgsm/data/ubuntu-16.04.csv | 7 +- lgsm/data/ubuntu-18.04.csv | 7 +- lgsm/data/ubuntu-20.04.csv | 7 +- lgsm/data/ubuntu-21.04.csv | 7 +- lgsm/data/ubuntu-21.10.csv | 7 +- lgsm/data/ubuntu-22.04.csv | 7 +- lgsm/functions/check_permissions.sh | 2 +- lgsm/functions/core_getopt.sh | 2 +- lgsm/functions/info_game.sh | 137 ++++++++----- lgsm/functions/info_messages.sh | 17 +- lgsm/functions/install_config.sh | 8 + lgsm/functions/install_server_files.sh | 2 +- linuxgsm.sh | 22 +-- 28 files changed, 878 insertions(+), 117 deletions(-) create mode 100644 lgsm/config-default/config-lgsm/necserver/_default.cfg create mode 100644 lgsm/data/almalinux-9.csv create mode 100644 lgsm/data/centos-9.csv create mode 100644 lgsm/data/rhel-9.csv create mode 100644 lgsm/data/rocky-9.csv diff --git a/lgsm/config-default/config-lgsm/necserver/_default.cfg b/lgsm/config-default/config-lgsm/necserver/_default.cfg new file mode 100644 index 000000000..65b7a7f1d --- /dev/null +++ b/lgsm/config-default/config-lgsm/necserver/_default.cfg @@ -0,0 +1,180 @@ +################################## +######## Default Settings ######## +################################## +# DO NOT EDIT, ANY CHANGES WILL BE OVERWRITTEN! +# Copy settings from here and use them in either: +# common.cfg - applies settings to every instance. +# [instance].cfg - applies settings to a specific instance. + +#### Game Server Settings #### +## Pre-defined Paramters | https://docs.linuxgsm.com/configuration/start-parameters#predefined-parameters +worldname="MyWorld" + +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="-localdir -world ${worldname}" + +#### LinuxGSM Settings #### + +## LinuxGSM Stats +# Send useful stats to LinuxGSM developers. +# https://docs.linuxgsm.com/configuration/linuxgsm-stats +# (on|off) +stats="off" + +## Notification Alerts +# (on|off) + +# Display IP | https://docs.linuxgsm.com/alerts#display-ip +displayip="" + +# More info | https://docs.linuxgsm.com/alerts#more-info +postalert="off" + +# Discord Alerts | https://docs.linuxgsm.com/alerts/discord +discordalert="off" +discordwebhook="webhook" + +# Email Alerts | https://docs.linuxgsm.com/alerts/email +emailalert="off" +email="email@example.com" +emailfrom="" + +# Gotify Alerts | https://docs.linuxgsm.com/alerts/gotify +gotifyalert="off" +gotifytoken="token" +gotifywebhook="webhook" + +# IFTTT Alerts | https://docs.linuxgsm.com/alerts/ifttt +iftttalert="off" +ifttttoken="accesstoken" +iftttevent="linuxgsm_alert" + +# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun +mailgunalert="off" +mailgunapiregion="us" +mailguntoken="accesstoken" +mailgundomain="example.com" +mailgunemailfrom="alert@example.com" +mailgunemail="email@myemail.com" + +# Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet +pushbulletalert="off" +pushbullettoken="accesstoken" +channeltag="" + +# Pushover Alerts | https://docs.linuxgsm.com/alerts/pushover +pushoveralert="off" +pushovertoken="accesstoken" +pushoveruserkey="userkey" + +# Rocket.Chat Alerts | https://docs.linuxgsm.com/alerts/rocket.chat +rocketchatalert="off" +rocketchatwebhook="webhook" +rocketchattoken="" + +# Slack Alerts | https://docs.linuxgsm.com/alerts/slack +slackalert="off" +slackwebhook="webhook" + +# Telegram Alerts | https://docs.linuxgsm.com/alerts/telegram +# You can add a custom cURL string eg proxy (useful in Russia) in "curlcustomstring". +# For example "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help". +telegramapi="api.telegram.org" +telegramalert="off" +telegramtoken="accesstoken" +telegramchatid="" +curlcustomstring="" + +## Updating | https://docs.linuxgsm.com/commands/update +updateonstart="off" + +## Backup | https://docs.linuxgsm.com/commands/backup +maxbackups="4" +maxbackupdays="30" +stoponbackup="on" + +## Logging | https://docs.linuxgsm.com/features/logging +consolelogging="on" +logdays="7" + +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + +## ANSI Colors | https://docs.linuxgsm.com/features/ansi-colors +ansi="on" + +#### Advanced Settings #### + +## Message Display Time | https://docs.linuxgsm.com/features/message-display-time +sleeptime="0.5" + +## SteamCMD Settings | https://docs.linuxgsm.com/steamcmd +# Server appid +appid="1169370" +steamcmdforcewindows="no" +# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch +branch="" +betapassword="" +# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server +steammaster="false" + +## Stop Mode | https://docs.linuxgsm.com/features/stop-mode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: GoldSrc +# 10: Avorion +# 11: end +stopmode="2" + +## Query mode +# 1: session only +# 2: gamedig (gsquery fallback) +# 3: gamedig +# 4: gsquery +# 5: tcp +querymode="2" +querytype="protocol-valve" + +## Console type +consoleverbose="yes" +consoleinteract="no" + +## Game Server Details +# Do not edit +gamename="Necesse" + +#### Directories #### +# Edit with care + +## Game Server Directories +systemdir="${serverfiles}" +executabledir="${serverfiles}" +executable="./StartServer-nogui.sh" +servercfgdir="${serverfiles}/cfg" +servercfg="server.cfg" +servercfgdefault="server.cfg" +servercfgfullpath="${servercfgdir}/${servercfg}" + +## Backup Directory +backupdir="${lgsmdir}/backup" + +## Logging Directories +logdir="${rootdir}/log" +gamelogdir="${systemdir}/logs" +lgsmlogdir="${logdir}/script" +consolelogdir="${logdir}/console" +lgsmlog="${lgsmlogdir}/${selfname}-script.log" +consolelog="${consolelogdir}/${selfname}-console.log" +alertlog="${lgsmlogdir}/${selfname}-alert.log" +postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" + +## Logs Naming +lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" +consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" diff --git a/lgsm/data/almalinux-8.csv b/lgsm/data/almalinux-8.csv index d00fcd887..0bc76a1a6 100644 --- a/lgsm/data/almalinux-8.csv +++ b/lgsm/data/almalinux-8.csv @@ -57,9 +57,9 @@ jc3 jk2 kf kf2 -lo l4d l4d2 +lo mc,java-11-openjdk mcb,libnsl mh @@ -68,6 +68,7 @@ mom mta,ncurses-compat-libs mumble nd +nec nmrih,ncurses-libs.i686 ns ns2,speex,tbb @@ -95,8 +96,8 @@ sbots scpsl scpslsm sdtd,telnet,expect -sfc,ncurses-libs.i686 sf +sfc,ncurses-libs.i686 sof2 sol squad @@ -117,9 +118,9 @@ ut2k4 ut3 ut99 vh,glibc-devel -vs vints,mono-complete vpmc,java-11-openjdk +vs wet wf wmc,java-11-openjdk diff --git a/lgsm/data/almalinux-9.csv b/lgsm/data/almalinux-9.csv new file mode 100644 index 000000000..0bc76a1a6 --- /dev/null +++ b/lgsm/data/almalinux-9.csv @@ -0,0 +1,129 @@ +all,bc,binutils,bzip2,cpio,curl,epel-release,file,glibc.i686,gzip,hostname,jq,libstdc++.i686,nmap-ncat,python36,tar,tmux,unzip,util-linux,wget,xz +steamcmd,glibc.i686,libstdc++.i686 +ac +ahl +ahl2 +ark +arma3 +armar,libcurl,openssl-libs +av +bb +bb2,libcurl.i686 +bd +bf1942,ncurses-libs.i686 +bfv,compat-libstdc++-33.i686,glibc.i686 +bmdm,ncurses-libs.i686 +bo +bs +bt,libicu,dos2unix +bt1944 +cc +cd +cmw +cod,compat-libstdc++-33.i686 +cod2,compat-libstdc++-33.i686 +cod4 +coduo,compat-libstdc++-33.i686 +codwaw +col +cs +cscz +csgo +css,ncurses-libs.i686 +dab +dayz +dmc +dod +dodr +dods +doi +dst,libcurl.i686 +dys +eco,libgdiplus +em +etl +fctr +fof +gmod,ncurses-libs.i686 +hl2dm +hldm +hldms +hw,zlib-devel +ins +inss +ios +jc2 +jc3 +jk2 +kf +kf2 +l4d +l4d2 +lo +mc,java-11-openjdk +mcb,libnsl +mh +mohaa,compat-libstdc++-33.i686 +mom +mta,ncurses-compat-libs +mumble +nd +nec +nmrih,ncurses-libs.i686 +ns +ns2,speex,tbb +ns2c,speex.i686,tbb.i686 +onset,mariadb-connector-c +opfor +pc +pmc,java-11-openjdk +pstbs,GConf2 +pvkii +pvr,libcxx +pz,java-11-openjdk rng-tools +q2 +q3 +ql +qw +ricochet +ro +rtcw +rust,zlib-devel +rw,java-11-openjdk +samp +sb +sbots +scpsl +scpslsm +sdtd,telnet,expect +sf +sfc,ncurses-libs.i686 +sof2 +sol +squad +st +stn +sven +terraria +tf2,libcurl.i686 +tfc +ti +ts +ts3 +tu +tw +unt +ut +ut2k4 +ut3 +ut99 +vh,glibc-devel +vints,mono-complete +vpmc,java-11-openjdk +vs +wet +wf +wmc,java-11-openjdk +wurm,xorg-x11-server-Xvfb +zmr,ncurses-libs.i686 +zps,ncurses-libs.i686 diff --git a/lgsm/data/centos-7.csv b/lgsm/data/centos-7.csv index 560740dd5..9ae62611d 100644 --- a/lgsm/data/centos-7.csv +++ b/lgsm/data/centos-7.csv @@ -57,9 +57,9 @@ jc3 jk2 kf kf2 -lo l4d l4d2 +lo mc,java-11-openjdk mcb,libnsl mh @@ -68,6 +68,7 @@ mom mta,ncurses-libs mumble nd +nec nmrih,ncurses-libs.i686 ns ns2,speex,tbb @@ -95,8 +96,8 @@ sbots scpsl scpslsm sdtd,telnet,expect -sfc,ncurses-libs.i686 sf +sfc,ncurses-libs.i686 sof2 sol squad @@ -117,8 +118,8 @@ ut2k4 ut3 ut99 vh,glibc-devel -vs vints,mono-complete +vs wet wf wmc,java-11-openjdk diff --git a/lgsm/data/centos-8.csv b/lgsm/data/centos-8.csv index 8ef35fa03..0d680e760 100644 --- a/lgsm/data/centos-8.csv +++ b/lgsm/data/centos-8.csv @@ -57,9 +57,9 @@ jc3 jk2 kf kf2 -lo l4d l4d2 +lo mc,java-11-openjdk mcb,libnsl mh @@ -68,6 +68,7 @@ mom mta,ncurses-compat-libs mumble nd +nec nmrih,ncurses-libs.i686 ns ns2,speex,tbb @@ -95,8 +96,8 @@ sbots scpsl scpslsm sdtd,telnet,expect -sfc,ncurses-libs.i686 sf +sfc,ncurses-libs.i686 sof2 sol squad @@ -116,9 +117,9 @@ ut2k4 ut3 ut99 vh,glibc-devel -vs vints,mono-complete vpmc,java-11-openjdk +vs wet wf wmc,java-11-openjdk diff --git a/lgsm/data/centos-9.csv b/lgsm/data/centos-9.csv new file mode 100644 index 000000000..0d680e760 --- /dev/null +++ b/lgsm/data/centos-9.csv @@ -0,0 +1,128 @@ +all,bc,binutils,bzip2,cpio,curl,epel-release,file,glibc.i686,gzip,hostname,jq,libstdc++,libstdc++.i686,nmap-ncat,python36,tar,tmux,unzip,util-linux,wget,xz +steamcmd,glibc.i686,libstdc++.i686 +ac +ahl +ahl2 +ark +arma3 +armar,libcurl,openssl-libs +av +bb +bb2,libcurl.i686 +bd +bf1942,ncurses-libs.i686 +bfv,compat-libstdc++-33.i686,glibc.i686 +bmdm,ncurses-libs.i686 +bo +bs +bt,libicu,dos2unix +bt1944 +cc +cd +cmw +cod,compat-libstdc++-33.i686 +cod2,compat-libstdc++-33.i686 +cod4 +coduo,compat-libstdc++-33.i686 +codwaw +col +cs +cscz +csgo +css,ncurses-libs.i686 +dab +dayz +dmc +dod +dodr +dods +doi +dst,libcurl.i686 +dys +eco,libgdiplus +em +etl +fctr +fof +gmod,ncurses-libs.i686 +hl2dm +hldm +hldms +hw,zlib-devel +ins +inss +ios +jc2 +jc3 +jk2 +kf +kf2 +l4d +l4d2 +lo +mc,java-11-openjdk +mcb,libnsl +mh +mohaa,compat-libstdc++-33.i686 +mom +mta,ncurses-compat-libs +mumble +nd +nec +nmrih,ncurses-libs.i686 +ns +ns2,speex,tbb +ns2c,speex.i686,tbb.i686 +onset,mariadb-connector-c +opfor +pc +pmc,java-11-openjdk +pstbs,GConf2 +pvkii +pvr,libcxx +pz,java-11-openjdk rng-tools +q2 +q3 +ql +qw +ricochet +ro +rtcw +rust,zlib-devel +rw,java-11-openjdk +samp +sb +sbots +scpsl +scpslsm +sdtd,telnet,expect +sf +sfc,ncurses-libs.i686 +sof2 +sol +squad +st +sven +terraria +tf2,libcurl.i686 +tfc +ti +ts +ts3 +tu +tw +unt +ut +ut2k4 +ut3 +ut99 +vh,glibc-devel +vints,mono-complete +vpmc,java-11-openjdk +vs +wet +wf +wmc,java-11-openjdk +wurm,xorg-x11-server-Xvfb +zmr,ncurses-libs.i686 +zps,ncurses-libs.i686 diff --git a/lgsm/data/debian-10.csv b/lgsm/data/debian-10.csv index 036eb625c..82c79d192 100644 --- a/lgsm/data/debian-10.csv +++ b/lgsm/data/debian-10.csv @@ -57,9 +57,9 @@ jc3 jk2 kf kf2 -lo l4d l4d2 +lo mc,openjdk-11-jre mcb mh @@ -68,6 +68,7 @@ mom mta,libncursesw5 mumble nd +nec nmrih,libtinfo5:i386 ns ns2,speex,libtbb2 @@ -95,8 +96,8 @@ sbots scpsl,mono-complete scpslsm,mono-complete sdtd,telnet,expect -sfc,libtinfo5:i386 sf +sfc,libtinfo5:i386 sof2 sol squad @@ -117,9 +118,9 @@ ut2k4 ut3 ut99 vh,libc6-dev -vs vints,mono-complete vpmc,openjdk-11-jre +vs wet wf wmc,openjdk-11-jre diff --git a/lgsm/data/debian-11.csv b/lgsm/data/debian-11.csv index 468990c5f..158f6222b 100644 --- a/lgsm/data/debian-11.csv +++ b/lgsm/data/debian-11.csv @@ -57,9 +57,9 @@ jc3 jk2 kf kf2 -lo l4d l4d2 +lo mc,openjdk-17-jre mcb mh @@ -68,6 +68,7 @@ mom mta,libncursesw5 mumble nd +nec nmrih,libtinfo5:i386 ns ns2,speex,libtbb2 @@ -95,8 +96,8 @@ sbots scpsl,mono-complete scpslsm,mono-complete sdtd,telnet,expect -sfc,libtinfo5:i386 sf +sfc,libtinfo5:i386 sof2 sol squad @@ -117,9 +118,9 @@ ut2k4 ut3 ut99 vh,libc6-dev -vs vints,mono-complete vpmc,openjdk-11-jre +vs wet wf wmc,openjdk-17-jre diff --git a/lgsm/data/debian-9.csv b/lgsm/data/debian-9.csv index 69773506f..f03c39f6a 100644 --- a/lgsm/data/debian-9.csv +++ b/lgsm/data/debian-9.csv @@ -57,9 +57,9 @@ jc3 jk2 kf kf2 -lo l4d l4d2 +lo mc,openjdk-8-jre mcb mh @@ -68,6 +68,7 @@ mom mta,libncursesw5 mumble nd +nec nmrih,libtinfo5:i386 ns ns2,speex,libtbb2 @@ -95,8 +96,8 @@ sbots scpsl,mono-complete scpslsm,mono-complete sdtd,telnet,expect -sfc,libtinfo5:i386 sf +sfc,libtinfo5:i386 sof2 sol squad @@ -117,8 +118,8 @@ ut2k4 ut3 ut99 vh,libc6-dev -vs vints,mono-complete +vs wet wf wmc,openjdk-8-jre diff --git a/lgsm/data/rhel-7.csv b/lgsm/data/rhel-7.csv index 968c4dc98..58dda5d20 100644 --- a/lgsm/data/rhel-7.csv +++ b/lgsm/data/rhel-7.csv @@ -57,9 +57,9 @@ jc3 jk2 kf kf2 -lo l4d l4d2 +lo mc,java-11-openjdk mcb,libnsl mh @@ -68,6 +68,7 @@ mom mta mumble nd +nec nmrih,ncurses-libs.i686 ns ns2,speex,tbb @@ -95,8 +96,8 @@ sbots scpsl scpslsm sdtd,telnet,expect -sfc,ncurses-libs.i686 sf +sfc,ncurses-libs.i686 sof2 sol squad @@ -117,9 +118,9 @@ ut2k4 ut3 ut99 vh,glibc-devel -vs vints,mono-complete vpmc,java-11-openjdk +vs wet wf wmc,java-11-openjdk diff --git a/lgsm/data/rhel-8.csv b/lgsm/data/rhel-8.csv index 002db75fd..8f0d5a30f 100644 --- a/lgsm/data/rhel-8.csv +++ b/lgsm/data/rhel-8.csv @@ -57,9 +57,9 @@ jc3 jk2 kf kf2 -lo l4d l4d2 +lo mc,java-11-openjdk mcb,libnsl mh @@ -68,6 +68,7 @@ mom mta mumble nd +nec nmrih,ncurses-libs.i686 ns ns2,speex,tbb @@ -95,8 +96,8 @@ sbots scpsl scpslsm sdtd,telnet,expect -sfc,ncurses-libs.i686 sf +sfc,ncurses-libs.i686 sof2 sol squad @@ -117,9 +118,9 @@ ut2k4 ut3 ut99 vh,glibc-devel -vs vints,mono-complete vpmc,java-11-openjdk +vs wet wf wmc,java-11-openjdk diff --git a/lgsm/data/rhel-9.csv b/lgsm/data/rhel-9.csv new file mode 100644 index 000000000..8f0d5a30f --- /dev/null +++ b/lgsm/data/rhel-9.csv @@ -0,0 +1,129 @@ +all,bc,binutils,bzip2,cpio,curl,epel-release,file,glibc.i686,gzip,hostname,jq,libstdc++.i686,nmap-ncat,python36,tar,tmux,unzip,util-linux,wget,xz +steamcmd,glibc.i686,libstdc++.i686 +ac +ahl +ahl2 +ark +arma3 +armar,libcurl,openssl-libs +av +bb +bb2,libcurl.i686 +bd +bf1942,ncurses-libs.i686 +bfv,compat-libstdc++-33.i686,glibc.i686 +bmdm,ncurses-libs.i686 +bo +bs +bt,libicu +bt1944 +cc +cd +cmw +cod,compat-libstdc++-33.i686 +cod2,compat-libstdc++-33.i686 +cod4 +coduo,compat-libstdc++-33.i686 +codwaw +col +cs +cscz +csgo +css,ncurses-libs.i686 +dab +dayz +dmc +dod +dodr +dods +doi +dst,libcurl.i686 +dys +eco,libgdiplus +em +etl +fctr +fof +gmod,ncurses-libs.i686 +hl2dm +hldm +hldms +hw,zlib-devel +ins +inss +ios +jc2 +jc3 +jk2 +kf +kf2 +l4d +l4d2 +lo +mc,java-11-openjdk +mcb,libnsl +mh +mohaa,compat-libstdc++-33.i686 +mom +mta +mumble +nd +nec +nmrih,ncurses-libs.i686 +ns +ns2,speex,tbb +ns2c,speex.i686,tbb.i686 +onset,mariadb-connector-c +opfor +pc +pmc,java-11-openjdk +pstbs,GConf2 +pvkii +pvr,libcxx +pz,java-11-openjdk rng-tools +q2 +q3 +ql +qw +ricochet +ro +rtcw +rust,zlib-devel +rw,java-11-openjdk +samp +sb +sbots +scpsl +scpslsm +sdtd,telnet,expect +sf +sfc,ncurses-libs.i686 +sof2 +sol +squad +st +stn +sven +terraria +tf2,libcurl.i686 +tfc +ti +ts +ts3 +tu +tw +unt +ut +ut2k4 +ut3 +ut99 +vh,glibc-devel +vints,mono-complete +vpmc,java-11-openjdk +vs +wet +wf +wmc,java-11-openjdk +wurm,xorg-x11-server-Xvfb +zmr,ncurses-libs.i686 +zps,ncurses-libs.i686 diff --git a/lgsm/data/rocky-8.csv b/lgsm/data/rocky-8.csv index d00fcd887..0bc76a1a6 100644 --- a/lgsm/data/rocky-8.csv +++ b/lgsm/data/rocky-8.csv @@ -57,9 +57,9 @@ jc3 jk2 kf kf2 -lo l4d l4d2 +lo mc,java-11-openjdk mcb,libnsl mh @@ -68,6 +68,7 @@ mom mta,ncurses-compat-libs mumble nd +nec nmrih,ncurses-libs.i686 ns ns2,speex,tbb @@ -95,8 +96,8 @@ sbots scpsl scpslsm sdtd,telnet,expect -sfc,ncurses-libs.i686 sf +sfc,ncurses-libs.i686 sof2 sol squad @@ -117,9 +118,9 @@ ut2k4 ut3 ut99 vh,glibc-devel -vs vints,mono-complete vpmc,java-11-openjdk +vs wet wf wmc,java-11-openjdk diff --git a/lgsm/data/rocky-9.csv b/lgsm/data/rocky-9.csv new file mode 100644 index 000000000..0bc76a1a6 --- /dev/null +++ b/lgsm/data/rocky-9.csv @@ -0,0 +1,129 @@ +all,bc,binutils,bzip2,cpio,curl,epel-release,file,glibc.i686,gzip,hostname,jq,libstdc++.i686,nmap-ncat,python36,tar,tmux,unzip,util-linux,wget,xz +steamcmd,glibc.i686,libstdc++.i686 +ac +ahl +ahl2 +ark +arma3 +armar,libcurl,openssl-libs +av +bb +bb2,libcurl.i686 +bd +bf1942,ncurses-libs.i686 +bfv,compat-libstdc++-33.i686,glibc.i686 +bmdm,ncurses-libs.i686 +bo +bs +bt,libicu,dos2unix +bt1944 +cc +cd +cmw +cod,compat-libstdc++-33.i686 +cod2,compat-libstdc++-33.i686 +cod4 +coduo,compat-libstdc++-33.i686 +codwaw +col +cs +cscz +csgo +css,ncurses-libs.i686 +dab +dayz +dmc +dod +dodr +dods +doi +dst,libcurl.i686 +dys +eco,libgdiplus +em +etl +fctr +fof +gmod,ncurses-libs.i686 +hl2dm +hldm +hldms +hw,zlib-devel +ins +inss +ios +jc2 +jc3 +jk2 +kf +kf2 +l4d +l4d2 +lo +mc,java-11-openjdk +mcb,libnsl +mh +mohaa,compat-libstdc++-33.i686 +mom +mta,ncurses-compat-libs +mumble +nd +nec +nmrih,ncurses-libs.i686 +ns +ns2,speex,tbb +ns2c,speex.i686,tbb.i686 +onset,mariadb-connector-c +opfor +pc +pmc,java-11-openjdk +pstbs,GConf2 +pvkii +pvr,libcxx +pz,java-11-openjdk rng-tools +q2 +q3 +ql +qw +ricochet +ro +rtcw +rust,zlib-devel +rw,java-11-openjdk +samp +sb +sbots +scpsl +scpslsm +sdtd,telnet,expect +sf +sfc,ncurses-libs.i686 +sof2 +sol +squad +st +stn +sven +terraria +tf2,libcurl.i686 +tfc +ti +ts +ts3 +tu +tw +unt +ut +ut2k4 +ut3 +ut99 +vh,glibc-devel +vints,mono-complete +vpmc,java-11-openjdk +vs +wet +wf +wmc,java-11-openjdk +wurm,xorg-x11-server-Xvfb +zmr,ncurses-libs.i686 +zps,ncurses-libs.i686 diff --git a/lgsm/data/serverlist.csv b/lgsm/data/serverlist.csv index 4c80f538a..a33bbf816 100644 --- a/lgsm/data/serverlist.csv +++ b/lgsm/data/serverlist.csv @@ -55,9 +55,9 @@ jc3,jc3server,Just Cause 3 jk2,jk2server,Jedi Knight II: Jedi Outcast kf,kfserver,Killing Floor kf2,kf2server,Killing Floor 2 -lo,loserver,Last Oasis l4d,l4dserver,Left 4 Dead l4d2,l4d2server,Left 4 Dead 2 +lo,loserver,Last Oasis mc,mcserver,Minecraft mcb,mcbserver,Minecraft Bedrock mh,mhserver,MORDHAU @@ -66,6 +66,7 @@ mom,momserver,Memories of Mars mta,mtaserver,Multi Theft Auto mumble,mumbleserver,Mumble nd,ndserver,Nuclear Dawn +nec,necserver,Necesse nmrih,nmrihserver,No More Room in Hell ns,nsserver,Natural Selection ns2,ns2server,Natural Selection 2 @@ -94,8 +95,8 @@ sbots,sbotsserver,StickyBots scpsl,scpslserver,SCP: Secret Laboratory scpslsm,scpslsmserver,SCP: Secret Laboratory ServerMod sdtd,sdtdserver,7 Days to Die -sfc,sfcserver,SourceForts Classic sf,sfserver,Satisfactory +sfc,sfcserver,SourceForts Classic sof2,sof2server,Soldier Of Fortune 2: Gold Edition sol,solserver,Soldat squad,squadserver,Squad diff --git a/lgsm/data/ubuntu-16.04.csv b/lgsm/data/ubuntu-16.04.csv index 8dc3bd77a..fdbcd12d0 100644 --- a/lgsm/data/ubuntu-16.04.csv +++ b/lgsm/data/ubuntu-16.04.csv @@ -56,9 +56,9 @@ jc3 jk2 kf kf2 -lo l4d l4d2 +lo mc,openjdk-8-jre mcb mh @@ -67,6 +67,7 @@ mom mta mumble nd +nec nmrih,libtinfo5:i386 ns ns2,speex,libtbb2 @@ -94,8 +95,8 @@ sbots scpsl,mono-complete scpslsm,mono-complete sdtd,telnet,expect -sfc,libtinfo5:i386 sf +sfc,libtinfo5:i386 sof2 sol squad @@ -116,8 +117,8 @@ ut2k4 ut3 ut99 vh,libc6-dev -vs vints,mono-complete +vs wet wf wmc,openjdk-8-jre diff --git a/lgsm/data/ubuntu-18.04.csv b/lgsm/data/ubuntu-18.04.csv index 036eb625c..82c79d192 100644 --- a/lgsm/data/ubuntu-18.04.csv +++ b/lgsm/data/ubuntu-18.04.csv @@ -57,9 +57,9 @@ jc3 jk2 kf kf2 -lo l4d l4d2 +lo mc,openjdk-11-jre mcb mh @@ -68,6 +68,7 @@ mom mta,libncursesw5 mumble nd +nec nmrih,libtinfo5:i386 ns ns2,speex,libtbb2 @@ -95,8 +96,8 @@ sbots scpsl,mono-complete scpslsm,mono-complete sdtd,telnet,expect -sfc,libtinfo5:i386 sf +sfc,libtinfo5:i386 sof2 sol squad @@ -117,9 +118,9 @@ ut2k4 ut3 ut99 vh,libc6-dev -vs vints,mono-complete vpmc,openjdk-11-jre +vs wet wf wmc,openjdk-11-jre diff --git a/lgsm/data/ubuntu-20.04.csv b/lgsm/data/ubuntu-20.04.csv index 9f984bde9..65697649b 100644 --- a/lgsm/data/ubuntu-20.04.csv +++ b/lgsm/data/ubuntu-20.04.csv @@ -57,9 +57,9 @@ jc3 jk2 kf kf2 -lo l4d l4d2 +lo mc,openjdk-17-jre mcb mh @@ -68,6 +68,7 @@ mom mta,libncursesw5 mumble nd +nec nmrih,libtinfo5:i386 ns ns2,speex,libtbb2 @@ -95,8 +96,8 @@ sbots scpsl,mono-complete scpslsm,mono-complete sdtd,telnet,expect -sfc,libtinfo5:i386 sf +sfc,libtinfo5:i386 sof2 sol squad @@ -117,9 +118,9 @@ ut2k4 ut3 ut99 vh,libc6-dev -vs vints,mono-complete vpmc,openjdk-11-jre +vs wet wf wmc,openjdk-17-jre diff --git a/lgsm/data/ubuntu-21.04.csv b/lgsm/data/ubuntu-21.04.csv index aabfa98ef..666f9d864 100644 --- a/lgsm/data/ubuntu-21.04.csv +++ b/lgsm/data/ubuntu-21.04.csv @@ -57,9 +57,9 @@ jc3 jk2 kf kf2 -lo l4d l4d2 +lo mc,openjdk-17-jre mcb mh @@ -68,6 +68,7 @@ mom mta,libncursesw5 mumble nd +nec nmrih,libtinfo5:i386 ns ns2,speex,libtbb2 @@ -95,8 +96,8 @@ sbots scpsl,mono-complete scpslsm,mono-complete sdtd,telnet,expect -sfc,libtinfo5:i386 sf +sfc,libtinfo5:i386 sof2 sol squad @@ -117,9 +118,9 @@ ut2k4 ut3 ut99 vh,libc6-dev -vs vints,mono-complete vpmc,openjdk-11-jre +vs wet wf wmc,openjdk-17-jre diff --git a/lgsm/data/ubuntu-21.10.csv b/lgsm/data/ubuntu-21.10.csv index 1ced64fc7..713d21a89 100644 --- a/lgsm/data/ubuntu-21.10.csv +++ b/lgsm/data/ubuntu-21.10.csv @@ -55,9 +55,9 @@ jc3 jk2 kf kf2 -lo l4d l4d2 +lo mc,openjdk-17-jre mcb mh @@ -66,6 +66,7 @@ mom mta,libncursesw5 mumble nd +nec nmrih,libtinfo5:i386 ns ns2,speex,libtbb2 @@ -93,8 +94,8 @@ sbots scpsl,mono-complete scpslsm,mono-complete sdtd,telnet,expect -sfc,libtinfo5:i386 sf +sfc,libtinfo5:i386 sof2 sol squad @@ -115,9 +116,9 @@ ut2k4 ut3 ut99 vh,libc6-dev -vs vints,mono-complete vpmc,openjdk-11-jre +vs wet wf wmc,openjdk-17-jre diff --git a/lgsm/data/ubuntu-22.04.csv b/lgsm/data/ubuntu-22.04.csv index e6b1e33a6..b65fc60ac 100644 --- a/lgsm/data/ubuntu-22.04.csv +++ b/lgsm/data/ubuntu-22.04.csv @@ -55,9 +55,9 @@ jc3 jk2 kf kf2 -lo l4d l4d2 +lo mc,openjdk-17-jre mcb mh @@ -66,6 +66,7 @@ mom mta,libncursesw5 mumble nd +nec nmrih,libtinfo5:i386 ns ns2,speex,libtbb2 @@ -93,8 +94,8 @@ sbots scpsl,mono-complete scpslsm,mono-complete sdtd,telnet,expect -sfc,libtinfo5:i386 sf +sfc,libtinfo5:i386 sof2 sol squad @@ -115,9 +116,9 @@ ut2k4 ut3 ut99 vh,libc6-dev -vs vints,mono-complete vpmc,openjdk-11-jre +vs wet wf wmc,openjdk-17-jre diff --git a/lgsm/functions/check_permissions.sh b/lgsm/functions/check_permissions.sh index 1091cbc6e..0094456ec 100755 --- a/lgsm/functions/check_permissions.sh +++ b/lgsm/functions/check_permissions.sh @@ -181,7 +181,7 @@ fn_sys_perm_fix_manually_msg() { # Attempt to fix /sys related permission errors if sudo is available, exits otherwise. fn_sys_perm_errors_fix() { - if sudo -n true >/dev/null 2>&1; then + if sudo -n true > /dev/null 2>&1; then fn_print_dots "Automatically fixing /sys permissions" fn_script_log_info "Automatically fixing /sys permissions." if [ "${sysdirpermerror}" == "1" ]; then diff --git a/lgsm/functions/core_getopt.sh b/lgsm/functions/core_getopt.sh index 3c44931b9..fdd66ab3f 100755 --- a/lgsm/functions/core_getopt.sh +++ b/lgsm/functions/core_getopt.sh @@ -75,7 +75,7 @@ if [ "${shortname}" == "jk2" ] || [ "${engine}" != "idtech3" ]; then fi # Validate and check-update command. -if [ "${appid}" ]||[ "${shortname}" == "ts3" ]; then +if [ "${appid}" ] || [ "${shortname}" == "ts3" ]; then currentopt+=("${cmd_validate[@]}" "${cmd_check_update[@]}") fi diff --git a/lgsm/functions/info_game.sh b/lgsm/functions/info_game.sh index dcec74b31..77169b3f3 100644 --- a/lgsm/functions/info_game.sh +++ b/lgsm/functions/info_game.sh @@ -17,24 +17,24 @@ functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_info_game_ac() { # Config if [ ! -f "${servercfgfullpath}" ]; then + adminpassword="${unavailable}" httpport="${zero}" port="${zero}" queryport="${zero}" servername="${unavailable}" - adminpassword="${unavailable}" else + adminpassword=$(grep "ADMIN_PASSWORD" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/ADMIN_PASSWORD//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') httpport=$(grep "HTTP_PORT" "${servercfgfullpath}" | tr -cd '[:digit:]') port=$(grep "TCP_PORT" "${servercfgfullpath}" | tr -cd '[:digit:]') queryport="${httpport}" servername=$(grep "NAME" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/NAME//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//' | head -n 1) - adminpassword=$(grep "ADMIN_PASSWORD" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/ADMIN_PASSWORD//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') # Not set + adminpassword=${adminpassword:-"NOT SET"} httpport=${httpport:-"0"} port=${port:-"0"} queryport=${queryport:-"0"} servername=${servername:-"NOT SET"} - adminpassword=${adminpassword:-"NOT SET"} fi } @@ -42,67 +42,74 @@ fn_info_game_ac() { fn_info_game_ark() { # Config if [ ! -f "${servercfgfullpath}" ]; then - servername="${unavailable}" adminpassword="${unavailable}" + servername="${unavailable}" serverpassword="${unavailable}" else - servername=$(sed -nr 's/^SessionName=(.*)/\1/p' "${servercfgfullpath}") adminpassword=$(sed -nr 's/^ServerAdminPassword=(.*)/\1/p' "${servercfgfullpath}") + servername=$(sed -nr 's/^SessionName=(.*)/\1/p' "${servercfgfullpath}") serverpassword=$(sed -nr 's/^ServerPassword=(.*)/\1/p' "${servercfgfullpath}") # Not set - servername=${servername:-"NOT SET"} adminpassword=${adminpassword:-"NOT SET"} + servername=${servername:-"NOT SET"} serverpassword=${serverpassword:-"NOT SET"} fi # Parameters + maxplayers=${maxplayers:-"0"} port=${port:-"0"} queryport=${queryport:-"0"} - rconport=${rconport:-"0"} rawport=$((port + 1)) - maxplayers=${maxplayers:-"0"} + rconport=${rconport:-"0"} } fn_info_game_arma3() { # Config if [ ! -f "${servercfgfullpath}" ]; then - servername="${unavailable}" adminpassword="${unavailable}" - serverpassword="${unavailable}" maxplayers="${zero}" + servername="${unavailable}" + serverpassword="${unavailable}" else - servername=$(sed -nr 's/^hostname\s*=\s*"(.*)"\s*;/\1/p' "${servercfgfullpath}") adminpassword=$(sed -nr 's/^passwordAdmin\s*=\s*"(.*)"\s*;/\1/p' "${servercfgfullpath}") - serverpassword=$(sed -nr 's/^password\s*=\s*"(.*)"\s*;/\1/p' "${servercfgfullpath}") maxplayers=$(sed -nr 's/^maxPlayers\s*=\s*([0-9]+)\s*;/\1/p' "${servercfgfullpath}") + servername=$(sed -nr 's/^hostname\s*=\s*"(.*)"\s*;/\1/p' "${servercfgfullpath}") + serverpassword=$(sed -nr 's/^password\s*=\s*"(.*)"\s*;/\1/p' "${servercfgfullpath}") # Not set - servername=${servername:-"NOT SET"} adminpassword=${adminpassword:-"NOT SET"} - serverpassword=${serverpassword:-"NOT SET"} maxplayers=${maxplayers:-"0"} + servername=${servername:-"NOT SET"} + serverpassword=${serverpassword:-"NOT SET"} fi # Parameters + battleeyeport=$((port + 4)) port=${port:-"2302"} - voiceport=${port:-"2302"} queryport=$((port + 1)) steammasterport=$((port + 2)) + voiceport=${port:-"2302"} voiceunusedport=$((port + 3)) - battleeyeport=$((port + 4)) } fn_info_game_armar() { - if [ -f "${servercfgfullpath}" ]; then + if [ ! -f "${servercfgfullpath}" ]; then + adminpassword="${unavailable}" + maxplayers="${zero}" + port=${port:-"0"} + queryport= + servername="${unavailable}" + serverpassword="${unavailable}" + else adminpassword=$(jq -r '.adminPassword' "${servercfgfullpath}") + battleeyeport=1376 configip=$(jq -r '.gameHostBindAddress' "${servercfgfullpath}") maxplayers=$(jq -r '.game.playerCountLimit' "${servercfgfullpath}") port=$(jq -r '.gameHostBindPort' "${servercfgfullpath}") queryport=$(jq -r '.steamQueryPort' "${servercfgfullpath}") servername=$(jq -r '.game.name' "${servercfgfullpath}") serverpassword=$(jq -r '.game.password' "${servercfgfullpath}") - battleeyeport=1376 # Not set adminpassword=${adminpassword:-"NOT SET"} @@ -112,10 +119,6 @@ fn_info_game_armar() { queryport=${queryport:-"0"} servername=${servername:-"NOT SET"} serverpassword=${serverpassword:-"NOT SET"} - else - port=${port:-"0"} - servername="${unavailable}" - serverpassword="${unavailable}" fi } @@ -148,7 +151,7 @@ fn_info_game_av() { fi # Not set - maxplayers=${maxplayers:-"NOT SET"} + maxplayers=${maxplayers:-"0"} servername=${servername:-"NOT SET"} serverpassword=${serverpassword:-"NOT SET"} port=${port:-"0"} @@ -233,7 +236,7 @@ fn_info_game_bo() { serverpassword=${serverpassword:-"NOT SET"} port=${port:-"0"} queryport=${queryport:-"0"} - maxplayers=${maxplayers:-"NOT SET"} + maxplayers=${maxplayers:-"0"} fi } @@ -477,7 +480,7 @@ fn_info_game_dodr() { maxplayers=$(sed -nr 's/^iServerMaxPlayers=(.*)$/\1/p' "${servercfgfullpath}") # Not set - maxplayers=${maxplayers:-"NOT SET"} + maxplayers=${maxplayers:-"0"} fi # Parameters @@ -907,7 +910,7 @@ fn_info_game_mc() { servername=${servername:-"NOT SET"} rconpassword=${rconpassword:-"NOT SET"} rconport=${rconport:-"NOT SET"} - maxplayers=${maxplayers:-"NOT SET"} + maxplayers=${maxplayers:-"0"} port=${port:-"NOT SET"} queryport=${queryport:-"NOT SET"} queryenabled="${queryenabled:-"NOT SET"}" @@ -938,7 +941,7 @@ fn_info_game_mcb() { # Not set servername=${servername:-"NOT SET"} - maxplayers=${maxplayers:-"NOT SET"} + maxplayers=${maxplayers:-"0"} port=${port:-"NOT SET"} portipv6=${portipv6:-"NOT SET"} queryport=${queryport:-"NOT SET"} @@ -1004,7 +1007,7 @@ fn_info_game_mom() { if [ ! -f "${servercfgfullpath}" ]; then servername="${unavailable}" serverpassword="${unavailable}" - maxplayer="${zero}" + maxplayers="${zero}" defaultmap="${unavailable}" else servername=$(grep "ServerName" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^--/d' -e 's/ServerName//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') @@ -1015,7 +1018,7 @@ fn_info_game_mom() { # Not set servername=${servername:-"NOT SET"} serverpassword=${serverpassword:-"NOT SET"} - maxplayer=${maxplayers:-"NOT SET"} + maxplayers=${maxplayers:-"0"} defaultmap=${defaultmap:-"NOT SET"} fi @@ -1079,6 +1082,26 @@ fn_info_game_mumble() { fi } +fn_info_game_nec() { + # Config + if [ ! -f "${servercfgfullpath}" ]; then + maxplayers=${maxplayers:-"0"} + port=${port:-"0"} + servername="Necesse" + serverpassword="${unavailable}" + else + maxplayers=$(grep "slots" "${servercfgfullpath}" | cut -f1 -d "/" | tr -cd '[:digit:]') + port=$(grep "port" "${servercfgfullpath}" | cut -f1 -d "/" | tr -cd '[:digit:]') + serverpassword=$(grep "password" "${servercfgfullpath}" | cut -f1 -d "/" | tr -cd '[:digit:]') + + # Not set + maxplayers=${maxplayers:-"0"} + port=${port:-"0"} + servername="Necesse Port ${port}" + serverpassword=${serverpassword:-"NOT SET"} + fi +} + fn_info_game_onset() { # Config if [ ! -f "${servercfgfullpath}" ]; then @@ -1096,7 +1119,7 @@ fn_info_game_onset() { # Not set servername=${servername:-"NOT SET"} - maxplayers=${maxplayers:-"NOT SET"} + maxplayers=${maxplayers:-"0"} port=${port:-"NOT SET"} httpport=${httpport:-"NOT SET"} queryport=${queryport:-"NOT SET"} @@ -1123,7 +1146,7 @@ fn_info_game_pc() { # Not set servername=${servername:-"NOT SET"} serverpassword=${serverpassword:-"NOT SET"} - maxplayers=${maxplayers:-"NOT SET"} + maxplayers=${maxplayers:-"0"} port=${port:-"NOT SET"} queryport=${queryport:-"NOT SET"} steamport=${steamport:-"NOT SET"} @@ -1150,7 +1173,7 @@ fn_info_game_pc2() { # Not set servername=${servername:-"NOT SET"} serverpassword=${serverpassword:-"NOT SET"} - maxplayers=${maxplayers:-"NOT SET"} + maxplayers=${maxplayers:-"0"} port=${port:-"NOT SET"} queryport=${queryport:-"NOT SET"} steamport=${steamport:-"NOT SET"} @@ -1491,7 +1514,7 @@ fn_info_game_rw() { serverpassword=${serverpassword:-"NOT SET"} rconpassword=${rconpassword:-"NOT SET"} rconport=${rconport:-"NOT SET"} - maxplayers=${maxplayers:-"NOT SET"} + maxplayers=${maxplayers:-"0"} port=${port:-"0"} port2=${port2:-"0"} port3=${port3:-"0"} @@ -1588,18 +1611,18 @@ fn_info_game_sbots() { fn_info_game_scpsl() { # Config - if [ -f "${servercfgfullpath}" ]; then - servername=$(sed -nr 's/^server_name: (.*)$/\1/p' "${servercfgfullpath}") - maxplayers=$(sed -nr 's/^max_players: (.*)$/\1/p' "${servercfgfullpath}") - configip=$(sed -nr 's/^ipv4_bind_ip: (.*)$/\1/p' "${servercfgfullpath}") - tickrate=$(sed -nr 's/^server_tickrate: (.*)$/\1/p' "${servercfgfullpath}") - adminpassword=$(sed -nr 's/^administrator_query_password: (.*)$/\1/p' "${servercfgfullpath}") - else + if [ ! -f "${servercfgfullpath}" ]; then servername=${servername:-"NOT SET"} maxplayers=${maxplayers:-"0"} configip=${configip:-"0.0.0.0"} tickrate=${tickrate:-"NOT SET"} adminpassword=${adminpassword:-"NOT SET"} + else + servername=$(sed -nr 's/^server_name: (.*)$/\1/p' "${servercfgfullpath}") + maxplayers=$(sed -nr 's/^max_players: (.*)$/\1/p' "${servercfgfullpath}") + configip=$(sed -nr 's/^ipv4_bind_ip: (.*)$/\1/p' "${servercfgfullpath}") + tickrate=$(sed -nr 's/^server_tickrate: (.*)$/\1/p' "${servercfgfullpath}") + adminpassword=$(sed -nr 's/^administrator_query_password: (.*)$/\1/p' "${servercfgfullpath}") fi # Parameters @@ -1657,7 +1680,7 @@ fn_info_game_sdtd() { telnetenabled=${telnetenabled:-"NOT SET"} telnetport=${telnetport:-"0"} telnetpass=${telnetpass:-"NOT SET"} - maxplayers=${maxplayers:-"NOT SET"} + maxplayers=${maxplayers:-"0"} gamemode=${gamemode:-"NOT SET"} gameworld=${gameworld:-"NOT SET"} fi @@ -1858,7 +1881,13 @@ fn_info_game_terraria() { fn_info_game_stn() { # Config - if [ -f "${servercfgfullpath}" ]; then + if [ ! -f "${servercfgfullpath}" ]; then + servername="${unavailable}" + configip=${configip:-"0.0.0.0"} + port="${zero}" + queryport="${zero}" + serverpassword=${serverpassword:-"NOT SET"} + else servername=$(sed -nr 's/^ServerName="(.*)"/\1/p' "${servercfgfullpath}") configip=$(sed -nr 's/^ServerIP=([0-9]+)/\1/p' "${servercfgfullpath}") port=$(sed -nr 's/^ServerPort=([0-9]+)/\1/p' "${servercfgfullpath}") @@ -1867,23 +1896,25 @@ fn_info_game_stn() { # Not set serverpassword=${serverpassword:-"NOT SET"} - else - servername="${unavailable}" - configip=${configip:-"0.0.0.0"} - port="${zero}" - queryport="${zero}" + port=${port:-"0"} serverpassword=${serverpassword:-"NOT SET"} + queryport=${queryport:-"0"} fi } fn_info_game_ti() { - if [ -f "${servercfgfullpath}" ]; then - servername=$(sed -nr 's/^ServerName="(.*)"/\1/p' "${servercfgfullpath}") - maxplayers=$(sed -nr 's/^MaxPlayerCount=([0-9]+)/\1/' "${servercfgfullpath}") - else + if [ ! -f "${servercfgfullpath}" ]; then servername="${unavailable}" maxplayers="${zero}" + else + servername=$(sed -nr 's/^ServerName="(.*)"/\1/p' "${servercfgfullpath}") + maxplayers=$(sed -nr 's/^MaxPlayerCount=([0-9]+)/\1/' "${servercfgfullpath}") + + # Not set + servername=${servername:-"NOT SET"} + maxplayers=${maxplayers:-"0"} fi + } fn_info_game_ts3() { @@ -2145,7 +2176,7 @@ fn_info_game_ut3() { servername=${servername:-"NOT SET"} serverpassword=${serverpassword:-"NOT SET"} adminpassword=${adminpassword:-"NOT SET"} - maxplayers=${maxplayers:-"NOT SET"} + maxplayers=${maxplayers:-"0"} webadminenabled=${webadminenabled:-"NOT SET"} webadminport=${webadminport:-"0"} webadminuser=${webadminuser:-"NOT SET"} @@ -2396,6 +2427,8 @@ elif [ "${shortname}" == "mta" ]; then fn_info_game_mta elif [ "${shortname}" == "mumble" ]; then fn_info_game_mumble +elif [ "${shortname}" == "nec" ]; then + fn_info_game_nec elif [ "${shortname}" == "onset" ]; then fn_info_game_onset elif [ "${shortname}" == "pc" ]; then diff --git a/lgsm/functions/info_messages.sh b/lgsm/functions/info_messages.sh index a216327c9..f4f67b120 100755 --- a/lgsm/functions/info_messages.sh +++ b/lgsm/functions/info_messages.sh @@ -658,7 +658,7 @@ fn_info_message_ports_edit() { startparameterslocation="${red}UNKNOWN${default}" # engines/games that require editing in the config file. - local ports_edit_array=("ac" "arma3" "armar" "bo" "bt" "cd" "dst" "eco" "idtech2" "idtech3" "idtech3_ql" "jc2" "jc3" "lwjgl2" "mcb" "mumble" "pc" "pc2" "pz" "qw" "refractor" "renderware" "rw" "sb" "sdtd" "st" "stn" "ts3" "tw" "terraria" "unreal" "unreal2" "unreal3" "vints" "wurm") + local ports_edit_array=("ac" "arma3" "armar" "bo" "bt" "cd" "dst" "eco" "idtech2" "idtech3" "idtech3_ql" "jc2" "jc3" "lwjgl2" "mcb" "mumble" "nec" "pc" "pc2" "pz" "qw" "refractor" "renderware" "rw" "sb" "sdtd" "st" "stn" "ts3" "tw" "terraria" "unreal" "unreal2" "unreal3" "vints" "wurm") for port_edit in "${ports_edit_array[@]}"; do if [ "${shortname}" == "ut3" ]; then startparameterslocation="${servercfgdir}/UTWeb.ini" @@ -687,7 +687,7 @@ fn_info_message_ports() { echo -e "ss -tuplwn | grep AvorionServer" elif [ "${shortname}" == "bf1942" ]; then echo -e "ss -tuplwn | grep bf1942_lnxded" - elif [ "${shortname}" == "mc" ] || [ "${shortname}" == "pmc" ] || [ "${shortname}" == "rw" ] || [ "${shortname}" == "vpmc" ] || [ "${shortname}" == "wmc" ]; then + elif [ "${shortname}" == "mc" ] || [ "${shortname}" == "nec" ] || [ "${shortname}" == "pmc" ] || [ "${shortname}" == "rw" ] || [ "${shortname}" == "vpmc" ] || [ "${shortname}" == "wmc" ]; then echo -e "ss -tuplwn | grep java" elif [ "${shortname}" == "terraria" ]; then echo -e "ss -tuplwn | grep Main" @@ -1171,6 +1171,13 @@ fn_info_message_mumble() { } | column -s $'\t' -t } +fn_info_message_nec() { + { + fn_port "header" + fn_port "Game" port udp + } | column -s $'\t' -t +} + fn_info_message_onset() { { fn_port "header" @@ -1727,12 +1734,14 @@ fn_info_message_select_engine() { fn_info_message_mh elif [ "${shortname}" == "mohaa" ]; then fn_info_message_mohaa + elif [ "${shortname}" == "mom" ]; then + fn_info_message_mom elif [ "${shortname}" == "mta" ]; then fn_info_message_mta elif [ "${shortname}" == "mumble" ]; then fn_info_message_mumble - elif [ "${shortname}" == "mom" ]; then - fn_info_message_mom + elif [ "${shortname}" == "nec" ]; then + fn_info_message_nec elif [ "${shortname}" == "onset" ]; then fn_info_message_onset elif [ "${shortname}" == "pc" ]; then diff --git a/lgsm/functions/install_config.sh b/lgsm/functions/install_config.sh index 8feb8655e..d5525c266 100755 --- a/lgsm/functions/install_config.sh +++ b/lgsm/functions/install_config.sh @@ -634,6 +634,14 @@ elif [ "${shortname}" == "pz" ]; then fn_default_config_remote fn_set_config_vars fn_list_config_locations +elif [ "${shortname}" == "nec" ]; then + gamedirname="Necesse" + fn_check_cfgdir + array_configs+=(server.cfg) + fn_fetch_default_config + fn_default_config_remote + fn_set_config_vars + fn_list_config_locations elif [ "${shortname}" == "pc" ]; then gamedirname="ProjectCars" array_configs+=(server.cfg) diff --git a/lgsm/functions/install_server_files.sh b/lgsm/functions/install_server_files.sh index c9faf643a..61c6b131c 100755 --- a/lgsm/functions/install_server_files.sh +++ b/lgsm/functions/install_server_files.sh @@ -222,7 +222,7 @@ elif [ "${shortname}" == "mcb" ]; then elif [ "${shortname}" == "pmc" ]; then install_eula.sh update_papermc.sh -elif [ "${shortname}" == "wmc" ]||[ "${shortname}" == "vpmc" ]; then +elif [ "${shortname}" == "wmc" ] || [ "${shortname}" == "vpmc" ]; then update_papermc.sh elif [ "${shortname}" == "mumble" ]; then update_mumble.sh diff --git a/linuxgsm.sh b/linuxgsm.sh index 7d9f21d0b..3849ae68b 100755 --- a/linuxgsm.sh +++ b/linuxgsm.sh @@ -15,7 +15,7 @@ # Debugging if [ -f ".dev-debug" ]; then - exec 5>dev-debug.log + exec 5> dev-debug.log BASH_XTRACEFD="5" set -x fi @@ -52,7 +52,7 @@ userinput2="${2}" [ -n "${LGSM_GITHUBBRANCH}" ] && githubbranch="${LGSM_GITHUBBRANCH}" || githubbranch="master" # Check that curl is installed before doing anything -if [ ! "$(command -v curl 2>/dev/null)" ]; then +if [ ! "$(command -v curl 2> /dev/null)" ]; then echo -e "[ FAIL ] Curl is not installed" exit 1 fi @@ -213,7 +213,7 @@ fn_install_menu_bash() { while read -r line || [[ -n "${line}" ]]; do var=$(echo -e "${line}" | awk -F "," '{print $2 " - " $3}') menu_options+=("${var}") - done <"${options}" + done < "${options}" menu_options+=("Cancel") select option in "${menu_options[@]}"; do if [ "${option}" ] && [ "${option}" != "Cancel" ]; then @@ -239,7 +239,7 @@ fn_install_menu_whiptail() { key=$(echo -e "${line}" | awk -F "," '{print $3}') val=$(echo -e "${line}" | awk -F "," '{print $2}') menu_options+=("${val//\"/}" "${key//\"/}") - done <"${options}" + done < "${options}" OPTION=$(${menucmd} --title "${title}" --menu "${caption}" "${height}" "${width}" "${menuheight}" "${menu_options[@]}" 3>&1 1>&2 2>&3) if [ $? == 0 ]; then eval "$resultvar=\"${OPTION}\"" @@ -263,12 +263,12 @@ fn_install_menu() { fi done case "$(basename "${menucmd}")" in - whiptail | dialog) - fn_install_menu_whiptail "${menucmd}" selection "${title}" "${caption}" "${options}" 40 80 30 - ;; - *) - fn_install_menu_bash selection "${title}" "${caption}" "${options}" - ;; + whiptail | dialog) + fn_install_menu_whiptail "${menucmd}" selection "${title}" "${caption}" "${options}" 40 80 30 + ;; + *) + fn_install_menu_bash selection "${title}" "${caption}" "${options}" + ;; esac eval "$resultvar=\"${selection}\"" } @@ -351,7 +351,7 @@ if [ "${shortname}" == "core" ]; then } | column -s $'\t' -t | more exit elif [ "${userinput}" == "install" ] || [ "${userinput}" == "i" ]; then - tail -n +1 "${serverlist}" | awk -F "," '{print $1 "," $2 "," $3}' >"${serverlistmenu}" + tail -n +1 "${serverlist}" | awk -F "," '{print $1 "," $2 "," $3}' > "${serverlistmenu}" fn_install_menu result "LinuxGSM" "Select game server to install." "${serverlistmenu}" userinput="${result}" fn_server_info From 94d1e99772ec5c25b3b2363d5e80d0626dc7fec0 Mon Sep 17 00:00:00 2001 From: Christian Date: Sun, 30 Oct 2022 23:27:15 +0100 Subject: [PATCH 084/161] feat(mods): add BepInEx mod for Valheim (#3960) --- lgsm/functions/fix_vh.sh | 16 +++++++++++++++- lgsm/functions/mods_list.sh | 7 ++++++- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/lgsm/functions/fix_vh.sh b/lgsm/functions/fix_vh.sh index ab0218873..a90c5d0b0 100755 --- a/lgsm/functions/fix_vh.sh +++ b/lgsm/functions/fix_vh.sh @@ -8,14 +8,28 @@ functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" export LD_LIBRARY_PATH=./linux64:$LD_LIBRARY_PATH -# special check if Valheim Plus is installed modsdir="${lgsmdir}/mods" modsinstalledlistfullpath="${modsdir}/installed-mods.txt" if [ -f "${modsinstalledlistfullpath}" ]; then + # special check if Valheim Plus is installed if grep -qE "^valheimplus" "${modsinstalledlistfullpath}"; then if ! grep -qE "^executable=\"./start_server_bepinex.sh\"" "${configdirserver}/${selfname}.cfg"; then echo 'executable="./start_server_bepinex.sh"' >> "${configdirserver}/${selfname}.cfg" executable="./start_server_bepinex.sh" fi fi + # special exports for BepInEx if installed + if grep -qE "^bepinexvh" "${modsinstalledlistfullpath}"; then + fn_print_info_nl "BepInEx install detected, applying start exports" + fn_script_log_info "BepInEx install detected, applying start exports" + # exports for BepInEx framework from script start_server_bepinex.sh + export DOORSTOP_ENABLE=TRUE + export DOORSTOP_INVOKE_DLL_PATH=./BepInEx/core/BepInEx.Preloader.dll + export DOORSTOP_CORLIB_OVERRIDE_PATH=./unstripped_corlib + + export LD_LIBRARY_PATH="./doorstop_libs:${LD_LIBRARY_PATH}" + export LD_PRELOAD="libdoorstop_x64.so:${LD_PRELOAD}" + + export SteamAppId=892970 + fi fi diff --git a/lgsm/functions/mods_list.sh b/lgsm/functions/mods_list.sh index 151a98cbe..06b534b9e 100755 --- a/lgsm/functions/mods_list.sh +++ b/lgsm/functions/mods_list.sh @@ -95,6 +95,8 @@ oxidehurtworldlatestlink=$(curl --connect-timeout 10 -sL https://api.github.com/ oxidesdtdlatestlink=$(curl --connect-timeout 10 -sL https://api.github.com/repos/OxideMod/Oxide.SevenDaysToDie/releases/latest | jq -r '.assets[]|select(.browser_download_url | contains("linux")) | .browser_download_url') # Valheim Plus valeimpluslatestlink=$(curl --connect-timeout 10 -sL https://api.github.com/repos/valheimPlus/ValheimPlus/releases/latest | jq -r '.assets[]|select(.browser_download_url | contains("UnixServer.tar.gz")) | .browser_download_url') +# Valheim BepInEx +bepinexvhlatestlink=$(curl --connect-timeout 10 -sL "https://valheim.thunderstore.io/api/experimental/package/denikson/BepInExPack_Valheim/" -H "accept: application/json" | jq -r '.latest.download_url' ) # Define mods information (required) @@ -194,5 +196,8 @@ mod_info_sdtdoxide=(MOD "sdtdoxide" "Oxide for 7 Days To Die" "${oxidesdtdlatest # ValheimPlus mod_info_valheimplus=(MOD "valheimplus" "Valheim PLUS" "${valeimpluslatestlink}" "ValheimPlus.tar.gz" "0" "LowercaseOff" "${systemdir}" "OVERWRITE" "ENGINES" "Valheim;" "NOTGAMES" "https://github.com/valheimPlus/ValheimPlus" "Mod to improve Valheim gameplay") +# BepInEx Valheim +mod_info_bepinexvh=(MOD "bepinexvh" "BepInEx Valheim" "${bepinexvhlatestlink}" "denikson-BepInExPack_Valheim.zip" "0" "LowercaseOff" "${systemdir}" "OVERWRITE" "ENGINES" "Valheim;" "NOTGAMES" "https://valheim.thunderstore.io/package/denikson/BepInExPack_Valheim/" "Unity / XNA game patcher and plugin framework") + # REQUIRED: Set all mods info into the global array -mods_global_array=("${mod_info_metamod[@]}" "${mod_info_base_amxx[@]}" "${mod_info_cs_amxx[@]}" "${mod_info_dod_amxx[@]}" "${mod_info_tfc_amxx[@]}" "${mod_info_ns_amxx[@]}" "${mod_info_ts_amxx[@]}" "${mod_info_metamodsource[@]}" "${mod_info_sourcemod[@]}" "${mod_info_steamworks[@]}" "${mod_info_gokz[@]}" "${mod_info_ttt[@]}" "${mod_info_get5[@]}" "${mod_info_prac[@]}" "${mod_info_pug[@]}" "${mod_info_dhook[@]}" "${mod_info_movement[@]}" "${mod_info_cleaner[@]}" "${mod_info_ulib[@]}" "${mod_info_ulx[@]}" "${mod_info_utime[@]}" "${mod_info_uclip[@]}" "${mod_info_acf[@]}" "${mod_info_acf_missiles[@]}" "${mod_info_acf_sweps[@]}" "${mod_info_advdupe2[@]}" "${mod_info_pac3[@]}" "${mod_info_wiremod[@]}" "${mod_info_wiremodextras[@]}" "${mod_info_darkrp[@]}" "${mod_info_darkrpmodification[@]}" "${mod_info_rustoxide[@]}" "${mod_info_hwoxide[@]}" "${mod_info_sdtdoxide[@]}" "${mod_info_advduplicator[@]}" "${mod_info_trackassemblytool[@]}" "${mod_info_physpropertiesadv[@]}" "${mod_info_controlsystemse2[@]}" "${mod_info_e2pistontiming[@]}" "${mod_info_propcannontool[@]}" "${mod_info_gearassemblytool[@]}" "${mod_info_spinnertool[@]}" "${mod_info_surfacefrictiontool[@]}" "${mod_info_magneticdipole[@]}" "${mod_info_environmentorganizer[@]}" "${mod_info_precision_alignment[@]}" "${mod_info_improved_stacker[@]}" "${mod_info_improved_weight[@]}" "${mod_info_improved_antinoclip[@]}" "${mod_info_laserstool[@]}" "${mod_info_valheimplus[@]}") +mods_global_array=("${mod_info_metamod[@]}" "${mod_info_base_amxx[@]}" "${mod_info_cs_amxx[@]}" "${mod_info_dod_amxx[@]}" "${mod_info_tfc_amxx[@]}" "${mod_info_ns_amxx[@]}" "${mod_info_ts_amxx[@]}" "${mod_info_metamodsource[@]}" "${mod_info_sourcemod[@]}" "${mod_info_steamworks[@]}" "${mod_info_gokz[@]}" "${mod_info_ttt[@]}" "${mod_info_get5[@]}" "${mod_info_prac[@]}" "${mod_info_pug[@]}" "${mod_info_dhook[@]}" "${mod_info_movement[@]}" "${mod_info_cleaner[@]}" "${mod_info_ulib[@]}" "${mod_info_ulx[@]}" "${mod_info_utime[@]}" "${mod_info_uclip[@]}" "${mod_info_acf[@]}" "${mod_info_acf_missiles[@]}" "${mod_info_acf_sweps[@]}" "${mod_info_advdupe2[@]}" "${mod_info_pac3[@]}" "${mod_info_wiremod[@]}" "${mod_info_wiremodextras[@]}" "${mod_info_darkrp[@]}" "${mod_info_darkrpmodification[@]}" "${mod_info_rustoxide[@]}" "${mod_info_hwoxide[@]}" "${mod_info_sdtdoxide[@]}" "${mod_info_advduplicator[@]}" "${mod_info_trackassemblytool[@]}" "${mod_info_physpropertiesadv[@]}" "${mod_info_controlsystemse2[@]}" "${mod_info_e2pistontiming[@]}" "${mod_info_propcannontool[@]}" "${mod_info_gearassemblytool[@]}" "${mod_info_spinnertool[@]}" "${mod_info_surfacefrictiontool[@]}" "${mod_info_magneticdipole[@]}" "${mod_info_environmentorganizer[@]}" "${mod_info_precision_alignment[@]}" "${mod_info_improved_stacker[@]}" "${mod_info_improved_weight[@]}" "${mod_info_improved_antinoclip[@]}" "${mod_info_laserstool[@]}" "${mod_info_valheimplus[@]}" "${mod_info_bepinexvh[@]}") From fa5f37b3271cf10a65331f0585752b2047599f6b Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sun, 30 Oct 2022 22:33:15 +0000 Subject: [PATCH 085/161] missing bin/bash --- .github/workflows/version-check.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/version-check.sh b/.github/workflows/version-check.sh index f470fd02b..4e7280509 100644 --- a/.github/workflows/version-check.sh +++ b/.github/workflows/version-check.sh @@ -1,3 +1,4 @@ +#!/bin/bash version=$(grep "version=" linuxgsm.sh | sed -e 's/version//g' | tr -d '="') modulesversion=$(grep "modulesversion=" lgsm/functions/core_functions.sh | sed -e 's/modulesversion//g' | tr -d '="') From 0487d7f3dfb4016e7d9162422f92e364a1394987 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sun, 30 Oct 2022 22:41:24 +0000 Subject: [PATCH 086/161] codacy --- lgsm/functions/command_dev_query_raw.sh | 60 ++++++++++++------------- lgsm/functions/command_fastdl.sh | 18 ++++---- 2 files changed, 39 insertions(+), 39 deletions(-) diff --git a/lgsm/functions/command_dev_query_raw.sh b/lgsm/functions/command_dev_query_raw.sh index 91db16584..d626dc204 100755 --- a/lgsm/functions/command_dev_query_raw.sh +++ b/lgsm/functions/command_dev_query_raw.sh @@ -28,169 +28,169 @@ echo -e "==================================================================" { echo -e "${lightblue}Port Name \tPort Number \tStatus \tTCP \tUDP${default}" if [ -v port ]; then - echo -e "Game: \t${port} \t$(ss -tupl | grep ${port} | wc -l) \t$(ss -tupl | grep ${port} | grep tcp | awk '{ print $2 }') \t$(ss -tupl | grep ${port} | grep udp | awk '{ print $2 }')" + echo -e "Game: \t${port} \t$(ss -tupl | grep -c ${port}) \t$(ss -tupl | grep ${port} | grep tcp | awk '{ print $2 }') \t$(ss -tupl | grep ${port} | grep udp | awk '{ print $2 }')" else echo -e "Game:" fi if [ "${shortname}" == "rw" ]; then if [ -v port2 ]; then - echo -e "Game+1: \t${port2} \t$(ss -tupl | grep ${port} | wc -l) \t$(ss -tupl | grep ${port2} | grep tcp | awk '{ print $2 }') \t$(ss -tupl | grep ${port2} | grep udp | awk '{ print $2 }')" + 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 ${port} | wc -l) \t$(ss -tupl | grep ${port3} | grep tcp | awk '{ print $2 }') \t$(ss -tupl | grep ${port3} | grep udp | awk '{ print $2 }')" + 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 ${port} | wc -l) \t$(ss -tupl | grep ${port4} | grep tcp | awk '{ print $2 }') \t$(ss -tupl | grep ${port4} | grep udp | awk '{ print $2 }')" + 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 [ -v port401 ]; then - echo -e "Game+400: \t${port401} \t$(ss -tupl | grep ${port401} | wc -l) \t$(ss -tupl | grep ${port401} | grep tcp | awk '{ print $2 }') \t$(ss -tupl | grep ${port401} | grep udp | awk '{ print $2 }')" + 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 }')" else echo -e "Game+400:" fi if [ -v portipv6 ]; then - echo -e "Game ipv6: \t${portipv6} \t$(ss -tupl | grep ${portipv6} | wc -l) \t$(ss -tupl | grep ${portipv6} | grep tcp | awk '{ print $2 }') \t$(ss -tupl | grep ${portipv6} | grep udp | awk '{ print $2 }')" + echo -e "Game ipv6: \t${portipv6} \t$(ss -tupl | grep -c ${portipv6}) \t$(ss -tupl | grep ${portipv6} | grep tcp | awk '{ print $2 }') \t$(ss -tupl | grep ${portipv6} | grep udp | awk '{ print $2 }')" else echo -e "Game ipv6:" fi if [ -v queryport ]; then - echo -e "Query: \t${queryport} \t$(ss -tupl | grep ${queryport} | wc -l) \t$(ss -tupl | grep ${queryport} | grep tcp | awk '{ print $2 }') \t$(ss -tupl | grep ${queryport} | grep udp | awk '{ print $2 }')" + echo -e "Query: \t${queryport} \t$(ss -tupl | grep -c ${queryport}) \t$(ss -tupl | grep ${queryport} | grep tcp | awk '{ print $2 }') \t$(ss -tupl | grep ${queryport} | grep udp | awk '{ print $2 }')" else echo -e "Query:" fi if [ -v httpport ]; then - echo -e "HTTP: \t${httpport} \t$(ss -tupl | grep ${httpport} | wc -l) \t$(ss -tupl | grep ${httpport} | grep tcp | awk '{ print $2 }') \t$(ss -tupl | grep ${httpport} | grep udp | awk '{ print $2 }')" + echo -e "HTTP: \t${httpport} \t$(ss -tupl | grep -c ${httpport}) \t$(ss -tupl | grep ${httpport} | grep tcp | awk '{ print $2 }') \t$(ss -tupl | grep ${httpport} | grep udp | awk '{ print $2 }')" else echo -e "HTTP:" fi if [ -v httpqueryport ]; then - echo -e "HTTP Query: \t${httpqueryport} \t$(ss -tupl | grep ${httpqueryport} | wc -l) \t$(ss -tupl | grep ${httpqueryport} | grep tcp | awk '{ print $2 }') \t$(ss -tupl | grep ${httpqueryport} | grep udp | awk '{ print $2 }')" + echo -e "HTTP Query: \t${httpqueryport} \t$(ss -tupl | grep -c ${httpqueryport}) \t$(ss -tupl | grep ${httpqueryport} | grep tcp | awk '{ print $2 }') \t$(ss -tupl | grep ${httpqueryport} | grep udp | awk '{ print $2 }')" else echo -e "HTTP Query:" fi if [ -v webadminport ]; then - echo -e "Web Admin: \t${webadminport} \t$(ss -tupl | grep ${webadminport} | wc -l) \t$(ss -tupl | grep ${webadminport} | grep tcp | awk '{ print $2 }') \t$(ss -tupl | grep ${webadminport} | grep udp | awk '{ print $2 }')" + echo -e "Web Admin: \t${webadminport} \t$(ss -tupl | grep -c ${webadminport}) \t$(ss -tupl | grep ${webadminport} | grep tcp | awk '{ print $2 }') \t$(ss -tupl | grep ${webadminport} | grep udp | awk '{ print $2 }')" else echo -e "Web Admin:" fi if [ -v clientport ]; then - echo -e "Client: \t${clientport} \t$(ss -tupl | grep ${clientport} | wc -l) \t$(ss -tupl | grep ${clientport} | grep tcp | awk '{ print $2 }') \t$(ss -tupl | grep ${clientport} | grep udp | awk '{ print $2 }')" + echo -e "Client: \t${clientport} \t$(ss -tupl | grep -c ${clientport}) \t$(ss -tupl | grep ${clientport} | grep tcp | awk '{ print $2 }') \t$(ss -tupl | grep ${clientport} | grep udp | awk '{ print $2 }')" else echo -e "Client:" fi if [ -v rconport ]; then - echo -e "RCON: \t${rconport} \t$(ss -tupl | grep ${rconport} | wc -l) \t$(ss -tupl | grep ${rconport} | grep tcp | awk '{ print $2 }') \t$(ss -tupl | grep ${rconport} | grep udp | awk '{ print $2 }')" + echo -e "RCON: \t${rconport} \t$(ss -tupl | grep -c ${rconport}) \t$(ss -tupl | grep ${rconport} | grep tcp | awk '{ print $2 }') \t$(ss -tupl | grep ${rconport} | grep udp | awk '{ print $2 }')" else echo -e "RCON:" fi if [ -v rawport ]; then - echo -e "RAW UDP Socket: \t${rawport} \t$(ss -tupl | grep ${rawport} | wc -l) \t$(ss -tupl | grep ${rawport} | grep tcp | awk '{ print $2 }') \t$(ss -tupl | grep ${rawport} | grep udp | awk '{ print $2 }')" + echo -e "RAW UDP Socket: \t${rawport} \t$(ss -tupl | grep -c ${rawport}) \t$(ss -tupl | grep ${rawport} | grep tcp | awk '{ print $2 }') \t$(ss -tupl | grep ${rawport} | grep udp | awk '{ print $2 }')" else echo -e "RAW UDP Socket:" fi if [ -v masterport ]; then - echo -e "Game: Master: \t${masterport} \t$(ss -tupl | grep ${masterport} | wc -l) \t$(ss -tupl | grep ${masterport} | grep tcp | awk '{ print $2 }') \t$(ss -tupl | grep ${masterport} | grep udp | awk '{ print $2 }')" + echo -e "Game: Master: \t${masterport} \t$(ss -tupl | grep -c ${masterport}) \t$(ss -tupl | grep ${masterport} | grep tcp | awk '{ print $2 }') \t$(ss -tupl | grep ${masterport} | grep udp | awk '{ print $2 }')" else echo -e "Game: Master:" fi if [ -v steamport ]; then - echo -e "Steam: \t${steamport} \t$(ss -tupl | grep ${steamport} | wc -l) \t$(ss -tupl | grep ${steamport} | grep tcp | awk '{ print $2 }') \t$(ss -tupl | grep ${steamport} | grep udp | awk '{ print $2 }')" + echo -e "Steam: \t${steamport} \t$(ss -tupl | grep -c ${steamport}) \t$(ss -tupl | grep ${steamport} | grep tcp | awk '{ print $2 }') \t$(ss -tupl | grep ${steamport} | grep udp | awk '{ print $2 }')" else echo -e "Steam:" fi if [ -v steamauthport ]; then - echo -e "Steam: Auth: \t${steamauthport} \t$(ss -tupl | grep ${steamauthport} | wc -l) \t$(ss -tupl | grep ${steamauthport} | grep tcp | awk '{ print $2 }') \t$(ss -tupl | grep ${steamauthport} | grep udp | awk '{ print $2 }')" + echo -e "Steam: Auth: \t${steamauthport} \t$(ss -tupl | grep -c ${steamauthport}) \t$(ss -tupl | grep ${steamauthport} | grep tcp | awk '{ print $2 }') \t$(ss -tupl | grep ${steamauthport} | grep udp | awk '{ print $2 }')" else echo -e "Steam: Auth:" fi if [ -v steammasterport ]; then - echo -e "Steam: Master: \t${steammasterport} \t$(ss -tupl | grep ${steammasterport} | wc -l) \t$(ss -tupl | grep ${steammasterport} | grep tcp | awk '{ print $2 }') \t$(ss -tupl | grep ${steammasterport} | grep udp | awk '{ print $2 }')" + echo -e "Steam: Master: \t${steammasterport} \t$(ss -tupl | grep -c ${steammasterport}) \t$(ss -tupl | grep ${steammasterport} | grep tcp | awk '{ print $2 }') \t$(ss -tupl | grep ${steammasterport} | grep udp | awk '{ print $2 }')" else echo -e "Steam: Master:" fi if [ -v steamqueryport ]; then - echo -e "Steam: Query: \t${steamqueryport} \t$(ss -tupl | grep ${steamqueryport} | wc -l) \t$(ss -tupl | grep ${steamqueryport} | grep tcp | awk '{ print $2 }') \t$(ss -tupl | grep ${steamqueryport} | grep udp | awk '{ print $2 }')" + echo -e "Steam: Query: \t${steamqueryport} \t$(ss -tupl | grep -c ${steamqueryport}) \t$(ss -tupl | grep ${steamqueryport} | grep tcp | awk '{ print $2 }') \t$(ss -tupl | grep ${steamqueryport} | grep udp | awk '{ print $2 }')" else echo -e "Steam: Query:" fi if [ -v beaconport ]; then - echo -e "Beacon: \t${beaconport} \t$(ss -tupl | grep ${beaconport} | wc -l) \t$(ss -tupl | grep ${beaconport} | grep tcp | awk '{ print $2 }') \t$(ss -tupl | grep ${beaconport} | grep udp | awk '{ print $2 }')" + echo -e "Beacon: \t${beaconport} \t$(ss -tupl | grep -c ${beaconport}) \t$(ss -tupl | grep ${beaconport} | grep tcp | awk '{ print $2 }') \t$(ss -tupl | grep ${beaconport} | grep udp | awk '{ print $2 }')" else echo -e "Beacon:" fi if [ -v appport ]; then - echo -e "App: \t${appport} \t$(ss -tupl | grep ${appport} | wc -l) \t$(ss -tupl | grep ${appport} | grep tcp | awk '{ print $2 }') \t$(ss -tupl | grep ${appport} | grep udp | awk '{ print $2 }')" + echo -e "App: \t${appport} \t$(ss -tupl | grep -c ${appport}) \t$(ss -tupl | grep ${appport} | grep tcp | awk '{ print $2 }') \t$(ss -tupl | grep ${appport} | grep udp | awk '{ print $2 }')" else echo -e "App:" fi if [ -v telnetport ]; then - echo -e "Telnet: \t${telnetport} \t$(ss -tupl | grep ${telnetport} | wc -l) \t$(ss -tupl | grep ${telnetport} | grep tcp | awk '{ print $2 }') \t$(ss -tupl | grep ${telnetport} | grep udp | awk '{ print $2 }')" + echo -e "Telnet: \t${telnetport} \t$(ss -tupl | grep -c ${telnetport}) \t$(ss -tupl | grep ${telnetport} | grep tcp | awk '{ print $2 }') \t$(ss -tupl | grep ${telnetport} | grep udp | awk '{ print $2 }')" else echo -e "Telnet:" fi if [ -v sourcetvport ]; then - echo -e "SourceTV: \t${sourcetvport} \t$(ss -tupl | grep ${sourcetvport} | wc -l) \t$(ss -tupl | grep ${sourcetvport} | grep tcp | awk '{ print $2 }') \t$(ss -tupl | grep ${sourcetvport} | grep udp | awk '{ print $2 }')" + echo -e "SourceTV: \t${sourcetvport} \t$(ss -tupl | grep -c ${sourcetvport}) \t$(ss -tupl | grep ${sourcetvport} | grep tcp | awk '{ print $2 }') \t$(ss -tupl | grep ${sourcetvport} | grep udp | awk '{ print $2 }')" else echo -e "SourceTV:" fi if [ -v fileport ]; then - echo -e "File: \t${fileport} \t$(ss -tupl | grep ${fileport} | wc -l) \t$(ss -tupl | grep ${fileport} | grep tcp | awk '{ print $2 }') \t$(ss -tupl | grep ${fileport} | grep udp | awk '{ print $2 }')" + echo -e "File: \t${fileport} \t$(ss -tupl | grep -c ${fileport}) \t$(ss -tupl | grep ${fileport} | grep tcp | awk '{ print $2 }') \t$(ss -tupl | grep ${fileport} | grep udp | awk '{ print $2 }')" else echo -e "File:" fi if [ -v udplinkport ]; then - echo -e "UDP Link: \t${udplinkport} \t$(ss -tupl | grep ${udplinkport} | wc -l) \t$(ss -tupl | grep ${udplinkport} | grep tcp | awk '{ print $2 }') \t$(ss -tupl | grep ${udplinkport} | grep udp | awk '{ print $2 }')" + echo -e "UDP Link: \t${udplinkport} \t$(ss -tupl | grep -c ${udplinkport}) \t$(ss -tupl | grep ${udplinkport} | grep tcp | awk '{ print $2 }') \t$(ss -tupl | grep ${udplinkport} | grep udp | awk '{ print $2 }')" else echo -e "UDP Link:" fi if [ -v voiceport ]; then - echo -e "Voice: \t${voiceport} \t$(ss -tupl | grep ${voiceport} | wc -l) \t$(ss -tupl | grep ${voiceport} | grep tcp | awk '{ print $2 }') \t$(ss -tupl | grep ${voiceport} | grep udp | awk '{ print $2 }')" + echo -e "Voice: \t${voiceport} \t$(ss -tupl | grep -c ${voiceport}) \t$(ss -tupl | grep ${voiceport} | grep tcp | awk '{ print $2 }') \t$(ss -tupl | grep ${voiceport} | grep udp | awk '{ print $2 }')" else echo -e "Voice:" fi if [ -v voiceunusedport ]; then - echo -e "Voice (Unused): \t${voiceunusedport} \t$(ss -tupl | grep ${voiceunusedport} | wc -l) \t$(ss -tupl | grep ${voiceunusedport} | grep tcp | awk '{ print $2 }') \t$(ss -tupl | grep ${voiceunusedport} | grep udp | awk '{ print $2 }')" + echo -e "Voice (Unused): \t${voiceunusedport} \t$(ss -tupl | grep -c ${voiceunusedport}) \t$(ss -tupl | grep ${voiceunusedport} | grep tcp | awk '{ print $2 }') \t$(ss -tupl | grep ${voiceunusedport} | grep udp | awk '{ print $2 }')" else echo -e "Voice (Unused):" fi if [ -v battleeyeport ]; then - echo -e "BattleEye: \t${battleeyeport} \t$(ss -tupl | grep ${battleeyeport} | wc -l) \t$(ss -tupl | grep ${battleeyeport} | grep tcp | awk '{ print $2 }') \t$(ss -tupl | grep ${battleeyeport} | grep udp | awk '{ print $2 }')" + echo -e "BattleEye: \t${battleeyeport} \t$(ss -tupl | grep -c ${battleeyeport}) \t$(ss -tupl | grep ${battleeyeport} | grep tcp | awk '{ print $2 }') \t$(ss -tupl | grep ${battleeyeport} | grep udp | awk '{ print $2 }')" else echo -e "BattleEye:" fi if [ -v statsport ]; then - echo -e "Stats: \t${battleeyeport} \t$(ss -tupl | grep ${statsport} | wc -l) \t$(ss -tupl | grep ${statsport} | grep tcp | awk '{ print $2 }') \t$(ss -tupl | grep ${statsport} | grep udp | awk '{ print $2 }')" + echo -e "Stats: \t${battleeyeport} \t$(ss -tupl | grep -c ${statsport}) \t$(ss -tupl | grep ${statsport} | grep tcp | awk '{ print $2 }') \t$(ss -tupl | grep ${statsport} | grep udp | awk '{ print $2 }')" else echo -e "Stats:" fi @@ -210,10 +210,10 @@ echo -e "" echo -e "${lightgreen}Gamedig Raw Output${default}" echo -e "=================================" echo -e "" -if [ ! "$(command -v gamedig 2> /dev/null)" ]; then +if [ ! "$(command -v gamedig 2>/dev/null)" ]; then fn_print_failure_nl "gamedig not installed" fi -if [ ! "$(command -v jq 2> /dev/null)" ]; then +if [ ! "$(command -v jq 2>/dev/null)" ]; then fn_print_failure_nl "jq not installed" fi for queryip in "${queryips[@]}"; do diff --git a/lgsm/functions/command_fastdl.sh b/lgsm/functions/command_fastdl.sh index e90ccc5e0..5a6b3221d 100755 --- a/lgsm/functions/command_fastdl.sh +++ b/lgsm/functions/command_fastdl.sh @@ -24,7 +24,7 @@ luafastdlfile="lgsm_cl_force_fastdl.lua" luafastdlfullpath="${luasvautorundir}/${luafastdlfile}" # Check if bzip2 is installed. -if [ ! "$(command -v bzip2 2> /dev/null)" ]; then +if [ ! "$(command -v bzip2 2>/dev/null)" ]; then fn_print_fail "bzip2 is not installed" fn_script_log_fatal "bzip2 is not installed" core_exit.sh @@ -133,7 +133,7 @@ fn_human_readable_file_size() { local factor="${item%:*}" local abbrev="${item#*:}" if [[ "${bytes}" -ge "${factor}" ]]; then - size=$(bc -l <<< "${bytes} / ${factor}") + size=$(bc -l <<<"${bytes} / ${factor}") printf "%.*f %s\n" "${precision}" "${size}" "${abbrev}" break fi @@ -161,7 +161,7 @@ fn_fastdl_preview() { tput rc tput el echo -e "gathering ${allowed_extention} : ${fileswc}..." - echo -e "${ext}" >> "${tmpdir}/fastdl_files_to_compress.txt" + echo -e "${ext}" >>"${tmpdir}/fastdl_files_to_compress.txt" done < <(find . -type f -iname "${allowed_extention}") if [ ${fileswc} != 0 ]; then fn_print_ok_eol_nl @@ -193,7 +193,7 @@ fn_fastdl_preview() { tput rc tput el echo -e "gathering ${directory} ${allowed_extention} : ${fileswc}..." - echo -e "${ext}" >> "${tmpdir}/fastdl_files_to_compress.txt" + echo -e "${ext}" >>"${tmpdir}/fastdl_files_to_compress.txt" done < <(find "${systemdir}/${directory}" -type f -iname "${allowed_extention}") tput rc tput el @@ -210,7 +210,7 @@ fn_fastdl_preview() { if [ -f "${tmpdir}/fastdl_files_to_compress.txt" ]; then echo -e "calculating total file size..." fn_sleep_time - totalfiles=$(wc -l < "${tmpdir}/fastdl_files_to_compress.txt") + totalfiles=$(wc -l <"${tmpdir}/fastdl_files_to_compress.txt") # Calculates total file size. while read -r dufile; do filesize=$(stat -c %s "${dufile}") @@ -221,7 +221,7 @@ fn_fastdl_preview() { fn_script_log_fatal "Calculating total file size." core_exit.sh fi - done < "${tmpdir}/fastdl_files_to_compress.txt" + done <"${tmpdir}/fastdl_files_to_compress.txt" else fn_print_fail_eol_nl "generating file list" fn_script_log_fatal "Generating file list." @@ -304,12 +304,12 @@ fn_fastdl_gmod() { fi fi if [ -f "${tmpdir}/fastdl_files_to_compress.txt" ]; then - totalfiles=$(wc -l < "${tmpdir}/fastdl_files_to_compress.txt") + totalfiles=$(wc -l <"${tmpdir}/fastdl_files_to_compress.txt") # Calculates total file size. while read -r dufile; do filesize=$(du -b "${dufile}" | awk '{ print $1 }') filesizetotal=$((filesizetotal + filesize)) - done < "${tmpdir}/fastdl_files_to_compress.txt" + done <"${tmpdir}/fastdl_files_to_compress.txt" fi } @@ -396,7 +396,7 @@ fn_fastdl_gmod_dl_enforcer() { touch "${luafastdlfullpath}" # Read all filenames and put them into a lua file at the right path. while read -r line; do - echo -e "resource.AddFile( \"${line}\" )" >> "${luafastdlfullpath}" + echo -e "resource.AddFile( \"${line}\" )" >>"${luafastdlfullpath}" done < <(find "${fastdldir:?}" \( -type f ! -name "*.bz2" \) -printf '%P\n') exitcode=$? if [ "${exitcode}" != 0 ]; then From 29d04fdff01564549b542c8ffd98e7f14c3fa7bf Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sun, 30 Oct 2022 22:42:00 +0000 Subject: [PATCH 087/161] deploy only master --- .github/workflows/trigger_docker_build.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/trigger_docker_build.yml b/.github/workflows/trigger_docker_build.yml index 0f1055c7d..697511816 100644 --- a/.github/workflows/trigger_docker_build.yml +++ b/.github/workflows/trigger_docker_build.yml @@ -3,7 +3,6 @@ on: push: branches: - master - - develop jobs: trigger_build_docker-linuxgsm: name: Trigger Build docker-linuxgsm From 16dcc760630683a517618a5d483dcfadfe15f921 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sun, 30 Oct 2022 22:54:20 +0000 Subject: [PATCH 088/161] codacy --- lgsm/functions/fix_lo.sh | 10 +++++----- lgsm/functions/update_papermc.sh | 6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/lgsm/functions/fix_lo.sh b/lgsm/functions/fix_lo.sh index b868a55b4..eec2ebd36 100644 --- a/lgsm/functions/fix_lo.sh +++ b/lgsm/functions/fix_lo.sh @@ -6,12 +6,12 @@ functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" -local APPID_FILE=${executabledir}/steam_appid.txt -if [ ! -f "${APPID_FILE}" ]; then - fn_print_information "adding ${APPID_FILE} to ${gamename} server." +appidfile=${executabledir}/steam_appid.txt +if [ ! -f "${appidfile}" ]; then + fn_print_information "adding ${appidfile} to ${gamename} server." fn_sleep_time - echo "903950" > "${APPID_FILE}" + echo "903950" > "${appidfile}" else - fn_print_information "${APPID_FILE} already exists. No action to be taken." + fn_print_information "${appidfile} already exists. No action to be taken." fn_sleep_time fi diff --git a/lgsm/functions/update_papermc.sh b/lgsm/functions/update_papermc.sh index 1f334549c..302e0baac 100644 --- a/lgsm/functions/update_papermc.sh +++ b/lgsm/functions/update_papermc.sh @@ -5,9 +5,9 @@ # Website: https://linuxgsm.com # Description: Handles updating of PaperMC and Waterfall servers. -local commandname="UPDATE" -local commandaction="Update" -local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +commandname="UPDATE" +commandaction="Update" +function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_update_papermc_dl() { # get build info From 81b4cf049ced408159a34a7b79de9069de1a98bf Mon Sep 17 00:00:00 2001 From: AlasdairHaig Date: Mon, 7 Nov 2022 11:14:11 +0100 Subject: [PATCH 089/161] Updating new starting parameters Adding new server start parameters, like crossplay, to the default config --- lgsm/config-default/config-lgsm/vhserver/_default.cfg | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lgsm/config-default/config-lgsm/vhserver/_default.cfg b/lgsm/config-default/config-lgsm/vhserver/_default.cfg index 89babe324..72fbc1a29 100644 --- a/lgsm/config-default/config-lgsm/vhserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/vhserver/_default.cfg @@ -16,9 +16,16 @@ port="2456" gameworld="${selfname}" public="1" savedir="$HOME/.config/unity3d/IronGate/Valheim" +logFile="" +saveinterval="1800" +backups="4" +backupshort="7200" +backuplong="43200" +# Clear crossplay to set to false +crossplay="set" ## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters -startparameters="-name '${servername}' -password ${serverpassword} -port ${port} -world ${gameworld} -public ${public} -savedir '${savedir}'" +startparameters="-name '${servername}' -password ${serverpassword} -port ${port} -world ${gameworld} -public ${public} -savedir '${savedir}' -logFile '${logFile}' -saveinterval ${saveinterval} -backups ${backups} -backupshort ${backupshort} -backuplong ${backuplong} ${crossplay:+'-crossplay'}" #### LinuxGSM Settings #### From 10010d7d22e8b2fe8c24c3f016820c991feb915a Mon Sep 17 00:00:00 2001 From: AlasdairHaig Date: Mon, 7 Nov 2022 13:14:56 +0100 Subject: [PATCH 090/161] Update linuxgsm.sh --- linuxgsm.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/linuxgsm.sh b/linuxgsm.sh index 7d9f21d0b..ac3be5663 100755 --- a/linuxgsm.sh +++ b/linuxgsm.sh @@ -43,6 +43,7 @@ configdirserver="${configdir}/${gameservername}" configdirdefault="${lgsmdir}/config-default" userinput="${1}" userinput2="${2}" +LGSM_GITHUBUSER="AlasdairHaig" ## GitHub Branch Select # Allows for the use of different function files From b1be4c912ee5c0f20fa1ad7a5d35db09953acd43 Mon Sep 17 00:00:00 2001 From: Alasdair Haig Date: Mon, 7 Nov 2022 12:37:32 +0000 Subject: [PATCH 091/161] Revert "Update linuxgsm.sh" This reverts commit 10010d7d22e8b2fe8c24c3f016820c991feb915a. --- linuxgsm.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/linuxgsm.sh b/linuxgsm.sh index ac3be5663..7d9f21d0b 100755 --- a/linuxgsm.sh +++ b/linuxgsm.sh @@ -43,7 +43,6 @@ configdirserver="${configdir}/${gameservername}" configdirdefault="${lgsmdir}/config-default" userinput="${1}" userinput2="${2}" -LGSM_GITHUBUSER="AlasdairHaig" ## GitHub Branch Select # Allows for the use of different function files From 592f5ce0e2debdb7f1c0971a8494542ddc216119 Mon Sep 17 00:00:00 2001 From: AlasdairHaig Date: Mon, 7 Nov 2022 14:01:16 +0100 Subject: [PATCH 092/161] Remove single quoations --- lgsm/config-default/config-lgsm/vhserver/_default.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lgsm/config-default/config-lgsm/vhserver/_default.cfg b/lgsm/config-default/config-lgsm/vhserver/_default.cfg index 72fbc1a29..4203e6a49 100644 --- a/lgsm/config-default/config-lgsm/vhserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/vhserver/_default.cfg @@ -25,7 +25,7 @@ backuplong="43200" crossplay="set" ## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters -startparameters="-name '${servername}' -password ${serverpassword} -port ${port} -world ${gameworld} -public ${public} -savedir '${savedir}' -logFile '${logFile}' -saveinterval ${saveinterval} -backups ${backups} -backupshort ${backupshort} -backuplong ${backuplong} ${crossplay:+'-crossplay'}" +startparameters="-name '${servername}' -password ${serverpassword} -port ${port} -world ${gameworld} -public ${public} -savedir '${savedir}' -logFile '${logFile}' -saveinterval ${saveinterval} -backups ${backups} -backupshort ${backupshort} -backuplong ${backuplong} ${crossplay:+-crossplay}" #### LinuxGSM Settings #### From 756cac442f17e824e3301f216a824a54df93a5b7 Mon Sep 17 00:00:00 2001 From: alasdair Date: Fri, 11 Nov 2022 19:47:56 +0100 Subject: [PATCH 093/161] Have fork reference self --- linuxgsm.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/linuxgsm.sh b/linuxgsm.sh index 7d9f21d0b..461b30662 100755 --- a/linuxgsm.sh +++ b/linuxgsm.sh @@ -47,9 +47,9 @@ userinput2="${2}" ## GitHub Branch Select # Allows for the use of different function files # from a different repo and/or branch. -[ -n "${LGSM_GITHUBUSER}" ] && githubuser="${LGSM_GITHUBUSER}" || githubuser="GameServerManagers" -[ -n "${LGSM_GITHUBREPO}" ] && githubrepo="${LGSM_GITHUBREPO}" || githubrepo="LinuxGSM" -[ -n "${LGSM_GITHUBBRANCH}" ] && githubbranch="${LGSM_GITHUBBRANCH}" || githubbranch="master" +githubuser="AlasdairHaig" +githubrepo="LinuxGSM" +githubbranch="master" # Check that curl is installed before doing anything if [ ! "$(command -v curl 2>/dev/null)" ]; then From 34a2a0f0d5f88c4d9041f54ee89e58a697eb9f87 Mon Sep 17 00:00:00 2001 From: alasdair Date: Fri, 11 Nov 2022 19:53:04 +0100 Subject: [PATCH 094/161] Set crossplay to off until it works --- lgsm/config-default/config-lgsm/vhserver/_default.cfg | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lgsm/config-default/config-lgsm/vhserver/_default.cfg b/lgsm/config-default/config-lgsm/vhserver/_default.cfg index 4203e6a49..85f13614d 100644 --- a/lgsm/config-default/config-lgsm/vhserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/vhserver/_default.cfg @@ -21,8 +21,9 @@ saveinterval="1800" backups="4" backupshort="7200" backuplong="43200" -# Clear crossplay to set to false -crossplay="set" +# If crossplay is empty, it's off. Fill with any text to make true +# Crossplay is currently not working on Linux dedicated servers, so for now the default is false (emtpy) +crossplay="" ## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters startparameters="-name '${servername}' -password ${serverpassword} -port ${port} -world ${gameworld} -public ${public} -savedir '${savedir}' -logFile '${logFile}' -saveinterval ${saveinterval} -backups ${backups} -backupshort ${backupshort} -backuplong ${backuplong} ${crossplay:+-crossplay}" From 6cf4c1e00ea78be10dee9cbadf3f0faa3510c03f Mon Sep 17 00:00:00 2001 From: alasdair Date: Fri, 11 Nov 2022 21:32:53 +0100 Subject: [PATCH 096/161] Revert "Have fork reference self" This reverts commit 756cac442f17e824e3301f216a824a54df93a5b7. --- linuxgsm.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/linuxgsm.sh b/linuxgsm.sh index 461b30662..7d9f21d0b 100755 --- a/linuxgsm.sh +++ b/linuxgsm.sh @@ -47,9 +47,9 @@ userinput2="${2}" ## GitHub Branch Select # Allows for the use of different function files # from a different repo and/or branch. -githubuser="AlasdairHaig" -githubrepo="LinuxGSM" -githubbranch="master" +[ -n "${LGSM_GITHUBUSER}" ] && githubuser="${LGSM_GITHUBUSER}" || githubuser="GameServerManagers" +[ -n "${LGSM_GITHUBREPO}" ] && githubrepo="${LGSM_GITHUBREPO}" || githubrepo="LinuxGSM" +[ -n "${LGSM_GITHUBBRANCH}" ] && githubbranch="${LGSM_GITHUBBRANCH}" || githubbranch="master" # Check that curl is installed before doing anything if [ ! "$(command -v curl 2>/dev/null)" ]; then From 11078b3bf7679a9b0586a5b50cc4947601977a76 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Fri, 13 Jan 2023 18:57:26 +0000 Subject: [PATCH 097/161] fix(terraria): remove broken dependency requirement --- lgsm/data/ubuntu-21.04.csv | 2 +- lgsm/data/ubuntu-21.10.csv | 2 +- lgsm/data/ubuntu-22.04.csv | 2 +- lgsm/functions/check_deps.sh | 2 +- lgsm/functions/command_dev_query_raw.sh | 4 ++-- lgsm/functions/command_fastdl.sh | 18 +++++++++--------- lgsm/functions/mods_list.sh | 2 +- 7 files changed, 16 insertions(+), 16 deletions(-) diff --git a/lgsm/data/ubuntu-21.04.csv b/lgsm/data/ubuntu-21.04.csv index 666f9d864..158f6222b 100644 --- a/lgsm/data/ubuntu-21.04.csv +++ b/lgsm/data/ubuntu-21.04.csv @@ -104,7 +104,7 @@ squad st stn sven,libssl1.1:i386,zlib1g:i386 -terraria,libsdl +terraria tf2,libcurl4-gnutls-dev:i386 tfc ti diff --git a/lgsm/data/ubuntu-21.10.csv b/lgsm/data/ubuntu-21.10.csv index 713d21a89..58f55fc00 100644 --- a/lgsm/data/ubuntu-21.10.csv +++ b/lgsm/data/ubuntu-21.10.csv @@ -102,7 +102,7 @@ squad st stn sven,libssl1.1:i386,zlib1g:i386 -terraria,libsdl +terraria tf2,libcurl4-gnutls-dev:i386 tfc ti diff --git a/lgsm/data/ubuntu-22.04.csv b/lgsm/data/ubuntu-22.04.csv index b65fc60ac..d5d20b641 100644 --- a/lgsm/data/ubuntu-22.04.csv +++ b/lgsm/data/ubuntu-22.04.csv @@ -102,7 +102,7 @@ squad st stn sven,libssl1.1:i386,zlib1g:i386 -terraria,libsdl +terraria tf2,libcurl4-gnutls-dev:i386 tfc ti diff --git a/lgsm/functions/check_deps.sh b/lgsm/functions/check_deps.sh index 194f5541e..bb8507769 100755 --- a/lgsm/functions/check_deps.sh +++ b/lgsm/functions/check_deps.sh @@ -337,7 +337,7 @@ fi if [ -f "${datadir}/${distroid}-${distroversioncsv}.csv" ]; then depall=$(awk -F, '$1=="all" {$1=""; print $0}' "${datadir}/${distroid}-${distroversioncsv}.csv") depsteamcmd=$(awk -F, '$1=="steamcmd" {$1=""; print $0}' "${datadir}/${distroid}-${distroversioncsv}.csv") - depshortname=$(awk -v shortname="$shortname" -F, '$1==shortname {$1=""; print $0}' "${datadir}/${distroid}-${distroversioncsv}.csv") + depshortname=$(awk -v shortname="${shortname}" -F, '$1==shortname {$1=""; print $0}' "${datadir}/${distroid}-${distroversioncsv}.csv") # Generate array of missing deps. array_deps_missing=() diff --git a/lgsm/functions/command_dev_query_raw.sh b/lgsm/functions/command_dev_query_raw.sh index d626dc204..26884b259 100755 --- a/lgsm/functions/command_dev_query_raw.sh +++ b/lgsm/functions/command_dev_query_raw.sh @@ -210,10 +210,10 @@ echo -e "" echo -e "${lightgreen}Gamedig Raw Output${default}" echo -e "=================================" echo -e "" -if [ ! "$(command -v gamedig 2>/dev/null)" ]; then +if [ ! "$(command -v gamedig 2> /dev/null)" ]; then fn_print_failure_nl "gamedig not installed" fi -if [ ! "$(command -v jq 2>/dev/null)" ]; then +if [ ! "$(command -v jq 2> /dev/null)" ]; then fn_print_failure_nl "jq not installed" fi for queryip in "${queryips[@]}"; do diff --git a/lgsm/functions/command_fastdl.sh b/lgsm/functions/command_fastdl.sh index 5a6b3221d..e90ccc5e0 100755 --- a/lgsm/functions/command_fastdl.sh +++ b/lgsm/functions/command_fastdl.sh @@ -24,7 +24,7 @@ luafastdlfile="lgsm_cl_force_fastdl.lua" luafastdlfullpath="${luasvautorundir}/${luafastdlfile}" # Check if bzip2 is installed. -if [ ! "$(command -v bzip2 2>/dev/null)" ]; then +if [ ! "$(command -v bzip2 2> /dev/null)" ]; then fn_print_fail "bzip2 is not installed" fn_script_log_fatal "bzip2 is not installed" core_exit.sh @@ -133,7 +133,7 @@ fn_human_readable_file_size() { local factor="${item%:*}" local abbrev="${item#*:}" if [[ "${bytes}" -ge "${factor}" ]]; then - size=$(bc -l <<<"${bytes} / ${factor}") + size=$(bc -l <<< "${bytes} / ${factor}") printf "%.*f %s\n" "${precision}" "${size}" "${abbrev}" break fi @@ -161,7 +161,7 @@ fn_fastdl_preview() { tput rc tput el echo -e "gathering ${allowed_extention} : ${fileswc}..." - echo -e "${ext}" >>"${tmpdir}/fastdl_files_to_compress.txt" + echo -e "${ext}" >> "${tmpdir}/fastdl_files_to_compress.txt" done < <(find . -type f -iname "${allowed_extention}") if [ ${fileswc} != 0 ]; then fn_print_ok_eol_nl @@ -193,7 +193,7 @@ fn_fastdl_preview() { tput rc tput el echo -e "gathering ${directory} ${allowed_extention} : ${fileswc}..." - echo -e "${ext}" >>"${tmpdir}/fastdl_files_to_compress.txt" + echo -e "${ext}" >> "${tmpdir}/fastdl_files_to_compress.txt" done < <(find "${systemdir}/${directory}" -type f -iname "${allowed_extention}") tput rc tput el @@ -210,7 +210,7 @@ fn_fastdl_preview() { if [ -f "${tmpdir}/fastdl_files_to_compress.txt" ]; then echo -e "calculating total file size..." fn_sleep_time - totalfiles=$(wc -l <"${tmpdir}/fastdl_files_to_compress.txt") + totalfiles=$(wc -l < "${tmpdir}/fastdl_files_to_compress.txt") # Calculates total file size. while read -r dufile; do filesize=$(stat -c %s "${dufile}") @@ -221,7 +221,7 @@ fn_fastdl_preview() { fn_script_log_fatal "Calculating total file size." core_exit.sh fi - done <"${tmpdir}/fastdl_files_to_compress.txt" + done < "${tmpdir}/fastdl_files_to_compress.txt" else fn_print_fail_eol_nl "generating file list" fn_script_log_fatal "Generating file list." @@ -304,12 +304,12 @@ fn_fastdl_gmod() { fi fi if [ -f "${tmpdir}/fastdl_files_to_compress.txt" ]; then - totalfiles=$(wc -l <"${tmpdir}/fastdl_files_to_compress.txt") + totalfiles=$(wc -l < "${tmpdir}/fastdl_files_to_compress.txt") # Calculates total file size. while read -r dufile; do filesize=$(du -b "${dufile}" | awk '{ print $1 }') filesizetotal=$((filesizetotal + filesize)) - done <"${tmpdir}/fastdl_files_to_compress.txt" + done < "${tmpdir}/fastdl_files_to_compress.txt" fi } @@ -396,7 +396,7 @@ fn_fastdl_gmod_dl_enforcer() { touch "${luafastdlfullpath}" # Read all filenames and put them into a lua file at the right path. while read -r line; do - echo -e "resource.AddFile( \"${line}\" )" >>"${luafastdlfullpath}" + echo -e "resource.AddFile( \"${line}\" )" >> "${luafastdlfullpath}" done < <(find "${fastdldir:?}" \( -type f ! -name "*.bz2" \) -printf '%P\n') exitcode=$? if [ "${exitcode}" != 0 ]; then diff --git a/lgsm/functions/mods_list.sh b/lgsm/functions/mods_list.sh index 06b534b9e..e8d583251 100755 --- a/lgsm/functions/mods_list.sh +++ b/lgsm/functions/mods_list.sh @@ -96,7 +96,7 @@ oxidesdtdlatestlink=$(curl --connect-timeout 10 -sL https://api.github.com/repos # Valheim Plus valeimpluslatestlink=$(curl --connect-timeout 10 -sL https://api.github.com/repos/valheimPlus/ValheimPlus/releases/latest | jq -r '.assets[]|select(.browser_download_url | contains("UnixServer.tar.gz")) | .browser_download_url') # Valheim BepInEx -bepinexvhlatestlink=$(curl --connect-timeout 10 -sL "https://valheim.thunderstore.io/api/experimental/package/denikson/BepInExPack_Valheim/" -H "accept: application/json" | jq -r '.latest.download_url' ) +bepinexvhlatestlink=$(curl --connect-timeout 10 -sL "https://valheim.thunderstore.io/api/experimental/package/denikson/BepInExPack_Valheim/" -H "accept: application/json" | jq -r '.latest.download_url') # Define mods information (required) From 72dd471ccd5ccf51608ad52412017e8d8ff56dfb Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Fri, 13 Jan 2023 20:35:02 +0000 Subject: [PATCH 098/161] fix(armar): update armar dependencies --- lgsm/data/debian-10.csv | 2 +- lgsm/data/debian-11.csv | 2 +- lgsm/data/debian-9.csv | 2 +- lgsm/data/ubuntu-18.04.csv | 2 +- lgsm/data/ubuntu-20.04.csv | 2 +- lgsm/data/ubuntu-21.04.csv | 2 +- lgsm/data/ubuntu-21.10.csv | 2 +- lgsm/data/ubuntu-22.04.csv | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/lgsm/data/debian-10.csv b/lgsm/data/debian-10.csv index 82c79d192..dd2abb341 100644 --- a/lgsm/data/debian-10.csv +++ b/lgsm/data/debian-10.csv @@ -5,7 +5,7 @@ ahl ahl2 ark arma3 -armar,libcurl4,libssl1.1 +armar,libcurl4 av bb bb2,libcurl4-gnutls-dev:i386 diff --git a/lgsm/data/debian-11.csv b/lgsm/data/debian-11.csv index 158f6222b..2c6a267c1 100644 --- a/lgsm/data/debian-11.csv +++ b/lgsm/data/debian-11.csv @@ -5,7 +5,7 @@ ahl ahl2 ark arma3 -armar,libcurl4,libssl1.1 +armar,libcurl4 av bb bb2,libcurl4-gnutls-dev:i386 diff --git a/lgsm/data/debian-9.csv b/lgsm/data/debian-9.csv index f03c39f6a..d69f72ad9 100644 --- a/lgsm/data/debian-9.csv +++ b/lgsm/data/debian-9.csv @@ -5,7 +5,7 @@ ahl ahl2 ark arma3 -armar,libcurl4,libssl1.1 +armar,libcurl4 av bb bb2,libcurl4-gnutls-dev:i386 diff --git a/lgsm/data/ubuntu-18.04.csv b/lgsm/data/ubuntu-18.04.csv index 82c79d192..dd2abb341 100644 --- a/lgsm/data/ubuntu-18.04.csv +++ b/lgsm/data/ubuntu-18.04.csv @@ -5,7 +5,7 @@ ahl ahl2 ark arma3 -armar,libcurl4,libssl1.1 +armar,libcurl4 av bb bb2,libcurl4-gnutls-dev:i386 diff --git a/lgsm/data/ubuntu-20.04.csv b/lgsm/data/ubuntu-20.04.csv index 65697649b..32b036733 100644 --- a/lgsm/data/ubuntu-20.04.csv +++ b/lgsm/data/ubuntu-20.04.csv @@ -5,7 +5,7 @@ ahl ahl2 ark arma3 -armar,libcurl4,libssl1.1 +armar,libcurl4 av bb bb2,libcurl4-gnutls-dev:i386 diff --git a/lgsm/data/ubuntu-21.04.csv b/lgsm/data/ubuntu-21.04.csv index 158f6222b..2c6a267c1 100644 --- a/lgsm/data/ubuntu-21.04.csv +++ b/lgsm/data/ubuntu-21.04.csv @@ -5,7 +5,7 @@ ahl ahl2 ark arma3 -armar,libcurl4,libssl1.1 +armar,libcurl4 av bb bb2,libcurl4-gnutls-dev:i386 diff --git a/lgsm/data/ubuntu-21.10.csv b/lgsm/data/ubuntu-21.10.csv index 58f55fc00..3fed35611 100644 --- a/lgsm/data/ubuntu-21.10.csv +++ b/lgsm/data/ubuntu-21.10.csv @@ -5,7 +5,7 @@ ahl ahl2 ark arma3 -armar,libcurl4,libssl1.1 +armar,libcurl4 av bb bb2,libcurl4-gnutls-dev:i386 diff --git a/lgsm/data/ubuntu-22.04.csv b/lgsm/data/ubuntu-22.04.csv index d5d20b641..599c11f7a 100644 --- a/lgsm/data/ubuntu-22.04.csv +++ b/lgsm/data/ubuntu-22.04.csv @@ -5,7 +5,7 @@ ahl ahl2 ark arma3 -armar,libcurl4,libssl1.1 +armar,libcurl4 av bb bb2,libcurl4-gnutls-dev:i386 From 7e6d2ad0edb23c4c41fb055fd4add023c888588e Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Fri, 13 Jan 2023 20:51:26 +0000 Subject: [PATCH 099/161] fix(onset): update onset dependencies --- lgsm/data/debian-10.csv | 2 +- lgsm/data/debian-11.csv | 2 +- lgsm/data/debian-9.csv | 2 +- lgsm/data/ubuntu-16.04.csv | 2 +- lgsm/data/ubuntu-18.04.csv | 2 +- lgsm/data/ubuntu-20.04.csv | 2 +- lgsm/data/ubuntu-21.04.csv | 2 +- lgsm/data/ubuntu-21.10.csv | 2 +- lgsm/data/ubuntu-22.04.csv | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/lgsm/data/debian-10.csv b/lgsm/data/debian-10.csv index dd2abb341..9932a3b39 100644 --- a/lgsm/data/debian-10.csv +++ b/lgsm/data/debian-10.csv @@ -73,7 +73,7 @@ nmrih,libtinfo5:i386 ns ns2,speex,libtbb2 ns2c,speex:i386,libtbb2 -onset,libmariadbclient-dev +onset,libmariadb-dev opfor pc pmc,openjdk-11-jre diff --git a/lgsm/data/debian-11.csv b/lgsm/data/debian-11.csv index 2c6a267c1..514f98ab8 100644 --- a/lgsm/data/debian-11.csv +++ b/lgsm/data/debian-11.csv @@ -73,7 +73,7 @@ nmrih,libtinfo5:i386 ns ns2,speex,libtbb2 ns2c,speex:i386,libtbb2 -onset,libmariadbclient-dev +onset,libmariadb-dev opfor pc pmc,openjdk-17-jre diff --git a/lgsm/data/debian-9.csv b/lgsm/data/debian-9.csv index d69f72ad9..786c8f6c0 100644 --- a/lgsm/data/debian-9.csv +++ b/lgsm/data/debian-9.csv @@ -73,7 +73,7 @@ nmrih,libtinfo5:i386 ns ns2,speex,libtbb2 ns2c,speex:i386,libtbb2 -onset,libmariadbclient-dev +onset,libmariadb-dev opfor pc pmc,openjdk-8-jre diff --git a/lgsm/data/ubuntu-16.04.csv b/lgsm/data/ubuntu-16.04.csv index fdbcd12d0..b5d8f6faf 100644 --- a/lgsm/data/ubuntu-16.04.csv +++ b/lgsm/data/ubuntu-16.04.csv @@ -72,7 +72,7 @@ nmrih,libtinfo5:i386 ns ns2,speex,libtbb2 ns2c,speex:i386,libtbb2 -onset,libmariadbclient-dev +onset,libmariadb-dev opfor pc pmc,openjdk-8-jre diff --git a/lgsm/data/ubuntu-18.04.csv b/lgsm/data/ubuntu-18.04.csv index dd2abb341..9932a3b39 100644 --- a/lgsm/data/ubuntu-18.04.csv +++ b/lgsm/data/ubuntu-18.04.csv @@ -73,7 +73,7 @@ nmrih,libtinfo5:i386 ns ns2,speex,libtbb2 ns2c,speex:i386,libtbb2 -onset,libmariadbclient-dev +onset,libmariadb-dev opfor pc pmc,openjdk-11-jre diff --git a/lgsm/data/ubuntu-20.04.csv b/lgsm/data/ubuntu-20.04.csv index 32b036733..68dc928d9 100644 --- a/lgsm/data/ubuntu-20.04.csv +++ b/lgsm/data/ubuntu-20.04.csv @@ -73,7 +73,7 @@ nmrih,libtinfo5:i386 ns ns2,speex,libtbb2 ns2c,speex:i386,libtbb2 -onset,libmariadbclient-dev +onset,libmariadb-dev opfor pc pmc,openjdk-17-jre diff --git a/lgsm/data/ubuntu-21.04.csv b/lgsm/data/ubuntu-21.04.csv index 2c6a267c1..514f98ab8 100644 --- a/lgsm/data/ubuntu-21.04.csv +++ b/lgsm/data/ubuntu-21.04.csv @@ -73,7 +73,7 @@ nmrih,libtinfo5:i386 ns ns2,speex,libtbb2 ns2c,speex:i386,libtbb2 -onset,libmariadbclient-dev +onset,libmariadb-dev opfor pc pmc,openjdk-17-jre diff --git a/lgsm/data/ubuntu-21.10.csv b/lgsm/data/ubuntu-21.10.csv index 3fed35611..45ce1f640 100644 --- a/lgsm/data/ubuntu-21.10.csv +++ b/lgsm/data/ubuntu-21.10.csv @@ -71,7 +71,7 @@ nmrih,libtinfo5:i386 ns ns2,speex,libtbb2 ns2c,speex:i386,libtbb2 -onset,libmariadbclient-dev +onset,libmariadb-dev opfor pc pmc,openjdk-17-jre diff --git a/lgsm/data/ubuntu-22.04.csv b/lgsm/data/ubuntu-22.04.csv index 599c11f7a..8b9f02234 100644 --- a/lgsm/data/ubuntu-22.04.csv +++ b/lgsm/data/ubuntu-22.04.csv @@ -71,7 +71,7 @@ nmrih,libtinfo5:i386 ns ns2,speex,libtbb2 ns2c,speex:i386,libtbb2 -onset,libmariadbclient-dev +onset,libmariadb-dev opfor pc pmc,openjdk-17-jre From 33185e608c13873edd1bdcd9c14bdf3ae61d98a8 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Fri, 13 Jan 2023 20:53:05 +0000 Subject: [PATCH 100/161] feat(docker): add docker distro info to csv --- lgsm/data/serverlist.csv | 256 +++++++++++++++++++-------------------- 1 file changed, 128 insertions(+), 128 deletions(-) diff --git a/lgsm/data/serverlist.csv b/lgsm/data/serverlist.csv index a33bbf816..be19a23f5 100644 --- a/lgsm/data/serverlist.csv +++ b/lgsm/data/serverlist.csv @@ -1,128 +1,128 @@ -ac,acserver,Assetto Corsa -ahl,ahlserver,Action Half-Life -ahl2,ahl2server,Action: Source -ark,arkserver,ARK: Survival Evolved -arma3,arma3server,ARMA 3 -armar,armarserver,Arma Reforger -av,avserver,Avorion -bb,bbserver,BrainBread -bb2,bb2server,BrainBread 2 -bd,bdserver,Base Defense -bf1942,bf1942server,Battlefield 1942 -bfv,bfvserver,Battlefield: Vietnam -bmdm,bmdmserver,Black Mesa: Deathmatch -bo,boserver,Ballistic Overkill -bs,bsserver,Blade Symphony -bt,btserver,Barotrauma -bt1944,bt1944server,Battalion 1944 -cc,ccserver,Codename CURE -cd,cdserver,Crafting Dead -cmw,cmwserver,Chivalry: Medieval Warfare -cod,codserver,Call of Duty -cod2,cod2server,Call of Duty 2 -cod4,cod4server,Call of Duty 4 -coduo,coduoserver,Call of Duty: United Offensive -codwaw,codwawserver,Call of Duty: World at War -col,colserver,Colony Survival -cs,csserver,Counter-Strike 1.6 -cscz,csczserver,Counter-Strike: Condition Zero -csgo,csgoserver,Counter-Strike: Global Offensive -css,cssserver,Counter-Strike: Source -dab,dabserver,Double Action: Boogaloo -dayz,dayzserver,DayZ -dmc,dmcserver,Deathmatch Classic -dod,dodserver,Day of Defeat -dodr,dodrserver,Day of Dragons -dods,dodsserver,Day of Defeat: Source -doi,doiserver,Day of Infamy -dst,dstserver,Don't Starve Together -dys,dysserver,Dystopia -eco,ecoserver,Eco -em,emserver,Empires Mod -etl,etlserver,ET: Legacy -fctr,fctrserver,Factorio -fof,fofserver,Fistful of Frags -gmod,gmodserver,Garrys Mod -hl2dm,hl2dmserver,Half-Life 2: Deathmatch -hldm,hldmserver,Half-Life: Deathmatch -hldms,hldmsserver,Half-Life Deathmatch: Source -hw,hwserver,Hurtworld -ins,insserver,Insurgency -inss,inssserver,Insurgency: Sandstorm -ios,iosserver,IOSoccer -jc2,jc2server,Just Cause 2 -jc3,jc3server,Just Cause 3 -jk2,jk2server,Jedi Knight II: Jedi Outcast -kf,kfserver,Killing Floor -kf2,kf2server,Killing Floor 2 -l4d,l4dserver,Left 4 Dead -l4d2,l4d2server,Left 4 Dead 2 -lo,loserver,Last Oasis -mc,mcserver,Minecraft -mcb,mcbserver,Minecraft Bedrock -mh,mhserver,MORDHAU -mohaa,mohaaserver,Medal of Honor: Allied Assault -mom,momserver,Memories of Mars -mta,mtaserver,Multi Theft Auto -mumble,mumbleserver,Mumble -nd,ndserver,Nuclear Dawn -nec,necserver,Necesse -nmrih,nmrihserver,No More Room in Hell -ns,nsserver,Natural Selection -ns2,ns2server,Natural Selection 2 -ns2c,ns2cserver,NS2: Combat -onset,onsetserver,Onset -opfor,opforserver,Opposing Force -pc,pcserver,Project Cars -pc2,pc2server,Project Cars 2 -pmc,pmcserver,PaperMC -pstbs,pstbsserver,Post Scriptum: The Bloody Seventh -pvkii,pvkiiserver,Pirates Vikings & Knights II -pvr,pvrserver,Pavlov VR -pz,pzserver,Project Zomboid -q2,q2server,Quake 2 -q3,q3server,Quake 3: Arena -ql,qlserver,Quake Live -qw,qwserver,Quake World -ricochet,ricochetserver,Ricochet -ro,roserver,Red Orchestra: Ostfront 41-45 -rtcw,rtcwserver,Return to Castle Wolfenstein -rust,rustserver,Rust -rw,rwserver,Rising World -samp,sampserver,San Andreas Multiplayer -sb,sbserver,Starbound -sbots,sbotsserver,StickyBots -scpsl,scpslserver,SCP: Secret Laboratory -scpslsm,scpslsmserver,SCP: Secret Laboratory ServerMod -sdtd,sdtdserver,7 Days to Die -sf,sfserver,Satisfactory -sfc,sfcserver,SourceForts Classic -sof2,sof2server,Soldier Of Fortune 2: Gold Edition -sol,solserver,Soldat -squad,squadserver,Squad -st,stserver,Stationeers -stn,stnserver,Survive the Nights -sven,svenserver,Sven Co-op -terraria,terrariaserver,Terraria -tf2,tf2server,Team Fortress 2 -tfc,tfcserver,Team Fortress Classic -ti,tiserver,The Isle -ts,tsserver,The Specialists -ts3,ts3server,Teamspeak 3 -tu,tuserver,Tower Unite -tw,twserver,Teeworlds -unt,untserver,Unturned -ut,utserver,Unreal Tournament -ut2k4,ut2k4server,Unreal Tournament 2004 -ut3,ut3server,Unreal Tournament 3 -ut99,ut99server,Unreal Tournament 99 -vh,vhserver,Valheim -vints,vintsserver,Vintage Story -vpmc,vpmcserver,Velocity Proxy MC -vs,vsserver,Vampire Slayer -wet,wetserver,Wolfenstein: Enemy Territory -wf,wfserver,Warfork -wmc,wmcserver,WaterfallMC -wurm,wurmserver,Wurm Unlimited -zmr,zmrserver,Zombie Master: Reborn -zps,zpsserver,Zombie Panic! Source +ac,acserver,Assetto Corsa,ubuntu-22.04 +ahl,ahlserver,Action Half-Life,ubuntu-22.04 +ahl2,ahl2server,Action: Source,ubuntu-22.04 +ark,arkserver,ARK: Survival Evolved,ubuntu-22.04 +arma3,arma3server,ARMA 3,ubuntu-22.04 +armar,armarserver,Arma Reforger,ubuntu-20.04 +av,avserver,Avorion,ubuntu-22.04 +bb,bbserver,BrainBread,ubuntu-22.04 +bb2,bb2server,BrainBread 2,ubuntu-22.04 +bd,bdserver,Base Defense,ubuntu-22.04 +bf1942,bf1942server,Battlefield 1942,ubuntu-22.04 +bfv,bfvserver,Battlefield: Vietnam,ubuntu-22.04 +bmdm,bmdmserver,Black Mesa: Deathmatch,ubuntu-22.04 +bo,boserver,Ballistic Overkill,ubuntu-22.04 +bs,bsserver,Blade Symphony,ubuntu-22.04 +bt,btserver,Barotrauma,ubuntu-22.04 +bt1944,bt1944server,Battalion 1944,ubuntu-22.04 +cc,ccserver,Codename CURE,ubuntu-22.04 +cd,cdserver,Crafting Dead,ubuntu-22.04 +cmw,cmwserver,Chivalry: Medieval Warfare,ubuntu-22.04 +cod,codserver,Call of Duty,ubuntu-22.04 +cod2,cod2server,Call of Duty 2,ubuntu-22.04 +cod4,cod4server,Call of Duty 4,ubuntu-22.04 +coduo,coduoserver,Call of Duty: United Offensive,ubuntu-22.04 +codwaw,codwawserver,Call of Duty: World at War,ubuntu-22.04 +col,colserver,Colony Survival,ubuntu-22.04 +cs,csserver,Counter-Strike 1.6,ubuntu-22.04 +cscz,csczserver,Counter-Strike: Condition Zero,ubuntu-22.04 +csgo,csgoserver,Counter-Strike: Global Offensive,ubuntu-22.04 +css,cssserver,Counter-Strike: Source,ubuntu-22.04 +dab,dabserver,Double Action: Boogaloo,ubuntu-22.04 +dayz,dayzserver,DayZ,ubuntu-22.04 +dmc,dmcserver,Deathmatch Classic,ubuntu-22.04 +dod,dodserver,Day of Defeat,ubuntu-22.04 +dodr,dodrserver,Day of Dragons,ubuntu-22.04 +dods,dodsserver,Day of Defeat: Source,ubuntu-22.04 +doi,doiserver,Day of Infamy,ubuntu-22.04 +dst,dstserver,Don't Starve Together,ubuntu-22.04 +dys,dysserver,Dystopia,ubuntu-22.04 +eco,ecoserver,Eco,ubuntu-22.04 +em,emserver,Empires Mod,ubuntu-22.04 +etl,etlserver,ET: Legacy,ubuntu-22.04 +fctr,fctrserver,Factorio,ubuntu-22.04 +fof,fofserver,Fistful of Frags,ubuntu-22.04 +gmod,gmodserver,Garrys Mod,ubuntu-22.04 +hl2dm,hl2dmserver,Half-Life 2: Deathmatch,ubuntu-22.04 +hldm,hldmserver,Half-Life: Deathmatch,ubuntu-22.04 +hldms,hldmsserver,Half-Life Deathmatch: Source,ubuntu-22.04 +hw,hwserver,Hurtworld,ubuntu-22.04 +ins,insserver,Insurgency,ubuntu-22.04 +inss,inssserver,Insurgency: Sandstorm,ubuntu-22.04 +ios,iosserver,IOSoccer,ubuntu-22.04 +jc2,jc2server,Just Cause 2,ubuntu-22.04 +jc3,jc3server,Just Cause 3,ubuntu-22.04 +jk2,jk2server,Jedi Knight II: Jedi Outcast,ubuntu-22.04 +kf,kfserver,Killing Floor,ubuntu-22.04 +kf2,kf2server,Killing Floor 2,ubuntu-22.04 +l4d,l4dserver,Left 4 Dead,ubuntu-22.04 +l4d2,l4d2server,Left 4 Dead 2,ubuntu-22.04 +lo,loserver,Last Oasis,ubuntu-22.04 +mc,mcserver,Minecraft,ubuntu-22.04 +mcb,mcbserver,Minecraft Bedrock,ubuntu-22.04 +mh,mhserver,MORDHAU,ubuntu-22.04 +mohaa,mohaaserver,Medal of Honor: Allied Assault,ubuntu-22.04 +mom,momserver,Memories of Mars,ubuntu-22.04 +mta,mtaserver,Multi Theft Auto,ubuntu-22.04 +mumble,mumbleserver,Mumble,ubuntu-22.04 +nd,ndserver,Nuclear Dawn,ubuntu-22.04 +nec,necserver,Necesse,ubuntu-22.04 +nmrih,nmrihserver,No More Room in Hell,ubuntu-22.04 +ns,nsserver,Natural Selection,ubuntu-22.04 +ns2,ns2server,Natural Selection 2,ubuntu-22.04 +ns2c,ns2cserver,NS2: Combat,ubuntu-22.04 +onset,onsetserver,Onset,ubuntu-20.04 +opfor,opforserver,Opposing Force,ubuntu-22.04 +pc,pcserver,Project Cars,ubuntu-22.04 +pc2,pc2server,Project Cars 2,ubuntu-22.04 +pmc,pmcserver,PaperMC,ubuntu-22.04 +pstbs,pstbsserver,Post Scriptum: The Bloody Seventh,ubuntu-22.04 +pvkii,pvkiiserver,Pirates Vikings & Knights II,ubuntu-22.04 +pvr,pvrserver,Pavlov VR,ubuntu-22.04 +pz,pzserver,Project Zomboid,ubuntu-22.04 +q2,q2server,Quake 2,ubuntu-22.04 +q3,q3server,Quake 3: Arena,ubuntu-22.04 +ql,qlserver,Quake Live,ubuntu-22.04 +qw,qwserver,Quake World,ubuntu-22.04 +ricochet,ricochetserver,Ricochet,ubuntu-22.04 +ro,roserver,Red Orchestra: Ostfront 41-45,ubuntu-22.04 +rtcw,rtcwserver,Return to Castle Wolfenstein,ubuntu-22.04 +rust,rustserver,Rust,ubuntu-22.04 +rw,rwserver,Rising World,ubuntu-22.04 +samp,sampserver,San Andreas Multiplayer,ubuntu-22.04 +sb,sbserver,Starbound,ubuntu-22.04 +sbots,sbotsserver,StickyBots,ubuntu-22.04 +scpsl,scpslserver,SCP: Secret Laboratory,ubuntu-22.04 +scpslsm,scpslsmserver,SCP: Secret Laboratory ServerMod,ubuntu-22.04 +sdtd,sdtdserver,7 Days to Die,ubuntu-22.04 +sf,sfserver,Satisfactory,ubuntu-22.04 +sfc,sfcserver,SourceForts Classic,ubuntu-22.04 +sof2,sof2server,Soldier Of Fortune 2: Gold Edition,ubuntu-22.04 +sol,solserver,Soldat,ubuntu-22.04 +squad,squadserver,Squad,ubuntu-22.04 +st,stserver,Stationeers,ubuntu-22.04 +stn,stnserver,Survive the Nights,ubuntu-22.04 +sven,svenserver,Sven Co-op,ubuntu-20.04 +terraria,terrariaserver,Terraria,ubuntu-22.04 +tf2,tf2server,Team Fortress 2,ubuntu-22.04 +tfc,tfcserver,Team Fortress Classic,ubuntu-22.04 +ti,tiserver,The Isle,ubuntu-22.04 +ts,tsserver,The Specialists,ubuntu-22.04 +ts3,ts3server,Teamspeak 3,ubuntu-22.04 +tu,tuserver,Tower Unite,ubuntu-22.04 +tw,twserver,Teeworlds,ubuntu-22.04 +unt,untserver,Unturned,ubuntu-22.04 +ut,utserver,Unreal Tournament,ubuntu-22.04 +ut2k4,ut2k4server,Unreal Tournament 2004,ubuntu-22.04 +ut3,ut3server,Unreal Tournament 3,ubuntu-22.04 +ut99,ut99server,Unreal Tournament 99,ubuntu-22.04 +vh,vhserver,Valheim,ubuntu-22.04 +vints,vintsserver,Vintage Story,ubuntu-22.04 +vpmc,vpmcserver,Velocity Proxy MC,ubuntu-22.04 +vs,vsserver,Vampire Slayer,ubuntu-22.04 +wet,wetserver,Wolfenstein: Enemy Territory,ubuntu-22.04 +wf,wfserver,Warfork,ubuntu-22.04 +wmc,wmcserver,WaterfallMC,ubuntu-22.04 +wurm,wurmserver,Wurm Unlimited,ubuntu-22.04 +zmr,zmrserver,Zombie Master: Reborn,ubuntu-22.04 +zps,zpsserver,Zombie Panic! Source,ubuntu-22.04 From ba0e1144a1a73567cdb3f253f491cadaae6dd696 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Fri, 13 Jan 2023 21:15:30 +0000 Subject: [PATCH 101/161] feat(docker): add docker image list to csv --- lgsm/data/serverlist.csv | 254 ++++++++++++++++++------------------- lgsm/data/ubuntu-20.04.csv | 12 +- lgsm/data/ubuntu-22.04.csv | 14 +- 3 files changed, 140 insertions(+), 140 deletions(-) diff --git a/lgsm/data/serverlist.csv b/lgsm/data/serverlist.csv index 4c80f538a..c075684b7 100644 --- a/lgsm/data/serverlist.csv +++ b/lgsm/data/serverlist.csv @@ -1,127 +1,127 @@ -ac,acserver,Assetto Corsa -ahl,ahlserver,Action Half-Life -ahl2,ahl2server,Action: Source -ark,arkserver,ARK: Survival Evolved -arma3,arma3server,ARMA 3 -armar,armarserver,Arma Reforger -av,avserver,Avorion -bb,bbserver,BrainBread -bb2,bb2server,BrainBread 2 -bd,bdserver,Base Defense -bf1942,bf1942server,Battlefield 1942 -bfv,bfvserver,Battlefield: Vietnam -bmdm,bmdmserver,Black Mesa: Deathmatch -bo,boserver,Ballistic Overkill -bs,bsserver,Blade Symphony -bt,btserver,Barotrauma -bt1944,bt1944server,Battalion 1944 -cc,ccserver,Codename CURE -cd,cdserver,Crafting Dead -cmw,cmwserver,Chivalry: Medieval Warfare -cod,codserver,Call of Duty -cod2,cod2server,Call of Duty 2 -cod4,cod4server,Call of Duty 4 -coduo,coduoserver,Call of Duty: United Offensive -codwaw,codwawserver,Call of Duty: World at War -col,colserver,Colony Survival -cs,csserver,Counter-Strike 1.6 -cscz,csczserver,Counter-Strike: Condition Zero -csgo,csgoserver,Counter-Strike: Global Offensive -css,cssserver,Counter-Strike: Source -dab,dabserver,Double Action: Boogaloo -dayz,dayzserver,DayZ -dmc,dmcserver,Deathmatch Classic -dod,dodserver,Day of Defeat -dodr,dodrserver,Day of Dragons -dods,dodsserver,Day of Defeat: Source -doi,doiserver,Day of Infamy -dst,dstserver,Don't Starve Together -dys,dysserver,Dystopia -eco,ecoserver,Eco -em,emserver,Empires Mod -etl,etlserver,ET: Legacy -fctr,fctrserver,Factorio -fof,fofserver,Fistful of Frags -gmod,gmodserver,Garrys Mod -hl2dm,hl2dmserver,Half-Life 2: Deathmatch -hldm,hldmserver,Half-Life: Deathmatch -hldms,hldmsserver,Half-Life Deathmatch: Source -hw,hwserver,Hurtworld -ins,insserver,Insurgency -inss,inssserver,Insurgency: Sandstorm -ios,iosserver,IOSoccer -jc2,jc2server,Just Cause 2 -jc3,jc3server,Just Cause 3 -jk2,jk2server,Jedi Knight II: Jedi Outcast -kf,kfserver,Killing Floor -kf2,kf2server,Killing Floor 2 -lo,loserver,Last Oasis -l4d,l4dserver,Left 4 Dead -l4d2,l4d2server,Left 4 Dead 2 -mc,mcserver,Minecraft -mcb,mcbserver,Minecraft Bedrock -mh,mhserver,MORDHAU -mohaa,mohaaserver,Medal of Honor: Allied Assault -mom,momserver,Memories of Mars -mta,mtaserver,Multi Theft Auto -mumble,mumbleserver,Mumble -nd,ndserver,Nuclear Dawn -nmrih,nmrihserver,No More Room in Hell -ns,nsserver,Natural Selection -ns2,ns2server,Natural Selection 2 -ns2c,ns2cserver,NS2: Combat -onset,onsetserver,Onset -opfor,opforserver,Opposing Force -pc,pcserver,Project Cars -pc2,pc2server,Project Cars 2 -pmc,pmcserver,PaperMC -pstbs,pstbsserver,Post Scriptum: The Bloody Seventh -pvkii,pvkiiserver,Pirates Vikings & Knights II -pvr,pvrserver,Pavlov VR -pz,pzserver,Project Zomboid -q2,q2server,Quake 2 -q3,q3server,Quake 3: Arena -ql,qlserver,Quake Live -qw,qwserver,Quake World -ricochet,ricochetserver,Ricochet -ro,roserver,Red Orchestra: Ostfront 41-45 -rtcw,rtcwserver,Return to Castle Wolfenstein -rust,rustserver,Rust -rw,rwserver,Rising World -samp,sampserver,San Andreas Multiplayer -sb,sbserver,Starbound -sbots,sbotsserver,StickyBots -scpsl,scpslserver,SCP: Secret Laboratory -scpslsm,scpslsmserver,SCP: Secret Laboratory ServerMod -sdtd,sdtdserver,7 Days to Die -sfc,sfcserver,SourceForts Classic -sf,sfserver,Satisfactory -sof2,sof2server,Soldier Of Fortune 2: Gold Edition -sol,solserver,Soldat -squad,squadserver,Squad -st,stserver,Stationeers -stn,stnserver,Survive the Nights -sven,svenserver,Sven Co-op -terraria,terrariaserver,Terraria -tf2,tf2server,Team Fortress 2 -tfc,tfcserver,Team Fortress Classic -ti,tiserver,The Isle -ts,tsserver,The Specialists -ts3,ts3server,Teamspeak 3 -tu,tuserver,Tower Unite -tw,twserver,Teeworlds -unt,untserver,Unturned -ut,utserver,Unreal Tournament -ut2k4,ut2k4server,Unreal Tournament 2004 -ut3,ut3server,Unreal Tournament 3 -ut99,ut99server,Unreal Tournament 99 -vh,vhserver,Valheim -vints,vintsserver,Vintage Story -vpmc,vpmcserver,Velocity Proxy MC -vs,vsserver,Vampire Slayer -wet,wetserver,Wolfenstein: Enemy Territory -wf,wfserver,Warfork -wmc,wmcserver,WaterfallMC -wurm,wurmserver,Wurm Unlimited -zmr,zmrserver,Zombie Master: Reborn -zps,zpsserver,Zombie Panic! Source +ac,acserver,Assetto Corsa,ubuntu-22.04 +ahl,ahlserver,Action Half-Life,ubuntu-22.04 +ahl2,ahl2server,Action: Source,ubuntu-22.04 +ark,arkserver,ARK: Survival Evolved,ubuntu-22.04 +arma3,arma3server,ARMA 3,ubuntu-22.04 +armar,armarserver,Arma Reforger,ubuntu-20.04 +av,avserver,Avorion,ubuntu-22.04 +bb,bbserver,BrainBread,ubuntu-22.04 +bb2,bb2server,BrainBread 2,ubuntu-22.04 +bd,bdserver,Base Defense,ubuntu-22.04 +bf1942,bf1942server,Battlefield 1942,ubuntu-22.04 +bfv,bfvserver,Battlefield: Vietnam,ubuntu-22.04 +bmdm,bmdmserver,Black Mesa: Deathmatch,ubuntu-22.04 +bo,boserver,Ballistic Overkill,ubuntu-22.04 +bs,bsserver,Blade Symphony,ubuntu-22.04 +bt,btserver,Barotrauma,ubuntu-22.04 +bt1944,bt1944server,Battalion 1944,ubuntu-22.04 +cc,ccserver,Codename CURE,ubuntu-22.04 +cd,cdserver,Crafting Dead,ubuntu-22.04 +cmw,cmwserver,Chivalry: Medieval Warfare,ubuntu-22.04 +cod,codserver,Call of Duty,ubuntu-22.04 +cod2,cod2server,Call of Duty 2,ubuntu-22.04 +cod4,cod4server,Call of Duty 4,ubuntu-22.04 +coduo,coduoserver,Call of Duty: United Offensive,ubuntu-22.04 +codwaw,codwawserver,Call of Duty: World at War,ubuntu-22.04 +col,colserver,Colony Survival,ubuntu-22.04 +cs,csserver,Counter-Strike 1.6,ubuntu-22.04 +cscz,csczserver,Counter-Strike: Condition Zero,ubuntu-22.04 +csgo,csgoserver,Counter-Strike: Global Offensive,ubuntu-22.04 +css,cssserver,Counter-Strike: Source,ubuntu-22.04 +dab,dabserver,Double Action: Boogaloo,ubuntu-22.04 +dayz,dayzserver,DayZ,ubuntu-22.04 +dmc,dmcserver,Deathmatch Classic,ubuntu-22.04 +dod,dodserver,Day of Defeat,ubuntu-22.04 +dodr,dodrserver,Day of Dragons,ubuntu-22.04 +dods,dodsserver,Day of Defeat: Source,ubuntu-22.04 +doi,doiserver,Day of Infamy,ubuntu-22.04 +dst,dstserver,Don't Starve Together,ubuntu-22.04 +dys,dysserver,Dystopia,ubuntu-22.04 +eco,ecoserver,Eco,ubuntu-22.04 +em,emserver,Empires Mod,ubuntu-22.04 +etl,etlserver,ET: Legacy,ubuntu-22.04 +fctr,fctrserver,Factorio,ubuntu-22.04 +fof,fofserver,Fistful of Frags,ubuntu-22.04 +gmod,gmodserver,Garrys Mod,ubuntu-22.04 +hl2dm,hl2dmserver,Half-Life 2: Deathmatch,ubuntu-22.04 +hldm,hldmserver,Half-Life: Deathmatch,ubuntu-22.04 +hldms,hldmsserver,Half-Life Deathmatch: Source,ubuntu-22.04 +hw,hwserver,Hurtworld,ubuntu-22.04 +ins,insserver,Insurgency,ubuntu-22.04 +inss,inssserver,Insurgency: Sandstorm,ubuntu-22.04 +ios,iosserver,IOSoccer,ubuntu-22.04 +jc2,jc2server,Just Cause 2,ubuntu-22.04 +jc3,jc3server,Just Cause 3,ubuntu-22.04 +jk2,jk2server,Jedi Knight II: Jedi Outcast,ubuntu-22.04 +kf,kfserver,Killing Floor,ubuntu-22.04 +kf2,kf2server,Killing Floor 2,ubuntu-22.04 +l4d,l4dserver,Left 4 Dead,ubuntu-22.04 +l4d2,l4d2server,Left 4 Dead 2,ubuntu-22.04 +lo,loserver,Last Oasis,ubuntu-22.04 +mc,mcserver,Minecraft,ubuntu-22.04 +mcb,mcbserver,Minecraft Bedrock,ubuntu-22.04 +mh,mhserver,MORDHAU,ubuntu-22.04 +mohaa,mohaaserver,Medal of Honor: Allied Assault,ubuntu-22.04 +mom,momserver,Memories of Mars,ubuntu-22.04 +mta,mtaserver,Multi Theft Auto,ubuntu-22.04 +mumble,mumbleserver,Mumble,ubuntu-22.04 +nd,ndserver,Nuclear Dawn,ubuntu-22.04 +nmrih,nmrihserver,No More Room in Hell,ubuntu-22.04 +ns,nsserver,Natural Selection,ubuntu-22.04 +ns2,ns2server,Natural Selection 2,ubuntu-22.04 +ns2c,ns2cserver,NS2: Combat,ubuntu-22.04 +onset,onsetserver,Onset,ubuntu-20.04 +opfor,opforserver,Opposing Force,ubuntu-22.04 +pc,pcserver,Project Cars,ubuntu-22.04 +pc2,pc2server,Project Cars 2,ubuntu-22.04 +pmc,pmcserver,PaperMC,ubuntu-22.04 +pstbs,pstbsserver,Post Scriptum: The Bloody Seventh,ubuntu-22.04 +pvkii,pvkiiserver,Pirates Vikings & Knights II,ubuntu-22.04 +pvr,pvrserver,Pavlov VR,ubuntu-22.04 +pz,pzserver,Project Zomboid,ubuntu-22.04 +q2,q2server,Quake 2,ubuntu-22.04 +q3,q3server,Quake 3: Arena,ubuntu-22.04 +ql,qlserver,Quake Live,ubuntu-22.04 +qw,qwserver,Quake World,ubuntu-22.04 +ricochet,ricochetserver,Ricochet,ubuntu-22.04 +ro,roserver,Red Orchestra: Ostfront 41-45,ubuntu-22.04 +rtcw,rtcwserver,Return to Castle Wolfenstein,ubuntu-22.04 +rust,rustserver,Rust,ubuntu-22.04 +rw,rwserver,Rising World,ubuntu-22.04 +samp,sampserver,San Andreas Multiplayer,ubuntu-22.04 +sb,sbserver,Starbound,ubuntu-22.04 +sbots,sbotsserver,StickyBots,ubuntu-22.04 +scpsl,scpslserver,SCP: Secret Laboratory,ubuntu-22.04 +scpslsm,scpslsmserver,SCP: Secret Laboratory ServerMod,ubuntu-22.04 +sdtd,sdtdserver,7 Days to Die,ubuntu-22.04 +sf,sfserver,Satisfactory,ubuntu-22.04 +sfc,sfcserver,SourceForts Classic,ubuntu-22.04 +sof2,sof2server,Soldier Of Fortune 2: Gold Edition,ubuntu-22.04 +sol,solserver,Soldat,ubuntu-22.04 +squad,squadserver,Squad,ubuntu-22.04 +st,stserver,Stationeers,ubuntu-22.04 +stn,stnserver,Survive the Nights,ubuntu-22.04 +sven,svenserver,Sven Co-op,ubuntu-20.04 +terraria,terrariaserver,Terraria,ubuntu-22.04 +tf2,tf2server,Team Fortress 2,ubuntu-22.04 +tfc,tfcserver,Team Fortress Classic,ubuntu-22.04 +ti,tiserver,The Isle,ubuntu-22.04 +ts,tsserver,The Specialists,ubuntu-22.04 +ts3,ts3server,Teamspeak 3,ubuntu-22.04 +tu,tuserver,Tower Unite,ubuntu-22.04 +tw,twserver,Teeworlds,ubuntu-22.04 +unt,untserver,Unturned,ubuntu-22.04 +ut,utserver,Unreal Tournament,ubuntu-22.04 +ut2k4,ut2k4server,Unreal Tournament 2004,ubuntu-22.04 +ut3,ut3server,Unreal Tournament 3,ubuntu-22.04 +ut99,ut99server,Unreal Tournament 99,ubuntu-22.04 +vh,vhserver,Valheim,ubuntu-22.04 +vints,vintsserver,Vintage Story,ubuntu-22.04 +vpmc,vpmcserver,Velocity Proxy MC,ubuntu-22.04 +vs,vsserver,Vampire Slayer,ubuntu-22.04 +wet,wetserver,Wolfenstein: Enemy Territory,ubuntu-22.04 +wf,wfserver,Warfork,ubuntu-22.04 +wmc,wmcserver,WaterfallMC,ubuntu-22.04 +wurm,wurmserver,Wurm Unlimited,ubuntu-22.04 +zmr,zmrserver,Zombie Master: Reborn,ubuntu-22.04 +zps,zpsserver,Zombie Panic! Source,ubuntu-22.04 diff --git a/lgsm/data/ubuntu-20.04.csv b/lgsm/data/ubuntu-20.04.csv index 49f64348d..db5cfd03b 100644 --- a/lgsm/data/ubuntu-20.04.csv +++ b/lgsm/data/ubuntu-20.04.csv @@ -5,7 +5,7 @@ ahl ahl2 ark arma3 -armar,libcurl4,libssl1.1 +armar,libcurl4 av bb bb2,libcurl4-gnutls-dev:i386 @@ -15,7 +15,7 @@ bfv,libncurses5:i386,libstdc++5:i386 bmdm,libncurses5:i386 bo bs -bt,libicu-dev +bt,libicu-dev,dos2unix bt1944 cc cd @@ -57,9 +57,9 @@ jc3 jk2 kf kf2 -lo l4d l4d2 +lo mc,openjdk-17-jre mcb mh @@ -72,7 +72,7 @@ nmrih,libtinfo5:i386 ns ns2,speex,libtbb2 ns2c,speex:i386,libtbb2 -onset,libmariadbclient-dev +onset,libmariadb-dev opfor pc pmc,openjdk-17-jre @@ -95,8 +95,8 @@ sbots scpsl,mono-complete scpslsm,mono-complete sdtd,telnet,expect -sfc,libtinfo5:i386 sf +sfc,libtinfo5:i386 sof2 sol squad @@ -117,9 +117,9 @@ ut2k4 ut3 ut99 vh,libc6-dev -vs vints,mono-complete vpmc,openjdk-11-jre +vs wet wf wmc,openjdk-17-jre diff --git a/lgsm/data/ubuntu-22.04.csv b/lgsm/data/ubuntu-22.04.csv index dd567bf7b..7a28e4b04 100644 --- a/lgsm/data/ubuntu-22.04.csv +++ b/lgsm/data/ubuntu-22.04.csv @@ -5,7 +5,7 @@ ahl ahl2 ark arma3 -armar,libcurl4,libssl1.1 +armar,libcurl4 av bb bb2,libcurl4-gnutls-dev:i386 @@ -15,7 +15,7 @@ bfv,libncurses5:i386,libstdc++5:i386 bmdm,libncurses5:i386 bo bs -bt,libicu-dev +bt,libicu-dev,dos2unix bt1944 cc cmw @@ -55,9 +55,9 @@ jc3 jk2 kf kf2 -lo l4d l4d2 +lo mc,openjdk-17-jre mcb mh @@ -70,7 +70,7 @@ nmrih,libtinfo5:i386 ns ns2,speex,libtbb2 ns2c,speex:i386,libtbb2 -onset,libmariadbclient-dev +onset,libmariadb-dev opfor pc pmc,openjdk-17-jre @@ -93,15 +93,15 @@ sbots scpsl,mono-complete scpslsm,mono-complete sdtd,telnet,expect -sfc,libtinfo5:i386 sf +sfc,libtinfo5:i386 sof2 sol squad st stn sven,libssl1.1:i386,zlib1g:i386 -terraria,libsdl +terraria tf2,libcurl4-gnutls-dev:i386 tfc ti @@ -115,9 +115,9 @@ ut2k4 ut3 ut99 vh,libc6-dev -vs vints,mono-complete vpmc,openjdk-11-jre +vs wet wf wmc,openjdk-17-jre From b09bd2d9aff61b1cacc2145bc7ca47250865fc46 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 14 Jan 2023 00:11:53 +0000 Subject: [PATCH 102/161] Update license copyright year(s) (#4073) * build(deps): bump release-drafter/release-drafter from 5.21.0 to 5.21.1 (#4006) Bumps [release-drafter/release-drafter](https://github.com/release-drafter/release-drafter) from 5.21.0 to 5.21.1. - [Release notes](https://github.com/release-drafter/release-drafter/releases) - [Commits](https://github.com/release-drafter/release-drafter/compare/v5.21.0...v5.21.1) --- updated-dependencies: - dependency-name: release-drafter/release-drafter dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * build(deps): bump webfactory/ssh-agent from 0.5.4 to 0.7.0 (#4009) Bumps [webfactory/ssh-agent](https://github.com/webfactory/ssh-agent) from 0.5.4 to 0.7.0. - [Release notes](https://github.com/webfactory/ssh-agent/releases) - [Changelog](https://github.com/webfactory/ssh-agent/blob/master/CHANGELOG.md) - [Commits](https://github.com/webfactory/ssh-agent/compare/v0.5.4...v0.7.0) --- updated-dependencies: - dependency-name: webfactory/ssh-agent dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * docs(license): update copyright year(s) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: github-actions --- .github/workflows/create-release.yml | 2 +- .github/workflows/git-sync.yml | 4 ++-- LICENSE | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/create-release.yml b/.github/workflows/create-release.yml index ad5a88a7d..e43f58c51 100644 --- a/.github/workflows/create-release.yml +++ b/.github/workflows/create-release.yml @@ -16,7 +16,7 @@ jobs: runs-on: ubuntu-latest steps: # Drafts your next Release notes as Pull Requests are merged into "master" - - uses: release-drafter/release-drafter@v5.21.0 + - uses: release-drafter/release-drafter@v5.21.1 with: config-name: release-drafter.yml env: diff --git a/.github/workflows/git-sync.yml b/.github/workflows/git-sync.yml index b43996dc6..f07d1f3b4 100644 --- a/.github/workflows/git-sync.yml +++ b/.github/workflows/git-sync.yml @@ -10,8 +10,8 @@ jobs: GitHub-to-Bitbucket: runs-on: ubuntu-latest steps: - - name: webfactory/ssh-agent@v0.5.4 - uses: webfactory/ssh-agent@v0.5.4 + - name: webfactory/ssh-agent@v0.7.0 + uses: webfactory/ssh-agent@v0.7.0 with: ssh-private-key: ${{ secrets.BITBUCKET_SECRET }} diff --git a/LICENSE b/LICENSE index 88c1caac5..12352eafa 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ # The MIT License (MIT) -Copyright (c) 2012-2022 Daniel Gibbs +Copyright (c) 2012-2023 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 From cf7b0c51e9c288c2811c91e07f1c67e0c7c604cd Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sat, 14 Jan 2023 00:28:30 +0000 Subject: [PATCH 103/161] Update update-copyright-years-in-license-file.yml --- .../workflows/update-copyright-years-in-license-file.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/update-copyright-years-in-license-file.yml b/.github/workflows/update-copyright-years-in-license-file.yml index 01af6dd3c..347446d75 100644 --- a/.github/workflows/update-copyright-years-in-license-file.yml +++ b/.github/workflows/update-copyright-years-in-license-file.yml @@ -2,6 +2,7 @@ name: Update copyright year(s) in license file on: + workflow_dispatch: schedule: - cron: "0 3 1 1 *" # 03:00 AM on January 1 @@ -15,3 +16,9 @@ jobs: - uses: FantasticFiasco/action-update-license-year@v2 with: token: ${{ secrets.GITHUB_TOKEN }} + path: LICENSE.md + - name: Merge pull request + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + gh pr merge --merge --delete-branch From c22940daeb966f4d1f735ef8e972a443077e4a8c Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sat, 14 Jan 2023 00:37:13 +0000 Subject: [PATCH 104/161] Rename LICENSE to LICENSE.md --- LICENSE => LICENSE.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename LICENSE => LICENSE.md (100%) diff --git a/LICENSE b/LICENSE.md similarity index 100% rename from LICENSE rename to LICENSE.md From 885914b144787a7fbfef00e0a96af74a3f633bf9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 16 Jan 2023 12:49:30 +0000 Subject: [PATCH 105/161] build(deps): bump release-drafter/release-drafter from 5.21.1 to 5.22.0 (#4075) * build(deps): bump release-drafter/release-drafter from 5.21.0 to 5.21.1 (#4006) Bumps [release-drafter/release-drafter](https://github.com/release-drafter/release-drafter) from 5.21.0 to 5.21.1. - [Release notes](https://github.com/release-drafter/release-drafter/releases) - [Commits](https://github.com/release-drafter/release-drafter/compare/v5.21.0...v5.21.1) --- updated-dependencies: - dependency-name: release-drafter/release-drafter dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * build(deps): bump webfactory/ssh-agent from 0.5.4 to 0.7.0 (#4009) Bumps [webfactory/ssh-agent](https://github.com/webfactory/ssh-agent) from 0.5.4 to 0.7.0. - [Release notes](https://github.com/webfactory/ssh-agent/releases) - [Changelog](https://github.com/webfactory/ssh-agent/blob/master/CHANGELOG.md) - [Commits](https://github.com/webfactory/ssh-agent/compare/v0.5.4...v0.7.0) --- updated-dependencies: - dependency-name: webfactory/ssh-agent dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * build(deps): bump release-drafter/release-drafter from 5.21.1 to 5.22.0 Bumps [release-drafter/release-drafter](https://github.com/release-drafter/release-drafter) from 5.21.1 to 5.22.0. - [Release notes](https://github.com/release-drafter/release-drafter/releases) - [Commits](https://github.com/release-drafter/release-drafter/compare/v5.21.1...v5.22.0) --- updated-dependencies: - dependency-name: release-drafter/release-drafter dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Daniel Gibbs --- .github/workflows/create-release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/create-release.yml b/.github/workflows/create-release.yml index e43f58c51..f543b2802 100644 --- a/.github/workflows/create-release.yml +++ b/.github/workflows/create-release.yml @@ -16,7 +16,7 @@ jobs: runs-on: ubuntu-latest steps: # Drafts your next Release notes as Pull Requests are merged into "master" - - uses: release-drafter/release-drafter@v5.21.1 + - uses: release-drafter/release-drafter@v5.22.0 with: config-name: release-drafter.yml env: From 357be101e2e6cc1c9bc8db169ad5688fa8ec476e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 16 Jan 2023 12:50:42 +0000 Subject: [PATCH 106/161] build(deps): bump dessant/lock-threads from 3 to 4 (#4049) * build(deps): bump release-drafter/release-drafter from 5.21.0 to 5.21.1 (#4006) Bumps [release-drafter/release-drafter](https://github.com/release-drafter/release-drafter) from 5.21.0 to 5.21.1. - [Release notes](https://github.com/release-drafter/release-drafter/releases) - [Commits](https://github.com/release-drafter/release-drafter/compare/v5.21.0...v5.21.1) --- updated-dependencies: - dependency-name: release-drafter/release-drafter dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * build(deps): bump webfactory/ssh-agent from 0.5.4 to 0.7.0 (#4009) Bumps [webfactory/ssh-agent](https://github.com/webfactory/ssh-agent) from 0.5.4 to 0.7.0. - [Release notes](https://github.com/webfactory/ssh-agent/releases) - [Changelog](https://github.com/webfactory/ssh-agent/blob/master/CHANGELOG.md) - [Commits](https://github.com/webfactory/ssh-agent/compare/v0.5.4...v0.7.0) --- updated-dependencies: - dependency-name: webfactory/ssh-agent dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * build(deps): bump dessant/lock-threads from 3 to 4 Bumps [dessant/lock-threads](https://github.com/dessant/lock-threads) from 3 to 4. - [Release notes](https://github.com/dessant/lock-threads/releases) - [Changelog](https://github.com/dessant/lock-threads/blob/master/CHANGELOG.md) - [Commits](https://github.com/dessant/lock-threads/compare/v3...v4) --- updated-dependencies: - dependency-name: dessant/lock-threads dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Daniel Gibbs --- .github/workflows/lock.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/lock.yml b/.github/workflows/lock.yml index 320b851a1..774f84364 100644 --- a/.github/workflows/lock.yml +++ b/.github/workflows/lock.yml @@ -14,7 +14,7 @@ jobs: pull-requests: write # for dessant/lock-threads to lock PRs runs-on: ubuntu-latest steps: - - uses: dessant/lock-threads@v3 + - uses: dessant/lock-threads@v4 with: github-token: ${{ secrets.GITHUB_TOKEN }} issue-comment: > From aa24fb9d50160014c40754cfdc20964f1d7d1107 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Mon, 16 Jan 2023 13:12:49 +0000 Subject: [PATCH 107/161] Rename trigger_docker_build.yml to trigger-docker-build.yml --- .../{trigger_docker_build.yml => trigger-docker-build.yml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/workflows/{trigger_docker_build.yml => trigger-docker-build.yml} (100%) diff --git a/.github/workflows/trigger_docker_build.yml b/.github/workflows/trigger-docker-build.yml similarity index 100% rename from .github/workflows/trigger_docker_build.yml rename to .github/workflows/trigger-docker-build.yml From 9a3e1d558d2226195a542133104510b33bcd5baa Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Wed, 18 Jan 2023 11:34:53 +0000 Subject: [PATCH 108/161] fix: correct : in monitor print messages --- lgsm/functions/command_monitor.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lgsm/functions/command_monitor.sh b/lgsm/functions/command_monitor.sh index 48d3d496a..0d6402942 100755 --- a/lgsm/functions/command_monitor.sh +++ b/lgsm/functions/command_monitor.sh @@ -131,7 +131,7 @@ fn_monitor_query() { # Server query OK. fn_print_ok "Querying port: ${querymethod}: ${queryip}:${queryport} : ${totalseconds}/${queryattempt}: " fn_print_ok_eol_nl - fn_script_log_pass "Querying port: ${querymethod}: ${queryip}:${queryport} : ${queryattempt}: OK" + fn_script_log_pass "Querying port: ${querymethod}: ${queryip}:${queryport} : ${queryattempt} : OK" monitorpass=1 if [ "${querystatus}" == "0" ]; then # Add query data to log. @@ -161,14 +161,14 @@ fn_monitor_query() { # Server query FAIL. fn_print_fail "Querying port: ${querymethod}: ${queryip}:${queryport} : ${totalseconds}/${queryattempt}: " fn_print_fail_eol - fn_script_log_warn "Querying port: ${querymethod}: ${queryip}:${queryport} : ${queryattempt}: FAIL" + fn_script_log_warn "Querying port: ${querymethod}: ${queryip}:${queryport} : ${queryattempt} : FAIL" # Monitor will try gamedig (if supported) for first 30s then gsquery before restarting. # gsquery will fail if longer than 60s if [ "${totalseconds}" -ge "59" ]; then # Monitor will FAIL if over 60s and trigger gane server reboot. fn_print_fail "Querying port: ${querymethod}: ${queryip}:${queryport} : ${totalseconds}/${queryattempt}: " fn_print_fail_eol_nl - fn_script_log_warn "Querying port: ${querymethod}: ${queryip}:${queryport} : ${queryattempt}: FAIL" + fn_script_log_warn "Querying port: ${querymethod}: ${queryip}:${queryport} : ${queryattempt} : FAIL" # Send alert if enabled. alert="restartquery" alert.sh @@ -180,7 +180,7 @@ fn_monitor_query() { done # Second counter will wait for 15s before breaking loop. for seconds in {1..15}; do - fn_print_fail "Querying port: ${querymethod}: ${ip}:${queryport} : ${totalseconds}/${queryattempt}: ${cyan}WAIT${default}" + fn_print_fail "Querying port: ${querymethod}: ${ip}:${queryport} : ${totalseconds}/${queryattempt} : ${cyan}WAIT${default}" sleep 0.5 totalseconds=$((totalseconds + 1)) if [ "${seconds}" == "15" ]; then From b901412f9d9cdae02bc8432dd07174c7a6f292bc Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Wed, 18 Jan 2023 11:35:11 +0000 Subject: [PATCH 109/161] chore: linting --- .github/workflows/labeler.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/labeler.yml b/.github/workflows/labeler.yml index 7526d2ce6..b63b8f462 100644 --- a/.github/workflows/labeler.yml +++ b/.github/workflows/labeler.yml @@ -13,9 +13,9 @@ jobs: issues: write # for github/issue-labeler to create or remove labels runs-on: ubuntu-latest steps: - - uses: github/issue-labeler@v2.5 - with: - repo-token: "${{ secrets.GITHUB_TOKEN }}" - configuration-path: .github/labeler.yml - not-before: - enable-versioned-regex: 0 + - uses: github/issue-labeler@v2.5 + with: + repo-token: "${{ secrets.GITHUB_TOKEN }}" + configuration-path: .github/labeler.yml + not-before: + enable-versioned-regex: 0 From 1fbb66d426fae792c1954b152355b1f543696f6e Mon Sep 17 00:00:00 2001 From: un-boxing-man Date: Thu, 2 Feb 2023 14:11:52 -0800 Subject: [PATCH 110/161] fix(rust): Support Rust query port needed after Feb 2nd! (#4048) * add query port to rust * fix variable in config * feat(docker): add docker image list to csv * Update _default.cfg fix server.queryport --------- Co-authored-by: Daniel Gibbs --- lgsm/config-default/config-lgsm/rustserver/_default.cfg | 3 ++- lgsm/functions/info_game.sh | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/lgsm/config-default/config-lgsm/rustserver/_default.cfg b/lgsm/config-default/config-lgsm/rustserver/_default.cfg index 7be5cd21d..d43a15152 100644 --- a/lgsm/config-default/config-lgsm/rustserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/rustserver/_default.cfg @@ -13,6 +13,7 @@ ip="0.0.0.0" port="28015" rconport="28016" appport=28082 +queryport=28017 rconpassword="CHANGE_ME" rconweb="1" # Value is: 1 for the Facepunch web panel, Rustadmin desktop and Rustadmin Online; 0 for RCON tools like Rusty. servername="Rust" @@ -27,7 +28,7 @@ saveinterval="300" # Auto-save in seconds. tickrate="30" # default: 30, range: 15-100. ## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters -startparameters="-batchmode +app.listenip ${ip} +app.port ${appport} +server.ip ${ip} +server.port ${port} +server.tickrate ${tickrate} +server.hostname \"${servername}\" +server.identity \"${selfname}\" +server.gamemode ${gamemode} +server.level \"${serverlevel}\" +server.seed ${seed} +server.salt ${salt} +server.maxplayers ${maxplayers} +server.worldsize ${worldsize} +server.saveinterval ${saveinterval} +rcon.web ${rconweb} +rcon.ip ${ip} +rcon.port ${rconport} +rcon.password \"${rconpassword}\" -logfile" +startparameters="-batchmode +app.listenip ${ip} +app.port ${appport} +server.ip ${ip} +server.port ${port} +server.queryport ${queryport} +server.tickrate ${tickrate} +server.hostname \"${servername}\" +server.identity \"${selfname}\" +server.gamemode ${gamemode} +server.level \"${serverlevel}\" +server.seed ${seed} +server.salt ${salt} +server.maxplayers ${maxplayers} +server.worldsize ${worldsize} +server.saveinterval ${saveinterval} +rcon.web ${rconweb} +rcon.ip ${ip} +rcon.port ${rconport} +rcon.password \"${rconpassword}\" -logfile" #### LinuxGSM Settings #### diff --git a/lgsm/functions/info_game.sh b/lgsm/functions/info_game.sh index 77169b3f3..66b9be5db 100644 --- a/lgsm/functions/info_game.sh +++ b/lgsm/functions/info_game.sh @@ -1462,7 +1462,7 @@ fn_info_game_rust() { # Parameters servername=${servername:-"NOT SET"} port=${port:-"0"} - queryport=${port:-"0"} + queryport=${queryport:-"0"} appport=${appport:-"0"} rconport=${rconport:-"0"} gamemode=${gamemode:-"NOT SET"} From a9ffd08d38415ea23271acdacc2c946716a61ec8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 2 Feb 2023 22:16:13 +0000 Subject: [PATCH 111/161] build(deps): bump github/issue-labeler from 2.5 to 2.6 (#4090) * feat(docker): add docker image list to csv * build(deps): bump github/issue-labeler from 2.5 to 2.6 Bumps [github/issue-labeler](https://github.com/github/issue-labeler) from 2.5 to 2.6. - [Release notes](https://github.com/github/issue-labeler/releases) - [Commits](https://github.com/github/issue-labeler/compare/v2.5...v2.6) --- updated-dependencies: - dependency-name: github/issue-labeler dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --------- Signed-off-by: dependabot[bot] Co-authored-by: Daniel Gibbs Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/labeler.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/labeler.yml b/.github/workflows/labeler.yml index b63b8f462..a1a90e6eb 100644 --- a/.github/workflows/labeler.yml +++ b/.github/workflows/labeler.yml @@ -13,9 +13,9 @@ jobs: issues: write # for github/issue-labeler to create or remove labels runs-on: ubuntu-latest steps: - - uses: github/issue-labeler@v2.5 - with: - repo-token: "${{ secrets.GITHUB_TOKEN }}" - configuration-path: .github/labeler.yml - not-before: - enable-versioned-regex: 0 + - uses: github/issue-labeler@v2.6 + with: + repo-token: "${{ secrets.GITHUB_TOKEN }}" + configuration-path: .github/labeler.yml + not-before: + enable-versioned-regex: 0 From d7545f67c390b66ea1116ff28f7d46ef00ce96c0 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Thu, 2 Feb 2023 22:19:39 +0000 Subject: [PATCH 114/161] Release v23.1.0 --- lgsm/functions/core_functions.sh | 2 +- linuxgsm.sh | 2 +- tests/tests_fctrserver.sh | 2 +- tests/tests_jc2server.sh | 2 +- tests/tests_mcserver.sh | 2 +- tests/tests_ts3server.sh | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lgsm/functions/core_functions.sh b/lgsm/functions/core_functions.sh index 4edd50ca7..05b52e243 100755 --- a/lgsm/functions/core_functions.sh +++ b/lgsm/functions/core_functions.sh @@ -8,7 +8,7 @@ functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" -modulesversion="v22.2.1" +modulesversion="v23.1.0" # Core diff --git a/linuxgsm.sh b/linuxgsm.sh index 3849ae68b..4344b68de 100755 --- a/linuxgsm.sh +++ b/linuxgsm.sh @@ -20,7 +20,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="v22.2.1" +version="v23.1.0" shortname="core" gameservername="core" commandname="CORE" diff --git a/tests/tests_fctrserver.sh b/tests/tests_fctrserver.sh index 2246bdeb1..0c1e02d67 100644 --- a/tests/tests_fctrserver.sh +++ b/tests/tests_fctrserver.sh @@ -20,7 +20,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="v22.2.1" +version="v23.1.0" shortname="fctr" gameservername="fctrserver" commandname="CORE" diff --git a/tests/tests_jc2server.sh b/tests/tests_jc2server.sh index e408420b8..62736d50b 100644 --- a/tests/tests_jc2server.sh +++ b/tests/tests_jc2server.sh @@ -20,7 +20,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="v22.2.1" +version="v23.1.0" shortname="jc2" gameservername="jc2server" commandname="CORE" diff --git a/tests/tests_mcserver.sh b/tests/tests_mcserver.sh index 984f522f0..6fe28715b 100644 --- a/tests/tests_mcserver.sh +++ b/tests/tests_mcserver.sh @@ -20,7 +20,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="v22.2.1" +version="v23.1.0" shortname="mc" gameservername="mcserver" commandname="CORE" diff --git a/tests/tests_ts3server.sh b/tests/tests_ts3server.sh index 6bc89c9fe..fa6d62283 100644 --- a/tests/tests_ts3server.sh +++ b/tests/tests_ts3server.sh @@ -20,7 +20,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="v22.2.1" +version="v23.1.0" shortname="ts3" gameservername="ts3server" commandname="CORE" From 6b73179e5d40112df16f9a8ace48e1123db19fbc Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Thu, 2 Feb 2023 23:48:38 +0000 Subject: [PATCH 115/161] fix: issue labeler Delete create-release.yml a --- .github/labeler.yml | 115 ++++++++++++++------------- .github/workflows/create-release.yml | 23 ------ .github/workflows/labeler.yml | 15 ++-- 3 files changed, 67 insertions(+), 86 deletions(-) delete mode 100644 .github/workflows/create-release.yml diff --git a/.github/labeler.yml b/.github/labeler.yml index 0ceeeae72..f9e0bd0aa 100644 --- a/.github/labeler.yml +++ b/.github/labeler.yml @@ -1,98 +1,99 @@ # Add/remove 'critical' label if issue contains the words 'urgent' or 'critical' -# Type -"type: game server request": - - "/(Server Request)/i" -"type: bug": - - "/(bug)/i" -"type: feature request": - - "/(feature)/i" + # Commands "command: backup": - - "/(backup)/i" + - "(backup)" "command: console": - - "/(console|tmux)/i" + - "(console|tmux)" "command: debug": - - "/(debug)/i" + - "(debug)" "command: details": - - "/(details)/i" + - "(details)" "command: fast-dl": - - "/(fast-dl|fastdl)/i" + - "(fast-dl|fastdl)" "command: install": - - "/(install)/i" + - "(install)" "command: mods": - - "/(mods)/i" + - "(mods)" "command: monitor": - - "/(monitor)/i" + - "(monitor)" "command: post-details": - - "/(post-details)/i" + - "(post-details)" "command: restart": - - "/(restart)/i" + - "(restart)" "command: send": - - "/(send)/i" + - "(send)" "command: skeleton": - - "/(skeleton)/i" + - "(skeleton)" "command: start": - - "/(start)/i" + - "(start)" "command: stop": - - "/(stop)/i" + - "(stop)" "command: update-lgsm": - - "/(update-lgsm)/i" + - "(update-lgsm)" "command: update": - - "/(update)/i" + - "(update)" "command: validate": - - "/(validate)/i" + - "(validate)" "command: wipe": - - "/(wipe)/i" + - "(wipe)" # Distros "distro: AlmaLinux": - - "/(Alma)/i" + - "(Alma)" "distro: Arch Linux": - - "/(Arch)/i" + - "(Arch)" "distro: CentOS": - - "/(CentOS)/i" + - "(CentOS)" "distro: Debian": - - "/(Debian)/i" + - "(Debian)" "distro: Fedora": - - "/(Fedora)/i" + - "(Fedora)" "distro: openSUSE": - - "/(openSUSE|suse)/i" + - "(openSUSE|suse)" "distro: Rocky Linux": - - "/(Rocky)/i" + - "(Rocky)" "distro: Slackware": - - "/(Slackware)/i" + - "(Slackware)" "distro: Ubuntu": - - "/(Ubuntu)/i" + - "(Ubuntu)" +# Games +"game: Ark: Survival Evolved": + - "(Ark: Survival Evolved|Ark)" +"game: ARMA 3": + - "(ARMA 3)" +"game: Assetto Corsa": + - "(Assetto Corsa)" +"game: Avorion": + - "(Avorion)" +"game: Ballistic Overkill": + - "(Ballistic Overkill)" +"game: Barotrauma": + - "(Barotrauma)" # Info "info: alerts": - - "/(alert)/i" + - "(alert)" "info: dependency": - - "/(dependency|deps)/i" + - "(dependency|deps)" "info: docker": - - "/(docker)/i" + - "(docker)" "info: docs": - - "/(documentation|docs)/i" + - "(documentation|docs)" "info: email": - - "/(postfix|sendmail|exim|smtp)/i" + - "(postfix|sendmail|exim|smtp)" "info: query": - - "/(gamedig|gsquery)/i" + - "(gamedig|gsquery)" "info: steamcmd": - - "/(steamcmd)/i" + - "(steamcmd)" "info: systemd": - - "/(systemd)/i" + - "(systemd)" "info: tmux": - - "/(tmux)/i" + - "(tmux)" "info: website": - - "/(website)/i" -# Games -"game: Ark: Survival Evolved": - - "/(Ark: Survival Evolved|Ark)/i" -"game: ARMA 3": - - "/(ARMA 3)/i" -"game: Assetto Corsa": - - "/(Assetto Corsa)/i" -"game: Avorion": - - "/(Avorion)/i" -"game: Ballistic Overkill": - - "/(Ballistic Overkill)/i" -"game: Barotrauma": - - "/(Barotrauma)/i" + - "(website)" +# Type +"type: game server request": + - "(Server Request)" +"type: bug": + - "(bug)" +"type: feature request": + - "(feature)" diff --git a/.github/workflows/create-release.yml b/.github/workflows/create-release.yml deleted file mode 100644 index f543b2802..000000000 --- a/.github/workflows/create-release.yml +++ /dev/null @@ -1,23 +0,0 @@ -name: Release Drafter - -on: - push: - # branches to consider in the event; optional, defaults to all - branches: - - master -permissions: - contents: read - -jobs: - update_release_draft: - permissions: - contents: write # for release-drafter/release-drafter to create a github release - pull-requests: write # for release-drafter/release-drafter to add label to PR - runs-on: ubuntu-latest - steps: - # Drafts your next Release notes as Pull Requests are merged into "master" - - uses: release-drafter/release-drafter@v5.22.0 - with: - config-name: release-drafter.yml - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/labeler.yml b/.github/workflows/labeler.yml index a1a90e6eb..07ec55677 100644 --- a/.github/workflows/labeler.yml +++ b/.github/workflows/labeler.yml @@ -2,6 +2,8 @@ name: "Issue Labeler" on: issues: types: [opened, edited] + pull_request: + types: [opened, edited] permissions: contents: read @@ -13,9 +15,10 @@ jobs: issues: write # for github/issue-labeler to create or remove labels runs-on: ubuntu-latest steps: - - uses: github/issue-labeler@v2.6 - with: - repo-token: "${{ secrets.GITHUB_TOKEN }}" - configuration-path: .github/labeler.yml - not-before: - enable-versioned-regex: 0 + - uses: github/issue-labeler@v2.6 + with: + repo-token: "${{ secrets.GITHUB_TOKEN }}" + configuration-path: .github/labeler.yml + not-before: + enable-versioned-regex: 0 + include-title: 1 From 9796d29ec59b34c50a2679060a8140d3643add58 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Fri, 3 Feb 2023 16:43:17 +0000 Subject: [PATCH 116/161] chore: make labels less sensitive --- .github/labeler.yml | 38 ++++++++++++++++++++------------------ 1 file changed, 20 insertions(+), 18 deletions(-) diff --git a/.github/labeler.yml b/.github/labeler.yml index f9e0bd0aa..ec30290ce 100644 --- a/.github/labeler.yml +++ b/.github/labeler.yml @@ -2,41 +2,41 @@ # Commands "command: backup": - - "(backup)" + - "(command: backup)" "command: console": - - "(console|tmux)" + - "(command: console|tmux)" "command: debug": - - "(debug)" + - "(command: debug)" "command: details": - - "(details)" + - "(command: details)" "command: fast-dl": - - "(fast-dl|fastdl)" + - "(command: fast-dl|fastdl|fast-dl)" "command: install": - - "(install)" + - "(command: install)" "command: mods": - - "(mods)" + - "(command: mods)" "command: monitor": - - "(monitor)" + - "(command: monitor|monitor)" "command: post-details": - - "(post-details)" + - "(command: post-details|post-details)" "command: restart": - - "(restart)" + - "(command: restart)" "command: send": - - "(send)" + - "(command: send)" "command: skeleton": - - "(skeleton)" + - "(command: skeleton)" "command: start": - - "(start)" + - "(command: start)" "command: stop": - - "(stop)" + - "(command: stop)" "command: update-lgsm": - - "(update-lgsm)" + - "(command: update-lgsm|update-lgsm)" "command: update": - - "(update)" + - "(command: update)" "command: validate": - - "(validate)" + - "(command: validate)" "command: wipe": - - "(wipe)" + - "(command: wipe)" # Distros "distro: AlmaLinux": - "(Alma)" @@ -69,6 +69,8 @@ - "(Ballistic Overkill)" "game: Barotrauma": - "(Barotrauma)" +"game: Black Mesa": + - "(Black Mesa)" # Info "info: alerts": - "(alert)" From 9db0c2d11d0cd56a1970a13fcdc29138a93dcf3c Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Thu, 9 Feb 2023 15:48:45 +0000 Subject: [PATCH 117/161] chore: increase duplicate threshold --- .github/workflows/potential-duplicates.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/potential-duplicates.yml b/.github/workflows/potential-duplicates.yml index 47356dba8..f1e783674 100644 --- a/.github/workflows/potential-duplicates.yml +++ b/.github/workflows/potential-duplicates.yml @@ -20,7 +20,7 @@ jobs: # Get issues with state to compare. Supported state: 'all', 'closed', 'open'. state: all # If similarity is higher than this threshold([0,1]), issue will be marked as duplicate. - threshold: 0.6 + threshold: 0.8 # Reactions to be add to comment when potential duplicates are detected. # Available reactions: "-1", "+1", "confused", "laugh", "heart", "hooray", "rocket", "eyes" #reactions: 'eyes, confused' From ec3605624ad02a5050ce35d89432402efc2e859e Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Thu, 9 Feb 2023 17:39:20 +0000 Subject: [PATCH 118/161] chore: fix labeler a a --- .github/labeler.yml | 21 ++++++++------------- .github/workflows/labeler.yml | 2 +- 2 files changed, 9 insertions(+), 14 deletions(-) diff --git a/.github/labeler.yml b/.github/labeler.yml index ec30290ce..a105a8c57 100644 --- a/.github/labeler.yml +++ b/.github/labeler.yml @@ -1,24 +1,21 @@ -# Add/remove 'critical' label if issue contains the words 'urgent' or 'critical' - -# Commands "command: backup": - - "(command: backup)" + - "(backup)" "command: console": - - "(command: console|tmux)" + - "(console|tmux)" "command: debug": - "(command: debug)" "command: details": - "(command: details)" "command: fast-dl": - - "(command: fast-dl|fastdl|fast-dl)" + - "(fast-dl|fastdl)" "command: install": - "(command: install)" "command: mods": - "(command: mods)" "command: monitor": - - "(command: monitor|monitor)" + - "(command: monitor)" "command: post-details": - - "(command: post-details|post-details)" + - "(command: post-details)" "command: restart": - "(command: restart)" "command: send": @@ -30,13 +27,13 @@ "command: stop": - "(command: stop)" "command: update-lgsm": - - "(command: update-lgsm|update-lgsm)" + - "(update-lgsm)" "command: update": - "(command: update)" "command: validate": - - "(command: validate)" + - "(validate)" "command: wipe": - - "(command: wipe)" + - "(wipe)" # Distros "distro: AlmaLinux": - "(Alma)" @@ -69,8 +66,6 @@ - "(Ballistic Overkill)" "game: Barotrauma": - "(Barotrauma)" -"game: Black Mesa": - - "(Black Mesa)" # Info "info: alerts": - "(alert)" diff --git a/.github/workflows/labeler.yml b/.github/workflows/labeler.yml index 07ec55677..b5bb38498 100644 --- a/.github/workflows/labeler.yml +++ b/.github/workflows/labeler.yml @@ -15,7 +15,7 @@ jobs: issues: write # for github/issue-labeler to create or remove labels runs-on: ubuntu-latest steps: - - uses: github/issue-labeler@v2.6 + - uses: github/issue-labeler@v2.5 with: repo-token: "${{ secrets.GITHUB_TOKEN }}" configuration-path: .github/labeler.yml From a181b2d56a5c04c44d2c2a9807911d21532a985f Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Thu, 9 Feb 2023 23:07:20 +0000 Subject: [PATCH 119/161] chore: update issue templates --- .github/ISSUE_TEMPLATE/bug-report.md | 50 ----------- .github/ISSUE_TEMPLATE/bug_report.yml | 95 ++++++++++++++++++++ .github/ISSUE_TEMPLATE/config.yml | 8 ++ .github/ISSUE_TEMPLATE/feature-request.md | 43 --------- .github/ISSUE_TEMPLATE/feature_request.yml | 78 ++++++++++++++++ .github/ISSUE_TEMPLATE/new-server-request.md | 31 ------- .github/ISSUE_TEMPLATE/server_request.yml | 57 ++++++++++++ .github/labeler.yml | 2 +- .github/workflows/trigger-docker-build.yml | 6 +- 9 files changed, 242 insertions(+), 128 deletions(-) delete mode 100644 .github/ISSUE_TEMPLATE/bug-report.md create mode 100644 .github/ISSUE_TEMPLATE/bug_report.yml create mode 100644 .github/ISSUE_TEMPLATE/config.yml delete mode 100644 .github/ISSUE_TEMPLATE/feature-request.md create mode 100644 .github/ISSUE_TEMPLATE/feature_request.yml delete mode 100644 .github/ISSUE_TEMPLATE/new-server-request.md create mode 100644 .github/ISSUE_TEMPLATE/server_request.yml diff --git a/.github/ISSUE_TEMPLATE/bug-report.md b/.github/ISSUE_TEMPLATE/bug-report.md deleted file mode 100644 index f0b071753..000000000 --- a/.github/ISSUE_TEMPLATE/bug-report.md +++ /dev/null @@ -1,50 +0,0 @@ ---- -name: Bug Report -about: Found a bug? Raise a report. -title: "[BUG]" -labels: "type: bug" -assignees: "" ---- - -Issues raised here are **ONLY** for: - -- LinuxGSM bugs. -- Feature suggestions. -- Code contributions. - -Issues raised here are **NOT** for: - -- General support. -- Specific game server issues (e.g CS:GO, TF2). -- Dedicated server issues (e.g Ubuntu, CentOS). -- Anything not directly related to LinuxGSM development. - -For general support visit the **[LinuxGSM-Support](https://linuxgsm.com/support)**. - -**_Please use the template below, deleting the above text_** - -## User Story - -As a [user description], I want [desired action] so that [desired outcome]. - -## Basic info - -- **Distro:** [Ubuntu 18.04] -- **Game:** [Garry's Mod] -- **Command:** [Monitor] -- **LinuxGSM version:** [v20.1.3] - -## Further Information - -A clear description of what the bug is and any ideas on how to resolve it. Plus any further context that might be relevant to the issue. - -## To Reproduce - -Steps to reproduce the behaviour: - -1. Go to '...' -2. Click on '....' -3. Scroll down to '....' -4. See error - -## Expected behaviour diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml new file mode 100644 index 000000000..f0837b108 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -0,0 +1,95 @@ +--- +name: Bug Report +description: File a bug report +title: "[Bug]: " +labels: ["type: bug"] +body: + - type: markdown + attributes: + value: | + Thanks for taking the time to fill out this bug report! + - type: input + id: user-story + attributes: + label: User story + description: As a [user description], I want [desired action] so that [desired outcome]. + placeholder: As a [user description], I want [desired action] so that [desired outcome]. + validations: + required: true + - type: input + id: game + attributes: + label: Game + description: What game server are you hosting? + placeholder: Valheim + validations: + required: true + - type: dropdown + id: distro + attributes: + label: Linux distro + multiple: true + options: + - Ubuntu 22.04 + - Ubuntu 20.04 + - Ubuntu 18.04 + - Ubuntu 16.04 + - Debian 11 + - Debian 10 + - Debian 9 + - RedHat 9 + - RedHat 8 + - RedHat 7 + - Other + validations: + required: true + - type: dropdown + id: command + attributes: + label: Command + multiple: true + options: + - "command: start" + - "command: stop" + - "command: restart" + - "command: monitor" + - "command: details" + - "command: update" + - "command: validate" + - "command: backup" + - "command: mods-install" + - "command: mods-update" + - "command: mods-remove" + - "command: debug" + - "command: console" + - "command: install" + - "command: auto-update" + - "command: update-lgsm" + - "command: wipe" + - "command: send" + validations: + required: true + - type: textarea + id: further-info + attributes: + label: Further information + description: A clear description of what the bug is, any ideas on how to resolve it and any further context that might be relevant to the issue. + placeholder: Tell us what you see! + validations: + required: true + - type: textarea + id: logs + attributes: + label: Relevant log output + description: Please copy and paste any relevant log output. This will be automatically formatted into code, so no need for backticks. + render: shell + - type: textarea + id: steps + attributes: + label: Steps to reproduce + description: Steps to reproduce the behaviour. + placeholder: | + 1. Go to '...' + 2. Click on '....' + 3. Scroll down to '....' + 4. See error diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 000000000..d2113c6ca --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1,8 @@ +blank_issues_enabled: false +contact_links: + - name: Ask a question + about: Ask questions and discuss with other users of LinuxGSM. + url: https://github.com/GameServerManagers/LinuxGSM/discussions + - name: Discord Server + about: Join the LinuxGSM Discord community server. Discuss your LinuxGSM setup, get help and advice + url: https://linuxgsm.com/discord diff --git a/.github/ISSUE_TEMPLATE/feature-request.md b/.github/ISSUE_TEMPLATE/feature-request.md deleted file mode 100644 index 992178f07..000000000 --- a/.github/ISSUE_TEMPLATE/feature-request.md +++ /dev/null @@ -1,43 +0,0 @@ ---- -name: Feature Request -about: Suggest an idea for LinuxGSM. -title: "[FEATURE]" -labels: "type: feature request" -assignees: "" ---- - -Issues raised here are **ONLY** for: - -- LinuxGSM bugs. -- Feature suggestions. -- Code contributions. - -Issues raised here are **NOT** for: - -- General support. -- Specific game server issues (e.g CS:GO, TF2). -- Dedicated server issues (e.g Ubuntu, CentOS). -- Anything not directly related to LinuxGSM development. - -For general support visit the **[LinuxGSM Support](https://linuxgsm.com/support)** page. - -**_Please use the template below, deleting the above text_** - -## User Story - -As a [user description], I want [desired action] so that [desired outcome]. - -## Basic info - -- **Distro:** [Ubuntu 20.04] -- **Game:** [Garry's Mod] -- **Command:** [Monitor] -- **LinuxGSM version:** [v20.1.3] - -## Further Information - -A clear description of what the feature is and any ideas on how to achieve this. - -## Further Reading - -Provide any useful documentation or resources that might help. diff --git a/.github/ISSUE_TEMPLATE/feature_request.yml b/.github/ISSUE_TEMPLATE/feature_request.yml new file mode 100644 index 000000000..fb06052ac --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.yml @@ -0,0 +1,78 @@ +--- +name: Feature Request +description: Suggest a feature +title: "[Feature]: " +labels: ["type: feature"] +body: + - type: markdown + attributes: + value: | + Thanks for taking the time to fill out this feature request! + - type: input + id: user-story + attributes: + label: User story + description: As a [user description], I want [desired action] so that [desired outcome]. + placeholder: As a [user description], I want [desired action] so that [desired outcome]. + validations: + required: true + - type: input + id: game + attributes: + label: Game + description: What game server are you hosting? + placeholder: Valheim + validations: + required: false + - type: dropdown + id: distro + attributes: + label: Linux distro + multiple: true + options: + - Ubuntu 22.04 + - Ubuntu 20.04 + - Ubuntu 18.04 + - Ubuntu 16.04 + - Debian 11 + - Debian 10 + - Debian 9 + - RedHat 9 + - RedHat 8 + - RedHat 7 + - Other + validations: + required: false + - type: dropdown + id: command + attributes: + label: Command + multiple: true + options: + - "command: start" + - "command: stop" + - "command: restart" + - "command: monitor" + - "command: details" + - "command: update" + - "command: validate" + - "command: backup" + - "command: mods-install" + - "command: mods-update" + - "command: mods-remove" + - "command: debug" + - "command: console" + - "command: install" + - "command: auto-update" + - "command: update-lgsm" + - "command: wipe" + - "command: send" + validations: + required: true + - type: textarea + id: further-info + attributes: + label: Further information + description: A clear description of what the feature is and any ideas on how to achieve this. + validations: + required: true diff --git a/.github/ISSUE_TEMPLATE/new-server-request.md b/.github/ISSUE_TEMPLATE/new-server-request.md deleted file mode 100644 index bedc4f506..000000000 --- a/.github/ISSUE_TEMPLATE/new-server-request.md +++ /dev/null @@ -1,31 +0,0 @@ ---- -name: New Server Request -about: Suggest a new game server to be added. -title: "[Server Request]" -labels: "type: game server request" -assignees: "" ---- - -## What game server would you like to add? - -[game server] - -## Can you link to any tutorials or guides? - -Provide any useful documentation or resources that might help. - -## Is the server on Steam? - -- [ ] Yes -- [ ] No - -If yes Use SteamDB to get the appid. (https://steamdb.info). - -[appid] - -## Is the server supported on Linux? - -We only support Linux servers and do **not** support Wine. - -- [ ] Yes -- [ ] No diff --git a/.github/ISSUE_TEMPLATE/server_request.yml b/.github/ISSUE_TEMPLATE/server_request.yml new file mode 100644 index 000000000..31dbc6b81 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/server_request.yml @@ -0,0 +1,57 @@ +--- +name: Server Request +description: Suggest a new game server to be added +title: "[Server Request]: " +labels: ["type: game server request"] +body: + - type: markdown + attributes: + value: | + Thanks for taking the time to fill out this game server! + - type: input + id: game-server + attributes: + label: Game server + description: What game server would you like to add? + validations: + required: true + - type: checkboxes + id: on-linux + attributes: + label: Linux support + description: Does this game server have Linux support? (not wine) + options: + - label: "Yes" + validations: + required: true + - type: dropdown + id: on-steam + attributes: + label: Steam + description: Is this game server available on Steam? + options: + - "Yes" + - "No" + validations: + required: true + - type: input + id: steam-id + attributes: + label: Steam appid + description: What is the Steam appid of the game server? Use SteamDB to get the appid. (https://steamdb.info). + placeholder: "892970" + validations: + required: false + - type: textarea + id: guides + attributes: + label: Guides + description: Links to guides on how to install the game server + - type: checkboxes + id: terms + attributes: + label: Code of Conduct + description: By submitting this issue, you agree to follow our [Code of Conduct](https://example.com) + options: + - label: I agree to follow this project's Code of Conduct + required: true diff --git a/.github/labeler.yml b/.github/labeler.yml index a105a8c57..a55e62006 100644 --- a/.github/labeler.yml +++ b/.github/labeler.yml @@ -9,7 +9,7 @@ "command: fast-dl": - "(fast-dl|fastdl)" "command: install": - - "(command: install)" + - "(install)" "command: mods": - "(command: mods)" "command: monitor": diff --git a/.github/workflows/trigger-docker-build.yml b/.github/workflows/trigger-docker-build.yml index 697511816..adb43343f 100644 --- a/.github/workflows/trigger-docker-build.yml +++ b/.github/workflows/trigger-docker-build.yml @@ -1,8 +1,8 @@ name: Trigger Docker Build on: - push: - branches: - - master + release: + types: + - published jobs: trigger_build_docker-linuxgsm: name: Trigger Build docker-linuxgsm From 40fc154fafa5ee4e4d16d45ee94cd6d11d5c5b58 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Fri, 10 Feb 2023 09:58:24 +0000 Subject: [PATCH 120/161] chore: minor grammar updates --- .github/pull_request_template.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index a0c40a150..4e6d08327 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -7,7 +7,7 @@ Fixes #[issue] ## Type of change - [ ] Bug fix (a change which fixes an issue). -- [ ] New feature (change which adds functionality). +- [ ] New feature (a change which adds functionality). - [ ] New Server (new server added). - [ ] Refactor (restructures existing code). - [ ] Comment update (typo, spelling, explanation, examples, etc). @@ -18,12 +18,12 @@ PR will not be merged until all steps are complete. - [ ] This pull request links to an issue. - [ ] This pull request uses the `develop` branch as its base. -- [ ] This pull request Subject follows the Conventional Commits standard. +- [ ] This pull request subject follows the Conventional Commits standard. - [ ] This code follows the style guidelines of this project. - [ ] I have performed a self-review of my code. - [ ] I have checked that this code is commented where required. -- [ ] I have provided a detailed with enough description of this PR. -- [ ] I have checked If documentation needs updating. +- [ ] I have provided a detailed enough description of this PR. +- [ ] I have checked if documentation needs updating. ## Documentation From 7f6147f27945cba19b3b6fd43188b1113f348c23 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Fri, 10 Feb 2023 13:10:09 +0000 Subject: [PATCH 121/161] chore: make labeler case insensitive --- .github/labeler.yml | 156 +++++++++++++++++++++++++++++++------------- 1 file changed, 110 insertions(+), 46 deletions(-) diff --git a/.github/labeler.yml b/.github/labeler.yml index a55e62006..1ec662f2b 100644 --- a/.github/labeler.yml +++ b/.github/labeler.yml @@ -1,96 +1,160 @@ "command: backup": - - "(backup)" + - "/(backup)/i" "command: console": - - "(console|tmux)" + - "/(console|tmux)/i" "command: debug": - - "(command: debug)" + - "/(command: debug)/i" "command: details": - - "(command: details)" + - "/(command: details)/i" "command: fast-dl": - - "(fast-dl|fastdl)" + - "/(fast-dl|fastdl)/i" "command: install": - - "(install)" + - "/(install)/i" "command: mods": - - "(command: mods)" + - "/(command: mods)/i" "command: monitor": - - "(command: monitor)" + - "/(command: monitor)/i" "command: post-details": - - "(command: post-details)" + - "/(command: post-details)/i" "command: restart": - - "(command: restart)" + - "/(command: restart)/i" "command: send": - - "(command: send)" + - "/(command: send)/i" "command: skeleton": - - "(command: skeleton)" + - "/(command: skeleton)/i" "command: start": - - "(command: start)" + - "/(command: start)/i" "command: stop": - - "(command: stop)" + - "/(command: stop)/i" "command: update-lgsm": - - "(update-lgsm)" + - "/(update-lgsm)/i" "command: update": - - "(command: update)" + - "/(command: update)/i" "command: validate": - - "(validate)" + - "/(validate)/i" "command: wipe": - - "(wipe)" + - "/(wipe)/i" + # Distros "distro: AlmaLinux": - - "(Alma)" + - "/(Alma)/i" "distro: Arch Linux": - - "(Arch)" + - "/(Arch Linux)/i" "distro: CentOS": - - "(CentOS)" + - "/(CentOS)/i" "distro: Debian": - - "(Debian)" + - "/(Debian)/i" "distro: Fedora": - - "(Fedora)" + - "/(Fedora)/i" "distro: openSUSE": - - "(openSUSE|suse)" + - "/(openSUSE|suse)/i" "distro: Rocky Linux": - - "(Rocky)" + - "/(Rocky)/i" "distro: Slackware": - - "(Slackware)" + - "/(Slackware)/i" "distro: Ubuntu": - - "(Ubuntu)" + - "/(Ubuntu)/i" + # Games +"game: 7 Days to Die": + - "/(7 Days to Die|sdtd)/i" "game: Ark: Survival Evolved": - - "(Ark: Survival Evolved|Ark)" + - "/(Ark: Survival Evolved|Ark)/i" "game: ARMA 3": - - "(ARMA 3)" + - "/(ARMA 3|ARMA3)/i" "game: Assetto Corsa": - - "(Assetto Corsa)" + - "/(Assetto Corsa)/i" "game: Avorion": - - "(Avorion)" + - "/(Avorion)/i" "game: Ballistic Overkill": - - "(Ballistic Overkill)" + - "/(Ballistic Overkill)/i" +"game: Battalion 1944": + - "/(Battalion 1944)/i" "game: Barotrauma": - - "(Barotrauma)" + - "/(Barotrauma)/i" +"game: Counter-Strike: Global Offensive": + - "/(Counter-Strike: Global Offensive|CS:GO|csgo)/i" +"game: Counter-Strike: Source": + - "/(Counter-Strike: Source|CS:S)/i" +"game: Counter-Strike 1.6": + - "/(Counter-Strike 1.6|Counter Strike 1.6|CS 1.6|cs1.6)/i" +"game: Dayz": + - "/(Dayz)/i" +"game: Don't Starve Together": + - "/(Don't Starve Together|Dont Starve Together|DST)/i" +"game: Eco": + - "/(^Eco$)/i" +"game: Factorio": + - "/(Factorio)/i" +"game: Garry's Mod": + - "/(Garry's Mod|Garrys Mod|GMod)/i" +"game: Insurgency: Sandstorm": + - "/(Insurgency: Sandstorm|Insurgency)/i" +"game: Killing Floor 2": + - "/(Killing Floor 2|KF2)/i" +"game: Left 4 Dead 2": + - "/(Left 4 Dead 2|L4D2)/i" +"game: Minecraft": + - "/(minecraft)((?!bedrock).)*$/i" +"game: Minecraft Bedrock": + - "/(Bedrock)/i" +"game: Mumble": + - "/(Mumble)/i" +"game: Project Zomboid": + - "/(Project Zomboid)/i" +"game: Quake 3": + - "/(Quake 3|Q3A|q3)/i" +"game: Rising World": + - "/(Rising World)/i" +"game: Satisfactory": + - "/(Satisfactory)/i" +"game: Squad": + - "/(Squad)/i" +"game: Starbound": + - "/(Starbound)/i" +"game: Stationeers": + - "/(Stationeers)/i" +"game: Teamspeak 3": + - "/(Teamspeak 3|ts3)/i" +"game: Rust": + - "/(Rust)/i" +"game: Unturned": + - "/(Unturned)/i" +"game: Unreal Tournament 99": + - "/(Unreal Tournament 99|ut99)/i" +"game: Unreal Tournament 2004": + - "/(Unreal Tournament 2004|ut2k4)/i" +"game: Unreal Tournament 3": + - "/(Unreal Tournament 3|ut3)/i" +"game: Valheim": + - "/(Valheim)/i" + # Info "info: alerts": - - "(alert)" + - "/(alert)/i" "info: dependency": - - "(dependency|deps)" + - "/(dependency|deps)/i" "info: docker": - - "(docker)" + - "/(docker)/i" "info: docs": - - "(documentation|docs)" + - "/(documentation|^docs$)/i" "info: email": - - "(postfix|sendmail|exim|smtp)" + - "/(postfix|sendmail|exim|smtp)/i" "info: query": - - "(gamedig|gsquery)" + - "/(gamedig|gsquery)/i" "info: steamcmd": - - "(steamcmd)" + - "/(steamcmd)/i" "info: systemd": - - "(systemd)" + - "/(systemd)/i" "info: tmux": - - "(tmux)" + - "/(tmux)/i" "info: website": - - "(website)" + - "/(website)/i" + # Type "type: game server request": - - "(Server Request)" + - "/(Server Request)/i" "type: bug": - - "(bug)" + - "/(bug)/i" "type: feature request": - - "(feature)" + - "/(feature)/i" From 227343c9908ec56a4f524497b5b2ec9ebad03f0e Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Thu, 16 Feb 2023 22:00:52 +0000 Subject: [PATCH 122/161] feat(debug): add press return to exit debug Since terminal is reset on debug exit this will allow user to see output before this happens. --- lgsm/functions/command_debug.sh | 21 +++++++++++++++++---- lgsm/functions/fix_steamcmd.sh | 4 ++-- 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/lgsm/functions/command_debug.sh b/lgsm/functions/command_debug.sh index 190a8c527..c6422be65 100755 --- a/lgsm/functions/command_debug.sh +++ b/lgsm/functions/command_debug.sh @@ -28,7 +28,6 @@ check.sh fix.sh info_distro.sh info_game.sh -# NOTE: Check if works with server without parms. Could be intergrated in to info_parms.sh. fn_print_header { echo -e "${lightblue}Distro:\t\t${default}${distroname}" @@ -40,8 +39,9 @@ fn_print_header echo -e "${lightblue}Free Memory:\t\t${default}${physmemfree}" echo -e "${lightblue}Free Disk:\t\t${default}${availspace}" } | column -s $'\t' -t + # glibc required. -if [ "${glibc}" ]; then +if [ -n "${glibc}" ]; then if [ "${glibc}" == "null" ]; then # Glibc is not required. : @@ -54,7 +54,7 @@ if [ "${glibc}" ]; then fi fi -# Server IP +# Server IP. echo -e "${lightblue}Game Server IP:\t${default}${ip}:${port}" # External server IP. @@ -63,6 +63,7 @@ if [ "${extip}" ]; then echo -e "${lightblue}Internet IP:\t${default}${extip}:${port}" fi fi + # Server password. if [ "${serverpassword}" ]; then echo -e "${lightblue}Server password:\t${default}${serverpassword}" @@ -78,7 +79,7 @@ else echo -e "${preexecutable} ${executable} ${startparameters}" fi echo -e "" -echo -e "Use for identifying server issues only!" +echo -e "Use debug for identifying server issues only!" echo -e "Press CTRL+c to drop out of debug mode." fn_print_warning_nl "If ${selfname} is already running it will be stopped." echo -e "" @@ -120,6 +121,18 @@ 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: $?" + fn_print_error_nl "Press ENTER to exit debug mode" + read -r +else + fn_print_ok_nl "Server has stopped" + fn_script_log_pass "Server has stopped" + fn_print_ok_nl "Press ENTER to exit debug mode" + read -r +fi + fn_lockfile_trap fn_print_dots "Stopping debug" diff --git a/lgsm/functions/fix_steamcmd.sh b/lgsm/functions/fix_steamcmd.sh index 0162a6495..9644208dc 100755 --- a/lgsm/functions/fix_steamcmd.sh +++ b/lgsm/functions/fix_steamcmd.sh @@ -56,7 +56,7 @@ steamclientsdk64="${steamsdk64}/steamclient.so" # remove any old unlinked versions of steamclient.so if [ -f "${steamclientsdk64}" ]; then if [ "$(stat -c '%h' "${steamclientsdk64}")" -eq 1 ]; then - fixname="steamclient.so sdk64 -- remove old file" + fixname="steamclient.so sdk64 - remove old file" fn_fix_msg_start rm -f "${steamclientsdk64}" fn_fix_msg_end @@ -87,7 +87,7 @@ steamsdk32="${HOME}/.steam/sdk32" steamclientsdk32="${HOME}/.steam/sdk32/steamclient.so" if [ -f "${steamclientsdk32}" ]; then if [ " $(stat -c '%h' "${steamclientsdk32}")" -eq 1 ]; then - fixname="steamclient.so sdk32 -- remove old file" + fixname="steamclient.so sdk32 - remove old file" fn_fix_msg_start rm -f "${steamclientsdk32}" fn_fix_msg_end From ccb216ecda3d2bd639ca81b0f68bb7c112607967 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Thu, 16 Feb 2023 22:17:15 +0000 Subject: [PATCH 123/161] fix: selecting branch instead of version when getting modules --- linuxgsm.sh | 11 +- package-lock.json | 222 ++++---------------------------------- tests/tests_kcov.sh | 14 --- tests/tests_shellcheck.sh | 32 ------ 4 files changed, 21 insertions(+), 258 deletions(-) delete mode 100644 tests/tests_kcov.sh delete mode 100644 tests/tests_shellcheck.sh diff --git a/linuxgsm.sh b/linuxgsm.sh index 4344b68de..a0eb306f6 100755 --- a/linuxgsm.sh +++ b/linuxgsm.sh @@ -1,7 +1,7 @@ #!/bin/bash # Project: Linux Game Server Managers - LinuxGSM # Author: Daniel Gibbs -# License: MIT License, Copyright (c) 2020 Daniel Gibbs +# License: MIT License, see LICENSE.md # Purpose: Linux Game Server Management Script # Contributors: https://linuxgsm.com/contrib # Documentation: https://docs.linuxgsm.com @@ -167,8 +167,8 @@ fn_bootstrap_fetch_file() { fn_bootstrap_fetch_file_github() { github_file_url_dir="${1}" github_file_url_name="${2}" - # If master branch will currently running LinuxGSM version to prevent "version mixing". This is ignored if a fork. - if [ "${githubbranch}" == "master" ] && [ "${githubuser}" == "GameServerManager" ] && [ "${commandname}" != "UPDATE-LGSM" ]; then + # By default modules will be downloaded from the version release to prevent potential version mixing. Only update-lgsm will allow an update. + if [ "${githubbranch}" == "master" ] && [ "${githubuser}" == "GameServerManagers" ] && [ "${commandname}" != "UPDATE-LGSM" ]; then remote_fileurl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${version}/${github_file_url_dir}/${github_file_url_name}" remote_fileurl_backup="https://bitbucket.org/${githubuser}/${githubrepo}/raw/${version}/${github_file_url_dir}/${github_file_url_name}" else @@ -512,9 +512,4 @@ else # Enables ANSI colours from core_messages.sh. Can be disabled with ansi=off. fn_ansi_loader - # Prevents running of core_exit.sh for Travis-CI. - if [ "${travistest}" != "1" ]; then - getopt=$1 - core_getopt.sh - fi fi diff --git a/package-lock.json b/package-lock.json index d0deca3ec..b592f5bea 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "linuxgsm", - "lockfileVersion": 2, + "lockfileVersion": 3, "requires": true, "packages": { "": { @@ -12,9 +12,9 @@ } }, "node_modules/@pkgr/utils": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/@pkgr/utils/-/utils-2.3.0.tgz", - "integrity": "sha512-7dIJ9CRVzBnqyEl7diUHPUFJf/oty2SeoVzcMocc5PeOUDK9KGzvgIBjGRRzzlRDaOjh3ADwH0WeibQvi3ls2Q==", + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/@pkgr/utils/-/utils-2.3.1.tgz", + "integrity": "sha512-wfzX8kc1PMyUILA+1Z/EqoE4UCXGy0iRGMhPwdfae1+f0OXlLqCk+By+aMzgJBzR9AzS4CDizioG6Ss1gvAFJw==", "dev": true, "dependencies": { "cross-spawn": "^7.0.3", @@ -127,9 +127,9 @@ "dev": true }, "node_modules/open": { - "version": "8.4.0", - "resolved": "https://registry.npmjs.org/open/-/open-8.4.0.tgz", - "integrity": "sha512-XgFPPM+B28FtCCgSb9I+s9szOC1vZRSwgWsRUA5ylIxRTgKozqjOCrVOqGsYABPYK5qnfqClxZTFBa8PKt2v6Q==", + "version": "8.4.1", + "resolved": "https://registry.npmjs.org/open/-/open-8.4.1.tgz", + "integrity": "sha512-/4b7qZNhv6Uhd7jjnREh1NjnPxlTq+XNWPG88Ydkj5AILcA5m3ajvcg57pB24EQjKv0dK62XnDqk9c/hkIG5Kg==", "dev": true, "dependencies": { "define-lazy-prop": "^2.0.0", @@ -159,9 +159,9 @@ "dev": true }, "node_modules/prettier": { - "version": "2.7.1", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.7.1.tgz", - "integrity": "sha512-ujppO+MkdPqoVINuDFDRLClm7D78qbDt0/NR+wp5FqEZOoTNAjPHWj17QRhu7geIHJfcNhRk1XVQmF8Bp3ye+g==", + "version": "2.8.4", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.4.tgz", + "integrity": "sha512-vIS4Rlc2FNh0BySk3Wkd6xmwxB0FpOndW5fisM5H8hsZSxU2VWVB5CWIkIjWvrHjIhxk2g3bfMKM87zNTrZddw==", "dev": true, "bin": { "prettier": "bin-prettier.js" @@ -230,13 +230,13 @@ } }, "node_modules/synckit": { - "version": "0.8.3", - "resolved": "https://registry.npmjs.org/synckit/-/synckit-0.8.3.tgz", - "integrity": "sha512-1goXnDYNJlKwCM37f5MTzRwo+8SqutgVtg2d37D6YnHHT4E3IhQMRfKiGdfTZU7LBlI6T8inCQUxnMBFHrbqWw==", + "version": "0.8.5", + "resolved": "https://registry.npmjs.org/synckit/-/synckit-0.8.5.tgz", + "integrity": "sha512-L1dapNV6vu2s/4Sputv8xGsCdAVlb5nRDMFU/E27D44l5U6cw1g0dGd45uLc+OXjNMmF4ntiMdCimzcjFKQI8Q==", "dev": true, "dependencies": { - "@pkgr/utils": "^2.3.0", - "tslib": "^2.4.0" + "@pkgr/utils": "^2.3.1", + "tslib": "^2.5.0" }, "engines": { "node": "^14.18.0 || >=16.0.0" @@ -256,9 +256,9 @@ } }, "node_modules/tslib": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.0.tgz", - "integrity": "sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ==", + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.5.0.tgz", + "integrity": "sha512-336iVw3rtn2BUK7ORdIAHTyxHGRIHVReokCR3XjbckJMK7ms8FysBfhLR8IXnAgy7T0PTPNBWKiH514FOW/WSg==", "dev": true }, "node_modules/which": { @@ -276,191 +276,5 @@ "node": ">= 8" } } - }, - "dependencies": { - "@pkgr/utils": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/@pkgr/utils/-/utils-2.3.0.tgz", - "integrity": "sha512-7dIJ9CRVzBnqyEl7diUHPUFJf/oty2SeoVzcMocc5PeOUDK9KGzvgIBjGRRzzlRDaOjh3ADwH0WeibQvi3ls2Q==", - "dev": true, - "requires": { - "cross-spawn": "^7.0.3", - "is-glob": "^4.0.3", - "open": "^8.4.0", - "picocolors": "^1.0.0", - "tiny-glob": "^0.2.9", - "tslib": "^2.4.0" - } - }, - "cross-spawn": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", - "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", - "dev": true, - "requires": { - "path-key": "^3.1.0", - "shebang-command": "^2.0.0", - "which": "^2.0.1" - } - }, - "define-lazy-prop": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/define-lazy-prop/-/define-lazy-prop-2.0.0.tgz", - "integrity": "sha512-Ds09qNh8yw3khSjiJjiUInaGX9xlqZDY7JVryGxdxV7NPeuqQfplOpQ66yJFZut3jLa5zOwkXw1g9EI2uKh4Og==", - "dev": true - }, - "globalyzer": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/globalyzer/-/globalyzer-0.1.0.tgz", - "integrity": "sha512-40oNTM9UfG6aBmuKxk/giHn5nQ8RVz/SS4Ir6zgzOv9/qC3kKZ9v4etGTcJbEl/NyVQH7FGU7d+X1egr57Md2Q==", - "dev": true - }, - "globrex": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/globrex/-/globrex-0.1.2.tgz", - "integrity": "sha512-uHJgbwAMwNFf5mLst7IWLNg14x1CkeqglJb/K3doi4dw6q2IvAAmM/Y81kevy83wP+Sst+nutFTYOGg3d1lsxg==", - "dev": true - }, - "is-docker": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/is-docker/-/is-docker-2.2.1.tgz", - "integrity": "sha512-F+i2BKsFrH66iaUFc0woD8sLy8getkwTwtOBjvs56Cx4CgJDeKQeqfz8wAYiSb8JOprWhHH5p77PbmYCvvUuXQ==", - "dev": true - }, - "is-extglob": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", - "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", - "dev": true - }, - "is-glob": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", - "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", - "dev": true, - "requires": { - "is-extglob": "^2.1.1" - } - }, - "is-wsl": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-2.2.0.tgz", - "integrity": "sha512-fKzAra0rGJUUBwGBgNkHZuToZcn+TtXHpeCgmkMJMMYx1sQDYaCSyjJBSCa2nH1DGm7s3n1oBnohoVTBaN7Lww==", - "dev": true, - "requires": { - "is-docker": "^2.0.0" - } - }, - "isexe": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", - "dev": true - }, - "mvdan-sh": { - "version": "0.10.1", - "resolved": "https://registry.npmjs.org/mvdan-sh/-/mvdan-sh-0.10.1.tgz", - "integrity": "sha512-kMbrH0EObaKmK3nVRKUIIya1dpASHIEusM13S4V1ViHFuxuNxCo+arxoa6j/dbV22YBGjl7UKJm9QQKJ2Crzhg==", - "dev": true - }, - "open": { - "version": "8.4.0", - "resolved": "https://registry.npmjs.org/open/-/open-8.4.0.tgz", - "integrity": "sha512-XgFPPM+B28FtCCgSb9I+s9szOC1vZRSwgWsRUA5ylIxRTgKozqjOCrVOqGsYABPYK5qnfqClxZTFBa8PKt2v6Q==", - "dev": true, - "requires": { - "define-lazy-prop": "^2.0.0", - "is-docker": "^2.1.1", - "is-wsl": "^2.2.0" - } - }, - "path-key": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", - "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", - "dev": true - }, - "picocolors": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz", - "integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==", - "dev": true - }, - "prettier": { - "version": "2.7.1", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.7.1.tgz", - "integrity": "sha512-ujppO+MkdPqoVINuDFDRLClm7D78qbDt0/NR+wp5FqEZOoTNAjPHWj17QRhu7geIHJfcNhRk1XVQmF8Bp3ye+g==", - "dev": true - }, - "prettier-plugin-sh": { - "version": "0.12.8", - "resolved": "https://registry.npmjs.org/prettier-plugin-sh/-/prettier-plugin-sh-0.12.8.tgz", - "integrity": "sha512-VOq8h2Gn5UzrCIKm4p/nAScXJbN09HdyFDknAcxt6Qu/tv/juu9bahxSrcnM9XWYA+Spz1F1ANJ4LhfwB7+Q1Q==", - "dev": true, - "requires": { - "mvdan-sh": "^0.10.1", - "sh-syntax": "^0.3.6", - "synckit": "^0.8.1" - } - }, - "sh-syntax": { - "version": "0.3.7", - "resolved": "https://registry.npmjs.org/sh-syntax/-/sh-syntax-0.3.7.tgz", - "integrity": "sha512-xIB/uRniZ9urxAuXp1Ouh/BKSI1VK8RSqfwGj7cV57HvGrFo3vHdJfv8Tdp/cVcxJgXQTkmHr5mG5rqJW8r4wQ==", - "dev": true, - "requires": { - "tslib": "^2.4.0" - } - }, - "shebang-command": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", - "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", - "dev": true, - "requires": { - "shebang-regex": "^3.0.0" - } - }, - "shebang-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", - "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", - "dev": true - }, - "synckit": { - "version": "0.8.3", - "resolved": "https://registry.npmjs.org/synckit/-/synckit-0.8.3.tgz", - "integrity": "sha512-1goXnDYNJlKwCM37f5MTzRwo+8SqutgVtg2d37D6YnHHT4E3IhQMRfKiGdfTZU7LBlI6T8inCQUxnMBFHrbqWw==", - "dev": true, - "requires": { - "@pkgr/utils": "^2.3.0", - "tslib": "^2.4.0" - } - }, - "tiny-glob": { - "version": "0.2.9", - "resolved": "https://registry.npmjs.org/tiny-glob/-/tiny-glob-0.2.9.tgz", - "integrity": "sha512-g/55ssRPUjShh+xkfx9UPDXqhckHEsHr4Vd9zX55oSdGZc/MD0m3sferOkwWtp98bv+kcVfEHtRJgBVJzelrzg==", - "dev": true, - "requires": { - "globalyzer": "0.1.0", - "globrex": "^0.1.2" - } - }, - "tslib": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.0.tgz", - "integrity": "sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ==", - "dev": true - }, - "which": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", - "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", - "dev": true, - "requires": { - "isexe": "^2.0.0" - } - } } } diff --git a/tests/tests_kcov.sh b/tests/tests_kcov.sh deleted file mode 100644 index 743e2fda2..000000000 --- a/tests/tests_kcov.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/bash -echo -e "Installing kcov" -curl -L "https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/shunit2/shunit2-2.1.6.tgz" | tar zx -wget https://github.com/SimonKagstrom/kcov/archive/master.tar.gz -tar xzf master.tar.gz -cd kcov-master || exit -mkdir build -cd build || exit -cmake .. -make -sudo make install -cd ../.. -rm -rf kcov-master -mkdir -p coverage diff --git a/tests/tests_shellcheck.sh b/tests/tests_shellcheck.sh deleted file mode 100644 index c277a5177..000000000 --- a/tests/tests_shellcheck.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/bash -# Project: Game Server Managers - LinuxGSM -# Author: Daniel Gibbs -# License: MIT License, Copyright (c) 2020 Daniel Gibbs -# Purpose: Travis CI Tests: Shellcheck | Linux Game Server Management Script -# Contributors: https://github.com/GameServerManagers/LinuxGSM/graphs/contributors -# Documentation: https://docs.linuxgsm.com/ -# Website: https://linuxgsm.com - -echo -e "=================================" -echo -e "Travis CI Tests" -echo -e "Linux Game Server Manager" -echo -e "by Daniel Gibbs" -echo -e "Contributors: http://goo.gl/qLmitD" -echo -e "https://linuxgsm.com" -echo -e "=================================" -echo -e "" -echo -e "=================================" -echo -e "Bash Analysis Tests" -echo -e "Using: Shellcheck" -echo -e "Testing Branch: $TRAVIS_BRANCH" -echo -e "=================================" -echo -e "" -scissues=$(find . -type f \( -name "*.sh" -o -name "*.cfg" \) -not -path "./shunit2-2.1.6/*" -exec shellcheck --shell=bash --exclude=SC2154,SC2034 {} \; | grep -F "^--" | wc -l) -echo -e "Found issues: ${scissues}" -echo -e "=================================" -find . -type f \( -name "*.sh" -o -name "*.cfg" \) -not -path "./shunit2-2.1.6/*" -exec shellcheck --shell=bash --exclude=SC2154,SC2034 {} \; -echo -e "" -echo -e "=================================" -echo -e "Bash Analysis Tests - Complete!" -echo -e "Using: Shellcheck" -echo -e "=================================" From 51031eb71ab3cf5c7fc31b7825271ed63a1ba882 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Thu, 16 Feb 2023 23:43:09 +0000 Subject: [PATCH 124/161] chore: auto add game server requests to gh project --- .github/workflows/add-to-project.yml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 .github/workflows/add-to-project.yml diff --git a/.github/workflows/add-to-project.yml b/.github/workflows/add-to-project.yml new file mode 100644 index 000000000..56a42c729 --- /dev/null +++ b/.github/workflows/add-to-project.yml @@ -0,0 +1,17 @@ +name: Add to project +on: + issues: + types: + - opened + - labeled + +jobs: + add-to-project: + name: Add game server requests to project + runs-on: ubuntu-latest + steps: + - uses: actions/add-to-project@v0.4.0 + with: + project-url: https://github.com/orgs/GameServerManagers/projects/11 + github-token: ${{ secrets.ADD_TO_PROJECT_PAT }} + labeled: "type: game server request" From 3d936381fae929c6b2987a4c5f5ae1689970c571 Mon Sep 17 00:00:00 2001 From: Marcin Jakubowski Date: Fri, 17 Feb 2023 23:50:41 +0100 Subject: [PATCH 125/161] feat(newserver): American Truck Simulator (#4105) --- .../config-lgsm/atsserver/_default.cfg | 179 ++++++++++++++++++ .../config-lgsm/ets2server/_default.cfg | 179 ++++++++++++++++++ lgsm/data/almalinux-8.csv | 2 + lgsm/data/almalinux-9.csv | 2 + lgsm/data/centos-7.csv | 2 + lgsm/data/centos-8.csv | 2 + lgsm/data/centos-9.csv | 2 + lgsm/data/debian-10.csv | 2 + lgsm/data/debian-11.csv | 2 + lgsm/data/debian-9.csv | 2 + lgsm/data/rhel-7.csv | 2 + lgsm/data/rhel-8.csv | 2 + lgsm/data/rhel-9.csv | 2 + lgsm/data/rocky-8.csv | 2 + lgsm/data/rocky-9.csv | 2 + lgsm/data/serverlist.csv | 2 + lgsm/data/ubuntu-16.04.csv | 2 + lgsm/data/ubuntu-18.04.csv | 2 + lgsm/data/ubuntu-20.04.csv | 2 + lgsm/data/ubuntu-21.04.csv | 2 + lgsm/data/ubuntu-21.10.csv | 2 + lgsm/data/ubuntu-22.04.csv | 2 + lgsm/functions/info_game.sh | 26 +++ lgsm/functions/info_messages.sh | 13 +- lgsm/functions/install_config.sh | 16 ++ 25 files changed, 452 insertions(+), 1 deletion(-) create mode 100644 lgsm/config-default/config-lgsm/atsserver/_default.cfg create mode 100644 lgsm/config-default/config-lgsm/ets2server/_default.cfg diff --git a/lgsm/config-default/config-lgsm/atsserver/_default.cfg b/lgsm/config-default/config-lgsm/atsserver/_default.cfg new file mode 100644 index 000000000..c6e338d34 --- /dev/null +++ b/lgsm/config-default/config-lgsm/atsserver/_default.cfg @@ -0,0 +1,179 @@ +################################## +######## Default Settings ######## +################################## +# DO NOT EDIT, ANY CHANGES WILL BE OVERWRITTEN! +# Copy settings from here and use them in either: +# common.cfg - applies settings to every instance. +# [instance].cfg - applies settings to a specific instance. + +#### Game Server Settings #### + +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="-nosingle" + +#### LinuxGSM Settings #### + +## LinuxGSM Stats +# Send useful stats to LinuxGSM developers. +# https://docs.linuxgsm.com/configuration/linuxgsm-stats +# (on|off) +stats="off" + +## Notification Alerts +# (on|off) + +# Display IP | https://docs.linuxgsm.com/alerts#display-ip +displayip="" + +# More info | https://docs.linuxgsm.com/alerts#more-info +postalert="off" + +# Discord Alerts | https://docs.linuxgsm.com/alerts/discord +discordalert="off" +discordwebhook="webhook" + +# Email Alerts | https://docs.linuxgsm.com/alerts/email +emailalert="off" +email="email@example.com" +emailfrom="" + +# Gotify Alerts | https://docs.linuxgsm.com/alerts/gotify +gotifyalert="off" +gotifytoken="token" +gotifywebhook="webhook" + +# IFTTT Alerts | https://docs.linuxgsm.com/alerts/ifttt +iftttalert="off" +ifttttoken="accesstoken" +iftttevent="linuxgsm_alert" + +# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun +mailgunalert="off" +mailgunapiregion="us" +mailguntoken="accesstoken" +mailgundomain="example.com" +mailgunemailfrom="alert@example.com" +mailgunemail="email@myemail.com" + +# Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet +pushbulletalert="off" +pushbullettoken="accesstoken" +channeltag="" + +# Pushover Alerts | https://docs.linuxgsm.com/alerts/pushover +pushoveralert="off" +pushovertoken="accesstoken" +pushoveruserkey="userkey" + +# Rocket.Chat Alerts | https://docs.linuxgsm.com/alerts/rocket.chat +rocketchatalert="off" +rocketchatwebhook="webhook" +rocketchattoken="" + +# Slack Alerts | https://docs.linuxgsm.com/alerts/slack +slackalert="off" +slackwebhook="webhook" + +# Telegram Alerts | https://docs.linuxgsm.com/alerts/telegram +# You can add a custom cURL string eg proxy (useful in Russia) in "curlcustomstring". +# For example "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help". +telegramapi="api.telegram.org" +telegramalert="off" +telegramtoken="accesstoken" +telegramchatid="" +curlcustomstring="" + +## Updating | https://docs.linuxgsm.com/commands/update +updateonstart="off" + +## Backup | https://docs.linuxgsm.com/commands/backup +maxbackups="4" +maxbackupdays="30" +stoponbackup="on" + +## Logging | https://docs.linuxgsm.com/features/logging +consolelogging="on" +logdays="7" + +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + +## ANSI Colors | https://docs.linuxgsm.com/features/ansi-colors +ansi="on" + +#### Advanced Settings #### + +## Message Display Time | https://docs.linuxgsm.com/features/message-display-time +sleeptime="0.5" + +## SteamCMD Settings | https://docs.linuxgsm.com/steamcmd +# Server appid +appid="2239530" +steamcmdforcewindows="no" +# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch +branch="" +betapassword="" +# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server +steammaster="true" + +## Stop Mode | https://docs.linuxgsm.com/features/stop-mode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: GoldSrc +# 10: Avorion +# 11: end +stopmode="2" + +## Query mode +# 1: session only +# 2: gamedig (gsquery fallback) +# 3: gamedig +# 4: gsquery +# 5: tcp +querymode="4" +querytype="protocol-valve" + +## Console type +consoleverbose="yes" +consoleinteract="no" + +## Game Server Details +# Do not edit +gamename="American Truck Simulator" +engine="prism3d" +glibc="2.15" + +#### Directories #### +# Edit with care + +## Game Server Directories +systemdir="${serverfiles}" +executabledir="${systemdir}/bin/linux_x64" +executable="./amtrucks_server" +servercfgdir="${HOME}/.local/share/American Truck Simulator" +servercfg="server_config.sii" +servercfgdefault="server_config.sii" +servercfgfullpath="${servercfgdir}/${servercfg}" + +## Backup Directory +backupdir="${lgsmdir}/backup" + +## Logging Directories +logdir="${rootdir}/log" +lgsmlogdir="${logdir}/script" +consolelogdir="${logdir}/console" +lgsmlog="${lgsmlogdir}/${selfname}-script.log" +consolelog="${consolelogdir}/${selfname}-console.log" +alertlog="${lgsmlogdir}/${selfname}-alert.log" +postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" + +## Logs Naming +lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" +consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" diff --git a/lgsm/config-default/config-lgsm/ets2server/_default.cfg b/lgsm/config-default/config-lgsm/ets2server/_default.cfg new file mode 100644 index 000000000..2d0176133 --- /dev/null +++ b/lgsm/config-default/config-lgsm/ets2server/_default.cfg @@ -0,0 +1,179 @@ +################################## +######## Default Settings ######## +################################## +# DO NOT EDIT, ANY CHANGES WILL BE OVERWRITTEN! +# Copy settings from here and use them in either: +# common.cfg - applies settings to every instance. +# [instance].cfg - applies settings to a specific instance. + +#### Game Server Settings #### + +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="-nosingle" + +#### LinuxGSM Settings #### + +## LinuxGSM Stats +# Send useful stats to LinuxGSM developers. +# https://docs.linuxgsm.com/configuration/linuxgsm-stats +# (on|off) +stats="off" + +## Notification Alerts +# (on|off) + +# Display IP | https://docs.linuxgsm.com/alerts#display-ip +displayip="" + +# More info | https://docs.linuxgsm.com/alerts#more-info +postalert="off" + +# Discord Alerts | https://docs.linuxgsm.com/alerts/discord +discordalert="off" +discordwebhook="webhook" + +# Email Alerts | https://docs.linuxgsm.com/alerts/email +emailalert="off" +email="email@example.com" +emailfrom="" + +# Gotify Alerts | https://docs.linuxgsm.com/alerts/gotify +gotifyalert="off" +gotifytoken="token" +gotifywebhook="webhook" + +# IFTTT Alerts | https://docs.linuxgsm.com/alerts/ifttt +iftttalert="off" +ifttttoken="accesstoken" +iftttevent="linuxgsm_alert" + +# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun +mailgunalert="off" +mailgunapiregion="us" +mailguntoken="accesstoken" +mailgundomain="example.com" +mailgunemailfrom="alert@example.com" +mailgunemail="email@myemail.com" + +# Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet +pushbulletalert="off" +pushbullettoken="accesstoken" +channeltag="" + +# Pushover Alerts | https://docs.linuxgsm.com/alerts/pushover +pushoveralert="off" +pushovertoken="accesstoken" +pushoveruserkey="userkey" + +# Rocket.Chat Alerts | https://docs.linuxgsm.com/alerts/rocket.chat +rocketchatalert="off" +rocketchatwebhook="webhook" +rocketchattoken="" + +# Slack Alerts | https://docs.linuxgsm.com/alerts/slack +slackalert="off" +slackwebhook="webhook" + +# Telegram Alerts | https://docs.linuxgsm.com/alerts/telegram +# You can add a custom cURL string eg proxy (useful in Russia) in "curlcustomstring". +# For example "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help". +telegramapi="api.telegram.org" +telegramalert="off" +telegramtoken="accesstoken" +telegramchatid="" +curlcustomstring="" + +## Updating | https://docs.linuxgsm.com/commands/update +updateonstart="off" + +## Backup | https://docs.linuxgsm.com/commands/backup +maxbackups="4" +maxbackupdays="30" +stoponbackup="on" + +## Logging | https://docs.linuxgsm.com/features/logging +consolelogging="on" +logdays="7" + +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + +## ANSI Colors | https://docs.linuxgsm.com/features/ansi-colors +ansi="on" + +#### Advanced Settings #### + +## Message Display Time | https://docs.linuxgsm.com/features/message-display-time +sleeptime="0.5" + +## SteamCMD Settings | https://docs.linuxgsm.com/steamcmd +# Server appid +appid="1948160" +steamcmdforcewindows="no" +# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch +branch="" +betapassword="" +# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server +steammaster="true" + +## Stop Mode | https://docs.linuxgsm.com/features/stop-mode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: GoldSrc +# 10: Avorion +# 11: end +stopmode="2" + +## Query mode +# 1: session only +# 2: gamedig (gsquery fallback) +# 3: gamedig +# 4: gsquery +# 5: tcp +querymode="4" +querytype="protocol-valve" + +## Console type +consoleverbose="yes" +consoleinteract="no" + +## Game Server Details +# Do not edit +gamename="Euro Truck Simulator 2" +engine="prism3d" +glibc="2.15" + +#### Directories #### +# Edit with care + +## Game Server Directories +systemdir="${serverfiles}" +executabledir="${systemdir}/bin/linux_x64" +executable="./eurotrucks2_server" +servercfgdir="${HOME}/.local/share/Euro Truck Simulator 2" +servercfg="server_config.sii" +servercfgdefault="server_config.sii" +servercfgfullpath="${servercfgdir}/${servercfg}" + +## Backup Directory +backupdir="${lgsmdir}/backup" + +## Logging Directories +logdir="${rootdir}/log" +lgsmlogdir="${logdir}/script" +consolelogdir="${logdir}/console" +lgsmlog="${lgsmlogdir}/${selfname}-script.log" +consolelog="${consolelogdir}/${selfname}-console.log" +alertlog="${lgsmlogdir}/${selfname}-alert.log" +postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" + +## Logs Naming +lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" +consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" diff --git a/lgsm/data/almalinux-8.csv b/lgsm/data/almalinux-8.csv index 0bc76a1a6..d14f52f44 100644 --- a/lgsm/data/almalinux-8.csv +++ b/lgsm/data/almalinux-8.csv @@ -6,6 +6,7 @@ ahl2 ark arma3 armar,libcurl,openssl-libs +ats av bb bb2,libcurl.i686 @@ -42,6 +43,7 @@ dys eco,libgdiplus em etl +ets2 fctr fof gmod,ncurses-libs.i686 diff --git a/lgsm/data/almalinux-9.csv b/lgsm/data/almalinux-9.csv index 0bc76a1a6..d14f52f44 100644 --- a/lgsm/data/almalinux-9.csv +++ b/lgsm/data/almalinux-9.csv @@ -6,6 +6,7 @@ ahl2 ark arma3 armar,libcurl,openssl-libs +ats av bb bb2,libcurl.i686 @@ -42,6 +43,7 @@ dys eco,libgdiplus em etl +ets2 fctr fof gmod,ncurses-libs.i686 diff --git a/lgsm/data/centos-7.csv b/lgsm/data/centos-7.csv index 9ae62611d..c5d633929 100644 --- a/lgsm/data/centos-7.csv +++ b/lgsm/data/centos-7.csv @@ -6,6 +6,7 @@ ahl2 ark arma3 armar,libcurl,openssl11-libs +ats av bb bb2,libcurl.i686 @@ -42,6 +43,7 @@ dys eco,libgdiplus em etl +ets2 fctr fof gmod,ncurses-libs.i686 diff --git a/lgsm/data/centos-8.csv b/lgsm/data/centos-8.csv index 0d680e760..f60a925ce 100644 --- a/lgsm/data/centos-8.csv +++ b/lgsm/data/centos-8.csv @@ -6,6 +6,7 @@ ahl2 ark arma3 armar,libcurl,openssl-libs +ats av bb bb2,libcurl.i686 @@ -42,6 +43,7 @@ dys eco,libgdiplus em etl +ets2 fctr fof gmod,ncurses-libs.i686 diff --git a/lgsm/data/centos-9.csv b/lgsm/data/centos-9.csv index 0d680e760..f60a925ce 100644 --- a/lgsm/data/centos-9.csv +++ b/lgsm/data/centos-9.csv @@ -6,6 +6,7 @@ ahl2 ark arma3 armar,libcurl,openssl-libs +ats av bb bb2,libcurl.i686 @@ -42,6 +43,7 @@ dys eco,libgdiplus em etl +ets2 fctr fof gmod,ncurses-libs.i686 diff --git a/lgsm/data/debian-10.csv b/lgsm/data/debian-10.csv index 9932a3b39..1196db200 100644 --- a/lgsm/data/debian-10.csv +++ b/lgsm/data/debian-10.csv @@ -6,6 +6,7 @@ ahl2 ark arma3 armar,libcurl4 +ats av bb bb2,libcurl4-gnutls-dev:i386 @@ -42,6 +43,7 @@ dys eco,libgdiplus em etl +ets2 fctr fof gmod,libtinfo5:i386 diff --git a/lgsm/data/debian-11.csv b/lgsm/data/debian-11.csv index 514f98ab8..28b7bd853 100644 --- a/lgsm/data/debian-11.csv +++ b/lgsm/data/debian-11.csv @@ -6,6 +6,7 @@ ahl2 ark arma3 armar,libcurl4 +ats av bb bb2,libcurl4-gnutls-dev:i386 @@ -42,6 +43,7 @@ dys eco,libgdiplus em etl +ets2 fctr fof gmod,libtinfo5:i386 diff --git a/lgsm/data/debian-9.csv b/lgsm/data/debian-9.csv index 786c8f6c0..1cfbe6ef8 100644 --- a/lgsm/data/debian-9.csv +++ b/lgsm/data/debian-9.csv @@ -6,6 +6,7 @@ ahl2 ark arma3 armar,libcurl4 +ats av bb bb2,libcurl4-gnutls-dev:i386 @@ -42,6 +43,7 @@ dys eco,libgdiplus em etl +ets2 fctr fof gmod,libtinfo5:i386 diff --git a/lgsm/data/rhel-7.csv b/lgsm/data/rhel-7.csv index 58dda5d20..c33ec945f 100644 --- a/lgsm/data/rhel-7.csv +++ b/lgsm/data/rhel-7.csv @@ -6,6 +6,7 @@ ahl2 ark arma3 armar,libcurl,openssl11-libs +ats av bb bb2,libcurl.i686 @@ -42,6 +43,7 @@ dys eco,libgdiplus em etl +ets2 fctr fof gmod,ncurses-libs.i686 diff --git a/lgsm/data/rhel-8.csv b/lgsm/data/rhel-8.csv index 8f0d5a30f..f074b5863 100644 --- a/lgsm/data/rhel-8.csv +++ b/lgsm/data/rhel-8.csv @@ -6,6 +6,7 @@ ahl2 ark arma3 armar,libcurl,openssl-libs +ats av bb bb2,libcurl.i686 @@ -42,6 +43,7 @@ dys eco,libgdiplus em etl +ets2 fctr fof gmod,ncurses-libs.i686 diff --git a/lgsm/data/rhel-9.csv b/lgsm/data/rhel-9.csv index 8f0d5a30f..f074b5863 100644 --- a/lgsm/data/rhel-9.csv +++ b/lgsm/data/rhel-9.csv @@ -6,6 +6,7 @@ ahl2 ark arma3 armar,libcurl,openssl-libs +ats av bb bb2,libcurl.i686 @@ -42,6 +43,7 @@ dys eco,libgdiplus em etl +ets2 fctr fof gmod,ncurses-libs.i686 diff --git a/lgsm/data/rocky-8.csv b/lgsm/data/rocky-8.csv index 0bc76a1a6..d14f52f44 100644 --- a/lgsm/data/rocky-8.csv +++ b/lgsm/data/rocky-8.csv @@ -6,6 +6,7 @@ ahl2 ark arma3 armar,libcurl,openssl-libs +ats av bb bb2,libcurl.i686 @@ -42,6 +43,7 @@ dys eco,libgdiplus em etl +ets2 fctr fof gmod,ncurses-libs.i686 diff --git a/lgsm/data/rocky-9.csv b/lgsm/data/rocky-9.csv index 0bc76a1a6..d14f52f44 100644 --- a/lgsm/data/rocky-9.csv +++ b/lgsm/data/rocky-9.csv @@ -6,6 +6,7 @@ ahl2 ark arma3 armar,libcurl,openssl-libs +ats av bb bb2,libcurl.i686 @@ -42,6 +43,7 @@ dys eco,libgdiplus em etl +ets2 fctr fof gmod,ncurses-libs.i686 diff --git a/lgsm/data/serverlist.csv b/lgsm/data/serverlist.csv index be19a23f5..3c416fa1d 100644 --- a/lgsm/data/serverlist.csv +++ b/lgsm/data/serverlist.csv @@ -4,6 +4,7 @@ ahl2,ahl2server,Action: Source,ubuntu-22.04 ark,arkserver,ARK: Survival Evolved,ubuntu-22.04 arma3,arma3server,ARMA 3,ubuntu-22.04 armar,armarserver,Arma Reforger,ubuntu-20.04 +ats,atsserver,American Truck Simulator av,avserver,Avorion,ubuntu-22.04 bb,bbserver,BrainBread,ubuntu-22.04 bb2,bb2server,BrainBread 2,ubuntu-22.04 @@ -40,6 +41,7 @@ dys,dysserver,Dystopia,ubuntu-22.04 eco,ecoserver,Eco,ubuntu-22.04 em,emserver,Empires Mod,ubuntu-22.04 etl,etlserver,ET: Legacy,ubuntu-22.04 +ets2,ets2server,Euro Truck Simulator 2,ubuntu-22.04 fctr,fctrserver,Factorio,ubuntu-22.04 fof,fofserver,Fistful of Frags,ubuntu-22.04 gmod,gmodserver,Garrys Mod,ubuntu-22.04 diff --git a/lgsm/data/ubuntu-16.04.csv b/lgsm/data/ubuntu-16.04.csv index b5d8f6faf..6b6fcd834 100644 --- a/lgsm/data/ubuntu-16.04.csv +++ b/lgsm/data/ubuntu-16.04.csv @@ -5,6 +5,7 @@ ahl ahl2 ark arma3 +ats av bb bb2,libcurl4-gnutls-dev:i386 @@ -41,6 +42,7 @@ dys eco,libgdiplus em etl +ets2 fctr fof gmod,libtinfo5:i386 diff --git a/lgsm/data/ubuntu-18.04.csv b/lgsm/data/ubuntu-18.04.csv index 9932a3b39..1196db200 100644 --- a/lgsm/data/ubuntu-18.04.csv +++ b/lgsm/data/ubuntu-18.04.csv @@ -6,6 +6,7 @@ ahl2 ark arma3 armar,libcurl4 +ats av bb bb2,libcurl4-gnutls-dev:i386 @@ -42,6 +43,7 @@ dys eco,libgdiplus em etl +ets2 fctr fof gmod,libtinfo5:i386 diff --git a/lgsm/data/ubuntu-20.04.csv b/lgsm/data/ubuntu-20.04.csv index 68dc928d9..240bb6c1e 100644 --- a/lgsm/data/ubuntu-20.04.csv +++ b/lgsm/data/ubuntu-20.04.csv @@ -6,6 +6,7 @@ ahl2 ark arma3 armar,libcurl4 +ats av bb bb2,libcurl4-gnutls-dev:i386 @@ -42,6 +43,7 @@ dys eco,libgdiplus em etl +ets2 fctr fof gmod,libtinfo5:i386 diff --git a/lgsm/data/ubuntu-21.04.csv b/lgsm/data/ubuntu-21.04.csv index 514f98ab8..28b7bd853 100644 --- a/lgsm/data/ubuntu-21.04.csv +++ b/lgsm/data/ubuntu-21.04.csv @@ -6,6 +6,7 @@ ahl2 ark arma3 armar,libcurl4 +ats av bb bb2,libcurl4-gnutls-dev:i386 @@ -42,6 +43,7 @@ dys eco,libgdiplus em etl +ets2 fctr fof gmod,libtinfo5:i386 diff --git a/lgsm/data/ubuntu-21.10.csv b/lgsm/data/ubuntu-21.10.csv index 45ce1f640..8860a2a4d 100644 --- a/lgsm/data/ubuntu-21.10.csv +++ b/lgsm/data/ubuntu-21.10.csv @@ -6,6 +6,7 @@ ahl2 ark arma3 armar,libcurl4 +ats av bb bb2,libcurl4-gnutls-dev:i386 @@ -40,6 +41,7 @@ dys eco,libgdiplus em etl +ets2 fctr fof gmod,libtinfo5:i386 diff --git a/lgsm/data/ubuntu-22.04.csv b/lgsm/data/ubuntu-22.04.csv index 8b9f02234..8492e08c4 100644 --- a/lgsm/data/ubuntu-22.04.csv +++ b/lgsm/data/ubuntu-22.04.csv @@ -6,6 +6,7 @@ ahl2 ark arma3 armar,libcurl4 +ats av bb bb2,libcurl4-gnutls-dev:i386 @@ -40,6 +41,7 @@ dys eco,libgdiplus em etl +ets2 fctr fof gmod,libtinfo5:i386 diff --git a/lgsm/functions/info_game.sh b/lgsm/functions/info_game.sh index 66b9be5db..80d02dd4d 100644 --- a/lgsm/functions/info_game.sh +++ b/lgsm/functions/info_game.sh @@ -1242,6 +1242,30 @@ fn_info_game_pvr() { queryport=${port:-"0"} } +fn_info_game_prism3d() { + # Config + if [ ! -f "${servercfgfullpath}" ]; then + maxplayers="${unavailable}" + port="${zero}" + queryport="${zero}" + servername="${unavailable}" + serverpassword="${unavailable}" + else + maxplayers=$(sed -nr 's/^\s*max_players\s*:\s*([0-9]+)/\1/p' "${servercfgfullpath}") + port=$(sed -nr 's/^\s*connection_dedicated_port\s*:\s*([0-9]+)/\1/p' "${servercfgfullpath}") + queryport=$(sed -nr 's/^\s*query_dedicated_port\s*:\s*([0-9]+)/\1/p' "${servercfgfullpath}") + servername=$(sed -nr 's/^\s*lobby_name\s*:\s*"?([^"\r\n]+)"?/\1/p' "${servercfgfullpath}") + serverpassword=$(sed -nr 's/^\s*password\s*:\s*"(.*)"/\1/p' "${servercfgfullpath}") + + # Not set + maxplayers=${maxplayers:-"0"} + port=${port:-"27015"} + queryport=${queryport:-"27016"} + servername=${servername:-"NOT SET"} + serverpassword=${serverpassword:-"NOT SET"} + fi +} + fn_info_game_pz() { # Config if [ ! -f "${servercfgfullpath}" ]; then @@ -2515,6 +2539,8 @@ elif [ "${shortname}" == "wmc" ]; then fn_info_game_wmc elif [ "${shortname}" == "wurm" ]; then fn_info_game_wurm +elif [ "${engine}" == "prism3d" ]; then + fn_info_game_prism3d elif [ "${engine}" == "source" ] || [ "${engine}" == "goldsrc" ]; then fn_info_game_source elif [ "${engine}" == "unreal2" ]; then diff --git a/lgsm/functions/info_messages.sh b/lgsm/functions/info_messages.sh index f4f67b120..a78a2f2c2 100755 --- a/lgsm/functions/info_messages.sh +++ b/lgsm/functions/info_messages.sh @@ -658,7 +658,7 @@ fn_info_message_ports_edit() { startparameterslocation="${red}UNKNOWN${default}" # engines/games that require editing in the config file. - local ports_edit_array=("ac" "arma3" "armar" "bo" "bt" "cd" "dst" "eco" "idtech2" "idtech3" "idtech3_ql" "jc2" "jc3" "lwjgl2" "mcb" "mumble" "nec" "pc" "pc2" "pz" "qw" "refractor" "renderware" "rw" "sb" "sdtd" "st" "stn" "ts3" "tw" "terraria" "unreal" "unreal2" "unreal3" "vints" "wurm") + local ports_edit_array=("ac" "arma3" "armar" "bo" "bt" "cd" "dst" "eco" "idtech2" "idtech3" "idtech3_ql" "jc2" "jc3" "lwjgl2" "mcb" "mumble" "nec" "pc" "pc2" "prism3d" "pz" "qw" "refractor" "renderware" "rw" "sb" "sdtd" "st" "stn" "ts3" "tw" "terraria" "unreal" "unreal2" "unreal3" "vints" "wurm") for port_edit in "${ports_edit_array[@]}"; do if [ "${shortname}" == "ut3" ]; then startparameterslocation="${servercfgdir}/UTWeb.ini" @@ -1403,6 +1403,15 @@ fn_info_message_sol() { fn_port "Files" filesport tcp } | column -s $'\t' -t } + +fn_info_message_prism3d() { + { + fn_port "header" + fn_port "Game" port udp + fn_port "Query" queryport udp + } | column -s $'\t' -t +} + fn_info_message_source() { { fn_port "header" @@ -1824,6 +1833,8 @@ fn_info_message_select_engine() { fn_info_message_wurm elif [ "${engine}" == "goldsrc" ]; then fn_info_message_goldsrc + elif [ "${engine}" == "prism3d" ]; then + fn_info_message_prism3d elif [ "${engine}" == "source" ]; then fn_info_message_source elif [ "${engine}" == "spark" ]; then diff --git a/lgsm/functions/install_config.sh b/lgsm/functions/install_config.sh index d5525c266..b92eb919b 100755 --- a/lgsm/functions/install_config.sh +++ b/lgsm/functions/install_config.sh @@ -210,6 +210,14 @@ elif [ "${shortname}" == "armar" ]; then fn_default_config_remote fn_set_config_vars fn_list_config_locations +elif [ "${shortname}" == "ats" ]; then + gamedirname="AmericanTruckSimulator" + fn_check_cfgdir + array_configs+=(server_config.sii) + fn_fetch_default_config + fn_default_config_remote + fn_set_config_vars + fn_list_config_locations elif [ "${shortname}" == "bo" ]; then gamedirname="BallisticOverkill" array_configs+=(config.txt) @@ -444,6 +452,14 @@ elif [ "${shortname}" == "etl" ]; then fn_default_config_remote fn_set_config_vars fn_list_config_locations +elif [ "${shortname}" == "ets2" ]; then + gamedirname="EuroTruckSimulator2" + fn_check_cfgdir + array_configs+=(server_config.sii) + fn_fetch_default_config + fn_default_config_remote + fn_set_config_vars + fn_list_config_locations elif [ "${shortname}" == "fctr" ]; then gamedirname="Factorio" array_configs+=(server-settings.json) From 928bfdc6efeee628ea12ecf9780166f257ef4361 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Fri, 17 Feb 2023 23:11:38 +0000 Subject: [PATCH 127/161] fix(nec): add missing vars --- lgsm/config-default/config-lgsm/necserver/_default.cfg | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lgsm/config-default/config-lgsm/necserver/_default.cfg b/lgsm/config-default/config-lgsm/necserver/_default.cfg index 65b7a7f1d..af49cb3e2 100644 --- a/lgsm/config-default/config-lgsm/necserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/necserver/_default.cfg @@ -149,6 +149,8 @@ consoleinteract="no" ## Game Server Details # Do not edit gamename="Necesse" +engine="null" +glibc="2.9" #### Directories #### # Edit with care From 146b29972d91ebf6ecfa01fb7b9ff5a9c7da9e85 Mon Sep 17 00:00:00 2001 From: Christian Date: Sat, 18 Feb 2023 00:56:47 +0100 Subject: [PATCH 128/161] feat(newserver): Core Keeper (#3884) Co-authored-by: Daniel Gibbs --- .../config-lgsm/ckserver/_default.cfg | 186 ++++++++++++++++++ lgsm/data/almalinux-8.csv | 1 + lgsm/data/almalinux-9.csv | 1 + lgsm/data/centos-7.csv | 1 + lgsm/data/centos-8.csv | 1 + lgsm/data/centos-9.csv | 1 + lgsm/data/debian-10.csv | 1 + lgsm/data/debian-11.csv | 1 + lgsm/data/debian-9.csv | 1 + lgsm/data/rhel-7.csv | 1 + lgsm/data/rhel-8.csv | 1 + lgsm/data/rhel-9.csv | 1 + lgsm/data/rocky-8.csv | 1 + lgsm/data/rocky-9.csv | 1 + lgsm/data/serverlist.csv | 2 + lgsm/data/ubuntu-16.04.csv | 1 + lgsm/data/ubuntu-18.04.csv | 1 + lgsm/data/ubuntu-20.04.csv | 1 + lgsm/data/ubuntu-21.04.csv | 1 + lgsm/data/ubuntu-21.10.csv | 1 + lgsm/data/ubuntu-22.04.csv | 1 + lgsm/functions/info_game.sh | 15 +- lgsm/functions/info_messages.sh | 12 +- lgsm/functions/install_config.sh | 7 + 24 files changed, 239 insertions(+), 2 deletions(-) create mode 100644 lgsm/config-default/config-lgsm/ckserver/_default.cfg diff --git a/lgsm/config-default/config-lgsm/ckserver/_default.cfg b/lgsm/config-default/config-lgsm/ckserver/_default.cfg new file mode 100644 index 000000000..ef1c0618c --- /dev/null +++ b/lgsm/config-default/config-lgsm/ckserver/_default.cfg @@ -0,0 +1,186 @@ +################################## +######## Default Settings ######## +################################## +# DO NOT EDIT, ANY CHANGES WILL BE OVERWRITTEN! +# Copy settings from here and use them in either: +# common.cfg - applies settings to every instance. +# [instance].cfg - applies settings to a specific instance. + +#### Game Server Settings #### + +ip="0.0.0.0" +port="1234" + +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="-batchmode -ip ${ip} -port ${port} -datapath ${servercfgdir} -logfile ${gamelog}" + +#### LinuxGSM Settings #### + +## LinuxGSM Stats +# Send useful stats to LinuxGSM developers. +# https://docs.linuxgsm.com/configuration/linuxgsm-stats +# (on|off) +stats="off" + +## Notification Alerts +# (on|off) + +# Display IP | https://docs.linuxgsm.com/alerts#display-ip +displayip="" + +# More info | https://docs.linuxgsm.com/alerts#more-info +postalert="off" + +# Discord Alerts | https://docs.linuxgsm.com/alerts/discord +discordalert="off" +discordwebhook="webhook" + +# Email Alerts | https://docs.linuxgsm.com/alerts/email +emailalert="off" +email="email@example.com" +emailfrom="" + +# Gotify Alerts | https://docs.linuxgsm.com/alerts/gotify +gotifyalert="off" +gotifytoken="token" +gotifywebhook="webhook" + +# IFTTT Alerts | https://docs.linuxgsm.com/alerts/ifttt +iftttalert="off" +ifttttoken="accesstoken" +iftttevent="linuxgsm_alert" + +# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun +mailgunalert="off" +mailgunapiregion="us" +mailguntoken="accesstoken" +mailgundomain="example.com" +mailgunemailfrom="alert@example.com" +mailgunemail="email@myemail.com" + +# Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet +pushbulletalert="off" +pushbullettoken="accesstoken" +channeltag="" + +# Pushover Alerts | https://docs.linuxgsm.com/alerts/pushover +pushoveralert="off" +pushovertoken="accesstoken" +pushoveruserkey="userkey" + +# Rocket.Chat Alerts | https://docs.linuxgsm.com/alerts/rocket.chat +rocketchatalert="off" +rocketchatwebhook="webhook" +rocketchattoken="" + +# Slack Alerts | https://docs.linuxgsm.com/alerts/slack +slackalert="off" +slackwebhook="webhook" + +# Telegram Alerts | https://docs.linuxgsm.com/alerts/telegram +# You can add a custom cURL string eg proxy (useful in Russia) in "curlcustomstring". +# For example "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help". +telegramapi="api.telegram.org" +telegramalert="off" +telegramtoken="accesstoken" +telegramchatid="" +curlcustomstring="" + +## Updating | https://docs.linuxgsm.com/commands/update +updateonstart="off" + +## Backup | https://docs.linuxgsm.com/commands/backup +maxbackups="4" +maxbackupdays="30" +stoponbackup="on" + +## Logging | https://docs.linuxgsm.com/features/logging +consolelogging="on" +logdays="7" + +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + +## ANSI Colors | https://docs.linuxgsm.com/features/ansi-colors +ansi="on" + +#### Advanced Settings #### + +## Message Display Time | https://docs.linuxgsm.com/features/message-display-time +sleeptime="0.5" + +## SteamCMD Settings | https://docs.linuxgsm.com/steamcmd +# Server appid +appid="1963720" +steamcmdforcewindows="no" +# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch +branch="" +betapassword="" +# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server +steammaster="true" + +## Stop Mode | https://docs.linuxgsm.com/features/stop-mode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: GoldSrc +# 10: Avorion +# 11: end +stopmode="2" + +## Query mode +# 1: session only +# 2: gamedig (gsquery fallback) +# 3: gamedig +# 4: gsquery +# 5: tcp +querymode="2" +querytype="protocol-valve" + +## Console type +consoleverbose="no" +consoleinteract="no" + +## Game Server Details +# Do not edit +gamename="Core Keeper" +engine="unity3d" +glibc="2.15" + +#### Directories #### +# Edit with care + +## Game Server Directories +systemdir="${serverfiles}" +executabledir="${serverfiles}" +preexecutable="xvfb-run" +executable="./CoreKeeperServer" +servercfgdir="${systemdir}/gamedata/${selfname}" +servercfg="ServerConfig.json" +servercfgdefault="ServerConfig.json" +servercfgfullpath="${servercfgdir}/${servercfg}" + +## Backup Directory +backupdir="${lgsmdir}/backup" + +## Logging Directories +logdir="${rootdir}/log" +gamelogdir="${serverfiles}/logs" +lgsmlogdir="${logdir}/script" +consolelogdir="${logdir}/console" +gamelog="${gamelogdir}/${selfname}-game.log" +lgsmlog="${lgsmlogdir}/${selfname}-script.log" +consolelog="${consolelogdir}/${selfname}-console.log" +alertlog="${lgsmlogdir}/${selfname}-alert.log" +postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" + +## Logs Naming +gamelogdate="${gamelogdir}/${selfname}-game-$(date '+%Y-%m-%d-%H:%M:%S').log" +lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" +consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" diff --git a/lgsm/data/almalinux-8.csv b/lgsm/data/almalinux-8.csv index d14f52f44..13a558282 100644 --- a/lgsm/data/almalinux-8.csv +++ b/lgsm/data/almalinux-8.csv @@ -20,6 +20,7 @@ bt,libicu,dos2unix bt1944 cc cd +ck,xorg-x11-server-Xvfb cmw cod,compat-libstdc++-33.i686 cod2,compat-libstdc++-33.i686 diff --git a/lgsm/data/almalinux-9.csv b/lgsm/data/almalinux-9.csv index d14f52f44..13a558282 100644 --- a/lgsm/data/almalinux-9.csv +++ b/lgsm/data/almalinux-9.csv @@ -20,6 +20,7 @@ bt,libicu,dos2unix bt1944 cc cd +ck,xorg-x11-server-Xvfb cmw cod,compat-libstdc++-33.i686 cod2,compat-libstdc++-33.i686 diff --git a/lgsm/data/centos-7.csv b/lgsm/data/centos-7.csv index c5d633929..847877d88 100644 --- a/lgsm/data/centos-7.csv +++ b/lgsm/data/centos-7.csv @@ -20,6 +20,7 @@ bt,libicu,dos2unix bt1944 cc cd +ck,xorg-x11-server-Xvfb cmw cod,compat-libstdc++-33.i686 cod2,compat-libstdc++-33.i686 diff --git a/lgsm/data/centos-8.csv b/lgsm/data/centos-8.csv index f60a925ce..d9e13a271 100644 --- a/lgsm/data/centos-8.csv +++ b/lgsm/data/centos-8.csv @@ -20,6 +20,7 @@ bt,libicu,dos2unix bt1944 cc cd +ck,xorg-x11-server-Xvfb cmw cod,compat-libstdc++-33.i686 cod2,compat-libstdc++-33.i686 diff --git a/lgsm/data/centos-9.csv b/lgsm/data/centos-9.csv index f60a925ce..d9e13a271 100644 --- a/lgsm/data/centos-9.csv +++ b/lgsm/data/centos-9.csv @@ -20,6 +20,7 @@ bt,libicu,dos2unix bt1944 cc cd +ck,xorg-x11-server-Xvfb cmw cod,compat-libstdc++-33.i686 cod2,compat-libstdc++-33.i686 diff --git a/lgsm/data/debian-10.csv b/lgsm/data/debian-10.csv index 1196db200..499846c75 100644 --- a/lgsm/data/debian-10.csv +++ b/lgsm/data/debian-10.csv @@ -20,6 +20,7 @@ bt,libicu-dev,dos2unix bt1944 cc cd +ck,xvfb cmw cod,libstdc++5:i386 cod2,libstdc++5:i386 diff --git a/lgsm/data/debian-11.csv b/lgsm/data/debian-11.csv index 28b7bd853..1e488fc15 100644 --- a/lgsm/data/debian-11.csv +++ b/lgsm/data/debian-11.csv @@ -20,6 +20,7 @@ bt,libicu-dev,dos2unix bt1944 cc cd +ck,xvfb cmw cod,libstdc++5:i386 cod2,libstdc++5:i386 diff --git a/lgsm/data/debian-9.csv b/lgsm/data/debian-9.csv index 1cfbe6ef8..e71e99c96 100644 --- a/lgsm/data/debian-9.csv +++ b/lgsm/data/debian-9.csv @@ -20,6 +20,7 @@ bt,libicu-dev,dos2unix bt1944 cc cd +ck,xvfb cmw cod,libstdc++5:i386 cod2,libstdc++5:i386 diff --git a/lgsm/data/rhel-7.csv b/lgsm/data/rhel-7.csv index c33ec945f..c9a885f2b 100644 --- a/lgsm/data/rhel-7.csv +++ b/lgsm/data/rhel-7.csv @@ -20,6 +20,7 @@ bt,libicu bt1944 cc cd +ck,xorg-x11-server-Xvfb cmw cod,compat-libstdc++-33.i686 cod2,compat-libstdc++-33.i686 diff --git a/lgsm/data/rhel-8.csv b/lgsm/data/rhel-8.csv index f074b5863..8280391e1 100644 --- a/lgsm/data/rhel-8.csv +++ b/lgsm/data/rhel-8.csv @@ -20,6 +20,7 @@ bt,libicu bt1944 cc cd +ck,xorg-x11-server-Xvfb cmw cod,compat-libstdc++-33.i686 cod2,compat-libstdc++-33.i686 diff --git a/lgsm/data/rhel-9.csv b/lgsm/data/rhel-9.csv index f074b5863..8280391e1 100644 --- a/lgsm/data/rhel-9.csv +++ b/lgsm/data/rhel-9.csv @@ -20,6 +20,7 @@ bt,libicu bt1944 cc cd +ck,xorg-x11-server-Xvfb cmw cod,compat-libstdc++-33.i686 cod2,compat-libstdc++-33.i686 diff --git a/lgsm/data/rocky-8.csv b/lgsm/data/rocky-8.csv index d14f52f44..13a558282 100644 --- a/lgsm/data/rocky-8.csv +++ b/lgsm/data/rocky-8.csv @@ -20,6 +20,7 @@ bt,libicu,dos2unix bt1944 cc cd +ck,xorg-x11-server-Xvfb cmw cod,compat-libstdc++-33.i686 cod2,compat-libstdc++-33.i686 diff --git a/lgsm/data/rocky-9.csv b/lgsm/data/rocky-9.csv index d14f52f44..13a558282 100644 --- a/lgsm/data/rocky-9.csv +++ b/lgsm/data/rocky-9.csv @@ -20,6 +20,7 @@ bt,libicu,dos2unix bt1944 cc cd +ck,xorg-x11-server-Xvfb cmw cod,compat-libstdc++-33.i686 cod2,compat-libstdc++-33.i686 diff --git a/lgsm/data/serverlist.csv b/lgsm/data/serverlist.csv index 3c416fa1d..5c9a6d97a 100644 --- a/lgsm/data/serverlist.csv +++ b/lgsm/data/serverlist.csv @@ -18,6 +18,7 @@ bt,btserver,Barotrauma,ubuntu-22.04 bt1944,bt1944server,Battalion 1944,ubuntu-22.04 cc,ccserver,Codename CURE,ubuntu-22.04 cd,cdserver,Crafting Dead,ubuntu-22.04 +ck,ckserver,Core Keeper,ubuntu-22.04 cmw,cmwserver,Chivalry: Medieval Warfare,ubuntu-22.04 cod,codserver,Call of Duty,ubuntu-22.04 cod2,cod2server,Call of Duty 2,ubuntu-22.04 @@ -128,3 +129,4 @@ wmc,wmcserver,WaterfallMC,ubuntu-22.04 wurm,wurmserver,Wurm Unlimited,ubuntu-22.04 zmr,zmrserver,Zombie Master: Reborn,ubuntu-22.04 zps,zpsserver,Zombie Panic! Source,ubuntu-22.04 + diff --git a/lgsm/data/ubuntu-16.04.csv b/lgsm/data/ubuntu-16.04.csv index 6b6fcd834..a571f8aac 100644 --- a/lgsm/data/ubuntu-16.04.csv +++ b/lgsm/data/ubuntu-16.04.csv @@ -19,6 +19,7 @@ bt,libicu-dev,dos2unix bt1944 cc cd +ck,xvfb cmw cod,libstdc++5:i386 cod2,libstdc++5:i386 diff --git a/lgsm/data/ubuntu-18.04.csv b/lgsm/data/ubuntu-18.04.csv index 1196db200..499846c75 100644 --- a/lgsm/data/ubuntu-18.04.csv +++ b/lgsm/data/ubuntu-18.04.csv @@ -20,6 +20,7 @@ bt,libicu-dev,dos2unix bt1944 cc cd +ck,xvfb cmw cod,libstdc++5:i386 cod2,libstdc++5:i386 diff --git a/lgsm/data/ubuntu-20.04.csv b/lgsm/data/ubuntu-20.04.csv index 240bb6c1e..6ff12422a 100644 --- a/lgsm/data/ubuntu-20.04.csv +++ b/lgsm/data/ubuntu-20.04.csv @@ -20,6 +20,7 @@ bt,libicu-dev,dos2unix bt1944 cc cd +ck,xvfb cmw cod,libstdc++5:i386 cod2,libstdc++5:i386 diff --git a/lgsm/data/ubuntu-21.04.csv b/lgsm/data/ubuntu-21.04.csv index 28b7bd853..1e488fc15 100644 --- a/lgsm/data/ubuntu-21.04.csv +++ b/lgsm/data/ubuntu-21.04.csv @@ -20,6 +20,7 @@ bt,libicu-dev,dos2unix bt1944 cc cd +ck,xvfb cmw cod,libstdc++5:i386 cod2,libstdc++5:i386 diff --git a/lgsm/data/ubuntu-21.10.csv b/lgsm/data/ubuntu-21.10.csv index 8860a2a4d..4760fd5f2 100644 --- a/lgsm/data/ubuntu-21.10.csv +++ b/lgsm/data/ubuntu-21.10.csv @@ -19,6 +19,7 @@ bs bt,libicu-dev bt1944 cc +ck,xvfb cmw cod,libstdc++5:i386 cod2,libstdc++5:i386 diff --git a/lgsm/data/ubuntu-22.04.csv b/lgsm/data/ubuntu-22.04.csv index 8492e08c4..7a64eb422 100644 --- a/lgsm/data/ubuntu-22.04.csv +++ b/lgsm/data/ubuntu-22.04.csv @@ -19,6 +19,7 @@ bs bt,libicu-dev,dos2unix bt1944 cc +ck,xvfb cmw cod,libstdc++5:i386 cod2,libstdc++5:i386 diff --git a/lgsm/functions/info_game.sh b/lgsm/functions/info_game.sh index 80d02dd4d..e4872a8f8 100644 --- a/lgsm/functions/info_game.sh +++ b/lgsm/functions/info_game.sh @@ -307,7 +307,18 @@ fn_info_game_cd() { fi } -fn_info_game_cmw() { +fn_info_game_ck(){ + if [ ! -f "${servercfgfullpath}" ]; then + servername="${unavailable}" + maxplayers="${zero}" + else + servername=$(jq -r '.worldName' "${servercfgfullpath}") + maxplayers=$(jq -r '.maxNumberPlayers' "${servercfgfullpath}") + fi + queryport=$((port + 1)) +} + +fn_info_game_cmw(){ # Config if [ ! -f "${servercfgfullpath}" ]; then adminpassword="${unavailable}" @@ -2395,6 +2406,8 @@ elif [ "${shortname}" == "bt1944" ]; then fn_info_game_bt1944 elif [ "${shortname}" == "cd" ]; then fn_info_game_cd +elif [ "${shortname}" == "ck" ]; then + fn_info_game_ck elif [ "${shortname}" == "cmw" ]; then fn_info_game_cmw elif [ "${shortname}" == "cod" ]; then diff --git a/lgsm/functions/info_messages.sh b/lgsm/functions/info_messages.sh index a78a2f2c2..533dee675 100755 --- a/lgsm/functions/info_messages.sh +++ b/lgsm/functions/info_messages.sh @@ -669,7 +669,7 @@ fn_info_message_ports_edit() { fi done # engines/games that require editing the start parameters. - local ports_edit_array=("av" "col" "fctr" "goldsrc" "hw" "iw3.0" "ioquake3" "qfusion" "rust" "scpsl" "scpslsm" "sol" "spark" "source" "unreal4" "arma3" "dayz" "unt" "vh") + local ports_edit_array=("av" "ck" "col" "fctr" "goldsrc" "hw" "iw3.0" "ioquake3" "qfusion" "rust" "scpsl" "scpslsm" "sol" "spark" "source" "unreal4" "arma3" "dayz" "unt" "vh") for port_edit in "${ports_edit_array[@]}"; do if [ "${engine}" == "${port_edit}" ] || [ "${gamename}" == "${port_edit}" ] || [ "${shortname}" == "${port_edit}" ]; then startparameterslocation="${configdirserver}" @@ -879,6 +879,14 @@ fn_info_messages_cd() { } | column -s $'\t' -t } +fn_info_messages_ck() { + { + fn_port "header" + fn_port "Game" port udp + fn_port "Query" queryport udp + } | column -s $'\t' -t +} + fn_info_message_cmw() { fn_info_message_password_strip { @@ -1689,6 +1697,8 @@ fn_info_message_select_engine() { fn_info_message_bt1944 elif [ "${shortname}" == "cd" ]; then fn_info_messages_cd + elif [ "${shortname}" == "ck" ]; then + fn_info_messages_ck elif [ "${shortname}" == "csgo" ]; then fn_info_message_csgo elif [ "${shortname}" == "cmw" ]; then diff --git a/lgsm/functions/install_config.sh b/lgsm/functions/install_config.sh index b92eb919b..c04db364c 100755 --- a/lgsm/functions/install_config.sh +++ b/lgsm/functions/install_config.sh @@ -297,6 +297,13 @@ elif [ "${shortname}" == "cd" ]; then fn_default_config_remote fn_set_config_vars fn_list_config_locations +elif [ "${shortname}" == "ck" ]; then + gamedirname="CoreKeeper" + array_configs+=( ServerConfig.json ) + fn_fetch_default_config + fn_default_config_remote + fn_set_config_vars + fn_list_config_locations elif [ "${shortname}" == "cod" ]; then gamedirname="CallOfDuty" array_configs+=(server.cfg) From e4e73d25f123f67246e3135780869320808cdc26 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sat, 18 Feb 2023 00:09:46 +0000 Subject: [PATCH 129/161] fix: tidy up dependency csv files --- lgsm/data/almalinux-8.csv | 2 +- lgsm/data/almalinux-9.csv | 2 +- lgsm/data/centos-7.csv | 3 ++- lgsm/data/centos-8.csv | 1 + lgsm/data/centos-9.csv | 1 + lgsm/data/debian-9.csv | 1 + lgsm/data/rhel-7.csv | 6 +++--- lgsm/data/rhel-8.csv | 6 +++--- lgsm/data/rhel-9.csv | 6 +++--- lgsm/data/rocky-8.csv | 2 +- lgsm/data/rocky-9.csv | 2 +- lgsm/data/ubuntu-16.04.csv | 2 ++ lgsm/data/ubuntu-22.04.csv | 4 +++- 13 files changed, 23 insertions(+), 15 deletions(-) diff --git a/lgsm/data/almalinux-8.csv b/lgsm/data/almalinux-8.csv index 13a558282..c7bba1d9c 100644 --- a/lgsm/data/almalinux-8.csv +++ b/lgsm/data/almalinux-8.csv @@ -1,4 +1,4 @@ -all,bc,binutils,bzip2,cpio,curl,epel-release,file,glibc.i686,gzip,hostname,jq,libstdc++.i686,nmap-ncat,python36,tar,tmux,unzip,util-linux,wget,xz +all,bc,binutils,bzip2,cpio,curl,epel-release,file,glibc.i686,gzip,hostname,jq,libstdc++,libstdc++.i686,nmap-ncat,python36,tar,tmux,unzip,util-linux,wget,xz steamcmd,glibc.i686,libstdc++.i686 ac ahl diff --git a/lgsm/data/almalinux-9.csv b/lgsm/data/almalinux-9.csv index 13a558282..c7bba1d9c 100644 --- a/lgsm/data/almalinux-9.csv +++ b/lgsm/data/almalinux-9.csv @@ -1,4 +1,4 @@ -all,bc,binutils,bzip2,cpio,curl,epel-release,file,glibc.i686,gzip,hostname,jq,libstdc++.i686,nmap-ncat,python36,tar,tmux,unzip,util-linux,wget,xz +all,bc,binutils,bzip2,cpio,curl,epel-release,file,glibc.i686,gzip,hostname,jq,libstdc++,libstdc++.i686,nmap-ncat,python36,tar,tmux,unzip,util-linux,wget,xz steamcmd,glibc.i686,libstdc++.i686 ac ahl diff --git a/lgsm/data/centos-7.csv b/lgsm/data/centos-7.csv index 847877d88..e997a2e5e 100644 --- a/lgsm/data/centos-7.csv +++ b/lgsm/data/centos-7.csv @@ -1,4 +1,4 @@ -all,bc,binutils,bzip2,cpio,curl,epel-release,file,glibc.i686,gzip,hostname,jq,libstdc++.i686,nmap-ncat,python3,tar,tmux,unzip,util-linux,wget,xz +all,bc,binutils,bzip2,cpio,curl,epel-release,file,glibc.i686,gzip,hostname,jq,libstdc++,libstdc++.i686,nmap-ncat,python3,tar,tmux,unzip,util-linux,wget,xz steamcmd,glibc.i686,libstdc++.i686 ac ahl @@ -122,6 +122,7 @@ ut3 ut99 vh,glibc-devel vints,mono-complete +vpmc,java-11-openjdk vs wet wf diff --git a/lgsm/data/centos-8.csv b/lgsm/data/centos-8.csv index d9e13a271..c7bba1d9c 100644 --- a/lgsm/data/centos-8.csv +++ b/lgsm/data/centos-8.csv @@ -105,6 +105,7 @@ sof2 sol squad st +stn sven terraria tf2,libcurl.i686 diff --git a/lgsm/data/centos-9.csv b/lgsm/data/centos-9.csv index d9e13a271..c7bba1d9c 100644 --- a/lgsm/data/centos-9.csv +++ b/lgsm/data/centos-9.csv @@ -105,6 +105,7 @@ sof2 sol squad st +stn sven terraria tf2,libcurl.i686 diff --git a/lgsm/data/debian-9.csv b/lgsm/data/debian-9.csv index e71e99c96..5fe112702 100644 --- a/lgsm/data/debian-9.csv +++ b/lgsm/data/debian-9.csv @@ -122,6 +122,7 @@ ut3 ut99 vh,libc6-dev vints,mono-complete +vpmc,openjdk-8-jre vs wet wf diff --git a/lgsm/data/rhel-7.csv b/lgsm/data/rhel-7.csv index c9a885f2b..0016a5665 100644 --- a/lgsm/data/rhel-7.csv +++ b/lgsm/data/rhel-7.csv @@ -1,4 +1,4 @@ -all,bc,binutils,bzip2,cpio,curl,epel-release,file,glibc.i686,gzip,hostname,jq,libstdc++.i686,nmap-ncat,python36,tar,tmux,unzip,util-linux,wget,xz +all,bc,binutils,bzip2,cpio,curl,epel-release,file,glibc.i686,gzip,hostname,jq,libstdc++,libstdc++.i686,nmap-ncat,python36,tar,tmux,unzip,util-linux,wget,xz steamcmd,glibc.i686,libstdc++.i686 ac ahl @@ -16,7 +16,7 @@ bfv,compat-libstdc++-33.i686,glibc.i686 bmdm,ncurses-libs.i686 bo bs -bt,libicu +bt,libicu,dos2unix bt1944 cc cd @@ -68,7 +68,7 @@ mcb,libnsl mh mohaa,compat-libstdc++-33.i686 mom -mta +mta,ncurses-libs mumble nd nec diff --git a/lgsm/data/rhel-8.csv b/lgsm/data/rhel-8.csv index 8280391e1..c7bba1d9c 100644 --- a/lgsm/data/rhel-8.csv +++ b/lgsm/data/rhel-8.csv @@ -1,4 +1,4 @@ -all,bc,binutils,bzip2,cpio,curl,epel-release,file,glibc.i686,gzip,hostname,jq,libstdc++.i686,nmap-ncat,python36,tar,tmux,unzip,util-linux,wget,xz +all,bc,binutils,bzip2,cpio,curl,epel-release,file,glibc.i686,gzip,hostname,jq,libstdc++,libstdc++.i686,nmap-ncat,python36,tar,tmux,unzip,util-linux,wget,xz steamcmd,glibc.i686,libstdc++.i686 ac ahl @@ -16,7 +16,7 @@ bfv,compat-libstdc++-33.i686,glibc.i686 bmdm,ncurses-libs.i686 bo bs -bt,libicu +bt,libicu,dos2unix bt1944 cc cd @@ -68,7 +68,7 @@ mcb,libnsl mh mohaa,compat-libstdc++-33.i686 mom -mta +mta,ncurses-compat-libs mumble nd nec diff --git a/lgsm/data/rhel-9.csv b/lgsm/data/rhel-9.csv index 8280391e1..c7bba1d9c 100644 --- a/lgsm/data/rhel-9.csv +++ b/lgsm/data/rhel-9.csv @@ -1,4 +1,4 @@ -all,bc,binutils,bzip2,cpio,curl,epel-release,file,glibc.i686,gzip,hostname,jq,libstdc++.i686,nmap-ncat,python36,tar,tmux,unzip,util-linux,wget,xz +all,bc,binutils,bzip2,cpio,curl,epel-release,file,glibc.i686,gzip,hostname,jq,libstdc++,libstdc++.i686,nmap-ncat,python36,tar,tmux,unzip,util-linux,wget,xz steamcmd,glibc.i686,libstdc++.i686 ac ahl @@ -16,7 +16,7 @@ bfv,compat-libstdc++-33.i686,glibc.i686 bmdm,ncurses-libs.i686 bo bs -bt,libicu +bt,libicu,dos2unix bt1944 cc cd @@ -68,7 +68,7 @@ mcb,libnsl mh mohaa,compat-libstdc++-33.i686 mom -mta +mta,ncurses-compat-libs mumble nd nec diff --git a/lgsm/data/rocky-8.csv b/lgsm/data/rocky-8.csv index 13a558282..c7bba1d9c 100644 --- a/lgsm/data/rocky-8.csv +++ b/lgsm/data/rocky-8.csv @@ -1,4 +1,4 @@ -all,bc,binutils,bzip2,cpio,curl,epel-release,file,glibc.i686,gzip,hostname,jq,libstdc++.i686,nmap-ncat,python36,tar,tmux,unzip,util-linux,wget,xz +all,bc,binutils,bzip2,cpio,curl,epel-release,file,glibc.i686,gzip,hostname,jq,libstdc++,libstdc++.i686,nmap-ncat,python36,tar,tmux,unzip,util-linux,wget,xz steamcmd,glibc.i686,libstdc++.i686 ac ahl diff --git a/lgsm/data/rocky-9.csv b/lgsm/data/rocky-9.csv index 13a558282..c7bba1d9c 100644 --- a/lgsm/data/rocky-9.csv +++ b/lgsm/data/rocky-9.csv @@ -1,4 +1,4 @@ -all,bc,binutils,bzip2,cpio,curl,epel-release,file,glibc.i686,gzip,hostname,jq,libstdc++.i686,nmap-ncat,python36,tar,tmux,unzip,util-linux,wget,xz +all,bc,binutils,bzip2,cpio,curl,epel-release,file,glibc.i686,gzip,hostname,jq,libstdc++,libstdc++.i686,nmap-ncat,python36,tar,tmux,unzip,util-linux,wget,xz steamcmd,glibc.i686,libstdc++.i686 ac ahl diff --git a/lgsm/data/ubuntu-16.04.csv b/lgsm/data/ubuntu-16.04.csv index a571f8aac..e1cfa166b 100644 --- a/lgsm/data/ubuntu-16.04.csv +++ b/lgsm/data/ubuntu-16.04.csv @@ -5,6 +5,7 @@ ahl ahl2 ark arma3 +armar,libcurl4 ats av bb @@ -121,6 +122,7 @@ ut3 ut99 vh,libc6-dev vints,mono-complete +vpmc,openjdk-8-jre vs wet wf diff --git a/lgsm/data/ubuntu-22.04.csv b/lgsm/data/ubuntu-22.04.csv index 7a64eb422..123529324 100644 --- a/lgsm/data/ubuntu-22.04.csv +++ b/lgsm/data/ubuntu-22.04.csv @@ -20,6 +20,7 @@ bt,libicu-dev,dos2unix bt1944 cc ck,xvfb +cd cmw cod,libstdc++5:i386 cod2,libstdc++5:i386 @@ -32,6 +33,7 @@ cscz csgo css,libtinfo5:i386 dab +dayz dmc dod dodr @@ -120,7 +122,7 @@ ut3 ut99 vh,libc6-dev vints,mono-complete -vpmc,openjdk-11-jre +vpmc,openjdk-17-jre vs wet wf From 508737007423827da120c36d7759272e21ba1507 Mon Sep 17 00:00:00 2001 From: Christian Date: Sun, 19 Feb 2023 22:46:17 +0100 Subject: [PATCH 130/161] fix(mc): dependencies bump java version to 17 for rhel 8+ (#4118) --- lgsm/data/almalinux-8.csv | 8 ++++---- lgsm/data/almalinux-9.csv | 8 ++++---- lgsm/data/centos-8.csv | 8 ++++---- lgsm/data/centos-9.csv | 8 ++++---- lgsm/data/rhel-8.csv | 8 ++++---- lgsm/data/rhel-9.csv | 8 ++++---- lgsm/data/rocky-8.csv | 8 ++++---- lgsm/data/rocky-9.csv | 8 ++++---- 8 files changed, 32 insertions(+), 32 deletions(-) diff --git a/lgsm/data/almalinux-8.csv b/lgsm/data/almalinux-8.csv index c7bba1d9c..9f341fb99 100644 --- a/lgsm/data/almalinux-8.csv +++ b/lgsm/data/almalinux-8.csv @@ -63,7 +63,7 @@ kf2 l4d l4d2 lo -mc,java-11-openjdk +mc,java-17-openjdk mcb,libnsl mh mohaa,compat-libstdc++-33.i686 @@ -79,7 +79,7 @@ ns2c,speex.i686,tbb.i686 onset,mariadb-connector-c opfor pc -pmc,java-11-openjdk +pmc,java-17-openjdk pstbs,GConf2 pvkii pvr,libcxx @@ -122,11 +122,11 @@ ut3 ut99 vh,glibc-devel vints,mono-complete -vpmc,java-11-openjdk +vpmc,java-17-openjdk vs wet wf -wmc,java-11-openjdk +wmc,java-17-openjdk wurm,xorg-x11-server-Xvfb zmr,ncurses-libs.i686 zps,ncurses-libs.i686 diff --git a/lgsm/data/almalinux-9.csv b/lgsm/data/almalinux-9.csv index c7bba1d9c..9f341fb99 100644 --- a/lgsm/data/almalinux-9.csv +++ b/lgsm/data/almalinux-9.csv @@ -63,7 +63,7 @@ kf2 l4d l4d2 lo -mc,java-11-openjdk +mc,java-17-openjdk mcb,libnsl mh mohaa,compat-libstdc++-33.i686 @@ -79,7 +79,7 @@ ns2c,speex.i686,tbb.i686 onset,mariadb-connector-c opfor pc -pmc,java-11-openjdk +pmc,java-17-openjdk pstbs,GConf2 pvkii pvr,libcxx @@ -122,11 +122,11 @@ ut3 ut99 vh,glibc-devel vints,mono-complete -vpmc,java-11-openjdk +vpmc,java-17-openjdk vs wet wf -wmc,java-11-openjdk +wmc,java-17-openjdk wurm,xorg-x11-server-Xvfb zmr,ncurses-libs.i686 zps,ncurses-libs.i686 diff --git a/lgsm/data/centos-8.csv b/lgsm/data/centos-8.csv index c7bba1d9c..9f341fb99 100644 --- a/lgsm/data/centos-8.csv +++ b/lgsm/data/centos-8.csv @@ -63,7 +63,7 @@ kf2 l4d l4d2 lo -mc,java-11-openjdk +mc,java-17-openjdk mcb,libnsl mh mohaa,compat-libstdc++-33.i686 @@ -79,7 +79,7 @@ ns2c,speex.i686,tbb.i686 onset,mariadb-connector-c opfor pc -pmc,java-11-openjdk +pmc,java-17-openjdk pstbs,GConf2 pvkii pvr,libcxx @@ -122,11 +122,11 @@ ut3 ut99 vh,glibc-devel vints,mono-complete -vpmc,java-11-openjdk +vpmc,java-17-openjdk vs wet wf -wmc,java-11-openjdk +wmc,java-17-openjdk wurm,xorg-x11-server-Xvfb zmr,ncurses-libs.i686 zps,ncurses-libs.i686 diff --git a/lgsm/data/centos-9.csv b/lgsm/data/centos-9.csv index c7bba1d9c..9f341fb99 100644 --- a/lgsm/data/centos-9.csv +++ b/lgsm/data/centos-9.csv @@ -63,7 +63,7 @@ kf2 l4d l4d2 lo -mc,java-11-openjdk +mc,java-17-openjdk mcb,libnsl mh mohaa,compat-libstdc++-33.i686 @@ -79,7 +79,7 @@ ns2c,speex.i686,tbb.i686 onset,mariadb-connector-c opfor pc -pmc,java-11-openjdk +pmc,java-17-openjdk pstbs,GConf2 pvkii pvr,libcxx @@ -122,11 +122,11 @@ ut3 ut99 vh,glibc-devel vints,mono-complete -vpmc,java-11-openjdk +vpmc,java-17-openjdk vs wet wf -wmc,java-11-openjdk +wmc,java-17-openjdk wurm,xorg-x11-server-Xvfb zmr,ncurses-libs.i686 zps,ncurses-libs.i686 diff --git a/lgsm/data/rhel-8.csv b/lgsm/data/rhel-8.csv index c7bba1d9c..9f341fb99 100644 --- a/lgsm/data/rhel-8.csv +++ b/lgsm/data/rhel-8.csv @@ -63,7 +63,7 @@ kf2 l4d l4d2 lo -mc,java-11-openjdk +mc,java-17-openjdk mcb,libnsl mh mohaa,compat-libstdc++-33.i686 @@ -79,7 +79,7 @@ ns2c,speex.i686,tbb.i686 onset,mariadb-connector-c opfor pc -pmc,java-11-openjdk +pmc,java-17-openjdk pstbs,GConf2 pvkii pvr,libcxx @@ -122,11 +122,11 @@ ut3 ut99 vh,glibc-devel vints,mono-complete -vpmc,java-11-openjdk +vpmc,java-17-openjdk vs wet wf -wmc,java-11-openjdk +wmc,java-17-openjdk wurm,xorg-x11-server-Xvfb zmr,ncurses-libs.i686 zps,ncurses-libs.i686 diff --git a/lgsm/data/rhel-9.csv b/lgsm/data/rhel-9.csv index c7bba1d9c..9f341fb99 100644 --- a/lgsm/data/rhel-9.csv +++ b/lgsm/data/rhel-9.csv @@ -63,7 +63,7 @@ kf2 l4d l4d2 lo -mc,java-11-openjdk +mc,java-17-openjdk mcb,libnsl mh mohaa,compat-libstdc++-33.i686 @@ -79,7 +79,7 @@ ns2c,speex.i686,tbb.i686 onset,mariadb-connector-c opfor pc -pmc,java-11-openjdk +pmc,java-17-openjdk pstbs,GConf2 pvkii pvr,libcxx @@ -122,11 +122,11 @@ ut3 ut99 vh,glibc-devel vints,mono-complete -vpmc,java-11-openjdk +vpmc,java-17-openjdk vs wet wf -wmc,java-11-openjdk +wmc,java-17-openjdk wurm,xorg-x11-server-Xvfb zmr,ncurses-libs.i686 zps,ncurses-libs.i686 diff --git a/lgsm/data/rocky-8.csv b/lgsm/data/rocky-8.csv index c7bba1d9c..9f341fb99 100644 --- a/lgsm/data/rocky-8.csv +++ b/lgsm/data/rocky-8.csv @@ -63,7 +63,7 @@ kf2 l4d l4d2 lo -mc,java-11-openjdk +mc,java-17-openjdk mcb,libnsl mh mohaa,compat-libstdc++-33.i686 @@ -79,7 +79,7 @@ ns2c,speex.i686,tbb.i686 onset,mariadb-connector-c opfor pc -pmc,java-11-openjdk +pmc,java-17-openjdk pstbs,GConf2 pvkii pvr,libcxx @@ -122,11 +122,11 @@ ut3 ut99 vh,glibc-devel vints,mono-complete -vpmc,java-11-openjdk +vpmc,java-17-openjdk vs wet wf -wmc,java-11-openjdk +wmc,java-17-openjdk wurm,xorg-x11-server-Xvfb zmr,ncurses-libs.i686 zps,ncurses-libs.i686 diff --git a/lgsm/data/rocky-9.csv b/lgsm/data/rocky-9.csv index c7bba1d9c..9f341fb99 100644 --- a/lgsm/data/rocky-9.csv +++ b/lgsm/data/rocky-9.csv @@ -63,7 +63,7 @@ kf2 l4d l4d2 lo -mc,java-11-openjdk +mc,java-17-openjdk mcb,libnsl mh mohaa,compat-libstdc++-33.i686 @@ -79,7 +79,7 @@ ns2c,speex.i686,tbb.i686 onset,mariadb-connector-c opfor pc -pmc,java-11-openjdk +pmc,java-17-openjdk pstbs,GConf2 pvkii pvr,libcxx @@ -122,11 +122,11 @@ ut3 ut99 vh,glibc-devel vints,mono-complete -vpmc,java-11-openjdk +vpmc,java-17-openjdk vs wet wf -wmc,java-11-openjdk +wmc,java-17-openjdk wurm,xorg-x11-server-Xvfb zmr,ncurses-libs.i686 zps,ncurses-libs.i686 From 9a026ecdd4dd6916207930aef036bd66d7c16ce8 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Mon, 20 Feb 2023 00:27:18 +0000 Subject: [PATCH 131/161] fix: re-add core_getop.sh --- linuxgsm.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/linuxgsm.sh b/linuxgsm.sh index a0eb306f6..0f36ebcaa 100755 --- a/linuxgsm.sh +++ b/linuxgsm.sh @@ -512,4 +512,7 @@ else # Enables ANSI colours from core_messages.sh. Can be disabled with ansi=off. fn_ansi_loader + + getopt=$1 + core_getopt.sh fi From ba339d9d3b07a6a1f54fe47a546fe74bfae07dfe Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Fri, 24 Feb 2023 00:37:31 +0000 Subject: [PATCH 132/161] fix: remove unnecessary sleep --- lgsm/functions/core_dl.sh | 2 -- 1 file changed, 2 deletions(-) diff --git a/lgsm/functions/core_dl.sh b/lgsm/functions/core_dl.sh index cc5af1809..c4faa6517 100755 --- a/lgsm/functions/core_dl.sh +++ b/lgsm/functions/core_dl.sh @@ -301,7 +301,6 @@ fn_check_file() { fi else fn_print_ok_eol - sleep 0.3 echo -en "\033[2K\\r" if [ -f "${lgsmlog}" ]; then fn_script_log_pass "Checking ${remote_filename}" @@ -398,7 +397,6 @@ fn_fetch_file() { fi else fn_print_ok_eol - sleep 0.3 echo -en "\033[2K\\r" if [ -f "${lgsmlog}" ]; then fn_script_log_pass "Downloading ${local_filename}" From 4898caa345d429144713754459d896805e6082b3 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Fri, 24 Feb 2023 00:59:37 +0000 Subject: [PATCH 133/161] feat: add 24h caching to external ip gathering this will prevent querying of external ip tool repeatedly Also tidied up a few rm commands --- lgsm/functions/command_dev_debug.sh | 2 +- lgsm/functions/command_fastdl.sh | 4 ++-- lgsm/functions/command_start.sh | 2 +- lgsm/functions/core_dl.sh | 2 +- lgsm/functions/core_steamcmd.sh | 2 +- lgsm/functions/info_game.sh | 31 +++++++++++++---------------- lgsm/functions/info_stats.sh | 2 +- lgsm/functions/mods_core.sh | 4 ++-- linuxgsm.sh | 2 +- tests/tests_fctrserver.sh | 2 +- tests/tests_jc2server.sh | 2 +- tests/tests_mcserver.sh | 2 +- tests/tests_ts3server.sh | 2 +- 13 files changed, 28 insertions(+), 31 deletions(-) diff --git a/lgsm/functions/command_dev_debug.sh b/lgsm/functions/command_dev_debug.sh index 957709898..19f16d58e 100755 --- a/lgsm/functions/command_dev_debug.sh +++ b/lgsm/functions/command_dev_debug.sh @@ -11,7 +11,7 @@ functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_firstcommand_reset if [ -f "${rootdir}/.dev-debug" ]; then - rm "${rootdir:?}/.dev-debug" + rm -f "${rootdir:?}/.dev-debug" fn_print_ok_nl "Disabled dev-debug" fn_script_log_info "Disabled dev-debug" else diff --git a/lgsm/functions/command_fastdl.sh b/lgsm/functions/command_fastdl.sh index e90ccc5e0..78abd650a 100755 --- a/lgsm/functions/command_fastdl.sh +++ b/lgsm/functions/command_fastdl.sh @@ -68,7 +68,7 @@ fn_clear_old_fastdl() { # Clearing old FastDL. if [ -d "${fastdldir}" ]; then echo -en "clearing existing FastDL directory ${fastdldir}..." - rm -fR "${fastdldir:?}" + rm -rf "${fastdldir:?}" exitcode=$? if [ "${exitcode}" != 0 ]; then fn_print_fail_eol_nl @@ -277,7 +277,7 @@ fn_fastdl_gmod() { # Clear addons directory in fastdl. echo -en "clearing addons dir from fastdl dir..." fn_sleep_time - rm -fR "${fastdldir:?}/addons" + rm -rf "${fastdldir:?}/addons" exitcode=$? if [ "${exitcode}" != 0 ]; then fn_print_fail_eol_nl diff --git a/lgsm/functions/command_start.sh b/lgsm/functions/command_start.sh index d10240fa7..4b01984f4 100755 --- a/lgsm/functions/command_start.sh +++ b/lgsm/functions/command_start.sh @@ -171,7 +171,7 @@ fn_start_tmux() { fn_print_ok "${servername}" fn_script_log_pass "Started ${servername}" fi - rm "${lgsmlogdir:?}/.${selfname}-tmux-error.tmp" 2> /dev/null + rm -f "${lgsmlogdir:?}/.${selfname}-tmux-error.tmp" 2> /dev/null echo -en "\n" } diff --git a/lgsm/functions/core_dl.sh b/lgsm/functions/core_dl.sh index c4faa6517..2e6db690e 100755 --- a/lgsm/functions/core_dl.sh +++ b/lgsm/functions/core_dl.sh @@ -374,7 +374,7 @@ fn_fetch_file() { # Download will fail if downloads a html file. if [ -f "${local_filedir}/${local_filename}" ]; then if [ -n "$(head "${local_filedir}/${local_filename}" | grep "DOCTYPE")" ]; then - rm "${local_filedir:?}/${local_filename:?}" + rm -f "${local_filedir:?}/${local_filename:?}" local exitcode=2 fi fi diff --git a/lgsm/functions/core_steamcmd.sh b/lgsm/functions/core_steamcmd.sh index 5b95adc81..9d54cfde1 100755 --- a/lgsm/functions/core_steamcmd.sh +++ b/lgsm/functions/core_steamcmd.sh @@ -73,7 +73,7 @@ fn_check_steamcmd_dir() { # Symbolic links to Steam installation directory. if [ ! -L "${HOME}/.steam/root" ]; then if [ -d "${HOME}/.steam/root" ]; then - rm "${HOME}/.steam/root" + rm -f "${HOME:?}/.steam/root" fi ln -s "${XDG_DATA_HOME:="${HOME}/.local/share"}/Steam" "${HOME}/.steam/root" fi diff --git a/lgsm/functions/info_game.sh b/lgsm/functions/info_game.sh index e4872a8f8..5814cd832 100644 --- a/lgsm/functions/info_game.sh +++ b/lgsm/functions/info_game.sh @@ -2561,27 +2561,24 @@ elif [ "${engine}" == "unreal2" ]; then fi # External IP address -if [ -z "${extip}" ]; then +# Cache external IP address for 24 hours +if [ -f "${tmpdir}/extip.txt" ]; then + if [ "$(find "${tmpdir}/extip.txt" -mmin +1440)" ]; then + rm -f "${tmpdir:?}/extip.txt" + fi +fi + +if [ ! -f "${tmpdir}/extip.txt" ]; then extip="$(curl --connect-timeout 10 -s https://api.ipify.org 2> /dev/null)" exitcode=$? - # Should ifconfig.co return an error will use last known IP. - if [ ${exitcode} -eq 0 ]; then - if [[ "${extip}" != *"DOCTYPE"* ]]; then - echo -e "${extip}" > "${tmpdir}/extip.txt" - else - if [ -f "${tmpdir}/extip.txt" ]; then - extip="$(cat "${tmpdir}/extip.txt")" - else - fn_print_error_nl "Unable to get external IP" - fi - fi + # if curl passes add extip to externalip.txt + if [ "${exitcode}" == "0" ]; then + echo "${extip}" > "${tmpdir}/extip.txt" else - if [ -f "${tmpdir}/extip.txt" ]; then - extip="$(cat "${tmpdir}/extip.txt")" - else - fn_print_error_nl "Unable to get external IP" - fi + echo "Unable to get external IP address" fi +else + extip="$(cat "${tmpdir}/extip.txt")" fi # Alert IP address diff --git a/lgsm/functions/info_stats.sh b/lgsm/functions/info_stats.sh index 93c01cf32..0589770f6 100755 --- a/lgsm/functions/info_stats.sh +++ b/lgsm/functions/info_stats.sh @@ -12,7 +12,7 @@ info_distro.sh # remove uuid that was used in v20.2.0 and below if [ -f "${datadir}/uuid.txt" ]; then - rm "${datadir:?}/uuid.txt" + rm -f "${datadir:?}/uuid.txt" fi # generate uuid's diff --git a/lgsm/functions/mods_core.sh b/lgsm/functions/mods_core.sh index 7e2d097a7..e79ceb9ad 100755 --- a/lgsm/functions/mods_core.sh +++ b/lgsm/functions/mods_core.sh @@ -440,7 +440,7 @@ fn_mods_create_tmp_dir() { fn_mods_clear_tmp_dir() { if [ -d "${modstmpdir}" ]; then echo -en "clearing mod download directory ${modstmpdir}..." - rm -fr "${modstmpdir:?}" + rm -rf "${modstmpdir:?}" exitcode=$? if [ "${exitcode}" != 0 ]; then fn_print_fail_eol_nl @@ -742,7 +742,7 @@ fn_mod_remove_amxmodx_file() { # if file is empty, remove it. if [ -f "${modinstalldir}/addons/metamod/plugins.ini" ]; then - rm "${modinstalldir}/addons/metamod/plugins.ini" + rm -f "${modinstalldir}/addons/metamod/plugins.ini" fn_script_log_pass "file removed ${modinstalldir}/addons/metamod/plugins.ini because it was empty" fi fi diff --git a/linuxgsm.sh b/linuxgsm.sh index 0f36ebcaa..3e4812439 100755 --- a/linuxgsm.sh +++ b/linuxgsm.sh @@ -113,7 +113,7 @@ fn_bootstrap_fetch_file() { # Download will fail if downloads a html file. if [ -f "${local_filedir}/${local_filename}" ]; then if [ -n "$(head "${local_filedir}/${local_filename}" | grep "DOCTYPE")" ]; then - rm "${local_filedir:?}/${local_filename:?}" + rm -f "${local_filedir:?}/${local_filename:?}" local exitcode=2 fi fi diff --git a/tests/tests_fctrserver.sh b/tests/tests_fctrserver.sh index 0c1e02d67..11ed61f93 100644 --- a/tests/tests_fctrserver.sh +++ b/tests/tests_fctrserver.sh @@ -112,7 +112,7 @@ fn_bootstrap_fetch_file() { # Download will fail if downloads a html file. if [ -f "${local_filedir}/${local_filename}" ]; then if [ -n "$(head "${local_filedir}/${local_filename}" | grep "DOCTYPE")" ]; then - rm "${local_filedir:?}/${local_filename:?}" + rm -f "${local_filedir:?}/${local_filename:?}" local exitcode=2 fi fi diff --git a/tests/tests_jc2server.sh b/tests/tests_jc2server.sh index 62736d50b..5e0158b7a 100644 --- a/tests/tests_jc2server.sh +++ b/tests/tests_jc2server.sh @@ -113,7 +113,7 @@ fn_bootstrap_fetch_file() { # Download will fail if downloads a html file. if [ -f "${local_filedir}/${local_filename}" ]; then if [ -n "$(head "${local_filedir}/${local_filename}" | grep "DOCTYPE")" ]; then - rm "${local_filedir:?}/${local_filename:?}" + rm -f "${local_filedir:?}/${local_filename:?}" local exitcode=2 fi fi diff --git a/tests/tests_mcserver.sh b/tests/tests_mcserver.sh index 6fe28715b..560484910 100644 --- a/tests/tests_mcserver.sh +++ b/tests/tests_mcserver.sh @@ -113,7 +113,7 @@ fn_bootstrap_fetch_file() { # Download will fail if downloads a html file. if [ -f "${local_filedir}/${local_filename}" ]; then if [ -n "$(head "${local_filedir}/${local_filename}" | grep "DOCTYPE")" ]; then - rm "${local_filedir:?}/${local_filename:?}" + rm -f "${local_filedir:?}/${local_filename:?}" local exitcode=2 fi fi diff --git a/tests/tests_ts3server.sh b/tests/tests_ts3server.sh index fa6d62283..731a38518 100644 --- a/tests/tests_ts3server.sh +++ b/tests/tests_ts3server.sh @@ -113,7 +113,7 @@ fn_bootstrap_fetch_file() { # Download will fail if downloads a html file. if [ -f "${local_filedir}/${local_filename}" ]; then if [ -n "$(head "${local_filedir}/${local_filename}" | grep "DOCTYPE")" ]; then - rm "${local_filedir:?}/${local_filename:?}" + rm -f "${local_filedir:?}/${local_filename:?}" local exitcode=2 fi fi From e8cb43a058bbc8aceb25f184e2fc97858788429e Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Mon, 27 Feb 2023 00:23:53 +0000 Subject: [PATCH 134/161] feat(btl): rename bt1944 to btl (#4124) * fix(bt1944): update binary file * feat(btl): rename bt1944 to btl --- .github/labeler.yml | 4 ++-- .../{bt1944server => btlserver}/_default.cfg | 6 +++--- lgsm/data/almalinux-8.csv | 2 +- lgsm/data/almalinux-9.csv | 2 +- lgsm/data/centos-7.csv | 2 +- lgsm/data/centos-8.csv | 2 +- lgsm/data/centos-9.csv | 2 +- lgsm/data/debian-10.csv | 2 +- lgsm/data/debian-11.csv | 2 +- lgsm/data/debian-9.csv | 2 +- lgsm/data/rhel-7.csv | 2 +- lgsm/data/rhel-8.csv | 2 +- lgsm/data/rhel-9.csv | 2 +- lgsm/data/rocky-8.csv | 2 +- lgsm/data/rocky-9.csv | 2 +- lgsm/data/serverlist.csv | 2 +- lgsm/data/ubuntu-16.04.csv | 2 +- lgsm/data/ubuntu-18.04.csv | 2 +- lgsm/data/ubuntu-20.04.csv | 2 +- lgsm/data/ubuntu-21.04.csv | 2 +- lgsm/data/ubuntu-21.10.csv | 2 +- lgsm/data/ubuntu-22.04.csv | 2 +- lgsm/functions/info_game.sh | 10 +++++----- lgsm/functions/info_messages.sh | 6 +++--- lgsm/functions/install_config.sh | 6 +++--- 25 files changed, 36 insertions(+), 36 deletions(-) rename lgsm/config-default/config-lgsm/{bt1944server => btlserver}/_default.cfg (97%) diff --git a/.github/labeler.yml b/.github/labeler.yml index 1ec662f2b..3da0d47ee 100644 --- a/.github/labeler.yml +++ b/.github/labeler.yml @@ -68,8 +68,8 @@ - "/(Avorion)/i" "game: Ballistic Overkill": - "/(Ballistic Overkill)/i" -"game: Battalion 1944": - - "/(Battalion 1944)/i" +"game: BATTALION: Legacy": + - "/(BATTALION: Legacy)/i" "game: Barotrauma": - "/(Barotrauma)/i" "game: Counter-Strike: Global Offensive": diff --git a/lgsm/config-default/config-lgsm/bt1944server/_default.cfg b/lgsm/config-default/config-lgsm/btlserver/_default.cfg similarity index 97% rename from lgsm/config-default/config-lgsm/bt1944server/_default.cfg rename to lgsm/config-default/config-lgsm/btlserver/_default.cfg index 78032cfe0..81173ccb9 100644 --- a/lgsm/config-default/config-lgsm/bt1944server/_default.cfg +++ b/lgsm/config-default/config-lgsm/btlserver/_default.cfg @@ -151,7 +151,7 @@ consoleinteract="no" ## Game Server Details # Do not edit -gamename="Battalion 1944" +gamename="BATTALION: Legacy" engine="unreal4" glibc="2.17" @@ -159,9 +159,9 @@ glibc="2.17" # Edit with care ## Game Server Directories -systemdir="${serverfiles}/Linux/Battalion" +systemdir="${serverfiles}/Battalion" executabledir="${systemdir}/Binaries/Linux" -executable="./BattalionServer" +executable="./BattalionServer-Linux-Shipping" servercfgdir="${systemdir}/Saved/Config/LinuxServer" servercfg="${selfname}.ini" servercfgdefault="DefaultGame.ini" diff --git a/lgsm/data/almalinux-8.csv b/lgsm/data/almalinux-8.csv index 9f341fb99..3d0dd88c9 100644 --- a/lgsm/data/almalinux-8.csv +++ b/lgsm/data/almalinux-8.csv @@ -17,7 +17,7 @@ bmdm,ncurses-libs.i686 bo bs bt,libicu,dos2unix -bt1944 +btl cc cd ck,xorg-x11-server-Xvfb diff --git a/lgsm/data/almalinux-9.csv b/lgsm/data/almalinux-9.csv index 9f341fb99..3d0dd88c9 100644 --- a/lgsm/data/almalinux-9.csv +++ b/lgsm/data/almalinux-9.csv @@ -17,7 +17,7 @@ bmdm,ncurses-libs.i686 bo bs bt,libicu,dos2unix -bt1944 +btl cc cd ck,xorg-x11-server-Xvfb diff --git a/lgsm/data/centos-7.csv b/lgsm/data/centos-7.csv index e997a2e5e..6836a9de0 100644 --- a/lgsm/data/centos-7.csv +++ b/lgsm/data/centos-7.csv @@ -17,7 +17,7 @@ bmdm,ncurses-libs.i686 bo bs bt,libicu,dos2unix -bt1944 +btl cc cd ck,xorg-x11-server-Xvfb diff --git a/lgsm/data/centos-8.csv b/lgsm/data/centos-8.csv index 9f341fb99..3d0dd88c9 100644 --- a/lgsm/data/centos-8.csv +++ b/lgsm/data/centos-8.csv @@ -17,7 +17,7 @@ bmdm,ncurses-libs.i686 bo bs bt,libicu,dos2unix -bt1944 +btl cc cd ck,xorg-x11-server-Xvfb diff --git a/lgsm/data/centos-9.csv b/lgsm/data/centos-9.csv index 9f341fb99..3d0dd88c9 100644 --- a/lgsm/data/centos-9.csv +++ b/lgsm/data/centos-9.csv @@ -17,7 +17,7 @@ bmdm,ncurses-libs.i686 bo bs bt,libicu,dos2unix -bt1944 +btl cc cd ck,xorg-x11-server-Xvfb diff --git a/lgsm/data/debian-10.csv b/lgsm/data/debian-10.csv index 499846c75..41c16331d 100644 --- a/lgsm/data/debian-10.csv +++ b/lgsm/data/debian-10.csv @@ -17,7 +17,7 @@ bmdm,libncurses5:i386 bo bs bt,libicu-dev,dos2unix -bt1944 +btl cc cd ck,xvfb diff --git a/lgsm/data/debian-11.csv b/lgsm/data/debian-11.csv index 1e488fc15..2c67d0d10 100644 --- a/lgsm/data/debian-11.csv +++ b/lgsm/data/debian-11.csv @@ -17,7 +17,7 @@ bmdm,libncurses5:i386 bo bs bt,libicu-dev,dos2unix -bt1944 +btl cc cd ck,xvfb diff --git a/lgsm/data/debian-9.csv b/lgsm/data/debian-9.csv index 5fe112702..20816ad24 100644 --- a/lgsm/data/debian-9.csv +++ b/lgsm/data/debian-9.csv @@ -17,7 +17,7 @@ bmdm,libncurses5:i386 bo bs bt,libicu-dev,dos2unix -bt1944 +btl cc cd ck,xvfb diff --git a/lgsm/data/rhel-7.csv b/lgsm/data/rhel-7.csv index 0016a5665..90c7fd28a 100644 --- a/lgsm/data/rhel-7.csv +++ b/lgsm/data/rhel-7.csv @@ -17,7 +17,7 @@ bmdm,ncurses-libs.i686 bo bs bt,libicu,dos2unix -bt1944 +btl cc cd ck,xorg-x11-server-Xvfb diff --git a/lgsm/data/rhel-8.csv b/lgsm/data/rhel-8.csv index 9f341fb99..3d0dd88c9 100644 --- a/lgsm/data/rhel-8.csv +++ b/lgsm/data/rhel-8.csv @@ -17,7 +17,7 @@ bmdm,ncurses-libs.i686 bo bs bt,libicu,dos2unix -bt1944 +btl cc cd ck,xorg-x11-server-Xvfb diff --git a/lgsm/data/rhel-9.csv b/lgsm/data/rhel-9.csv index 9f341fb99..3d0dd88c9 100644 --- a/lgsm/data/rhel-9.csv +++ b/lgsm/data/rhel-9.csv @@ -17,7 +17,7 @@ bmdm,ncurses-libs.i686 bo bs bt,libicu,dos2unix -bt1944 +btl cc cd ck,xorg-x11-server-Xvfb diff --git a/lgsm/data/rocky-8.csv b/lgsm/data/rocky-8.csv index 9f341fb99..3d0dd88c9 100644 --- a/lgsm/data/rocky-8.csv +++ b/lgsm/data/rocky-8.csv @@ -17,7 +17,7 @@ bmdm,ncurses-libs.i686 bo bs bt,libicu,dos2unix -bt1944 +btl cc cd ck,xorg-x11-server-Xvfb diff --git a/lgsm/data/rocky-9.csv b/lgsm/data/rocky-9.csv index 9f341fb99..3d0dd88c9 100644 --- a/lgsm/data/rocky-9.csv +++ b/lgsm/data/rocky-9.csv @@ -17,7 +17,7 @@ bmdm,ncurses-libs.i686 bo bs bt,libicu,dos2unix -bt1944 +btl cc cd ck,xorg-x11-server-Xvfb diff --git a/lgsm/data/serverlist.csv b/lgsm/data/serverlist.csv index 5c9a6d97a..aff8708e7 100644 --- a/lgsm/data/serverlist.csv +++ b/lgsm/data/serverlist.csv @@ -15,7 +15,7 @@ bmdm,bmdmserver,Black Mesa: Deathmatch,ubuntu-22.04 bo,boserver,Ballistic Overkill,ubuntu-22.04 bs,bsserver,Blade Symphony,ubuntu-22.04 bt,btserver,Barotrauma,ubuntu-22.04 -bt1944,bt1944server,Battalion 1944,ubuntu-22.04 +btl,btlserver,BATTALION: Legacy,ubuntu-22.04 cc,ccserver,Codename CURE,ubuntu-22.04 cd,cdserver,Crafting Dead,ubuntu-22.04 ck,ckserver,Core Keeper,ubuntu-22.04 diff --git a/lgsm/data/ubuntu-16.04.csv b/lgsm/data/ubuntu-16.04.csv index e1cfa166b..f26b7996a 100644 --- a/lgsm/data/ubuntu-16.04.csv +++ b/lgsm/data/ubuntu-16.04.csv @@ -17,7 +17,7 @@ bmdm,libncurses5:i386 bo bs bt,libicu-dev,dos2unix -bt1944 +btl cc cd ck,xvfb diff --git a/lgsm/data/ubuntu-18.04.csv b/lgsm/data/ubuntu-18.04.csv index 499846c75..41c16331d 100644 --- a/lgsm/data/ubuntu-18.04.csv +++ b/lgsm/data/ubuntu-18.04.csv @@ -17,7 +17,7 @@ bmdm,libncurses5:i386 bo bs bt,libicu-dev,dos2unix -bt1944 +btl cc cd ck,xvfb diff --git a/lgsm/data/ubuntu-20.04.csv b/lgsm/data/ubuntu-20.04.csv index 6ff12422a..d32d7e024 100644 --- a/lgsm/data/ubuntu-20.04.csv +++ b/lgsm/data/ubuntu-20.04.csv @@ -17,7 +17,7 @@ bmdm,libncurses5:i386 bo bs bt,libicu-dev,dos2unix -bt1944 +btl cc cd ck,xvfb diff --git a/lgsm/data/ubuntu-21.04.csv b/lgsm/data/ubuntu-21.04.csv index 1e488fc15..2c67d0d10 100644 --- a/lgsm/data/ubuntu-21.04.csv +++ b/lgsm/data/ubuntu-21.04.csv @@ -17,7 +17,7 @@ bmdm,libncurses5:i386 bo bs bt,libicu-dev,dos2unix -bt1944 +btl cc cd ck,xvfb diff --git a/lgsm/data/ubuntu-21.10.csv b/lgsm/data/ubuntu-21.10.csv index 4760fd5f2..88bcd2b09 100644 --- a/lgsm/data/ubuntu-21.10.csv +++ b/lgsm/data/ubuntu-21.10.csv @@ -17,7 +17,7 @@ bmdm,libncurses5:i386 bo bs bt,libicu-dev -bt1944 +btl cc ck,xvfb cmw diff --git a/lgsm/data/ubuntu-22.04.csv b/lgsm/data/ubuntu-22.04.csv index 123529324..d18b8e6fb 100644 --- a/lgsm/data/ubuntu-22.04.csv +++ b/lgsm/data/ubuntu-22.04.csv @@ -17,7 +17,7 @@ bmdm,libncurses5:i386 bo bs bt,libicu-dev,dos2unix -bt1944 +btl cc ck,xvfb cd diff --git a/lgsm/functions/info_game.sh b/lgsm/functions/info_game.sh index 5814cd832..f859653c8 100644 --- a/lgsm/functions/info_game.sh +++ b/lgsm/functions/info_game.sh @@ -264,7 +264,7 @@ fn_info_game_bt() { fi } -fn_info_game_bt1944() { +fn_info_game_btl() { # Config if [ ! -f "${servercfgfullpath}" ]; then servername="${unavailable}" @@ -307,7 +307,7 @@ fn_info_game_cd() { fi } -fn_info_game_ck(){ +fn_info_game_ck() { if [ ! -f "${servercfgfullpath}" ]; then servername="${unavailable}" maxplayers="${zero}" @@ -318,7 +318,7 @@ fn_info_game_ck(){ queryport=$((port + 1)) } -fn_info_game_cmw(){ +fn_info_game_cmw() { # Config if [ ! -f "${servercfgfullpath}" ]; then adminpassword="${unavailable}" @@ -2402,8 +2402,8 @@ elif [ "${shortname}" == "bo" ]; then fn_info_game_bo elif [ "${shortname}" == "bt" ]; then fn_info_game_bt -elif [ "${shortname}" == "bt1944" ]; then - fn_info_game_bt1944 +elif [ "${shortname}" == "btl" ]; then + fn_info_game_btl elif [ "${shortname}" == "cd" ]; then fn_info_game_cd elif [ "${shortname}" == "ck" ]; then diff --git a/lgsm/functions/info_messages.sh b/lgsm/functions/info_messages.sh index 533dee675..74f529bd7 100755 --- a/lgsm/functions/info_messages.sh +++ b/lgsm/functions/info_messages.sh @@ -861,7 +861,7 @@ fn_info_message_bt() { } | column -s $'\t' -t } -fn_info_message_bt1944() { +fn_info_message_btl() { { fn_port "header" fn_port "Game" port udp @@ -1693,8 +1693,8 @@ fn_info_message_select_engine() { fn_info_message_bo elif [ "${shortname}" == "bt" ]; then fn_info_message_bt - elif [ "${shortname}" == "bt1944" ]; then - fn_info_message_bt1944 + elif [ "${shortname}" == "btl" ]; then + fn_info_message_btl elif [ "${shortname}" == "cd" ]; then fn_info_messages_cd elif [ "${shortname}" == "ck" ]; then diff --git a/lgsm/functions/install_config.sh b/lgsm/functions/install_config.sh index c04db364c..dd3bb80c3 100755 --- a/lgsm/functions/install_config.sh +++ b/lgsm/functions/install_config.sh @@ -240,8 +240,8 @@ elif [ "${shortname}" == "bt" ]; then fn_default_config_remote fn_set_config_vars fn_list_config_locations -elif [ "${shortname}" == "bt1944" ]; then - gamedirname="Battalion1944" +elif [ "${shortname}" == "btl" ]; then + gamedirname="BattalionLegacy" fn_check_cfgdir array_configs+=(DefaultGame.ini) fn_fetch_default_config @@ -299,7 +299,7 @@ elif [ "${shortname}" == "cd" ]; then fn_list_config_locations elif [ "${shortname}" == "ck" ]; then gamedirname="CoreKeeper" - array_configs+=( ServerConfig.json ) + array_configs+=(ServerConfig.json) fn_fetch_default_config fn_default_config_remote fn_set_config_vars From 37fb14c78eab21b377e162df1f2f70bc10c67a3f Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Mon, 27 Feb 2023 01:16:43 +0000 Subject: [PATCH 135/161] fix(cmw): correct configsubdir setting --- lgsm/config-default/config-lgsm/cmwserver/_default.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lgsm/config-default/config-lgsm/cmwserver/_default.cfg b/lgsm/config-default/config-lgsm/cmwserver/_default.cfg index 435bde1ea..0f05118e9 100644 --- a/lgsm/config-default/config-lgsm/cmwserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/cmwserver/_default.cfg @@ -15,7 +15,7 @@ queryport="7779" defaultmap="AOCTD-Frigid_p" ## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters -startparameters="${defaultmap}?steamsockets -multihome=${ip} -Port=${port} -QueryPort=${queryport} -seekfreeloadingserver -configsubdir=${gamelogdir} -log=${gamelog}" +startparameters="${defaultmap}?steamsockets -multihome=${ip} -Port=${port} -QueryPort=${queryport} -seekfreeloadingserver -configsubdir=${selfname} -log=${gamelog}" #### LinuxGSM Settings #### From 7eef6330d7599376dced08ca1d2462b1df3bbd72 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Wed, 1 Mar 2023 19:53:47 +0000 Subject: [PATCH 136/161] feat(mumble): remove support for mumble (#4128) deprecate mumble support as Linux is no longer being supported by the Mumble dev team --- .../config-lgsm/mumbleserver/_default.cfg | 169 ------------------ lgsm/data/almalinux-8.csv | 1 - lgsm/data/almalinux-9.csv | 1 - lgsm/data/centos-7.csv | 1 - lgsm/data/centos-8.csv | 1 - lgsm/data/centos-9.csv | 1 - lgsm/data/debian-10.csv | 1 - lgsm/data/debian-11.csv | 1 - lgsm/data/debian-9.csv | 1 - lgsm/data/rhel-7.csv | 1 - lgsm/data/rhel-8.csv | 1 - lgsm/data/rhel-9.csv | 1 - lgsm/data/rocky-8.csv | 1 - lgsm/data/rocky-9.csv | 1 - lgsm/data/serverlist.csv | 1 - lgsm/data/ubuntu-16.04.csv | 1 - lgsm/data/ubuntu-18.04.csv | 1 - lgsm/data/ubuntu-20.04.csv | 1 - lgsm/data/ubuntu-21.04.csv | 1 - lgsm/data/ubuntu-21.10.csv | 1 - lgsm/data/ubuntu-22.04.csv | 1 - lgsm/functions/command_update.sh | 2 - lgsm/functions/core_functions.sh | 5 - lgsm/functions/info_game.sh | 21 --- lgsm/functions/info_messages.sh | 12 +- lgsm/functions/install_config.sh | 6 - lgsm/functions/install_server_files.sh | 2 - lgsm/functions/update_mumble.sh | 143 --------------- 28 files changed, 1 insertion(+), 379 deletions(-) delete mode 100644 lgsm/config-default/config-lgsm/mumbleserver/_default.cfg delete mode 100644 lgsm/functions/update_mumble.sh diff --git a/lgsm/config-default/config-lgsm/mumbleserver/_default.cfg b/lgsm/config-default/config-lgsm/mumbleserver/_default.cfg deleted file mode 100644 index fdb06bfe8..000000000 --- a/lgsm/config-default/config-lgsm/mumbleserver/_default.cfg +++ /dev/null @@ -1,169 +0,0 @@ -################################## -######## Default Settings ######## -################################## -# DO NOT EDIT, ANY CHANGES WILL BE OVERWRITTEN! -# Copy settings from here and use them in either: -# common.cfg - applies settings to every instance. -# [instance].cfg - applies settings to a specific instance. - -#### Game Server Settings #### - -## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters -startparameters="-fg -ini ${servercfgfullpath}" - -#### LinuxGSM Settings #### - -## LinuxGSM Stats -# Send useful stats to LinuxGSM developers. -# https://docs.linuxgsm.com/configuration/linuxgsm-stats -# (on|off) -stats="off" - -## Notification Alerts -# (on|off) - -# Display IP | https://docs.linuxgsm.com/alerts#display-ip -displayip="" - -# More info | https://docs.linuxgsm.com/alerts#more-info -postalert="off" - -# Discord Alerts | https://docs.linuxgsm.com/alerts/discord -discordalert="off" -discordwebhook="webhook" - -# Email Alerts | https://docs.linuxgsm.com/alerts/email -emailalert="off" -email="email@example.com" -emailfrom="" - -# Gotify Alerts | https://docs.linuxgsm.com/alerts/gotify -gotifyalert="off" -gotifytoken="token" -gotifywebhook="webhook" - -# IFTTT Alerts | https://docs.linuxgsm.com/alerts/ifttt -iftttalert="off" -ifttttoken="accesstoken" -iftttevent="linuxgsm_alert" - -# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun -mailgunalert="off" -mailgunapiregion="us" -mailguntoken="accesstoken" -mailgundomain="example.com" -mailgunemailfrom="alert@example.com" -mailgunemail="email@myemail.com" - -# Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet -pushbulletalert="off" -pushbullettoken="accesstoken" -channeltag="" - -# Pushover Alerts | https://docs.linuxgsm.com/alerts/pushover -pushoveralert="off" -pushovertoken="accesstoken" -pushoveruserkey="userkey" - -# Rocket.Chat Alerts | https://docs.linuxgsm.com/alerts/rocket.chat -rocketchatalert="off" -rocketchatwebhook="webhook" -rocketchattoken="" - -# Slack Alerts | https://docs.linuxgsm.com/alerts/slack -slackalert="off" -slackwebhook="webhook" - -# Telegram Alerts | https://docs.linuxgsm.com/alerts/telegram -# You can add a custom cURL string eg proxy (useful in Russia) in "curlcustomstring". -# For example "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help". -telegramapi="api.telegram.org" -telegramalert="off" -telegramtoken="accesstoken" -telegramchatid="" -curlcustomstring="" - -## Updating | https://docs.linuxgsm.com/commands/update -updateonstart="off" - -## Backup | https://docs.linuxgsm.com/commands/backup -maxbackups="4" -maxbackupdays="30" -stoponbackup="on" - -## Logging | https://docs.linuxgsm.com/features/logging -consolelogging="on" -logdays="7" - -## Monitor | https://docs.linuxgsm.com/commands/monitor -# Query delay time -querydelay="1" - -## ANSI Colors | https://docs.linuxgsm.com/features/ansi-colors -ansi="on" - -#### Advanced Settings #### - -## Message Display Time | https://docs.linuxgsm.com/features/message-display-time -sleeptime="0.5" - -## Stop Mode | https://docs.linuxgsm.com/features/stop-mode -# 1: tmux kill -# 2: CTRL+c -# 3: quit -# 4: quit 120s -# 5: stop -# 6: q -# 7: exit -# 8: 7 Days to Die -# 9: GoldSrc -# 10: Avorion -# 11: end -stopmode="2" - -## Query mode -# 1: session only -# 2: gamedig (gsquery fallback) -# 3: gamedig -# 4: gsquery -# 5: tcp -querymode="2" -querytype="mumbleping" - -## Console type -consoleverbose="yes" -consoleinteract="no" - -## Game Server Details -# Do not edit -gamename="Mumble" -engine="null" -glibc="null" - -#### Directories #### -# Edit with care - -## Game Server Directories -systemdir="${serverfiles}" -executabledir="${serverfiles}" -executable="./murmur.x86" -servercfgdir="${systemdir}" -servercfg="${selfname}.ini" -servercfgdefault="murmur.ini" -servercfgfullpath="${servercfgdir}/${servercfg}" - -## Backup Directory -backupdir="${lgsmdir}/backup" - -## Logging Directories -logdir="${rootdir}/log" -lgsmlogdir="${logdir}/script" -consolelogdir="${logdir}/console" -lgsmlog="${lgsmlogdir}/${selfname}-script.log" -consolelog="${consolelogdir}/${selfname}-console.log" -alertlog="${lgsmlogdir}/${selfname}-alert.log" -postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" - -## Logs Naming -lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" -consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" diff --git a/lgsm/data/almalinux-8.csv b/lgsm/data/almalinux-8.csv index 3d0dd88c9..86ff4dc14 100644 --- a/lgsm/data/almalinux-8.csv +++ b/lgsm/data/almalinux-8.csv @@ -69,7 +69,6 @@ mh mohaa,compat-libstdc++-33.i686 mom mta,ncurses-compat-libs -mumble nd nec nmrih,ncurses-libs.i686 diff --git a/lgsm/data/almalinux-9.csv b/lgsm/data/almalinux-9.csv index 3d0dd88c9..86ff4dc14 100644 --- a/lgsm/data/almalinux-9.csv +++ b/lgsm/data/almalinux-9.csv @@ -69,7 +69,6 @@ mh mohaa,compat-libstdc++-33.i686 mom mta,ncurses-compat-libs -mumble nd nec nmrih,ncurses-libs.i686 diff --git a/lgsm/data/centos-7.csv b/lgsm/data/centos-7.csv index 6836a9de0..c1d2b97b8 100644 --- a/lgsm/data/centos-7.csv +++ b/lgsm/data/centos-7.csv @@ -69,7 +69,6 @@ mh mohaa,compat-libstdc++-33.i686 mom mta,ncurses-libs -mumble nd nec nmrih,ncurses-libs.i686 diff --git a/lgsm/data/centos-8.csv b/lgsm/data/centos-8.csv index 3d0dd88c9..86ff4dc14 100644 --- a/lgsm/data/centos-8.csv +++ b/lgsm/data/centos-8.csv @@ -69,7 +69,6 @@ mh mohaa,compat-libstdc++-33.i686 mom mta,ncurses-compat-libs -mumble nd nec nmrih,ncurses-libs.i686 diff --git a/lgsm/data/centos-9.csv b/lgsm/data/centos-9.csv index 3d0dd88c9..86ff4dc14 100644 --- a/lgsm/data/centos-9.csv +++ b/lgsm/data/centos-9.csv @@ -69,7 +69,6 @@ mh mohaa,compat-libstdc++-33.i686 mom mta,ncurses-compat-libs -mumble nd nec nmrih,ncurses-libs.i686 diff --git a/lgsm/data/debian-10.csv b/lgsm/data/debian-10.csv index 41c16331d..768be603f 100644 --- a/lgsm/data/debian-10.csv +++ b/lgsm/data/debian-10.csv @@ -69,7 +69,6 @@ mh mohaa,libstdc++5:i386 mom mta,libncursesw5 -mumble nd nec nmrih,libtinfo5:i386 diff --git a/lgsm/data/debian-11.csv b/lgsm/data/debian-11.csv index 2c67d0d10..021e66e20 100644 --- a/lgsm/data/debian-11.csv +++ b/lgsm/data/debian-11.csv @@ -69,7 +69,6 @@ mh mohaa,libstdc++5:i386 mom mta,libncursesw5 -mumble nd nec nmrih,libtinfo5:i386 diff --git a/lgsm/data/debian-9.csv b/lgsm/data/debian-9.csv index 20816ad24..fa0d6a881 100644 --- a/lgsm/data/debian-9.csv +++ b/lgsm/data/debian-9.csv @@ -69,7 +69,6 @@ mh mohaa,libstdc++5:i386 mom mta,libncursesw5 -mumble nd nec nmrih,libtinfo5:i386 diff --git a/lgsm/data/rhel-7.csv b/lgsm/data/rhel-7.csv index 90c7fd28a..4cfe96848 100644 --- a/lgsm/data/rhel-7.csv +++ b/lgsm/data/rhel-7.csv @@ -69,7 +69,6 @@ mh mohaa,compat-libstdc++-33.i686 mom mta,ncurses-libs -mumble nd nec nmrih,ncurses-libs.i686 diff --git a/lgsm/data/rhel-8.csv b/lgsm/data/rhel-8.csv index 3d0dd88c9..86ff4dc14 100644 --- a/lgsm/data/rhel-8.csv +++ b/lgsm/data/rhel-8.csv @@ -69,7 +69,6 @@ mh mohaa,compat-libstdc++-33.i686 mom mta,ncurses-compat-libs -mumble nd nec nmrih,ncurses-libs.i686 diff --git a/lgsm/data/rhel-9.csv b/lgsm/data/rhel-9.csv index 3d0dd88c9..86ff4dc14 100644 --- a/lgsm/data/rhel-9.csv +++ b/lgsm/data/rhel-9.csv @@ -69,7 +69,6 @@ mh mohaa,compat-libstdc++-33.i686 mom mta,ncurses-compat-libs -mumble nd nec nmrih,ncurses-libs.i686 diff --git a/lgsm/data/rocky-8.csv b/lgsm/data/rocky-8.csv index 3d0dd88c9..86ff4dc14 100644 --- a/lgsm/data/rocky-8.csv +++ b/lgsm/data/rocky-8.csv @@ -69,7 +69,6 @@ mh mohaa,compat-libstdc++-33.i686 mom mta,ncurses-compat-libs -mumble nd nec nmrih,ncurses-libs.i686 diff --git a/lgsm/data/rocky-9.csv b/lgsm/data/rocky-9.csv index 3d0dd88c9..86ff4dc14 100644 --- a/lgsm/data/rocky-9.csv +++ b/lgsm/data/rocky-9.csv @@ -69,7 +69,6 @@ mh mohaa,compat-libstdc++-33.i686 mom mta,ncurses-compat-libs -mumble nd nec nmrih,ncurses-libs.i686 diff --git a/lgsm/data/serverlist.csv b/lgsm/data/serverlist.csv index aff8708e7..ae9ae564c 100644 --- a/lgsm/data/serverlist.csv +++ b/lgsm/data/serverlist.csv @@ -67,7 +67,6 @@ mh,mhserver,MORDHAU,ubuntu-22.04 mohaa,mohaaserver,Medal of Honor: Allied Assault,ubuntu-22.04 mom,momserver,Memories of Mars,ubuntu-22.04 mta,mtaserver,Multi Theft Auto,ubuntu-22.04 -mumble,mumbleserver,Mumble,ubuntu-22.04 nd,ndserver,Nuclear Dawn,ubuntu-22.04 nec,necserver,Necesse,ubuntu-22.04 nmrih,nmrihserver,No More Room in Hell,ubuntu-22.04 diff --git a/lgsm/data/ubuntu-16.04.csv b/lgsm/data/ubuntu-16.04.csv index f26b7996a..d0f8fcebc 100644 --- a/lgsm/data/ubuntu-16.04.csv +++ b/lgsm/data/ubuntu-16.04.csv @@ -69,7 +69,6 @@ mh mohaa,libstdc++5:i386 mom mta -mumble nd nec nmrih,libtinfo5:i386 diff --git a/lgsm/data/ubuntu-18.04.csv b/lgsm/data/ubuntu-18.04.csv index 41c16331d..768be603f 100644 --- a/lgsm/data/ubuntu-18.04.csv +++ b/lgsm/data/ubuntu-18.04.csv @@ -69,7 +69,6 @@ mh mohaa,libstdc++5:i386 mom mta,libncursesw5 -mumble nd nec nmrih,libtinfo5:i386 diff --git a/lgsm/data/ubuntu-20.04.csv b/lgsm/data/ubuntu-20.04.csv index d32d7e024..d4e8d6533 100644 --- a/lgsm/data/ubuntu-20.04.csv +++ b/lgsm/data/ubuntu-20.04.csv @@ -69,7 +69,6 @@ mh mohaa,libstdc++5:i386 mom mta,libncursesw5 -mumble nd nec nmrih,libtinfo5:i386 diff --git a/lgsm/data/ubuntu-21.04.csv b/lgsm/data/ubuntu-21.04.csv index 2c67d0d10..021e66e20 100644 --- a/lgsm/data/ubuntu-21.04.csv +++ b/lgsm/data/ubuntu-21.04.csv @@ -69,7 +69,6 @@ mh mohaa,libstdc++5:i386 mom mta,libncursesw5 -mumble nd nec nmrih,libtinfo5:i386 diff --git a/lgsm/data/ubuntu-21.10.csv b/lgsm/data/ubuntu-21.10.csv index 88bcd2b09..4284cdd9c 100644 --- a/lgsm/data/ubuntu-21.10.csv +++ b/lgsm/data/ubuntu-21.10.csv @@ -67,7 +67,6 @@ mh mohaa,libstdc++5:i386 mom mta,libncursesw5 -mumble nd nec nmrih,libtinfo5:i386 diff --git a/lgsm/data/ubuntu-22.04.csv b/lgsm/data/ubuntu-22.04.csv index d18b8e6fb..5aaacff81 100644 --- a/lgsm/data/ubuntu-22.04.csv +++ b/lgsm/data/ubuntu-22.04.csv @@ -69,7 +69,6 @@ mh mohaa,libstdc++5:i386 mom mta,libncursesw5 -mumble nd nec nmrih,libtinfo5:i386 diff --git a/lgsm/functions/command_update.sh b/lgsm/functions/command_update.sh index 07b65e5fa..ccf26322e 100755 --- a/lgsm/functions/command_update.sh +++ b/lgsm/functions/command_update.sh @@ -23,8 +23,6 @@ elif [ "${shortname}" == "mcb" ]; then update_minecraft_bedrock.sh elif [ "${shortname}" == "pmc" ] || [ "${shortname}" == "vpmc" ] || [ "${shortname}" == "wmc" ]; then update_papermc.sh -elif [ "${shortname}" == "mumble" ]; then - update_mumble.sh elif [ "${shortname}" == "fctr" ]; then update_factorio.sh elif [ "${shortname}" == "mta" ]; then diff --git a/lgsm/functions/core_functions.sh b/lgsm/functions/core_functions.sh index 05b52e243..bca5debf9 100755 --- a/lgsm/functions/core_functions.sh +++ b/lgsm/functions/core_functions.sh @@ -655,11 +655,6 @@ update_papermc.sh() { fn_fetch_function } -update_mumble.sh() { - functionfile="${FUNCNAME[0]}" - fn_fetch_function -} - update_mta.sh() { functionfile="${FUNCNAME[0]}" fn_fetch_function diff --git a/lgsm/functions/info_game.sh b/lgsm/functions/info_game.sh index f859653c8..4a1256431 100644 --- a/lgsm/functions/info_game.sh +++ b/lgsm/functions/info_game.sh @@ -1074,25 +1074,6 @@ fn_info_game_mta() { } -fn_info_game_mumble() { - # Config - if [ ! -f "${servercfgfullpath}" ]; then - port="64738" - queryport="${port}" - servername="Mumble" - else - port=$(grep "port" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^;/d' -e 's/port//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - queryport="${port}" - configip=$(grep "host=" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^;/d' -e 's/host=//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - - # Not set - port=${port:-"64738"} - queryport=${queryport:-"64738"} - servername="Mumble Port ${port}" - configip=${configip:-"0.0.0.0"} - fi -} - fn_info_game_nec() { # Config if [ ! -f "${servercfgfullpath}" ]; then @@ -2462,8 +2443,6 @@ elif [ "${shortname}" == "mom" ]; then fn_info_game_mom elif [ "${shortname}" == "mta" ]; then fn_info_game_mta -elif [ "${shortname}" == "mumble" ]; then - fn_info_game_mumble elif [ "${shortname}" == "nec" ]; then fn_info_game_nec elif [ "${shortname}" == "onset" ]; then diff --git a/lgsm/functions/info_messages.sh b/lgsm/functions/info_messages.sh index 74f529bd7..69123543a 100755 --- a/lgsm/functions/info_messages.sh +++ b/lgsm/functions/info_messages.sh @@ -658,7 +658,7 @@ fn_info_message_ports_edit() { startparameterslocation="${red}UNKNOWN${default}" # engines/games that require editing in the config file. - local ports_edit_array=("ac" "arma3" "armar" "bo" "bt" "cd" "dst" "eco" "idtech2" "idtech3" "idtech3_ql" "jc2" "jc3" "lwjgl2" "mcb" "mumble" "nec" "pc" "pc2" "prism3d" "pz" "qw" "refractor" "renderware" "rw" "sb" "sdtd" "st" "stn" "ts3" "tw" "terraria" "unreal" "unreal2" "unreal3" "vints" "wurm") + local ports_edit_array=("ac" "arma3" "armar" "bo" "bt" "cd" "dst" "eco" "idtech2" "idtech3" "idtech3_ql" "jc2" "jc3" "lwjgl2" "mcb" "nec" "pc" "pc2" "prism3d" "pz" "qw" "refractor" "renderware" "rw" "sb" "sdtd" "st" "stn" "ts3" "tw" "terraria" "unreal" "unreal2" "unreal3" "vints" "wurm") for port_edit in "${ports_edit_array[@]}"; do if [ "${shortname}" == "ut3" ]; then startparameterslocation="${servercfgdir}/UTWeb.ini" @@ -1171,14 +1171,6 @@ fn_info_message_mta() { } | column -s $'\t' -t } -fn_info_message_mumble() { - { - fn_port "header" - fn_port "Voice" port udp - fn_port "Query" queryport tcp - } | column -s $'\t' -t -} - fn_info_message_nec() { { fn_port "header" @@ -1757,8 +1749,6 @@ fn_info_message_select_engine() { fn_info_message_mom elif [ "${shortname}" == "mta" ]; then fn_info_message_mta - elif [ "${shortname}" == "mumble" ]; then - fn_info_message_mumble elif [ "${shortname}" == "nec" ]; then fn_info_message_nec elif [ "${shortname}" == "onset" ]; then diff --git a/lgsm/functions/install_config.sh b/lgsm/functions/install_config.sh index dd3bb80c3..35d7df7c6 100755 --- a/lgsm/functions/install_config.sh +++ b/lgsm/functions/install_config.sh @@ -629,12 +629,6 @@ elif [ "${shotname}" == "mom" ]; then fn_default_config_remote fn_set_config_vars fn_list_config_locations -elif [ "${shortname}" == "mumble" ]; then - gamedirname="Mumble" - array_configs+=(murmur.ini) - fn_fetch_default_config - fn_default_config_remote - fn_list_config_locations elif [ "${shortname}" == "pvr" ]; then gamedirname="PavlovVR" fn_check_cfgdir diff --git a/lgsm/functions/install_server_files.sh b/lgsm/functions/install_server_files.sh index 61c6b131c..c98986685 100755 --- a/lgsm/functions/install_server_files.sh +++ b/lgsm/functions/install_server_files.sh @@ -224,8 +224,6 @@ elif [ "${shortname}" == "pmc" ]; then update_papermc.sh elif [ "${shortname}" == "wmc" ] || [ "${shortname}" == "vpmc" ]; then update_papermc.sh -elif [ "${shortname}" == "mumble" ]; then - update_mumble.sh elif [ "${shortname}" == "mta" ]; then update_mta.sh elif [ "${shortname}" == "fctr" ]; then diff --git a/lgsm/functions/update_mumble.sh b/lgsm/functions/update_mumble.sh deleted file mode 100644 index 77e64d3c0..000000000 --- a/lgsm/functions/update_mumble.sh +++ /dev/null @@ -1,143 +0,0 @@ -#!/bin/bash -# LinuxGSM update_mumble.sh module -# Author: Daniel Gibbs -# Contributors: http://linuxgsm.com/contrib -# Website: https://linuxgsm.com -# Description: Handles updating of Mumble servers. - -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" - -fn_update_mumble_dl() { - fn_fetch_file "https://github.com/mumble-voip/mumble/releases/download/${remotebuild}/murmur-static_${mumblearch}-${remotebuild}.tar.bz2" "" "" "" "${tmpdir}" "murmur-static_${mumblearch}-${remotebuild}.tar.bz2" "" "norun" "noforce" "nohash" - fn_dl_extract "${tmpdir}" "murmur-static_${mumblearch}-${remotebuild}.tar.bz2" "${tmpdir}" - echo -e "copying to ${serverfiles}...\c" - cp -R "${tmpdir}/murmur-static_${mumblearch}-${remotebuild}/"* "${serverfiles}" - local exitcode=$? - if [ "${exitcode}" == "0" ]; then - fn_print_ok_eol_nl - fn_script_log_pass "Copying to ${serverfiles}" - fn_clear_tmp - else - fn_print_fail_eol_nl - fn_script_log_fatal "Copying to ${serverfiles}" - fn_clear_tmp - core_exit.sh - fi -} - -fn_update_mumble_localbuild() { - # Gets local build info. - fn_print_dots "Checking local build: ${remotelocation}" - # Uses executable to find local build. - cd "${executabledir}" || exit - if [ -f "${executable}" ]; then - localbuild=$(${executable} -version 2>&1 > /dev/null | awk '{print $5}') - fn_print_ok "Checking local build: ${remotelocation}" - fn_script_log_pass "Checking local build" - else - localbuild="0" - fn_print_error "Checking local build: ${remotelocation}" - fn_script_log_error "Checking local build" - fi -} - -fn_update_mumble_remotebuild() { - # Gets remote build info. - remotebuild=$(curl -s "https://api.github.com/repos/mumble-voip/mumble/releases/latest" | grep 'murmur-static_x86.*\.bz2"' | tail -1 | awk -F"/" '{ print $8 }') - if [ "${firstcommandname}" != "INSTALL" ]; then - fn_print_dots "Checking remote build: ${remotelocation}" - # Checks if remotebuild variable has been set. - if [ -z "${remotebuild}" ] || [ "${remotebuild}" == "null" ]; then - fn_print_fail "Checking remote build: ${remotelocation}" - fn_script_log_fatal "Checking remote build" - core_exit.sh - else - fn_print_ok "Checking remote build: ${remotelocation}" - fn_script_log_pass "Checking remote build" - fi - else - # Checks if remotebuild variable has been set. - if [ -z "${remotebuild}" ] || [ "${remotebuild}" == "null" ]; then - fn_print_failure "Unable to get remote build" - fn_script_log_fatal "Unable to get remote build" - core_exit.sh - fi - fi -} - -fn_update_mumble_compare() { - # Removes dots so if statement can compare version numbers. - fn_print_dots "Checking for update: ${remotelocation}" - localbuilddigit=$(echo -e "${localbuild}" | tr -cd '[:digit:]') - remotebuilddigit=$(echo -e "${remotebuild}" | tr -cd '[:digit:]') - if [ "${localbuilddigit}" -ne "${remotebuilddigit}" ] || [ "${forceupdate}" == "1" ]; then - fn_print_ok_nl "Checking for update: ${remotelocation}" - echo -en "\n" - echo -e "Update available" - echo -e "* Local build: ${red}${localbuild} ${mumblearch}${default}" - echo -e "* Remote build: ${green}${remotebuild} ${mumblearch}${default}" - echo -en "\n" - fn_script_log_info "Update available" - fn_script_log_info "Local build: ${localbuild} ${mumblearch}" - fn_script_log_info "Remote build: ${remotebuild} ${mumblearch}" - fn_script_log_info "${localbuild} > ${remotebuild}" - - unset updateonstart - check_status.sh - # If server stopped. - if [ "${status}" == "0" ]; then - exitbypass=1 - fn_update_mumble_dl - if [ "${requirerestart}" == "1" ]; then - exitbypass=1 - command_start.sh - fn_firstcommand_reset - exitbypass=1 - command_stop.sh - fn_firstcommand_reset - fi - # If server started. - else - fn_print_restart_warning - exitbypass=1 - command_stop.sh - fn_firstcommand_reset - exitbypass=1 - fn_update_mumble_dl - exitbypass=1 - command_start.sh - fn_firstcommand_reset - fi - unset exitbypass - date +%s > "${lockdir}/lastupdate.lock" - alert="update" - alert.sh - else - fn_print_ok_nl "Checking for update: ${remotelocation}" - echo -en "\n" - echo -e "No update available" - echo -e "* Local build: ${green}${localbuild} ${mumblearch}${default}" - echo -e "* Remote build: ${green}${remotebuild} ${mumblearch}${default}" - echo -en "\n" - fn_script_log_info "No update available" - fn_script_log_info "Local build: ${localbuild} ${mumblearch}" - fn_script_log_info "Remote build: ${remotebuild} ${mumblearch}" - fi -} - -# The location where the builds are checked and downloaded. -remotelocation="mumble.info" - -# Game server architecture. -mumblearch="x86" - -if [ "${firstcommandname}" == "INSTALL" ]; then - fn_update_mumble_remotebuild - fn_update_mumble_dl -else - fn_print_dots "Checking for update: ${remotelocation}" - fn_script_log_info "Checking for update: ${remotelocation}" - fn_update_mumble_localbuild - fn_update_mumble_remotebuild - fn_update_mumble_compare -fi From 651edde223fddb7d817f0b68ba83f8f72b44a25f Mon Sep 17 00:00:00 2001 From: Christian Date: Wed, 1 Mar 2023 20:54:54 +0100 Subject: [PATCH 137/161] fix(mods): get5 download change to github (#4020) --- lgsm/functions/mods_list.sh | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/lgsm/functions/mods_list.sh b/lgsm/functions/mods_list.sh index e8d583251..f78686759 100755 --- a/lgsm/functions/mods_list.sh +++ b/lgsm/functions/mods_list.sh @@ -72,10 +72,9 @@ steamworkslatestfile=$(curl --connect-timeout 10 -sL ${steamworksscrapeurl} | gr steamworksdownloadurl="${steamworksscrapeurl}/${steamworkslatestfile}" steamworksurl="${steamworksdownloadurl}" # CS:GO Mods -get5lastbuild=$(curl --connect-timeout 10 -sL https://ci.splewis.net/job/get5/lastSuccessfulBuild/api/json | jq -r '.artifacts[]') -get5latestfile=$(echo -e "${get5lastbuild}" | jq -r '.fileName') -get5latestfilepath=$(echo -e "${get5lastbuild}" | jq -r '.relativePath') -get5url="https://ci.splewis.net/job/get5/lastSuccessfulBuild/artifact/${get5latestfilepath}" +get5lastbuild=$(curl --connect-timeout 10 -sL https://api.github.com/repos/splewis/get5/releases/latest | jq '.assets[] |select(.browser_download_url | endswith(".tar.gz"))') +get5latestfile=$(echo -e "${get5lastbuild}" | jq -r '.name') +get5latestfilelink=$(echo -e "${get5lastbuild}" | jq -r '.browser_download_url') csgopracticelatest=$(curl --connect-timeout 10 -sL https://api.github.com/repos/splewis/csgo-practice-mode/releases/latest | jq '.assets[]') csgopracticelatestfile=$(echo -e "${csgopracticelatest}" | jq -r '.name') csgopracticelatestlink=$(echo -e "${csgopracticelatest}" | jq -r '.browser_download_url') @@ -151,7 +150,7 @@ mod_info_stripper=(MOD "stripper" "Stripper Source" "http://www.bailopan.net/str # CS:GO Mods mod_info_gokz=(MOD "gokz" "GOKZ" "${gokzlatestlink}" "${gokzlatestfile}" "0" "LowercaseOff" "${systemdir}" "cfg;addons/sourcemod/configs;" "ENGINES" "Counter-Strike: Global Offensive;" "NOTGAMES" "https://github.com/KZGlobalTeam/gokz" "GOKZ ${gokzlatestversion} - Implements the KZ game mode (requires SourceMod and MetaMod)") mod_info_ttt=(MOD "ttt" "Trouble in Terrorist Town" "https://csgottt.com/downloads/ttt-latest-dev-${sourcemodversion}.zip" "ttt-latest.zip" "0" "LowercaseOff" "${systemdir}" "cfg;addons/sourcemod/configs;" "ENGINES" "Counter-Strike: Global Offensive;" "NOTGAMES" "https://github.com/Bara/TroubleinTerroristTown" "Implements the TTT game mode (requires SourceMod and MetaMod)") -mod_info_get5=(MOD "get5" "Get 5" "${get5url}" "${get5latestfile}" "0" "LowercaseOff" "${systemdir}" "cfg;addons/sourcemod/configs;" "ENGINES" "Counter-Strike: Global Offensive;" "NOTGAMES" "https://github.com/splewis/get5" "Plugin for competitive matches/scrims (requires SourceMod and MetaMod)") +mod_info_get5=(MOD "get5" "Get 5" "${get5latestfilelink}" "${get5latestfile}" "0" "LowercaseOff" "${systemdir}" "cfg;addons/sourcemod/configs;" "ENGINES" "Counter-Strike: Global Offensive;" "NOTGAMES" "https://github.com/splewis/get5" "Plugin for competitive matches/scrims (requires SourceMod and MetaMod)") mod_info_prac=(MOD "prac" "csgo practice mode" "${csgopracticelatestlink}" "${csgopracticelatestfile}" "0" "LowercaseOff" "${systemdir}" "cfg;addons/sourcemod/configs;" "ENGINES" "Counter-Strike: Global Offensive;" "NOTGAMES" "https://github.com/splewis/csgo-practice-mode" "Practice Mode is a sourcemod plugin for helping players/teams run practices.") mod_info_pug=(MOD "pug" "PUG" "${csgopuglatestlink}" "${csgopuglatestfile}" "0" "LowercaseOff" "${systemdir}" "cfg;addons/sourcemod/configs;" "ENGINES" "Counter-Strike: Global Offensive;" "NOTGAMES" "https://github.com/splewis/csgo-pug-setup" "plugin for setting up private pug/10man games") mod_info_dhook=(MOD "dhook" "dhook" "https://forums.alliedmods.net/attachment.php?attachmentid=190123&d=1625050030" "dhooks-2.2.0d17.zip" "0" "LowercaseOff" "${systemdir}" "cfg;addons/sourcemod/configs;" "ENGINES" "Counter-Strike: Global Offensive;" "NOTGAMES" "https://forums.alliedmods.net/showpost.php?p=2588686&postcount=589" "DHooks 2.2.0 - Required for GOKZ") From c957b2aa5ad36f83df13c3bed5d9a1e2df86ac10 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Wed, 1 Mar 2023 19:56:32 +0000 Subject: [PATCH 138/161] fix(av): fix will trigger on start as well (#4123) this should resolve the steamclient bug --- lgsm/functions/fix.sh | 2 ++ lgsm/functions/fix_av.sh | 8 ++++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/lgsm/functions/fix.sh b/lgsm/functions/fix.sh index 0ed9fdf70..b0e9396cc 100755 --- a/lgsm/functions/fix.sh +++ b/lgsm/functions/fix.sh @@ -43,6 +43,8 @@ if [ "${commandname}" != "INSTALL" ] && [ -z "${fixbypass}" ]; then fix_armar.sh elif [ "${shortname}" == "ark" ]; then fix_ark.sh + elif [ "${shortname}" == "av" ]; then + fix_av.sh elif [ "${shortname}" == "bt" ]; then fix_bt.sh elif [ "${shortname}" == "bo" ]; then diff --git a/lgsm/functions/fix_av.sh b/lgsm/functions/fix_av.sh index f34a01c37..a61a8be65 100755 --- a/lgsm/functions/fix_av.sh +++ b/lgsm/functions/fix_av.sh @@ -9,11 +9,11 @@ functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${serverfiles}:${serverfiles}/linux64" -if [ "${postinstall}" == "1" ]; then +# Generates the server config if it doesn't exist. +if [ ! -f "${servercfgfullpath}" ]; then startparameters="--datapath ${avdatapath} --galaxy-name ${selfname} --init-folders-only" fn_print_information "starting ${gamename} server to generate configs." fn_sleep_time - # go to the executeable dir and start the init of the server - cd "${systemdir}" || return 2 - "${executabledir}/${executable}" ${startparameters} + cd "${systemdir}" || exit + eval "${executable} ${startparameters}" fi From e86848c41cc2e397b63749cf6c1d1d4862adf9f5 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Wed, 22 Mar 2023 23:46:09 +0000 Subject: [PATCH 139/161] feat: update refactor (#4146) * feat(ut99): add oldunreal update functionality * non-steam update refactor * chore: flipping exit code if statements Must have consistancy XD * rename variables * feat(ut99): now supports native x64 * extracts will now fail if files doesnt exist * localbuild fix * a * fix: exit code bug * improve progress bar * add extractsrc and extractdest to deal with specific dir extracts * update ts3 extract * update * paper REFACTOR * mta a * fix(mta): prevent default resources exit from installer * streamline mcserver * mcb * jk2 * fixes * correct directory extract for factorio * mcb remove non printable characters * codacy --- .../config-lgsm/ut99server/_default.cfg | 2 +- lgsm/functions/alert.sh | 4 +- lgsm/functions/command_backup.sh | 11 +- lgsm/functions/command_check_update.sh | 28 +- .../command_install_resources_mta.sh | 4 +- lgsm/functions/command_mods_update.sh | 4 +- lgsm/functions/command_update.sh | 2 + lgsm/functions/core_dl.sh | 82 ++++-- lgsm/functions/core_exit.sh | 2 +- lgsm/functions/core_functions.sh | 5 + lgsm/functions/core_getopt.sh | 12 +- lgsm/functions/core_steamcmd.sh | 32 +-- lgsm/functions/fix.sh | 2 +- lgsm/functions/info_game.sh | 6 +- lgsm/functions/install_eula.sh | 2 - lgsm/functions/install_server_files.sh | 3 + lgsm/functions/install_ts3db.sh | 10 +- lgsm/functions/mods_core.sh | 18 +- lgsm/functions/update_factorio.sh | 169 ++++++------ lgsm/functions/update_jediknight2.sh | 195 +++++++------- lgsm/functions/update_minecraft.sh | 159 +++++------ lgsm/functions/update_minecraft_bedrock.sh | 189 +++++++------- lgsm/functions/update_mta.sh | 209 ++++++--------- lgsm/functions/update_papermc.sh | 247 ++++++++++-------- lgsm/functions/update_ts3.sh | 180 +++++-------- lgsm/functions/update_ut99.sh | 163 ++++++++++++ lgsm/functions/update_vintagestory.sh | 142 +++++----- 27 files changed, 1030 insertions(+), 852 deletions(-) create mode 100644 lgsm/functions/update_ut99.sh diff --git a/lgsm/config-default/config-lgsm/ut99server/_default.cfg b/lgsm/config-default/config-lgsm/ut99server/_default.cfg index 205e8a1d7..5af870f50 100644 --- a/lgsm/config-default/config-lgsm/ut99server/_default.cfg +++ b/lgsm/config-default/config-lgsm/ut99server/_default.cfg @@ -145,7 +145,7 @@ glibc="2.1" # Edit with care ## Game Server Directories -systemdir="${serverfiles}/System" +systemdir="${serverfiles}/System64" executabledir="${systemdir}" executable="./ucc-bin" servercfgdir="${systemdir}" diff --git a/lgsm/functions/alert.sh b/lgsm/functions/alert.sh index 8460209c4..59deae2b6 100755 --- a/lgsm/functions/alert.sh +++ b/lgsm/functions/alert.sh @@ -60,7 +60,7 @@ fn_alert_update() { alertemoji="🎮" alertsound="1" alerturl="not enabled" - alertbody="${gamename} received update" + alertbody="${gamename} received update: ${remotebuildversion}" } fn_alert_check_update() { @@ -69,7 +69,7 @@ fn_alert_check_update() { alertemoji="🎮" alertsound="1" alerturl="not enabled" - alertbody="${gamename} update available" + alertbody="${gamename} update available: ${remotebuildversion}" } fn_alert_permissions() { diff --git a/lgsm/functions/command_backup.sh b/lgsm/functions/command_backup.sh index 0dfabcd03..d69c57a0f 100644 --- a/lgsm/functions/command_backup.sh +++ b/lgsm/functions/command_backup.sh @@ -99,16 +99,17 @@ fn_backup_migrate_olddir() { fn_script_log_info "${rootdir}/backups > ${backupdir}" mv "${rootdir}/backups/"* "${backupdir}" 2> /dev/null exitcode=$? - if [ "${exitcode}" -eq 0 ]; then + if [ "${exitcode}" == 0 ]; then rmdir "${rootdir}/backups" 2> /dev/null exitcode=$? fi - if [ "${exitcode}" -eq 0 ]; then - fn_print_ok_nl "Backup directory is being migrated" - fn_script_log_pass "Backup directory is being migrated" - else + if [ "${exitcode}" != 0 ]; then fn_print_error_nl "Backup directory is being migrated" fn_script_log_error "Backup directory is being migrated" + else + + fn_print_ok_nl "Backup directory is being migrated" + fn_script_log_pass "Backup directory is being migrated" fi fi fi diff --git a/lgsm/functions/command_check_update.sh b/lgsm/functions/command_check_update.sh index 59b29d6e9..3753c72c6 100755 --- a/lgsm/functions/command_check_update.sh +++ b/lgsm/functions/command_check_update.sh @@ -14,16 +14,26 @@ fn_print_dots "" check.sh core_logs.sh -if [ "${appid}" ]; then - core_steamcmd.sh - - check_steamcmd.sh - - fn_update_steamcmd_localbuild - fn_update_steamcmd_remotebuild - fn_update_steamcmd_compare -elif [ "${shortname}" == "ts3" ]; then +if [ "${shortname}" == "ts3" ]; then update_ts3.sh +elif [ "${shortname}" == "mc" ]; then + update_minecraft.sh +elif [ "${shortname}" == "mcb" ]; then + update_minecraft_bedrock.sh +elif [ "${shortname}" == "pmc" ] || [ "${shortname}" == "vpmc" ] || [ "${shortname}" == "wmc" ]; then + update_papermc.sh +elif [ "${shortname}" == "fctr" ]; then + update_factorio.sh +elif [ "${shortname}" == "mta" ]; then + update_mta.sh +elif [ "${shortname}" == "jk2" ]; then + update_jediknight2.sh +elif [ "${shortname}" == "vints" ]; then + update_vintagestory.sh +elif [ "${shortname}" == "ut99" ]; then + update_ut99.sh +else + update_steamcmd.sh fi core_exit.sh diff --git a/lgsm/functions/command_install_resources_mta.sh b/lgsm/functions/command_install_resources_mta.sh index 15f5be22f..daf039551 100755 --- a/lgsm/functions/command_install_resources_mta.sh +++ b/lgsm/functions/command_install_resources_mta.sh @@ -12,7 +12,7 @@ fn_firstcommand_set fn_install_resources() { echo -e "" - echo -e "Installing Default Resources" + echo -e "${lightyellow}Installing Default Resources${default}" echo -e "=================================" fn_fetch_file "http://mirror.mtasa.com/mtasa/resources/mtasa-resources-latest.zip" "" "" "" "${tmpdir}" "mtasa-resources-latest.zip" "nochmodx" "norun" "noforce" "nohash" fn_dl_extract "${tmpdir}" "mtasa-resources-latest.zip" "${resourcesdir}" @@ -30,5 +30,3 @@ else fn_print_warning_nl "Default resources are not installed when using ./${selfname} auto-install." fn_print_information_nl "To install default resources use ./${selfname} install" fi - -core_exit.sh diff --git a/lgsm/functions/command_mods_update.sh b/lgsm/functions/command_mods_update.sh index c2f7b42b5..80b23fea9 100755 --- a/lgsm/functions/command_mods_update.sh +++ b/lgsm/functions/command_mods_update.sh @@ -27,8 +27,8 @@ fn_remove_cfg_files() { filetopreserve=$(echo -e "${modkeepfiles}" | awk -F ';' -v x=${preservefilesindex} '{ print $x }') echo -e " * serverfiles/${filetopreserve}" # If it matches an existing file that have been extracted delete the file. - if [ -f "${extractdir}/${filetopreserve}" ] || [ -d "${extractdir}/${filetopreserve}" ]; then - rm -r "${extractdir:?}/${filetopreserve}" + if [ -f "${extractdest}/${filetopreserve}" ] || [ -d "${extractdest}/${filetopreserve}" ]; then + rm -r "${extractdest:?}/${filetopreserve}" # Write the file path in a tmp file, to rebuild a full file list as it is rebuilt upon update. if [ ! -f "${modsdir}/.removedfiles.tmp" ]; then touch "${modsdir}/.removedfiles.tmp" diff --git a/lgsm/functions/command_update.sh b/lgsm/functions/command_update.sh index ccf26322e..ae5c2065c 100755 --- a/lgsm/functions/command_update.sh +++ b/lgsm/functions/command_update.sh @@ -31,6 +31,8 @@ elif [ "${shortname}" == "jk2" ]; then update_jediknight2.sh elif [ "${shortname}" == "vints" ]; then update_vintagestory.sh +elif [ "${shortname}" == "ut99" ]; then + update_ut99.sh else update_steamcmd.sh fi diff --git a/lgsm/functions/core_dl.sh b/lgsm/functions/core_dl.sh index 2e6db690e..d19425ac5 100755 --- a/lgsm/functions/core_dl.sh +++ b/lgsm/functions/core_dl.sh @@ -14,8 +14,8 @@ # hash: Optional, set an hash sum and will compare it against the file. # # Downloads can be defined in code like so: -# fn_fetch_file "${remote_fileurl}" "${local_filedir}" "${local_filename}" "${chmodx}" "${run}" "${forcedl}" "${hash}" -# fn_fetch_file "http://example.com/file.tar.bz2" "/some/dir" "file.tar.bz2" "chmodx" "run" "forcedl" "10cd7353aa9d758a075c600a6dd193fd" +# fn_fetch_file "${remote_fileurl}" "${remote_fileurl_backup}" "${remote_fileurl_name}" "${remote_fileurl_backup_name}" "${local_filedir}" "${local_filename}" "${chmodx}" "${run}" "${forcedl}" "${hash}" +# fn_fetch_file "http://example.com/file.tar.bz2" "http://example.com/file2.tar.bz2" "file.tar.bz2" "file2.tar.bz2" "/some/dir" "file.tar.bz2" "chmodx" "run" "forcedl" "10cd7353aa9d758a075c600a6dd193fd" functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" @@ -124,7 +124,7 @@ fn_dl_steamcmd() { echo -en "Please provide content log to LinuxGSM developers https://linuxgsm.com/steamcmd-error" fn_script_log_error "${commandaction} ${selfname}: ${remotelocation}: Unknown error occured" fi - elif [ "${exitcode}" != "0" ]; then + elif [ "${exitcode}" != 0 ]; then fn_print_error2_nl "${commandaction} ${selfname}: ${remotelocation}: Exit code: ${exitcode}" fn_script_log_error "${commandaction} ${selfname}: ${remotelocation}: Exit code: ${exitcode}" else @@ -146,12 +146,12 @@ fn_clear_tmp() { if [ -d "${tmpdir}" ]; then rm -rf "${tmpdir:?}/"* local exitcode=$? - if [ "${exitcode}" == 0 ]; then - fn_print_ok_eol_nl - fn_script_log_pass "clearing LinuxGSM tmp directory" - else + if [ "${exitcode}" != 0 ]; then fn_print_error_eol_nl fn_script_log_error "clearing LinuxGSM tmp directory" + else + fn_print_ok_eol_nl + fn_script_log_pass "clearing LinuxGSM tmp directory" fi fi } @@ -202,31 +202,56 @@ fn_dl_hash() { # Extracts bzip2, gzip or zip files. # Extracts can be defined in code like so: -# fn_dl_extract "${local_filedir}" "${local_filename}" "${extractdir}" +# fn_dl_extract "${local_filedir}" "${local_filename}" "${extractdest}" "${extractsrc}" # fn_dl_extract "/home/gameserver/lgsm/tmp" "file.tar.bz2" "/home/gamserver/serverfiles" fn_dl_extract() { local_filedir="${1}" local_filename="${2}" - extractdir="${3}" + extractdest="${3}" + extractsrc="${4}" # Extracts archives. echo -en "extracting ${local_filename}..." - mime=$(file -b --mime-type "${local_filedir}/${local_filename}") - if [ ! -d "${extractdir}" ]; then - mkdir "${extractdir}" + + if [ ! -d "${extractdest}" ]; then + mkdir "${extractdest}" + fi + if [ ! -f "${local_filedir}/${local_filename}" ]; then + fn_print_fail_eol_nl + echo -en "file ${local_filedir}/${local_filename} not found" + fn_script_log_fatal "Extracting ${local_filename}" + fn_script_log_fatal "File ${local_filedir}/${local_filename} not found" + core_exit.sh fi + mime=$(file -b --mime-type "${local_filedir}/${local_filename}") if [ "${mime}" == "application/gzip" ] || [ "${mime}" == "application/x-gzip" ]; then - extractcmd=$(tar -zxf "${local_filedir}/${local_filename}" -C "${extractdir}") + if [ -n "${extractsrc}" ]; then + extractcmd=$(tar -zxf "${local_filedir}/${local_filename}" -C "${extractdest}" --strip-components=1 "${extractsrc}") + else + extractcmd=$(tar -zxf "${local_filedir}/${local_filename}" -C "${extractdest}") + fi elif [ "${mime}" == "application/x-bzip2" ]; then - extractcmd=$(tar -jxf "${local_filedir}/${local_filename}" -C "${extractdir}") + if [ -n "${extractsrc}" ]; then + extractcmd=$(tar -jxf "${local_filedir}/${local_filename}" -C "${extractdest}" --strip-components=1 "${extractsrc}") + else + extractcmd=$(tar -jxf "${local_filedir}/${local_filename}" -C "${extractdest}") + fi elif [ "${mime}" == "application/x-xz" ]; then - extractcmd=$(tar -xf "${local_filedir}/${local_filename}" -C "${extractdir}") + if [ -n "${extractsrc}" ]; then + extractcmd=$(tar -Jxf "${local_filedir}/${local_filename}" -C "${extractdest}" --strip-components=1 "${extractsrc}") + else + extractcmd=$(tar -Jxf "${local_filedir}/${local_filename}" -C "${extractdest}") + fi elif [ "${mime}" == "application/zip" ]; then - extractcmd=$(unzip -qo -d "${extractdir}" "${local_filedir}/${local_filename}") + if [ -n "${extractsrc}" ]; then + extractcmd=$(unzip -qoj -d "${extractdest}" "${local_filedir}/${local_filename}" "${extractsrc}"/*) + else + extractcmd=$(unzip -qo -d "${extractdest}" "${local_filedir}/${local_filename}") + fi fi local exitcode=$? if [ "${exitcode}" != 0 ]; then fn_print_fail_eol_nl - fn_script_log_fatal "Extracting download" + fn_script_log_fatal "Extracting ${local_filename}" if [ -f "${lgsmlog}" ]; then echo -e "${extractcmd}" >> "${lgsmlog}" fi @@ -234,7 +259,7 @@ fn_dl_extract() { core_exit.sh else fn_print_ok_eol_nl - fn_script_log_pass "Extracting download" + fn_script_log_pass "Extracting ${local_filename}" fi } @@ -360,21 +385,21 @@ fn_fetch_file() { trap fn_fetch_trap INT # Larger files show a progress bar. if [ "${local_filename##*.}" == "bz2" ] || [ "${local_filename##*.}" == "gz" ] || [ "${local_filename##*.}" == "zip" ] || [ "${local_filename##*.}" == "jar" ] || [ "${local_filename##*.}" == "xz" ]; then - echo -en "downloading ${local_filename}..." + echo -e "downloading ${local_filename}..." fn_sleep_time - echo -en "\033[1K" curlcmd=$(curl --connect-timeout 10 --progress-bar --fail -L -o "${local_filedir}/${local_filename}" "${fileurl}") + local exitcode=$? echo -en "downloading ${local_filename}..." else + curlcmd=$(curl --connect-timeout 10 -s --fail -L -o "${local_filedir}/${local_filename}" "${fileurl}") + local exitcode=$? echo -en "fetching ${fileurl_name} ${local_filename}...\c" - curlcmd=$(curl --connect-timeout 10 -s --fail -L -o "${local_filedir}/${local_filename}" "${fileurl}" 2>&1) fi - local exitcode=$? # Download will fail if downloads a html file. if [ -f "${local_filedir}/${local_filename}" ]; then - if [ -n "$(head "${local_filedir}/${local_filename}" | grep "DOCTYPE")" ]; then - rm -f "${local_filedir:?}/${local_filename:?}" + if head -n 1 "${local_filedir}/${local_filename}" | grep -q "DOCTYPE"; then + rm "${local_filedir:?}/${local_filename:?}" local exitcode=2 fi fi @@ -384,22 +409,21 @@ fn_fetch_file() { if [ ${counter} -ge 2 ]; then fn_print_fail_eol_nl if [ -f "${lgsmlog}" ]; then - fn_script_log_fatal "Downloading ${local_filename}" + fn_script_log_fatal "Downloading ${local_filename}..." fn_script_log_fatal "${fileurl}" fi core_exit.sh else fn_print_error_eol_nl if [ -f "${lgsmlog}" ]; then - fn_script_log_error "Downloading ${local_filename}" + fn_script_log_error "Downloading ${local_filename}..." fn_script_log_error "${fileurl}" fi fi else - fn_print_ok_eol - echo -en "\033[2K\\r" + fn_print_ok_eol_nl if [ -f "${lgsmlog}" ]; then - fn_script_log_pass "Downloading ${local_filename}" + fn_script_log_pass "Downloading ${local_filename}..." fi # Make file executable if chmodx is set. diff --git a/lgsm/functions/core_exit.sh b/lgsm/functions/core_exit.sh index 2d2f5b8fa..95d9d8cae 100755 --- a/lgsm/functions/core_exit.sh +++ b/lgsm/functions/core_exit.sh @@ -25,7 +25,7 @@ fi if [ "${exitbypass}" ]; then unset exitbypass -elif [ "${exitcode}" ] && [ "${exitcode}" != "0" ]; then +elif [ "${exitcode}" != "0" ]; then # List LinuxGSM version in logs fn_script_log_info "LinuxGSM version: ${version}" if [ "${exitcode}" == "1" ]; then diff --git a/lgsm/functions/core_functions.sh b/lgsm/functions/core_functions.sh index bca5debf9..6ab24b78b 100755 --- a/lgsm/functions/core_functions.sh +++ b/lgsm/functions/core_functions.sh @@ -680,6 +680,11 @@ update_vintagestory.sh() { fn_fetch_function } +update_ut99.sh() { + functionfile="${FUNCNAME[0]}" + fn_fetch_function +} + fn_update_functions.sh() { functionfile="${FUNCNAME[0]}" fn_fetch_function diff --git a/lgsm/functions/core_getopt.sh b/lgsm/functions/core_getopt.sh index fdd66ab3f..808fe2e2a 100755 --- a/lgsm/functions/core_getopt.sh +++ b/lgsm/functions/core_getopt.sh @@ -65,8 +65,8 @@ currentopt+=("${cmd_update_linuxgsm[@]}") # Exclude noupdate games here. if [ "${shortname}" == "jk2" ] || [ "${engine}" != "idtech3" ]; then - if [ "${shortname}" != "bf1942" ] && [ "${shortname}" != "bfv" ] && [ "${engine}" != "idtech2" ] && [ "${engine}" != "iw2.0" ] && [ "${engine}" != "iw3.0" ] && [ "${engine}" != "quake" ] && [ "${shortname}" != "samp" ] && [ "${shortname}" != "ut2k4" ] && [ "${shortname}" != "ut99" ]; then - currentopt+=("${cmd_update[@]}") + if [ "${shortname}" != "bf1942" ] && [ "${shortname}" != "bfv" ] && [ "${engine}" != "idtech2" ] && [ "${engine}" != "iw2.0" ] && [ "${engine}" != "iw3.0" ] && [ "${engine}" != "quake" ] && [ "${shortname}" != "samp" ] && [ "${shortname}" != "ut2k4" ]; then + currentopt+=("${cmd_update[@]}" "${cmd_check_update[@]}") # force update for SteamCMD or Multi Theft Auto only. if [ "${appid}" ] || [ "${shortname}" == "mta" ]; then currentopt+=("${cmd_force_update[@]}") @@ -75,8 +75,8 @@ if [ "${shortname}" == "jk2" ] || [ "${engine}" != "idtech3" ]; then fi # Validate and check-update command. -if [ "${appid}" ] || [ "${shortname}" == "ts3" ]; then - currentopt+=("${cmd_validate[@]}" "${cmd_check_update[@]}") +if [ "${appid}" ]; then + currentopt+=("${cmd_validate[@]}") fi # Backup. @@ -102,10 +102,12 @@ if [ "${shortname}" == "ts3" ]; then currentopt+=("${cmd_change_password[@]}") fi -# Unreal exclusive. +# Rust exclusive. if [ "${shortname}" == "rust" ]; then currentopt+=("${cmd_fullwipe[@]}" "${cmd_mapwipe[@]}") fi + +# Unreal exclusive. if [ "${engine}" == "unreal2" ]; then if [ "${shortname}" == "ut2k4" ]; then currentopt+=("${cmd_install_cdkey[@]}" "${cmd_map_compressor_u2[@]}") diff --git a/lgsm/functions/core_steamcmd.sh b/lgsm/functions/core_steamcmd.sh index 9d54cfde1..119748fb7 100755 --- a/lgsm/functions/core_steamcmd.sh +++ b/lgsm/functions/core_steamcmd.sh @@ -14,7 +14,7 @@ fn_install_steamcmd() { if [ ! -d "${steamcmddir}" ]; then mkdir -p "${steamcmddir}" fi - fn_fetch_file "http://media.steampowered.com/client/steamcmd_linux.tar.gz" "" "" "" "${tmpdir}" "steamcmd_linux.tar.gz" "" "norun" "noforce" "nohash" + fn_fetch_file "http://media.steampowered.com/client/steamcmd_linux.tar.gz" "" "" "" "${tmpdir}" "steamcmd_linux.tar.gz" "nochmodx" "norun" "noforce" "nohash" fn_dl_extract "${tmpdir}" "steamcmd_linux.tar.gz" "${steamcmddir}" chmod +x "${steamcmddir}/steamcmd.sh" } @@ -157,9 +157,9 @@ fn_update_steamcmd_localbuild() { fi # Checks if localbuild variable has been set. - if [ -z "${localbuild}" ] || [ "${localbuild}" == "null" ]; then - fn_print_fail "Checking local build: ${remotelocation}" - fn_script_log_fatal "Checking local build" + if [ -z "${localbuild}" ]; then + fn_print_fail "Checking local build: ${remotelocation}: missing local build info" + fn_script_log_fatal "Missing local build info" core_exit.sh else fn_print_ok "Checking local build: ${remotelocation}" @@ -168,7 +168,7 @@ fn_update_steamcmd_localbuild() { } fn_update_steamcmd_remotebuild() { - # Gets remote build info. + # Get remote build info. if [ -d "${steamcmddir}" ]; then cd "${steamcmddir}" || exit fi @@ -179,12 +179,12 @@ fn_update_steamcmd_remotebuild() { fi # password for branch not needed to check the buildid - remotebuild=$(${steamcmdcommand} +login "${steamuser}" "${steampass}" +app_info_update 1 +app_info_print "${appid}" +quit | sed -e '/"branches"/,/^}/!d' | sed -n "/\"${branch}\"/,/}/p" | grep -m 1 buildid | tr -cd '[:digit:]') + remotebuildversion=$(${steamcmdcommand} +login "${steamuser}" "${steampass}" +app_info_update 1 +app_info_print "${appid}" +quit | sed -e '/"branches"/,/^}/!d' | sed -n "/\"${branch}\"/,/}/p" | grep -m 1 buildid | tr -cd '[:digit:]') if [ "${firstcommandname}" != "INSTALL" ]; then fn_print_dots "Checking remote build: ${remotelocation}" - # Checks if remotebuild variable has been set. - if [ -z "${remotebuild}" ] || [ "${remotebuild}" == "null" ]; then + # Checks if remotebuildversion variable has been set. + if [ -z "${remotebuildversion}" ] || [ "${remotebuildversion}" == "null" ]; then fn_print_fail "Checking remote build: ${remotelocation}" fn_script_log_fatal "Checking remote build" core_exit.sh @@ -194,7 +194,7 @@ fn_update_steamcmd_remotebuild() { fi else # Checks if remotebuild variable has been set. - if [ -z "${remotebuild}" ] || [ "${remotebuild}" == "null" ]; then + if [ -z "${remotebuildversion}" ] || [ "${remotebuildversion}" == "null" ]; then fn_print_failure "Unable to get remote build" fn_script_log_fatal "Unable to get remote build" core_exit.sh @@ -204,12 +204,12 @@ fn_update_steamcmd_remotebuild() { fn_update_steamcmd_compare() { fn_print_dots "Checking for update: ${remotelocation}" - if [ "${localbuild}" != "${remotebuild}" ]; then + if [ "${localbuild}" != "${remotebuildversion}" ] || [ "${forceupdate}" == "1" ]; then fn_print_ok_nl "Checking for update: ${remotelocation}" echo -en "\n" echo -e "Update available" echo -e "* Local build: ${red}${localbuild}${default}" - echo -e "* Remote build: ${green}${remotebuild}${default}" + echo -e "* Remote build: ${green}${remotebuildversion}${default}" if [ -n "${branch}" ]; then echo -e "* Branch: ${branch}" fi @@ -220,14 +220,14 @@ fn_update_steamcmd_compare() { echo -en "\n" fn_script_log_info "Update available" fn_script_log_info "Local build: ${localbuild}" - fn_script_log_info "Remote build: ${remotebuild}" + fn_script_log_info "Remote build: ${remotebuildversion}" if [ -n "${branch}" ]; then fn_script_log_info "Branch: ${branch}" fi if [ -n "${betapassword}" ]; then fn_script_log_info "Branch password: ${betapassword}" fi - fn_script_log_info "${localbuild} > ${remotebuild}" + fn_script_log_info "${localbuild} > ${remotebuildversion}" if [ "${commandname}" == "UPDATE" ]; then unset updateonstart @@ -246,8 +246,8 @@ fn_update_steamcmd_compare() { exitbypass=1 command_start.sh fn_firstcommand_reset - unset exitbypass fi + unset exitbypass date +%s > "${lockdir}/lastupdate.lock" alert="update" elif [ "${commandname}" == "CHECK-UPDATE" ]; then @@ -259,7 +259,7 @@ fn_update_steamcmd_compare() { echo -en "\n" echo -e "No update available" echo -e "* Local build: ${green}${localbuild}${default}" - echo -e "* Remote build: ${green}${remotebuild}${default}" + echo -e "* Remote build: ${green}${remotebuildversion}${default}" if [ -n "${branch}" ]; then echo -e "* Branch: ${branch}" fi @@ -270,7 +270,7 @@ fn_update_steamcmd_compare() { echo -en "\n" fn_script_log_info "No update available" fn_script_log_info "Local build: ${localbuild}" - fn_script_log_info "Remote build: ${remotebuild}" + fn_script_log_info "Remote build: ${remotebuildversion}" if [ -n "${branch}" ]; then fn_script_log_info "Branch: ${branch}" fi diff --git a/lgsm/functions/fix.sh b/lgsm/functions/fix.sh index b0e9396cc..60a96059d 100755 --- a/lgsm/functions/fix.sh +++ b/lgsm/functions/fix.sh @@ -17,7 +17,7 @@ fn_fix_msg_start() { fn_fix_msg_start_nl() { fn_print_dots "Applying ${fixname} fix: ${gamename}" - fn_print_info "Applying ${fixname} fix: ${gamename}" + fn_print_info_nl "Applying ${fixname} fix: ${gamename}" fn_script_log_info "Applying ${fixname} fix: ${gamename}" } diff --git a/lgsm/functions/info_game.sh b/lgsm/functions/info_game.sh index 4a1256431..f5dc108da 100644 --- a/lgsm/functions/info_game.sh +++ b/lgsm/functions/info_game.sh @@ -2551,10 +2551,10 @@ if [ ! -f "${tmpdir}/extip.txt" ]; then extip="$(curl --connect-timeout 10 -s https://api.ipify.org 2> /dev/null)" exitcode=$? # if curl passes add extip to externalip.txt - if [ "${exitcode}" == "0" ]; then - echo "${extip}" > "${tmpdir}/extip.txt" - else + if [ "${exitcode}" != "0" ]; then echo "Unable to get external IP address" + else + echo "${extip}" > "${tmpdir}/extip.txt" fi else extip="$(cat "${tmpdir}/extip.txt")" diff --git a/lgsm/functions/install_eula.sh b/lgsm/functions/install_eula.sh index 5b8b4db5d..3e51fac71 100755 --- a/lgsm/functions/install_eula.sh +++ b/lgsm/functions/install_eula.sh @@ -31,11 +31,9 @@ if [ -z "${autoinstall}" ]; then fi elif [ "${commandname}" == "START" ]; then fn_print_info "By continuing you are indicating your agreement to the EULA." - echo -e "" sleep 5 else echo -e "By using auto-install you are indicating your agreement to the EULA." - echo -e "" sleep 5 fi diff --git a/lgsm/functions/install_server_files.sh b/lgsm/functions/install_server_files.sh index c98986685..9316d6efd 100755 --- a/lgsm/functions/install_server_files.sh +++ b/lgsm/functions/install_server_files.sh @@ -233,6 +233,9 @@ elif [ "${shortname}" == "jk2" ]; then update_jediknight2.sh elif [ "${shortname}" == "vints" ]; then update_vintagestory.sh +elif [ "${shortname}" == "ut99" ]; then + fn_install_server_files + update_ut99.sh elif [ -z "${appid}" ] || [ "${shortname}" == "ahl" ] || [ "${shortname}" == "bb" ] || [ "${shortname}" == "ns" ] || [ "${shortname}" == "sfc" ] || [ "${shortname}" == "ts" ] || [ "${shortname}" == "vs" ] || [ "${shortname}" == "zmr" ]; then if [ "${shortname}" == "ut" ]; then install_eula.sh diff --git a/lgsm/functions/install_ts3db.sh b/lgsm/functions/install_ts3db.sh index e394296de..ed879cd28 100755 --- a/lgsm/functions/install_ts3db.sh +++ b/lgsm/functions/install_ts3db.sh @@ -12,13 +12,13 @@ fn_install_ts3db_mariadb() { echo -e "copying libmariadb.so.2...\c" cp "${serverfiles}/redist/libmariadb.so.2" "${serverfiles}" local exitcode=$? - if [ "${exitcode}" == "0" ]; then - fn_print_ok_eol_nl - fn_script_log_pass "copying libmariadb.so.2" - else + if [ "${exitcode}" != "0" ]; then fn_print_fail_eol_nl fn_script_log_fatal "copying libmariadb.so.2" core_exit.sh + else + fn_print_ok_eol_nl + fn_script_log_pass "copying libmariadb.so.2" fi fi @@ -64,7 +64,7 @@ fi install_eula.sh echo -e "" -echo -e "${lightyellow}Getting privilege key${default}" +echo -e "${lightyellow}Getting Privilege Key${default}" echo -e "=================================" fn_sleep_time fn_print_information_nl "Save these details for later." diff --git a/lgsm/functions/mods_core.sh b/lgsm/functions/mods_core.sh index e79ceb9ad..8e4ade771 100755 --- a/lgsm/functions/mods_core.sh +++ b/lgsm/functions/mods_core.sh @@ -10,7 +10,7 @@ functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" # Files and Directories. modsdir="${lgsmdir}/mods" modstmpdir="${modsdir}/tmp" -extractdir="${modstmpdir}/extract" +extractdest="${modstmpdir}/extract" modsinstalledlist="installed-mods.txt" modsinstalledlistfullpath="${modsdir}/${modsinstalledlist}" @@ -25,10 +25,10 @@ fn_mod_install_files() { fn_script_log_fatal "An issue occurred downloading ${modprettyname}" core_exit.sh fi - if [ ! -d "${extractdir}" ]; then - mkdir -p "${extractdir}" + if [ ! -d "${extractdest}" ]; then + mkdir -p "${extractdest}" fi - fn_dl_extract "${modstmpdir}" "${modfilename}" "${extractdir}" + fn_dl_extract "${modstmpdir}" "${modfilename}" "${extractdest}" } # Convert mod files to lowercase if needed. @@ -39,9 +39,9 @@ fn_mod_lowercase() { fn_sleep_time fn_script_log_info "Converting ${modprettyname} files to lowercase" # Total files and directories for the mod, to output to the user - fileswc=$(find "${extractdir}" | wc -l) + fileswc=$(find "${extractdest}" | wc -l) # Total uppercase files and directories for the mod, to output to the user - filesupperwc=$(find "${extractdir}" -name '*[[:upper:]]*' | wc -l) + filesupperwc=$(find "${extractdest}" -name '*[[:upper:]]*' | wc -l) fn_script_log_info "Found ${filesupperwc} uppercase files out of ${fileswc}, converting" echo -en "Found ${filesupperwc} uppercase files out of ${fileswc}, converting..." # Convert files and directories starting from the deepest to prevent issues (-depth argument) @@ -63,7 +63,7 @@ fn_mod_lowercase() { core_exit.sh fi fi - done < <(find "${extractdir}" -depth -name '*[[:upper:]]*') + done < <(find "${extractdest}" -depth -name '*[[:upper:]]*') fn_print_ok_eol_nl fi } @@ -73,7 +73,7 @@ fn_mod_create_filelist() { echo -en "building ${modcommand}-files.txt..." fn_sleep_time # ${modsdir}/${modcommand}-files.txt. - find "${extractdir}" -mindepth 1 -printf '%P\n' > "${modsdir}/${modcommand}-files.txt" + find "${extractdest}" -mindepth 1 -printf '%P\n' > "${modsdir}/${modcommand}-files.txt" local exitcode=$? if [ "${exitcode}" != 0 ]; then fn_print_fail_eol_nl @@ -93,7 +93,7 @@ fn_mod_create_filelist() { fn_mod_copy_destination() { echo -en "copying ${modprettyname} to ${modinstalldir}..." fn_sleep_time - cp -Rf "${extractdir}/." "${modinstalldir}/" + cp -Rf "${extractdest}/." "${modinstalldir}/" local exitcode=$? if [ "${exitcode}" != 0 ]; then fn_print_fail_eol_nl diff --git a/lgsm/functions/update_factorio.sh b/lgsm/functions/update_factorio.sh index 2c8bf0d01..548d53b15 100644 --- a/lgsm/functions/update_factorio.sh +++ b/lgsm/functions/update_factorio.sh @@ -7,47 +7,44 @@ functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" -fn_update_factorio_dl() { - fn_fetch_file "https://factorio.com/get-download/${downloadbranch}/headless/${factorioarch}" "" "" "" "${tmpdir}" "factorio_headless_${factorioarch}-${remotebuild}.tar.xz" "" "norun" "noforce" "nohash" - fn_dl_extract "${tmpdir}" "factorio_headless_${factorioarch}-${remotebuild}.tar.xz" "${tmpdir}" - echo -e "copying to ${serverfiles}...\c" - cp -R "${tmpdir}/factorio/"* "${serverfiles}" - local exitcode=$? - if [ "${exitcode}" == "0" ]; then - fn_print_ok_eol_nl - fn_script_log_pass "Copying to ${serverfiles}" - fn_clear_tmp - else - fn_print_fail_eol_nl - fn_script_log_fatal "Copying to ${serverfiles}" - core_exit.sh - fn_clear_tmp - fi +fn_update_dl() { + # Download and extract files to serverfiles + fn_fetch_file "${remotebuildurl}" "" "" "" "${tmpdir}" "${remotebuildfilename}" "nochmodx" "norun" "force" "nohash" + fn_dl_extract "${tmpdir}" "factorio_headless_${factorioarch}-${remotebuildversion}.tar.xz" "${serverfiles}" "factorio" + fn_clear_tmp } -fn_update_factorio_localbuild() { +fn_update_localbuild() { # Gets local build info. fn_print_dots "Checking local build: ${remotelocation}" - # Uses executable to find local build. - cd "${executabledir}" || exit - if [ -f "${executable}" ]; then + # Uses executable to get local build. + if [ -d "${exutabledir}" ]; then + cd "${executabledir}" || exit localbuild=$(${executable} --version | grep "Version:" | awk '{print $2}') - fn_print_ok "Checking for update: ${remotelocation}: checking local build" - fn_script_log_pass "Checking local build" - else + fi + if [ -z "${localbuild}" ]; then + fn_print_error "Checking local build: ${remotelocation}: missing local build info" + fn_script_log_error "Missing local build info" + fn_script_log_error "Set localbuild to 0" localbuild="0" - fn_print_error "Checking for update: ${remotelocation}: checking local build" - fn_script_log_error "Checking local build" + else + fn_print_ok "Checking local build: ${remotelocation}" + fn_script_log_pass "Checking local build" fi } -fn_update_factorio_remotebuild() { - # Gets remote build info. - remotebuild=$(curl -s "https://factorio.com/get-download/${downloadbranch}/headless/${factorioarch}" | grep -o '[0-9]\.[0-9]\{1,\}\.[0-9]\{1,\}' | head -1) +fn_update_remotebuild() { + # Get remote build info. + apiurl="https://factorio.com/get-download/${branch}/headless/${factorioarch}" + remotebuildresponse=$(curl -s "${apiurl}") + remotebuildversion=$(echo "${remotebuildresponse}" | grep -o '[0-9]\.[0-9]\{1,\}\.[0-9]\{1,\}' | head -1) + remotebuildurl="https://factorio.com/get-download/${branch}/headless/${factorioarch}" + remotebuildfilename="factorio_headless_${factorioarch}-${remotebuildversion}.tar.xz" + if [ "${firstcommandname}" != "INSTALL" ]; then fn_print_dots "Checking remote build: ${remotelocation}" - # Checks if remotebuild variable has been set. - if [ -z "${remotebuild}" ] || [ "${remotebuild}" == "null" ]; then + # Checks if remotebuildversion variable has been set. + if [ -z "${remotebuildversion}" ] || [ "${remotebuildversion}" == "null" ]; then fn_print_fail "Checking remote build: ${remotelocation}" fn_script_log_fatal "Checking remote build" core_exit.sh @@ -57,7 +54,7 @@ fn_update_factorio_remotebuild() { fi else # Checks if remotebuild variable has been set. - if [ -z "${remotebuild}" ] || [ "${remotebuild}" == "null" ]; then + if [ -z "${remotebuildversion}" ] || [ "${remotebuildversion}" == "null" ]; then fn_print_failure "Unable to get remote build" fn_script_log_fatal "Unable to get remote build" core_exit.sh @@ -65,101 +62,107 @@ fn_update_factorio_remotebuild() { fi } -fn_update_factorio_compare() { +fn_update_compare() { fn_print_dots "Checking for update: ${remotelocation}" - # Removes dots so if statement can compare version numbers. - fn_print_dots "Checking for update: ${remotelocation}" - localbuilddigit=$(echo -e "${localbuild}" | tr -cd '[:digit:]') - remotebuilddigit=$(echo -e "${remotebuild}" | tr -cd '[:digit:]') - if [ "${localbuilddigit}" -ne "${remotebuilddigit}" ] || [ "${forceupdate}" == "1" ]; then + if [ "${localbuild}" != "${remotebuildversion}" ] || [ "${forceupdate}" == "1" ]; then fn_print_ok_nl "Checking for update: ${remotelocation}" echo -en "\n" echo -e "Update available" echo -e "* Local build: ${red}${localbuild} ${factorioarch}${default}" - echo -e "* Remote build: ${green}${remotebuild} ${factorioarch}${default}" + echo -e "* Remote build: ${green}${remotebuildversion} ${factorioarch}${default}" if [ -n "${branch}" ]; then echo -e "* Branch: ${branch}" fi + if [ -f "${rootdir}/.dev-debug" ]; then + echo -e "Remote build info" + echo -e "* apiurl: ${apiurl}" + echo -e "* remotebuildfilename: ${remotebuildfilename}" + echo -e "* remotebuildurl: ${remotebuildurl}" + echo -e "* remotebuildversion: ${remotebuildversion}" + fi echo -en "\n" fn_script_log_info "Update available" fn_script_log_info "Local build: ${localbuild} ${factorioarch}" - fn_script_log_info "Remote build: ${remotebuild} ${factorioarch}" - if [ -v "${branch}" ]; then + fn_script_log_info "Remote build: ${remotebuildversion} ${factorioarch}" + if [ -n "${branch}" ]; then fn_script_log_info "Branch: ${branch}" fi - fn_script_log_info "${localbuild} > ${remotebuild}" + fn_script_log_info "${localbuild} > ${remotebuildversion}" - unset updateonstart - check_status.sh - # If server stopped. - if [ "${status}" == "0" ]; then - exitbypass=1 - fn_update_factorio_dl - if [ "${requirerestart}" == "1" ]; then + if [ "${commandname}" == "UPDATE" ]; then + unset updateonstart + check_status.sh + # If server stopped. + if [ "${status}" == "0" ]; then + fn_update_dl + if [ "${localbuild}" == "0" ]; then + exitbypass=1 + command_start.sh + fn_firstcommand_reset + exitbypass=1 + sleep 5 + command_stop.sh + fn_firstcommand_reset + fi + # If server started. + else + fn_print_restart_warning exitbypass=1 - command_start.sh + command_stop.sh fn_firstcommand_reset exitbypass=1 - command_stop.sh + fn_update_dl + exitbypass=1 + command_start.sh fn_firstcommand_reset fi - # If server started. - else - fn_print_restart_warning - exitbypass=1 - command_stop.sh - fn_firstcommand_reset - exitbypass=1 - fn_update_factorio_dl - exitbypass=1 - command_start.sh - fn_firstcommand_reset + unset exitbypass + date +%s > "${lockdir}/lastupdate.lock" + alert="update" + elif [ "${commandname}" == "CHECK-UPDATE" ]; then + alert="check-update" fi - unset exitbypass - date +%s > "${lockdir}/lastupdate.lock" - alert="update" alert.sh else fn_print_ok_nl "Checking for update: ${remotelocation}" echo -en "\n" echo -e "No update available" echo -e "* Local build: ${green}${localbuild} ${factorioarch}${default}" - echo -e "* Remote build: ${green}${remotebuild} ${factorioarch}${default}" - if [ -v "${branch}" ]; then + echo -e "* Remote build: ${green}${remotebuildversion} ${factorioarch}${default}" + if [ -n "${branch}" ]; then echo -e "* Branch: ${branch}" fi echo -en "\n" fn_script_log_info "No update available" fn_script_log_info "Local build: ${localbuild} ${factorioarch}" - fn_script_log_info "Remote build: ${remotebuild} ${factorioarch}" - if [ -v "${branch}" ]; then + fn_script_log_info "Remote build: ${remotebuildversion} ${factorioarch}" + if [ -n "${branch}" ]; then fn_script_log_info "Branch: ${branch}" fi + if [ -f "${rootdir}/.dev-debug" ]; then + echo -e "Remote build info" + echo -e "* apiurl: ${apiurl}" + echo -e "* remotebuildfilename: ${remotebuildfilename}" + echo -e "* remotebuildurl: ${remotebuildurl}" + echo -e "* remotebuildversion: ${remotebuildversion}" + fi fi } -# The location where the builds are checked and downloaded. -remotelocation="factorio.com" - # Game server architecture. factorioarch="linux64" -if [ "${branch}" == "stable" ]; then - downloadbranch="stable" -elif [ "${branch}" == "experimental" ]; then - downloadbranch="latest" -else - downloadbranch="${branch}" -fi +# The location where the builds are checked and downloaded. +remotelocation="factorio.com" if [ "${firstcommandname}" == "INSTALL" ]; then - fn_update_factorio_remotebuild - fn_update_factorio_dl + fn_update_remotebuild + fn_update_dl else fn_print_dots "Checking for update" fn_print_dots "Checking for update: ${remotelocation}" fn_script_log_info "Checking for update: ${remotelocation}" - fn_update_factorio_localbuild - fn_update_factorio_remotebuild - fn_update_factorio_compare + fn_update_localbuild + fn_update_remotebuild + fn_update_compare fi diff --git a/lgsm/functions/update_jediknight2.sh b/lgsm/functions/update_jediknight2.sh index 421bc543f..7560f0158 100644 --- a/lgsm/functions/update_jediknight2.sh +++ b/lgsm/functions/update_jediknight2.sh @@ -3,81 +3,45 @@ # Author: Daniel Gibbs # Contributors: http://linuxgsm.com/contrib # Website: https://linuxgsm.com -# Description: Handles updating of jk2 servers. +# Description: Handles updating of Jedi Knight 2 servers. functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" -fn_update_jk2_dl() { - fn_fetch_file "https://github.com/mvdevs/jk2mv/releases/download/${remotebuild}/jk2mv-v${remotebuild}-dedicated.zip" "" "" "" "${tmpdir}" "jk2mv-${remotebuild}-dedicated.zip" "" "norun" "noforce" "nohash" - fn_dl_extract "${tmpdir}" "jk2mv-${remotebuild}-dedicated.zip" "${tmpdir}/jk2mv-v${remotebuild}-dedicated" - echo -e "copying to ${serverfiles}...\c" - cp -R "${tmpdir}/jk2mv-v${remotebuild}-dedicated/linux-amd64/jk2mvded"* "${serverfiles}/GameData" - local exitcode=$? - if [ "${exitcode}" == "0" ]; then - fn_print_ok_eol_nl - fn_script_log_pass "Copying to ${serverfiles}" - fn_clear_tmp - else - fn_print_fail_eol_nl - fn_script_log_fatal "Copying to ${serverfiles}" - core_exit.sh - fi +fn_update_dl() { + # Download and extract files to serverfiles + fn_fetch_file "${remotebuildurl}" "" "" "" "${tmpdir}" "${remotebuildfilename}" "nochmodx" "norun" "force" "nohash" + fn_dl_extract "${tmpdir}" "${remotebuildfilename}" "${serverfiles}/GameData" "linux-amd64" + fn_clear_tmp } -fn_update_jk2_localbuild() { +fn_update_localbuild() { # Gets local build info. fn_print_dots "Checking local build: ${remotelocation}" - # Uses log file to gather info. - # Log is generated and cleared on startup but filled on shutdown. - requirerestart=1 - localbuild=$(grep "\"version\"" "${consolelogdir}"/* 2> /dev/null | sed 's/.*://' | awk '{print $1}' | head -n 1) - if [ -z "${localbuild}" ]; then - fn_print_error "Checking local build: ${remotelocation}" - fn_print_error_nl "Checking local build: ${remotelocation}: no log files containing version info" - fn_print_info_nl "Checking local build: ${remotelocation}: forcing server restart" - fn_script_log_error "No log files containing version info" - fn_script_log_info "Forcing server restart" - - check_status.sh - # If server stopped. - if [ "${status}" == "0" ]; then - exitbypass=1 - command_start.sh - fn_firstcommand_reset - sleep 3 - exitbypass=1 - command_stop.sh - fn_firstcommand_reset - # If server started. - else - exitbypass=1 - command_stop.sh - fn_firstcommand_reset - fi - fi - - if [ -z "${localbuild}" ]; then - localbuild=$(grep Version "$(ls -tr "${consolelogdir}"/* 2> /dev/null)" | tail -1 | sed 's/.*Version //') - fi - + # Uses log file to get local build. + localbuild=$(grep "\"version\"" "${consolelogdir}"/* 2> /dev/null | sed 's/.*://' | awk '{print $1}' | head -n 1 | sed 's/v//') if [ -z "${localbuild}" ]; then - localbuild="0" - fn_print_error "Checking local build: ${remotelocation}: waiting for local build: missing local build info" + fn_print_error "Checking local build: ${remotelocation}: missing local build info" fn_script_log_error "Missing local build info" fn_script_log_error "Set localbuild to 0" + localbuild="0" else fn_print_ok "Checking local build: ${remotelocation}" fn_script_log_pass "Checking local build" fi } -fn_update_jk2_remotebuild() { - # Gets remote build info. - remotebuild=$(curl -s "https://api.github.com/repos/mvdevs/jk2mv/releases/latest" | grep dedicated.zip | tail -1 | awk -F"/" '{ print $8 }') +fn_update_remotebuild() { + # Get remote build info. + apiurl="https://api.github.com/repos/mvdevs/jk2mv/releases/latest" + remotebuildresponse=$(curl -s "${apiurl}") + remotebuildfilename=$(echo "${remotebuildresponse}" | jq -r '.assets[]|select(.browser_download_url | contains("dedicated.zip")) | .name') + remotebuildurl=$(echo "${remotebuildresponse}" | jq -r '.assets[]|select(.browser_download_url | contains("dedicated.zip")) | .browser_download_url') + remotebuildversion=$(echo "${remotebuildresponse}" | jq -r '.tag_name') + if [ "${firstcommandname}" != "INSTALL" ]; then fn_print_dots "Checking remote build: ${remotelocation}" - # Checks if remotebuild variable has been set. - if [ -z "${remotebuild}" ] || [ "${remotebuild}" == "null" ]; then + # Checks if remotebuildversion variable has been set. + if [ -z "${remotebuildversion}" ] || [ "${remotebuildversion}" == "null" ]; then fn_print_fail "Checking remote build: ${remotelocation}" fn_script_log_fatal "Checking remote build" core_exit.sh @@ -87,7 +51,7 @@ fn_update_jk2_remotebuild() { fi else # Checks if remotebuild variable has been set. - if [ -z "${remotebuild}" ] || [ "${remotebuild}" == "null" ]; then + if [ -z "${remotebuildversion}" ] || [ "${remotebuildversion}" == "null" ]; then fn_print_failure "Unable to get remote build" fn_script_log_fatal "Unable to get remote build" core_exit.sh @@ -95,80 +59,105 @@ fn_update_jk2_remotebuild() { fi } -fn_update_jk2_compare() { - # Removes dots so if statement can compare version numbers. +fn_update_compare() { fn_print_dots "Checking for update: ${remotelocation}" - localbuilddigit=$(echo -e "${localbuild}" | tr -cd '[:digit:]') - remotebuilddigit=$(echo -e "${remotebuild}" | tr -cd '[:digit:]') - if [ "${localbuilddigit}" -ne "${remotebuilddigit}" ] || [ "${forceupdate}" == "1" ]; then + if [ "${localbuild}" != "${remotebuildversion}" ] || [ "${forceupdate}" == "1" ]; then fn_print_ok_nl "Checking for update: ${remotelocation}" echo -en "\n" echo -e "Update available" - echo -e "* Local build: ${red}${localbuild} ${jk2arch}${default}" - echo -e "* Remote build: ${green}${remotebuild} ${jk2arch}${default}" + echo -e "* Local build: ${red}${localbuild}${default}" + echo -e "* Remote build: ${green}${remotebuildversion}${default}" + if [ -n "${branch}" ]; then + echo -e "* Branch: ${branch}" + fi + if [ -f "${rootdir}/.dev-debug" ]; then + echo -e "Remote build info" + echo -e "* apiurl: ${apiurl}" + echo -e "* remotebuildfilename: ${remotebuildfilename}" + echo -e "* remotebuildurl: ${remotebuildurl}" + echo -e "* remotebuildversion: ${remotebuildversion}" + fi echo -en "\n" fn_script_log_info "Update available" - fn_script_log_info "Local build: ${localbuild} ${jk2arch}" - fn_script_log_info "Remote build: ${remotebuild} ${jk2arch}" - fn_script_log_info "${localbuild} > ${remotebuild}" + fn_script_log_info "Local build: ${localbuild}" + fn_script_log_info "Remote build: ${remotebuildversion}" + if [ -n "${branch}" ]; then + fn_script_log_info "Branch: ${branch}" + fi + fn_script_log_info "${localbuild} > ${remotebuildversion}" - unset updateonstart - check_status.sh - # If server stopped. - if [ "${status}" == "0" ]; then - exitbypass=1 - fn_update_jk2_dl - if [ "${requirerestart}" == "1" ]; then + if [ "${commandname}" == "UPDATE" ]; then + unset updateonstart + check_status.sh + # If server stopped. + if [ "${status}" == "0" ]; then + fn_update_dl + if [ "${localbuild}" == "0" ]; then + exitbypass=1 + command_start.sh + fn_firstcommand_reset + exitbypass=1 + sleep 5 + command_stop.sh + fn_firstcommand_reset + fi + # If server started. + else + fn_print_restart_warning exitbypass=1 - command_start.sh + command_stop.sh fn_firstcommand_reset exitbypass=1 - command_stop.sh + fn_update_dl + exitbypass=1 + command_start.sh fn_firstcommand_reset fi - # If server started. - else - fn_print_restart_warning - exitbypass=1 - command_stop.sh - fn_firstcommand_reset - exitbypass=1 - fn_update_jk2_dl - exitbypass=1 - command_start.sh - fn_firstcommand_reset + unset exitbypass + date +%s > "${lockdir}/lastupdate.lock" + alert="update" + elif [ "${commandname}" == "CHECK-UPDATE" ]; then + alert="check-update" fi - date +%s > "${lockdir}/lastupdate.lock" - alert="update" alert.sh else fn_print_ok_nl "Checking for update: ${remotelocation}" echo -en "\n" echo -e "No update available" - echo -e "* Local build: ${green}${localbuild} ${jk2arch}${default}" - echo -e "* Remote build: ${green}${remotebuild} ${jk2arch}${default}" + echo -e "* Local build: ${green}${localbuild}${default}" + echo -e "* Remote build: ${green}${remotebuildversion}${default}" + if [ -n "${branch}" ]; then + echo -e "* Branch: ${branch}" + fi echo -en "\n" fn_script_log_info "No update available" - fn_script_log_info "Local build: ${localbuild} ${jk2arch}" - fn_script_log_info "Remote build: ${remotebuild} ${jk2arch}" + fn_script_log_info "Local build: ${localbuild}" + fn_script_log_info "Remote build: ${remotebuildversion}" + if [ -n "${branch}" ]; then + fn_script_log_info "Branch: ${branch}" + fi + if [ -f "${rootdir}/.dev-debug" ]; then + echo -e "Remote build info" + echo -e "* apiurl: ${apiurl}" + echo -e "* remotebuildfilename: ${remotebuildfilename}" + echo -e "* remotebuildurl: ${remotebuildurl}" + echo -e "* remotebuildversion: ${remotebuildversion}" + fi fi } # The location where the builds are checked and downloaded. -remotelocation="jk2mv.org" - -# Game server architecture. -jk2arch="x64" +remotelocation="github.com" if [ "${firstcommandname}" == "INSTALL" ]; then - fn_update_jk2_remotebuild - fn_update_jk2_dl + fn_update_remotebuild + fn_update_dl else update_steamcmd.sh fn_print_dots "Checking for update" fn_print_dots "Checking for update: ${remotelocation}" fn_script_log_info "Checking for update: ${remotelocation}" - fn_update_jk2_localbuild - fn_update_jk2_remotebuild - fn_update_jk2_compare + fn_update_localbuild + fn_update_remotebuild + fn_update_compare fi diff --git a/lgsm/functions/update_minecraft.sh b/lgsm/functions/update_minecraft.sh index d20b98ef4..ace4713bc 100644 --- a/lgsm/functions/update_minecraft.sh +++ b/lgsm/functions/update_minecraft.sh @@ -3,66 +3,57 @@ # Author: Daniel Gibbs # Contributors: http://linuxgsm.com/contrib # Website: https://linuxgsm.com -# Description: Handles updating of Minecraft servers. +# Description: Handles updating of Minecraft: Java Edition servers. functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" -fn_update_minecraft_dl() { - # Generate link to version manifest json. - remotebuildlink=$(curl -s "https://launchermeta.${remotelocation}/mc/game/version_manifest.json" | jq -r --arg branch ${branch} --arg mcversion ${remotebuild} '.versions | .[] | select(.type==$branch and .id==$mcversion) | .url') - # Generate link to server.jar - remotebuildurl=$(curl -s "${remotebuildlink}" | jq -r '.downloads.server.url') - - fn_fetch_file "${remotebuildurl}" "" "" "" "${tmpdir}" "minecraft_server.${remotebuild}.jar" "" "norun" "noforce" "nohash" - echo -e "copying to ${serverfiles}...\c" - cp "${tmpdir}/minecraft_server.${remotebuild}.jar" "${serverfiles}/minecraft_server.jar" - local exitcode=$? - if [ "${exitcode}" == "0" ]; then - fn_print_ok_eol_nl - fn_script_log_pass "Copying to ${serverfiles}" - chmod u+x "${serverfiles}/minecraft_server.jar" - fn_clear_tmp - else - fn_print_fail_eol_nl - fn_script_log_fatal "Copying to ${serverfiles}" - fn_clear_tmp - core_exit.sh - fi +fn_update_dl() { + # Download and extract files to serverfiles + fn_fetch_file "${remotebuildurl}" "" "" "" "${serverfiles}" "minecraft_server.jar" "chmodx" "norun" "noforce" "nohash" } -fn_update_minecraft_localbuild() { +fn_update_localbuild() { # Gets local build info. fn_print_dots "Checking local build: ${remotelocation}" - # Uses executable to find local build. - cd "${executabledir}" || exit - if [ -f "minecraft_server.jar" ]; then + # Uses executable to get local build. + if [ -d "${exutabledir}" ]; then + cd "${executabledir}" || exit localbuild=$(unzip -p "minecraft_server.jar" version.json | jq -r '.id') + fi + if [ -z "${localbuild}" ]; then + fn_print_error "Checking local build: ${remotelocation}: missing local build info" + fn_script_log_error "Missing local build info" + fn_script_log_error "Set localbuild to 0" + localbuild="0" + else fn_print_ok "Checking local build: ${remotelocation}" fn_script_log_pass "Checking local build" - else - localbuild="0" - fn_print_error "Checking local build: ${remotelocation}" - fn_script_log_error "Checking local build" fi } -fn_update_minecraft_remotebuild() { - # Gets remote build info. +fn_update_remotebuild() { + # Get remote build info. + apiurl="https://launchermeta.mojang.com/mc/game/version_manifest.json" + remotebuildresponse=$(curl -s "${apiurl}") # Latest release. if [ "${branch}" == "release" ] && [ "${mcversion}" == "latest" ]; then - remotebuild=$(curl -s "https://launchermeta.${remotelocation}/mc/game/version_manifest.json" | jq -r '.latest.release') + remotebuildversion=$(echo "${remotebuildresponse}" | jq -r '.latest.release') # Latest snapshot. elif [ "${branch}" == "snapshot" ] && [ "${mcversion}" == "latest" ]; then - remotebuild=$(curl -s "https://launchermeta.${remotelocation}/mc/game/version_manifest.json" | jq -r '.latest.snapshot') + remotebuildversion=$(echo "${remotebuildresponse}" | jq -r '.latest.snapshot') # Specific release/snapshot. else - remotebuild=$(curl -s "https://launchermeta.${remotelocation}/mc/game/version_manifest.json" | jq -r --arg branch ${branch} --arg mcversion ${mcversion} '.versions | .[] | select(.type==$branch and .id==$mcversion) | .id') + remotebuildversion=$(echo "${remotebuildresponse}" | jq -r --arg branch "${branch}" --arg mcversion "${mcversion}" '.versions | .[] | select(.type==$branch and .id==$mcversion) | .id') fi + # Generate link to version manifest json. + remotebuildmanifest=$(echo "${remotebuildresponse}" | jq -r --arg branch "${branch}" --arg mcversion "${remotebuildversion}" '.versions | .[] | select(.type==$branch and .id==$mcversion) | .url') + # Generate link to server.jar + remotebuildurl=$(curl -s "${remotebuildmanifest}" | jq -r '.downloads.server.url') if [ "${firstcommandname}" != "INSTALL" ]; then fn_print_dots "Checking remote build: ${remotelocation}" - # Checks if remotebuild variable has been set. - if [ -z "${remotebuild}" ] || [ "${remotebuild}" == "null" ]; then + # Checks if remotebuildversion variable has been set. + if [ -z "${remotebuildversion}" ] || [ "${remotebuildversion}" == "null" ]; then fn_print_fail "Checking remote build: ${remotelocation}" fn_script_log_fatal "Checking remote build" core_exit.sh @@ -72,7 +63,7 @@ fn_update_minecraft_remotebuild() { fi else # Checks if remotebuild variable has been set. - if [ -z "${remotebuild}" ] || [ "${remotebuild}" == "null" ]; then + if [ -z "${remotebuildversion}" ] || [ "${remotebuildversion}" == "null" ]; then fn_print_failure "Unable to get remote build" fn_script_log_fatal "Unable to get remote build" core_exit.sh @@ -80,70 +71,90 @@ fn_update_minecraft_remotebuild() { fi } -fn_update_minecraft_compare() { - # Removes dots so if statement can compare version numbers. +fn_update_compare() { fn_print_dots "Checking for update: ${remotelocation}" - if [ "${localbuild}" != "${remotebuild}" ] || [ "${forceupdate}" == "1" ]; then + if [ "${localbuild}" != "${remotebuildversion}" ] || [ "${forceupdate}" == "1" ]; then fn_print_ok_nl "Checking for update: ${remotelocation}" echo -en "\n" echo -e "Update available" echo -e "* Local build: ${red}${localbuild}${default}" - echo -e "* Remote build: ${green}${remotebuild}${default}" + echo -e "* Remote build: ${green}${remotebuildversion}${default}" if [ -n "${branch}" ]; then echo -e "* Branch: ${branch}" fi + if [ -f "${rootdir}/.dev-debug" ]; then + echo -e "Remote build info" + echo -e "* apiurl: ${apiurl}" + echo -e "* remotebuildfilename: ${remotebuildfilename}" + echo -e "* remotebuildurl: ${remotebuildurl}" + echo -e "* remotebuildversion: ${remotebuildversion}" + fi echo -en "\n" fn_script_log_info "Update available" fn_script_log_info "Local build: ${localbuild}" - fn_script_log_info "Remote build: ${remotebuild}" - fn_script_log_info "${localbuild} > ${remotebuild}" + fn_script_log_info "Remote build: ${remotebuildversion}" + if [ -n "${branch}" ]; then + fn_script_log_info "Branch: ${branch}" + fi + fn_script_log_info "${localbuild} > ${remotebuildversion}" - unset updateonstart - check_status.sh - # If server stopped. - if [ "${status}" == "0" ]; then - exitbypass=1 - fn_update_minecraft_dl - if [ "${requirerestart}" == "1" ]; then + if [ "${commandname}" == "UPDATE" ]; then + unset updateonstart + check_status.sh + # If server stopped. + if [ "${status}" == "0" ]; then + fn_update_dl + if [ "${localbuild}" == "0" ]; then + exitbypass=1 + command_start.sh + fn_firstcommand_reset + exitbypass=1 + sleep 5 + command_stop.sh + fn_firstcommand_reset + fi + # If server started. + else + fn_print_restart_warning exitbypass=1 - command_start.sh + command_stop.sh fn_firstcommand_reset exitbypass=1 - command_stop.sh + fn_update_dl + exitbypass=1 + command_start.sh fn_firstcommand_reset fi - # If server started. - else - fn_print_restart_warning - exitbypass=1 - command_stop.sh - fn_firstcommand_reset - exitbypass=1 - fn_update_minecraft_dl - exitbypass=1 - command_start.sh - fn_firstcommand_reset + unset exitbypass + date +%s > "${lockdir}/lastupdate.lock" + alert="update" + elif [ "${commandname}" == "CHECK-UPDATE" ]; then + alert="check-update" fi - unset exitbypass - date +%s > "${lockdir}/lastupdate.lock" - alert="update" alert.sh else fn_print_ok_nl "Checking for update: ${remotelocation}" echo -en "\n" echo -e "No update available" echo -e "* Local build: ${green}${localbuild}${default}" - echo -e "* Remote build: ${green}${remotebuild}${default}" + echo -e "* Remote build: ${green}${remotebuildversion}${default}" if [ -n "${branch}" ]; then echo -e "* Branch: ${branch}" fi echo -en "\n" fn_script_log_info "No update available" fn_script_log_info "Local build: ${localbuild}" - fn_script_log_info "Remote build: ${remotebuild}" + fn_script_log_info "Remote build: ${remotebuildversion}" if [ -n "${branch}" ]; then fn_script_log_info "Branch: ${branch}" fi + if [ -f "${rootdir}/.dev-debug" ]; then + echo -e "Remote build info" + echo -e "* apiurl: ${apiurl}" + echo -e "* remotebuildfilename: ${remotebuildfilename}" + echo -e "* remotebuildurl: ${remotebuildurl}" + echo -e "* remotebuildversion: ${remotebuildversion}" + fi fi } @@ -151,13 +162,13 @@ fn_update_minecraft_compare() { remotelocation="mojang.com" if [ "${firstcommandname}" == "INSTALL" ]; then - fn_update_minecraft_remotebuild - fn_update_minecraft_dl + fn_update_remotebuild + fn_update_dl else fn_print_dots "Checking for update" fn_print_dots "Checking for update: ${remotelocation}" fn_script_log_info "Checking for update: ${remotelocation}" - fn_update_minecraft_localbuild - fn_update_minecraft_remotebuild - fn_update_minecraft_compare + fn_update_localbuild + fn_update_remotebuild + fn_update_compare fi diff --git a/lgsm/functions/update_minecraft_bedrock.sh b/lgsm/functions/update_minecraft_bedrock.sh index 163e076aa..cf61e3a2b 100644 --- a/lgsm/functions/update_minecraft_bedrock.sh +++ b/lgsm/functions/update_minecraft_bedrock.sh @@ -7,90 +7,60 @@ functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" -#random number for userAgent -randnum=$((1 + RANDOM % 5000)) - -fn_update_minecraft_dl() { - fn_fetch_file "https://minecraft.azureedge.net/bin-linux/bedrock-server-${remotebuild}.zip" "" "" "" "${tmpdir}" "bedrock_server.${remotebuild}.zip" +fn_update_dl() { + fn_fetch_file "${remotebuildurl}" "" "" "" "${tmpdir}" "bedrock_server.${remotebuildversion}.zip" echo -e "Extracting to ${serverfiles}...\c" if [ "${firstcommandname}" == "INSTALL" ]; then - unzip -oq "${tmpdir}/bedrock_server.${remotebuild}.zip" -x "server.properties" -d "${serverfiles}" + unzip -oq "${tmpdir}/bedrock_server.${remotebuildversion}.zip" -x "server.properties" -d "${serverfiles}" else - unzip -oq "${tmpdir}/bedrock_server.${remotebuild}.zip" -x "permissions.json" "server.properties" "allowlist.json" -d "${serverfiles}" + unzip -oq "${tmpdir}/bedrock_server.${remotebuildversion}.zip" -x "permissions.json" "server.properties" "allowlist.json" -d "${serverfiles}" fi local exitcode=$? - if [ "${exitcode}" == "0" ]; then - fn_print_ok_eol_nl - fn_script_log_pass "Extracting to ${serverfiles}" - chmod u+x "${serverfiles}/bedrock_server" - fn_clear_tmp - else + if [ "${exitcode}" != 0 ]; then fn_print_fail_eol_nl - fn_script_log_fatal "Extracting to ${serverfiles}" - fn_clear_tmp + fn_script_log_fatal "Extracting ${local_filename}" + if [ -f "${lgsmlog}" ]; then + echo -e "${extractcmd}" >> "${lgsmlog}" + fi + echo -e "${extractcmd}" core_exit.sh + else + fn_print_ok_eol_nl + fn_script_log_pass "Extracting ${local_filename}" fi } -fn_update_minecraft_localbuild() { +fn_update_localbuild() { # Gets local build info. fn_print_dots "Checking local build: ${remotelocation}" - # Uses log file to gather info. - # Log is generated and cleared on startup but filled on shutdown. - requirerestart=1 - localbuild=$(grep Version "${consolelogdir}"/* 2> /dev/null | tail -1 | sed 's/.*Version //') - if [ -z "${localbuild}" ]; then - fn_print_error "Checking local build: ${remotelocation}" - fn_print_error_nl "Checking local build: ${remotelocation}: no log files containing version info" - fn_print_info_nl "Checking local build: ${remotelocation}: forcing server restart" - fn_script_log_error "No log files containing version info" - fn_script_log_info "Forcing server restart" - - check_status.sh - # If server stopped. - if [ "${status}" == "0" ]; then - exitbypass=1 - command_start.sh - fn_firstcommand_reset - sleep 3 - exitbypass=1 - command_stop.sh - fn_firstcommand_reset - # If server started. - else - exitbypass=1 - command_stop.sh - fn_firstcommand_reset - fi - fi - - if [ -z "${localbuild}" ]; then - localbuild=$(grep Version "$(ls -tr "${consolelogdir}"/* 2> /dev/null)" | tail -1 | sed 's/.*Version //') - fi - + # Uses log file to get local build. + localbuild=$(grep Version "${consolelogdir}"/* 2> /dev/null | tail -1 | sed 's/.*Version //' | tr -d '\000-\011\013-\037') if [ -z "${localbuild}" ]; then - localbuild="0" - fn_print_error "Checking local build: ${remotelocation}: waiting for local build: missing local build info" + fn_print_error "Checking local build: ${remotelocation}: missing local build info" fn_script_log_error "Missing local build info" fn_script_log_error "Set localbuild to 0" + localbuild="0" else fn_print_ok "Checking local build: ${remotelocation}" fn_script_log_pass "Checking local build" fi } -fn_update_minecraft_remotebuild() { - # Gets remote build info. +fn_update_remotebuild() { + # Random number for userAgent + randnum=$((1 + RANDOM % 5000)) + # Get remote build info. if [ "${mcversion}" == "latest" ]; then - remotebuild=$(curl -H "Accept-Encoding: identity" -H "Accept-Language: en" -Ls -A "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.${randnum}.212 Safari/537.36" "https://www.minecraft.net/en-us/download/server/bedrock/" | grep -o 'https://minecraft.azureedge.net/bin-linux/[^"]*' | sed 's/.*\///' | grep -Eo "[.0-9]+[0-9]") + remotebuildversion=$(curl -H "Accept-Encoding: identity" -H "Accept-Language: en" -Ls -A "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.${randnum}.212 Safari/537.36" "https://www.minecraft.net/en-us/download/server/bedrock/" | grep -o 'https://minecraft.azureedge.net/bin-linux/[^"]*' | sed 's/.*\///' | grep -Eo "[.0-9]+[0-9]") else - remotebuild="${mcversion}" + remotebuildversion="${mcversion}" fi + remotebuildurl="https://minecraft.azureedge.net/bin-linux/bedrock-server-${remotebuildversion}.zip" if [ "${firstcommandname}" != "INSTALL" ]; then fn_print_dots "Checking remote build: ${remotelocation}" - # Checks if remotebuild variable has been set. - if [ -z "${remotebuild}" ] || [ "${remotebuild}" == "null" ]; then + # Checks if remotebuildversion variable has been set. + if [ -z "${remotebuildversion}" ] || [ "${remotebuildversion}" == "null" ]; then fn_print_fail "Checking remote build: ${remotelocation}" fn_script_log_fatal "Checking remote build" core_exit.sh @@ -100,7 +70,7 @@ fn_update_minecraft_remotebuild() { fi else # Checks if remotebuild variable has been set. - if [ -z "${remotebuild}" ] || [ "${remotebuild}" == "null" ]; then + if [ -z "${remotebuildversion}" ] || [ "${remotebuildversion}" == "null" ]; then fn_print_failure "Unable to get remote build" fn_script_log_fatal "Unable to get remote build" core_exit.sh @@ -108,63 +78,90 @@ fn_update_minecraft_remotebuild() { fi } -fn_update_minecraft_compare() { - # Removes dots so if statement can compare version numbers. +fn_update_compare() { fn_print_dots "Checking for update: ${remotelocation}" - localbuilddigit=$(echo -e "${localbuild}" | tr -cd '[:digit:]') - remotebuilddigit=$(echo -e "${remotebuild}" | tr -cd '[:digit:]') - if [ "${localbuilddigit}" -ne "${remotebuilddigit}" ] || [ "${forceupdate}" == "1" ]; then + if [ "${localbuild}" != "${remotebuildversion}" ] || [ "${forceupdate}" == "1" ]; then fn_print_ok_nl "Checking for update: ${remotelocation}" echo -en "\n" echo -e "Update available" echo -e "* Local build: ${red}${localbuild}${default}" - echo -e "* Remote build: ${green}${remotebuild}${default}" + echo -e "* Remote build: ${green}${remotebuildversion}${default}" + if [ -n "${branch}" ]; then + echo -e "* Branch: ${branch}" + fi + if [ -f "${rootdir}/.dev-debug" ]; then + echo -e "Remote build info" + echo -e "* apiurl: ${apiurl}" + echo -e "* remotebuildfilename: ${remotebuildfilename}" + echo -e "* remotebuildurl: ${remotebuildurl}" + echo -e "* remotebuildversion: ${remotebuildversion}" + fi echo -en "\n" fn_script_log_info "Update available" fn_script_log_info "Local build: ${localbuild}" - fn_script_log_info "Remote build: ${remotebuild}" - fn_script_log_info "${localbuild} > ${remotebuild}" + fn_script_log_info "Remote build: ${remotebuildversion}" + if [ -n "${branch}" ]; then + fn_script_log_info "Branch: ${branch}" + fi + fn_script_log_info "${localbuild} > ${remotebuildversion}" - unset updateonstart - check_status.sh - # If server stopped. - if [ "${status}" == "0" ]; then - exitbypass=1 - fn_update_minecraft_dl - if [ "${requirerestart}" == "1" ]; then + if [ "${commandname}" == "UPDATE" ]; then + unset updateonstart + check_status.sh + # If server stopped. + if [ "${status}" == "0" ]; then + fn_update_dl + if [ "${localbuild}" == "0" ]; then + exitbypass=1 + command_start.sh + fn_firstcommand_reset + exitbypass=1 + sleep 5 + command_stop.sh + fn_firstcommand_reset + fi + # If server started. + else + fn_print_restart_warning exitbypass=1 - command_start.sh + command_stop.sh fn_firstcommand_reset exitbypass=1 - command_stop.sh + fn_update_dl + exitbypass=1 + command_start.sh fn_firstcommand_reset fi - # If server started. - else - fn_print_restart_warning - exitbypass=1 - command_stop.sh - fn_firstcommand_reset - exitbypass=1 - fn_update_minecraft_dl - exitbypass=1 - command_start.sh - fn_firstcommand_reset + unset exitbypass + date +%s > "${lockdir}/lastupdate.lock" + alert="update" + elif [ "${commandname}" == "CHECK-UPDATE" ]; then + alert="check-update" fi - unset exitbypass - date +%s > "${lockdir}/lastupdate.lock" - alert="update" alert.sh else fn_print_ok_nl "Checking for update: ${remotelocation}" echo -en "\n" echo -e "No update available" echo -e "* Local build: ${green}${localbuild}${default}" - echo -e "* Remote build: ${green}${remotebuild}${default}" + echo -e "* Remote build: ${green}${remotebuildversion}${default}" + if [ -n "${branch}" ]; then + echo -e "* Branch: ${branch}" + fi echo -en "\n" fn_script_log_info "No update available" fn_script_log_info "Local build: ${localbuild}" - fn_script_log_info "Remote build: ${remotebuild}" + fn_script_log_info "Remote build: ${remotebuildversion}" + if [ -n "${branch}" ]; then + fn_script_log_info "Branch: ${branch}" + fi + if [ -f "${rootdir}/.dev-debug" ]; then + echo -e "Remote build info" + echo -e "* apiurl: ${apiurl}" + echo -e "* remotebuildfilename: ${remotebuildfilename}" + echo -e "* remotebuildurl: ${remotebuildurl}" + echo -e "* remotebuildversion: ${remotebuildversion}" + fi fi } @@ -172,13 +169,13 @@ fn_update_minecraft_compare() { remotelocation="minecraft.net" if [ "${firstcommandname}" == "INSTALL" ]; then - fn_update_minecraft_remotebuild - fn_update_minecraft_dl + fn_update_remotebuild + fn_update_dl else fn_print_dots "Checking for update" fn_print_dots "Checking for update: ${remotelocation}" fn_script_log_info "Checking for update: ${remotelocation}" - fn_update_minecraft_localbuild - fn_update_minecraft_remotebuild - fn_update_minecraft_compare + fn_update_localbuild + fn_update_remotebuild + fn_update_compare fi diff --git a/lgsm/functions/update_mta.sh b/lgsm/functions/update_mta.sh index 61216b809..5252c1328 100644 --- a/lgsm/functions/update_mta.sh +++ b/lgsm/functions/update_mta.sh @@ -7,103 +7,39 @@ functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" -fn_update_mta_dl() { - fn_fetch_file "http://linux.mtasa.com/dl/multitheftauto_linux_x64.tar.gz" "" "" "" "${tmpdir}" "multitheftauto_linux_x64.tar.gz" "" "norun" "noforce" "nohash" - mkdir "${tmpdir}/multitheftauto_linux_x64" - fn_dl_extract "${tmpdir}" "multitheftauto_linux_x64.tar.gz" "${tmpdir}/multitheftauto_linux_x64" - echo -e "copying to ${serverfiles}...\c" - cp -R "${tmpdir}/multitheftauto_linux_x64/multitheftauto_linux_x64/"* "${serverfiles}" - local exitcode=$? - fn_clear_tmp - if [ "${exitcode}" == "0" ]; then - fn_print_ok_eol_nl - fn_script_log_pass "Copying to ${serverfiles}" - chmod u+x "${serverfiles}/mta-server64" - else - fn_print_fail_eol_nl - fn_script_log_fatal "Copying to ${serverfiles}" - core_exit.sh - fi +fn_update_dl() { + # Download and extract files to tmpdir. + fn_fetch_file "http://linux.mtasa.com/dl/multitheftauto_linux_x64.tar.gz" "" "" "" "${tmpdir}" "multitheftauto_linux_x64.tar.gz" "nochmodx" "norun" "force" "nohash" + fn_dl_extract "${tmpdir}" "multitheftauto_linux_x64.tar.gz" "${serverfiles}" "multitheftauto_linux_x64" } -fn_update_mta_localbuild() { +fn_update_localbuild() { # Gets local build info. fn_print_dots "Checking local build: ${remotelocation}" - # Uses log file to gather info. - # Gives time for log file to generate. - requirerestart=1 - if [ ! -f "${serverfiles}/mods/deathmatch/logs/server.log" ]; then - fn_print_error "Checking local build: ${remotelocation}" - fn_print_error_nl "Checking local build: ${remotelocation}: no log files containing version info" - fn_print_info_nl "Checking local build: ${remotelocation}: forcing server restart" - fn_script_log_error "No log files containing version info" - fn_script_log_info "Forcing server restart" - exitbypass=1 - command_stop.sh - exitbypass=1 - command_start.sh - fn_firstcommand_reset - totalseconds=0 - # Check again, allow time to generate logs. - while [ ! -f "${serverfiles}/mods/deathmatch/logs/server.log" ]; do - sleep 1 - fn_print_info "Checking local build: ${remotelocation}: waiting for log file: ${totalseconds}" - if [ -v "${loopignore}" ]; then - loopignore=1 - fn_script_log_info "Waiting for log file to generate" - fi - - if [ "${totalseconds}" -gt "120" ]; then - localbuild="0" - fn_print_error "Checking local build: ${remotelocation}: waiting for log file: missing log file" - fn_script_log_error "Missing log file" - fn_script_log_error "Set localbuild to 0" - fi - - totalseconds=$((totalseconds + 1)) - done - fi - + # Uses log file to get local build. + localbuild=$(grep "= Multi Theft Auto: San Andreas v" "${serverfiles}/mods/deathmatch/logs/server.log" | awk '{ print $7 }' | sed -r 's/^.{1}//' | tail -1) if [ -z "${localbuild}" ]; then - localbuild=$(grep "= Multi Theft Auto: San Andreas v" "${serverfiles}/mods/deathmatch/logs/server.log" | awk '{ print $7 }' | sed -r 's/^.{1}//' | tail -1) - fi - - if [ -z "${localbuild}" ]; then - # Gives time for var to generate. - totalseconds=0 - for seconds in {1..120}; do - fn_print_info "Checking local build: ${remotelocation}: waiting for local build: ${totalseconds}" - if [ -z "${loopignore}" ]; then - loopignore=1 - fn_script_log_info "Waiting for local build to generate" - fi - localbuild=$(grep "= Multi Theft Auto: San Andreas v" "${serverfiles}/mods/deathmatch/logs/server.log" | awk '{ print $7 }' | sed -r 's/^.{1}//' | tail -1) - if [ "${localbuild}" ]; then - break - fi - sleep 1 - totalseconds=$((totalseconds + 1)) - done - fi - - if [ -z "${localbuild}" ]; then - localbuild="0" - fn_print_error "Checking local build: ${remotelocation}: waiting for local build: missing local build info" + fn_print_error "Checking local build: ${remotelocation}: missing local build info" fn_script_log_error "Missing local build info" fn_script_log_error "Set localbuild to 0" + localbuild="0" else fn_print_ok "Checking local build: ${remotelocation}" fn_script_log_pass "Checking local build" fi } -fn_update_mta_remotebuild() { - # Gets remote build info. - remotebuild=$(curl -s "https://api.github.com/repos/multitheftauto/mtasa-blue/releases/latest" | jq -r '.tag_name') +fn_update_remotebuild() { + # Get remote build info. + apiurl="https://api.github.com/repos/multitheftauto/mtasa-blue/releases/latest" + remotebuildresponse=$(curl -s "${apiurl}") + remotebuildfilename=$(echo "${remotebuildresponse}" | jq -r '.assets[]|select(.browser_download_url | contains("Linux-amd64")) | .name') + remotebuildurl=$(echo "${remotebuildresponse}" | jq -r '.assets[]|select(.browser_download_url | contains("Linux-amd64")) | .browser_download_url') + remotebuildversion=$(echo "${remotebuildresponse}" | jq -r '.tag_name') if [ "${firstcommandname}" != "INSTALL" ]; then fn_print_dots "Checking remote build: ${remotelocation}" - # Checks if remotebuild variable has been set. - if [ -z "${remotebuild}" ] || [ "${remotebuild}" == "null" ]; then + # Checks if remotebuildversion variable has been set. + if [ -z "${remotebuildversion}" ] || [ "${remotebuildversion}" == "null" ]; then fn_print_fail "Checking remote build: ${remotelocation}" fn_script_log_fatal "Checking remote build" core_exit.sh @@ -113,7 +49,7 @@ fn_update_mta_remotebuild() { fi else # Checks if remotebuild variable has been set. - if [ -z "${remotebuild}" ] || [ "${remotebuild}" == "null" ]; then + if [ -z "${remotebuildversion}" ] || [ "${remotebuildversion}" == "null" ]; then fn_print_failure "Unable to get remote build" fn_script_log_fatal "Unable to get remote build" core_exit.sh @@ -121,69 +57,96 @@ fn_update_mta_remotebuild() { fi } -fn_update_mta_compare() { - # Removes dots so if statement can compare version numbers. +fn_update_compare() { fn_print_dots "Checking for update: ${remotelocation}" - localbuilddigit=$(echo -e "${localbuild}" | tr -cd '[:digit:]') - remotebuilddigit=$(echo -e "${remotebuild}" | tr -cd '[:digit:]') - if [ "${localbuilddigit}" -ne "${remotebuilddigit}" ] || [ "${forceupdate}" == "1" ]; then - fn_print_ok_nl "Checking for update: ${remotelocation}" + if [ "${localbuild}" != "${remotebuildversion}" ] || [ "${forceupdate}" == "1" ]; then if [ "${forceupdate}" == "1" ]; then # forceupdate bypasses checks, useful for small build changes mtaupdatestatus="forced" else mtaupdatestatus="available" fi + fn_print_ok_nl "Checking for update: ${remotelocation}" echo -en "\n" - echo -e "Update ${mtaupdatestatus}:" + echo -e "Update available" echo -e "* Local build: ${red}${localbuild}${default}" - echo -e "* Remote build: ${green}${remotebuild}${default}" + echo -e "* Remote build: ${green}${remotebuildversion}${default}" + if [ -n "${branch}" ]; then + echo -e "* Branch: ${branch}" + fi + if [ -f "${rootdir}/.dev-debug" ]; then + echo -e "Remote build info" + echo -e "* apiurl: ${apiurl}" + echo -e "* remotebuildfilename: ${remotebuildfilename}" + echo -e "* remotebuildurl: ${remotebuildurl}" + echo -e "* remotebuildversion: ${remotebuildversion}" + fi echo -en "\n" fn_script_log_info "Update available" fn_script_log_info "Local build: ${localbuild}" - fn_script_log_info "Remote build: ${remotebuild}" - fn_script_log_info "${localbuild} > ${remotebuild}" + fn_script_log_info "Remote build: ${remotebuildversion}" + if [ -n "${branch}" ]; then + fn_script_log_info "Branch: ${branch}" + fi + fn_script_log_info "${localbuild} > ${remotebuildversion}" - unset updateonstart - check_status.sh - # If server stopped. - if [ "${status}" == "0" ]; then - exitbypass=1 - fn_update_mta_dl - if [ "${requirerestart}" == "1" ]; then + if [ "${commandname}" == "UPDATE" ]; then + unset updateonstart + check_status.sh + # If server stopped. + if [ "${status}" == "0" ]; then + fn_update_dl + if [ "${localbuild}" == "0" ]; then + exitbypass=1 + command_start.sh + fn_firstcommand_reset + exitbypass=1 + sleep 5 + command_stop.sh + fn_firstcommand_reset + fi + # If server started. + else + fn_print_restart_warning exitbypass=1 - command_start.sh + command_stop.sh fn_firstcommand_reset exitbypass=1 - command_stop.sh + fn_update_dl + exitbypass=1 + command_start.sh fn_firstcommand_reset fi - # If server started. - else - fn_print_restart_warning - exitbypass=1 - command_stop.sh - fn_firstcommand_reset - exitbypass=1 - fn_update_mta_dl - exitbypass=1 - command_start.sh - fn_firstcommand_reset + unset exitbypass + date +%s > "${lockdir}/lastupdate.lock" + alert="update" + elif [ "${commandname}" == "CHECK-UPDATE" ]; then + alert="check-update" fi - unset exitbypass - date +%s > "${lockdir}/lastupdate.lock" - alert="update" alert.sh else fn_print_ok_nl "Checking for update: ${remotelocation}" echo -en "\n" echo -e "No update available" echo -e "* Local build: ${green}${localbuild}${default}" - echo -e "* Remote build: ${green}${remotebuild}${default}" + echo -e "* Remote build: ${green}${remotebuildversion}${default}" + if [ -n "${branch}" ]; then + echo -e "* Branch: ${branch}" + fi echo -en "\n" fn_script_log_info "No update available" fn_script_log_info "Local build: ${localbuild}" - fn_script_log_info "Remote build: ${remotebuild}" + fn_script_log_info "Remote build: ${remotebuildversion}" + if [ -n "${branch}" ]; then + fn_script_log_info "Branch: ${branch}" + fi + if [ -f "${rootdir}/.dev-debug" ]; then + echo -e "Remote build info" + echo -e "* apiurl: ${apiurl}" + echo -e "* remotebuildfilename: ${remotebuildfilename}" + echo -e "* remotebuildurl: ${remotebuildurl}" + echo -e "* remotebuildversion: ${remotebuildversion}" + fi fi } @@ -191,13 +154,13 @@ fn_update_mta_compare() { remotelocation="linux.mtasa.com" if [ "${firstcommandname}" == "INSTALL" ]; then - fn_update_mta_remotebuild - fn_update_mta_dl + fn_update_remotebuild + fn_update_dl else fn_print_dots "Checking for update" fn_print_dots "Checking for update: ${remotelocation}" fn_script_log_info "Checking for update: ${remotelocation}" - fn_update_mta_localbuild - fn_update_mta_remotebuild - fn_update_mta_compare + fn_update_localbuild + fn_update_remotebuild + fn_update_compare fi diff --git a/lgsm/functions/update_papermc.sh b/lgsm/functions/update_papermc.sh index 302e0baac..f48a66e39 100644 --- a/lgsm/functions/update_papermc.sh +++ b/lgsm/functions/update_papermc.sh @@ -5,115 +5,167 @@ # Website: https://linuxgsm.com # Description: Handles updating of PaperMC and Waterfall servers. -commandname="UPDATE" -commandaction="Update" -function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" -fn_update_papermc_dl() { - # get build info - builddata=$(curl -s "https://${remotelocation}/api/v2/projects/${paperproject}/versions/${paperversion}/builds/${remotebuild}" | jq '.downloads') - buildname=$(echo -e "${builddata}" | jq -r '.application.name') - buildsha256=$(echo -e "${builddata}" | jq -r '.application.sha256') - - fn_fetch_file "https://${remotelocation}/api/v2/projects/${paperproject}/versions/${paperversion}/builds/${remotebuild}/downloads/${buildname}" "" "" "" "${tmpdir}" "${buildname}" "nochmodx" "norun" "force" "${buildsha256}" - - echo -e "copying to ${serverfiles}...\c" - cp -f "${tmpdir}/${buildname}" "${serverfiles}/${executable#./}" - local exitcode=$? - if [ "${exitcode}" == "0" ]; then - fn_print_ok_eol_nl - fn_script_log_pass "Copying to ${serverfiles}" - chmod u+x "${serverfiles}/${executable#./}" - echo "${remotebuild}" > "${localversionfile}" - fn_clear_tmp - else - fn_print_fail_eol_nl - fn_script_log_fatal "Copying to ${serverfiles}" - core_exit.sh - fi +fn_update_dl() { + # Download and extract files to serverfiles + fn_fetch_file "${remotebuildurl}" "" "" "" "${serverfiles}" "${executable#./}" "chmodx" "norun" "force" "${remotebuildhash}" + echo "${remotebuildversion}" > "${serverfiles}/build.txt" } -fn_update_papermc_localbuild() { +fn_update_localbuild() { # Gets local build info. - fn_print_dots "Checking for update: ${remotelocation}: checking local build" - sleep 0.5 - - if [ ! -f "${localversionfile}" ]; then - fn_print_error_nl "Checking for update: ${remotelocation}: checking local build: no local build files" - fn_script_log_error "No local build file found" - else - localbuild=$(head -n 1 "${localversionfile}") - fi - + fn_print_dots "Checking local build: ${remotelocation}" + # Uses version file to get local build. + localbuild=$(head -n 1 "${serverfiles}/build.txt") if [ -z "${localbuild}" ]; then + fn_print_error "Checking local build: ${remotelocation}: missing local build info" + fn_script_log_error "Missing local build info" + fn_script_log_error "Set localbuild to 0" localbuild="0" - fn_print_error "Checking for update: ${remotelocation}: waiting for local build: missing local build info" - fn_script_log_error "Missing local build info, Set localbuild to 0" else - fn_print_ok "Checking for update: ${remotelocation}: checking local build" + fn_print_ok "Checking local build: ${remotelocation}" fn_script_log_pass "Checking local build" fi - sleep 0.5 } -fn_update_papermc_remotebuild() { - # Gets remote build info. - remotebuild=$(curl -s "https://${remotelocation}/api/v2/projects/${paperproject}/versions/${paperversion}" | jq -r '.builds[-1]') - - # Checks if remotebuild variable has been set. - if [ -z "${remotebuild}" ] || [ "${remotebuild}" == "null" ]; then - fn_print_failure "Unable to get remote build" - fn_script_log_fatal "Unable to get remote build" - core_exit.sh +fn_update_remotebuild() { + # Get remote build info. + apiurl="https://papermc.io/api/v2/projects/" + # Get list of projects. + remotebuildresponse=$(curl -s "${apiurl}") + # Get list of Minecraft versions for project. + remotebuildresponseproject=$(curl -s "${apiurl}/${paperproject}") + # Get latest Minecraft: Java Edition version or user specified version. + if [ "${mcversion}" == "latest" ]; then + remotebuildmcversion=$(echo "${remotebuildresponseproject}" | jq -r '.versions[-1]') else - fn_print_ok "Got build for version ${paperversion}" - fn_script_log "Got build for version ${paperversion}" + # Checks if user specified version exists. + remotebuildmcversion=$(echo "${remotebuildresponseproject}" | jq -r -e --arg mcversion "${mcversion}" '.versions[]|select(. == $mcversion)') + if [ -z "${remotebuildmcversion}" ]; then + # user passed version does not exist + fn_print_error_nl "Version ${mcversion} not available from ${remotelocation}" + fn_script_log_error "Version ${mcversion} not available from ${remotelocation}" + core_exit.sh + fi + fi + # Get list of paper builds for specific Minecraft: Java Edition version. + remotebuildresponsemcversion=$(curl -s "${apiurl}/paper/versions/${remotebuildmcversion}") + # Get latest paper build for specific Minecraft: Java Edition version. + remotebuildpaperversion=$(echo "${remotebuildresponsemcversion}" | jq -r '.builds[-1]') + # Get various info about the paper build. + remotebuildresponseversion=$(curl -s "${apiurl}/${paperproject}/versions/${remotebuildmcversion}/builds/${remotebuildpaperversion}") + remotebuildfilename=$(echo "${remotebuildresponseversion}" | jq -r '.downloads.application.name') + remotebuildhash=$(echo "${remotebuildresponseversion}" | jq -r '.downloads.application.sha256') + remotebuildurl="${apiurl}/${paperproject}/versions/${remotebuildmcversion}/builds/${remotebuildpaperversion}/downloads/${remotebuildfilename}" + # Combines Minecraft: Java Edition version and paper build. e.g 1.16.5-456 + remotebuildversion="${remotebuildmcversion}-${remotebuildpaperversion}" + + if [ "${firstcommandname}" != "INSTALL" ]; then + fn_print_dots "Checking remote build: ${remotelocation}" + # Checks if remotebuildversion variable has been set. + if [ -z "${remotebuildversion}" ] || [ "${remotebuildversion}" == "null" ]; then + fn_print_fail "Checking remote build: ${remotelocation}" + fn_script_log_fatal "Checking remote build" + core_exit.sh + else + fn_print_ok "Checking remote build: ${remotelocation}" + fn_script_log_pass "Checking remote build" + fi + else + # Checks if remotebuild variable has been set. + if [ -z "${remotebuildversion}" ] || [ "${remotebuildversion}" == "null" ]; then + fn_print_failure "Unable to get remote build" + fn_script_log_fatal "Unable to get remote build" + core_exit.sh + fi fi } -fn_update_papermc_compare() { +fn_update_compare() { fn_print_dots "Checking for update: ${remotelocation}" - sleep 0.5 - if [ "${localbuild}" != "${remotebuild}" ] || [ "${forceupdate}" == "1" ]; then + if [ "${localbuild}" != "${remotebuildversion}" ] || [ "${forceupdate}" == "1" ]; then fn_print_ok_nl "Checking for update: ${remotelocation}" echo -en "\n" - echo -e "Update available for version ${paperversion}" + echo -e "Update available" echo -e "* Local build: ${red}${localbuild}${default}" - echo -e "* Remote build: ${green}${remotebuild}${default}" - fn_script_log_info "Update available for version ${paperversion}" - fn_script_log_info "Local build: ${localbuild}" - fn_script_log_info "Remote build: ${remotebuild}" - fn_script_log_info "${localbuild} > ${remotebuild}" - echo -en "\n" - echo -en "applying update.\r" + echo -e "* Remote build: ${green}${remotebuildversion}${default}" + if [ -n "${branch}" ]; then + echo -e "* Branch: ${branch}" + fi + if [ -f "${rootdir}/.dev-debug" ]; then + echo -e "Remote build info" + echo -e "* apiurl: ${apiurl}" + echo -e "* remotebuildfilename: ${remotebuildfilename}" + echo -e "* remotebuildurl: ${remotebuildurl}" + echo -e "* remotebuildversion: ${remotebuildversion}" + fi echo -en "\n" - - unset updateonstart - - check_status.sh - # If server stopped. - if [ "${status}" == "0" ]; then - fn_update_papermc_dl - # If server started. - else - exitbypass=1 - command_stop.sh - exitbypass=1 - fn_update_papermc_dl - exitbypass=1 - command_start.sh + fn_script_log_info "Update available" + fn_script_log_info "Local build: ${localbuild}" + fn_script_log_info "Remote build: ${remotebuildversion}" + if [ -n "${branch}" ]; then + fn_script_log_info "Branch: ${branch}" + fi + fn_script_log_info "${localbuild} > ${remotebuildversion}" + + if [ "${commandname}" == "UPDATE" ]; then + unset updateonstart + check_status.sh + # If server stopped. + if [ "${status}" == "0" ]; then + fn_update_dl + if [ "${localbuild}" == "0" ]; then + exitbypass=1 + command_start.sh + fn_firstcommand_reset + exitbypass=1 + sleep 5 + command_stop.sh + fn_firstcommand_reset + fi + # If server started. + else + fn_print_restart_warning + exitbypass=1 + command_stop.sh + fn_firstcommand_reset + exitbypass=1 + fn_update_dl + exitbypass=1 + command_start.sh + fn_firstcommand_reset + fi + unset exitbypass + date +%s > "${lockdir}/lastupdate.lock" + alert="update" + elif [ "${commandname}" == "CHECK-UPDATE" ]; then + alert="check-update" fi - alert="update" alert.sh else fn_print_ok_nl "Checking for update: ${remotelocation}" echo -en "\n" - echo -e "No update available for version ${paperversion}" + echo -e "No update available" echo -e "* Local build: ${green}${localbuild}${default}" - echo -e "* Remote build: ${green}${remotebuild}${default}" + echo -e "* Remote build: ${green}${remotebuildversion}${default}" + if [ -n "${branch}" ]; then + echo -e "* Branch: ${branch}" + fi + echo -en "\n" fn_script_log_info "No update available" fn_script_log_info "Local build: ${localbuild}" - fn_script_log_info "Remote build: ${remotebuild}" + fn_script_log_info "Remote build: ${remotebuildversion}" + if [ -n "${branch}" ]; then + fn_script_log_info "Branch: ${branch}" + fi + if [ -f "${rootdir}/.dev-debug" ]; then + echo -e "Remote build info" + echo -e "* apiurl: ${apiurl}" + echo -e "* remotebuildfilename: ${remotebuildfilename}" + echo -e "* remotebuildurl: ${remotebuildurl}" + echo -e "* remotebuildversion: ${remotebuildversion}" + fi fi } @@ -128,35 +180,14 @@ elif [ "${shortname}" == "wmc" ]; then paperproject="waterfall" fi -localversionfile="${datadir}/${paperproject}-version" - -# check if datadir was created, if not create it -if [ ! -d "${datadir}" ]; then - mkdir -p "${datadir}" -fi - -# check version if the user did set one and check it -if [ "${mcversion}" == "latest" ]; then - paperversion=$(curl -s "https://${remotelocation}/api/v2/projects/${paperproject}" | jq -r '.versions[-1]') -else - # check if version there for the download from the api - paperversion=$(curl -s "https://${remotelocation}/api/v2/projects/${paperproject}" | jq -r -e --arg mcversion "${mcversion}" '.versions[]|select(. == $mcversion)') - if [ -z "${paperversion}" ]; then - # user passed version does not exist - fn_print_error_nl "Version ${mcversion} not available from ${remotelocation}" - fn_script_log_error "Version ${mcversion} not available from ${remotelocation}" - core_exit.sh - fi -fi - if [ "${firstcommandname}" == "INSTALL" ]; then - fn_update_papermc_remotebuild - fn_update_papermc_dl + fn_update_remotebuild + fn_update_dl else + fn_print_dots "Checking for update" fn_print_dots "Checking for update: ${remotelocation}" fn_script_log_info "Checking for update: ${remotelocation}" - sleep 0.5 - fn_update_papermc_localbuild - fn_update_papermc_remotebuild - fn_update_papermc_compare + fn_update_localbuild + fn_update_remotebuild + fn_update_compare fi diff --git a/lgsm/functions/update_ts3.sh b/lgsm/functions/update_ts3.sh index be5c9e06f..e76609b2d 100644 --- a/lgsm/functions/update_ts3.sh +++ b/lgsm/functions/update_ts3.sh @@ -7,116 +7,48 @@ functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" -fn_update_ts3_dl() { - ts3latestdata=$(curl -s "https://www.${remotelocation}/versions/server.json" | jq '.linux') - if [ "${ts3arch}" == "amd64" ]; then - remotebuildurl=$(echo -e "${ts3latestdata}" | jq -r '.x86_64.mirrors."teamspeak.com"') - remotehash=$(echo -e "${ts3latestdata}" | jq -r '.x86_64.checksum') - elif [ "${ts3arch}" == "x86" ]; then - remotebuildurl=$(echo -e "${ts3latestdata}" | jq -r '.x86.mirrors."teamspeak.com"') - remotehash=$(echo -e "${ts3latestdata}" | jq -r '.x86.checksum') - fi - remotefile=$(basename "${remotebuildurl}") - fn_fetch_file "${remotebuildurl}" "" "" "" "${tmpdir}" "${remotefile}" "" "norun" "noforce" "${remotehash}" - fn_dl_extract "${tmpdir}" "${remotefile}" "${tmpdir}" - echo -e "copying to ${serverfiles}...\c" - cp -R "${tmpdir}/teamspeak3-server_linux_${ts3arch}/"* "${serverfiles}" - local exitcode=$? - if [ "${exitcode}" == "0" ]; then - fn_print_ok_eol_nl - fn_script_log_pass "Copying to ${serverfiles}" - fn_clear_tmp - else - fn_print_fail_eol_nl - fn_script_log_fatal "Copying to ${serverfiles}" - fn_clear_tmp - core_exit.sh - fi +fn_update_dl() { + # Download and extract files to serverfiles + fn_fetch_file "${remotebuildurl}" "" "" "" "${tmpdir}" "${remotebuildfilename}" "nochmodx" "norun" "force" "${remotebuildhash}" + fn_dl_extract "${tmpdir}" "${remotebuildfilename}" "${serverfiles}" "teamspeak3-server_linux_${ts3arch}" + fn_clear_tmp } -fn_update_ts3_localbuild() { +fn_update_localbuild() { # Gets local build info. fn_print_dots "Checking local build: ${remotelocation}" - # Uses log file to gather info. - # Gives time for log file to generate. - requirerestart=1 - if [ ! -d "${serverfiles}/logs" ] || [ -z "$(find "${serverfiles}/logs/"* -name 'ts3server*_0.log' 2> /dev/null)" ]; then - fn_print_error "Checking local build: ${remotelocation}" - fn_print_error_nl "Checking local build: ${remotelocation}: no log files containing version info" - fn_print_info_nl "Checking local build: ${remotelocation}: forcing server restart" - fn_script_log_error "No log files containing version info" - fn_script_log_info "Forcing server restart" - exitbypass=1 - command_stop.sh - exitbypass=1 - command_start.sh - fn_firstcommand_reset - totalseconds=0 - # Check again, allow time to generate logs. - while [ ! -d "${serverfiles}/logs" ] || [ -z "$(find "${serverfiles}/logs/"* -name 'ts3server*_0.log' 2> /dev/null)" ]; do - sleep 1 - fn_print_info "Checking local build: ${remotelocation}: waiting for log file: ${totalseconds}" - if [ -v "${loopignore}" ]; then - loopignore=1 - fn_script_log_info "Waiting for log file to generate" - fi - - if [ "${totalseconds}" -gt "120" ]; then - localbuild="0" - fn_print_error "Checking local build: ${remotelocation}: waiting for log file: missing log file" - fn_script_log_error "Missing log file" - fn_script_log_error "Set localbuild to 0" - fi - - totalseconds=$((totalseconds + 1)) - done - fi - - if [ -z "${localbuild}" ]; then - localbuild=$(cat "$(find ./* -name "ts3server*_0.log" 2> /dev/null | sort | tail -1)" | grep -Eo "TeamSpeak 3 Server ((\.)?[0-9]{1,3}){1,3}\.[0-9]{1,3}" | grep -Eo "((\.)?[0-9]{1,3}){1,3}\.[0-9]{1,3}" | tail -1) - fi - - if [ -z "${localbuild}" ]; then - # Gives time for var to generate. - totalseconds=0 - for seconds in {1..120}; do - fn_print_info "Checking local build: ${remotelocation}: waiting for local build: ${totalseconds}" - if [ -z "${loopignore}" ]; then - loopignore=1 - fn_script_log_info "Waiting for local build to generate" - fi - localbuild=$(cat "$(find ./* -name "ts3server*_0.log" 2> /dev/null | sort | tail -1)" | grep -Eo "TeamSpeak 3 Server ((\.)?[0-9]{1,3}){1,3}\.[0-9]{1,3}" | grep -Eo "((\.)?[0-9]{1,3}){1,3}\.[0-9]{1,3}" | tail -1) - if [ "${localbuild}" ] || [ "${seconds}" == "120" ]; then - break - fi - sleep 1 - totalseconds=$((totalseconds + 1)) - done - fi - + # Uses log file to get local build. + localbuild=$(grep -Eo "TeamSpeak 3 Server ((\.)?[0-9]{1,3}){1,3}\.[0-9]{1,3}" "$(find ./* -name "ts3server*_0.log" 2> /dev/null | sort | tail -1)" | grep -Eo "((\.)?[0-9]{1,3}){1,3}\.[0-9]{1,3}" | tail -1) if [ -z "${localbuild}" ]; then - localbuild="0" - fn_print_error "Checking local build: ${remotelocation}: waiting for local build: missing local build info" + fn_print_error "Checking local build: ${remotelocation}: missing local build info" fn_script_log_error "Missing local build info" fn_script_log_error "Set localbuild to 0" + localbuild="0" else fn_print_ok "Checking local build: ${remotelocation}" fn_script_log_pass "Checking local build" fi } -fn_update_ts3_remotebuild() { - # Gets remote build info. - ts3latestdata=$(curl -s "https://www.${remotelocation}/versions/server.json" | jq '.linux') +fn_update_remotebuild() { + # Get remote build info. + apiurl="https://www.teamspeak.com/versions/server.json" + remotebuildresponse=$(curl -s "${apiurl}") + if [ "${ts3arch}" == "amd64" ]; then - remotebuild=$(echo -e "${ts3latestdata}" | jq -r '.x86_64.version') + remotebuildurl=$(echo -e "${remotebuildresponse}" | jq -r '.linux.x86_64.mirrors."teamspeak.com"') + remotebuildhash=$(echo -e "${remotebuildresponse}" | jq -r '.linux.x86_64.checksum') elif [ "${ts3arch}" == "x86" ]; then - remotebuild=$(echo -e "${ts3latestdata}" | jq -r '.x86.version') + remotebuildurl=$(echo -e "${remotebuildresponse}" | jq -r '.linux.x86.mirrors."teamspeak.com"') + remotebuildhash=$(echo -e "${remotebuildresponse}" | jq -r '.linux.x86.checksum') fi + remotebuildfilename=$(basename "${remotebuildurl}") + remotebuildversion=$(echo -e "${remotebuildresponse}" | jq -r '.linux.x86_64.version') + if [ "${firstcommandname}" != "INSTALL" ]; then fn_print_dots "Checking remote build: ${remotelocation}" - # Checks if remotebuild variable has been set. - if [ -z "${remotebuild}" ] || [ "${remotebuild}" == "null" ]; then + # Checks if remotebuildversion variable has been set. + if [ -z "${remotebuildversion}" ] || [ "${remotebuildversion}" == "null" ]; then fn_print_fail "Checking remote build: ${remotelocation}" fn_script_log_fatal "Checking remote build" core_exit.sh @@ -126,7 +58,7 @@ fn_update_ts3_remotebuild() { fi else # Checks if remotebuild variable has been set. - if [ -z "${remotebuild}" ] || [ "${remotebuild}" == "null" ]; then + if [ -z "${remotebuildversion}" ] || [ "${remotebuildversion}" == "null" ]; then fn_print_failure "Unable to get remote build" fn_script_log_fatal "Unable to get remote build" core_exit.sh @@ -134,34 +66,45 @@ fn_update_ts3_remotebuild() { fi } -fn_update_ts3_compare() { - # Removes dots so if statement can compare version numbers. +fn_update_compare() { fn_print_dots "Checking for update: ${remotelocation}" - localbuilddigit=$(echo -e "${localbuild}" | tr -cd '[:digit:]') - remotebuilddigit=$(echo -e "${remotebuild}" | tr -cd '[:digit:]') - if [ "${localbuilddigit}" -ne "${remotebuilddigit}" ] || [ "${forceupdate}" == "1" ]; then + if [ "${localbuild}" != "${remotebuildversion}" ] || [ "${forceupdate}" == "1" ]; then fn_print_ok_nl "Checking for update: ${remotelocation}" echo -en "\n" echo -e "Update available" echo -e "* Local build: ${red}${localbuild}${default}" - echo -e "* Remote build: ${green}${remotebuild}${default}" + echo -e "* Remote build: ${green}${remotebuildversion}${default}" + if [ -n "${branch}" ]; then + echo -e "* Branch: ${branch}" + fi + if [ -f "${rootdir}/.dev-debug" ]; then + echo -e "Remote build info" + echo -e "* apiurl: ${apiurl}" + echo -e "* remotebuildfilename: ${remotebuildfilename}" + echo -e "* remotebuildurl: ${remotebuildurl}" + echo -e "* remotebuildversion: ${remotebuildversion}" + fi + echo -en "\n" fn_script_log_info "Update available" fn_script_log_info "Local build: ${localbuild}" - fn_script_log_info "Remote build: ${remotebuild}" - fn_script_log_info "${localbuild} > ${remotebuild}" + fn_script_log_info "Remote build: ${remotebuildversion}" + if [ -n "${branch}" ]; then + fn_script_log_info "Branch: ${branch}" + fi + fn_script_log_info "${localbuild} > ${remotebuildversion}" if [ "${commandname}" == "UPDATE" ]; then unset updateonstart check_status.sh # If server stopped. if [ "${status}" == "0" ]; then - exitbypass=1 - fn_update_ts3_dl - if [ "${requirerestart}" == "1" ]; then + fn_update_dl + if [ "${localbuild}" == "0" ]; then exitbypass=1 command_start.sh fn_firstcommand_reset exitbypass=1 + sleep 5 command_stop.sh fn_firstcommand_reset fi @@ -172,7 +115,7 @@ fn_update_ts3_compare() { command_stop.sh fn_firstcommand_reset exitbypass=1 - fn_update_ts3_dl + fn_update_dl exitbypass=1 command_start.sh fn_firstcommand_reset @@ -189,11 +132,24 @@ fn_update_ts3_compare() { echo -en "\n" echo -e "No update available" echo -e "* Local build: ${green}${localbuild}${default}" - echo -e "* Remote build: ${green}${remotebuild}${default}" + echo -e "* Remote build: ${green}${remotebuildversion}${default}" + if [ -n "${branch}" ]; then + echo -e "* Branch: ${branch}" + fi echo -en "\n" fn_script_log_info "No update available" fn_script_log_info "Local build: ${localbuild}" - fn_script_log_info "Remote build: ${remotebuild}" + fn_script_log_info "Remote build: ${remotebuildversion}" + if [ -n "${branch}" ]; then + fn_script_log_info "Branch: ${branch}" + fi + if [ -f "${rootdir}/.dev-debug" ]; then + echo -e "Remote build info" + echo -e "* apiurl: ${apiurl}" + echo -e "* remotebuildfilename: ${remotebuildfilename}" + echo -e "* remotebuildurl: ${remotebuildurl}" + echo -e "* remotebuildversion: ${remotebuildversion}" + fi fi } @@ -213,13 +169,13 @@ fi remotelocation="teamspeak.com" if [ "${firstcommandname}" == "INSTALL" ]; then - fn_update_ts3_remotebuild - fn_update_ts3_dl + fn_update_remotebuild + fn_update_dl else fn_print_dots "Checking for update" fn_print_dots "Checking for update: ${remotelocation}" fn_script_log_info "Checking for update: ${remotelocation}" - fn_update_ts3_localbuild - fn_update_ts3_remotebuild - fn_update_ts3_compare + fn_update_localbuild + fn_update_remotebuild + fn_update_compare fi diff --git a/lgsm/functions/update_ut99.sh b/lgsm/functions/update_ut99.sh new file mode 100644 index 000000000..b6db783e2 --- /dev/null +++ b/lgsm/functions/update_ut99.sh @@ -0,0 +1,163 @@ +#!/bin/bash +# LinuxGSM command_ut99.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Handles updating of Unreal Tournament 99 servers. + +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +fn_update_dl() { + # Download and extract files to serverfiles + fn_fetch_file "${remotebuildurl}" "" "" "" "${tmpdir}" "${remotebuildfilename}" "nochmodx" "norun" "force" "nohash" + fn_dl_extract "${tmpdir}" "${remotebuildfilename}" "${serverfiles}" + echo "${remotebuildversion}" > "${serverfiles}/build.txt" + fn_clear_tmp +} + +fn_update_localbuild() { + # Gets local build info. + fn_print_dots "Checking local build: ${remotelocation}" + # Uses build file to get local build. + localbuild=$(head -n 1 "${serverfiles}/build.txt") + if [ -z "${localbuild}" ]; then + fn_print_error "Checking local build: ${remotelocation}: missing local build info" + fn_script_log_error "Missing local build info" + fn_script_log_error "Set localbuild to 0" + localbuild="0" + else + fn_print_ok "Checking local build: ${remotelocation}" + fn_script_log_pass "Checking local build" + fi +} + +fn_update_remotebuild() { + # Get remote build info. + apiurl="https://api.github.com/repos/OldUnreal/UnrealTournamentPatches/releases/latest" + remotebuildresponse=$(curl -s "${apiurl}") + remotebuildfilename=$(echo "${remotebuildresponse}" | jq -r '.assets[]|select(.browser_download_url | contains("Linux-amd64")) | .name') + remotebuildurl=$(echo "${remotebuildresponse}" | jq -r '.assets[]|select(.browser_download_url | contains("Linux-amd64")) | .browser_download_url') + remotebuildversion=$(echo "${remotebuildresponse}" | jq -r '.tag_name') + + if [ "${firstcommandname}" != "INSTALL" ]; then + fn_print_dots "Checking remote build: ${remotelocation}" + # Checks if remotebuildversion variable has been set. + if [ -z "${remotebuildversion}" ] || [ "${remotebuildversion}" == "null" ]; then + fn_print_fail "Checking remote build: ${remotelocation}" + fn_script_log_fatal "Checking remote build" + core_exit.sh + else + fn_print_ok "Checking remote build: ${remotelocation}" + fn_script_log_pass "Checking remote build" + fi + else + # Checks if remotebuild variable has been set. + if [ -z "${remotebuildversion}" ] || [ "${remotebuildversion}" == "null" ]; then + fn_print_failure "Unable to get remote build" + fn_script_log_fatal "Unable to get remote build" + core_exit.sh + fi + fi +} + +fn_update_compare() { + fn_print_dots "Checking for update: ${remotelocation}" + if [ "${localbuild}" != "${remotebuildversion}" ] || [ "${forceupdate}" == "1" ]; then + fn_print_ok_nl "Checking for update: ${remotelocation}" + echo -en "\n" + echo -e "Update available" + echo -e "* Local build: ${red}${localbuild}${default}" + echo -e "* Remote build: ${green}${remotebuildversion}${default}" + if [ -n "${branch}" ]; then + echo -e "* Branch: ${branch}" + fi + if [ -f "${rootdir}/.dev-debug" ]; then + echo -e "Remote build info" + echo -e "* apiurl: ${apiurl}" + echo -e "* remotebuildfilename: ${remotebuildfilename}" + echo -e "* remotebuildurl: ${remotebuildurl}" + echo -e "* remotebuildversion: ${remotebuildversion}" + fi + echo -en "\n" + fn_script_log_info "Update available" + fn_script_log_info "Local build: ${localbuild}" + fn_script_log_info "Remote build: ${remotebuildversion}" + if [ -n "${branch}" ]; then + fn_script_log_info "Branch: ${branch}" + fi + fn_script_log_info "${localbuild} > ${remotebuildversion}" + + if [ "${commandname}" == "UPDATE" ]; then + unset updateonstart + check_status.sh + # If server stopped. + if [ "${status}" == "0" ]; then + fn_update_dl + if [ "${localbuild}" == "0" ]; then + exitbypass=1 + command_start.sh + fn_firstcommand_reset + exitbypass=1 + sleep 5 + command_stop.sh + fn_firstcommand_reset + fi + # If server started. + else + fn_print_restart_warning + exitbypass=1 + command_stop.sh + fn_firstcommand_reset + exitbypass=1 + fn_update_dl + exitbypass=1 + command_start.sh + fn_firstcommand_reset + fi + unset exitbypass + date +%s > "${lockdir}/lastupdate.lock" + alert="update" + elif [ "${commandname}" == "CHECK-UPDATE" ]; then + alert="check-update" + fi + alert.sh + else + fn_print_ok_nl "Checking for update: ${remotelocation}" + echo -en "\n" + echo -e "No update available" + echo -e "* Local build: ${green}${localbuild}${default}" + echo -e "* Remote build: ${green}${remotebuildversion}${default}" + if [ -n "${branch}" ]; then + echo -e "* Branch: ${branch}" + fi + echo -en "\n" + fn_script_log_info "No update available" + fn_script_log_info "Local build: ${localbuild}" + fn_script_log_info "Remote build: ${remotebuildversion}" + if [ -n "${branch}" ]; then + fn_script_log_info "Branch: ${branch}" + fi + if [ -f "${rootdir}/.dev-debug" ]; then + echo -e "Remote build info" + echo -e "* apiurl: ${apiurl}" + echo -e "* remotebuildfilename: ${remotebuildfilename}" + echo -e "* remotebuildurl: ${remotebuildurl}" + echo -e "* remotebuildversion: ${remotebuildversion}" + fi + fi +} + +# The location where the builds are checked and downloaded. +remotelocation="github.com" + +if [ "${firstcommandname}" == "INSTALL" ]; then + fn_update_remotebuild + fn_update_dl +else + fn_print_dots "Checking for update" + fn_print_dots "Checking for update: ${remotelocation}" + fn_script_log_info "Checking for update: ${remotelocation}" + fn_update_localbuild + fn_update_remotebuild + fn_update_compare +fi diff --git a/lgsm/functions/update_vintagestory.sh b/lgsm/functions/update_vintagestory.sh index 905384922..84e3192c9 100755 --- a/lgsm/functions/update_vintagestory.sh +++ b/lgsm/functions/update_vintagestory.sh @@ -7,46 +7,49 @@ functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" -fn_update_vs_dl() { - # get version info for download - remotebuildresponse=$(curl -s "${apiurl}" | jq --arg version "${remotebuild}" '.[$version].server') - remotebuildfile=$(echo -e "${remotebuildresponse}" | jq -r '.filename') - remotebuildlink=$(echo -e "${remotebuildresponse}" | jq -r '.urls.cdn') - remotebuildmd5=$(echo -e "${remotebuildresponse}" | jq -r '.md5') - +fn_update_dl() { # Download and extract files to serverfiles - fn_fetch_file "${remotebuildlink}" "" "" "" "${tmpdir}" "${remotebuildfile}" "nochmodx" "norun" "force" "${remotebuildmd5}" - fn_dl_extract "${tmpdir}" "${remotebuildfile}" "${serverfiles}" + fn_fetch_file "${remotebuildurl}" "" "" "" "${tmpdir}" "${remotebuildfilename}" "nochmodx" "norun" "force" "${remotebuildhash}" + fn_dl_extract "${tmpdir}" "${remotebuildfilename}" "${serverfiles}" fn_clear_tmp } -fn_update_vs_localbuild() { +fn_update_localbuild() { # Gets local build info. fn_print_dots "Checking local build: ${remotelocation}" - # Uses executable to find local build. - cd "${executabledir}" || exit - if [ -f "${executable}" ]; then + # Uses executable to get local build. + if [ -d "${exutabledir}" ]; then + cd "${executabledir}" || exit localbuild="$(${preexecutable} ${executable} --version | sed '/^[[:space:]]*$/d')" + fi + if [ -z "${localbuild}" ]; then + fn_print_error "Checking local build: ${remotelocation}: missing local build info" + fn_script_log_error "Missing local build info" + fn_script_log_error "Set localbuild to 0" + localbuild="0" + else fn_print_ok "Checking local build: ${remotelocation}" fn_script_log_pass "Checking local build" - else - localbuild="0" - fn_print_error "Checking local build: ${remotelocation}" - fn_script_log_error "Checking local build" fi } -fn_update_vs_remotebuild() { +fn_update_remotebuild() { + # Get remote build info. + apiurl="http://api.vintagestory.at/stable-unstable.json" + remotebuildresponse=$(curl -s "${apiurl}") if [ "${branch}" == "stable" ]; then - remotebuild=$(curl -s "${apiurl}" | jq -r '[ to_entries[] ] | .[].key' | grep -Ev "\-rc|\-pre" | sort -r -V | head -1) + remotebuildversion=$(echo "${remotebuildresponse}" | jq -r '[ to_entries[] ] | .[].key' | grep -Ev "\-rc|\-pre" | sort -r -V | head -1) else - remotebuild=$(curl -s "${apiurl}" | 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 + remotebuildfilename=$(echo "${remotebuildresponse}" | jq --arg remotebuildversion "${remotebuildversion}" -r '.[$remotebuildversion].server.filename') + remotebuildurl=$(echo "${remotebuildresponse}" | jq --arg remotebuildversion "${remotebuildversion}" -r '.[$remotebuildversion].server.urls.cdn') + remotebuildhash=$(echo "${remotebuildresponse}" | jq --arg remotebuildversion "${remotebuildversion}" -r '.[$remotebuildversion].server.md5') if [ "${firstcommandname}" != "INSTALL" ]; then fn_print_dots "Checking remote build: ${remotelocation}" - # Checks if remotebuild variable has been set. - if [ -z "${remotebuild}" ] || [ "${remotebuild}" == "null" ]; then + # Checks if remotebuildversion variable has been set. + if [ -z "${remotebuildversion}" ] || [ "${remotebuildversion}" == "null" ]; then fn_print_fail "Checking remote build: ${remotelocation}" fn_script_log_fatal "Checking remote build" core_exit.sh @@ -56,7 +59,7 @@ fn_update_vs_remotebuild() { fi else # Checks if remotebuild variable has been set. - if [ -z "${remotebuild}" ] || [ "${remotebuild}" == "null" ]; then + if [ -z "${remotebuildversion}" ] || [ "${remotebuildversion}" == "null" ]; then fn_print_failure "Unable to get remote build" fn_script_log_fatal "Unable to get remote build" core_exit.sh @@ -64,85 +67,104 @@ fn_update_vs_remotebuild() { fi } -fn_update_vs_compare() { - # Removes dots so if statement can compare version numbers. +fn_update_compare() { fn_print_dots "Checking for update: ${remotelocation}" - if [ "${localbuild}" != "${remotebuild}" ] || [ "${forceupdate}" == "1" ]; then + if [ "${localbuild}" != "${remotebuildversion}" ] || [ "${forceupdate}" == "1" ]; then fn_print_ok_nl "Checking for update: ${remotelocation}" echo -en "\n" echo -e "Update available" echo -e "* Local build: ${red}${localbuild}${default}" - echo -e "* Remote build: ${green}${remotebuild}${default}" + echo -e "* Remote build: ${green}${remotebuildversion}${default}" if [ -n "${branch}" ]; then echo -e "* Branch: ${branch}" fi + if [ -f "${rootdir}/.dev-debug" ]; then + echo -e "Remote build info" + echo -e "* apiurl: ${apiurl}" + echo -e "* remotebuildfilename: ${remotebuildfilename}" + echo -e "* remotebuildurl: ${remotebuildurl}" + echo -e "* remotebuildversion: ${remotebuildversion}" + fi echo -en "\n" fn_script_log_info "Update available" fn_script_log_info "Local build: ${localbuild}" - fn_script_log_info "Remote build: ${remotebuild}" - fn_script_log_info "${localbuild} > ${remotebuild}" + fn_script_log_info "Remote build: ${remotebuildversion}" + if [ -n "${branch}" ]; then + fn_script_log_info "Branch: ${branch}" + fi + fn_script_log_info "${localbuild} > ${remotebuildversion}" - unset updateonstart - check_status.sh - # If server stopped. - if [ "${status}" == "0" ]; then - exitbypass=1 - fn_update_vs_dl - if [ "${requirerestart}" == "1" ]; then + if [ "${commandname}" == "UPDATE" ]; then + unset updateonstart + check_status.sh + # If server stopped. + if [ "${status}" == "0" ]; then + fn_update_dl + if [ "${localbuild}" == "0" ]; then + exitbypass=1 + command_start.sh + fn_firstcommand_reset + exitbypass=1 + sleep 5 + command_stop.sh + fn_firstcommand_reset + fi + # If server started. + else + fn_print_restart_warning exitbypass=1 - command_start.sh + command_stop.sh fn_firstcommand_reset exitbypass=1 - command_stop.sh + fn_update_dl + exitbypass=1 + command_start.sh fn_firstcommand_reset fi - # If server started. - else - fn_print_restart_warning - exitbypass=1 - command_stop.sh - fn_firstcommand_reset - exitbypass=1 - fn_update_vs_dl - exitbypass=1 - command_start.sh - fn_firstcommand_reset + unset exitbypass + date +%s > "${lockdir}/lastupdate.lock" + alert="update" + elif [ "${commandname}" == "CHECK-UPDATE" ]; then + alert="check-update" fi - unset exitbypass - date +%s > "${lockdir}/lastupdate.lock" - alert="update" alert.sh else fn_print_ok_nl "Checking for update: ${remotelocation}" echo -en "\n" echo -e "No update available" echo -e "* Local build: ${green}${localbuild}${default}" - echo -e "* Remote build: ${green}${remotebuild}${default}" + echo -e "* Remote build: ${green}${remotebuildversion}${default}" if [ -n "${branch}" ]; then echo -e "* Branch: ${branch}" fi echo -en "\n" fn_script_log_info "No update available" fn_script_log_info "Local build: ${localbuild}" - fn_script_log_info "Remote build: ${remotebuild}" + fn_script_log_info "Remote build: ${remotebuildversion}" if [ -n "${branch}" ]; then fn_script_log_info "Branch: ${branch}" fi + if [ -f "${rootdir}/.dev-debug" ]; then + echo -e "Remote build info" + echo -e "* apiurl: ${apiurl}" + echo -e "* remotebuildfilename: ${remotebuildfilename}" + echo -e "* remotebuildurl: ${remotebuildurl}" + echo -e "* remotebuildversion: ${remotebuildversion}" + fi fi } # The location where the builds are checked and downloaded. remotelocation="vintagestory.at" -apiurl="http://api.${remotelocation}/stable-unstable.json" if [ "${firstcommandname}" == "INSTALL" ]; then - fn_update_vs_remotebuild - fn_update_vs_dl + fn_update_remotebuild + fn_update_dl else fn_print_dots "Checking for update" fn_print_dots "Checking for update: ${remotelocation}" fn_script_log_info "Checking for update: ${remotelocation}" - fn_update_vs_localbuild - fn_update_vs_remotebuild - fn_update_vs_compare + fn_update_localbuild + fn_update_remotebuild + fn_update_compare fi From 89363f6b253f114d2159561262718db51774b49e Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sun, 26 Mar 2023 22:58:48 +0100 Subject: [PATCH 140/161] fix(rust): random seed not generating --- lgsm/functions/fix_rust.sh | 2 +- lgsm/functions/info_game.sh | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/lgsm/functions/fix_rust.sh b/lgsm/functions/fix_rust.sh index 4488377a3..f1d592658 100755 --- a/lgsm/functions/fix_rust.sh +++ b/lgsm/functions/fix_rust.sh @@ -12,7 +12,7 @@ export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${serverfiles}:${serverfiles}/RustDedic # Part of random seed feature. # If seed is not defined by user generate a seed file. -if [ -z "${seed}" ]; then +if [ -z "${seed}" ] || [ "${seed}" == "0" ]; then if [ ! -f "${datadir}/${selfname}-seed.txt" ]; then shuf -i 1-2147483647 -n 1 > "${datadir}/${selfname}-seed.txt" fi diff --git a/lgsm/functions/info_game.sh b/lgsm/functions/info_game.sh index f5dc108da..0bd219485 100644 --- a/lgsm/functions/info_game.sh +++ b/lgsm/functions/info_game.sh @@ -1490,7 +1490,11 @@ fn_info_game_rust() { serverlevel=${serverlevel:-"NOT SET"} customlevelurl=${customlevelurl:-"NOT SET"} worldsize=${worldsize:-"0"} - seed=${seed:-"0"} + if [ -n "${seed}" ]; then + seed=${seed:-"0"} + elif [ -f "${datadir}/${selfname}-seed.txt" ]; then + seed=$(cat "${datadir}/${selfname}-seed.txt") + fi salt=${salt:-"0"} } From 7c818be4fe3032f32e101d2a38b0b5e117a6c04c Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sun, 26 Mar 2023 23:16:39 +0100 Subject: [PATCH 141/161] feat(mods): add rust carbon mod (#4122) * feat(mods): add rust carbon * updated tag and file name * add source --- lgsm/functions/fix_rust.sh | 8 ++++++++ lgsm/functions/mods_list.sh | 9 ++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/lgsm/functions/fix_rust.sh b/lgsm/functions/fix_rust.sh index f1d592658..662bbe052 100755 --- a/lgsm/functions/fix_rust.sh +++ b/lgsm/functions/fix_rust.sh @@ -19,3 +19,11 @@ if [ -z "${seed}" ] || [ "${seed}" == "0" ]; then seed="$(cat "${datadir}/${selfname}-seed.txt")" randomseed=1 fi + +# If Carbon mod is installed, run enviroment.sh +if [ -f "${serverfiles}/carbon/tools/environment.sh" ]; then + fn_print_info_nl "Running Carbon environment.sh" + fn_script_log_info "Running Carbon environment.sh" + # shellcheck source=/dev/null + source "${serverfiles}/carbon/tools/environment.sh" +fi diff --git a/lgsm/functions/mods_list.sh b/lgsm/functions/mods_list.sh index f78686759..a83b7e303 100755 --- a/lgsm/functions/mods_list.sh +++ b/lgsm/functions/mods_list.sh @@ -88,6 +88,10 @@ movementapilatestversion=$(curl --connect-timeout 10 -s https://api.github.com/r movementapilatestfile="MovementAPI-v${movementapilatestversion}.zip" movementapilatestlink="https://github.com/danzayau/MovementAPI/releases/download/${movementapilatestversion}/${movementapilatestfile}" +# Rust +carbonrustapilatestfile="Carbon.Linux.Release.tar.gz" +carbonrustlatestlink=$(curl --connect-timeout 10 -sL https://api.github.com/repos/CarbonCommunity/Carbon.Core/releases/tags/production_build | jq -r '.assets[]|select(.name == "Carbon.Linux.Release.tar.gz") | .browser_download_url') + # Oxide oxiderustlatestlink=$(curl --connect-timeout 10 -sL https://api.github.com/repos/OxideMod/Oxide.Rust/releases/latest | jq -r '.assets[]|select(.browser_download_url | contains("linux")) | .browser_download_url') oxidehurtworldlatestlink=$(curl --connect-timeout 10 -sL https://api.github.com/repos/OxideMod/Oxide.Hurtworld/releases/latest | jq -r '.assets[].browser_download_url') @@ -187,6 +191,9 @@ mod_info_darkrp=(MOD "darkrp" "DarkRP" "https://github.com/FPtje/DarkRP/archive/ mod_info_darkrpmodification=(MOD "darkrpmodification" "DarkRP Modification" "https://github.com/FPtje/darkrpmodification/archive/master.zip" "darkrpmodification-master.zip" "0" "LowercaseOff" "${systemdir}/addons" "NOUPDATE" "ENGINES" "Garry's Mod;" "NOTGAMES" "http://darkrp.com" "Customize DarkRP settings") mod_info_laserstool=(MOD "laserstool" "Laser STool" "https://github.com/dvdvideo1234/laserstool/archive/main.zip" "laserstool-main.zip" "0" "LowercaseOn" "${systemdir}/addons" "OVERWRITE" "ENGINES" "Garry's Mod;" "NOTGAMES" "https://github.com/dvdvideo1234/LaserSTool" "Scripted tool that spawns laser entities, simulates light rays and even kill players") +# Rust +mod_info_rustcarbon=(MOD "rustcarbon" "Carbon for Rust" "${carbonrustlatestlink}" "Carbon.Linux.Release.tar.gz" "0" "LowercaseOff" "${systemdir}" "OVERWRITE" "ENGINES" "Rust;" "NOTGAMES" "carbonmod.gg" "Allows for the use of both plugins and harmony mods") + # Oxidemod mod_info_rustoxide=(MOD "rustoxide" "Oxide for Rust" "${oxiderustlatestlink}" "Oxide.Rust-linux.zip" "0" "LowercaseOff" "${systemdir}" "OVERWRITE" "ENGINES" "Rust;" "NOTGAMES" "https://umod.org/games/rust" "Allows for the use of plugins") mod_info_hwoxide=(MOD "hwoxide" "Oxide for Hurtworld" "${oxidehurtworldlatestlink}" "Oxide.Hurtworld.zip" "0" "LowercaseOff" "${systemdir}" "OVERWRITE" "ENGINES" "Hurtworld;" "NOTGAMES" "https://umod.org/games/hurtworld" "Allows for the use of plugins") @@ -199,4 +206,4 @@ mod_info_valheimplus=(MOD "valheimplus" "Valheim PLUS" "${valeimpluslatestlink}" mod_info_bepinexvh=(MOD "bepinexvh" "BepInEx Valheim" "${bepinexvhlatestlink}" "denikson-BepInExPack_Valheim.zip" "0" "LowercaseOff" "${systemdir}" "OVERWRITE" "ENGINES" "Valheim;" "NOTGAMES" "https://valheim.thunderstore.io/package/denikson/BepInExPack_Valheim/" "Unity / XNA game patcher and plugin framework") # REQUIRED: Set all mods info into the global array -mods_global_array=("${mod_info_metamod[@]}" "${mod_info_base_amxx[@]}" "${mod_info_cs_amxx[@]}" "${mod_info_dod_amxx[@]}" "${mod_info_tfc_amxx[@]}" "${mod_info_ns_amxx[@]}" "${mod_info_ts_amxx[@]}" "${mod_info_metamodsource[@]}" "${mod_info_sourcemod[@]}" "${mod_info_steamworks[@]}" "${mod_info_gokz[@]}" "${mod_info_ttt[@]}" "${mod_info_get5[@]}" "${mod_info_prac[@]}" "${mod_info_pug[@]}" "${mod_info_dhook[@]}" "${mod_info_movement[@]}" "${mod_info_cleaner[@]}" "${mod_info_ulib[@]}" "${mod_info_ulx[@]}" "${mod_info_utime[@]}" "${mod_info_uclip[@]}" "${mod_info_acf[@]}" "${mod_info_acf_missiles[@]}" "${mod_info_acf_sweps[@]}" "${mod_info_advdupe2[@]}" "${mod_info_pac3[@]}" "${mod_info_wiremod[@]}" "${mod_info_wiremodextras[@]}" "${mod_info_darkrp[@]}" "${mod_info_darkrpmodification[@]}" "${mod_info_rustoxide[@]}" "${mod_info_hwoxide[@]}" "${mod_info_sdtdoxide[@]}" "${mod_info_advduplicator[@]}" "${mod_info_trackassemblytool[@]}" "${mod_info_physpropertiesadv[@]}" "${mod_info_controlsystemse2[@]}" "${mod_info_e2pistontiming[@]}" "${mod_info_propcannontool[@]}" "${mod_info_gearassemblytool[@]}" "${mod_info_spinnertool[@]}" "${mod_info_surfacefrictiontool[@]}" "${mod_info_magneticdipole[@]}" "${mod_info_environmentorganizer[@]}" "${mod_info_precision_alignment[@]}" "${mod_info_improved_stacker[@]}" "${mod_info_improved_weight[@]}" "${mod_info_improved_antinoclip[@]}" "${mod_info_laserstool[@]}" "${mod_info_valheimplus[@]}" "${mod_info_bepinexvh[@]}") +mods_global_array=("${mod_info_metamod[@]}" "${mod_info_base_amxx[@]}" "${mod_info_cs_amxx[@]}" "${mod_info_dod_amxx[@]}" "${mod_info_tfc_amxx[@]}" "${mod_info_ns_amxx[@]}" "${mod_info_ts_amxx[@]}" "${mod_info_metamodsource[@]}" "${mod_info_sourcemod[@]}" "${mod_info_steamworks[@]}" "${mod_info_gokz[@]}" "${mod_info_ttt[@]}" "${mod_info_get5[@]}" "${mod_info_prac[@]}" "${mod_info_pug[@]}" "${mod_info_dhook[@]}" "${mod_info_movement[@]}" "${mod_info_cleaner[@]}" "${mod_info_ulib[@]}" "${mod_info_ulx[@]}" "${mod_info_utime[@]}" "${mod_info_uclip[@]}" "${mod_info_acf[@]}" "${mod_info_acf_missiles[@]}" "${mod_info_acf_sweps[@]}" "${mod_info_advdupe2[@]}" "${mod_info_pac3[@]}" "${mod_info_wiremod[@]}" "${mod_info_wiremodextras[@]}" "${mod_info_darkrp[@]}" "${mod_info_darkrpmodification[@]}" "${mod_info_rustcarbon[@]}" "${mod_info_rustoxide[@]}" "${mod_info_hwoxide[@]}" "${mod_info_sdtdoxide[@]}" "${mod_info_advduplicator[@]}" "${mod_info_trackassemblytool[@]}" "${mod_info_physpropertiesadv[@]}" "${mod_info_controlsystemse2[@]}" "${mod_info_e2pistontiming[@]}" "${mod_info_propcannontool[@]}" "${mod_info_gearassemblytool[@]}" "${mod_info_spinnertool[@]}" "${mod_info_surfacefrictiontool[@]}" "${mod_info_magneticdipole[@]}" "${mod_info_environmentorganizer[@]}" "${mod_info_precision_alignment[@]}" "${mod_info_improved_stacker[@]}" "${mod_info_improved_weight[@]}" "${mod_info_improved_antinoclip[@]}" "${mod_info_laserstool[@]}" "${mod_info_valheimplus[@]}" "${mod_info_bepinexvh[@]}") From c6549da271c4747c473627631700d28c10d8ac1d Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sun, 26 Mar 2023 23:42:02 +0100 Subject: [PATCH 142/161] fix(rust): improve seed messaging --- lgsm/functions/command_wipe.sh | 2 +- lgsm/functions/fix_rust.sh | 3 +++ lgsm/functions/info_game.sh | 2 ++ 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/lgsm/functions/command_wipe.sh b/lgsm/functions/command_wipe.sh index 29577984e..e1677e827 100755 --- a/lgsm/functions/command_wipe.sh +++ b/lgsm/functions/command_wipe.sh @@ -111,7 +111,7 @@ fn_wipe_random_seed() { seed=$(cat "${datadir}/${selfname}-seed.txt") randomseed=1 echo -en "generating new random seed (${cyan}${seed}${default})..." - fn_script_log_pass "generating new random seed (${cyan}${seed}${default})" + fn_script_log_pass "Generating new random seed (${cyan}${seed}${default})" fn_sleep_time fn_print_ok_eol_nl fi diff --git a/lgsm/functions/fix_rust.sh b/lgsm/functions/fix_rust.sh index 662bbe052..5f407e89f 100755 --- a/lgsm/functions/fix_rust.sh +++ b/lgsm/functions/fix_rust.sh @@ -15,6 +15,9 @@ export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${serverfiles}:${serverfiles}/RustDedic if [ -z "${seed}" ] || [ "${seed}" == "0" ]; then if [ ! -f "${datadir}/${selfname}-seed.txt" ]; then shuf -i 1-2147483647 -n 1 > "${datadir}/${selfname}-seed.txt" + seed="$(cat "${datadir}/${selfname}-seed.txt")" + fn_print_info_nl "Generating new random seed (${cyan}${seed}${default})" + fn_script_log_pass "Generating new random seed (${cyan}${seed}${default})" fi seed="$(cat "${datadir}/${selfname}-seed.txt")" randomseed=1 diff --git a/lgsm/functions/info_game.sh b/lgsm/functions/info_game.sh index 0bd219485..8c9ca310a 100644 --- a/lgsm/functions/info_game.sh +++ b/lgsm/functions/info_game.sh @@ -1494,6 +1494,8 @@ fn_info_game_rust() { seed=${seed:-"0"} elif [ -f "${datadir}/${selfname}-seed.txt" ]; then seed=$(cat "${datadir}/${selfname}-seed.txt") + else + seed="0" fi salt=${salt:-"0"} } From bc7e200dcd2bcfa75548eb758c72791faff405ad Mon Sep 17 00:00:00 2001 From: jusito <17811819+jusito@users.noreply.github.com> Date: Mon, 27 Mar 2023 22:14:12 +0200 Subject: [PATCH 143/161] fix(update-lgsm): cd functionsdir but never back (#4140) --- lgsm/functions/command_update_linuxgsm.sh | 78 ++++++++++++----------- 1 file changed, 40 insertions(+), 38 deletions(-) diff --git a/lgsm/functions/command_update_linuxgsm.sh b/lgsm/functions/command_update_linuxgsm.sh index 39a441f59..569bc7cdb 100755 --- a/lgsm/functions/command_update_linuxgsm.sh +++ b/lgsm/functions/command_update_linuxgsm.sh @@ -182,49 +182,51 @@ fi # Check and update modules. if [ -n "${functionsdir}" ]; then if [ -d "${functionsdir}" ]; then - cd "${functionsdir}" || exit - for functionfile in *; do - # check if module exists in the repo and remove if missing. - # commonly used if module names change. - echo -en "checking ${remotereponame} module ${functionfile}...\c" - github_file_url_dir="lgsm/functions" - if [ "${remotereponame}" == "GitHub" ]; then - curl --connect-timeout 10 -IsfL "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${functionfile}" 1> /dev/null - else - curl --connect-timeout 10 -IsfL "https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/${github_file_url_dir}/${functionfile}" 1> /dev/null - fi - if [ $? != 0 ]; then - fn_print_error_eol_nl - fn_script_log_error "Checking ${remotereponame} module ${functionfile}" - echo -en "removing module ${functionfile}...\c" - if ! rm -f "${functionfile:?}"; then - fn_print_fail_eol_nl - fn_script_log_fatal "Removing module ${functionfile}" - core_exit.sh - else - fn_print_ok_eol_nl - fn_script_log_pass "Removing module ${functionfile}" - fi - else - # compare file + ( + cd "${functionsdir}" || exit + for functionfile in *; do + # check if module exists in the repo and remove if missing. + # commonly used if module names change. + echo -en "checking ${remotereponame} module ${functionfile}...\c" + github_file_url_dir="lgsm/functions" if [ "${remotereponame}" == "GitHub" ]; then - function_file_diff=$(diff "${functionsdir}/${functionfile}" <(curl --connect-timeout 10 -s "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${functionfile}")) + curl --connect-timeout 10 -IsfL "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${functionfile}" 1> /dev/null else - function_file_diff=$(diff "${functionsdir}/${functionfile}" <(curl --connect-timeout 10 -s "https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/${github_file_url_dir}/${functionfile}")) + curl --connect-timeout 10 -IsfL "https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/${github_file_url_dir}/${functionfile}" 1> /dev/null fi - - # results - if [ "${function_file_diff}" != "" ]; then - fn_print_update_eol_nl - fn_script_log_update "Checking ${remotereponame} module ${functionfile}" - rm -rf "${functionsdir:?}/${functionfile}" - fn_update_function + if [ $? != 0 ]; then + fn_print_error_eol_nl + fn_script_log_error "Checking ${remotereponame} module ${functionfile}" + echo -en "removing module ${functionfile}...\c" + if ! rm -f "${functionfile:?}"; then + fn_print_fail_eol_nl + fn_script_log_fatal "Removing module ${functionfile}" + core_exit.sh + else + fn_print_ok_eol_nl + fn_script_log_pass "Removing module ${functionfile}" + fi else - fn_print_ok_eol_nl - fn_script_log_pass "Checking ${remotereponame} module ${functionfile}" + # compare file + if [ "${remotereponame}" == "GitHub" ]; then + function_file_diff=$(diff "${functionsdir}/${functionfile}" <(curl --connect-timeout 10 -s "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${functionfile}")) + else + function_file_diff=$(diff "${functionsdir}/${functionfile}" <(curl --connect-timeout 10 -s "https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/${github_file_url_dir}/${functionfile}")) + fi + + # results + if [ "${function_file_diff}" != "" ]; then + fn_print_update_eol_nl + fn_script_log_update "Checking ${remotereponame} module ${functionfile}" + rm -rf "${functionsdir:?}/${functionfile}" + fn_update_function + else + fn_print_ok_eol_nl + fn_script_log_pass "Checking ${remotereponame} module ${functionfile}" + fi fi - fi - done + done + ) fi fi From 69468d333a39e1ac7581368094560b12d49e0179 Mon Sep 17 00:00:00 2001 From: Reda DRISSI Date: Tue, 28 Mar 2023 23:09:16 +0200 Subject: [PATCH 144/161] feat(core): prefix logs with a timestamp (#3795) * feat: Added Option to prefix logs with timestamps * feat: Added Option to prefix logs with timestamps * Add parameters to every game * feat: Switched timestamp enabling from True/False to on/off * feat: Added quotes on variables * add to new configs * renamed to logtimestamp * remove gawk as a requirement gawk is a standard tool on linux distros and no check is required * tidy * rename to addtimestamp --------- Co-authored-by: Reda.drissi.e Co-authored-by: Daniel Gibbs --- .../config-lgsm/acserver/_default.cfg | 4 ++++ .../config-lgsm/ahl2server/_default.cfg | 5 ++++- .../config-lgsm/ahlserver/_default.cfg | 4 ++++ .../config-lgsm/arkserver/_default.cfg | 4 ++++ .../config-lgsm/arma3server/_default.cfg | 4 ++++ .../config-lgsm/armarserver/_default.cfg | 4 ++++ .../config-lgsm/atsserver/_default.cfg | 4 ++++ .../config-lgsm/avserver/_default.cfg | 4 ++++ .../config-lgsm/bb2server/_default.cfg | 4 ++++ .../config-lgsm/bbserver/_default.cfg | 4 ++++ .../config-lgsm/bdserver/_default.cfg | 4 ++++ .../config-lgsm/bf1942server/_default.cfg | 4 ++++ .../config-lgsm/bfvserver/_default.cfg | 4 ++++ .../config-lgsm/bmdmserver/_default.cfg | 4 ++++ .../config-lgsm/boserver/_default.cfg | 4 ++++ .../config-lgsm/bsserver/_default.cfg | 4 ++++ .../config-lgsm/btlserver/_default.cfg | 4 ++++ .../config-lgsm/btserver/_default.cfg | 4 ++++ .../config-lgsm/ccserver/_default.cfg | 4 ++++ .../config-lgsm/cdserver/_default.cfg | 4 ++++ .../config-lgsm/ckserver/_default.cfg | 4 ++++ .../config-lgsm/cmwserver/_default.cfg | 4 ++++ .../config-lgsm/cod2server/_default.cfg | 4 ++++ .../config-lgsm/cod4server/_default.cfg | 4 ++++ .../config-lgsm/codserver/_default.cfg | 4 ++++ .../config-lgsm/coduoserver/_default.cfg | 4 ++++ .../config-lgsm/codwawserver/_default.cfg | 4 ++++ .../config-lgsm/colserver/_default.cfg | 4 ++++ .../config-lgsm/csczserver/_default.cfg | 4 ++++ .../config-lgsm/csgoserver/_default.cfg | 4 ++++ .../config-lgsm/csserver/_default.cfg | 4 ++++ .../config-lgsm/cssserver/_default.cfg | 4 ++++ .../config-lgsm/dabserver/_default.cfg | 4 ++++ .../config-lgsm/dayzserver/_default.cfg | 4 ++++ .../config-lgsm/dmcserver/_default.cfg | 4 ++++ .../config-lgsm/dodrserver/_default.cfg | 4 ++++ .../config-lgsm/dodserver/_default.cfg | 4 ++++ .../config-lgsm/dodsserver/_default.cfg | 4 ++++ .../config-lgsm/doiserver/_default.cfg | 4 ++++ .../config-lgsm/dstserver/_default.cfg | 4 ++++ .../config-lgsm/dysserver/_default.cfg | 4 ++++ .../config-lgsm/ecoserver/_default.cfg | 4 ++++ .../config-lgsm/emserver/_default.cfg | 4 ++++ .../config-lgsm/etlserver/_default.cfg | 4 ++++ .../config-lgsm/ets2server/_default.cfg | 4 ++++ .../config-lgsm/fctrserver/_default.cfg | 4 ++++ .../config-lgsm/fofserver/_default.cfg | 4 ++++ .../config-lgsm/gmodserver/_default.cfg | 4 ++++ .../config-lgsm/hl2dmserver/_default.cfg | 4 ++++ .../config-lgsm/hldmserver/_default.cfg | 4 ++++ .../config-lgsm/hldmsserver/_default.cfg | 4 ++++ .../config-lgsm/hwserver/_default.cfg | 6 +++++- .../config-lgsm/insserver/_default.cfg | 4 ++++ .../config-lgsm/inssserver/_default.cfg | 4 ++++ .../config-lgsm/iosserver/_default.cfg | 4 ++++ .../config-lgsm/jc2server/_default.cfg | 4 ++++ .../config-lgsm/jc3server/_default.cfg | 4 ++++ .../config-lgsm/jk2server/_default.cfg | 4 ++++ .../config-lgsm/kf2server/_default.cfg | 4 ++++ .../config-lgsm/kfserver/_default.cfg | 4 ++++ .../config-lgsm/l4d2server/_default.cfg | 4 ++++ .../config-lgsm/l4dserver/_default.cfg | 4 ++++ .../config-lgsm/loserver/_default.cfg | 4 ++++ .../config-lgsm/mcbserver/_default.cfg | 4 ++++ .../config-lgsm/mcserver/_default.cfg | 4 ++++ .../config-lgsm/mhserver/_default.cfg | 4 ++++ .../config-lgsm/mohaaserver/_default.cfg | 4 ++++ .../config-lgsm/momserver/_default.cfg | 4 ++++ .../config-lgsm/mtaserver/_default.cfg | 4 ++++ .../config-lgsm/ndserver/_default.cfg | 4 ++++ .../config-lgsm/necserver/_default.cfg | 4 ++++ .../config-lgsm/nmrihserver/_default.cfg | 4 ++++ .../config-lgsm/ns2cserver/_default.cfg | 4 ++++ .../config-lgsm/ns2server/_default.cfg | 4 ++++ .../config-lgsm/nsserver/_default.cfg | 4 ++++ .../config-lgsm/onsetserver/_default.cfg | 4 ++++ .../config-lgsm/opforserver/_default.cfg | 4 ++++ .../config-lgsm/pc2server/_default.cfg | 4 ++++ .../config-lgsm/pcserver/_default.cfg | 4 ++++ .../config-lgsm/pmcserver/_default.cfg | 4 ++++ .../config-lgsm/pstbsserver/_default.cfg | 4 ++++ .../config-lgsm/pvkiiserver/_default.cfg | 4 ++++ .../config-lgsm/pvrserver/_default.cfg | 4 ++++ .../config-lgsm/pzserver/_default.cfg | 4 ++++ .../config-lgsm/q2server/_default.cfg | 4 ++++ .../config-lgsm/q3server/_default.cfg | 4 ++++ .../config-lgsm/qlserver/_default.cfg | 4 ++++ .../config-lgsm/qwserver/_default.cfg | 4 ++++ .../config-lgsm/ricochetserver/_default.cfg | 4 ++++ .../config-lgsm/roserver/_default.cfg | 4 ++++ .../config-lgsm/rtcwserver/_default.cfg | 4 ++++ .../config-lgsm/rustserver/_default.cfg | 16 ++++++++++------ .../config-lgsm/rwserver/_default.cfg | 4 ++++ .../config-lgsm/sampserver/_default.cfg | 4 ++++ .../config-lgsm/sbotsserver/_default.cfg | 6 +++++- .../config-lgsm/sbserver/_default.cfg | 4 ++++ .../config-lgsm/scpslserver/_default.cfg | 4 ++++ .../config-lgsm/scpslsmserver/_default.cfg | 4 ++++ .../config-lgsm/sdtdserver/_default.cfg | 4 ++++ .../config-lgsm/sfcserver/_default.cfg | 4 ++++ .../config-lgsm/sfserver/_default.cfg | 4 ++++ .../config-lgsm/sof2server/_default.cfg | 4 ++++ .../config-lgsm/solserver/_default.cfg | 4 ++++ .../config-lgsm/squadserver/_default.cfg | 4 ++++ .../config-lgsm/stnserver/_default.cfg | 4 ++++ .../config-lgsm/stserver/_default.cfg | 4 ++++ .../config-lgsm/svenserver/_default.cfg | 4 ++++ .../config-lgsm/terrariaserver/_default.cfg | 4 ++++ .../config-lgsm/tf2server/_default.cfg | 4 ++++ .../config-lgsm/tfcserver/_default.cfg | 4 ++++ .../config-lgsm/tiserver/_default.cfg | 4 ++++ .../config-lgsm/ts3server/_default.cfg | 4 ++++ .../config-lgsm/tsserver/_default.cfg | 4 ++++ .../config-lgsm/tuserver/_default.cfg | 4 ++++ .../config-lgsm/twserver/_default.cfg | 4 ++++ .../config-lgsm/untserver/_default.cfg | 4 ++++ .../config-lgsm/ut2k4server/_default.cfg | 4 ++++ .../config-lgsm/ut3server/_default.cfg | 4 ++++ .../config-lgsm/ut99server/_default.cfg | 4 ++++ .../config-lgsm/utserver/_default.cfg | 4 ++++ .../config-lgsm/vhserver/_default.cfg | 4 ++++ .../config-lgsm/vintsserver/_default.cfg | 4 ++++ .../config-lgsm/vpmcserver/_default.cfg | 4 ++++ .../config-lgsm/vsserver/_default.cfg | 4 ++++ .../config-lgsm/wetserver/_default.cfg | 4 ++++ .../config-lgsm/wfserver/_default.cfg | 4 ++++ .../config-lgsm/wmcserver/_default.cfg | 4 ++++ .../config-lgsm/wurmserver/_default.cfg | 4 ++++ .../config-lgsm/zmrserver/_default.cfg | 4 ++++ .../config-lgsm/zpsserver/_default.cfg | 4 ++++ lgsm/functions/command_start.sh | 16 +++++++++++++--- 131 files changed, 541 insertions(+), 12 deletions(-) diff --git a/lgsm/config-default/config-lgsm/acserver/_default.cfg b/lgsm/config-default/config-lgsm/acserver/_default.cfg index 3b6776ef7..8d572b695 100644 --- a/lgsm/config-default/config-lgsm/acserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/acserver/_default.cfg @@ -184,3 +184,7 @@ postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" ## Logs Naming lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" + +## Log Parameters +logtimestamp="off" +logtimestampformat="%Y-%m-%d %H:%M:%S" diff --git a/lgsm/config-default/config-lgsm/ahl2server/_default.cfg b/lgsm/config-default/config-lgsm/ahl2server/_default.cfg index a2552a95d..3283f54e8 100644 --- a/lgsm/config-default/config-lgsm/ahl2server/_default.cfg +++ b/lgsm/config-default/config-lgsm/ahl2server/_default.cfg @@ -152,7 +152,6 @@ stopmode="3" querymode="2" querytype="protocol-valve" - ## Console type consoleverbose="yes" consoleinteract="yes" @@ -191,3 +190,7 @@ postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" ## Logs Naming lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" + +## Log Parameters +logtimestamp="off" +logtimestampformat="%Y-%m-%d %H:%M:%S" diff --git a/lgsm/config-default/config-lgsm/ahlserver/_default.cfg b/lgsm/config-default/config-lgsm/ahlserver/_default.cfg index 046aa0c11..9d4c0ed4b 100644 --- a/lgsm/config-default/config-lgsm/ahlserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/ahlserver/_default.cfg @@ -186,3 +186,7 @@ postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" ## Logs Naming lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" + +## Log Parameters +logtimestamp="off" +logtimestampformat="%Y-%m-%d %H:%M:%S" diff --git a/lgsm/config-default/config-lgsm/arkserver/_default.cfg b/lgsm/config-default/config-lgsm/arkserver/_default.cfg index 8e24debfc..cc3de9082 100644 --- a/lgsm/config-default/config-lgsm/arkserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/arkserver/_default.cfg @@ -188,3 +188,7 @@ postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" ## Logs Naming lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" + +## Log Parameters +logtimestamp="off" +logtimestampformat="%Y-%m-%d %H:%M:%S" diff --git a/lgsm/config-default/config-lgsm/arma3server/_default.cfg b/lgsm/config-default/config-lgsm/arma3server/_default.cfg index 7c4619c17..c92e843fd 100644 --- a/lgsm/config-default/config-lgsm/arma3server/_default.cfg +++ b/lgsm/config-default/config-lgsm/arma3server/_default.cfg @@ -204,3 +204,7 @@ postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" ## Logs Naming lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" + +## Log Parameters +logtimestamp="off" +logtimestampformat="%Y-%m-%d %H:%M:%S" diff --git a/lgsm/config-default/config-lgsm/armarserver/_default.cfg b/lgsm/config-default/config-lgsm/armarserver/_default.cfg index 9e2f88d7c..3cee2f43f 100644 --- a/lgsm/config-default/config-lgsm/armarserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/armarserver/_default.cfg @@ -185,3 +185,7 @@ postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" ## Logs Naming lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" + +## Log Parameters +logtimestamp="off" +logtimestampformat="%Y-%m-%d %H:%M:%S" diff --git a/lgsm/config-default/config-lgsm/atsserver/_default.cfg b/lgsm/config-default/config-lgsm/atsserver/_default.cfg index c6e338d34..a77e230ce 100644 --- a/lgsm/config-default/config-lgsm/atsserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/atsserver/_default.cfg @@ -177,3 +177,7 @@ postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" ## Logs Naming lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" + +## Log Parameters +logtimestamp="off" +logtimestampformat="%Y-%m-%d %H:%M:%S" diff --git a/lgsm/config-default/config-lgsm/avserver/_default.cfg b/lgsm/config-default/config-lgsm/avserver/_default.cfg index bbaf07daa..a77e347a8 100644 --- a/lgsm/config-default/config-lgsm/avserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/avserver/_default.cfg @@ -182,3 +182,7 @@ postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" ## Logs Naming lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" + +## Log Parameters +logtimestamp="off" +logtimestampformat="%Y-%m-%d %H:%M:%S" diff --git a/lgsm/config-default/config-lgsm/bb2server/_default.cfg b/lgsm/config-default/config-lgsm/bb2server/_default.cfg index 1e566b88b..6557890a1 100644 --- a/lgsm/config-default/config-lgsm/bb2server/_default.cfg +++ b/lgsm/config-default/config-lgsm/bb2server/_default.cfg @@ -191,3 +191,7 @@ postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" ## Logs Naming lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" + +## Log Parameters +logtimestamp="off" +logtimestampformat="%Y-%m-%d %H:%M:%S" diff --git a/lgsm/config-default/config-lgsm/bbserver/_default.cfg b/lgsm/config-default/config-lgsm/bbserver/_default.cfg index 118f65547..ad283e5aa 100644 --- a/lgsm/config-default/config-lgsm/bbserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/bbserver/_default.cfg @@ -186,3 +186,7 @@ postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" ## Logs Naming lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" + +## Log Parameters +logtimestamp="off" +logtimestampformat="%Y-%m-%d %H:%M:%S" diff --git a/lgsm/config-default/config-lgsm/bdserver/_default.cfg b/lgsm/config-default/config-lgsm/bdserver/_default.cfg index eef61562c..07d5465d0 100644 --- a/lgsm/config-default/config-lgsm/bdserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/bdserver/_default.cfg @@ -185,3 +185,7 @@ postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" ## Logs Naming lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" + +## Log Parameters +logtimestamp="off" +logtimestampformat="%Y-%m-%d %H:%M:%S" diff --git a/lgsm/config-default/config-lgsm/bf1942server/_default.cfg b/lgsm/config-default/config-lgsm/bf1942server/_default.cfg index c6da048f9..4d2651a9a 100644 --- a/lgsm/config-default/config-lgsm/bf1942server/_default.cfg +++ b/lgsm/config-default/config-lgsm/bf1942server/_default.cfg @@ -168,3 +168,7 @@ postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" ## Logs Naming lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" + +## Log Parameters +logtimestamp="off" +logtimestampformat="%Y-%m-%d %H:%M:%S" diff --git a/lgsm/config-default/config-lgsm/bfvserver/_default.cfg b/lgsm/config-default/config-lgsm/bfvserver/_default.cfg index 9acc98e5b..27d7cd504 100644 --- a/lgsm/config-default/config-lgsm/bfvserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/bfvserver/_default.cfg @@ -168,3 +168,7 @@ postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" ## Logs Naming lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" + +## Log Parameters +logtimestamp="off" +logtimestampformat="%Y-%m-%d %H:%M:%S" diff --git a/lgsm/config-default/config-lgsm/bmdmserver/_default.cfg b/lgsm/config-default/config-lgsm/bmdmserver/_default.cfg index bd8145df3..5d13c758c 100644 --- a/lgsm/config-default/config-lgsm/bmdmserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/bmdmserver/_default.cfg @@ -191,3 +191,7 @@ postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" ## Logs Naming lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" + +## Log Parameters +logtimestamp="off" +logtimestampformat="%Y-%m-%d %H:%M:%S" diff --git a/lgsm/config-default/config-lgsm/boserver/_default.cfg b/lgsm/config-default/config-lgsm/boserver/_default.cfg index f2c2a3b03..4f44086c2 100644 --- a/lgsm/config-default/config-lgsm/boserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/boserver/_default.cfg @@ -184,3 +184,7 @@ postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" ## Logs Naming lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" + +## Log Parameters +logtimestamp="off" +logtimestampformat="%Y-%m-%d %H:%M:%S" diff --git a/lgsm/config-default/config-lgsm/bsserver/_default.cfg b/lgsm/config-default/config-lgsm/bsserver/_default.cfg index 41ab3fba7..45f931aa4 100644 --- a/lgsm/config-default/config-lgsm/bsserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/bsserver/_default.cfg @@ -195,3 +195,7 @@ postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" ## Logs Naming lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" + +## Log Parameters +logtimestamp="off" +logtimestampformat="%Y-%m-%d %H:%M:%S" diff --git a/lgsm/config-default/config-lgsm/btlserver/_default.cfg b/lgsm/config-default/config-lgsm/btlserver/_default.cfg index 81173ccb9..b1b738fe2 100644 --- a/lgsm/config-default/config-lgsm/btlserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/btlserver/_default.cfg @@ -183,3 +183,7 @@ postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" ## Logs Naming lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" + +## Log Parameters +logtimestamp="off" +logtimestampformat="%Y-%m-%d %H:%M:%S" diff --git a/lgsm/config-default/config-lgsm/btserver/_default.cfg b/lgsm/config-default/config-lgsm/btserver/_default.cfg index 11e175c18..1fda28f37 100644 --- a/lgsm/config-default/config-lgsm/btserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/btserver/_default.cfg @@ -178,3 +178,7 @@ postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" ## Logs Naming lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" + +## Log Parameters +logtimestamp="off" +logtimestampformat="%Y-%m-%d %H:%M:%S" diff --git a/lgsm/config-default/config-lgsm/ccserver/_default.cfg b/lgsm/config-default/config-lgsm/ccserver/_default.cfg index 10ba0f8af..5a80c2ca5 100644 --- a/lgsm/config-default/config-lgsm/ccserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/ccserver/_default.cfg @@ -186,3 +186,7 @@ postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" ## Logs Naming lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" + +## Log Parameters +logtimestamp="off" +logtimestampformat="%Y-%m-%d %H:%M:%S" diff --git a/lgsm/config-default/config-lgsm/cdserver/_default.cfg b/lgsm/config-default/config-lgsm/cdserver/_default.cfg index 50eb14bf1..bf490c78a 100644 --- a/lgsm/config-default/config-lgsm/cdserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/cdserver/_default.cfg @@ -178,3 +178,7 @@ postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" ## Logs Naming lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" + +## Log Parameters +logtimestamp="off" +logtimestampformat="%Y-%m-%d %H:%M:%S" diff --git a/lgsm/config-default/config-lgsm/ckserver/_default.cfg b/lgsm/config-default/config-lgsm/ckserver/_default.cfg index ef1c0618c..3659bae6c 100644 --- a/lgsm/config-default/config-lgsm/ckserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/ckserver/_default.cfg @@ -184,3 +184,7 @@ postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" gamelogdate="${gamelogdir}/${selfname}-game-$(date '+%Y-%m-%d-%H:%M:%S').log" lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" + +## Log Parameters +logtimestamp="off" +logtimestampformat="%Y-%m-%d %H:%M:%S" diff --git a/lgsm/config-default/config-lgsm/cmwserver/_default.cfg b/lgsm/config-default/config-lgsm/cmwserver/_default.cfg index 0f05118e9..964185444 100644 --- a/lgsm/config-default/config-lgsm/cmwserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/cmwserver/_default.cfg @@ -186,3 +186,7 @@ postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" gamelogdate="${gamelogdir}/${selfname}-game-$(date '+%Y-%m-%d-%H:%M:%S').log" + +## Log Parameters +logtimestamp="off" +logtimestampformat="%Y-%m-%d %H:%M:%S" diff --git a/lgsm/config-default/config-lgsm/cod2server/_default.cfg b/lgsm/config-default/config-lgsm/cod2server/_default.cfg index fca571d93..64990c12e 100644 --- a/lgsm/config-default/config-lgsm/cod2server/_default.cfg +++ b/lgsm/config-default/config-lgsm/cod2server/_default.cfg @@ -171,3 +171,7 @@ postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" ## Logs Naming lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" + +## Log Parameters +logtimestamp="off" +logtimestampformat="%Y-%m-%d %H:%M:%S" diff --git a/lgsm/config-default/config-lgsm/cod4server/_default.cfg b/lgsm/config-default/config-lgsm/cod4server/_default.cfg index 8389feb3c..f73a2a1e3 100644 --- a/lgsm/config-default/config-lgsm/cod4server/_default.cfg +++ b/lgsm/config-default/config-lgsm/cod4server/_default.cfg @@ -171,3 +171,7 @@ postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" ## Logs Naming lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" + +## Log Parameters +logtimestamp="off" +logtimestampformat="%Y-%m-%d %H:%M:%S" diff --git a/lgsm/config-default/config-lgsm/codserver/_default.cfg b/lgsm/config-default/config-lgsm/codserver/_default.cfg index 34883c0a1..4650e35ad 100644 --- a/lgsm/config-default/config-lgsm/codserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/codserver/_default.cfg @@ -171,3 +171,7 @@ postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" ## Logs Naming lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" + +## Log Parameters +logtimestamp="off" +logtimestampformat="%Y-%m-%d %H:%M:%S" diff --git a/lgsm/config-default/config-lgsm/coduoserver/_default.cfg b/lgsm/config-default/config-lgsm/coduoserver/_default.cfg index 3b922967d..47304668f 100644 --- a/lgsm/config-default/config-lgsm/coduoserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/coduoserver/_default.cfg @@ -171,3 +171,7 @@ postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" ## Logs Naming lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" + +## Log Parameters +logtimestamp="off" +logtimestampformat="%Y-%m-%d %H:%M:%S" diff --git a/lgsm/config-default/config-lgsm/codwawserver/_default.cfg b/lgsm/config-default/config-lgsm/codwawserver/_default.cfg index 58dec3f7a..bd0ed995a 100644 --- a/lgsm/config-default/config-lgsm/codwawserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/codwawserver/_default.cfg @@ -171,3 +171,7 @@ postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" ## Logs Naming lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" + +## Log Parameters +logtimestamp="off" +logtimestampformat="%Y-%m-%d %H:%M:%S" diff --git a/lgsm/config-default/config-lgsm/colserver/_default.cfg b/lgsm/config-default/config-lgsm/colserver/_default.cfg index 450b76765..a1cffc5c9 100644 --- a/lgsm/config-default/config-lgsm/colserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/colserver/_default.cfg @@ -181,3 +181,7 @@ postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" gamelogdate="${gamelogdir}/${selfname}-game-$(date '+%Y-%m-%d-%H:%M:%S').log" lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" + +## Log Parameters +logtimestamp="off" +logtimestampformat="%Y-%m-%d %H:%M:%S" diff --git a/lgsm/config-default/config-lgsm/csczserver/_default.cfg b/lgsm/config-default/config-lgsm/csczserver/_default.cfg index 61767765b..7104cf096 100644 --- a/lgsm/config-default/config-lgsm/csczserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/csczserver/_default.cfg @@ -186,3 +186,7 @@ postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" ## Logs Naming lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" + +## Log Parameters +logtimestamp="off" +logtimestampformat="%Y-%m-%d %H:%M:%S" diff --git a/lgsm/config-default/config-lgsm/csgoserver/_default.cfg b/lgsm/config-default/config-lgsm/csgoserver/_default.cfg index 30ba7b8c5..dd83b4996 100644 --- a/lgsm/config-default/config-lgsm/csgoserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/csgoserver/_default.cfg @@ -222,3 +222,7 @@ postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" ## Logs Naming lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" + +## Log Parameters +logtimestamp="off" +logtimestampformat="%Y-%m-%d %H:%M:%S" diff --git a/lgsm/config-default/config-lgsm/csserver/_default.cfg b/lgsm/config-default/config-lgsm/csserver/_default.cfg index 83a6101da..a1f47e974 100644 --- a/lgsm/config-default/config-lgsm/csserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/csserver/_default.cfg @@ -186,3 +186,7 @@ postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" ## Logs Naming lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" + +## Log Parameters +logtimestamp="off" +logtimestampformat="%Y-%m-%d %H:%M:%S" diff --git a/lgsm/config-default/config-lgsm/cssserver/_default.cfg b/lgsm/config-default/config-lgsm/cssserver/_default.cfg index e06da982c..b84ed1d3c 100644 --- a/lgsm/config-default/config-lgsm/cssserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/cssserver/_default.cfg @@ -191,3 +191,7 @@ postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" ## Logs Naming lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" + +## Log Parameters +logtimestamp="off" +logtimestampformat="%Y-%m-%d %H:%M:%S" diff --git a/lgsm/config-default/config-lgsm/dabserver/_default.cfg b/lgsm/config-default/config-lgsm/dabserver/_default.cfg index 377ab85ff..450c2e7e0 100644 --- a/lgsm/config-default/config-lgsm/dabserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/dabserver/_default.cfg @@ -186,3 +186,7 @@ postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" ## Logs Naming lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" + +## Log Parameters +logtimestamp="off" +logtimestampformat="%Y-%m-%d %H:%M:%S" diff --git a/lgsm/config-default/config-lgsm/dayzserver/_default.cfg b/lgsm/config-default/config-lgsm/dayzserver/_default.cfg index 45042cf07..d6d63d2b1 100644 --- a/lgsm/config-default/config-lgsm/dayzserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/dayzserver/_default.cfg @@ -200,3 +200,7 @@ postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" ## Logs Naming lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" + +## Log Parameters +logtimestamp="off" +logtimestampformat="%Y-%m-%d %H:%M:%S" diff --git a/lgsm/config-default/config-lgsm/dmcserver/_default.cfg b/lgsm/config-default/config-lgsm/dmcserver/_default.cfg index b8d7d382c..8e734fe96 100644 --- a/lgsm/config-default/config-lgsm/dmcserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/dmcserver/_default.cfg @@ -186,3 +186,7 @@ postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" ## Logs Naming lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" + +## Log Parameters +logtimestamp="off" +logtimestampformat="%Y-%m-%d %H:%M:%S" diff --git a/lgsm/config-default/config-lgsm/dodrserver/_default.cfg b/lgsm/config-default/config-lgsm/dodrserver/_default.cfg index 41d55374b..b176fc637 100644 --- a/lgsm/config-default/config-lgsm/dodrserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/dodrserver/_default.cfg @@ -184,3 +184,7 @@ postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" ## Logs Naming lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" + +## Log Parameters +logtimestamp="off" +logtimestampformat="%Y-%m-%d %H:%M:%S" diff --git a/lgsm/config-default/config-lgsm/dodserver/_default.cfg b/lgsm/config-default/config-lgsm/dodserver/_default.cfg index 12076ed80..45e6b8449 100644 --- a/lgsm/config-default/config-lgsm/dodserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/dodserver/_default.cfg @@ -186,3 +186,7 @@ postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" ## Logs Naming lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" + +## Log Parameters +logtimestamp="off" +logtimestampformat="%Y-%m-%d %H:%M:%S" diff --git a/lgsm/config-default/config-lgsm/dodsserver/_default.cfg b/lgsm/config-default/config-lgsm/dodsserver/_default.cfg index b938891db..83be0acb8 100644 --- a/lgsm/config-default/config-lgsm/dodsserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/dodsserver/_default.cfg @@ -186,3 +186,7 @@ postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" ## Logs Naming lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" + +## Log Parameters +logtimestamp="off" +logtimestampformat="%Y-%m-%d %H:%M:%S" diff --git a/lgsm/config-default/config-lgsm/doiserver/_default.cfg b/lgsm/config-default/config-lgsm/doiserver/_default.cfg index f1eac4968..2a1ce62bc 100644 --- a/lgsm/config-default/config-lgsm/doiserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/doiserver/_default.cfg @@ -187,3 +187,7 @@ postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" ## Logs Naming lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" + +## Log Parameters +logtimestamp="off" +logtimestampformat="%Y-%m-%d %H:%M:%S" diff --git a/lgsm/config-default/config-lgsm/dstserver/_default.cfg b/lgsm/config-default/config-lgsm/dstserver/_default.cfg index fa6c79315..b5b2f50c9 100644 --- a/lgsm/config-default/config-lgsm/dstserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/dstserver/_default.cfg @@ -193,3 +193,7 @@ postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" ## Logs Naming lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" + +## Log Parameters +logtimestamp="off" +logtimestampformat="%Y-%m-%d %H:%M:%S" diff --git a/lgsm/config-default/config-lgsm/dysserver/_default.cfg b/lgsm/config-default/config-lgsm/dysserver/_default.cfg index 8ac508ca9..f567dab6e 100644 --- a/lgsm/config-default/config-lgsm/dysserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/dysserver/_default.cfg @@ -191,3 +191,7 @@ postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" ## Logs Naming lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" + +## Log Parameters +logtimestamp="off" +logtimestampformat="%Y-%m-%d %H:%M:%S" diff --git a/lgsm/config-default/config-lgsm/ecoserver/_default.cfg b/lgsm/config-default/config-lgsm/ecoserver/_default.cfg index db4669132..174ef357c 100644 --- a/lgsm/config-default/config-lgsm/ecoserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/ecoserver/_default.cfg @@ -179,3 +179,7 @@ postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" gamelogdate="${gamelogdir}/${selfname}-game-$(date '+%Y-%m-%d-%H:%M:%S').log" + +## Log Parameters +logtimestamp="off" +logtimestampformat="%Y-%m-%d %H:%M:%S" diff --git a/lgsm/config-default/config-lgsm/emserver/_default.cfg b/lgsm/config-default/config-lgsm/emserver/_default.cfg index 16db942a4..8181f7f1e 100644 --- a/lgsm/config-default/config-lgsm/emserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/emserver/_default.cfg @@ -191,3 +191,7 @@ postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" ## Logs Naming lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" + +## Log Parameters +logtimestamp="off" +logtimestampformat="%Y-%m-%d %H:%M:%S" diff --git a/lgsm/config-default/config-lgsm/etlserver/_default.cfg b/lgsm/config-default/config-lgsm/etlserver/_default.cfg index 488fe649a..e36ab3581 100644 --- a/lgsm/config-default/config-lgsm/etlserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/etlserver/_default.cfg @@ -165,3 +165,7 @@ postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" ## Logs Naming lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" + +## Log Parameters +logtimestamp="off" +logtimestampformat="%Y-%m-%d %H:%M:%S" diff --git a/lgsm/config-default/config-lgsm/ets2server/_default.cfg b/lgsm/config-default/config-lgsm/ets2server/_default.cfg index 2d0176133..4edca5194 100644 --- a/lgsm/config-default/config-lgsm/ets2server/_default.cfg +++ b/lgsm/config-default/config-lgsm/ets2server/_default.cfg @@ -177,3 +177,7 @@ postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" ## Logs Naming lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" + +## Log Parameters +logtimestamp="off" +logtimestampformat="%Y-%m-%d %H:%M:%S" diff --git a/lgsm/config-default/config-lgsm/fctrserver/_default.cfg b/lgsm/config-default/config-lgsm/fctrserver/_default.cfg index 9f010510e..c58ee2789 100644 --- a/lgsm/config-default/config-lgsm/fctrserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/fctrserver/_default.cfg @@ -176,3 +176,7 @@ postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" ## Logs Naming lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" + +## Log Parameters +logtimestamp="off" +logtimestampformat="%Y-%m-%d %H:%M:%S" diff --git a/lgsm/config-default/config-lgsm/fofserver/_default.cfg b/lgsm/config-default/config-lgsm/fofserver/_default.cfg index 3c2adf8af..623900384 100644 --- a/lgsm/config-default/config-lgsm/fofserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/fofserver/_default.cfg @@ -186,3 +186,7 @@ postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" ## Logs Naming lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" + +## Log Parameters +logtimestamp="off" +logtimestampformat="%Y-%m-%d %H:%M:%S" diff --git a/lgsm/config-default/config-lgsm/gmodserver/_default.cfg b/lgsm/config-default/config-lgsm/gmodserver/_default.cfg index 1f569df9c..aad52e802 100644 --- a/lgsm/config-default/config-lgsm/gmodserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/gmodserver/_default.cfg @@ -199,3 +199,7 @@ postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" ## Logs Naming lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" + +## Log Parameters +logtimestamp="off" +logtimestampformat="%Y-%m-%d %H:%M:%S" diff --git a/lgsm/config-default/config-lgsm/hl2dmserver/_default.cfg b/lgsm/config-default/config-lgsm/hl2dmserver/_default.cfg index 3b2b69a58..4763fc423 100644 --- a/lgsm/config-default/config-lgsm/hl2dmserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/hl2dmserver/_default.cfg @@ -186,3 +186,7 @@ postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" ## Logs Naming lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" + +## Log Parameters +logtimestamp="off" +logtimestampformat="%Y-%m-%d %H:%M:%S" diff --git a/lgsm/config-default/config-lgsm/hldmserver/_default.cfg b/lgsm/config-default/config-lgsm/hldmserver/_default.cfg index f595afc2a..f8d3887ae 100644 --- a/lgsm/config-default/config-lgsm/hldmserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/hldmserver/_default.cfg @@ -185,3 +185,7 @@ postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" ## Logs Naming lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" + +## Log Parameters +logtimestamp="off" +logtimestampformat="%Y-%m-%d %H:%M:%S" diff --git a/lgsm/config-default/config-lgsm/hldmsserver/_default.cfg b/lgsm/config-default/config-lgsm/hldmsserver/_default.cfg index 59aada076..2e4f061e4 100644 --- a/lgsm/config-default/config-lgsm/hldmsserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/hldmsserver/_default.cfg @@ -186,3 +186,7 @@ postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" ## Logs Naming lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" + +## Log Parameters +logtimestamp="off" +logtimestampformat="%Y-%m-%d %H:%M:%S" diff --git a/lgsm/config-default/config-lgsm/hwserver/_default.cfg b/lgsm/config-default/config-lgsm/hwserver/_default.cfg index 1d54b8eb2..6f156f9d9 100644 --- a/lgsm/config-default/config-lgsm/hwserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/hwserver/_default.cfg @@ -14,7 +14,7 @@ ip="0.0.0.0" port="12871" queryport="12881" maxplayers="20" -defaultmap="" # Optional +defaultmap="" # Optional creativemode="0" # Free Build: creativemode="1" gamelog="gamelog.txt" @@ -195,3 +195,7 @@ postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" gamelogdate="${gamelogdir}/${selfname}-game-$(date '+%Y-%m-%d-%H:%M:%S').log" lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" + +## Log Parameters +logtimestamp="off" +logtimestampformat="%Y-%m-%d %H:%M:%S" diff --git a/lgsm/config-default/config-lgsm/insserver/_default.cfg b/lgsm/config-default/config-lgsm/insserver/_default.cfg index c7adf3e65..d6d65d863 100644 --- a/lgsm/config-default/config-lgsm/insserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/insserver/_default.cfg @@ -192,3 +192,7 @@ postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" ## Logs Naming lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" + +## Log Parameters +logtimestamp="off" +logtimestampformat="%Y-%m-%d %H:%M:%S" diff --git a/lgsm/config-default/config-lgsm/inssserver/_default.cfg b/lgsm/config-default/config-lgsm/inssserver/_default.cfg index 66678d284..5317f6be9 100644 --- a/lgsm/config-default/config-lgsm/inssserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/inssserver/_default.cfg @@ -190,3 +190,7 @@ postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" ## Logs Naming lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" + +## Log Parameters +logtimestamp="off" +logtimestampformat="%Y-%m-%d %H:%M:%S" diff --git a/lgsm/config-default/config-lgsm/iosserver/_default.cfg b/lgsm/config-default/config-lgsm/iosserver/_default.cfg index c81bc4002..d587e3719 100644 --- a/lgsm/config-default/config-lgsm/iosserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/iosserver/_default.cfg @@ -186,3 +186,7 @@ postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" ## Logs Naming lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" + +## Log Parameters +logtimestamp="off" +logtimestampformat="%Y-%m-%d %H:%M:%S" diff --git a/lgsm/config-default/config-lgsm/jc2server/_default.cfg b/lgsm/config-default/config-lgsm/jc2server/_default.cfg index 01043a35e..6c36a7f69 100644 --- a/lgsm/config-default/config-lgsm/jc2server/_default.cfg +++ b/lgsm/config-default/config-lgsm/jc2server/_default.cfg @@ -178,3 +178,7 @@ postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" ## Logs Naming lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" + +## Log Parameters +logtimestamp="off" +logtimestampformat="%Y-%m-%d %H:%M:%S" diff --git a/lgsm/config-default/config-lgsm/jc3server/_default.cfg b/lgsm/config-default/config-lgsm/jc3server/_default.cfg index a1aacafb5..fd049f80d 100644 --- a/lgsm/config-default/config-lgsm/jc3server/_default.cfg +++ b/lgsm/config-default/config-lgsm/jc3server/_default.cfg @@ -177,3 +177,7 @@ postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" ## Logs Naming lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" + +## Log Parameters +logtimestamp="off" +logtimestampformat="%Y-%m-%d %H:%M:%S" diff --git a/lgsm/config-default/config-lgsm/jk2server/_default.cfg b/lgsm/config-default/config-lgsm/jk2server/_default.cfg index 700ba8fbb..0675729e4 100644 --- a/lgsm/config-default/config-lgsm/jk2server/_default.cfg +++ b/lgsm/config-default/config-lgsm/jk2server/_default.cfg @@ -187,3 +187,7 @@ postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" ## Logs Naming lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" + +## Log Parameters +logtimestamp="off" +logtimestampformat="%Y-%m-%d %H:%M:%S" diff --git a/lgsm/config-default/config-lgsm/kf2server/_default.cfg b/lgsm/config-default/config-lgsm/kf2server/_default.cfg index a60bbd1a2..a8c3c72bf 100644 --- a/lgsm/config-default/config-lgsm/kf2server/_default.cfg +++ b/lgsm/config-default/config-lgsm/kf2server/_default.cfg @@ -184,3 +184,7 @@ postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" ## Logs Naming lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" + +## Log Parameters +logtimestamp="off" +logtimestampformat="%Y-%m-%d %H:%M:%S" diff --git a/lgsm/config-default/config-lgsm/kfserver/_default.cfg b/lgsm/config-default/config-lgsm/kfserver/_default.cfg index 74ffea9af..71b1a178b 100644 --- a/lgsm/config-default/config-lgsm/kfserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/kfserver/_default.cfg @@ -194,3 +194,7 @@ postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" gamelogdate="${gamelogdir}/${selfname}-game-$(date '+%Y-%m-%d-%H:%M:%S').log" + +## Log Parameters +logtimestamp="off" +logtimestampformat="%Y-%m-%d %H:%M:%S" diff --git a/lgsm/config-default/config-lgsm/l4d2server/_default.cfg b/lgsm/config-default/config-lgsm/l4d2server/_default.cfg index 4fb938983..3ef547c22 100644 --- a/lgsm/config-default/config-lgsm/l4d2server/_default.cfg +++ b/lgsm/config-default/config-lgsm/l4d2server/_default.cfg @@ -185,3 +185,7 @@ postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" ## Logs Naming lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" + +## Log Parameters +logtimestamp="off" +logtimestampformat="%Y-%m-%d %H:%M:%S" diff --git a/lgsm/config-default/config-lgsm/l4dserver/_default.cfg b/lgsm/config-default/config-lgsm/l4dserver/_default.cfg index 838a65efb..c0cbd2452 100644 --- a/lgsm/config-default/config-lgsm/l4dserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/l4dserver/_default.cfg @@ -185,3 +185,7 @@ postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" ## Logs Naming lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" + +## Log Parameters +logtimestamp="off" +logtimestampformat="%Y-%m-%d %H:%M:%S" diff --git a/lgsm/config-default/config-lgsm/loserver/_default.cfg b/lgsm/config-default/config-lgsm/loserver/_default.cfg index 15ebddde5..d4056faf9 100644 --- a/lgsm/config-default/config-lgsm/loserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/loserver/_default.cfg @@ -189,3 +189,7 @@ postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" ## Logs Naming lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" + +## Log Parameters +logtimestamp="off" +logtimestampformat="%Y-%m-%d %H:%M:%S" diff --git a/lgsm/config-default/config-lgsm/mcbserver/_default.cfg b/lgsm/config-default/config-lgsm/mcbserver/_default.cfg index bc64ee883..f8fddf0c0 100644 --- a/lgsm/config-default/config-lgsm/mcbserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/mcbserver/_default.cfg @@ -171,3 +171,7 @@ postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" ## Logs Naming lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" + +## Log Parameters +logtimestamp="off" +logtimestampformat="%Y-%m-%d %H:%M:%S" diff --git a/lgsm/config-default/config-lgsm/mcserver/_default.cfg b/lgsm/config-default/config-lgsm/mcserver/_default.cfg index fd7b8a71e..c12265f9f 100644 --- a/lgsm/config-default/config-lgsm/mcserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/mcserver/_default.cfg @@ -178,3 +178,7 @@ postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" ## Logs Naming lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" + +## Log Parameters +logtimestamp="off" +logtimestampformat="%Y-%m-%d %H:%M:%S" diff --git a/lgsm/config-default/config-lgsm/mhserver/_default.cfg b/lgsm/config-default/config-lgsm/mhserver/_default.cfg index 81ab22a95..1011e8768 100644 --- a/lgsm/config-default/config-lgsm/mhserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/mhserver/_default.cfg @@ -186,3 +186,7 @@ postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" ## Logs Naming lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" + +## Log Parameters +logtimestamp="off" +logtimestampformat="%Y-%m-%d %H:%M:%S" diff --git a/lgsm/config-default/config-lgsm/mohaaserver/_default.cfg b/lgsm/config-default/config-lgsm/mohaaserver/_default.cfg index a9f5fc840..0077221f4 100644 --- a/lgsm/config-default/config-lgsm/mohaaserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/mohaaserver/_default.cfg @@ -170,3 +170,7 @@ postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" ## Logs Naming lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" + +## Log Parameters +logtimestamp="off" +logtimestampformat="%Y-%m-%d %H:%M:%S" diff --git a/lgsm/config-default/config-lgsm/momserver/_default.cfg b/lgsm/config-default/config-lgsm/momserver/_default.cfg index a19d077fe..6ebc106b9 100644 --- a/lgsm/config-default/config-lgsm/momserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/momserver/_default.cfg @@ -184,3 +184,7 @@ postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" ## Logs Naming lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" + +## Log Parameters +logtimestamp="off" +logtimestampformat="%Y-%m-%d %H:%M:%S" diff --git a/lgsm/config-default/config-lgsm/mtaserver/_default.cfg b/lgsm/config-default/config-lgsm/mtaserver/_default.cfg index ac7d4e939..c001c7bf1 100644 --- a/lgsm/config-default/config-lgsm/mtaserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/mtaserver/_default.cfg @@ -170,3 +170,7 @@ postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" ## Logs Naming lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" + +## Log Parameters +logtimestamp="off" +logtimestampformat="%Y-%m-%d %H:%M:%S" diff --git a/lgsm/config-default/config-lgsm/ndserver/_default.cfg b/lgsm/config-default/config-lgsm/ndserver/_default.cfg index 9653eb52b..935659c83 100644 --- a/lgsm/config-default/config-lgsm/ndserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/ndserver/_default.cfg @@ -186,3 +186,7 @@ postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" ## Logs Naming lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" + +## Log Parameters +logtimestamp="off" +logtimestampformat="%Y-%m-%d %H:%M:%S" diff --git a/lgsm/config-default/config-lgsm/necserver/_default.cfg b/lgsm/config-default/config-lgsm/necserver/_default.cfg index af49cb3e2..5d3b4d887 100644 --- a/lgsm/config-default/config-lgsm/necserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/necserver/_default.cfg @@ -180,3 +180,7 @@ postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" ## Logs Naming lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" + +## Log Parameters +logtimestamp="off" +logtimestampformat="%Y-%m-%d %H:%M:%S" diff --git a/lgsm/config-default/config-lgsm/nmrihserver/_default.cfg b/lgsm/config-default/config-lgsm/nmrihserver/_default.cfg index 5f412cd4d..241e535f4 100644 --- a/lgsm/config-default/config-lgsm/nmrihserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/nmrihserver/_default.cfg @@ -191,3 +191,7 @@ postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" ## Logs Naming lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" + +## Log Parameters +logtimestamp="off" +logtimestampformat="%Y-%m-%d %H:%M:%S" diff --git a/lgsm/config-default/config-lgsm/ns2cserver/_default.cfg b/lgsm/config-default/config-lgsm/ns2cserver/_default.cfg index 73cf810f1..bc3e20cd1 100644 --- a/lgsm/config-default/config-lgsm/ns2cserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/ns2cserver/_default.cfg @@ -191,3 +191,7 @@ postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" ## Logs Naming lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" + +## Log Parameters +logtimestamp="off" +logtimestampformat="%Y-%m-%d %H:%M:%S" diff --git a/lgsm/config-default/config-lgsm/ns2server/_default.cfg b/lgsm/config-default/config-lgsm/ns2server/_default.cfg index 83dfd991b..d3fa2ad13 100644 --- a/lgsm/config-default/config-lgsm/ns2server/_default.cfg +++ b/lgsm/config-default/config-lgsm/ns2server/_default.cfg @@ -191,3 +191,7 @@ postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" ## Logs Naming lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" + +## Log Parameters +logtimestamp="off" +logtimestampformat="%Y-%m-%d %H:%M:%S" diff --git a/lgsm/config-default/config-lgsm/nsserver/_default.cfg b/lgsm/config-default/config-lgsm/nsserver/_default.cfg index 4292b1f2a..5a63b2edf 100644 --- a/lgsm/config-default/config-lgsm/nsserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/nsserver/_default.cfg @@ -186,3 +186,7 @@ postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" ## Logs Naming lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" + +## Log Parameters +logtimestamp="off" +logtimestampformat="%Y-%m-%d %H:%M:%S" diff --git a/lgsm/config-default/config-lgsm/onsetserver/_default.cfg b/lgsm/config-default/config-lgsm/onsetserver/_default.cfg index 172953609..2c270bfc5 100644 --- a/lgsm/config-default/config-lgsm/onsetserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/onsetserver/_default.cfg @@ -178,3 +178,7 @@ postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" ## Logs Naming lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" + +## Log Parameters +logtimestamp="off" +logtimestampformat="%Y-%m-%d %H:%M:%S" diff --git a/lgsm/config-default/config-lgsm/opforserver/_default.cfg b/lgsm/config-default/config-lgsm/opforserver/_default.cfg index d10367f63..691c69b3a 100644 --- a/lgsm/config-default/config-lgsm/opforserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/opforserver/_default.cfg @@ -186,3 +186,7 @@ postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" ## Logs Naming lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" + +## Log Parameters +logtimestamp="off" +logtimestampformat="%Y-%m-%d %H:%M:%S" diff --git a/lgsm/config-default/config-lgsm/pc2server/_default.cfg b/lgsm/config-default/config-lgsm/pc2server/_default.cfg index e43f150fd..72f87b4f0 100644 --- a/lgsm/config-default/config-lgsm/pc2server/_default.cfg +++ b/lgsm/config-default/config-lgsm/pc2server/_default.cfg @@ -182,3 +182,7 @@ postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" ## Logs Naming lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" + +## Log Parameters +logtimestamp="off" +logtimestampformat="%Y-%m-%d %H:%M:%S" diff --git a/lgsm/config-default/config-lgsm/pcserver/_default.cfg b/lgsm/config-default/config-lgsm/pcserver/_default.cfg index cb82ffca5..af31b615b 100644 --- a/lgsm/config-default/config-lgsm/pcserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/pcserver/_default.cfg @@ -178,3 +178,7 @@ postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" ## Logs Naming lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" + +## Log Parameters +logtimestamp="off" +logtimestampformat="%Y-%m-%d %H:%M:%S" diff --git a/lgsm/config-default/config-lgsm/pmcserver/_default.cfg b/lgsm/config-default/config-lgsm/pmcserver/_default.cfg index 704d63ff3..e8f69161e 100644 --- a/lgsm/config-default/config-lgsm/pmcserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/pmcserver/_default.cfg @@ -176,3 +176,7 @@ postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" ## Logs Naming lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" + +## Log Parameters +logtimestamp="off" +logtimestampformat="%Y-%m-%d %H:%M:%S" diff --git a/lgsm/config-default/config-lgsm/pstbsserver/_default.cfg b/lgsm/config-default/config-lgsm/pstbsserver/_default.cfg index 69501dbf3..f1ccede86 100644 --- a/lgsm/config-default/config-lgsm/pstbsserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/pstbsserver/_default.cfg @@ -188,3 +188,7 @@ postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" ## Logs Naming lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" + +## Log Parameters +logtimestamp="off" +logtimestampformat="%Y-%m-%d %H:%M:%S" diff --git a/lgsm/config-default/config-lgsm/pvkiiserver/_default.cfg b/lgsm/config-default/config-lgsm/pvkiiserver/_default.cfg index 1689af811..6cb271de0 100644 --- a/lgsm/config-default/config-lgsm/pvkiiserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/pvkiiserver/_default.cfg @@ -186,3 +186,7 @@ postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" ## Logs Naming lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" + +## Log Parameters +logtimestamp="off" +logtimestampformat="%Y-%m-%d %H:%M:%S" diff --git a/lgsm/config-default/config-lgsm/pvrserver/_default.cfg b/lgsm/config-default/config-lgsm/pvrserver/_default.cfg index 45a2b8fbd..8d27cf08c 100644 --- a/lgsm/config-default/config-lgsm/pvrserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/pvrserver/_default.cfg @@ -185,3 +185,7 @@ postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" ## Logs Naming lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" + +## Log Parameters +logtimestamp="off" +logtimestampformat="%Y-%m-%d %H:%M:%S" diff --git a/lgsm/config-default/config-lgsm/pzserver/_default.cfg b/lgsm/config-default/config-lgsm/pzserver/_default.cfg index 2d284187f..399c43f0f 100644 --- a/lgsm/config-default/config-lgsm/pzserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/pzserver/_default.cfg @@ -182,3 +182,7 @@ postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" ## Logs Naming lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" + +## Log Parameters +logtimestamp="off" +logtimestampformat="%Y-%m-%d %H:%M:%S" diff --git a/lgsm/config-default/config-lgsm/q2server/_default.cfg b/lgsm/config-default/config-lgsm/q2server/_default.cfg index ea1061a70..526e27854 100644 --- a/lgsm/config-default/config-lgsm/q2server/_default.cfg +++ b/lgsm/config-default/config-lgsm/q2server/_default.cfg @@ -170,3 +170,7 @@ postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" ## Logs Naming lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" + +## Log Parameters +logtimestamp="off" +logtimestampformat="%Y-%m-%d %H:%M:%S" diff --git a/lgsm/config-default/config-lgsm/q3server/_default.cfg b/lgsm/config-default/config-lgsm/q3server/_default.cfg index 5621dec15..d8fda33d7 100644 --- a/lgsm/config-default/config-lgsm/q3server/_default.cfg +++ b/lgsm/config-default/config-lgsm/q3server/_default.cfg @@ -170,3 +170,7 @@ postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" ## Logs Naming lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" + +## Log Parameters +logtimestamp="off" +logtimestampformat="%Y-%m-%d %H:%M:%S" diff --git a/lgsm/config-default/config-lgsm/qlserver/_default.cfg b/lgsm/config-default/config-lgsm/qlserver/_default.cfg index c2c0d0f24..5b1444ed9 100644 --- a/lgsm/config-default/config-lgsm/qlserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/qlserver/_default.cfg @@ -179,3 +179,7 @@ postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" ## Logs Naming lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" + +## Log Parameters +logtimestamp="off" +logtimestampformat="%Y-%m-%d %H:%M:%S" diff --git a/lgsm/config-default/config-lgsm/qwserver/_default.cfg b/lgsm/config-default/config-lgsm/qwserver/_default.cfg index 9435b2199..1e9482c8c 100644 --- a/lgsm/config-default/config-lgsm/qwserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/qwserver/_default.cfg @@ -169,3 +169,7 @@ postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" ## Logs Naming lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" + +## Log Parameters +logtimestamp="off" +logtimestampformat="%Y-%m-%d %H:%M:%S" diff --git a/lgsm/config-default/config-lgsm/ricochetserver/_default.cfg b/lgsm/config-default/config-lgsm/ricochetserver/_default.cfg index d36a4c1f2..231ab423a 100644 --- a/lgsm/config-default/config-lgsm/ricochetserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/ricochetserver/_default.cfg @@ -186,3 +186,7 @@ postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" ## Logs Naming lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" + +## Log Parameters +logtimestamp="off" +logtimestampformat="%Y-%m-%d %H:%M:%S" diff --git a/lgsm/config-default/config-lgsm/roserver/_default.cfg b/lgsm/config-default/config-lgsm/roserver/_default.cfg index 58e3f4fe9..9ff217a8b 100644 --- a/lgsm/config-default/config-lgsm/roserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/roserver/_default.cfg @@ -190,3 +190,7 @@ postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" gamelogdate="${gamelogdir}/${selfname}-game-$(date '+%Y-%m-%d-%H:%M:%S').log" + +## Log Parameters +logtimestamp="off" +logtimestampformat="%Y-%m-%d %H:%M:%S" diff --git a/lgsm/config-default/config-lgsm/rtcwserver/_default.cfg b/lgsm/config-default/config-lgsm/rtcwserver/_default.cfg index 847c8a1dd..3c134592a 100644 --- a/lgsm/config-default/config-lgsm/rtcwserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/rtcwserver/_default.cfg @@ -170,3 +170,7 @@ postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" ## Logs Naming lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" + +## Log Parameters +logtimestamp="off" +logtimestampformat="%Y-%m-%d %H:%M:%S" diff --git a/lgsm/config-default/config-lgsm/rustserver/_default.cfg b/lgsm/config-default/config-lgsm/rustserver/_default.cfg index d43a15152..acda7f6e4 100644 --- a/lgsm/config-default/config-lgsm/rustserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/rustserver/_default.cfg @@ -17,15 +17,15 @@ queryport=28017 rconpassword="CHANGE_ME" rconweb="1" # Value is: 1 for the Facepunch web panel, Rustadmin desktop and Rustadmin Online; 0 for RCON tools like Rusty. servername="Rust" -gamemode="vanilla" # Values: vanilla, softcore ( Doc: https://wiki.facepunch.com/rust/server-gamemodes ) +gamemode="vanilla" # Values: vanilla, softcore ( Doc: https://wiki.facepunch.com/rust/server-gamemodes ) serverlevel="Procedural Map" # Values: Procedural Map, Barren, HapisIsland, SavasIsland -customlevelurl="" # Custom level url. +server.levelurl \"${customlevelurl}\" -seed="" # range: 1-2147483647, used to reproduce a procedural map. -salt="" # range: unknown, used to recover a known setting from an existing map. +customlevelurl="" # Custom level url. +server.levelurl \"${customlevelurl}\" +seed="" # range: 1-2147483647, used to reproduce a procedural map. +salt="" # range: unknown, used to recover a known setting from an existing map. maxplayers="50" -worldsize="3000" # default: 3000, range: 1000-6000, map size in meters. +worldsize="3000" # default: 3000, range: 1000-6000, map size in meters. saveinterval="300" # Auto-save in seconds. -tickrate="30" # default: 30, range: 15-100. +tickrate="30" # default: 30, range: 15-100. ## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters startparameters="-batchmode +app.listenip ${ip} +app.port ${appport} +server.ip ${ip} +server.port ${port} +server.queryport ${queryport} +server.tickrate ${tickrate} +server.hostname \"${servername}\" +server.identity \"${selfname}\" +server.gamemode ${gamemode} +server.level \"${serverlevel}\" +server.seed ${seed} +server.salt ${salt} +server.maxplayers ${maxplayers} +server.worldsize ${worldsize} +server.saveinterval ${saveinterval} +rcon.web ${rconweb} +rcon.ip ${ip} +rcon.port ${rconport} +rcon.password \"${rconpassword}\" -logfile" @@ -199,3 +199,7 @@ postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" gamelogdate="${gamelogdir}/${selfname}-game-$(date '+%Y-%m-%d-%H:%M:%S').log" + +## Log Parameters +logtimestamp="off" +logtimestampformat="%Y-%m-%d %H:%M:%S" diff --git a/lgsm/config-default/config-lgsm/rwserver/_default.cfg b/lgsm/config-default/config-lgsm/rwserver/_default.cfg index f1c09e189..a31449a05 100644 --- a/lgsm/config-default/config-lgsm/rwserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/rwserver/_default.cfg @@ -182,3 +182,7 @@ postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" ## Logs Naming lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" + +## Log Parameters +logtimestamp="off" +logtimestampformat="%Y-%m-%d %H:%M:%S" diff --git a/lgsm/config-default/config-lgsm/sampserver/_default.cfg b/lgsm/config-default/config-lgsm/sampserver/_default.cfg index 6883fe589..eecc9cce2 100644 --- a/lgsm/config-default/config-lgsm/sampserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/sampserver/_default.cfg @@ -169,3 +169,7 @@ postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" ## Logs Naming lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" + +## Log Parameters +logtimestamp="off" +logtimestampformat="%Y-%m-%d %H:%M:%S" diff --git a/lgsm/config-default/config-lgsm/sbotsserver/_default.cfg b/lgsm/config-default/config-lgsm/sbotsserver/_default.cfg index 6805d6395..899842b08 100644 --- a/lgsm/config-default/config-lgsm/sbotsserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/sbotsserver/_default.cfg @@ -14,7 +14,7 @@ queryport="27015" defaultmap="StationKappa" servername="LinuxGSM Server" serverpassword="NOT SET" # Can't be adjusted currently -maxplayers="8" # Can't be adjusted currently +maxplayers="8" # Can't be adjusted currently ## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters startparameters="Port=${port}?QueryPort=${queryport} -startup_map ${defaultmap} -server_name \"${servername}\"" @@ -186,3 +186,7 @@ postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" ## Logs Naming lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" + +## Log Parameters +logtimestamp="off" +logtimestampformat="%Y-%m-%d %H:%M:%S" diff --git a/lgsm/config-default/config-lgsm/sbserver/_default.cfg b/lgsm/config-default/config-lgsm/sbserver/_default.cfg index 13815fbcb..521500591 100644 --- a/lgsm/config-default/config-lgsm/sbserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/sbserver/_default.cfg @@ -185,3 +185,7 @@ postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" ## Logs Naming lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" + +## Log Parameters +logtimestamp="off" +logtimestampformat="%Y-%m-%d %H:%M:%S" diff --git a/lgsm/config-default/config-lgsm/scpslserver/_default.cfg b/lgsm/config-default/config-lgsm/scpslserver/_default.cfg index ac948d864..3409fe994 100644 --- a/lgsm/config-default/config-lgsm/scpslserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/scpslserver/_default.cfg @@ -183,3 +183,7 @@ postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" ## Logs Naming lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" + +## Log Parameters +logtimestamp="off" +logtimestampformat="%Y-%m-%d %H:%M:%S" diff --git a/lgsm/config-default/config-lgsm/scpslsmserver/_default.cfg b/lgsm/config-default/config-lgsm/scpslsmserver/_default.cfg index 285bd0a49..73d0605c6 100644 --- a/lgsm/config-default/config-lgsm/scpslsmserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/scpslsmserver/_default.cfg @@ -183,3 +183,7 @@ postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" ## Logs Naming lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" + +## Log Parameters +logtimestamp="off" +logtimestampformat="%Y-%m-%d %H:%M:%S" diff --git a/lgsm/config-default/config-lgsm/sdtdserver/_default.cfg b/lgsm/config-default/config-lgsm/sdtdserver/_default.cfg index 090309696..270e8f84e 100644 --- a/lgsm/config-default/config-lgsm/sdtdserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/sdtdserver/_default.cfg @@ -183,3 +183,7 @@ postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" ## Logs Naming lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" + +## Log Parameters +logtimestamp="off" +logtimestampformat="%Y-%m-%d %H:%M:%S" diff --git a/lgsm/config-default/config-lgsm/sfcserver/_default.cfg b/lgsm/config-default/config-lgsm/sfcserver/_default.cfg index 5b1071a3b..579790be7 100644 --- a/lgsm/config-default/config-lgsm/sfcserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/sfcserver/_default.cfg @@ -186,3 +186,7 @@ postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" ## Logs Naming lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" + +## Log Parameters +logtimestamp="off" +logtimestampformat="%Y-%m-%d %H:%M:%S" diff --git a/lgsm/config-default/config-lgsm/sfserver/_default.cfg b/lgsm/config-default/config-lgsm/sfserver/_default.cfg index 45ca1151a..dfe3857c0 100644 --- a/lgsm/config-default/config-lgsm/sfserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/sfserver/_default.cfg @@ -184,3 +184,7 @@ postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" ## Logs Naming lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" + +## Log Parameters +logtimestamp="off" +logtimestampformat="%Y-%m-%d %H:%M:%S" diff --git a/lgsm/config-default/config-lgsm/sof2server/_default.cfg b/lgsm/config-default/config-lgsm/sof2server/_default.cfg index 094754914..a0f878e45 100644 --- a/lgsm/config-default/config-lgsm/sof2server/_default.cfg +++ b/lgsm/config-default/config-lgsm/sof2server/_default.cfg @@ -170,3 +170,7 @@ postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" ## Logs Naming lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" + +## Log Parameters +logtimestamp="off" +logtimestampformat="%Y-%m-%d %H:%M:%S" diff --git a/lgsm/config-default/config-lgsm/solserver/_default.cfg b/lgsm/config-default/config-lgsm/solserver/_default.cfg index 820492509..6db45dc53 100644 --- a/lgsm/config-default/config-lgsm/solserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/solserver/_default.cfg @@ -182,3 +182,7 @@ postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" ## Logs Naming lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" + +## Log Parameters +logtimestamp="off" +logtimestampformat="%Y-%m-%d %H:%M:%S" diff --git a/lgsm/config-default/config-lgsm/squadserver/_default.cfg b/lgsm/config-default/config-lgsm/squadserver/_default.cfg index 0a343cfdf..79240e2bf 100644 --- a/lgsm/config-default/config-lgsm/squadserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/squadserver/_default.cfg @@ -184,3 +184,7 @@ postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" ## Logs Naming lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" + +## Log Parameters +logtimestamp="off" +logtimestampformat="%Y-%m-%d %H:%M:%S" diff --git a/lgsm/config-default/config-lgsm/stnserver/_default.cfg b/lgsm/config-default/config-lgsm/stnserver/_default.cfg index 0b9510d4c..d26cef127 100644 --- a/lgsm/config-default/config-lgsm/stnserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/stnserver/_default.cfg @@ -184,3 +184,7 @@ postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" gamelogdate="${gamelogdir}/${selfname}-game-$(date '+%Y-%m-%d-%H:%M:%S').log" lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" + +## Log Parameters +logtimestamp="off" +logtimestampformat="%Y-%m-%d %H:%M:%S" diff --git a/lgsm/config-default/config-lgsm/stserver/_default.cfg b/lgsm/config-default/config-lgsm/stserver/_default.cfg index 26da17f43..834c2d054 100644 --- a/lgsm/config-default/config-lgsm/stserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/stserver/_default.cfg @@ -189,3 +189,7 @@ postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" ## Logs Naming lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" + +## Log Parameters +logtimestamp="off" +logtimestampformat="%Y-%m-%d %H:%M:%S" diff --git a/lgsm/config-default/config-lgsm/svenserver/_default.cfg b/lgsm/config-default/config-lgsm/svenserver/_default.cfg index f8feb47f4..ec164b90b 100644 --- a/lgsm/config-default/config-lgsm/svenserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/svenserver/_default.cfg @@ -185,3 +185,7 @@ postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" ## Logs Naming lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" + +## Log Parameters +logtimestamp="off" +logtimestampformat="%Y-%m-%d %H:%M:%S" diff --git a/lgsm/config-default/config-lgsm/terrariaserver/_default.cfg b/lgsm/config-default/config-lgsm/terrariaserver/_default.cfg index c0aaea6c6..a286b0571 100644 --- a/lgsm/config-default/config-lgsm/terrariaserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/terrariaserver/_default.cfg @@ -185,3 +185,7 @@ postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" ## Logs Naming lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" + +## Log Parameters +logtimestamp="off" +logtimestampformat="%Y-%m-%d %H:%M:%S" diff --git a/lgsm/config-default/config-lgsm/tf2server/_default.cfg b/lgsm/config-default/config-lgsm/tf2server/_default.cfg index 16ab36696..824b6e7e3 100644 --- a/lgsm/config-default/config-lgsm/tf2server/_default.cfg +++ b/lgsm/config-default/config-lgsm/tf2server/_default.cfg @@ -191,3 +191,7 @@ postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" ## Logs Naming lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" + +## Log Parameters +logtimestamp="off" +logtimestampformat="%Y-%m-%d %H:%M:%S" diff --git a/lgsm/config-default/config-lgsm/tfcserver/_default.cfg b/lgsm/config-default/config-lgsm/tfcserver/_default.cfg index 827b32736..968350fd8 100644 --- a/lgsm/config-default/config-lgsm/tfcserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/tfcserver/_default.cfg @@ -186,3 +186,7 @@ postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" ## Logs Naming lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" + +## Log Parameters +logtimestamp="off" +logtimestampformat="%Y-%m-%d %H:%M:%S" diff --git a/lgsm/config-default/config-lgsm/tiserver/_default.cfg b/lgsm/config-default/config-lgsm/tiserver/_default.cfg index 1de6910b5..f31864df3 100644 --- a/lgsm/config-default/config-lgsm/tiserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/tiserver/_default.cfg @@ -185,3 +185,7 @@ postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" ## Logs Naming lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" + +## Log Parameters +logtimestamp="off" +logtimestampformat="%Y-%m-%d %H:%M:%S" diff --git a/lgsm/config-default/config-lgsm/ts3server/_default.cfg b/lgsm/config-default/config-lgsm/ts3server/_default.cfg index f676309d0..963920a6c 100644 --- a/lgsm/config-default/config-lgsm/ts3server/_default.cfg +++ b/lgsm/config-default/config-lgsm/ts3server/_default.cfg @@ -169,3 +169,7 @@ postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" ## Logs Naming lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" + +## Log Parameters +logtimestamp="off" +logtimestampformat="%Y-%m-%d %H:%M:%S" diff --git a/lgsm/config-default/config-lgsm/tsserver/_default.cfg b/lgsm/config-default/config-lgsm/tsserver/_default.cfg index c1c99b24a..1b4ac5bfc 100644 --- a/lgsm/config-default/config-lgsm/tsserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/tsserver/_default.cfg @@ -186,3 +186,7 @@ postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" ## Logs Naming lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" + +## Log Parameters +logtimestamp="off" +logtimestampformat="%Y-%m-%d %H:%M:%S" diff --git a/lgsm/config-default/config-lgsm/tuserver/_default.cfg b/lgsm/config-default/config-lgsm/tuserver/_default.cfg index 5fdfd6447..816310062 100644 --- a/lgsm/config-default/config-lgsm/tuserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/tuserver/_default.cfg @@ -188,3 +188,7 @@ postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" ## Logs Naming lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" + +## Log Parameters +logtimestamp="off" +logtimestampformat="%Y-%m-%d %H:%M:%S" diff --git a/lgsm/config-default/config-lgsm/twserver/_default.cfg b/lgsm/config-default/config-lgsm/twserver/_default.cfg index 791c93da5..8c4b32683 100644 --- a/lgsm/config-default/config-lgsm/twserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/twserver/_default.cfg @@ -186,3 +186,7 @@ postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" ## Logs Naming lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" + +## Log Parameters +logtimestamp="off" +logtimestampformat="%Y-%m-%d %H:%M:%S" diff --git a/lgsm/config-default/config-lgsm/untserver/_default.cfg b/lgsm/config-default/config-lgsm/untserver/_default.cfg index 41d1981e7..c3c5b7e14 100644 --- a/lgsm/config-default/config-lgsm/untserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/untserver/_default.cfg @@ -189,3 +189,7 @@ postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" ## Logs Naming lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" + +## Log Parameters +logtimestamp="off" +logtimestampformat="%Y-%m-%d %H:%M:%S" diff --git a/lgsm/config-default/config-lgsm/ut2k4server/_default.cfg b/lgsm/config-default/config-lgsm/ut2k4server/_default.cfg index b3ca481cd..0df674dc6 100644 --- a/lgsm/config-default/config-lgsm/ut2k4server/_default.cfg +++ b/lgsm/config-default/config-lgsm/ut2k4server/_default.cfg @@ -172,3 +172,7 @@ postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" gamelogdate="${gamelogdir}/${selfname}-game-$(date '+%Y-%m-%d-%H:%M:%S').log" + +## Log Parameters +logtimestamp="off" +logtimestampformat="%Y-%m-%d %H:%M:%S" diff --git a/lgsm/config-default/config-lgsm/ut3server/_default.cfg b/lgsm/config-default/config-lgsm/ut3server/_default.cfg index 49cd6b7d5..87b99bdb8 100644 --- a/lgsm/config-default/config-lgsm/ut3server/_default.cfg +++ b/lgsm/config-default/config-lgsm/ut3server/_default.cfg @@ -187,3 +187,7 @@ postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" gamelogdate="${gamelogdir}/${selfname}-game-$(date '+%Y-%m-%d-%H:%M:%S').log" + +## Log Parameters +logtimestamp="off" +logtimestampformat="%Y-%m-%d %H:%M:%S" diff --git a/lgsm/config-default/config-lgsm/ut99server/_default.cfg b/lgsm/config-default/config-lgsm/ut99server/_default.cfg index 5af870f50..dede89687 100644 --- a/lgsm/config-default/config-lgsm/ut99server/_default.cfg +++ b/lgsm/config-default/config-lgsm/ut99server/_default.cfg @@ -170,3 +170,7 @@ postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" ## Logs Naming lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" + +## Log Parameters +logtimestamp="off" +logtimestampformat="%Y-%m-%d %H:%M:%S" diff --git a/lgsm/config-default/config-lgsm/utserver/_default.cfg b/lgsm/config-default/config-lgsm/utserver/_default.cfg index 6b6603221..392598840 100644 --- a/lgsm/config-default/config-lgsm/utserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/utserver/_default.cfg @@ -173,3 +173,7 @@ postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" ## Logs Naming lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" + +## Log Parameters +logtimestamp="off" +logtimestampformat="%Y-%m-%d %H:%M:%S" diff --git a/lgsm/config-default/config-lgsm/vhserver/_default.cfg b/lgsm/config-default/config-lgsm/vhserver/_default.cfg index 85f13614d..8bb87887b 100644 --- a/lgsm/config-default/config-lgsm/vhserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/vhserver/_default.cfg @@ -192,3 +192,7 @@ postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" ## Logs Naming lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" + +## Log Parameters +logtimestamp="off" +logtimestampformat="%Y-%m-%d %H:%M:%S" diff --git a/lgsm/config-default/config-lgsm/vintsserver/_default.cfg b/lgsm/config-default/config-lgsm/vintsserver/_default.cfg index 7009f02cb..a207ecdb7 100644 --- a/lgsm/config-default/config-lgsm/vintsserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/vintsserver/_default.cfg @@ -173,3 +173,7 @@ postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" ## Logs Naming lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" + +## Log Parameters +logtimestamp="off" +logtimestampformat="%Y-%m-%d %H:%M:%S" diff --git a/lgsm/config-default/config-lgsm/vpmcserver/_default.cfg b/lgsm/config-default/config-lgsm/vpmcserver/_default.cfg index 6755e0e51..20b587f32 100644 --- a/lgsm/config-default/config-lgsm/vpmcserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/vpmcserver/_default.cfg @@ -177,3 +177,7 @@ postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" ## Logs Naming lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" + +## Log Parameters +logtimestamp="off" +logtimestampformat="%Y-%m-%d %H:%M:%S" diff --git a/lgsm/config-default/config-lgsm/vsserver/_default.cfg b/lgsm/config-default/config-lgsm/vsserver/_default.cfg index a441abd01..94510c334 100644 --- a/lgsm/config-default/config-lgsm/vsserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/vsserver/_default.cfg @@ -186,3 +186,7 @@ postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" ## Logs Naming lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" + +## Log Parameters +logtimestamp="off" +logtimestampformat="%Y-%m-%d %H:%M:%S" diff --git a/lgsm/config-default/config-lgsm/wetserver/_default.cfg b/lgsm/config-default/config-lgsm/wetserver/_default.cfg index 012b2df1c..994abb5c0 100644 --- a/lgsm/config-default/config-lgsm/wetserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/wetserver/_default.cfg @@ -165,3 +165,7 @@ postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" ## Logs Naming lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" + +## Log Parameters +logtimestamp="off" +logtimestampformat="%Y-%m-%d %H:%M:%S" diff --git a/lgsm/config-default/config-lgsm/wfserver/_default.cfg b/lgsm/config-default/config-lgsm/wfserver/_default.cfg index eeedf5f18..fc53e641c 100644 --- a/lgsm/config-default/config-lgsm/wfserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/wfserver/_default.cfg @@ -184,3 +184,7 @@ postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" ## Logs Naming lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" + +## Log Parameters +logtimestamp="off" +logtimestampformat="%Y-%m-%d %H:%M:%S" diff --git a/lgsm/config-default/config-lgsm/wmcserver/_default.cfg b/lgsm/config-default/config-lgsm/wmcserver/_default.cfg index 229d7bef5..cdf56e71e 100644 --- a/lgsm/config-default/config-lgsm/wmcserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/wmcserver/_default.cfg @@ -176,3 +176,7 @@ postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" ## Logs Naming lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" + +## Log Parameters +logtimestamp="off" +logtimestampformat="%Y-%m-%d %H:%M:%S" diff --git a/lgsm/config-default/config-lgsm/wurmserver/_default.cfg b/lgsm/config-default/config-lgsm/wurmserver/_default.cfg index a70fa371f..3743e899f 100644 --- a/lgsm/config-default/config-lgsm/wurmserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/wurmserver/_default.cfg @@ -181,3 +181,7 @@ postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" ## Logs Naming lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" + +## Log Parameters +logtimestamp="off" +logtimestampformat="%Y-%m-%d %H:%M:%S" diff --git a/lgsm/config-default/config-lgsm/zmrserver/_default.cfg b/lgsm/config-default/config-lgsm/zmrserver/_default.cfg index 4b87f9172..c2621b48a 100644 --- a/lgsm/config-default/config-lgsm/zmrserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/zmrserver/_default.cfg @@ -186,3 +186,7 @@ postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" ## Logs Naming lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" + +## Log Parameters +logtimestamp="off" +logtimestampformat="%Y-%m-%d %H:%M:%S" diff --git a/lgsm/config-default/config-lgsm/zpsserver/_default.cfg b/lgsm/config-default/config-lgsm/zpsserver/_default.cfg index a5fc616cf..777403dfd 100644 --- a/lgsm/config-default/config-lgsm/zpsserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/zpsserver/_default.cfg @@ -191,3 +191,7 @@ postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" ## Logs Naming lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" + +## Log Parameters +logtimestamp="off" +logtimestampformat="%Y-%m-%d %H:%M:%S" diff --git a/lgsm/functions/command_start.sh b/lgsm/functions/command_start.sh index 4b01984f4..04c6b4e64 100755 --- a/lgsm/functions/command_start.sh +++ b/lgsm/functions/command_start.sh @@ -8,6 +8,7 @@ commandname="START" commandaction="Starting" functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +addtimestamp="gawk '{ print strftime(\\\"[$logtimestampformat]\\\"), \\\$0 }'" fn_firstcommand_set fn_start_teamspeak3() { @@ -92,8 +93,13 @@ fn_start_tmux() { fn_script_log "tmux version: master (user compiled)" echo -e "tmux version: master (user compiled)" >> "${consolelog}" if [ "${consolelogging}" == "on" ] || [ -z "${consolelogging}" ]; then - tmux pipe-pane -o -t "${sessionname}" "exec cat >> '${consolelog}'" + if [ "$logtimestamp" == "on" ]; then + tmux pipe-pane -o -t "${sessionname}" "exec bash -c \"cat | $addtimestamp\" >> '${consolelog}'" + else + tmux pipe-pane -o -t "${sessionname}" "exec cat >> '${consolelog}'" + fi fi + elif [ -n "${tmuxv}" ]; then # tmux pipe-pane not supported in tmux versions < 1.6. if [ "${tmuxvdigit}" -lt "16" ]; then @@ -108,7 +114,11 @@ fn_start_tmux() { Currently installed: $(tmux -V)" > "${consolelog}" # Console logging enable or not set. elif [ "${consolelogging}" == "on" ] || [ -z "${consolelogging}" ]; then - tmux pipe-pane -o -t "${sessionname}" "exec cat >> '${consolelog}'" + if [ "$logtimestamp" == "on" ]; then + tmux pipe-pane -o -t "${sessionname}" "exec bash -c \"cat | $addtimestamp\" >> '${consolelog}'" + else + tmux pipe-pane -o -t "${sessionname}" "exec cat >> '${consolelog}'" + fi fi else echo -e "Unable to detect tmux version" >> "${consolelog}" @@ -137,7 +147,7 @@ fn_start_tmux() { echo -e "" echo -e "Error" echo -e "=================================" - cat "${lgsmlogdir}/.${selfname}-tmux-error.tmp" | tee -a "${lgsmlog}" + tee -a "${lgsmlog}" < "${lgsmlogdir}/.${selfname}-tmux-error.tmp" # Detected error https://linuxgsm.com/support if grep -c "Operation not permitted" "${lgsmlogdir}/.${selfname}-tmux-error.tmp"; then From e61a38bc5c6e21faba16949dcac7c1f3c406cf97 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 1 Apr 2023 10:43:54 +0100 Subject: [PATCH 145/161] build(deps): bump webfactory/ssh-agent from 0.7.0 to 0.8.0 (#4151) * chore: auto add game server requests to gh project * build(deps): bump webfactory/ssh-agent from 0.7.0 to 0.8.0 Bumps [webfactory/ssh-agent](https://github.com/webfactory/ssh-agent) from 0.7.0 to 0.8.0. - [Release notes](https://github.com/webfactory/ssh-agent/releases) - [Changelog](https://github.com/webfactory/ssh-agent/blob/master/CHANGELOG.md) - [Commits](https://github.com/webfactory/ssh-agent/compare/v0.7.0...v0.8.0) --- updated-dependencies: - dependency-name: webfactory/ssh-agent dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --------- Signed-off-by: dependabot[bot] Co-authored-by: Daniel Gibbs Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/add-to-project.yml | 17 +++++++++++++++++ .github/workflows/git-sync.yml | 4 ++-- 2 files changed, 19 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/add-to-project.yml diff --git a/.github/workflows/add-to-project.yml b/.github/workflows/add-to-project.yml new file mode 100644 index 000000000..56a42c729 --- /dev/null +++ b/.github/workflows/add-to-project.yml @@ -0,0 +1,17 @@ +name: Add to project +on: + issues: + types: + - opened + - labeled + +jobs: + add-to-project: + name: Add game server requests to project + runs-on: ubuntu-latest + steps: + - uses: actions/add-to-project@v0.4.0 + with: + project-url: https://github.com/orgs/GameServerManagers/projects/11 + github-token: ${{ secrets.ADD_TO_PROJECT_PAT }} + labeled: "type: game server request" diff --git a/.github/workflows/git-sync.yml b/.github/workflows/git-sync.yml index f07d1f3b4..e013ae32d 100644 --- a/.github/workflows/git-sync.yml +++ b/.github/workflows/git-sync.yml @@ -10,8 +10,8 @@ jobs: GitHub-to-Bitbucket: runs-on: ubuntu-latest steps: - - name: webfactory/ssh-agent@v0.7.0 - uses: webfactory/ssh-agent@v0.7.0 + - name: webfactory/ssh-agent@v0.8.0 + uses: webfactory/ssh-agent@v0.8.0 with: ssh-private-key: ${{ secrets.BITBUCKET_SECRET }} From 5377762ef0cc4ab7556ac11dd44821296f668f7f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 1 Apr 2023 10:45:28 +0100 Subject: [PATCH 146/161] build(deps): bump convictional/trigger-workflow-and-wait from 1.3.0 to 1.6.5 (#4100) * chore: auto add game server requests to gh project * build(deps): bump convictional/trigger-workflow-and-wait Bumps [convictional/trigger-workflow-and-wait](https://github.com/convictional/trigger-workflow-and-wait) from 1.3.0 to 1.6.5. - [Release notes](https://github.com/convictional/trigger-workflow-and-wait/releases) - [Commits](https://github.com/convictional/trigger-workflow-and-wait/compare/v1.3.0...v1.6.5) --- updated-dependencies: - dependency-name: convictional/trigger-workflow-and-wait dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --------- Signed-off-by: dependabot[bot] Co-authored-by: Daniel Gibbs Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/trigger-docker-build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/trigger-docker-build.yml b/.github/workflows/trigger-docker-build.yml index adb43343f..dec3dd462 100644 --- a/.github/workflows/trigger-docker-build.yml +++ b/.github/workflows/trigger-docker-build.yml @@ -8,7 +8,7 @@ jobs: name: Trigger Build docker-linuxgsm runs-on: ubuntu-latest steps: - - uses: convictional/trigger-workflow-and-wait@v1.3.0 + - uses: convictional/trigger-workflow-and-wait@v1.6.5 with: owner: GameServerManagers repo: docker-linuxgsm @@ -19,7 +19,7 @@ jobs: name: Trigger Build docker-linuxgsm runs-on: ubuntu-latest steps: - - uses: convictional/trigger-workflow-and-wait@v1.3.0 + - uses: convictional/trigger-workflow-and-wait@v1.6.5 with: owner: GameServerManagers repo: docker-gameserver From 483498d5190e54fa669affa3a25d3ac639f44326 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 1 Apr 2023 10:45:52 +0100 Subject: [PATCH 147/161] build(deps): bump actions/add-to-project from 0.4.0 to 0.4.1 (#4126) * chore: auto add game server requests to gh project * build(deps): bump actions/add-to-project from 0.4.0 to 0.4.1 Bumps [actions/add-to-project](https://github.com/actions/add-to-project) from 0.4.0 to 0.4.1. - [Release notes](https://github.com/actions/add-to-project/releases) - [Commits](https://github.com/actions/add-to-project/compare/v0.4.0...v0.4.1) --- updated-dependencies: - dependency-name: actions/add-to-project dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --------- Signed-off-by: dependabot[bot] Co-authored-by: Daniel Gibbs Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/add-to-project.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/add-to-project.yml b/.github/workflows/add-to-project.yml index 56a42c729..8e71d1cb5 100644 --- a/.github/workflows/add-to-project.yml +++ b/.github/workflows/add-to-project.yml @@ -10,7 +10,7 @@ jobs: name: Add game server requests to project runs-on: ubuntu-latest steps: - - uses: actions/add-to-project@v0.4.0 + - uses: actions/add-to-project@v0.4.1 with: project-url: https://github.com/orgs/GameServerManagers/projects/11 github-token: ${{ secrets.ADD_TO_PROJECT_PAT }} From 52ed09c1bbd226d48711f6a77780ed5fa6020063 Mon Sep 17 00:00:00 2001 From: jusito <17811819+jusito@users.noreply.github.com> Date: Sat, 1 Apr 2023 16:44:27 +0200 Subject: [PATCH 148/161] fix(gamedig): default exitcode & var name (#4161) --- lgsm/functions/query_gamedig.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lgsm/functions/query_gamedig.sh b/lgsm/functions/query_gamedig.sh index 43f748bcc..265607acd 100755 --- a/lgsm/functions/query_gamedig.sh +++ b/lgsm/functions/query_gamedig.sh @@ -7,7 +7,7 @@ # https://github.com/sonicsnes/node-gamedig functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" - +querystatus="2" # Check if gamedig and jq are installed. if [ "$(command -v gamedig 2> /dev/null)" ] && [ "$(command -v jq 2> /dev/null)" ]; then @@ -81,7 +81,7 @@ if [ "$(command -v gamedig 2> /dev/null)" ] && [ "$(command -v jq 2> /dev/null)" # server version. if [ "${querytype}" == "teamspeak3" ]; then - dversion=$(echo "${gamedigraw}" | jq -re '.raw.virtualserver_version') + gdversion=$(echo "${gamedigraw}" | jq -re '.raw.virtualserver_version') else gdversion=$(echo "${gamedigraw}" | jq -re '.raw.version') fi From 4c717c5b94e5c9e10abd7b03d7230fdadc3eb3bf Mon Sep 17 00:00:00 2001 From: jusito <17811819+jusito@users.noreply.github.com> Date: Sat, 1 Apr 2023 23:32:56 +0200 Subject: [PATCH 149/161] fix(details): port output with whitespaces (#4160) --- lgsm/functions/info_messages.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lgsm/functions/info_messages.sh b/lgsm/functions/info_messages.sh index 69123543a..5478987f1 100755 --- a/lgsm/functions/info_messages.sh +++ b/lgsm/functions/info_messages.sh @@ -773,7 +773,7 @@ fn_port() { portname="${1}" porttype="${2}" portprotocol="${3}" - echo -e "${portname}\t${!porttype}\t${portprotocol}\t$(echo "${ssinfo}" | grep ${portprotocol} | grep ${!porttype} | wc -l)" + echo -e "${portname}\t${!porttype}\t${portprotocol}\t$(echo "${ssinfo}" | grep "${portprotocol}" | grep -c "${!porttype}")" fi } From 75852abb42c842b60e61b5cf39d32f8d057b4312 Mon Sep 17 00:00:00 2001 From: jusito <17811819+jusito@users.noreply.github.com> Date: Sat, 1 Apr 2023 23:37:10 +0200 Subject: [PATCH 150/161] fix(core): unhandled curl fail (#4159) --- lgsm/functions/core_dl.sh | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/lgsm/functions/core_dl.sh b/lgsm/functions/core_dl.sh index d19425ac5..53a60cc1a 100755 --- a/lgsm/functions/core_dl.sh +++ b/lgsm/functions/core_dl.sh @@ -383,17 +383,21 @@ fn_fetch_file() { fi # Trap will remove part downloaded files if canceled. trap fn_fetch_trap INT - # Larger files show a progress bar. - if [ "${local_filename##*.}" == "bz2" ] || [ "${local_filename##*.}" == "gz" ] || [ "${local_filename##*.}" == "zip" ] || [ "${local_filename##*.}" == "jar" ] || [ "${local_filename##*.}" == "xz" ]; then - echo -e "downloading ${local_filename}..." - fn_sleep_time - curlcmd=$(curl --connect-timeout 10 --progress-bar --fail -L -o "${local_filedir}/${local_filename}" "${fileurl}") - local exitcode=$? + curlcmd=(curl --connect-timeout 10 --fail -L -o "${local_filedir}/${local_filename}" --retry 2) + + # if is large file show progress, else be silent + local exitcode="" + large_files=("bz2" "gz" "zip" "jar" "xz") + if grep -qE "(^|\s)${local_filename##*.}(\s|$)" <<< "${large_files[@]}"; then echo -en "downloading ${local_filename}..." + fn_sleep_time + echo -en "\033[1K" + "${curlcmd[@]}" --progress-bar "${fileurl}" 2>&1 + exitcode="$?" else - curlcmd=$(curl --connect-timeout 10 -s --fail -L -o "${local_filedir}/${local_filename}" "${fileurl}") - local exitcode=$? echo -en "fetching ${fileurl_name} ${local_filename}...\c" + "${curlcmd[@]}" --silent --show-error "${fileurl}" 2>&1 + exitcode="$?" fi # Download will fail if downloads a html file. From 2fcc919d82434491697b2bd70731d479dc2734f8 Mon Sep 17 00:00:00 2001 From: jusito <17811819+jusito@users.noreply.github.com> Date: Sat, 1 Apr 2023 23:38:09 +0200 Subject: [PATCH 151/161] fix: check localhost ip first on fallback (#4158) --- lgsm/functions/check_ip.sh | 31 ++++++++++++++++++------------- 1 file changed, 18 insertions(+), 13 deletions(-) diff --git a/lgsm/functions/check_ip.sh b/lgsm/functions/check_ip.sh index fc5d70f2c..bf301008f 100755 --- a/lgsm/functions/check_ip.sh +++ b/lgsm/functions/check_ip.sh @@ -26,32 +26,37 @@ for ethtool_command in "${ethtool_commands_array[@]}"; do fi done -getip=$(${ipcommand} -o -4 addr | awk '{print $4}' | grep -oe '\([0-9]\{1,3\}\.\?\)\{4\}' | sort -u | grep -v 127.0.0) -getipwc=$(${ipcommand} -o -4 addr | awk '{print $4}' | grep -oe '\([0-9]\{1,3\}\.\?\)\{4\}' | sort -u | grep -vc 127.0.0) +mapfile -t current_ips < <(${ipcommand} -o -4 addr | awk '{print $4}' | grep -oe '\([0-9]\{1,3\}\.\?\)\{4\}' | sort -u | grep -v 127.0.0) + +function fn_is_valid_ip() { + local ip="${1}" + # excluding 0.* ips also + grep -qEe '^[1-9]+[0-9]*\.[0-9]+\.[0-9]+\.[0-9]+$' <<< "${ip}" +} # Check if server has multiple IP addresses # If the IP variable has been set by user. -if [ -n "${ip}" ] && [ "${ip}" != "0.0.0.0" ]; then - queryips=("${ip}") - webadminip=("${ip}") - telnetip=("${ip}") +if fn_is_valid_ip "${ip}"; then + queryips=( "${ip}" ) + webadminip=( "${ip}" ) + telnetip=( "${ip}" ) # If game config does have an IP set. -elif [ -n "${configip}" ] && [ "${configip}" != "0.0.0.0" ]; then - queryips=("${configip}") +elif fn_is_valid_ip "${configip}";then + queryips=( "${configip}" ) ip="${configip}" webadminip=("${configip}") telnetip=("${configip}") # If there is only 1 server IP address. # Some IP details can automaticly use the one IP -elif [ "${getipwc}" == "1" ]; then - queryips=($(echo "${getip}")) +elif [ "${#current_ips[@]}" == "1" ]; then + queryips=( "127.0.0.1" "${current_ips[@]}" ) ip="0.0.0.0" - webadminip=("${getip}") - telnetip=("${getip}") + webadminip=("${current_ips[@]}") + telnetip=("${current_ips[@]}") # If no ip is set by the user and server has more than one IP. else - queryips=($(echo "${getip}")) + queryips=( "127.0.0.1" "${current_ips[@]}" ) ip="0.0.0.0" webadminip=("${ip}") telnetip=("${ip}") From 4fc6280ccad2ae0a57a051f71684e0386863b9b0 Mon Sep 17 00:00:00 2001 From: jusito <17811819+jusito@users.noreply.github.com> Date: Sat, 1 Apr 2023 23:44:34 +0200 Subject: [PATCH 152/161] refactor(fix.sh): removed error prone code (#4157) * refactor: removed error prone code * prettier --------- Co-authored-by: Daniel Gibbs --- lgsm/functions/fix.sh | 117 +++++++++++++----------------------------- 1 file changed, 37 insertions(+), 80 deletions(-) diff --git a/lgsm/functions/fix.sh b/lgsm/functions/fix.sh index 60a96059d..57f6a91fa 100755 --- a/lgsm/functions/fix.sh +++ b/lgsm/functions/fix.sh @@ -31,101 +31,58 @@ fn_fix_msg_end() { fi } +fn_exists_fix() { + local short="${1:?}" + + if [ "$(type -t "fix_${short}.sh")" == 'function' ]; then + return 0 + else + return 1 + fi +} + +fn_apply_fix() { + local phase_message="${1:?}" + local short="${2:?}" + + if fn_exists_fix "${short}"; then + "fix_${short}.sh" + else + fn_print_error_nl "${shortname} is marked to apply pre start fix but there is no fix registered" + fi +} + +apply_pre_start_fix=(arma3 armar ark av bt bo csgo cmw dst hw ins nmrih onset rust rw sdtd sfc sof2 squad st tf2 terraria ts3 mcb mta unt vh wurm zmr) +apply_post_install_fix=(av kf kf2 lo ro samp ut2k4 ut ut3) + +# validate registered fixes for safe development +for fix in "${apply_pre_start_fix[@]}" "${apply_post_install_fix[@]}"; do + if ! fn_exists_fix "${fix}"; then + fn_print_fail_nl "fix_${fix}.sh is registered but doesn't exist. Typo or did you miss to modify core_functions.sh?" + exitcode 1 + core_exit.sh + fi +done + # Fixes that are run on start. if [ "${commandname}" != "INSTALL" ] && [ -z "${fixbypass}" ]; then if [ "${appid}" ]; then fix_steamcmd.sh fi - if [ "${shortname}" == "arma3" ]; then - fix_arma3.sh - elif [ "${shortname}" == "armar" ]; then - fix_armar.sh - elif [ "${shortname}" == "ark" ]; then - fix_ark.sh - elif [ "${shortname}" == "av" ]; then - fix_av.sh - elif [ "${shortname}" == "bt" ]; then - fix_bt.sh - elif [ "${shortname}" == "bo" ]; then - fix_bo.sh - elif [ "${shortname}" == "csgo" ]; then - fix_csgo.sh - elif [ "${shortname}" == "cmw" ]; then - fix_cmw.sh - elif [ "${shortname}" == "dst" ]; then - fix_dst.sh - elif [ "${shortname}" == "hw" ]; then - fix_hw.sh - elif [ "${shortname}" == "ins" ]; then - fix_ins.sh - elif [ "${shortname}" == "nmrih" ]; then - fix_nmrih.sh - elif [ "${shortname}" == "onset" ]; then - fix_onset.sh - elif [ "${shortname}" == "rust" ]; then - fix_rust.sh - elif [ "${shortname}" == "rw" ]; then - fix_rw.sh - elif [ "${shortname}" == "sdtd" ]; then - fix_sdtd.sh - elif [ "${shortname}" == "sfc" ]; then - fix_sfc.sh - elif [ "${shortname}" == "sof2" ]; then - fix_sof2.sh - elif [ "${shortname}" == "squad" ]; then - fix_squad.sh - elif [ "${shortname}" == "st" ]; then - fix_st.sh - elif [ "${shortname}" == "tf2" ]; then - fix_tf2.sh - elif [ "${shortname}" == "terraria" ]; then - fix_terraria.sh - elif [ "${shortname}" == "ts3" ]; then - fix_ts3.sh - elif [ "${shortname}" == "mcb" ]; then - fix_mcb.sh - elif [ "${shortname}" == "mta" ]; then - fix_mta.sh - elif [ "${shortname}" == "unt" ]; then - fix_unt.sh - elif [ "${shortname}" == "vh" ]; then - fix_vh.sh - elif [ "${shortname}" == "wurm" ]; then - fix_wurm.sh - elif [ "${shortname}" == "zmr" ]; then - fix_zmr.sh + if grep -qEe "(^|\s)${shortname}(\s|$)" <<< "${apply_pre_start_fix[@]}"; then + fn_apply_fix "pre start" "${shortname}" fi fi # Fixes that are run on install only. if [ "${commandname}" == "INSTALL" ]; then - if [ "${shortname}" == "av" ] || [ "${shortname}" == "cmw" ] || [ "${shortname}" == "kf" ] || [ "${shortname}" == "kf2" ] || [ "${shortname}" == "lo" ] || [ "${shortname}" == "onset" ] || [ "${shortname}" == "ro" ] || [ "${shortname}" == "samp" ] || [ "${shortname}" == "ut2k4" ] || [ "${shortname}" == "ut" ] || [ "${shortname}" == "ut3" ]; then + if grep -qEe "(^|\s)${shortname}(\s|$)" <<< "${apply_post_install_fix[@]}"; then echo -e "" echo -e "${lightyellow}Applying Post-Install Fixes${default}" echo -e "=================================" fn_sleep_time postinstall=1 - if [ "${shortname}" == "av" ]; then - fix_av.sh - elif [ "${shortname}" == "kf" ]; then - fix_kf.sh - elif [ "${shortname}" == "kf2" ]; then - fix_kf2.sh - elif [ "${shortname}" == "lo" ]; then - fix_lo.sh - elif [ "${shortname}" == "ro" ]; then - fix_ro.sh - elif [ "${shortname}" == "samp" ]; then - fix_samp.sh - elif [ "${shortname}" == "ut2k4" ]; then - fix_ut2k4.sh - elif [ "${shortname}" == "ut" ]; then - fix_ut.sh - elif [ "${shortname}" == "ut3" ]; then - fix_ut3.sh - else - fn_print_information_nl "No fixes required." - fi + fn_apply_fix "post install" "${shortname}" fi fi From 6b7267bbf028e0a013c3f51a29330a8f60331e21 Mon Sep 17 00:00:00 2001 From: jusito <17811819+jusito@users.noreply.github.com> Date: Sat, 1 Apr 2023 23:56:43 +0200 Subject: [PATCH 153/161] fix: install successful without installation files (#4156) * fix: install successful without files * use fn_script_log_fatal --------- Co-authored-by: Daniel Gibbs --- lgsm/functions/install_server_files.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lgsm/functions/install_server_files.sh b/lgsm/functions/install_server_files.sh index 9316d6efd..e550e1455 100755 --- a/lgsm/functions/install_server_files.sh +++ b/lgsm/functions/install_server_files.sh @@ -197,6 +197,9 @@ fn_install_server_files() { chmodx="nochmodx" run="norun" force="noforce" md5="0188ae86dbc9376f11ae3032dba2d665" + else + fn_print_fail_nl "Installing ${gamename} Server failed, missing default configuration" + fn_script_log_fatal "Installing ${gamename} Server failed, missing default configuration" fi fn_fetch_file "${remote_fileurl}" "" "" "" "${local_filedir}" "${local_filename}" "${chmodx}" "${run}" "${forcedl}" "${md5}" fn_dl_extract "${local_filedir}" "${local_filename}" "${serverfiles}" From 40e5009194a79e2cde6096b6b62dccd6030b198b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 2 Apr 2023 16:16:06 +0100 Subject: [PATCH 154/161] build(deps): bump FantasticFiasco/action-update-license-year from 2 to 3 (#4153) * chore: auto add game server requests to gh project * build(deps): bump FantasticFiasco/action-update-license-year from 2 to 3 Bumps [FantasticFiasco/action-update-license-year](https://github.com/FantasticFiasco/action-update-license-year) from 2 to 3. - [Release notes](https://github.com/FantasticFiasco/action-update-license-year/releases) - [Changelog](https://github.com/FantasticFiasco/action-update-license-year/blob/master/CHANGELOG.md) - [Commits](https://github.com/FantasticFiasco/action-update-license-year/compare/v2...v3) --- updated-dependencies: - dependency-name: FantasticFiasco/action-update-license-year dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --------- Signed-off-by: dependabot[bot] Co-authored-by: Daniel Gibbs Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/update-copyright-years-in-license-file.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/update-copyright-years-in-license-file.yml b/.github/workflows/update-copyright-years-in-license-file.yml index 347446d75..162a27944 100644 --- a/.github/workflows/update-copyright-years-in-license-file.yml +++ b/.github/workflows/update-copyright-years-in-license-file.yml @@ -13,7 +13,7 @@ jobs: - uses: actions/checkout@v3 with: fetch-depth: 0 - - uses: FantasticFiasco/action-update-license-year@v2 + - uses: FantasticFiasco/action-update-license-year@v3 with: token: ${{ secrets.GITHUB_TOKEN }} path: LICENSE.md From a69825aa7c509d2678a451007327c2b055dddbd2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 2 Apr 2023 16:17:48 +0100 Subject: [PATCH 155/161] build(deps): bump github/issue-labeler from 2.5 to 3.1 (#4152) * chore: auto add game server requests to gh project * build(deps): bump github/issue-labeler from 2.5 to 3.1 Bumps [github/issue-labeler](https://github.com/github/issue-labeler) from 2.5 to 3.1. - [Release notes](https://github.com/github/issue-labeler/releases) - [Commits](https://github.com/github/issue-labeler/compare/v2.5...v3.1) --- updated-dependencies: - dependency-name: github/issue-labeler dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --------- Signed-off-by: dependabot[bot] Co-authored-by: Daniel Gibbs Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/labeler.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/labeler.yml b/.github/workflows/labeler.yml index b5bb38498..ebf260f6f 100644 --- a/.github/workflows/labeler.yml +++ b/.github/workflows/labeler.yml @@ -15,7 +15,7 @@ jobs: issues: write # for github/issue-labeler to create or remove labels runs-on: ubuntu-latest steps: - - uses: github/issue-labeler@v2.5 + - uses: github/issue-labeler@v3.1 with: repo-token: "${{ secrets.GITHUB_TOKEN }}" configuration-path: .github/labeler.yml From b07dac780762b19ee1f3cfd5e39621a3639f1d91 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sun, 2 Apr 2023 16:26:22 +0100 Subject: [PATCH 156/161] fix: broken bitbucket button --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index f0a9713cf..f710ff66d 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@

LinuxGSM Codacy grade - GitHub Workflow Status + GitHub Workflow Status Discord SteamCMD MIT License From b9b641c300d45aa1524e4793102e786e0cf82a13 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sun, 2 Apr 2023 16:38:12 +0100 Subject: [PATCH 157/161] prettier --- lgsm/functions/check_ip.sh | 18 +++++++++--------- lgsm/functions/command_monitor.sh | 2 +- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/lgsm/functions/check_ip.sh b/lgsm/functions/check_ip.sh index bf301008f..4b8eca5ec 100755 --- a/lgsm/functions/check_ip.sh +++ b/lgsm/functions/check_ip.sh @@ -12,7 +12,7 @@ info_game.sh ip_commands_array=("/bin/ip" "/usr/sbin/ip" "ip") for ip_command in "${ip_commands_array[@]}"; do - if [ "$(command -v ${ip_command} 2> /dev/null)" ]; then + if [ "$(command -v "${ip_command}" 2> /dev/null)" ]; then ipcommand="${ip_command}" break fi @@ -20,7 +20,7 @@ done ethtool_commands_array=("/bin/ethtool" "/usr/sbin/ethtool" "ethtool") for ethtool_command in "${ethtool_commands_array[@]}"; do - if [ "$(command -v ${ethtool_command} 2> /dev/null)" ]; then + if [ "$(command -v "${ethtool_command}" 2> /dev/null)" ]; then ethtoolcommand="${ethtool_command}" break fi @@ -38,25 +38,25 @@ function fn_is_valid_ip() { # If the IP variable has been set by user. if fn_is_valid_ip "${ip}"; then - queryips=( "${ip}" ) - webadminip=( "${ip}" ) - telnetip=( "${ip}" ) + queryips=("${ip}") + webadminip=("${ip}") + telnetip=("${ip}") # If game config does have an IP set. -elif fn_is_valid_ip "${configip}";then - queryips=( "${configip}" ) +elif fn_is_valid_ip "${configip}"; then + queryips=("${configip}") ip="${configip}" webadminip=("${configip}") telnetip=("${configip}") # If there is only 1 server IP address. # Some IP details can automaticly use the one IP elif [ "${#current_ips[@]}" == "1" ]; then - queryips=( "127.0.0.1" "${current_ips[@]}" ) + queryips=("127.0.0.1" "${current_ips[@]}") ip="0.0.0.0" webadminip=("${current_ips[@]}") telnetip=("${current_ips[@]}") # If no ip is set by the user and server has more than one IP. else - queryips=( "127.0.0.1" "${current_ips[@]}" ) + queryips=("127.0.0.1" "${current_ips[@]}") ip="0.0.0.0" webadminip=("${ip}") telnetip=("${ip}") diff --git a/lgsm/functions/command_monitor.sh b/lgsm/functions/command_monitor.sh index 0d6402942..20c830e0b 100755 --- a/lgsm/functions/command_monitor.sh +++ b/lgsm/functions/command_monitor.sh @@ -72,7 +72,7 @@ fn_monitor_check_queryport() { fn_print_dots "Checking port: " fn_print_checking_eol fn_script_log_info "Checking port: CHECKING" - if [ -n "${rconenabled}" ] && [ "${rconenabled}" != "true" ] && [ ${shortname} == "av" ]; then + if [ -n "${rconenabled}" ] && [ "${rconenabled}" != "true" ] && [ "${shortname}" == "av" ]; then fn_print_warn "Checking port: Unable to query, rcon is not enabled" fn_script_log_warn "Checking port: Unable to query, rcon is not enabled" else From 2e78a4658e5f7167130adfc846b1aa177e496a6c Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sun, 2 Apr 2023 16:39:21 +0100 Subject: [PATCH 158/161] Release v23.2.0 --- .vscode/extensions.json | 18 +++++++++--------- lgsm/functions/core_functions.sh | 2 +- linuxgsm.sh | 2 +- tests/tests_fctrserver.sh | 2 +- tests/tests_jc2server.sh | 2 +- tests/tests_mcserver.sh | 2 +- tests/tests_ts3server.sh | 2 +- 7 files changed, 15 insertions(+), 15 deletions(-) diff --git a/.vscode/extensions.json b/.vscode/extensions.json index 0ceb99088..0c9982e65 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -1,11 +1,11 @@ { - "recommendations": [ - "ms-python.python", - "editorconfig.editorconfig", - "yzhang.markdown-all-in-one", - "esbenp.prettier-vscode", - "timonwong.shellcheck", - "foxundermoon.shell-format", - "redhat.vscode-yaml" - ] + "recommendations": [ + "ms-python.python", + "editorconfig.editorconfig", + "yzhang.markdown-all-in-one", + "esbenp.prettier-vscode", + "timonwong.shellcheck", + "foxundermoon.shell-format", + "redhat.vscode-yaml" + ] } diff --git a/lgsm/functions/core_functions.sh b/lgsm/functions/core_functions.sh index 6ab24b78b..aa8a43659 100755 --- a/lgsm/functions/core_functions.sh +++ b/lgsm/functions/core_functions.sh @@ -8,7 +8,7 @@ functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" -modulesversion="v23.1.0" +modulesversion="v23.2.0" # Core diff --git a/linuxgsm.sh b/linuxgsm.sh index 3e4812439..3d8b7f376 100755 --- a/linuxgsm.sh +++ b/linuxgsm.sh @@ -20,7 +20,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="v23.1.0" +version="v23.2.0" shortname="core" gameservername="core" commandname="CORE" diff --git a/tests/tests_fctrserver.sh b/tests/tests_fctrserver.sh index 11ed61f93..36060b0fe 100644 --- a/tests/tests_fctrserver.sh +++ b/tests/tests_fctrserver.sh @@ -20,7 +20,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="v23.1.0" +version="v23.2.0" shortname="fctr" gameservername="fctrserver" commandname="CORE" diff --git a/tests/tests_jc2server.sh b/tests/tests_jc2server.sh index 5e0158b7a..fde725412 100644 --- a/tests/tests_jc2server.sh +++ b/tests/tests_jc2server.sh @@ -20,7 +20,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="v23.1.0" +version="v23.2.0" shortname="jc2" gameservername="jc2server" commandname="CORE" diff --git a/tests/tests_mcserver.sh b/tests/tests_mcserver.sh index 560484910..006cc38a2 100644 --- a/tests/tests_mcserver.sh +++ b/tests/tests_mcserver.sh @@ -20,7 +20,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="v23.1.0" +version="v23.2.0" shortname="mc" gameservername="mcserver" commandname="CORE" diff --git a/tests/tests_ts3server.sh b/tests/tests_ts3server.sh index 731a38518..40c7d3787 100644 --- a/tests/tests_ts3server.sh +++ b/tests/tests_ts3server.sh @@ -20,7 +20,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="v23.1.0" +version="v23.2.0" shortname="ts3" gameservername="ts3server" commandname="CORE" From 8b99b83ac56772eeaa7e4995451420ce204ec33e Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Mon, 3 Apr 2023 21:57:46 +0100 Subject: [PATCH 159/161] fix: GameServerManagers #4099 --- lgsm/functions/core_dl.sh | 10 +++++----- tests/tests_fctrserver.sh | 2 +- tests/tests_jc2server.sh | 2 +- tests/tests_mcserver.sh | 2 +- tests/tests_ts3server.sh | 2 +- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/lgsm/functions/core_dl.sh b/lgsm/functions/core_dl.sh index 53a60cc1a..27d001285 100755 --- a/lgsm/functions/core_dl.sh +++ b/lgsm/functions/core_dl.sh @@ -477,7 +477,7 @@ fn_fetch_file_github() { remote_fileurl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_fileurl_dir}/${github_fileurl_name}" remote_fileurl_backup="https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/${github_fileurl_dir}/${github_fileurl_name}" # If master branch will currently running LinuxGSM version to prevent "version mixing". This is ignored if a fork. - elif [ "${githubbranch}" == "master" ] && [ "${githubuser}" == "GameServerManager" ] && [ "${commandname}" != "UPDATE-LGSM" ]; then + elif [ "${githubbranch}" == "master" ] && [ "${githubuser}" == "GameServerManagers" ] && [ "${commandname}" != "UPDATE-LGSM" ]; then remote_fileurl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${version}/${github_fileurl_dir}/${github_fileurl_name}" remote_fileurl_backup="https://bitbucket.org/${githubuser}/${githubrepo}/raw/${version}/${github_fileurl_dir}/${github_fileurl_name}" else @@ -499,7 +499,7 @@ fn_fetch_file_github() { fn_check_file_github() { github_fileurl_dir="${1}" github_fileurl_name="${2}" - if [ "${githubbranch}" == "master" ] && [ "${githubuser}" == "GameServerManager" ] && [ "${commandname}" != "UPDATE-LGSM" ]; then + if [ "${githubbranch}" == "master" ] && [ "${githubuser}" == "GameServerManagers" ] && [ "${commandname}" != "UPDATE-LGSM" ]; then remote_fileurl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${version}/${github_fileurl_dir}/${github_fileurl_name}" remote_fileurl_backup="https://bitbucket.org/${githubuser}/${githubrepo}/raw/${version}/${github_fileurl_dir}/${github_fileurl_name}" else @@ -516,7 +516,7 @@ fn_fetch_config() { github_fileurl_dir="${1}" github_fileurl_name="${2}" # If master branch will currently running LinuxGSM version to prevent "version mixing". This is ignored if a fork. - if [ "${githubbranch}" == "master" ] && [ "${githubuser}" == "GameServerManager" ] && [ "${commandname}" != "UPDATE-LGSM" ]; then + if [ "${githubbranch}" == "master" ] && [ "${githubuser}" == "GameServerManagers" ] && [ "${commandname}" != "UPDATE-LGSM" ]; then remote_fileurl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${version}/${github_fileurl_dir}/${github_fileurl_name}" remote_fileurl_backup="https://bitbucket.org/${githubuser}/${githubrepo}/raw/${version}/${github_fileurl_dir}/${github_fileurl_name}" else @@ -540,7 +540,7 @@ fn_fetch_function() { github_fileurl_dir="lgsm/functions" github_fileurl_name="${functionfile}" # If master branch will currently running LinuxGSM version to prevent "version mixing". This is ignored if a fork. - if [ "${githubbranch}" == "master" ] && [ "${githubuser}" == "GameServerManager" ] && [ "${commandname}" != "UPDATE-LGSM" ]; then + if [ "${githubbranch}" == "master" ] && [ "${githubuser}" == "GameServerManagers" ] && [ "${commandname}" != "UPDATE-LGSM" ]; then remote_fileurl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${version}/${github_fileurl_dir}/${github_fileurl_name}" remote_fileurl_backup="https://bitbucket.org/${githubuser}/${githubrepo}/raw/${version}/${github_fileurl_dir}/${github_fileurl_name}" else @@ -564,7 +564,7 @@ fn_update_function() { github_fileurl_dir="lgsm/functions" github_fileurl_name="${functionfile}" # If master branch will currently running LinuxGSM version to prevent "version mixing". This is ignored if a fork. - if [ "${githubbranch}" == "master" ] && [ "${githubuser}" == "GameServerManager" ] && [ "${commandname}" != "UPDATE-LGSM" ]; then + if [ "${githubbranch}" == "master" ] && [ "${githubuser}" == "GameServerManagers" ] && [ "${commandname}" != "UPDATE-LGSM" ]; then remote_fileurl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${version}/${github_fileurl_dir}/${github_fileurl_name}" remote_fileurl_backup="https://bitbucket.org/${githubuser}/${githubrepo}/raw/${version}/${github_fileurl_dir}/${github_fileurl_name}" else diff --git a/tests/tests_fctrserver.sh b/tests/tests_fctrserver.sh index 36060b0fe..791aaeddc 100644 --- a/tests/tests_fctrserver.sh +++ b/tests/tests_fctrserver.sh @@ -168,7 +168,7 @@ fn_bootstrap_fetch_file_github() { github_file_url_dir="${1}" github_file_url_name="${2}" # If master branch will currently running LinuxGSM version to prevent "version mixing". This is ignored if a fork. - if [ "${githubbranch}" == "master" ] && [ "${githubuser}" == "GameServerManager" ] && [ "${commandname}" != "UPDATE-LGSM" ]; then + if [ "${githubbranch}" == "master" ] && [ "${githubuser}" == "GameServerManagers" ] && [ "${commandname}" != "UPDATE-LGSM" ]; then remote_fileurl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${version}/${github_file_url_dir}/${github_file_url_name}" remote_fileurl_backup="https://bitbucket.org/${githubuser}/${githubrepo}/raw/${version}/${github_file_url_dir}/${github_file_url_name}" else diff --git a/tests/tests_jc2server.sh b/tests/tests_jc2server.sh index fde725412..2fcb1c845 100644 --- a/tests/tests_jc2server.sh +++ b/tests/tests_jc2server.sh @@ -169,7 +169,7 @@ fn_bootstrap_fetch_file_github() { github_file_url_dir="${1}" github_file_url_name="${2}" # If master branch will currently running LinuxGSM version to prevent "version mixing". This is ignored if a fork. - if [ "${githubbranch}" == "master" ] && [ "${githubuser}" == "GameServerManager" ] && [ "${commandname}" != "UPDATE-LGSM" ]; then + if [ "${githubbranch}" == "master" ] && [ "${githubuser}" == "GameServerManagers" ] && [ "${commandname}" != "UPDATE-LGSM" ]; then remote_fileurl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${version}/${github_file_url_dir}/${github_file_url_name}" remote_fileurl_backup="https://bitbucket.org/${githubuser}/${githubrepo}/raw/${version}/${github_file_url_dir}/${github_file_url_name}" else diff --git a/tests/tests_mcserver.sh b/tests/tests_mcserver.sh index 006cc38a2..5cbb4ace8 100644 --- a/tests/tests_mcserver.sh +++ b/tests/tests_mcserver.sh @@ -169,7 +169,7 @@ fn_bootstrap_fetch_file_github() { github_file_url_dir="${1}" github_file_url_name="${2}" # If master branch will currently running LinuxGSM version to prevent "version mixing". This is ignored if a fork. - if [ "${githubbranch}" == "master" ] && [ "${githubuser}" == "GameServerManager" ] && [ "${commandname}" != "UPDATE-LGSM" ]; then + if [ "${githubbranch}" == "master" ] && [ "${githubuser}" == "GameServerManagers" ] && [ "${commandname}" != "UPDATE-LGSM" ]; then remote_fileurl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${version}/${github_file_url_dir}/${github_file_url_name}" remote_fileurl_backup="https://bitbucket.org/${githubuser}/${githubrepo}/raw/${version}/${github_file_url_dir}/${github_file_url_name}" else diff --git a/tests/tests_ts3server.sh b/tests/tests_ts3server.sh index 40c7d3787..82e232398 100644 --- a/tests/tests_ts3server.sh +++ b/tests/tests_ts3server.sh @@ -169,7 +169,7 @@ fn_bootstrap_fetch_file_github() { github_file_url_dir="${1}" github_file_url_name="${2}" # If master branch will currently running LinuxGSM version to prevent "version mixing". This is ignored if a fork. - if [ "${githubbranch}" == "master" ] && [ "${githubuser}" == "GameServerManager" ] && [ "${commandname}" != "UPDATE-LGSM" ]; then + if [ "${githubbranch}" == "master" ] && [ "${githubuser}" == "GameServerManagers" ] && [ "${commandname}" != "UPDATE-LGSM" ]; then remote_fileurl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${version}/${github_file_url_dir}/${github_file_url_name}" remote_fileurl_backup="https://bitbucket.org/${githubuser}/${githubrepo}/raw/${version}/${github_file_url_dir}/${github_file_url_name}" else From 0dfc51098fef02fe15b9dc5dbe632b4667ae53c4 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Mon, 3 Apr 2023 22:43:32 +0100 Subject: [PATCH 160/161] feat: change donate to sponsor (#4164) Convert the word donate to sponsor to bring in line with GitHub Sponsors --- .../{command_donate.sh => command_sponsor.sh} | 12 ++++++------ lgsm/functions/core_functions.sh | 2 +- lgsm/functions/core_getopt.sh | 6 +++--- tests/tests_fctrserver.sh | 14 +++++++------- tests/tests_jc2server.sh | 14 +++++++------- tests/tests_mcserver.sh | 14 +++++++------- tests/tests_ts3server.sh | 14 +++++++------- 7 files changed, 38 insertions(+), 38 deletions(-) rename lgsm/functions/{command_donate.sh => command_sponsor.sh} (78%) diff --git a/lgsm/functions/command_donate.sh b/lgsm/functions/command_sponsor.sh similarity index 78% rename from lgsm/functions/command_donate.sh rename to lgsm/functions/command_sponsor.sh index f00a4d702..22ec0c49e 100755 --- a/lgsm/functions/command_donate.sh +++ b/lgsm/functions/command_sponsor.sh @@ -1,12 +1,12 @@ #!/bin/bash -# LinuxGSM command_donate.sh module +# LinuxGSM command_sponsor.sh module # Author: Daniel Gibbs # Contributors: http://linuxgsm.com/contrib # Website: https://linuxgsm.com -# Description: Shows ways to donate. +# Description: Shows ways to sponsor. -commandname="DONATE" -commandaction="Donate" +commandname="SPONSOR" +commandaction="Sponsor" functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_firstcommand_set @@ -15,10 +15,10 @@ echo -e "${lightyellow}Support LinuxGSM${default}" echo -e "=================================" echo -e "" echo -e "Been using LinuxGSM?" -echo -e "Consider donating to support development." +echo -e "Consider sponsoring to support development." echo -e "" -echo -e "* ${lightblue}Patreon:${default} https://linuxgsm.com/patreon" echo -e "* ${lightblue}GitHub:${default} https://github.com/sponsors/dgibbs64" +echo -e "* ${lightblue}Patreon:${default} https://linuxgsm.com/patreon" echo -e "* ${lightblue}PayPal:${default} https://linuxgsm.com/paypal" echo -e "" echo -e "LinuxGSM est. 2012" diff --git a/lgsm/functions/core_functions.sh b/lgsm/functions/core_functions.sh index aa8a43659..a1708008c 100755 --- a/lgsm/functions/core_functions.sh +++ b/lgsm/functions/core_functions.sh @@ -86,7 +86,7 @@ command_details.sh() { fn_fetch_function } -command_donate.sh() { +command_sponsor.sh() { functionfile="${FUNCNAME[0]}" fn_fetch_function } diff --git a/lgsm/functions/core_getopt.sh b/lgsm/functions/core_getopt.sh index 808fe2e2a..d7762b0ac 100755 --- a/lgsm/functions/core_getopt.sh +++ b/lgsm/functions/core_getopt.sh @@ -22,7 +22,7 @@ cmd_update_linuxgsm=("ul;update-lgsm;uf;update-functions" "command_update_linuxg cmd_test_alert=("ta;test-alert" "command_test_alert.sh" "Send a test alert.") cmd_monitor=("m;monitor" "command_monitor.sh" "Check server status and restart if crashed.") cmd_skeleton=("sk;skeleton" "command_skeleton.sh" "Create a skeleton directory.") -cmd_donate=("do;donate" "command_donate.sh" "Donation options.") +cmd_sponsor=("s;sponsor" "command_sponsor.sh" "Donation options.") cmd_send=("sd;send" "command_send.sh" "Send command to game server console.") # Console servers only. cmd_console=("c;console" "command_console.sh" "Access server console.") @@ -148,8 +148,8 @@ if [ -f ".dev-debug" ]; then currentopt+=("${cmd_dev_detect_deps[@]}" "${cmd_dev_detect_glibc[@]}" "${cmd_dev_detect_ldd[@]}" "${cmd_dev_query_raw[@]}" "${cmd_dev_clear_functions[@]}") fi -## Donate. -currentopt+=("${cmd_donate[@]}") +## Sponsor. +currentopt+=("${cmd_sponsor[@]}") ### Build list of available commands. optcommands=() diff --git a/tests/tests_fctrserver.sh b/tests/tests_fctrserver.sh index 791aaeddc..b9ca2789a 100644 --- a/tests/tests_fctrserver.sh +++ b/tests/tests_fctrserver.sh @@ -614,8 +614,8 @@ echo -e "8.3 - dev - detect deps" echo -e "8.4 - dev - query-raw" echo -e "" -echo -e "9.0 - Donate" -echo -e "9.1 - donate" +echo -e "9.0 - Sponsor" +echo -e "9.1 - sponsor" echo -e "" echo -e "0.0 - Pre-test Tasks" @@ -1153,22 +1153,22 @@ grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g echo -e "" -echo -e "9.0 - Donate" +echo -e "9.0 - Sponsor" echo -e "==================================================================" echo -e "" -echo -e "9.1 - donate" +echo -e "9.1 - sponsor" echo -e "=================================" echo -e "Description:" -echo -e "donate." -echo -e "Command: ./${gameservername} donate" +echo -e "sponsor." +echo -e "Command: ./${gameservername} sponsor" requiredstatus="STARTED" fn_setstatus ( exec 5> "${TRAVIS_BUILD_DIR}/dev-debug.log" BASH_XTRACEFD="5" set -x - command_donate.sh + command_sponsor.sh ) fn_test_result_pass echo -e "run order" diff --git a/tests/tests_jc2server.sh b/tests/tests_jc2server.sh index 2fcb1c845..5c2787086 100644 --- a/tests/tests_jc2server.sh +++ b/tests/tests_jc2server.sh @@ -620,8 +620,8 @@ echo -e "8.2 - dev - detect ldd" echo -e "8.3 - dev - detect deps" echo -e "8.4 - dev - query-raw" echo -e "" -echo -e "9.0 - Donate" -echo -e "9.1 - donate" +echo -e "9.0 - Sponsor" +echo -e "9.1 - sponsor" echo -e "" echo -e "0.0 - Pre-test Tasks" echo -e "==================================================================" @@ -1320,22 +1320,22 @@ echo -e "=================" grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' echo -e "" -echo -e "9.0 - Donate" +echo -e "9.0 - Sponsor" echo -e "==================================================================" echo -e "" -echo -e "9.1 - donate" +echo -e "9.1 - sponsor" echo -e "=================================" echo -e "Description:" -echo -e "donate." -echo -e "Command: ./${gameservername} donate" +echo -e "sponsor." +echo -e "Command: ./${gameservername} sponsor" requiredstatus="STARTED" fn_setstatus ( exec 5> "${TRAVIS_BUILD_DIR}/dev-debug.log" BASH_XTRACEFD="5" set -x - command_donate.sh + command_sponsor.sh ) fn_test_result_pass echo -e "run order" diff --git a/tests/tests_mcserver.sh b/tests/tests_mcserver.sh index 5cbb4ace8..05676ad2f 100644 --- a/tests/tests_mcserver.sh +++ b/tests/tests_mcserver.sh @@ -613,8 +613,8 @@ echo -e "8.2 - dev - detect ldd" echo -e "8.3 - dev - detect deps" echo -e "8.4 - dev - query-raw" echo -e "" -echo -e "9.0 - Donate" -echo -e "9.1 - donate" +echo -e "9.0 - Sponsor" +echo -e "9.1 - sponsor" echo -e "" echo -e "0.0 - Pre-test Tasks" @@ -1198,22 +1198,22 @@ echo -e "=================" grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' echo -e "" -echo -e "9.0 - Donate" +echo -e "9.0 - Sponsor" echo -e "==================================================================" echo -e "" -echo -e "9.1 - donate" +echo -e "9.1 - sponsor" echo -e "=================================" echo -e "Description:" -echo -e "donate." -echo -e "Command: ./${gameservername} donate" +echo -e "sponsor." +echo -e "Command: ./${gameservername} sponsor" requiredstatus="STARTED" fn_setstatus ( exec 5> "${TRAVIS_BUILD_DIR}/dev-debug.log" BASH_XTRACEFD="5" set -x - command_donate.sh + command_sponsor.sh ) fn_test_result_pass echo -e "run order" diff --git a/tests/tests_ts3server.sh b/tests/tests_ts3server.sh index 82e232398..1f553fd51 100644 --- a/tests/tests_ts3server.sh +++ b/tests/tests_ts3server.sh @@ -614,8 +614,8 @@ echo -e "8.2 - dev - detect ldd" echo -e "8.3 - dev - detect deps" echo -e "8.4 - dev - query-raw" echo -e "" -echo -e "9.0 - Donate" -echo -e "9.1 - donate" +echo -e "9.0 - Sponsor" +echo -e "9.1 - sponsor" echo -e "" echo -e "0.0 - Pre-test Tasks" echo -e "==================================================================" @@ -1151,22 +1151,22 @@ echo -e "=================" grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' echo -e "" -echo -e "9.0 - Donate" +echo -e "9.0 - Sponsor" echo -e "==================================================================" echo -e "" -echo -e "9.1 - donate" +echo -e "9.1 - sponsor" echo -e "=================================" echo -e "Description:" -echo -e "donate." -echo -e "Command: ./${gameservername} donate" +echo -e "sponsor." +echo -e "Command: ./${gameservername} sponsor" requiredstatus="STARTED" fn_setstatus ( exec 5> "${TRAVIS_BUILD_DIR}/dev-debug.log" BASH_XTRACEFD="5" set -x - command_donate.sh + command_sponsor.sh ) fn_test_result_pass echo -e "run order" From d099e7ef72524947a7aa63a4f3f6c30ceb0251fd Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Mon, 3 Apr 2023 22:47:48 +0100 Subject: [PATCH 161/161] feat: steamcmd install now goes via update_steamcmd.sh (#4165) now goes via update_steamcmd.sh --- lgsm/functions/install_server_files.sh | 3 ++- lgsm/functions/update_steamcmd.sh | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/lgsm/functions/install_server_files.sh b/lgsm/functions/install_server_files.sh index e550e1455..80075a76a 100755 --- a/lgsm/functions/install_server_files.sh +++ b/lgsm/functions/install_server_files.sh @@ -212,7 +212,8 @@ fn_sleep_time if [ "${appid}" ]; then remotelocation="SteamCMD" - fn_dl_steamcmd + forceupdate=1 + update_steamcmd.sh fi if [ "${shortname}" == "ts3" ]; then diff --git a/lgsm/functions/update_steamcmd.sh b/lgsm/functions/update_steamcmd.sh index 85bacb899..eb773f016 100644 --- a/lgsm/functions/update_steamcmd.sh +++ b/lgsm/functions/update_steamcmd.sh @@ -18,7 +18,7 @@ fn_print_dots "${remotelocation}" if [ "${forceupdate}" == "1" ]; then # forceupdate bypasses update checks. - if [ "${status}" != "0" ]; then + if [ "${status}" != "0" ]&&[ -v "${status}" ]; then fn_print_restart_warning exitbypass=1 command_stop.sh