From 51031eb71ab3cf5c7fc31b7825271ed63a1ba882 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Thu, 16 Feb 2023 23:43:09 +0000 Subject: [PATCH 001/181] 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 0000000000..56a42c7290 --- /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 ba339d9d3b07a6a1f54fe47a546fe74bfae07dfe Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Fri, 24 Feb 2023 00:37:31 +0000 Subject: [PATCH 002/181] 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 cc5af18090..c4faa6517d 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 003/181] 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 9577098980..19f16d58e2 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 e90ccc5e04..78abd650a1 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 d10240fa7a..4b01984f46 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 c4faa6517d..2e6db690e8 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 5b95adc81d..9d54cfde1b 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 e4872a8f84..5814cd8324 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 93c01cf32a..0589770f69 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 7e2d097a79..e79ceb9ad5 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 0f36ebcaaf..3e48124394 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 0c1e02d677..11ed61f934 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 62736d50b2..5e0158b7aa 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 6fe28715bb..5604849101 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 fa6d622839..731a38518e 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 004/181] 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 1ec662f2b0..3da0d47ee0 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 78032cfe04..81173ccb97 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 9f341fb999..3d0dd88c93 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 9f341fb999..3d0dd88c93 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 e997a2e5e2..6836a9de0b 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 9f341fb999..3d0dd88c93 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 9f341fb999..3d0dd88c93 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 499846c756..41c16331d0 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 1e488fc152..2c67d0d102 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 5fe1127027..20816ad24d 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 0016a56652..90c7fd28a8 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 9f341fb999..3d0dd88c93 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 9f341fb999..3d0dd88c93 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 9f341fb999..3d0dd88c93 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 9f341fb999..3d0dd88c93 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 5c9a6d97aa..aff8708e70 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 e1cfa166be..f26b7996af 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 499846c756..41c16331d0 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 6ff12422a0..d32d7e0240 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 1e488fc152..2c67d0d102 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 4760fd5f24..88bcd2b093 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 1235293240..d18b8e6fbe 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 5814cd8324..f859653c8c 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 533dee675d..74f529bd7c 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 c04db364ca..dd3bb80c36 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 005/181] 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 435bde1ea8..0f05118e92 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 006/181] 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 fdb06bfe8a..0000000000 --- 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 3d0dd88c93..86ff4dc14b 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 3d0dd88c93..86ff4dc14b 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 6836a9de0b..c1d2b97b8d 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 3d0dd88c93..86ff4dc14b 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 3d0dd88c93..86ff4dc14b 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 41c16331d0..768be603f0 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 2c67d0d102..021e66e203 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 20816ad24d..fa0d6a881b 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 90c7fd28a8..4cfe968482 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 3d0dd88c93..86ff4dc14b 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 3d0dd88c93..86ff4dc14b 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 3d0dd88c93..86ff4dc14b 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 3d0dd88c93..86ff4dc14b 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 aff8708e70..ae9ae564c8 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 f26b7996af..d0f8fcebc2 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 41c16331d0..768be603f0 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 d32d7e0240..d4e8d65337 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 2c67d0d102..021e66e203 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 88bcd2b093..4284cdd9cc 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 d18b8e6fbe..5aaacff813 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 07b65e5fac..ccf26322e1 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 05b52e243a..bca5debf94 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 f859653c8c..4a12564310 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 74f529bd7c..69123543a6 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 dd3bb80c36..35d7df7c6b 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 61c6b131cc..c989866858 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 77e64d3c07..0000000000 --- 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 007/181] 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 e8d583251d..f786867595 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 008/181] 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 0ed9fdf705..b0e9396cc8 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 f34a01c37a..a61a8be658 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 009/181] 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 205e8a1d79..5af870f50c 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 8460209c40..59deae2b6e 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 0dfabcd030..d69c57a0fd 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 59b29d6e9a..3753c72c65 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 15f5be22fc..daf0395511 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 c2f7b42b58..80b23fea9c 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 ccf26322e1..ae5c2065c6 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 2e6db690e8..d19425ac59 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 2d2f5b8fa1..95d9d8cae0 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 bca5debf94..6ab24b78b7 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 fdd66ab3f5..808fe2e2af 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 9d54cfde1b..119748fb71 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 b0e9396cc8..60a96059dd 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 4a12564310..f5dc108da4 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 5b8b4db5d3..3e51fac714 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 c989866858..9316d6efd0 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 e394296de9..ed879cd287 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 e79ceb9ad5..8e4ade7716 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 2c8bf0d018..548d53b159 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 421bc543f6..7560f01580 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 d20b98ef48..ace4713bc0 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 163e076aab..cf61e3a2b1 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 61216b8094..5252c13280 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 302e0baac6..f48a66e39f 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 be5c9e06f5..e76609b2dd 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 0000000000..b6db783e27 --- /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 9053849222..84e3192c9b 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 010/181] 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 4488377a38..f1d5926581 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 f5dc108da4..0bd219485e 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 011/181] 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 f1d5926581..662bbe0521 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 f786867595..a83b7e3032 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 012/181] 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 29577984e5..e1677e8276 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 662bbe0521..5f407e89f8 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 0bd219485e..8c9ca310a8 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 013/181] 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 39a441f59b..569bc7cdb9 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 014/181] 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 3b6776ef7f..8d572b695d 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 a2552a95d8..3283f54e8a 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 046aa0c11e..9d4c0ed4b4 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 8e24debfc6..cc3de9082b 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 7c4619c17f..c92e843fd7 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 9e2f88d7c4..3cee2f43f6 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 c6e338d340..a77e230ce3 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 bbaf07daa5..a77e347a87 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 1e566b88b3..6557890a1e 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 118f655478..ad283e5aa4 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 eef61562cb..07d5465d02 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 c6da048f93..4d2651a9ac 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 9acc98e5b8..27d7cd504d 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 bd8145df31..5d13c758c7 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 f2c2a3b030..4f44086c2c 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 41ab3fba73..45f931aa40 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 81173ccb97..b1b738fe25 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 11e175c18e..1fda28f37a 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 10ba0f8af8..5a80c2ca52 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 50eb14bf13..bf490c78a8 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 ef1c0618c3..3659bae6c1 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 0f05118e92..964185444b 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 fca571d93c..64990c12e6 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 8389feb3c2..f73a2a1e3d 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 34883c0a1a..4650e35adb 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 3b922967df..47304668f9 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 58dec3f7ac..bd0ed995a6 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 450b767653..a1cffc5c98 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 61767765ba..7104cf096d 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 30ba7b8c59..dd83b4996d 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 83a6101dac..a1f47e9740 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 e06da982cf..b84ed1d3c2 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 377ab85fff..450c2e7e0c 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 45042cf07d..d6d63d2b16 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 b8d7d382c4..8e734fe963 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 41d55374bb..b176fc6373 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 12076ed80e..45e6b84499 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 b938891dba..83be0acb89 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 f1eac49685..2a1ce62bc9 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 fa6c79315c..b5b2f50c9f 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 8ac508ca9c..f567dab6e5 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 db46691327..174ef357c2 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 16db942a4e..8181f7f1ed 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 488fe649a0..e36ab3581a 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 2d01761338..4edca5194a 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 9f010510e0..c58ee27893 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 3c2adf8af2..623900384c 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 1f569df9ce..aad52e8024 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 3b2b69a589..4763fc4237 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 f595afc2a0..f8d3887aea 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 59aada0766..2e4f061e40 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 1d54b8eb2f..6f156f9d95 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 c7adf3e653..d6d65d863b 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 66678d2840..5317f6be94 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 c81bc4002d..d587e37192 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 01043a35e6..6c36a7f69f 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 a1aacafb53..fd049f80d6 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 700ba8fbbb..0675729e48 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 a60bbd1a23..a8c3c72bf3 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 74ffea9af6..71b1a178b8 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 4fb9389831..3ef547c22a 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 838a65efb1..c0cbd2452b 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 15ebddde5f..d4056faf94 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 bc64ee8833..f8fddf0c0d 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 fd7b8a71e3..c12265f9ff 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 81ab22a955..1011e87681 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 a9f5fc840b..0077221f4f 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 a19d077fe9..6ebc106b9b 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 ac7d4e9398..c001c7bf1d 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 9653eb52ba..935659c83e 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 af49cb3e28..5d3b4d8873 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 5f412cd4d8..241e535f46 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 73cf810f1b..bc3e20cd1d 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 83dfd991bb..d3fa2ad13d 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 4292b1f2ac..5a63b2edff 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 1729536095..2c270bfc5e 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 d10367f638..691c69b3a6 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 e43f150fd5..72f87b4f0f 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 cb82ffca53..af31b615be 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 704d63ff33..e8f69161ef 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 69501dbf34..f1ccede86f 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 1689af8112..6cb271de05 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 45a2b8fbda..8d27cf08c6 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 2d284187f2..399c43f0fd 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 ea1061a707..526e27854c 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 5621dec157..d8fda33d76 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 c2c0d0f246..5b1444ed96 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 9435b21995..1e9482c8cc 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 d36a4c1f28..231ab423aa 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 58e3f4fe9d..9ff217a8b0 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 847c8a1ddb..3c134592a1 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 d43a151527..acda7f6e4b 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 f1c09e1893..a31449a05e 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 6883fe5893..eecc9cce2c 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 6805d6395f..899842b08d 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 13815fbcba..521500591f 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 ac948d864f..3409fe9943 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 285bd0a492..73d0605c69 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 090309696c..270e8f84ee 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 5b1071a3b6..579790be76 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 45ca1151a6..dfe3857c05 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 094754914e..a0f878e45b 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 8204925099..6db45dc530 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 0a343cfdf0..79240e2bf3 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 0b9510d4cd..d26cef1279 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 26da17f432..834c2d054f 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 f8feb47f4f..ec164b90b3 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 c0aaea6c6d..a286b0571b 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 16ab366960..824b6e7e3e 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 827b32736d..968350fd84 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 1de6910b52..f31864df30 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 f676309d07..963920a6c9 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 c1c99b24a9..1b4ac5bfc3 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 5fdfd6447f..8163100627 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 791c93da5f..8c4b326831 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 41d1981e7c..c3c5b7e140 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 b3ca481cd8..0df674dc60 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 49cd6b7d59..87b99bdb83 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 5af870f50c..dede896871 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 6b66032215..3925988405 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 85f13614dd..8bb87887bd 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 7009f02cb6..a207ecdb7e 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 6755e0e51e..20b587f323 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 a441abd01d..94510c334a 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 012b2df1cc..994abb5c00 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 eeedf5f188..fc53e641c0 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 229d7bef56..cdf56e71e2 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 a70fa371fe..3743e899f5 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 4b87f91723..c2621b48a4 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 a5fc616cfd..777403dfd8 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 4b01984f46..04c6b4e645 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 015/181] 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 0000000000..56a42c7290 --- /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 f07d1f3b48..e013ae32dd 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 016/181] 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 adb43343f0..dec3dd462b 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 017/181] 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 56a42c7290..8e71d1cb59 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 018/181] 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 43f748bccb..265607acd5 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 019/181] 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 69123543a6..5478987f1c 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 020/181] 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 d19425ac59..53a60cc1ad 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 021/181] 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 fc5d70f2c4..bf301008f5 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 022/181] 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 60a96059dd..57f6a91fac 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 023/181] 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 9316d6efd0..e550e14550 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 024/181] 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 347446d75c..162a279442 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 025/181] 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 b5bb384989..ebf260f6f9 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 026/181] fix: broken bitbucket button --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index f0a9713cf8..f710ff66db 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 027/181] 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 bf301008f5..4b8eca5ec9 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 0d6402942d..20c830e0b8 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 028/181] 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 0ceb990881..0c9982e654 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 6ab24b78b7..aa8a43659a 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 3e48124394..3d8b7f376a 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 11ed61f934..36060b0fe7 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 5e0158b7aa..fde7254124 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 5604849101..006cc38a2e 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 731a38518e..40c7d3787d 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 029/181] 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 53a60cc1ad..27d0012859 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 36060b0fe7..791aaeddcf 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 fde7254124..2fcb1c8455 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 006cc38a2e..5cbb4ace83 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 40c7d3787d..82e2323985 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 030/181] 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 f00a4d7025..22ec0c49e7 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 aa8a43659a..a1708008c3 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 808fe2e2af..d7762b0ac1 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 791aaeddcf..b9ca2789ac 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 2fcb1c8455..5c27870869 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 5cbb4ace83..05676ad2fd 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 82e2323985..1f553fd51a 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 031/181] 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 e550e14550..80075a76ac 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 85bacb8997..eb773f016f 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 From 0bec0ca21889a4f801a62b302b3e19b3ec6c7dc4 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Wed, 5 Apr 2023 00:16:37 +0100 Subject: [PATCH 032/181] feat: convert functions dir to modules dir (#4169) * functions dir will be deleted after 14 days --- .github/workflows/version-check.sh | 2 +- lgsm/functions/core_dl.sh | 100 +-- lgsm/functions/core_exit.sh | 18 +- lgsm/functions/core_functions.sh | 2 +- lgsm/functions/core_getopt.sh | 10 +- lgsm/functions/core_github.sh | 6 +- lgsm/functions/core_legacy.sh | 11 +- lgsm/functions/core_logs.sh | 2 +- lgsm/functions/core_messages.sh | 2 +- lgsm/functions/core_modules.sh | 816 ++++++++++++++++++ lgsm/functions/core_steamcmd.sh | 4 +- lgsm/functions/core_trap.sh | 2 +- lgsm/{functions => modules}/README.md | 0 lgsm/{functions => modules}/alert.sh | 4 +- lgsm/{functions => modules}/alert_discord.sh | 2 +- lgsm/{functions => modules}/alert_email.sh | 2 +- lgsm/{functions => modules}/alert_gotify.sh | 2 +- lgsm/{functions => modules}/alert_ifttt.sh | 2 +- lgsm/{functions => modules}/alert_mailgun.sh | 2 +- .../alert_pushbullet.sh | 2 +- lgsm/{functions => modules}/alert_pushover.sh | 2 +- .../alert_rocketchat.sh | 2 +- lgsm/{functions => modules}/alert_slack.sh | 2 +- lgsm/{functions => modules}/alert_telegram.sh | 2 +- lgsm/{functions => modules}/check.sh | 4 +- lgsm/{functions => modules}/check_config.sh | 2 +- lgsm/{functions => modules}/check_deps.sh | 2 +- .../check_executable.sh | 2 +- lgsm/{functions => modules}/check_glibc.sh | 2 +- lgsm/{functions => modules}/check_ip.sh | 2 +- .../check_last_update.sh | 2 +- lgsm/{functions => modules}/check_logs.sh | 2 +- .../check_permissions.sh | 16 +- lgsm/{functions => modules}/check_root.sh | 2 +- lgsm/{functions => modules}/check_status.sh | 2 +- lgsm/{functions => modules}/check_steamcmd.sh | 4 +- .../check_system_dir.sh | 2 +- .../check_system_requirements.sh | 2 +- .../check_tmuxception.sh | 2 +- lgsm/{functions => modules}/check_version.sh | 2 +- lgsm/{functions => modules}/command_backup.sh | 2 +- .../command_check_update.sh | 2 +- .../{functions => modules}/command_console.sh | 2 +- lgsm/{functions => modules}/command_debug.sh | 2 +- .../{functions => modules}/command_details.sh | 2 +- .../command_dev_clear_modules.sh} | 12 +- .../command_dev_debug.sh | 2 +- .../command_dev_detect_deps.sh | 2 +- .../command_dev_detect_glibc.sh | 2 +- .../command_dev_detect_ldd.sh | 2 +- .../command_dev_query_raw.sh | 8 +- lgsm/{functions => modules}/command_fastdl.sh | 2 +- .../{functions => modules}/command_install.sh | 4 +- .../command_install_resources_mta.sh | 2 +- .../command_mods_install.sh | 2 +- .../command_mods_remove.sh | 2 +- .../command_mods_update.sh | 2 +- .../{functions => modules}/command_monitor.sh | 8 +- .../command_postdetails.sh | 4 +- .../{functions => modules}/command_restart.sh | 2 +- lgsm/{functions => modules}/command_send.sh | 2 +- .../command_skeleton.sh | 2 +- .../{functions => modules}/command_sponsor.sh | 2 +- lgsm/{functions => modules}/command_start.sh | 2 +- lgsm/{functions => modules}/command_stop.sh | 2 +- .../command_test_alert.sh | 2 +- .../command_ts3_server_pass.sh | 2 +- lgsm/{functions => modules}/command_update.sh | 2 +- .../command_update_linuxgsm.sh | 48 +- .../command_validate.sh | 2 +- lgsm/{functions => modules}/command_wipe.sh | 2 +- .../compress_unreal2_maps.sh | 2 +- .../compress_ut99_maps.sh | 2 +- lgsm/modules/core_dl.sh | 627 ++++++++++++++ lgsm/modules/core_exit.sh | 61 ++ lgsm/modules/core_functions.sh | 816 ++++++++++++++++++ lgsm/modules/core_getopt.sh | 215 +++++ lgsm/modules/core_github.sh | 114 +++ lgsm/modules/core_legacy.sh | 93 ++ lgsm/modules/core_logs.sh | 110 +++ lgsm/modules/core_messages.sh | 598 +++++++++++++ lgsm/modules/core_modules.sh | 816 ++++++++++++++++++ lgsm/modules/core_steamcmd.sh | 330 +++++++ lgsm/modules/core_trap.sh | 22 + lgsm/{functions => modules}/fix.sh | 8 +- lgsm/{functions => modules}/fix_ark.sh | 2 +- lgsm/{functions => modules}/fix_arma3.sh | 2 +- lgsm/{functions => modules}/fix_armar.sh | 2 +- lgsm/{functions => modules}/fix_av.sh | 2 +- lgsm/{functions => modules}/fix_bo.sh | 2 +- lgsm/{functions => modules}/fix_bt.sh | 2 +- lgsm/{functions => modules}/fix_cmw.sh | 2 +- lgsm/{functions => modules}/fix_csgo.sh | 2 +- lgsm/{functions => modules}/fix_dst.sh | 2 +- lgsm/{functions => modules}/fix_hw.sh | 2 +- lgsm/{functions => modules}/fix_ins.sh | 2 +- lgsm/{functions => modules}/fix_kf.sh | 2 +- lgsm/{functions => modules}/fix_kf2.sh | 2 +- lgsm/{functions => modules}/fix_lo.sh | 4 +- lgsm/{functions => modules}/fix_mcb.sh | 2 +- lgsm/{functions => modules}/fix_mta.sh | 2 +- lgsm/{functions => modules}/fix_nmrih.sh | 2 +- lgsm/{functions => modules}/fix_onset.sh | 2 +- lgsm/{functions => modules}/fix_ro.sh | 2 +- lgsm/{functions => modules}/fix_rust.sh | 2 +- lgsm/{functions => modules}/fix_rw.sh | 2 +- lgsm/{functions => modules}/fix_samp.sh | 2 +- lgsm/{functions => modules}/fix_sdtd.sh | 2 +- lgsm/{functions => modules}/fix_sfc.sh | 2 +- lgsm/{functions => modules}/fix_sof2.sh | 2 +- lgsm/{functions => modules}/fix_squad.sh | 2 +- lgsm/{functions => modules}/fix_st.sh | 2 +- lgsm/{functions => modules}/fix_steamcmd.sh | 2 +- lgsm/{functions => modules}/fix_terraria.sh | 2 +- lgsm/{functions => modules}/fix_tf2.sh | 2 +- lgsm/{functions => modules}/fix_ts3.sh | 2 +- lgsm/{functions => modules}/fix_unt.sh | 2 +- lgsm/{functions => modules}/fix_ut.sh | 2 +- lgsm/{functions => modules}/fix_ut2k4.sh | 2 +- lgsm/{functions => modules}/fix_ut3.sh | 2 +- lgsm/{functions => modules}/fix_vh.sh | 4 +- lgsm/{functions => modules}/fix_wurm.sh | 2 +- lgsm/{functions => modules}/fix_zmr.sh | 2 +- lgsm/{functions => modules}/info_distro.sh | 2 +- lgsm/{functions => modules}/info_game.sh | 2 +- lgsm/{functions => modules}/info_messages.sh | 2 +- lgsm/{functions => modules}/info_stats.sh | 2 +- .../install_complete.sh | 2 +- lgsm/{functions => modules}/install_config.sh | 2 +- .../install_dst_token.sh | 2 +- lgsm/{functions => modules}/install_eula.sh | 2 +- .../install_factorio_save.sh | 2 +- lgsm/{functions => modules}/install_gslt.sh | 2 +- lgsm/{functions => modules}/install_header.sh | 2 +- lgsm/{functions => modules}/install_logs.sh | 2 +- .../install_mta_resources.sh | 2 +- lgsm/{functions => modules}/install_retry.sh | 2 +- .../install_server_dir.sh | 2 +- .../install_server_files.sh | 2 +- .../install_squad_license.sh | 2 +- lgsm/{functions => modules}/install_stats.sh | 2 +- .../install_steamcmd.sh | 2 +- lgsm/{functions => modules}/install_ts3db.sh | 2 +- .../install_ut2k4_key.sh | 2 +- lgsm/{functions => modules}/mods_core.sh | 4 +- lgsm/{functions => modules}/mods_list.sh | 2 +- lgsm/{functions => modules}/query_gamedig.sh | 2 +- lgsm/{functions => modules}/query_gsquery.py | 2 +- .../{functions => modules}/update_factorio.sh | 2 +- .../update_jediknight2.sh | 2 +- .../update_minecraft.sh | 2 +- .../update_minecraft_bedrock.sh | 2 +- lgsm/{functions => modules}/update_mta.sh | 2 +- lgsm/{functions => modules}/update_papermc.sh | 4 +- .../{functions => modules}/update_steamcmd.sh | 4 +- lgsm/{functions => modules}/update_ts3.sh | 2 +- lgsm/{functions => modules}/update_ut99.sh | 2 +- .../update_vintagestory.sh | 2 +- linuxgsm.sh | 24 +- tests/tests_fctrserver.sh | 80 +- tests/tests_jc2server.sh | 94 +- tests/tests_mcserver.sh | 80 +- tests/tests_ts3server.sh | 80 +- 163 files changed, 5070 insertions(+), 441 deletions(-) mode change 100755 => 100644 lgsm/functions/core_dl.sh mode change 100755 => 100644 lgsm/functions/core_exit.sh mode change 100755 => 100644 lgsm/functions/core_getopt.sh mode change 100755 => 100644 lgsm/functions/core_legacy.sh mode change 100755 => 100644 lgsm/functions/core_logs.sh mode change 100755 => 100644 lgsm/functions/core_messages.sh create mode 100644 lgsm/functions/core_modules.sh mode change 100755 => 100644 lgsm/functions/core_steamcmd.sh mode change 100755 => 100644 lgsm/functions/core_trap.sh rename lgsm/{functions => modules}/README.md (100%) mode change 100755 => 100644 rename lgsm/{functions => modules}/alert.sh (98%) mode change 100755 => 100644 rename lgsm/{functions => modules}/alert_discord.sh (95%) mode change 100755 => 100644 rename lgsm/{functions => modules}/alert_email.sh (90%) mode change 100755 => 100644 rename lgsm/{functions => modules}/alert_gotify.sh (93%) rename lgsm/{functions => modules}/alert_ifttt.sh (93%) mode change 100755 => 100644 rename lgsm/{functions => modules}/alert_mailgun.sh (93%) mode change 100755 => 100644 rename lgsm/{functions => modules}/alert_pushbullet.sh (93%) mode change 100755 => 100644 rename lgsm/{functions => modules}/alert_pushover.sh (95%) mode change 100755 => 100644 rename lgsm/{functions => modules}/alert_rocketchat.sh (94%) mode change 100755 => 100644 rename lgsm/{functions => modules}/alert_slack.sh (96%) mode change 100755 => 100644 rename lgsm/{functions => modules}/alert_telegram.sh (94%) mode change 100755 => 100644 rename lgsm/{functions => modules}/check.sh (95%) mode change 100755 => 100644 rename lgsm/{functions => modules}/check_config.sh (94%) mode change 100755 => 100644 rename lgsm/{functions => modules}/check_deps.sh (99%) mode change 100755 => 100644 rename lgsm/{functions => modules}/check_executable.sh (89%) mode change 100755 => 100644 rename lgsm/{functions => modules}/check_glibc.sh (92%) mode change 100755 => 100644 rename lgsm/{functions => modules}/check_ip.sh (96%) mode change 100755 => 100644 rename lgsm/{functions => modules}/check_last_update.sh (92%) mode change 100755 => 100644 rename lgsm/{functions => modules}/check_logs.sh (90%) mode change 100755 => 100644 rename lgsm/{functions => modules}/check_permissions.sh (94%) mode change 100755 => 100644 rename lgsm/{functions => modules}/check_root.sh (89%) mode change 100755 => 100644 rename lgsm/{functions => modules}/check_status.sh (82%) mode change 100755 => 100644 rename lgsm/{functions => modules}/check_steamcmd.sh (82%) mode change 100755 => 100644 rename lgsm/{functions => modules}/check_system_dir.sh (88%) mode change 100755 => 100644 rename lgsm/{functions => modules}/check_system_requirements.sh (96%) mode change 100755 => 100644 rename lgsm/{functions => modules}/check_tmuxception.sh (94%) mode change 100755 => 100644 rename lgsm/{functions => modules}/check_version.sh (91%) mode change 100755 => 100644 rename lgsm/{functions => modules}/command_backup.sh (99%) rename lgsm/{functions => modules}/command_check_update.sh (93%) mode change 100755 => 100644 rename lgsm/{functions => modules}/command_console.sh (95%) mode change 100755 => 100644 rename lgsm/{functions => modules}/command_debug.sh (98%) mode change 100755 => 100644 rename lgsm/{functions => modules}/command_details.sh (93%) mode change 100755 => 100644 rename lgsm/{functions/command_dev_clear_functions.sh => modules/command_dev_clear_modules.sh} (60%) mode change 100755 => 100644 rename lgsm/{functions => modules}/command_dev_debug.sh (89%) mode change 100755 => 100644 rename lgsm/{functions => modules}/command_dev_detect_deps.sh (99%) mode change 100755 => 100644 rename lgsm/{functions => modules}/command_dev_detect_glibc.sh (97%) mode change 100755 => 100644 rename lgsm/{functions => modules}/command_dev_detect_ldd.sh (96%) mode change 100755 => 100644 rename lgsm/{functions => modules}/command_dev_query_raw.sh (97%) mode change 100755 => 100644 rename lgsm/{functions => modules}/command_fastdl.sh (99%) mode change 100755 => 100644 rename lgsm/{functions => modules}/command_install.sh (90%) mode change 100755 => 100644 rename lgsm/{functions => modules}/command_install_resources_mta.sh (94%) mode change 100755 => 100644 rename lgsm/{functions => modules}/command_mods_install.sh (98%) mode change 100755 => 100644 rename lgsm/{functions => modules}/command_mods_remove.sh (98%) mode change 100755 => 100644 rename lgsm/{functions => modules}/command_mods_update.sh (98%) mode change 100755 => 100644 rename lgsm/{functions => modules}/command_monitor.sh (95%) mode change 100755 => 100644 rename lgsm/{functions => modules}/command_postdetails.sh (94%) mode change 100755 => 100644 rename lgsm/{functions => modules}/command_restart.sh (83%) mode change 100755 => 100644 rename lgsm/{functions => modules}/command_send.sh (93%) rename lgsm/{functions => modules}/command_skeleton.sh (91%) rename lgsm/{functions => modules}/command_sponsor.sh (91%) mode change 100755 => 100644 rename lgsm/{functions => modules}/command_start.sh (99%) mode change 100755 => 100644 rename lgsm/{functions => modules}/command_stop.sh (99%) rename lgsm/{functions => modules}/command_test_alert.sh (83%) mode change 100755 => 100644 rename lgsm/{functions => modules}/command_ts3_server_pass.sh (95%) mode change 100755 => 100644 rename lgsm/{functions => modules}/command_update.sh (93%) mode change 100755 => 100644 rename lgsm/{functions => modules}/command_update_linuxgsm.sh (86%) mode change 100755 => 100644 rename lgsm/{functions => modules}/command_validate.sh (94%) mode change 100755 => 100644 rename lgsm/{functions => modules}/command_wipe.sh (98%) mode change 100755 => 100644 rename lgsm/{functions => modules}/compress_unreal2_maps.sh (92%) mode change 100755 => 100644 rename lgsm/{functions => modules}/compress_ut99_maps.sh (92%) mode change 100755 => 100644 create mode 100644 lgsm/modules/core_dl.sh create mode 100644 lgsm/modules/core_exit.sh create mode 100755 lgsm/modules/core_functions.sh create mode 100644 lgsm/modules/core_getopt.sh create mode 100644 lgsm/modules/core_github.sh create mode 100644 lgsm/modules/core_legacy.sh create mode 100644 lgsm/modules/core_logs.sh create mode 100644 lgsm/modules/core_messages.sh create mode 100644 lgsm/modules/core_modules.sh create mode 100644 lgsm/modules/core_steamcmd.sh create mode 100644 lgsm/modules/core_trap.sh rename lgsm/{functions => modules}/fix.sh (93%) mode change 100755 => 100644 rename lgsm/{functions => modules}/fix_ark.sh (97%) mode change 100755 => 100644 rename lgsm/{functions => modules}/fix_arma3.sh (89%) mode change 100755 => 100644 rename lgsm/{functions => modules}/fix_armar.sh (86%) rename lgsm/{functions => modules}/fix_av.sh (90%) mode change 100755 => 100644 rename lgsm/{functions => modules}/fix_bo.sh (81%) rename lgsm/{functions => modules}/fix_bt.sh (91%) rename lgsm/{functions => modules}/fix_cmw.sh (89%) mode change 100755 => 100644 rename lgsm/{functions => modules}/fix_csgo.sh (95%) mode change 100755 => 100644 rename lgsm/{functions => modules}/fix_dst.sh (91%) mode change 100755 => 100644 rename lgsm/{functions => modules}/fix_hw.sh (81%) mode change 100755 => 100644 rename lgsm/{functions => modules}/fix_ins.sh (89%) mode change 100755 => 100644 rename lgsm/{functions => modules}/fix_kf.sh (93%) mode change 100755 => 100644 rename lgsm/{functions => modules}/fix_kf2.sh (87%) mode change 100755 => 100644 rename lgsm/{functions => modules}/fix_lo.sh (80%) rename lgsm/{functions => modules}/fix_mcb.sh (84%) mode change 100755 => 100644 rename lgsm/{functions => modules}/fix_mta.sh (89%) mode change 100755 => 100644 rename lgsm/{functions => modules}/fix_nmrih.sh (93%) mode change 100755 => 100644 rename lgsm/{functions => modules}/fix_onset.sh (91%) mode change 100755 => 100644 rename lgsm/{functions => modules}/fix_ro.sh (94%) mode change 100755 => 100644 rename lgsm/{functions => modules}/fix_rust.sh (94%) mode change 100755 => 100644 rename lgsm/{functions => modules}/fix_rw.sh (80%) mode change 100755 => 100644 rename lgsm/{functions => modules}/fix_samp.sh (94%) rename lgsm/{functions => modules}/fix_sdtd.sh (81%) mode change 100755 => 100644 rename lgsm/{functions => modules}/fix_sfc.sh (95%) mode change 100755 => 100644 rename lgsm/{functions => modules}/fix_sof2.sh (82%) mode change 100755 => 100644 rename lgsm/{functions => modules}/fix_squad.sh (92%) rename lgsm/{functions => modules}/fix_st.sh (84%) rename lgsm/{functions => modules}/fix_steamcmd.sh (98%) mode change 100755 => 100644 rename lgsm/{functions => modules}/fix_terraria.sh (75%) mode change 100755 => 100644 rename lgsm/{functions => modules}/fix_tf2.sh (88%) mode change 100755 => 100644 rename lgsm/{functions => modules}/fix_ts3.sh (94%) mode change 100755 => 100644 rename lgsm/{functions => modules}/fix_unt.sh (81%) mode change 100755 => 100644 rename lgsm/{functions => modules}/fix_ut.sh (83%) mode change 100755 => 100644 rename lgsm/{functions => modules}/fix_ut2k4.sh (93%) mode change 100755 => 100644 rename lgsm/{functions => modules}/fix_ut3.sh (91%) mode change 100755 => 100644 rename lgsm/{functions => modules}/fix_vh.sh (92%) mode change 100755 => 100644 rename lgsm/{functions => modules}/fix_wurm.sh (87%) mode change 100755 => 100644 rename lgsm/{functions => modules}/fix_zmr.sh (95%) mode change 100755 => 100644 rename lgsm/{functions => modules}/info_distro.sh (99%) mode change 100755 => 100644 rename lgsm/{functions => modules}/info_game.sh (99%) rename lgsm/{functions => modules}/info_messages.sh (99%) mode change 100755 => 100644 rename lgsm/{functions => modules}/info_stats.sh (99%) mode change 100755 => 100644 rename lgsm/{functions => modules}/install_complete.sh (86%) mode change 100755 => 100644 rename lgsm/{functions => modules}/install_config.sh (99%) mode change 100755 => 100644 rename lgsm/{functions => modules}/install_dst_token.sh (95%) mode change 100755 => 100644 rename lgsm/{functions => modules}/install_eula.sh (95%) mode change 100755 => 100644 rename lgsm/{functions => modules}/install_factorio_save.sh (86%) mode change 100755 => 100644 rename lgsm/{functions => modules}/install_gslt.sh (96%) mode change 100755 => 100644 rename lgsm/{functions => modules}/install_header.sh (91%) mode change 100755 => 100644 rename lgsm/{functions => modules}/install_logs.sh (97%) mode change 100755 => 100644 rename lgsm/{functions => modules}/install_mta_resources.sh (88%) mode change 100755 => 100644 rename lgsm/{functions => modules}/install_retry.sh (82%) mode change 100755 => 100644 rename lgsm/{functions => modules}/install_server_dir.sh (89%) mode change 100755 => 100644 rename lgsm/{functions => modules}/install_server_files.sh (99%) mode change 100755 => 100644 rename lgsm/{functions => modules}/install_squad_license.sh (93%) mode change 100755 => 100644 rename lgsm/{functions => modules}/install_stats.sh (93%) mode change 100755 => 100644 rename lgsm/{functions => modules}/install_steamcmd.sh (83%) mode change 100755 => 100644 rename lgsm/{functions => modules}/install_ts3db.sh (97%) mode change 100755 => 100644 rename lgsm/{functions => modules}/install_ut2k4_key.sh (93%) mode change 100755 => 100644 rename lgsm/{functions => modules}/mods_core.sh (99%) mode change 100755 => 100644 rename lgsm/{functions => modules}/mods_list.sh (99%) mode change 100755 => 100644 rename lgsm/{functions => modules}/query_gamedig.sh (97%) mode change 100755 => 100644 rename lgsm/{functions => modules}/query_gsquery.py (99%) mode change 100755 => 100644 rename lgsm/{functions => modules}/update_factorio.sh (98%) rename lgsm/{functions => modules}/update_jediknight2.sh (98%) rename lgsm/{functions => modules}/update_minecraft.sh (98%) rename lgsm/{functions => modules}/update_minecraft_bedrock.sh (98%) rename lgsm/{functions => modules}/update_mta.sh (98%) rename lgsm/{functions => modules}/update_papermc.sh (98%) rename lgsm/{functions => modules}/update_steamcmd.sh (87%) rename lgsm/{functions => modules}/update_ts3.sh (98%) rename lgsm/{functions => modules}/update_ut99.sh (98%) rename lgsm/{functions => modules}/update_vintagestory.sh (98%) mode change 100755 => 100644 diff --git a/.github/workflows/version-check.sh b/.github/workflows/version-check.sh index 4e7280509f..a5f21c5cb1 100644 --- a/.github/workflows/version-check.sh +++ b/.github/workflows/version-check.sh @@ -1,6 +1,6 @@ #!/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 '="') +modulesversion=$(grep "modulesversion=" lgsm/modules/core_modules.sh | sed -e 's/modulesversion//g' | tr -d '="') if [ "${version}" != "${modulesversion}" ]; then echo "Error! LinuxGSM version mismatch" diff --git a/lgsm/functions/core_dl.sh b/lgsm/functions/core_dl.sh old mode 100755 new mode 100644 index 27d0012859..405e9dc6b5 --- a/lgsm/functions/core_dl.sh +++ b/lgsm/functions/core_dl.sh @@ -17,7 +17,7 @@ # 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]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_dl_steamcmd() { fn_print_start_nl "${remotelocation}" @@ -453,11 +453,13 @@ fn_fetch_file() { fi } -# GitHub file download functions. +# GitHub file download modules. # Used to simplify downloading specific files from GitHub. -# github_fileurl_dir: the directory of the file in the GitHub: lgsm/functions -# github_fileurl_name: the filename of the file to download from GitHub: core_messages.sh +# github_file_url_dir: the directory of the file in the GitHub: lgsm/modules +# github_file_url_name: the filename of the file to download from GitHub: core_messages.sh +# github_file_url_dir: the directory of the file in the GitHub: lgsm/modules +# github_file_url_name: the filename of the file to download from GitHub: core_messages.sh # githuburl: the full GitHub url # remote_fileurl: The URL of the file: http://example.com/dl/File.tar.bz2 @@ -470,58 +472,58 @@ fn_fetch_file() { # Fetches files from the Git repo. fn_fetch_file_github() { - github_fileurl_dir="${1}" - github_fileurl_name="${2}" + github_file_url_dir="${1}" + github_file_url_name="${2}" # For legacy versions - code can be removed at a future date if [ "${legacymode}" == "1" ]; then - 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}" + remote_fileurl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" + remote_fileurl_backup="https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" # If master branch will currently running LinuxGSM version to prevent "version mixing". This is ignored if a fork. 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}" + 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 - 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}" + remote_fileurl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" + remote_fileurl_backup="https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" fi remote_fileurl_name="GitHub" remote_fileurl_backup_name="Bitbucket" local_filedir="${3}" - local_filename="${github_fileurl_name}" + local_filename="${github_file_url_name}" chmodx="${4:-0}" run="${5:-0}" forcedl="${6:-0}" hash="${7:-0}" - # Passes vars to the file download function. + # Passes vars to the file download module. 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() { - github_fileurl_dir="${1}" - github_fileurl_name="${2}" + github_file_url_dir="${1}" + github_file_url_name="${2}" 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}" + 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 - 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}" + remote_fileurl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" + remote_fileurl_backup="https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" fi remote_fileurl_name="GitHub" remote_fileurl_backup_name="Bitbucket" - fn_check_file "${remote_fileurl}" "${remote_fileurl_backup}" "${remote_fileurl_name}" "${remote_fileurl_backup_name}" "${github_fileurl_name}" + fn_check_file "${remote_fileurl}" "${remote_fileurl_backup}" "${remote_fileurl_name}" "${remote_fileurl_backup_name}" "${github_file_url_name}" } # Fetches config files from the Git repo. fn_fetch_config() { - github_fileurl_dir="${1}" - github_fileurl_name="${2}" + 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}" == "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}" + 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 - 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}" + remote_fileurl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" + remote_fileurl_backup="https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" fi remote_fileurl_name="GitHub" remote_fileurl_backup_name="Bitbucket" @@ -531,55 +533,55 @@ fn_fetch_config() { run="norun" forcedl="noforce" hash="nohash" - # Passes vars to the file download function. + # Passes vars to the file download module. fn_fetch_file "${remote_fileurl}" "${remote_fileurl_backup}" "${remote_fileurl_name}" "${remote_fileurl_backup_name}" "${local_filedir}" "${local_filename}" "${chmodx}" "${run}" "${forcedl}" "${hash}" } # Fetches modules from the Git repo during first download. -fn_fetch_function() { - github_fileurl_dir="lgsm/functions" - github_fileurl_name="${functionfile}" +fn_fetch_module() { + github_file_url_dir="lgsm/modules" + github_file_url_name="${modulefile}" # If master branch will currently running LinuxGSM version to prevent "version mixing". This is ignored if a fork. 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}" + 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 - 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}" + remote_fileurl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" + remote_fileurl_backup="https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" fi remote_fileurl_name="GitHub" remote_fileurl_backup_name="Bitbucket" - local_filedir="${functionsdir}" - local_filename="${github_fileurl_name}" + local_filedir="${modulesdir}" + local_filename="${github_file_url_name}" chmodx="chmodx" run="run" forcedl="noforce" hash="nohash" - # Passes vars to the file download function. + # Passes vars to the file download module. fn_fetch_file "${remote_fileurl}" "${remote_fileurl_backup}" "${remote_fileurl_name}" "${remote_fileurl_backup_name}" "${local_filedir}" "${local_filename}" "${chmodx}" "${run}" "${forcedl}" "${hash}" } # Fetches modules from the Git repo during update-lgsm. -fn_update_function() { - github_fileurl_dir="lgsm/functions" - github_fileurl_name="${functionfile}" +fn_update_module() { + github_file_url_dir="lgsm/modules" + github_file_url_name="${modulefile}" # If master branch will currently running LinuxGSM version to prevent "version mixing". This is ignored if a fork. 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}" + 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 - 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}" + remote_fileurl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" + remote_fileurl_backup="https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" fi remote_fileurl_name="GitHub" remote_fileurl_backup_name="Bitbucket" - local_filedir="${functionsdir}" - local_filename="${github_fileurl_name}" + local_filedir="${modulesdir}" + local_filename="${github_file_url_name}" chmodx="chmodx" run="norun" forcedl="noforce" hash="nohash" - # Passes vars to the file download function. + # Passes vars to the file download module. fn_fetch_file "${remote_fileurl}" "${remote_fileurl_backup}" "${remote_fileurl_name}" "${remote_fileurl_backup_name}" "${local_filedir}" "${local_filename}" "${chmodx}" "${run}" "${forcedl}" "${hash}" } @@ -618,7 +620,7 @@ fn_dl_latest_release_github() { fn_print_fail_nl "Cannot get version from GitHub API for ${githubreleaseuser}/${githubreleaserepo}" fn_script_log_fatal "Cannot get version from GitHub API for ${githubreleaseuser}/${githubreleaserepo}" else - # Fetch file from the remote location from the existing function to the ${tmpdir} for now. + # Fetch file from the remote location from the existing module to the ${tmpdir} for now. fn_fetch_file "${githubreleasedownloadlink}" "" "${githubreleasefilename}" "" "${githubreleasedownloadpath}" "${githubreleasefilename}" fi fi diff --git a/lgsm/functions/core_exit.sh b/lgsm/functions/core_exit.sh old mode 100755 new mode 100644 index 95d9d8cae0..a8686c2a88 --- a/lgsm/functions/core_exit.sh +++ b/lgsm/functions/core_exit.sh @@ -5,14 +5,14 @@ # Website: https://linuxgsm.com # Description: Handles exiting of LinuxGSM by running and reporting an exit code. -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_exit_dev_debug() { if [ -f "${rootdir}/.dev-debug" ]; then echo -e "" - echo -e "${functionselfname} exiting with code: ${exitcode}" + echo -e "${moduleselfname} exiting with code: ${exitcode}" if [ -f "${rootdir}/dev-debug.log" ]; then - grep "functionfile=" "${rootdir}/dev-debug.log" | sed 's/functionfile=//g' > "${rootdir}/dev-debug-function-order.log" + grep "modulefile=" "${rootdir}/dev-debug.log" | sed 's/modulefile=//g' > "${rootdir}/dev-debug-module-order.log" fi fi } @@ -29,13 +29,13 @@ elif [ "${exitcode}" != "0" ]; then # List LinuxGSM version in logs fn_script_log_info "LinuxGSM version: ${version}" if [ "${exitcode}" == "1" ]; then - fn_script_log_fatal "${functionselfname} exiting with code: ${exitcode}" + fn_script_log_fatal "${moduleselfname} exiting with code: ${exitcode}" elif [ "${exitcode}" == "2" ]; then - fn_script_log_error "${functionselfname} exiting with code: ${exitcode}" + fn_script_log_error "${moduleselfname} exiting with code: ${exitcode}" elif [ "${exitcode}" == "3" ]; then - fn_script_log_warn "${functionselfname} exiting with code: ${exitcode}" + fn_script_log_warn "${moduleselfname} exiting with code: ${exitcode}" else - fn_script_log_warn "${functionselfname} exiting with code: ${exitcode}" + fn_script_log_warn "${moduleselfname} exiting with code: ${exitcode}" fi fn_exit_dev_debug # remove trap. @@ -44,7 +44,7 @@ elif [ "${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}" + fn_script_log_pass "${moduleselfname} exiting with code: ${exitcode}" fn_exit_dev_debug # remove trap. trap - INT @@ -53,7 +53,7 @@ else # List LinuxGSM version in logs fn_script_log_info "LinuxGSM version: ${version}" fn_print_error "No exit code set" - fn_script_log_pass "${functionselfname} exiting with code: NOT SET" + fn_script_log_pass "${moduleselfname} exiting with code: NOT SET" fn_exit_dev_debug # remove trap. trap - INT diff --git a/lgsm/functions/core_functions.sh b/lgsm/functions/core_functions.sh index a1708008c3..07a2ebd09f 100755 --- a/lgsm/functions/core_functions.sh +++ b/lgsm/functions/core_functions.sh @@ -6,7 +6,7 @@ # Description: Defines all functions to allow download and execution of functions using fn_fetch_function. # This function is called first before any other function. Without this file other functions will not load. -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +module_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" modulesversion="v23.2.0" diff --git a/lgsm/functions/core_getopt.sh b/lgsm/functions/core_getopt.sh old mode 100755 new mode 100644 index d7762b0ac1..222ad0cf88 --- a/lgsm/functions/core_getopt.sh +++ b/lgsm/functions/core_getopt.sh @@ -5,7 +5,7 @@ # Website: https://linuxgsm.com # Description: getopt arguments. -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" ### Define all commands here. ## User commands | Trigger commands | Description @@ -18,11 +18,11 @@ 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_update_linuxgsm=("ul;update-lgsm;uf;update-modules" "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_sponsor=("s;sponsor" "command_sponsor.sh" "Donation options.") +cmd_sponso=("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.") @@ -54,7 +54,7 @@ cmd_dev_detect_deps=("dd;detect-deps" "command_dev_detect_deps.sh" "Detect requi cmd_dev_detect_glibc=("dg;detect-glibc" "command_dev_detect_glibc.sh" "Detect required glibc.") cmd_dev_detect_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_clear_modules=("cf;clear-modules" "command_dev_clear_modules.sh" "Delete the contents of the modules dir.") ### Set specific opt here. @@ -145,7 +145,7 @@ currentopt+=("${cmd_install[@]}" "${cmd_auto_install[@]}") ## Developer commands. 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_modules[@]}") fi ## Sponsor. diff --git a/lgsm/functions/core_github.sh b/lgsm/functions/core_github.sh index 0462e65bfa..228fe1078d 100644 --- a/lgsm/functions/core_github.sh +++ b/lgsm/functions/core_github.sh @@ -1,11 +1,11 @@ #!/bin/bash -# LinuxGSM core_github.sh function +# LinuxGSM core_github.sh module # Author: Daniel Gibbs # Contributors: http://linuxgsm.com/contrib # Website: https://linuxgsm.com -# Description: core function file for updates via github +# Description: core module file for updates via github -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" github_api="https://api.github.com" diff --git a/lgsm/functions/core_legacy.sh b/lgsm/functions/core_legacy.sh old mode 100755 new mode 100644 index f9aa514551..2ed942abd1 --- a/lgsm/functions/core_legacy.sh +++ b/lgsm/functions/core_legacy.sh @@ -5,7 +5,7 @@ # Website: https://linuxgsm.com # Description: Code for backwards compatability with older versions of LinuxGSM. -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(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) @@ -78,6 +78,15 @@ if [ -z "${wsstartmap}" ]; then fi fi +# Added as part of migrating functions dir to modules dir. +# Will remove functions dir if files in modules dir older than 14 days +functionsdir="${lgsmdir}/modules" +if [ -d "${lgsmdir}/functions" ]; then + if [ "$(find "${lgsmdir}/modules"/ -type f -mtime +"14" | wc -l)" -ne "0" ]; then + rm -rf "${lgsmdir:?}/functions" + fi +fi + fn_parms() { fn_reload_startparameters parms="${startparameters}" diff --git a/lgsm/functions/core_logs.sh b/lgsm/functions/core_logs.sh old mode 100755 new mode 100644 index 1f0e275400..8057f30f74 --- a/lgsm/functions/core_logs.sh +++ b/lgsm/functions/core_logs.sh @@ -5,7 +5,7 @@ # Website: https://linuxgsm.com # Description: Acts as a log rotator, removing old logs. -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" # Check if logfile variable and file exist, create logfile if it doesn't exist. if [ "${consolelog}" ]; then diff --git a/lgsm/functions/core_messages.sh b/lgsm/functions/core_messages.sh old mode 100755 new mode 100644 index 5362dd3d30..6d3ca9a25a --- a/lgsm/functions/core_messages.sh +++ b/lgsm/functions/core_messages.sh @@ -5,7 +5,7 @@ # Website: https://linuxgsm.com # Description: Defines on-screen messages such as [ OK ] and how script logs look. -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(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. diff --git a/lgsm/functions/core_modules.sh b/lgsm/functions/core_modules.sh new file mode 100644 index 0000000000..8eb843b5a5 --- /dev/null +++ b/lgsm/functions/core_modules.sh @@ -0,0 +1,816 @@ +#!/bin/bash +# LinuxGSM core_modules.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Defines all modules to allow download and execution of modules using fn_fetch_module. +# This module is called first before any other module. Without this file other modules will not load. + +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +modulesversion="v23.2.0" + +# Core + +core_dl.sh() { + modulefile="${FUNCNAME[0]}" + if [ "$(type fn_fetch_core_dl 2> /dev/null)" ]; then + fn_fetch_core_dl "lgsm/modules" "core_dl.sh" "${modulesdir}" "chmodx" "run" "noforcedl" "nohash" + else + fn_bootstrap_fetch_file_github "lgsm/modules" "core_dl.sh" "${modulesdir}" "chmodx" "run" "noforcedl" "nohash" + fi +} + +core_messages.sh() { + modulefile="${FUNCNAME[0]}" + if [ "$(type fn_fetch_core_dl 2> /dev/null)" ]; then + fn_fetch_core_dl "lgsm/modules" "core_messages.sh" "${modulesdir}" "chmodx" "run" "noforcedl" "nohash" + else + fn_bootstrap_fetch_file_github "lgsm/modules" "core_messages.sh" "${modulesdir}" "chmodx" "run" "noforcedl" "nohash" + fi +} + +core_legacy.sh() { + modulefile="${FUNCNAME[0]}" + if [ "$(type fn_fetch_core_dl 2> /dev/null)" ]; then + fn_fetch_core_dl "lgsm/modules" "core_legacy.sh" "${modulesdir}" "chmodx" "run" "noforcedl" "nohash" + else + fn_bootstrap_fetch_file_github "lgsm/modules" "core_legacy.sh" "${modulesdir}" "chmodx" "run" "noforcedl" "nohash" + fi +} + +core_exit.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +core_getopt.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +core_trap.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +core_steamcmd.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +core_github.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +# Commands + +command_backup.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +command_console.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +command_debug.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +command_details.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +command_sponsor.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +command_postdetails.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +command_test_alert.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +command_monitor.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +command_start.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +command_stop.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +command_validate.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +command_install.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +command_install_resources_mta.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +install_squad_license.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +command_mods_install.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +command_mods_update.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +command_mods_remove.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +command_fastdl.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +command_ts3_server_pass.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +command_restart.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +command_skeleton.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +command_wipe.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +command_send.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +# Checks + +check.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +check_config.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +check_deps.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +check_executable.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +check_glibc.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +check_ip.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +check_last_update.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +check_logs.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +check_permissions.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +check_root.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +check_status.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +check_steamcmd.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +check_system_dir.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +check_system_requirements.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +check_tmuxception.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +check_version.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +# Compress + +compress_unreal2_maps.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +compress_ut99_maps.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +# Mods + +mods_list.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +mods_core.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +# Dev + +command_dev_clear_modules.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +command_dev_debug.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +command_dev_detect_deps.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +command_dev_detect_glibc.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +command_dev_detect_ldd.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +command_dev_query_raw.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +# Fix + +fix.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +fix_ark.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +fix_av.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +fix_arma3.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +fix_armar.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +fix_bt.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +fix_bo.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +fix_cmw.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +fix_csgo.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +fix_dst.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +fix_hw.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +fix_ins.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +fix_kf.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +fix_kf2.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +fix_lo.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +fix_mcb.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +fix_mta.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +fix_nmrih.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +fix_onset.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +fix_ro.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +fix_rust.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +fix_rw.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +fix_sfc.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +fix_st.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +fix_steamcmd.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +fix_terraria.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +fix_tf2.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +fix_ut3.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +fix_rust.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +fix_samp.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +fix_sdtd.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +fix_sof2.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +fix_squad.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +fix_ts3.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +fix_ut2k4.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +fix_ut.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +fix_unt.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +fix_vh.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +fix_wurm.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +fix_zmr.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +# Info + +info_distro.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +info_game.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +info_messages.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +info_stats.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +# Alert + +alert.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +alert_discord.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +alert_email.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +alert_ifttt.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +alert_mailgun.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +alert_pushbullet.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +alert_pushover.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +alert_gotify.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +alert_telegram.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +alert_rocketchat.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +alert_slack.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} +# Logs + +core_logs.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +# Query + +query_gamedig.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +# Update + +command_update_modules.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +command_update_linuxgsm.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +command_update.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +command_check_update.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +update_ts3.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +update_minecraft.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +update_minecraft_bedrock.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +update_papermc.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +update_mta.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +update_factorio.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +update_jediknight2.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +update_steamcmd.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +update_vintagestory.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +update_ut99.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +fn_update_modules.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +# +## Installer modules +# + +fn_autoinstall() { + autoinstall=1 + command_install.sh +} + +install_complete.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +install_config.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +install_factorio_save.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +install_dst_token.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +install_eula.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +install_gsquery.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +install_gslt.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +install_header.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +install_logs.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +install_retry.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +install_server_dir.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} +install_server_files.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +install_stats.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +install_steamcmd.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +install_ts3.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +install_ts3db.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +install_ut2k4.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +install_dl_ut2k4.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +install_ut2k4_key.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +# Calls code required for legacy servers +core_legacy.sh + +# Creates tmp dir if missing +if [ ! -d "${tmpdir}" ]; then + mkdir -p "${tmpdir}" +fi + +# Creates lock dir if missing +if [ ! -d "${lockdir}" ]; then + mkdir -p "${lockdir}" +fi + +# Calls on-screen messages (bootstrap) +core_messages.sh + +#Calls file downloader (bootstrap) +core_dl.sh + +# Calls the global Ctrl-C trap +core_trap.sh diff --git a/lgsm/functions/core_steamcmd.sh b/lgsm/functions/core_steamcmd.sh old mode 100755 new mode 100644 index 119748fb71..78c30f60ae --- a/lgsm/functions/core_steamcmd.sh +++ b/lgsm/functions/core_steamcmd.sh @@ -3,9 +3,9 @@ # Author: Daniel Gibbs # Contributors: http://linuxgsm.com/contrib # Website: https://linuxgsm.com -# Description: Core functions for SteamCMD +# Description: Core modules for SteamCMD -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_install_steamcmd() { if [ "${shortname}" == "ark" ] && [ "${installsteamcmd}" == "1" ]; then diff --git a/lgsm/functions/core_trap.sh b/lgsm/functions/core_trap.sh old mode 100755 new mode 100644 index ae2b794706..ea6fce8692 --- a/lgsm/functions/core_trap.sh +++ b/lgsm/functions/core_trap.sh @@ -5,7 +5,7 @@ # Website: https://linuxgsm.com # Description: Handles CTRL-C trap to give an exit code. -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_exit_trap() { if [ -z "${exitcode}" ]; then diff --git a/lgsm/functions/README.md b/lgsm/modules/README.md old mode 100755 new mode 100644 similarity index 100% rename from lgsm/functions/README.md rename to lgsm/modules/README.md diff --git a/lgsm/functions/alert.sh b/lgsm/modules/alert.sh old mode 100755 new mode 100644 similarity index 98% rename from lgsm/functions/alert.sh rename to lgsm/modules/alert.sh index 59deae2b6e..c7ed897f92 --- a/lgsm/functions/alert.sh +++ b/lgsm/modules/alert.sh @@ -3,9 +3,9 @@ # Author: Daniel Gibbs # Contributors: http://linuxgsm.com/contrib # Website: https://linuxgsm.com -# Description: Overall function for managing alerts. +# Description: Overall module for managing alerts. -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" # Generates alert log of the details at the time of the alert. # Used with email alerts. diff --git a/lgsm/functions/alert_discord.sh b/lgsm/modules/alert_discord.sh old mode 100755 new mode 100644 similarity index 95% rename from lgsm/functions/alert_discord.sh rename to lgsm/modules/alert_discord.sh index 7708175163..a384de3db0 --- a/lgsm/functions/alert_discord.sh +++ b/lgsm/modules/alert_discord.sh @@ -5,7 +5,7 @@ # Website: https://linuxgsm.com # Description: Sends Discord alert. -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" json=$( cat << EOF diff --git a/lgsm/functions/alert_email.sh b/lgsm/modules/alert_email.sh old mode 100755 new mode 100644 similarity index 90% rename from lgsm/functions/alert_email.sh rename to lgsm/modules/alert_email.sh index ad90e880f1..e2cf5f1230 --- a/lgsm/functions/alert_email.sh +++ b/lgsm/modules/alert_email.sh @@ -5,7 +5,7 @@ # Website: https://linuxgsm.com # Description: Sends email alert. -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_print_dots "Sending Email alert: ${email}" fn_sleep_time diff --git a/lgsm/functions/alert_gotify.sh b/lgsm/modules/alert_gotify.sh similarity index 93% rename from lgsm/functions/alert_gotify.sh rename to lgsm/modules/alert_gotify.sh index faeba45934..ef833ba75b 100644 --- a/lgsm/functions/alert_gotify.sh +++ b/lgsm/modules/alert_gotify.sh @@ -5,7 +5,7 @@ # Website: https://linuxgsm.com # Description: Sends Gotify alert. -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +module_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" json=$( cat << EOF diff --git a/lgsm/functions/alert_ifttt.sh b/lgsm/modules/alert_ifttt.sh old mode 100755 new mode 100644 similarity index 93% rename from lgsm/functions/alert_ifttt.sh rename to lgsm/modules/alert_ifttt.sh index f8bbc24ad8..ae0de8ed6f --- a/lgsm/functions/alert_ifttt.sh +++ b/lgsm/modules/alert_ifttt.sh @@ -5,7 +5,7 @@ # Website: https://linuxgsm.com # Description: Sends IFTTT alert. -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" json=$( cat << EOF diff --git a/lgsm/functions/alert_mailgun.sh b/lgsm/modules/alert_mailgun.sh old mode 100755 new mode 100644 similarity index 93% rename from lgsm/functions/alert_mailgun.sh rename to lgsm/modules/alert_mailgun.sh index 25576209cd..a25c826486 --- a/lgsm/functions/alert_mailgun.sh +++ b/lgsm/modules/alert_mailgun.sh @@ -5,7 +5,7 @@ # Website: https://linuxgsm.com # Description: Sends Mailgun Email alert. -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" if [ "${mailgunapiregion}" == "eu" ]; then mailgunapiurl="https://api.eu.mailgun.net" diff --git a/lgsm/functions/alert_pushbullet.sh b/lgsm/modules/alert_pushbullet.sh old mode 100755 new mode 100644 similarity index 93% rename from lgsm/functions/alert_pushbullet.sh rename to lgsm/modules/alert_pushbullet.sh index 3e82d0db02..eec1416110 --- a/lgsm/functions/alert_pushbullet.sh +++ b/lgsm/modules/alert_pushbullet.sh @@ -5,7 +5,7 @@ # Website: https://linuxgsm.com # Description: Sends Pushbullet Messenger alert. -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" json=$( cat << EOF diff --git a/lgsm/functions/alert_pushover.sh b/lgsm/modules/alert_pushover.sh old mode 100755 new mode 100644 similarity index 95% rename from lgsm/functions/alert_pushover.sh rename to lgsm/modules/alert_pushover.sh index d7c0864787..608e73c30e --- a/lgsm/functions/alert_pushover.sh +++ b/lgsm/modules/alert_pushover.sh @@ -5,7 +5,7 @@ # Website: https://linuxgsm.com # Description: Sends Pushover alert. -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_print_dots "Sending Pushover alert" diff --git a/lgsm/functions/alert_rocketchat.sh b/lgsm/modules/alert_rocketchat.sh old mode 100755 new mode 100644 similarity index 94% rename from lgsm/functions/alert_rocketchat.sh rename to lgsm/modules/alert_rocketchat.sh index 34d018e386..875a6ff5df --- a/lgsm/functions/alert_rocketchat.sh +++ b/lgsm/modules/alert_rocketchat.sh @@ -5,7 +5,7 @@ # Website: https://linuxgsm.com # Description: Sends Rocketchat alert. -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" json=$( cat << EOF diff --git a/lgsm/functions/alert_slack.sh b/lgsm/modules/alert_slack.sh old mode 100755 new mode 100644 similarity index 96% rename from lgsm/functions/alert_slack.sh rename to lgsm/modules/alert_slack.sh index 2e87c1571a..3bb148828f --- a/lgsm/functions/alert_slack.sh +++ b/lgsm/modules/alert_slack.sh @@ -5,7 +5,7 @@ # Website: https://linuxgsm.com # Description: Sends Slack alert. -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" json=$( cat << EOF diff --git a/lgsm/functions/alert_telegram.sh b/lgsm/modules/alert_telegram.sh old mode 100755 new mode 100644 similarity index 94% rename from lgsm/functions/alert_telegram.sh rename to lgsm/modules/alert_telegram.sh index 27e34beb4c..77b89560ca --- a/lgsm/functions/alert_telegram.sh +++ b/lgsm/modules/alert_telegram.sh @@ -5,7 +5,7 @@ # Website: https://linuxgsm.com # Description: Sends Telegram Messenger alert. -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" json=$( cat << EOF diff --git a/lgsm/functions/check.sh b/lgsm/modules/check.sh old mode 100755 new mode 100644 similarity index 95% rename from lgsm/functions/check.sh rename to lgsm/modules/check.sh index 239a24140a..f0f49fc51c --- a/lgsm/functions/check.sh +++ b/lgsm/modules/check.sh @@ -3,10 +3,10 @@ # Author: Daniel Gibbs # Contributors: http://linuxgsm.com/contrib # Website: https://linuxgsm.com -# Description: Overall function for managing checks. +# Description: Overall module for managing checks. # Runs checks that will either halt on or fix an issue. -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" # Every command that requires checks just references check.sh. # check.sh selects which checks to run by using arrays. diff --git a/lgsm/functions/check_config.sh b/lgsm/modules/check_config.sh old mode 100755 new mode 100644 similarity index 94% rename from lgsm/functions/check_config.sh rename to lgsm/modules/check_config.sh index 2c65243eb5..4f96a8db47 --- a/lgsm/functions/check_config.sh +++ b/lgsm/modules/check_config.sh @@ -5,7 +5,7 @@ # Website: https://linuxgsm.com # Description: Checks if the server config is missing and warns the user if needed. -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" if [ -n "${servercfgfullpath}" ] && [ ! -f "${servercfgfullpath}" ]; then fn_print_dots "" diff --git a/lgsm/functions/check_deps.sh b/lgsm/modules/check_deps.sh old mode 100755 new mode 100644 similarity index 99% rename from lgsm/functions/check_deps.sh rename to lgsm/modules/check_deps.sh index bb8507769c..1db5c96c3d --- a/lgsm/functions/check_deps.sh +++ b/lgsm/modules/check_deps.sh @@ -5,7 +5,7 @@ # Website: https://linuxgsm.com # Description: Checks and installs missing dependencies. -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_install_mono_repo() { if [ "${autodepinstall}" == "0" ]; then diff --git a/lgsm/functions/check_executable.sh b/lgsm/modules/check_executable.sh old mode 100755 new mode 100644 similarity index 89% rename from lgsm/functions/check_executable.sh rename to lgsm/modules/check_executable.sh index d1b5c3efd0..40721fbf4b --- a/lgsm/functions/check_executable.sh +++ b/lgsm/modules/check_executable.sh @@ -5,7 +5,7 @@ # Website: https://linuxgsm.com # Description: Checks if server executable exists. -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" # Check if executable exists execname=$(basename "${executable}") diff --git a/lgsm/functions/check_glibc.sh b/lgsm/modules/check_glibc.sh old mode 100755 new mode 100644 similarity index 92% rename from lgsm/functions/check_glibc.sh rename to lgsm/modules/check_glibc.sh index b1a959f5b4..25357a4610 --- a/lgsm/functions/check_glibc.sh +++ b/lgsm/modules/check_glibc.sh @@ -5,7 +5,7 @@ # Website: https://linuxgsm.com # Description: Checks if the server has the correct Glibc version. -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" info_distro.sh diff --git a/lgsm/functions/check_ip.sh b/lgsm/modules/check_ip.sh old mode 100755 new mode 100644 similarity index 96% rename from lgsm/functions/check_ip.sh rename to lgsm/modules/check_ip.sh index 4b8eca5ec9..8dc0567b97 --- a/lgsm/functions/check_ip.sh +++ b/lgsm/modules/check_ip.sh @@ -6,7 +6,7 @@ # Description: Automatically identifies the server interface IP. # If multiple interfaces are detected the user will need to manually set using ip="0.0.0.0". -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" info_game.sh diff --git a/lgsm/functions/check_last_update.sh b/lgsm/modules/check_last_update.sh old mode 100755 new mode 100644 similarity index 92% rename from lgsm/functions/check_last_update.sh rename to lgsm/modules/check_last_update.sh index ee86c0ba14..d4f2d8f899 --- a/lgsm/functions/check_last_update.sh +++ b/lgsm/modules/check_last_update.sh @@ -6,7 +6,7 @@ # Description: Checks lock file to see when last update happened. # Will reboot server if instance not rebooted since update. -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" if [ -f "${lockdir}/${selfname}-laststart.lock" ]; then laststart=$(cat "${lockdir}/${selfname}-laststart.lock") diff --git a/lgsm/functions/check_logs.sh b/lgsm/modules/check_logs.sh old mode 100755 new mode 100644 similarity index 90% rename from lgsm/functions/check_logs.sh rename to lgsm/modules/check_logs.sh index fa3df92d10..2087ac9157 --- a/lgsm/functions/check_logs.sh +++ b/lgsm/modules/check_logs.sh @@ -5,7 +5,7 @@ # Website: https://linuxgsm.com # Description: Checks if log files exist. -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_check_logs() { fn_print_dots "Checking for log files" diff --git a/lgsm/functions/check_permissions.sh b/lgsm/modules/check_permissions.sh old mode 100755 new mode 100644 similarity index 94% rename from lgsm/functions/check_permissions.sh rename to lgsm/modules/check_permissions.sh index 0094456ec3..bb3e6764f1 --- a/lgsm/functions/check_permissions.sh +++ b/lgsm/modules/check_permissions.sh @@ -5,7 +5,7 @@ # Website: https://linuxgsm.com # Description: Checks ownership & permissions of scripts, files and directories. -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_check_ownership() { if [ -f "${rootdir}/${selfname}" ]; then @@ -13,8 +13,8 @@ fn_check_ownership() { selfownissue=1 fi fi - if [ -d "${functionsdir}" ]; then - if [ "$(find "${functionsdir}" -not -user "$(whoami)" | wc -l)" -ne "0" ]; then + if [ -d "${modulesdir}" ]; then + if [ "$(find "${modulesdir}" -not -user "$(whoami)" | wc -l)" -ne "0" ]; then funcownissue=1 fi fi @@ -34,7 +34,7 @@ fn_check_ownership() { find "${rootdir}/${selfname}" -not -user "$(whoami)" -printf "%u\t%g\t%p\n" fi if [ "${funcownissue}" == "1" ]; then - find "${functionsdir}" -not -user "$(whoami)" -printf "%u\t%g\t%p\n" + find "${modulesdir}" -not -user "$(whoami)" -printf "%u\t%g\t%p\n" fi if [ "${filesownissue}" == "1" ]; then find "${serverfiles}" -not -user "$(whoami)" -printf "%u\t%g\t%p\n" @@ -53,15 +53,15 @@ fn_check_ownership() { } fn_check_permissions() { - if [ -d "${functionsdir}" ]; then - if [ "$(find "${functionsdir}" -type f -not -executable | wc -l)" -ne "0" ]; then + if [ -d "${modulesdir}" ]; then + if [ "$(find "${modulesdir}" -type f -not -executable | wc -l)" -ne "0" ]; then fn_print_fail_nl "Permissions issues found" fn_script_log_fatal "Permissions issues found" fn_print_information_nl "The following files are not executable:" fn_script_log_info "The following files are not executable:" { echo -e "File\n" - find "${functionsdir}" -type f -not -executable -printf "%p\n" + find "${modulesdir}" -type f -not -executable -printf "%p\n" } | column -s $'\t' -t | tee -a "${lgsmlog}" if [ "${monitorflag}" == 1 ]; then alert="permissions" @@ -141,7 +141,7 @@ fn_check_permissions() { fi } -## The following fn_sys_perm_* functions checks for permission errors in /sys directory. +## The following fn_sys_perm_* modules checks for permission errors in /sys directory. # Checks for permission errors in /sys directory. fn_sys_perm_errors_detect() { diff --git a/lgsm/functions/check_root.sh b/lgsm/modules/check_root.sh old mode 100755 new mode 100644 similarity index 89% rename from lgsm/functions/check_root.sh rename to lgsm/modules/check_root.sh index dab0331487..26475601a8 --- a/lgsm/functions/check_root.sh +++ b/lgsm/modules/check_root.sh @@ -5,7 +5,7 @@ # Website: https://linuxgsm.com # Description: Checks if the user tried to run the script as root. -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" if [ "$(whoami)" == "root" ] && [ ! -f /.dockerenv ]; then if [ "${commandname}" != "INSTALL" ]; then diff --git a/lgsm/functions/check_status.sh b/lgsm/modules/check_status.sh old mode 100755 new mode 100644 similarity index 82% rename from lgsm/functions/check_status.sh rename to lgsm/modules/check_status.sh index 28ec38eb25..2ebfb30550 --- a/lgsm/functions/check_status.sh +++ b/lgsm/modules/check_status.sh @@ -5,6 +5,6 @@ # Website: https://linuxgsm.com # Description: Checks the process status of the server. Either online or offline. -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" status=$(tmux list-sessions -F "#{session_name}" 2> /dev/null | grep -Ecx "^${sessionname}") diff --git a/lgsm/functions/check_steamcmd.sh b/lgsm/modules/check_steamcmd.sh old mode 100755 new mode 100644 similarity index 82% rename from lgsm/functions/check_steamcmd.sh rename to lgsm/modules/check_steamcmd.sh index d41e8669f4..5d14bb21f1 --- a/lgsm/functions/check_steamcmd.sh +++ b/lgsm/modules/check_steamcmd.sh @@ -5,9 +5,9 @@ # Website: https://linuxgsm.com # Description: Checks if SteamCMD is installed correctly. -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" -# init steamcmd functions +# init steamcmd functions. core_steamcmd.sh fn_check_steamcmd_clear diff --git a/lgsm/functions/check_system_dir.sh b/lgsm/modules/check_system_dir.sh old mode 100755 new mode 100644 similarity index 88% rename from lgsm/functions/check_system_dir.sh rename to lgsm/modules/check_system_dir.sh index 0a732d6d13..9f0f5f0920 --- a/lgsm/functions/check_system_dir.sh +++ b/lgsm/modules/check_system_dir.sh @@ -5,7 +5,7 @@ # Website: https://linuxgsm.com # Description: Checks if systemdir/serverfiles is accessible. -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" if [ "${commandname}" != "VALIDATE" ]; then checkdir="${serverfiles}" diff --git a/lgsm/functions/check_system_requirements.sh b/lgsm/modules/check_system_requirements.sh old mode 100755 new mode 100644 similarity index 96% rename from lgsm/functions/check_system_requirements.sh rename to lgsm/modules/check_system_requirements.sh index bfe597135c..114292f462 --- a/lgsm/functions/check_system_requirements.sh +++ b/lgsm/modules/check_system_requirements.sh @@ -5,7 +5,7 @@ # Website: https://linuxgsm.com # Description: Checks RAM requirements. -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" info_distro.sh diff --git a/lgsm/functions/check_tmuxception.sh b/lgsm/modules/check_tmuxception.sh old mode 100755 new mode 100644 similarity index 94% rename from lgsm/functions/check_tmuxception.sh rename to lgsm/modules/check_tmuxception.sh index 64705a3a8b..aded5cb2dc --- a/lgsm/functions/check_tmuxception.sh +++ b/lgsm/modules/check_tmuxception.sh @@ -5,7 +5,7 @@ # Website: https://linuxgsm.com # Description: Checks if run from tmux or screen. -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_check_is_in_tmux() { if [ "${TMUX}" ]; then diff --git a/lgsm/functions/check_version.sh b/lgsm/modules/check_version.sh old mode 100755 new mode 100644 similarity index 91% rename from lgsm/functions/check_version.sh rename to lgsm/modules/check_version.sh index 657e32b54c..3ca0158434 --- a/lgsm/functions/check_version.sh +++ b/lgsm/modules/check_version.sh @@ -6,7 +6,7 @@ # Description: Will run update-lgsm if gameserver.sh and modules version does not match # this will allow gameserver.sh to update - useful for multi instance servers. -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" if [ -n "${modulesversion}" ] && [ -n "${version}" ] && [ "${version}" != "${modulesversion}" ]; then exitbypass=1 diff --git a/lgsm/functions/command_backup.sh b/lgsm/modules/command_backup.sh similarity index 99% rename from lgsm/functions/command_backup.sh rename to lgsm/modules/command_backup.sh index d69c57a0fd..1973eb95fc 100644 --- a/lgsm/functions/command_backup.sh +++ b/lgsm/modules/command_backup.sh @@ -7,7 +7,7 @@ commandname="BACKUP" commandaction="Backing up" -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_firstcommand_set check.sh diff --git a/lgsm/functions/command_check_update.sh b/lgsm/modules/command_check_update.sh old mode 100755 new mode 100644 similarity index 93% rename from lgsm/functions/command_check_update.sh rename to lgsm/modules/command_check_update.sh index 3753c72c65..f079f36167 --- a/lgsm/functions/command_check_update.sh +++ b/lgsm/modules/command_check_update.sh @@ -7,7 +7,7 @@ commandname="CHECK-UPDATE" commandaction="check for Update" -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_firstcommand_set fn_print_dots "" diff --git a/lgsm/functions/command_console.sh b/lgsm/modules/command_console.sh old mode 100755 new mode 100644 similarity index 95% rename from lgsm/functions/command_console.sh rename to lgsm/modules/command_console.sh index 5b84789e66..e95f2d0e59 --- a/lgsm/functions/command_console.sh +++ b/lgsm/modules/command_console.sh @@ -7,7 +7,7 @@ commandname="CONSOLE" commandaction="Access console" -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_firstcommand_set check.sh diff --git a/lgsm/functions/command_debug.sh b/lgsm/modules/command_debug.sh old mode 100755 new mode 100644 similarity index 98% rename from lgsm/functions/command_debug.sh rename to lgsm/modules/command_debug.sh index c6422be651..52efd04db7 --- a/lgsm/functions/command_debug.sh +++ b/lgsm/modules/command_debug.sh @@ -7,7 +7,7 @@ commandname="DEBUG" commandaction="Debuging" -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_firstcommand_set # Trap to remove lockfile on quit. diff --git a/lgsm/functions/command_details.sh b/lgsm/modules/command_details.sh old mode 100755 new mode 100644 similarity index 93% rename from lgsm/functions/command_details.sh rename to lgsm/modules/command_details.sh index 08d9f031b4..2c8e3a6585 --- a/lgsm/functions/command_details.sh +++ b/lgsm/modules/command_details.sh @@ -7,7 +7,7 @@ commandname="DETAILS" commandaction="Viewing details" -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_firstcommand_set # Run checks and gathers details to display. diff --git a/lgsm/functions/command_dev_clear_functions.sh b/lgsm/modules/command_dev_clear_modules.sh old mode 100755 new mode 100644 similarity index 60% rename from lgsm/functions/command_dev_clear_functions.sh rename to lgsm/modules/command_dev_clear_modules.sh index 87c77515d3..52d07ee1ad --- a/lgsm/functions/command_dev_clear_functions.sh +++ b/lgsm/modules/command_dev_clear_modules.sh @@ -1,21 +1,21 @@ #!/bin/bash -# LinuxGSM command_dev_clear_functions.sh module +# LinuxGSM command_dev_clear_modules.sh module # Author: Daniel Gibbs # Contributors: http://linuxgsm.com/contrib # Website: https://linuxgsm.com -# Description: Deletes the contents of the functions dir. +# Description: Deletes the contents of the modules dir. commandname="DEV-CLEAR-MODULES" commandaction="Clearing modules" -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_firstcommand_set echo -e "=================================" -echo -e "Clear Functions" +echo -e "Clear Modules" echo -e "=================================" echo -e "" -if fn_prompt_yn "Do you want to delete all functions?" Y; then - rm -rfv "${functionsdir:?}/"* +if fn_prompt_yn "Do you want to delete all modules?" Y; then + rm -rfv "${modulesdir:?}/"* rm -rfv "${configdirdefault:?}/"* fn_script_log_info "Cleared modules directory" fn_script_log_info "Cleared default config directory" diff --git a/lgsm/functions/command_dev_debug.sh b/lgsm/modules/command_dev_debug.sh old mode 100755 new mode 100644 similarity index 89% rename from lgsm/functions/command_dev_debug.sh rename to lgsm/modules/command_dev_debug.sh index 19f16d58e2..081bda6117 --- a/lgsm/functions/command_dev_debug.sh +++ b/lgsm/modules/command_dev_debug.sh @@ -7,7 +7,7 @@ commandname="DEV-DEBUG" commandaction="Developer debug" -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_firstcommand_reset if [ -f "${rootdir}/.dev-debug" ]; then diff --git a/lgsm/functions/command_dev_detect_deps.sh b/lgsm/modules/command_dev_detect_deps.sh old mode 100755 new mode 100644 similarity index 99% rename from lgsm/functions/command_dev_detect_deps.sh rename to lgsm/modules/command_dev_detect_deps.sh index d16b744189..763ab5554c --- a/lgsm/functions/command_dev_detect_deps.sh +++ b/lgsm/modules/command_dev_detect_deps.sh @@ -7,7 +7,7 @@ commandname="DEV-DETECT-DEPS" commandaction="Developer detect deps" -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_firstcommand_set echo -e "=================================" diff --git a/lgsm/functions/command_dev_detect_glibc.sh b/lgsm/modules/command_dev_detect_glibc.sh old mode 100755 new mode 100644 similarity index 97% rename from lgsm/functions/command_dev_detect_glibc.sh rename to lgsm/modules/command_dev_detect_glibc.sh index 73280e55d3..8ff87d7110 --- a/lgsm/functions/command_dev_detect_glibc.sh +++ b/lgsm/modules/command_dev_detect_glibc.sh @@ -8,7 +8,7 @@ commandname="DEV-DETECT-GLIBC" commandaction="Developer detect glibc" -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_firstcommand_set echo -e "=================================" diff --git a/lgsm/functions/command_dev_detect_ldd.sh b/lgsm/modules/command_dev_detect_ldd.sh old mode 100755 new mode 100644 similarity index 96% rename from lgsm/functions/command_dev_detect_ldd.sh rename to lgsm/modules/command_dev_detect_ldd.sh index 43630d4e93..877c8d95bc --- a/lgsm/functions/command_dev_detect_ldd.sh +++ b/lgsm/modules/command_dev_detect_ldd.sh @@ -8,7 +8,7 @@ commandname="DEV-DETECT-LDD" commandaction="Developer detect ldd" -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_firstcommand_set echo -e "=================================" diff --git a/lgsm/functions/command_dev_query_raw.sh b/lgsm/modules/command_dev_query_raw.sh old mode 100755 new mode 100644 similarity index 97% rename from lgsm/functions/command_dev_query_raw.sh rename to lgsm/modules/command_dev_query_raw.sh index 26884b2598..0d30e75bfc --- a/lgsm/functions/command_dev_query_raw.sh +++ b/lgsm/modules/command_dev_query_raw.sh @@ -7,7 +7,7 @@ commandname="DEV-QUERY-RAW" commandaction="Developer query raw" -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_firstcommand_set check.sh @@ -229,10 +229,10 @@ echo -e "" for queryip in "${queryips[@]}"; do echo -e "./query_gsquery.py -a \"${queryip}\" -p \"${queryport}\" -e \"${querytype}\"" echo -e "" - if [ ! -f "${functionsdir}/query_gsquery.py" ]; then - fn_fetch_file_github "lgsm/functions" "query_gsquery.py" "${functionsdir}" "chmodx" "norun" "noforce" "nohash" + if [ ! -f "${modulesdir}/query_gsquery.py" ]; then + fn_fetch_file_github "lgsm/modules" "query_gsquery.py" "${modulesdir}" "chmodx" "norun" "noforce" "nohash" fi - "${functionsdir}"/query_gsquery.py -a "${queryip}" -p "${queryport}" -e "${querytype}" + "${modulesdir}"/query_gsquery.py -a "${queryip}" -p "${queryport}" -e "${querytype}" done echo -e "" echo -e "${lightgreen}TCP Raw Output${default}" diff --git a/lgsm/functions/command_fastdl.sh b/lgsm/modules/command_fastdl.sh old mode 100755 new mode 100644 similarity index 99% rename from lgsm/functions/command_fastdl.sh rename to lgsm/modules/command_fastdl.sh index 78abd650a1..4aff9994d9 --- a/lgsm/functions/command_fastdl.sh +++ b/lgsm/modules/command_fastdl.sh @@ -7,7 +7,7 @@ commandname="FASTDL" commandaction="Fastdl" -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_firstcommand_set check.sh diff --git a/lgsm/functions/command_install.sh b/lgsm/modules/command_install.sh old mode 100755 new mode 100644 similarity index 90% rename from lgsm/functions/command_install.sh rename to lgsm/modules/command_install.sh index 19dc59c7ee..32f846fac0 --- a/lgsm/functions/command_install.sh +++ b/lgsm/modules/command_install.sh @@ -3,11 +3,11 @@ # Author: Daniel Gibbs # Contributors: http://linuxgsm.com/contrib # Website: https://linuxgsm.com -# Description: Overall function for the installer. +# Description: Overall module for the installer. commandname="INSTALL" commandaction="Installing" -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_firstcommand_set check.sh diff --git a/lgsm/functions/command_install_resources_mta.sh b/lgsm/modules/command_install_resources_mta.sh old mode 100755 new mode 100644 similarity index 94% rename from lgsm/functions/command_install_resources_mta.sh rename to lgsm/modules/command_install_resources_mta.sh index daf0395511..c3d745a301 --- a/lgsm/functions/command_install_resources_mta.sh +++ b/lgsm/modules/command_install_resources_mta.sh @@ -7,7 +7,7 @@ commandname="DEFAULT-RESOURCES" commandaction="Default Resources" -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_firstcommand_set fn_install_resources() { diff --git a/lgsm/functions/command_mods_install.sh b/lgsm/modules/command_mods_install.sh old mode 100755 new mode 100644 similarity index 98% rename from lgsm/functions/command_mods_install.sh rename to lgsm/modules/command_mods_install.sh index 0edbe5bc04..d602be2cd3 --- a/lgsm/functions/command_mods_install.sh +++ b/lgsm/modules/command_mods_install.sh @@ -7,7 +7,7 @@ commandname="MODS-INSTALL" commandaction="Installing mods" -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_firstcommand_set check.sh diff --git a/lgsm/functions/command_mods_remove.sh b/lgsm/modules/command_mods_remove.sh old mode 100755 new mode 100644 similarity index 98% rename from lgsm/functions/command_mods_remove.sh rename to lgsm/modules/command_mods_remove.sh index 7127dcb3ca..08095c8e86 --- a/lgsm/functions/command_mods_remove.sh +++ b/lgsm/modules/command_mods_remove.sh @@ -7,7 +7,7 @@ commandname="MODS-REMOVE" commandaction="Removing mods" -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_firstcommand_set check.sh diff --git a/lgsm/functions/command_mods_update.sh b/lgsm/modules/command_mods_update.sh old mode 100755 new mode 100644 similarity index 98% rename from lgsm/functions/command_mods_update.sh rename to lgsm/modules/command_mods_update.sh index 80b23fea9c..b917f191f5 --- a/lgsm/functions/command_mods_update.sh +++ b/lgsm/modules/command_mods_update.sh @@ -7,7 +7,7 @@ commandname="MODS-UPDATE" commandaction="Updating mods" -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_firstcommand_set check.sh diff --git a/lgsm/functions/command_monitor.sh b/lgsm/modules/command_monitor.sh old mode 100755 new mode 100644 similarity index 95% rename from lgsm/functions/command_monitor.sh rename to lgsm/modules/command_monitor.sh index 20c830e0b8..f2db9ca2d5 --- a/lgsm/functions/command_monitor.sh +++ b/lgsm/modules/command_monitor.sh @@ -8,7 +8,7 @@ commandname="MONITOR" commandaction="Monitoring" -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_firstcommand_set fn_monitor_check_lockfile() { @@ -84,10 +84,10 @@ fn_monitor_check_queryport() { } fn_query_gsquery() { - if [ ! -f "${functionsdir}/query_gsquery.py" ]; then - fn_fetch_file_github "lgsm/functions" "query_gsquery.py" "${functionsdir}" "chmodx" "norun" "noforce" "nohash" + if [ ! -f "${modulesdir}/query_gsquery.py" ]; then + fn_fetch_file_github "lgsm/modules" "query_gsquery.py" "${modulesdir}" "chmodx" "norun" "noforce" "nohash" fi - "${functionsdir}"/query_gsquery.py -a "${queryip}" -p "${queryport}" -e "${querytype}" > /dev/null 2>&1 + "${modulesdir}"/query_gsquery.py -a "${queryip}" -p "${queryport}" -e "${querytype}" > /dev/null 2>&1 querystatus="$?" } diff --git a/lgsm/functions/command_postdetails.sh b/lgsm/modules/command_postdetails.sh old mode 100755 new mode 100644 similarity index 94% rename from lgsm/functions/command_postdetails.sh rename to lgsm/modules/command_postdetails.sh index dad44d9afb..736c9ec272 --- a/lgsm/functions/command_postdetails.sh +++ b/lgsm/modules/command_postdetails.sh @@ -7,12 +7,12 @@ commandname="POST-DETAILS" commandaction="Posting details" -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_firstcommand_set posttarget="https://termbin.com" -# source all of the functions defined in the details command. +# source all of the modules defined in the details command. info_messages.sh fn_bad_postdetailslog() { diff --git a/lgsm/functions/command_restart.sh b/lgsm/modules/command_restart.sh old mode 100755 new mode 100644 similarity index 83% rename from lgsm/functions/command_restart.sh rename to lgsm/modules/command_restart.sh index 3bf60c32cd..b7bb1f3e3c --- a/lgsm/functions/command_restart.sh +++ b/lgsm/modules/command_restart.sh @@ -7,7 +7,7 @@ commandname="MODS-INSTALL" commandaction="Restarting" -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_firstcommand_set info_game.sh diff --git a/lgsm/functions/command_send.sh b/lgsm/modules/command_send.sh similarity index 93% rename from lgsm/functions/command_send.sh rename to lgsm/modules/command_send.sh index c143276f62..8ba8f8412d 100644 --- a/lgsm/functions/command_send.sh +++ b/lgsm/modules/command_send.sh @@ -7,7 +7,7 @@ commandname="SEND" commandaction="Send" -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_firstcommand_set check.sh diff --git a/lgsm/functions/command_skeleton.sh b/lgsm/modules/command_skeleton.sh similarity index 91% rename from lgsm/functions/command_skeleton.sh rename to lgsm/modules/command_skeleton.sh index 53c4ddec52..01a7f4e7ee 100644 --- a/lgsm/functions/command_skeleton.sh +++ b/lgsm/modules/command_skeleton.sh @@ -5,7 +5,7 @@ # Website: https://linuxgsm.com # Description: Creates an copy of a game servers directorys. -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_print_dots "Creating skeleton directory" check.sh diff --git a/lgsm/functions/command_sponsor.sh b/lgsm/modules/command_sponsor.sh old mode 100755 new mode 100644 similarity index 91% rename from lgsm/functions/command_sponsor.sh rename to lgsm/modules/command_sponsor.sh index 22ec0c49e7..336f20f0a6 --- a/lgsm/functions/command_sponsor.sh +++ b/lgsm/modules/command_sponsor.sh @@ -7,7 +7,7 @@ commandname="SPONSOR" commandaction="Sponsor" -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_firstcommand_set fn_print_ascii_logo diff --git a/lgsm/functions/command_start.sh b/lgsm/modules/command_start.sh old mode 100755 new mode 100644 similarity index 99% rename from lgsm/functions/command_start.sh rename to lgsm/modules/command_start.sh index 04c6b4e645..e5021cde24 --- a/lgsm/functions/command_start.sh +++ b/lgsm/modules/command_start.sh @@ -7,7 +7,7 @@ commandname="START" commandaction="Starting" -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" addtimestamp="gawk '{ print strftime(\\\"[$logtimestampformat]\\\"), \\\$0 }'" fn_firstcommand_set diff --git a/lgsm/functions/command_stop.sh b/lgsm/modules/command_stop.sh similarity index 99% rename from lgsm/functions/command_stop.sh rename to lgsm/modules/command_stop.sh index d18ef7c23a..564f5ed4c3 100644 --- a/lgsm/functions/command_stop.sh +++ b/lgsm/modules/command_stop.sh @@ -7,7 +7,7 @@ commandname="STOP" commandaction="Stopping" -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_firstcommand_set # Attempts graceful shutdown by sending 'CTRL+c'. diff --git a/lgsm/functions/command_test_alert.sh b/lgsm/modules/command_test_alert.sh old mode 100755 new mode 100644 similarity index 83% rename from lgsm/functions/command_test_alert.sh rename to lgsm/modules/command_test_alert.sh index 7fe61e48a9..15f4813913 --- a/lgsm/functions/command_test_alert.sh +++ b/lgsm/modules/command_test_alert.sh @@ -7,7 +7,7 @@ commandname="TEST-ALERT" commandaction="Sending Alert" -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_firstcommand_set fn_print_dots "${servername}" diff --git a/lgsm/functions/command_ts3_server_pass.sh b/lgsm/modules/command_ts3_server_pass.sh old mode 100755 new mode 100644 similarity index 95% rename from lgsm/functions/command_ts3_server_pass.sh rename to lgsm/modules/command_ts3_server_pass.sh index be0816d15f..4814ab1421 --- a/lgsm/functions/command_ts3_server_pass.sh +++ b/lgsm/modules/command_ts3_server_pass.sh @@ -7,7 +7,7 @@ commandname="CHANGE-PASSWORD" commandaction="Changing password" -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_firstcommand_set fn_serveradmin_password_prompt() { diff --git a/lgsm/functions/command_update.sh b/lgsm/modules/command_update.sh old mode 100755 new mode 100644 similarity index 93% rename from lgsm/functions/command_update.sh rename to lgsm/modules/command_update.sh index ae5c2065c6..5993609c0e --- a/lgsm/functions/command_update.sh +++ b/lgsm/modules/command_update.sh @@ -7,7 +7,7 @@ commandname="UPDATE" commandaction="Updating" -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_firstcommand_set fn_print_dots "" diff --git a/lgsm/functions/command_update_linuxgsm.sh b/lgsm/modules/command_update_linuxgsm.sh old mode 100755 new mode 100644 similarity index 86% rename from lgsm/functions/command_update_linuxgsm.sh rename to lgsm/modules/command_update_linuxgsm.sh index 569bc7cdb9..3c4e6d0809 --- a/lgsm/functions/command_update_linuxgsm.sh +++ b/lgsm/modules/command_update_linuxgsm.sh @@ -3,11 +3,11 @@ # Author: Daniel Gibbs # Contributors: http://linuxgsm.com/contrib # Website: https://linuxgsm.com -# Description: Deletes the functions dir to allow re-downloading of functions from GitHub. +# Description: Deletes the modules dir to allow re-downloading of modules from GitHub. commandname="UPDATE-LGSM" commandaction="Updating LinuxGSM" -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_firstcommand_set check.sh @@ -180,49 +180,49 @@ if [ -f "${datadir}/${distroid}-${distroversioncsv}.csv" ]; then fi fi # Check and update modules. -if [ -n "${functionsdir}" ]; then - if [ -d "${functionsdir}" ]; then +if [ -n "${modulesdir}" ]; then + if [ -d "${modulesdir}" ]; then ( - cd "${functionsdir}" || exit - for functionfile in *; do + cd "${modulesdir}" || exit + for modulefile 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" + echo -en "checking ${remotereponame} module ${modulefile}...\c" + github_file_url_dir="lgsm/modules" 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}/${modulefile}" 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}/${modulefile}" 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_script_log_error "Checking ${remotereponame} module ${modulefile}" + echo -en "removing module ${modulefile}...\c" + if ! rm -f "${modulefile:?}"; then fn_print_fail_eol_nl - fn_script_log_fatal "Removing module ${functionfile}" + fn_script_log_fatal "Removing module ${modulefile}" core_exit.sh else fn_print_ok_eol_nl - fn_script_log_pass "Removing module ${functionfile}" + fn_script_log_pass "Removing module ${modulefile}" fi else # 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}")) + module_file_diff=$(diff "${modulesdir}/${modulefile}" <(curl --connect-timeout 10 -s "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${modulefile}")) else - function_file_diff=$(diff "${functionsdir}/${functionfile}" <(curl --connect-timeout 10 -s "https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/${github_file_url_dir}/${functionfile}")) + module_file_diff=$(diff "${modulesdir}/${modulefile}" <(curl --connect-timeout 10 -s "https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/${github_file_url_dir}/${modulefile}")) fi # results - if [ "${function_file_diff}" != "" ]; then + if [ "${module_file_diff}" != "" ]; then fn_print_update_eol_nl - fn_script_log_update "Checking ${remotereponame} module ${functionfile}" - rm -rf "${functionsdir:?}/${functionfile}" - fn_update_function + fn_script_log_update "Checking ${remotereponame} module ${modulefile}" + rm -rf "${modulesdir:?}/${modulefile}" + fn_update_module else fn_print_ok_eol_nl - fn_script_log_pass "Checking ${remotereponame} module ${functionfile}" + fn_script_log_pass "Checking ${remotereponame} module ${modulefile}" fi fi done @@ -230,7 +230,7 @@ if [ -n "${functionsdir}" ]; then fi fi -fn_print_ok_nl "Updating functions" -fn_script_log_pass "Updating functions" +fn_print_ok_nl "Updating modules" +fn_script_log_pass "Updating modules" core_exit.sh diff --git a/lgsm/functions/command_validate.sh b/lgsm/modules/command_validate.sh old mode 100755 new mode 100644 similarity index 94% rename from lgsm/functions/command_validate.sh rename to lgsm/modules/command_validate.sh index 15257a3e28..23ee92a268 --- a/lgsm/functions/command_validate.sh +++ b/lgsm/modules/command_validate.sh @@ -7,7 +7,7 @@ commandname="VALIDATE" commandaction="Validating" -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_firstcommand_set fn_validate() { diff --git a/lgsm/functions/command_wipe.sh b/lgsm/modules/command_wipe.sh old mode 100755 new mode 100644 similarity index 98% rename from lgsm/functions/command_wipe.sh rename to lgsm/modules/command_wipe.sh index e1677e8276..193d2cd2dd --- a/lgsm/functions/command_wipe.sh +++ b/lgsm/modules/command_wipe.sh @@ -7,7 +7,7 @@ commandname="WIPE" commandaction="Wiping" -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_firstcommand_set # Provides an exit code upon error. diff --git a/lgsm/functions/compress_unreal2_maps.sh b/lgsm/modules/compress_unreal2_maps.sh old mode 100755 new mode 100644 similarity index 92% rename from lgsm/functions/compress_unreal2_maps.sh rename to lgsm/modules/compress_unreal2_maps.sh index 0c32d3c77b..f67ac70103 --- a/lgsm/functions/compress_unreal2_maps.sh +++ b/lgsm/modules/compress_unreal2_maps.sh @@ -7,7 +7,7 @@ commandname="MAP-COMPRESSOR" commandaction="Compressing maps" -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_firstcommand_set check.sh diff --git a/lgsm/functions/compress_ut99_maps.sh b/lgsm/modules/compress_ut99_maps.sh old mode 100755 new mode 100644 similarity index 92% rename from lgsm/functions/compress_ut99_maps.sh rename to lgsm/modules/compress_ut99_maps.sh index 9aa074ba9a..51bbd386ae --- a/lgsm/functions/compress_ut99_maps.sh +++ b/lgsm/modules/compress_ut99_maps.sh @@ -7,7 +7,7 @@ commandname="MAP-COMPRESSOR" commandaction="Compressing maps" -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_firstcommand_set check.sh diff --git a/lgsm/modules/core_dl.sh b/lgsm/modules/core_dl.sh new file mode 100644 index 0000000000..405e9dc6b5 --- /dev/null +++ b/lgsm/modules/core_dl.sh @@ -0,0 +1,627 @@ +#!/bin/bash +# LinuxGSM core_dl.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Deals with all downloads for LinuxGSM. + +# remote_fileurl: The URL of the file: http://example.com/dl/File.tar.bz2 +# local_filedir: location the file is to be saved: /home/server/lgsm/tmp +# local_filename: name of file (this can be different from the url name): file.tar.bz2 +# chmodx: Optional, set to "chmodx" to make file executable using chmod +x +# run: Optional, set run to execute the file after download +# forcedl: Optional, force re-download of file even if exists +# 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}" "${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" + +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +fn_dl_steamcmd() { + fn_print_start_nl "${remotelocation}" + fn_script_log_info "${commandaction} ${selfname}: ${remotelocation}" + if [ -n "${branch}" ]; then + echo -e "Branch: ${branch}" + fn_script_log_info "Branch: ${branch}" + fi + if [ -n "${betapassword}" ]; then + echo -e "Branch password: ${betapassword}" + fn_script_log_info "Branch password: ${betapassword}" + fi + if [ -d "${steamcmddir}" ]; then + cd "${steamcmddir}" || exit + fi + + # Unbuffer will allow the output of steamcmd not buffer allowing a smooth output. + # unbuffer us part of the expect package. + if [ "$(command -v unbuffer)" ]; then + unbuffer="unbuffer" + fi + + # Validate will be added as a parameter if required. + if [ "${commandname}" == "VALIDATE" ] || [ "${commandname}" == "INSTALL" ]; then + validate="validate" + fi + + # To do error checking for SteamCMD the output of steamcmd will be saved to a log. + steamcmdlog="${lgsmlogdir}/${selfname}-steamcmd.log" + + # clear previous steamcmd log + if [ -f "${steamcmdlog}" ]; then + rm -f "${steamcmdlog:?}" + fi + counter=0 + 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 + ${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}" + else + ${unbuffer} ${steamcmdcommand} +force_install_dir "${serverfiles}" +login "${steamuser}" "${steampass}" +app_set_config 90 mod "${appidmod}" +app_update "${appid}" ${validate} +quit | uniq | tee -a "${lgsmlog}" "${steamcmdlog}" + fi + # Force Windows Platform type. + elif [ "${steamcmdforcewindows}" == "yes" ]; 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}" + else + ${unbuffer} ${steamcmdcommand} +@sSteamCmdForcePlatformType windows +force_install_dir "${serverfiles}" +login "${steamuser}" "${steampass}" +app_update "${appid}" ${validate} +quit | uniq | tee -a "${lgsmlog}" "${steamcmdlog}" + fi + # All other servers. + else + 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}" + else + ${unbuffer} ${steamcmdcommand} +force_install_dir "${serverfiles}" +login "${steamuser}" "${steampass}" +app_update "${appid}" ${validate} +quit | uniq | tee -a "${lgsmlog}" "${steamcmdlog}" + fi + fi + + # 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 + # 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" + fn_script_log_fatal "${commandaction} ${selfname}: ${remotelocation}: Not enough disk space to download server files" + core_exit.sh + # Not enough space. + elif [ -n "$(grep "0x212" "${steamcmdlog}" | tail -1)" ]; then + fn_print_failure_nl "${commandaction} ${selfname}: ${remotelocation}: Not enough disk space to download server files" + fn_script_log_fatal "${commandaction} ${selfname}: ${remotelocation}: Not enough disk space to download server files" + core_exit.sh + # Need tp purchase game. + elif [ -n "$(grep "No subscription" "${steamcmdlog}" | tail -1)" ]; then + fn_print_failure_nl "${commandaction} ${selfname}: ${remotelocation}: Steam account does not have a license for the required game" + fn_script_log_fatal "${commandaction} ${selfname}: ${remotelocation}: Steam account does not have a license for the required game" + core_exit.sh + # Two-factor authentication failure + elif [ -n "$(grep "Two-factor code mismatch" "${steamcmdlog}" | tail -1)" ]; then + 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 + # Update did not finish. + 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 + fn_print_error2_nl "${commandaction} ${selfname}: ${remotelocation}: Unknown error occured" + echo -en "Please provide content log to LinuxGSM developers https://linuxgsm.com/steamcmd-error" + fn_script_log_error "${commandaction} ${selfname}: ${remotelocation}: Unknown error occured" + fi + elif [ "${exitcode}" != 0 ]; then + fn_print_error2_nl "${commandaction} ${selfname}: ${remotelocation}: Exit code: ${exitcode}" + fn_script_log_error "${commandaction} ${selfname}: ${remotelocation}: Exit code: ${exitcode}" + else + fn_print_complete_nl "${commandaction} ${selfname}: ${remotelocation}" + fn_script_log_pass "${commandaction} ${selfname}: ${remotelocation}" + fi + + if [ "${counter}" -gt "10" ]; then + fn_print_failure_nl "${commandaction} ${selfname}: ${remotelocation}: Did not complete the download, too many retrys" + fn_script_log_fatal "${commandaction} ${selfname}: ${remotelocation}: Did not complete the download, too many retrys" + core_exit.sh + fi + done +} + +# Emptys contents of the LinuxGSM tmpdir. +fn_clear_tmp() { + echo -en "clearing LinuxGSM tmp directory..." + if [ -d "${tmpdir}" ]; then + rm -rf "${tmpdir:?}/"* + local exitcode=$? + 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 +} + +fn_dl_hash() { + # Runs Hash Check if available. + if [ "${hash}" != "0" ] && [ "${hash}" != "nohash" ] && [ "${hash}" != "nomd5" ]; then + # MD5 + if [ "${#hash}" == "32" ]; then + hashbin="md5sum" + hashtype="MD5" + # SHA1 + elif [ "${#hash}" == "40" ]; then + hashbin="sha1sum" + hashtype="SHA1" + # SHA256 + elif [ "${#hash}" == "64" ]; then + hashbin="sha256sum" + hashtype="SHA256" + # SHA512 + elif [ "${#hash}" == "128" ]; then + hashbin="sha512sum" + hashtype="SHA512" + else + fn_script_log_error "hash lengh not known for hash type" + fn_print_error_nl "hash lengh not known for hash type" + core_exit.sh + fi + echo -en "verifying ${local_filename} with ${hashtype}..." + fn_sleep_time + hashsumcmd=$(${hashbin} "${local_filedir}/${local_filename}" | awk '{print $1}') + if [ "${hashsumcmd}" != "${hash}" ]; then + fn_print_fail_eol_nl + echo -e "${local_filename} returned ${hashtype} checksum: ${hashsumcmd}" + echo -e "expected ${hashtype} checksum: ${hash}" + fn_script_log_fatal "Verifying ${local_filename} with ${hashtype}" + fn_script_log_info "${local_filename} returned ${hashtype} checksum: ${hashsumcmd}" + fn_script_log_info "Expected ${hashtype} checksum: ${hash}" + core_exit.sh + else + fn_print_ok_eol_nl + fn_script_log_pass "Verifying ${local_filename} with ${hashtype}" + fn_script_log_info "${local_filename} returned ${hashtype} checksum: ${hashsumcmd}" + fn_script_log_info "Expected ${hashtype} checksum: ${hash}" + fi + fi +} + +# Extracts bzip2, gzip or zip files. +# Extracts can be defined in code like so: +# 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}" + extractdest="${3}" + extractsrc="${4}" + # Extracts archives. + echo -en "extracting ${local_filename}..." + + 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 + 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 + 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 + 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 + 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 ${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 +} + +# Trap to remove file download if canceled before completed. +fn_fetch_trap() { + echo -e "" + echo -en "downloading ${local_filename}..." + fn_print_canceled_eol_nl + fn_script_log_info "Downloading ${local_filename}...CANCELED" + fn_sleep_time + rm -f "${local_filedir:?}/${local_filename}" + echo -en "downloading ${local_filename}..." + fn_print_removed_eol_nl + fn_script_log_info "Downloading ${local_filename}...REMOVED" + core_exit.sh +} + +# Will check a file exists and download it. Will not exit if fails to download. +fn_check_file() { + remote_fileurl="${1}" + remote_fileurl_backup="${2}" + remote_fileurl_name="${3}" + remote_fileurl_backup_name="${4}" + remote_filename="${5}" + # 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) + else + # counter set to 1 to not allow second try + counter=1 + remote_fileurls_array=(remote_fileurl) + fi + for remote_fileurl_array in "${remote_fileurls_array[@]}"; do + if [ "${remote_fileurl_array}" == "remote_fileurl" ]; then + fileurl="${remote_fileurl}" + fileurl_name="${remote_fileurl_name}" + elif [ "${remote_fileurl_array}" == "remote_fileurl_backup" ]; then + fileurl="${remote_fileurl_backup}" + fileurl_name="${remote_fileurl_backup_name}" + fi + counter=$((counter + 1)) + echo -en "checking ${fileurl_name} ${remote_filename}...\c" + curlcmd=$(curl --output /dev/null --silent --head --fail "${fileurl}" 2>&1) + local exitcode=$? + + # On first try will error. On second try will fail. + if [ "${exitcode}" != 0 ]; then + if [ ${counter} -ge 2 ]; then + fn_print_fail_eol_nl + if [ -f "${lgsmlog}" ]; then + fn_script_log_fatal "Checking ${remote_filename}" + fn_script_log_fatal "${fileurl}" + checkflag=1 + fi + else + fn_print_error_eol_nl + if [ -f "${lgsmlog}" ]; then + fn_script_log_error "Checking ${remote_filename}" + fn_script_log_error "${fileurl}" + checkflag=2 + fi + fi + else + fn_print_ok_eol + echo -en "\033[2K\\r" + if [ -f "${lgsmlog}" ]; then + fn_script_log_pass "Checking ${remote_filename}" + checkflag=0 + fi + break + fi + done + + if [ -f "${local_filedir}/${local_filename}" ]; then + fn_dl_hash + # Execute file if run is set. + if [ "${run}" == "run" ]; then + # shellcheck source=/dev/null + source "${local_filedir}/${local_filename}" + fi + fi +} + +fn_fetch_file() { + remote_fileurl="${1}" + remote_fileurl_backup="${2}" + remote_fileurl_name="${3}" + remote_fileurl_backup_name="${4}" + local_filedir="${5}" + local_filename="${6}" + chmodx="${7:-0}" + run="${8:-0}" + forcedl="${9:-0}" + hash="${10:-0}" + + # Download file if missing or download forced. + 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) + else + # counter set to 1 to not allow second try + counter=1 + remote_fileurls_array=(remote_fileurl) + fi + for remote_fileurl_array in "${remote_fileurls_array[@]}"; do + if [ "${remote_fileurl_array}" == "remote_fileurl" ]; then + fileurl="${remote_fileurl}" + fileurl_name="${remote_fileurl_name}" + elif [ "${remote_fileurl_array}" == "remote_fileurl_backup" ]; then + fileurl="${remote_fileurl_backup}" + fileurl_name="${remote_fileurl_backup_name}" + fi + 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 + 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 + 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. + if [ -f "${local_filedir}/${local_filename}" ]; then + if head -n 1 "${local_filedir}/${local_filename}" | grep -q "DOCTYPE"; then + rm "${local_filedir:?}/${local_filename:?}" + local exitcode=2 + fi + fi + + # On first try will error. On second try will fail. + if [ "${exitcode}" != 0 ]; then + 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 "${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 "${fileurl}" + fi + fi + else + fn_print_ok_eol_nl + if [ -f "${lgsmlog}" ]; then + fn_script_log_pass "Downloading ${local_filename}..." + fi + + # Make file executable if chmodx is set. + if [ "${chmodx}" == "chmodx" ]; then + chmod +x "${local_filedir}/${local_filename}" + fi + + # Remove trap. + trap - INT + + break + fi + done + fi + + if [ -f "${local_filedir}/${local_filename}" ]; then + fn_dl_hash + # Execute file if run is set. + if [ "${run}" == "run" ]; then + # shellcheck source=/dev/null + source "${local_filedir}/${local_filename}" + fi + fi +} + +# GitHub file download modules. +# Used to simplify downloading specific files from GitHub. + +# github_file_url_dir: the directory of the file in the GitHub: lgsm/modules +# github_file_url_name: the filename of the file to download from GitHub: core_messages.sh +# github_file_url_dir: the directory of the file in the GitHub: lgsm/modules +# github_file_url_name: the filename of the file to download from GitHub: core_messages.sh +# githuburl: the full GitHub url + +# remote_fileurl: The URL of the file: http://example.com/dl/File.tar.bz2 +# local_filedir: location the file is to be saved: /home/server/lgsm/tmp +# local_filename: name of file (this can be different from the url name): file.tar.bz2 +# chmodx: Optional, set to "chmodx" to make file executable using chmod +x +# run: Optional, set run to execute the file after download +# forcedl: Optional, force re-download of file even if exists +# hash: Optional, set an hash sum and will compare it against the file. + +# Fetches files from the Git repo. +fn_fetch_file_github() { + github_file_url_dir="${1}" + github_file_url_name="${2}" + # For legacy versions - code can be removed at a future date + if [ "${legacymode}" == "1" ]; then + remote_fileurl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" + remote_fileurl_backup="https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" + # If master branch will currently running LinuxGSM version to prevent "version mixing". This is ignored if a fork. + elif [ "${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 + remote_fileurl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" + remote_fileurl_backup="https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" + fi + remote_fileurl_name="GitHub" + remote_fileurl_backup_name="Bitbucket" + local_filedir="${3}" + local_filename="${github_file_url_name}" + chmodx="${4:-0}" + run="${5:-0}" + forcedl="${6:-0}" + hash="${7:-0}" + # Passes vars to the file download module. + 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() { + github_file_url_dir="${1}" + github_file_url_name="${2}" + 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 + remote_fileurl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" + remote_fileurl_backup="https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" + fi + remote_fileurl_name="GitHub" + remote_fileurl_backup_name="Bitbucket" + fn_check_file "${remote_fileurl}" "${remote_fileurl_backup}" "${remote_fileurl_name}" "${remote_fileurl_backup_name}" "${github_file_url_name}" +} + +# Fetches config files from the Git repo. +fn_fetch_config() { + 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}" == "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 + remote_fileurl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" + remote_fileurl_backup="https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" + fi + remote_fileurl_name="GitHub" + remote_fileurl_backup_name="Bitbucket" + local_filedir="${3}" + local_filename="${4}" + chmodx="nochmodx" + run="norun" + forcedl="noforce" + hash="nohash" + # Passes vars to the file download module. + fn_fetch_file "${remote_fileurl}" "${remote_fileurl_backup}" "${remote_fileurl_name}" "${remote_fileurl_backup_name}" "${local_filedir}" "${local_filename}" "${chmodx}" "${run}" "${forcedl}" "${hash}" +} + +# Fetches modules from the Git repo during first download. +fn_fetch_module() { + github_file_url_dir="lgsm/modules" + github_file_url_name="${modulefile}" + # If master branch will currently running LinuxGSM version to prevent "version mixing". This is ignored if a fork. + 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 + remote_fileurl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" + remote_fileurl_backup="https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" + fi + remote_fileurl_name="GitHub" + remote_fileurl_backup_name="Bitbucket" + local_filedir="${modulesdir}" + local_filename="${github_file_url_name}" + chmodx="chmodx" + run="run" + forcedl="noforce" + hash="nohash" + # Passes vars to the file download module. + fn_fetch_file "${remote_fileurl}" "${remote_fileurl_backup}" "${remote_fileurl_name}" "${remote_fileurl_backup_name}" "${local_filedir}" "${local_filename}" "${chmodx}" "${run}" "${forcedl}" "${hash}" +} + +# Fetches modules from the Git repo during update-lgsm. +fn_update_module() { + github_file_url_dir="lgsm/modules" + github_file_url_name="${modulefile}" + # If master branch will currently running LinuxGSM version to prevent "version mixing". This is ignored if a fork. + 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 + remote_fileurl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" + remote_fileurl_backup="https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" + fi + remote_fileurl_name="GitHub" + remote_fileurl_backup_name="Bitbucket" + local_filedir="${modulesdir}" + local_filename="${github_file_url_name}" + chmodx="chmodx" + run="norun" + forcedl="noforce" + hash="nohash" + # Passes vars to the file download module. + fn_fetch_file "${remote_fileurl}" "${remote_fileurl_backup}" "${remote_fileurl_name}" "${remote_fileurl_backup_name}" "${local_filedir}" "${local_filename}" "${chmodx}" "${run}" "${forcedl}" "${hash}" + +} + +# Function to download latest github release. +# $1 GitHub user / organisation. +# $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() { + local githubreleaseuser="${1}" + local githubreleaserepo="${2}" + local githubreleasedownloadpath="${3}" + local githubreleasesearch="${4}" + local githublatestreleaseurl="https://api.github.com/repos/${githubreleaseuser}/${githubreleaserepo}/releases/latest" + + # Get last github release. + # If no search for the release filename is set, just get the first file from the latest release. + if [ -z "${githubreleasesearch}" ]; then + githubreleaseassets=$(curl -s "${githublatestreleaseurl}" | jq '[ .assets[] ]') + else + githubreleaseassets=$(curl -s "${githublatestreleaseurl}" | jq "[ .assets[]|select(.browser_download_url | contains(\"${githubreleasesearch}\")) ]") + fi + + # Check how many releases we got from the api and exit if we have more then one. + if [ "$(echo -e "${githubreleaseassets}" | jq '. | length')" -gt 1 ]; then + fn_print_fatal_nl "Found more than one release to download - Please report this to the LinuxGSM issue tracker" + fn_script_log_fatal "Found more than one release to download - Please report this to the LinuxGSM issue tracker" + else + # Set variables for download via fn_fetch_file. + githubreleasefilename=$(echo -e "${githubreleaseassets}" | jq -r '.[]name') + githubreleasedownloadlink=$(echo -e "${githubreleaseassets}" | jq -r '.[]browser_download_url') + + # Error if no version is there. + if [ -z "${githubreleasefilename}" ]; then + fn_print_fail_nl "Cannot get version from GitHub API for ${githubreleaseuser}/${githubreleaserepo}" + fn_script_log_fatal "Cannot get version from GitHub API for ${githubreleaseuser}/${githubreleaserepo}" + else + # Fetch file from the remote location from the existing module to the ${tmpdir} for now. + fn_fetch_file "${githubreleasedownloadlink}" "" "${githubreleasefilename}" "" "${githubreleasedownloadpath}" "${githubreleasefilename}" + fi + fi +} diff --git a/lgsm/modules/core_exit.sh b/lgsm/modules/core_exit.sh new file mode 100644 index 0000000000..a8686c2a88 --- /dev/null +++ b/lgsm/modules/core_exit.sh @@ -0,0 +1,61 @@ +#!/bin/bash +# LinuxGSM core_exit.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Handles exiting of LinuxGSM by running and reporting an exit code. + +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +fn_exit_dev_debug() { + if [ -f "${rootdir}/.dev-debug" ]; then + echo -e "" + echo -e "${moduleselfname} exiting with code: ${exitcode}" + if [ -f "${rootdir}/dev-debug.log" ]; then + grep "modulefile=" "${rootdir}/dev-debug.log" | sed 's/modulefile=//g' > "${rootdir}/dev-debug-module-order.log" + fi + fi +} + +# If running dependency check as root will remove any files that belong to root user. +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 + +if [ "${exitbypass}" ]; then + unset exitbypass +elif [ "${exitcode}" != "0" ]; then + # List LinuxGSM version in logs + fn_script_log_info "LinuxGSM version: ${version}" + if [ "${exitcode}" == "1" ]; then + fn_script_log_fatal "${moduleselfname} exiting with code: ${exitcode}" + elif [ "${exitcode}" == "2" ]; then + fn_script_log_error "${moduleselfname} exiting with code: ${exitcode}" + elif [ "${exitcode}" == "3" ]; then + fn_script_log_warn "${moduleselfname} exiting with code: ${exitcode}" + else + fn_script_log_warn "${moduleselfname} exiting with code: ${exitcode}" + fi + fn_exit_dev_debug + # remove trap. + trap - INT + exit "${exitcode}" +elif [ "${exitcode}" ] && [ "${exitcode}" == "0" ]; then + # List LinuxGSM version in logs + fn_script_log_info "LinuxGSM version: ${version}" + fn_script_log_pass "${moduleselfname} exiting with code: ${exitcode}" + fn_exit_dev_debug + # remove trap. + trap - INT + exit "${exitcode}" +else + # List LinuxGSM version in logs + fn_script_log_info "LinuxGSM version: ${version}" + fn_print_error "No exit code set" + fn_script_log_pass "${moduleselfname} exiting with code: NOT SET" + fn_exit_dev_debug + # remove trap. + trap - INT + exit "${exitcode}" +fi diff --git a/lgsm/modules/core_functions.sh b/lgsm/modules/core_functions.sh new file mode 100755 index 0000000000..07a2ebd09f --- /dev/null +++ b/lgsm/modules/core_functions.sh @@ -0,0 +1,816 @@ +#!/bin/bash +# LinuxGSM core_functions.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Defines all functions to allow download and execution of functions using fn_fetch_function. +# This function is called first before any other function. Without this file other functions will not load. + +module_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +modulesversion="v23.2.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_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_exit.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_steamcmd.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_console.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_sponsor.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_monitor.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_validate.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 +} + +install_squad_license.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_remove.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_restart.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_send.sh() { + functionfile="${FUNCNAME[0]}" + fn_fetch_function +} + +# Checks + +check.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_executable.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_last_update.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_root.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_system_dir.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_version.sh() { + functionfile="${FUNCNAME[0]}" + fn_fetch_function +} + +# Compress + +compress_unreal2_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_core.sh() { + functionfile="${FUNCNAME[0]}" + fn_fetch_function +} + +# Dev + +command_dev_clear_functions.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_glibc.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 +} + +# Fix + +fix.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_arma3.sh() { + functionfile="${FUNCNAME[0]}" + fn_fetch_function +} + +fix_armar.sh() { + functionfile="${FUNCNAME[0]}" + fn_fetch_function +} + +fix_bt.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_csgo.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_ins.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_lo.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_nmrih.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_rust.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_st.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_tf2.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_samp.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_squad.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_ut.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_wurm.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_game.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 +} + +# Alert + +alert.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_ifttt.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_pushover.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_rocketchat.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 +} + +# Query + +query_gamedig.sh() { + functionfile="${FUNCNAME[0]}" + fn_fetch_function +} + +# Update + +command_update_functions.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_check_update.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_bedrock.sh() { + functionfile="${FUNCNAME[0]}" + fn_fetch_function +} + +update_papermc.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_jediknight2.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_ut99.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 +} + +install_complete.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_dst_token.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_gslt.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_retry.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_stats.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_ts3db.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_ut2k4_key.sh() { + functionfile="${FUNCNAME[0]}" + fn_fetch_function +} + +# Calls code required for legacy servers +core_legacy.sh + +# Creates tmp dir if missing +if [ ! -d "${tmpdir}" ]; then + mkdir -p "${tmpdir}" +fi + +# Creates lock dir if missing +if [ ! -d "${lockdir}" ]; then + mkdir -p "${lockdir}" +fi + +# Calls on-screen messages (bootstrap) +core_messages.sh + +#Calls file downloader (bootstrap) +core_dl.sh + +# Calls the global Ctrl-C trap +core_trap.sh diff --git a/lgsm/modules/core_getopt.sh b/lgsm/modules/core_getopt.sh new file mode 100644 index 0000000000..222ad0cf88 --- /dev/null +++ b/lgsm/modules/core_getopt.sh @@ -0,0 +1,215 @@ +#!/bin/bash +# LinuxGSM core_getopt.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: getopt arguments. + +moduleselfname="$(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-modules" "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_sponso=("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.") +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.") +# SteamCMD servers only. +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.") +# 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.") +# 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_modules=("cf;clear-modules" "command_dev_clear_modules.sh" "Delete the contents of the modules dir.") + +### Set specific opt here. + +currentopt=("${cmd_start[@]}" "${cmd_stop[@]}" "${cmd_restart[@]}" "${cmd_monitor[@]}" "${cmd_test_alert[@]}" "${cmd_details[@]}" "${cmd_postdetails[@]}" "${cmd_skeleton[@]}") + +# 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" ]; 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[@]}") + fi + fi +fi + +# Validate and check-update command. +if [ "${appid}" ]; then + currentopt+=("${cmd_validate[@]}") +fi + +# Backup. +currentopt+=("${cmd_backup[@]}") + +# Console & Debug. +currentopt+=("${cmd_console[@]}" "${cmd_debug[@]}") + +# Console send. +if [ "${consoleinteract}" == "yes" ]; then + currentopt+=("${cmd_send[@]}") +fi + +## Game server exclusive commands. + +# FastDL command. +if [ "${engine}" == "source" ]; then + currentopt+=("${cmd_fastdl[@]}") +fi + +# TeamSpeak exclusive. +if [ "${shortname}" == "ts3" ]; then + currentopt+=("${cmd_change_password[@]}") +fi + +# 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[@]}") + else + currentopt+=("${cmd_map_compressor_u2[@]}") + fi +fi +if [ "${engine}" == "unreal" ]; then + currentopt+=("${cmd_map_compressor_u99[@]}") +fi + +# DST exclusive. +if [ "${shortname}" == "dst" ]; then + currentopt+=("${cmd_install_dst_token[@]}") +fi + +# MTA exclusive. +if [ "${shortname}" == "mta" ]; then + currentopt+=("${cmd_install_default_resources[@]}") +fi + +# Squad license exclusive. +if [ "${shortname}" == "squad" ]; then + 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[@]}") +fi + +## Installer. +currentopt+=("${cmd_install[@]}" "${cmd_auto_install[@]}") + +## Developer commands. +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_modules[@]}") +fi + +## Sponsor. +currentopt+=("${cmd_sponsor[@]}") + +### Build list of available commands. +optcommands=() +index="0" +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 }')") + done +done + +# Shows LinuxGSM usage. +fn_opt_usage() { + echo -e "Usage: $0 [option]" + echo -e "" + echo -e "LinuxGSM - ${gamename} - Version ${version}" + echo -e "https://linuxgsm.com/${gameservername}" + echo -e "" + echo -e "${lightyellow}Commands${default}" + # 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 + } | column -s $'\t' -t + fn_script_log_pass "Display commands" + core_exit.sh +} + +# Check if command existw and run corresponding scripts, or display script usage. +if [ -z "${getopt}" ]; then + fn_opt_usage +fi +# If command exists. +for i in "${optcommands[@]}"; do + if [ "${i}" == "${getopt}" ]; then + # Seek and run command. + index="0" + for ((index = "0"; index < ${#currentopt[@]}; index += 3)); do + currcmdamount=$(echo -e "${currentopt[index]}" | awk -F ';' '{ print NF }') + 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]}" + # 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}" + core_exit.sh + fi + done + done + fi +done + +# If we're executing this, it means command was not found. +fn_print_error2_nl "Unknown command: $0 ${getopt}" +fn_script_log_error "Unknown command: $0 ${getopt}" +fn_opt_usage +core_exit.sh diff --git a/lgsm/modules/core_github.sh b/lgsm/modules/core_github.sh new file mode 100644 index 0000000000..228fe1078d --- /dev/null +++ b/lgsm/modules/core_github.sh @@ -0,0 +1,114 @@ +#!/bin/bash +# LinuxGSM core_github.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: core module file for updates via github + +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +github_api="https://api.github.com" + +fn_githublocalversionfile() { + local githubreleaseuser="${1}" + local githubreleaserepo="${2}" + + githublocalversionfile="${datadir}/github-${githubreleaseuser}-${githubreleaserepo}-version" +} + +# $1 githubuser/group +# $2 github repo name +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') + + # error if no version is there + if [ -z "${githubreleaseversion}" ]; then + fn_print_fail_nl "Cannot get version from GitHub API for ${githubreleaseuser}/${githubreleaserepo}" + fn_script_log_fatal "Cannot get version from GitHub API for ${githubreleaseuser}/${githubreleaserepo}" + fi +} + +# $1 githubuser/group +# $2 github repo name +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') + + # error if no version is there + if [ -z "${githubreleaseversion}" ]; then + fn_print_fail_nl "Cannot get version from GitHub API for ${githubreleaseuser}/${githubreleaserepo}" + fn_script_log_fatal "Cannot get version from GitHub API for ${githubreleaseuser}/${githubreleaserepo}" + else + echo "${githubreleaseversion}" > "${githublocalversionfile}" + fi +} + +# $1 githubuser/group +# $2 github repo name +fn_github_get_installed_version() { + local githubreleaseuser="${1}" + local githubreleaserepo="${2}" + + fn_githublocalversionfile "${githubreleaseuser}" "${githubreleaserepo}" + + githublocalversion=$(cat "${githublocalversionfile}") +} + +# $1 githubuser/group +# $2 github repo name +# if a update needs to be downloaded - updateneeded is set to 1 +fn_github_compare_version() { + local githubreleaseuser="${1}" + local githubreleaserepo="${2}" + exitcode=0 + updateneeded=0 + + fn_githublocalversionfile "${githubreleaseuser}" "${githubreleaserepo}" + local githublatestreleaseurl="${github_api}/repos/${githubreleaseuser}/${githubreleaserepo}/releases/latest" + + githublocalversion=$(cat "${githublocalversionfile}") + githubreleaseversion=$(curl -s "${githublatestreleaseurl}" | jq '.tag_name') + + # error if no version is there + if [ -z "${githubreleaseversion}" ]; then + fn_print_fail_nl "Can not get version from Github Api for ${githubreleaseuser}/${githubreleaserepo}" + fn_script_log_fatal "Can not get version from Github Api for ${githubreleaseuser}/${githubreleaserepo}" + else + if [ "${githublocalversion}" == "${githubreleaseversion}" ]; then + echo -en "\n" + echo -e "No update from github.com/${githubreleaseuser}/${githubreleaserepo}/ available:" + echo -e "* Local build: ${red}${githublocalversion}${default}" + echo -e "* Remote build: ${green}${githubreleaseversion}${default}" + 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) + if [ "${githubreleaseversion}" == "${last_version}" ]; then + echo -en "\n" + echo -e "Update from github.com/${githubreleaseuser}/${githubreleaserepo}/ available:" + echo -e "* Local build: ${red}${githublocalversion}${default}" + echo -e "* Remote build: ${green}${githubreleaseversion}${default}" + echo -en "\n" + updateneeded=1 + else + # local version is higher than the remote version output this to the user + # strange case but could be possible, as a release could be removed from github + echo -en "\n" + echo -e "Local version is newer than the remote version" + echo -e "* Local version: ${green}${githublocalversion}${default}" + echo -e "* Remote version: ${green}${githubreleaseversion}${default}" + echo -en "\n" + exitcode=1 + fi + fi + fi +} diff --git a/lgsm/modules/core_legacy.sh b/lgsm/modules/core_legacy.sh new file mode 100644 index 0000000000..2ed942abd1 --- /dev/null +++ b/lgsm/modules/core_legacy.sh @@ -0,0 +1,93 @@ +#!/bin/bash +# LinuxGSM core_legacy.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Code for backwards compatability with older versions of LinuxGSM. + +moduleselfname="$(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) +for legacy_version in "${legacy_versions_array[@]}"; do + if [ "${version}" == "${legacy_version}" ]; then + legacymode=1 + fi +done + +if [ -z "${serverfiles}" ]; then + serverfiles="${filesdir}" +fi + +if [ -z "${logdir}" ]; then + logdir="${rootdir}/log" +fi + +if [ -z "${lgsmlogdir}" ]; then + lgsmlogdir="${scriptlogdir}" +fi + +if [ -z "${lgsmlog}" ]; then + lgsmlog="${scriptlog}" +fi + +if [ -z "${lgsmlogdate}" ]; then + lgsmlogdate="${scriptlogdate}" +fi + +if [ -z "${steamcmddir}" ]; then + steamcmddir="${HOME}/.steam/steamcmd" +fi + +if [ -z "${lgsmdir}" ]; then + lgsmdir="${rootdir}/lgsm" +fi + +if [ -z "${tmpdir}" ]; then + tmpdir="${lgsmdir}/tmp" +fi + +if [ -z "${alertlog}" ]; then + alertlog="${emaillog}" +fi + +if [ -z "${servicename}" ]; then + servicename="${selfname}" +fi + +# Alternations to workshop variables. +if [ -z "${wsapikey}" ]; then + if [ "${workshopauth}" ]; then + wsapikey="${workshopauth}" + elif [ "${authkey}" ]; then + wsapikey="${authkey}" + fi +fi + +if [ -z "${wscollectionid}" ]; then + if [ "${workshopauth}" ]; then + wscollectionid="${ws_collection_id}" + elif [ "${authkey}" ]; then + wscollectionid="${workshopcollectionid}" + fi +fi + +if [ -z "${wsstartmap}" ]; then + if [ "${ws_start_map}" ]; then + wscollectionid="${ws_start_map}" + fi +fi + +# Added as part of migrating functions dir to modules dir. +# Will remove functions dir if files in modules dir older than 14 days +functionsdir="${lgsmdir}/modules" +if [ -d "${lgsmdir}/functions" ]; then + if [ "$(find "${lgsmdir}/modules"/ -type f -mtime +"14" | wc -l)" -ne "0" ]; then + rm -rf "${lgsmdir:?}/functions" + fi +fi + +fn_parms() { + fn_reload_startparameters + parms="${startparameters}" +} diff --git a/lgsm/modules/core_logs.sh b/lgsm/modules/core_logs.sh new file mode 100644 index 0000000000..8057f30f74 --- /dev/null +++ b/lgsm/modules/core_logs.sh @@ -0,0 +1,110 @@ +#!/bin/bash +# LinuxGSM core_logs.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Acts as a log rotator, removing old logs. + +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +# Check if logfile variable and file exist, create logfile if it doesn't exist. +if [ "${consolelog}" ]; then + if [ ! -f "${consolelog}" ]; then + touch "${consolelog}" + fi +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 [ "$(find "${systemdir}" -name "gamelog*.log")" ]; then + fn_print_info "Moving game logs to ${gamelogdir}" + fn_script_log_info "Moving game logs to ${gamelogdir}" + echo -en "\n" + fn_sleep_time + mv "${systemdir}"/gamelog*.log "${gamelogdir}" + fi +fi + +# Log manager will start the cleanup if it finds logs older than "${logdays}". +if [ "$(find "${lgsmlogdir}"/ -type f -mtime +"${logdays}" | wc -l)" -ne "0" ]; then + fn_print_dots "Starting" + # Set common logs directories + commonlogs="${systemdir}/logs" + commonsourcelogs="${systemdir}/*/logs" + # Set addon logs directories + sourcemodlogdir="${systemdir}/addons/sourcemod/logs" + ulxlogdir="${systemdir}/data/ulx_logs" + 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" + fn_sleep_time + fn_print_info "Removing logs older than ${logdays} days" + fn_script_log_info "Removing logs older than ${logdays} days" + # Logging logfiles to be removed according to "${logdays}", counting and removing them. + # Script logfiles. + find "${lgsmlogdir}"/ -type f -mtime +"${logdays}" | tee >> "${lgsmlog}" + 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 + 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 {} \; + fi + # Console logfiles. + if [ "${consolelog}" ]; then + find "${consolelogdir}"/ -type f -mtime +"${logdays}" | tee >> "${lgsmlog}" + consolecount=$(find "${consolelogdir}"/ -type f -mtime +"${logdays}" | wc -l) + find "${consolelogdir}"/ -mtime +"${logdays}" -type f -exec rm -f {} \; + fi + # Common logfiles. + if [ -d "${commonlogs}" ]; then + find "${commonlogs}"/ -type f -mtime +"${logdays}" | tee >> "${lgsmlog}" + smcount=$(find "${commonlogs}"/ -type f -mtime +"${logdays}" | wc -l) + find "${commonlogs}"/ -mtime +"${logdays}" -type f -exec rm -f {} \; + fi + if [ -d "${commonsourcelogs}" ]; then + find "${commonsourcelogs}"/* -type f -mtime +"${logdays}" | tee >> "${lgsmlog}" + smcount=$(find "${commonsourcelogs}"/* -type f -mtime +"${logdays}" | wc -l) + find "${commonsourcelogs}"/* -mtime +"${logdays}" -type f -exec rm -f {} \; + fi + # Source addons logfiles. + if [ "${engine}" == "source" ]; then + # SourceMod logfiles. + if [ -d "${sourcemodlogdir}" ]; then + find "${sourcemodlogdir}"/ -type f -mtime +"${logdays}" | tee >> "${lgsmlog}" + smcount=$(find "${sourcemodlogdir}"/ -type f -mtime +"${logdays}" | wc -l) + find "${sourcemodlogdir}"/ -mtime +"${logdays}" -type f -exec rm -f {} \; + fi + # Garry's Mod logfiles. + if [ "${shortname}" == "gmod" ]; then + # ULX logfiles. + if [ -d "${ulxlogdir}" ]; then + find "${ulxlogdir}"/ -type f -mtime +"${logdays}" | tee >> "${lgsmlog}" + ulxcount=$(find "${ulxlogdir}"/ -type f -mtime +"${logdays}" | wc -l) + find "${ulxlogdir}"/ -mtime +"${logdays}" -type f -exec rm -f {} \; + fi + # DarkRP logfiles. + if [ -d "${darkrplogdir}" ]; then + find "${darkrplogdir}"/ -type f -mtime +"${logdays}" | tee >> "${lgsmlog}" + darkrpcount=$(find "${darkrplogdir}"/ -type f -mtime +"${logdays}" | wc -l) + find "${darkrplogdir}"/ -mtime +"${logdays}" -type f -exec rm -f {} \; + fi + fi + fi + + # Count total amount of files removed. + countlogs=$((scriptcount + consolecount + gamecount + srcdscount + smcount + ulxcount + darkrpcount)) + # Job done. + fn_print_ok "Removed ${countlogs} log files" + fn_script_log "Removed ${countlogs} log files" +fi diff --git a/lgsm/modules/core_messages.sh b/lgsm/modules/core_messages.sh new file mode 100644 index 0000000000..6d3ca9a25a --- /dev/null +++ b/lgsm/modules/core_messages.sh @@ -0,0 +1,598 @@ +#!/bin/bash +# LinuxGSM core_messages.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Defines on-screen messages such as [ OK ] and how script logs look. + +moduleselfname="$(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() { + if [ "${ansi}" != "off" ]; then + # echo colors + default="\e[0m" + black="\e[30m" + red="\e[31m" + lightred="\e[91m" + green="\e[32m" + lightgreen="\e[92m" + yellow="\e[33m" + lightyellow="\e[93m" + blue="\e[34m" + lightblue="\e[94m" + magenta="\e[35m" + lightmagenta="\e[95m" + cyan="\e[36m" + lightcyan="\e[96m" + darkgrey="\e[90m" + lightgrey="\e[37m" + white="\e[97m" + fi + # carriage return & erase to end of line. + creeol="\r\033[K" +} + +fn_sleep_time() { + if [ "${sleeptime}" != "0" ] || [ "${travistest}" != "1" ]; then + if [ -z "${sleeptime}" ]; then + sleeptime=0.5 + fi + sleep "${sleeptime}" + fi +} + +# Log display +######################## +## Feb 28 14:56:58 ut99-server: Monitor: +fn_script_log() { + if [ -d "${lgsmlogdir}" ]; then + if [ -n "${commandname}" ]; then + echo -e "$(date '+%b %d %H:%M:%S.%3N') ${selfname}: ${commandname}: ${1}" >> "${lgsmlog}" + else + echo -e "$(date '+%b %d %H:%M:%S.%3N') ${selfname}: ${1}" >> "${lgsmlog}" + fi + fi +} + +## Feb 28 14:56:58 ut99-server: Monitor: PASS: +fn_script_log_pass() { + if [ -d "${lgsmlogdir}" ]; then + + if [ -n "${commandname}" ]; then + echo -e "$(date '+%b %d %H:%M:%S.%3N') ${selfname}: ${commandname}: PASS: ${1}" >> "${lgsmlog}" + else + echo -e "$(date '+%b %d %H:%M:%S.%3N') ${selfname}: PASS: ${1}" >> "${lgsmlog}" + fi + fi + exitcode=0 +} + +## Feb 28 14:56:58 ut99-server: Monitor: 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}" + else + echo -e "$(date '+%b %d %H:%M:%S.%3N') ${selfname}: FATAL: ${1}" >> "${lgsmlog}" + fi + fi + exitcode=1 +} + +## Feb 28 14:56:58 ut99-server: Monitor: 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}" + else + echo -e "$(date '+%b %d %H:%M:%S.%3N') ${selfname}: ERROR: ${1}" >> "${lgsmlog}" + fi + fi + exitcode=2 +} + +## Feb 28 14:56:58 ut99-server: Monitor: 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}" + else + echo -e "$(date '+%b %d %H:%M:%S.%3N') ${selfname}: WARN: ${1}" >> "${lgsmlog}" + fi + fi + exitcode=3 +} + +## Feb 28 14:56:58 ut99-server: Monitor: 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}" + else + echo -e "$(date '+%b %d %H:%M:%S.%3N') ${selfname}: INFO: ${1}" >> "${lgsmlog}" + fi + fi +} + +## Feb 28 14:56:58 ut99-server: Monitor: 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}" + else + echo -e "$(date '+%b %d %H:%M:%S.%3N') ${selfname}: UPDATE: ${1}" >> "${lgsmlog}" + fi + fi +} + +# On-Screen - Automated functions +################################## + +# [ .... ] +fn_print_dots() { + if [ "${commandaction}" ]; then + echo -en "${creeol}[ .... ] ${commandaction} ${selfname}: $*" + else + echo -en "${creeol}[ .... ] $*" + fi + fn_sleep_time +} + +fn_print_dots_nl() { + if [ "${commandaction}" ]; then + echo -e "${creeol}[ .... ] ${commandaction} ${selfname}: $*" + else + echo -e "${creeol}[ .... ] $*" + fi + fn_sleep_time + echo -en "\n" +} + +# [ OK ] +fn_print_ok() { + if [ "${commandaction}" ]; then + echo -en "${creeol}[${green} OK ${default}] ${commandaction} ${selfname}: $*" + else + echo -en "${creeol}[${green} OK ${default}] $*" + fi + fn_sleep_time +} + +fn_print_ok_nl() { + if [ "${commandaction}" ]; then + echo -en "${creeol}[${green} OK ${default}] ${commandaction} ${selfname}: $*" + else + echo -en "${creeol}[${green} OK ${default}] $*" + fi + fn_sleep_time + echo -en "\n" +} + +# [ FAIL ] +fn_print_fail() { + if [ "${commandaction}" ]; then + echo -en "${creeol}[${red} FAIL ${default}] ${commandaction} ${selfname}: $*" + else + echo -en "${creeol}[${red} FAIL ${default}] $*" + fi + fn_sleep_time +} + +fn_print_fail_nl() { + if [ "${commandaction}" ]; then + echo -en "${creeol}[${red} FAIL ${default}] ${commandaction} ${selfname}: $*" + else + echo -en "${creeol}[${red} FAIL ${default}] $*" + fi + fn_sleep_time + echo -en "\n" +} + +# [ ERROR ] +fn_print_error() { + if [ "${commandaction}" ]; then + echo -en "${creeol}[${red} ERROR ${default}] ${commandaction} ${selfname}: $*" + else + echo -en "${creeol}[${red} ERROR ${default}] $*" + fi + fn_sleep_time +} + +fn_print_error_nl() { + if [ "${commandaction}" ]; then + echo -en "${creeol}[${red} ERROR ${default}] ${commandaction} ${selfname}: $*" + else + echo -en "${creeol}[${red} ERROR ${default}] $*" + fi + fn_sleep_time + echo -en "\n" +} + +# [ WARN ] +fn_print_warn() { + if [ "${commandaction}" ]; then + echo -en "${creeol}[${lightyellow} WARN ${default}] ${commandaction} ${selfname}: $*" + else + echo -en "${creeol}[${lightyellow} WARN ${default}] $*" + fi + fn_sleep_time +} + +fn_print_warn_nl() { + if [ "${commandaction}" ]; then + echo -en "${creeol}[${lightyellow} WARN ${default}] ${commandaction} ${selfname}: $*" + else + echo -en "${creeol}[${lightyellow} WARN ${default}] $*" + fi + fn_sleep_time + echo -en "\n" +} + +# [ INFO ] +fn_print_info() { + if [ "${commandaction}" ]; then + echo -en "${creeol}[${cyan} INFO ${default}] ${commandaction} ${selfname}: $*" + else + echo -en "${creeol}[${cyan} INFO ${default}] $*" + fi + fn_sleep_time +} + +fn_print_info_nl() { + if [ "${commandaction}" ]; then + echo -en "${creeol}[${cyan} INFO ${default}] ${commandaction} ${selfname}: $*" + else + echo -en "${creeol}[${cyan} INFO ${default}] $*" + fi + fn_sleep_time + echo -en "\n" +} + +# [ START ] +fn_print_start() { + if [ "${commandaction}" ]; then + echo -en "${creeol}[${lightgreen} START ${default}] ${commandaction} ${selfname}: $*" + else + echo -en "${creeol}[${lightgreen} START ${default}] $*" + fi + fn_sleep_time +} + +fn_print_start_nl() { + if [ "${commandaction}" ]; then + echo -en "${creeol}[${lightgreen} START ${default}] ${commandaction} ${selfname}: $*" + else + echo -en "${creeol}[${lightgreen} START ${default}] $*" + fi + fn_sleep_time + echo -en "\n" +} + +# On-Screen - Interactive messages +################################## + +# No More Room in Hell Debug +# ================================= +fn_print_header() { + echo -e "" + echo -e "${lightyellow}${gamename} ${commandaction}${default}" + echo -e "=================================${default}" +} + +# Complete! +fn_print_complete() { + echo -en "${green}Complete!${default} $*" + fn_sleep_time +} + +fn_print_complete_nl() { + echo -e "${green}Complete!${default} $*" + fn_sleep_time +} + +# Failure! +fn_print_failure() { + echo -en "${red}Failure!${default} $*" + fn_sleep_time +} + +fn_print_failure_nl() { + echo -e "${red}Failure!${default} $*" + fn_sleep_time +} + +# Error! +fn_print_error2() { + echo -en "${red}Error!${default} $*" + fn_sleep_time +} + +fn_print_error2_nl() { + echo -e "${red}Error!${default} $*" + fn_sleep_time +} + +# Warning! +fn_print_warning() { + echo -en "${lightyellow}Warning!${default} $*" + fn_sleep_time +} + +fn_print_warning_nl() { + echo -e "${lightyellow}Warning!${default} $*" + fn_sleep_time +} + +# Information! +fn_print_information() { + echo -en "${cyan}Information!${default} $*" + fn_sleep_time +} + +fn_print_information_nl() { + echo -e "${cyan}Information!${default} $*" + fn_sleep_time +} + +# Y/N Prompt +fn_prompt_yn() { + local prompt="$1" + local initial="$2" + + if [ "${initial}" == "Y" ]; then + prompt+=" [Y/n] " + elif [ "${initial}" == "N" ]; then + prompt+=" [y/N] " + else + prompt+=" [y/n] " + fi + + while true; do + 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." ;; + esac + done +} + +# Prompt for message +fn_prompt_message() { + while true; do + unset prompt + local prompt="$1" + read -e -p "${prompt}" -r answer + if fn_prompt_yn "Continue" Y; then + break + fi + done + echo "${answer}" +} + +# On-Screen End of Line +################################## + +# YES +fn_print_yes_eol() { + echo -en "${cyan}YES${default}" + fn_sleep_time +} + +fn_print_yes_eol_nl() { + echo -e "${cyan}YES${default}" + fn_sleep_time +} + +# NO +fn_print_no_eol() { + echo -en "${red}NO${default}" + fn_sleep_time +} + +fn_print_no_eol_nl() { + echo -e "${red}NO${default}" + fn_sleep_time +} + +# OK +fn_print_ok_eol() { + echo -en "${green}OK${default}" + fn_sleep_time +} + +fn_print_ok_eol_nl() { + echo -e "${green}OK${default}" + fn_sleep_time +} + +# FAIL +fn_print_fail_eol() { + echo -en "${red}FAIL${default}" + fn_sleep_time +} + +fn_print_fail_eol_nl() { + echo -e "${red}FAIL${default}" + fn_sleep_time +} + +# ERROR +fn_print_error_eol() { + echo -en "${red}ERROR${default}" + fn_sleep_time +} + +fn_print_error_eol_nl() { + echo -e "${red}ERROR${default}" + fn_sleep_time +} + +# WAIT +fn_print_wait_eol() { + echo -en "${cyan}WAIT${default}" + fn_sleep_time +} + +fn_print_wait_eol_nl() { + echo -e "${cyan}WAIT${default}" + fn_sleep_time +} + +# WARN +fn_print_warn_eol() { + echo -en "${lightyellow}WARN${default}" + fn_sleep_time +} + +fn_print_warn_eol_nl() { + echo -e "${lightyellow}WARN${default}" + fn_sleep_time +} + +# INFO +fn_print_info_eol() { + echo -en "${cyan}INFO${default}" + fn_sleep_time +} + +fn_print_info_eol_nl() { + echo -e "${cyan}INFO${default}" + fn_sleep_time +} + +# QUERYING +fn_print_querying_eol() { + echo -en "${cyan}QUERYING${default}" + fn_sleep_time +} + +fn_print_querying_eol_nl() { + echo -e "${cyan}QUERYING${default}" + fn_sleep_time +} + +# CHECKING +fn_print_checking_eol() { + echo -en "${cyan}CHECKING${default}" + fn_sleep_time +} + +fn_print_checking_eol_nl() { + echo -e "${cyan}CHECKING${default}" + fn_sleep_time +} + +# DELAY +fn_print_delay_eol() { + echo -en "${green}DELAY${default}" + fn_sleep_time +} + +fn_print_delay_eol_nl() { + echo -e "${green}DELAY${default}" + fn_sleep_time +} + +# CANCELED +fn_print_canceled_eol() { + echo -en "${lightyellow}CANCELED${default}" + fn_sleep_time +} + +fn_print_canceled_eol_nl() { + echo -e "${lightyellow}CANCELED${default}" + fn_sleep_time +} + +# REMOVED +fn_print_removed_eol() { + echo -en "${red}REMOVED${default}" + fn_sleep_time +} + +fn_print_removed_eol_nl() { + echo -e "${red}REMOVED${default}" + fn_sleep_time +} + +# UPDATE +fn_print_update_eol() { + echo -en "${cyan}UPDATE${default}" + fn_sleep_time +} + +fn_print_update_eol_nl() { + echo -e "${cyan}UPDATE${default}" + fn_sleep_time +} + +fn_print_ascii_logo() { + echo -e "" + echo -e " mdMMMMbm" + echo -e " mMMMMMMMMMMm" + echo -e " mMMMMMMMMMMMMm" + echo -e " mMMMMMMMMMMMMMMm" + echo -e " hMMMV^VMMV^VMMMh" + echo -e " MMMMM MM MMMMM" + echo -e " hMMs vv sMMh" + echo -e " hMMM: :MMMh" + echo -e " .hMMMh hMMMh." + echo -e " -dMMMh ${lightgrey}__${default} hMMMd-" + echo -e " :mMMMs ${lightgrey}||${default} sMMMm:" + echo -e " :MMMM+ ${lightgrey}||${default} ${red}_${default} +NMMN:" + echo -e " .mMMM+ ${lightgrey}========${default} +MMMm." + echo -e " yMMMy ${darkgrey}##############${default} yMMMy" + echo -e " mMMM: ${darkgrey}##############${default} :MMMm" + echo -e " mMM ${lightyellow}nn${default} ${lightyellow}nn${default} ${lightyellow}nn${default} ${lightyellow}nn${default} MMm" + echo -e " o ${lightyellow}nNNNNNNNn${default} ${lightyellow}nNNNNNNNn${default} o" + echo -e " ${lightyellow}nNNNNNNNNNn${default} ${lightyellow}nNNNNNNNNNn${default}" + echo -e " ${lightyellow}nNNNNNNNNNNN${default} ${lightyellow}NNNNNNNNNNNn${default}" + echo -e " ${lightyellow}+NNNNNNNNN:${default} ${lightyellow}:NNNNNNNNN+${default}" + echo -e " ${lightyellow}nNNNNNNN${default} /\ ${lightyellow}NNNNNNNn${default}" + echo -e " ${lightyellow}nnnnn${default} db ${lightyellow}nnnnn${default}" + echo -e "" + echo -e "${lightyellow}888${default} ${lightyellow}d8b${default} ${default}.d8888b. .d8888b. 888b d888" + echo -e "${lightyellow}888 Y8P ${default}d88P Y88b d88P Y88b 8888b d8888" + echo -e "${lightyellow}888${default} ${default}888${default} 888 Y88b. 88888b.d88888" + echo -e "${lightyellow}888${default} ${lightyellow}888${default} ${lightyellow}88888b.${default} ${lightyellow}888${default} ${lightyellow}888${default} ${lightyellow}888${default} ${lightyellow}888${default} 888 Y888b. 888Y88888P888" + echo -e "${lightyellow}888${default} ${lightyellow}888${default} ${lightyellow}888${default} ${lightyellow}88b${default} ${lightyellow}888${default} ${lightyellow}888${default} ${lightyellow}Y8bd8P${default} 888 88888 Y88b. 888 Y888P 888" + echo -e "${lightyellow}888${default} ${lightyellow}888${default} ${lightyellow}888${default} ${lightyellow}888${default} ${lightyellow}888${default} ${lightyellow}888${default} ${lightyellow}X88K${default} 888 888 888 888 Y8P 888" + echo -e "${lightyellow}888${default} ${lightyellow}888${default} ${lightyellow}888${default} ${lightyellow}888${default} ${lightyellow}Y88b${default} ${lightyellow}88Y${default} ${lightyellow}.d8pq8b.${default} Y88b d88P Y88b d88P 888 * 888" + echo -e "${lightyellow}LinuxGSM${default} ${lightyellow}888${default} ${lightyellow}888${default} ${lightyellow}888${default} ${lightyellow}Y8888Y${default} ${lightyellow}888${default} ${lightyellow}888${default} Y2012P88 Y8888P 888 888" + echo -e "" +} + +fn_print_restart_warning() { + fn_print_warn "${selfname} will be restarted" + fn_script_log_warn "${selfname} will be restarted" + totalseconds=3 + for seconds in {3..1}; do + fn_print_warn "${selfname} will be restarted: ${totalseconds}" + totalseconds=$((totalseconds - 1)) + sleep 1 + if [ "${seconds}" == "0" ]; then + break + fi + done + fn_print_warn_nl "${selfname} will be restarted" +} + +# Functions below are used to ensure that logs and UI correctly reflect the command it is actually running. +# 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() { + if [ -z "${firstcommandname}" ]; then + firstcommandname="${commandname}" + firstcommandaction="${commandaction}" + fi +} + +# Used to reset commandname variables to the command the script ran first. +fn_firstcommand_reset() { + commandname="${firstcommandname}" + commandaction="${firstcommandaction}" +} diff --git a/lgsm/modules/core_modules.sh b/lgsm/modules/core_modules.sh new file mode 100644 index 0000000000..8eb843b5a5 --- /dev/null +++ b/lgsm/modules/core_modules.sh @@ -0,0 +1,816 @@ +#!/bin/bash +# LinuxGSM core_modules.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Defines all modules to allow download and execution of modules using fn_fetch_module. +# This module is called first before any other module. Without this file other modules will not load. + +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +modulesversion="v23.2.0" + +# Core + +core_dl.sh() { + modulefile="${FUNCNAME[0]}" + if [ "$(type fn_fetch_core_dl 2> /dev/null)" ]; then + fn_fetch_core_dl "lgsm/modules" "core_dl.sh" "${modulesdir}" "chmodx" "run" "noforcedl" "nohash" + else + fn_bootstrap_fetch_file_github "lgsm/modules" "core_dl.sh" "${modulesdir}" "chmodx" "run" "noforcedl" "nohash" + fi +} + +core_messages.sh() { + modulefile="${FUNCNAME[0]}" + if [ "$(type fn_fetch_core_dl 2> /dev/null)" ]; then + fn_fetch_core_dl "lgsm/modules" "core_messages.sh" "${modulesdir}" "chmodx" "run" "noforcedl" "nohash" + else + fn_bootstrap_fetch_file_github "lgsm/modules" "core_messages.sh" "${modulesdir}" "chmodx" "run" "noforcedl" "nohash" + fi +} + +core_legacy.sh() { + modulefile="${FUNCNAME[0]}" + if [ "$(type fn_fetch_core_dl 2> /dev/null)" ]; then + fn_fetch_core_dl "lgsm/modules" "core_legacy.sh" "${modulesdir}" "chmodx" "run" "noforcedl" "nohash" + else + fn_bootstrap_fetch_file_github "lgsm/modules" "core_legacy.sh" "${modulesdir}" "chmodx" "run" "noforcedl" "nohash" + fi +} + +core_exit.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +core_getopt.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +core_trap.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +core_steamcmd.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +core_github.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +# Commands + +command_backup.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +command_console.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +command_debug.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +command_details.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +command_sponsor.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +command_postdetails.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +command_test_alert.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +command_monitor.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +command_start.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +command_stop.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +command_validate.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +command_install.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +command_install_resources_mta.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +install_squad_license.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +command_mods_install.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +command_mods_update.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +command_mods_remove.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +command_fastdl.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +command_ts3_server_pass.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +command_restart.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +command_skeleton.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +command_wipe.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +command_send.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +# Checks + +check.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +check_config.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +check_deps.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +check_executable.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +check_glibc.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +check_ip.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +check_last_update.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +check_logs.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +check_permissions.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +check_root.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +check_status.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +check_steamcmd.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +check_system_dir.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +check_system_requirements.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +check_tmuxception.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +check_version.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +# Compress + +compress_unreal2_maps.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +compress_ut99_maps.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +# Mods + +mods_list.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +mods_core.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +# Dev + +command_dev_clear_modules.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +command_dev_debug.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +command_dev_detect_deps.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +command_dev_detect_glibc.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +command_dev_detect_ldd.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +command_dev_query_raw.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +# Fix + +fix.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +fix_ark.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +fix_av.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +fix_arma3.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +fix_armar.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +fix_bt.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +fix_bo.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +fix_cmw.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +fix_csgo.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +fix_dst.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +fix_hw.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +fix_ins.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +fix_kf.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +fix_kf2.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +fix_lo.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +fix_mcb.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +fix_mta.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +fix_nmrih.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +fix_onset.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +fix_ro.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +fix_rust.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +fix_rw.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +fix_sfc.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +fix_st.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +fix_steamcmd.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +fix_terraria.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +fix_tf2.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +fix_ut3.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +fix_rust.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +fix_samp.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +fix_sdtd.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +fix_sof2.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +fix_squad.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +fix_ts3.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +fix_ut2k4.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +fix_ut.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +fix_unt.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +fix_vh.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +fix_wurm.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +fix_zmr.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +# Info + +info_distro.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +info_game.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +info_messages.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +info_stats.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +# Alert + +alert.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +alert_discord.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +alert_email.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +alert_ifttt.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +alert_mailgun.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +alert_pushbullet.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +alert_pushover.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +alert_gotify.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +alert_telegram.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +alert_rocketchat.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +alert_slack.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} +# Logs + +core_logs.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +# Query + +query_gamedig.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +# Update + +command_update_modules.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +command_update_linuxgsm.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +command_update.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +command_check_update.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +update_ts3.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +update_minecraft.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +update_minecraft_bedrock.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +update_papermc.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +update_mta.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +update_factorio.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +update_jediknight2.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +update_steamcmd.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +update_vintagestory.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +update_ut99.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +fn_update_modules.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +# +## Installer modules +# + +fn_autoinstall() { + autoinstall=1 + command_install.sh +} + +install_complete.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +install_config.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +install_factorio_save.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +install_dst_token.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +install_eula.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +install_gsquery.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +install_gslt.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +install_header.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +install_logs.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +install_retry.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +install_server_dir.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} +install_server_files.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +install_stats.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +install_steamcmd.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +install_ts3.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +install_ts3db.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +install_ut2k4.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +install_dl_ut2k4.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +install_ut2k4_key.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +# Calls code required for legacy servers +core_legacy.sh + +# Creates tmp dir if missing +if [ ! -d "${tmpdir}" ]; then + mkdir -p "${tmpdir}" +fi + +# Creates lock dir if missing +if [ ! -d "${lockdir}" ]; then + mkdir -p "${lockdir}" +fi + +# Calls on-screen messages (bootstrap) +core_messages.sh + +#Calls file downloader (bootstrap) +core_dl.sh + +# Calls the global Ctrl-C trap +core_trap.sh diff --git a/lgsm/modules/core_steamcmd.sh b/lgsm/modules/core_steamcmd.sh new file mode 100644 index 0000000000..78c30f60ae --- /dev/null +++ b/lgsm/modules/core_steamcmd.sh @@ -0,0 +1,330 @@ +#!/bin/bash +# LinuxGSM core_steamcmd.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Core modules for SteamCMD + +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +fn_install_steamcmd() { + if [ "${shortname}" == "ark" ] && [ "${installsteamcmd}" == "1" ]; then + steamcmddir="${serverfiles}/Engine/Binaries/ThirdParty/SteamCMD/Linux" + fi + 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" "nochmodx" "norun" "noforce" "nohash" + fn_dl_extract "${tmpdir}" "steamcmd_linux.tar.gz" "${steamcmddir}" + chmod +x "${steamcmddir}/steamcmd.sh" +} + +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}" + echo -e " * Change steamuser=\"username\" to a valid steam login." + if [ -d "${lgsmlogdir}" ]; then + fn_script_log_fatal "Steam login not set. Update steamuser in ${configdirserver}" + fi + core_exit.sh + fi + # Anonymous user is set if steamuser is missing. + if [ -z "${steamuser}" ]; then + if [ -d "${lgsmlogdir}" ]; then + fn_script_log_info "Using anonymous Steam login" + fi + steamuser="anonymous" + steampass='' + fi +} + +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 [ "${commandname}" == "INSTALL" ]; then + fn_install_steamcmd + else + fn_print_warn_nl "SteamCMD is missing" + fn_script_log_warn "SteamCMD is missing" + fn_install_steamcmd + fi + elif [ "${commandname}" == "INSTALL" ]; then + fn_print_information "SteamCMD is already installed..." + fn_print_ok_eol_nl + fi +} + +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 + + # Create Steam installation directory. + if [ ! -d "${XDG_DATA_HOME:="${HOME}/.local/share"}/Steam" ]; then + mkdir -p "${XDG_DATA_HOME:="${HOME}/.local/share"}/Steam" + fi + + # Create common Steam directory. + if [ ! -d "${HOME}/.steam" ]; then + mkdir -p "${HOME}/.steam" + fi + + # Symbolic links to Steam installation directory. + if [ ! -L "${HOME}/.steam/root" ]; then + if [ -d "${HOME}/.steam/root" ]; then + rm -f "${HOME:?}/.steam/root" + fi + ln -s "${XDG_DATA_HOME:="${HOME}/.local/share"}/Steam" "${HOME}/.steam/root" + fi + + if [ ! -L "${HOME}/.steam/steam" ]; then + if [ -d "${HOME}/.steam/steam" ]; then + rm -rf "${HOME}/.steam/steam" + fi + ln -s "${XDG_DATA_HOME:="${HOME}/.local/share"}/Steam" "${HOME}/.steam/steam" + fi +} + +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 + rm -rf "${rootdir:?}/steamcmd" + fi + + if [ -d "${HOME}/Steam" ] && [ "${steamcmddir}" == "${XDG_DATA_HOME:="${HOME}/.local/share"}/Steam" ]; then + rm -rf "${HOME}/Steam" + fi +} + +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() { + # Checks if SteamCMD exists in + # Engine/Binaries/ThirdParty/SteamCMD/Linux + # to allow ark mods to work + if [ ! -f "${serverfiles}/Engine/Binaries/ThirdParty/SteamCMD/Linux/steamcmd.sh" ]; then + installsteamcmd=1 + if [ "${commandname}" == "INSTALL" ]; then + fn_install_steamcmd + else + fn_print_warn_nl "ARK mods SteamCMD is missing" + fn_script_log_warn "ARK mods SteamCMD is missing" + fn_install_steamcmd + fi + elif [ "${commandname}" == "INSTALL" ]; then + fn_print_information "ARK mods SteamCMD is already installed..." + fn_print_ok_eol_nl + fi +} + +fn_check_steamcmd_clear() { + # Will remove steamcmd dir if steamcmd package is installed. + if [ "$(command -v steamcmd 2> /dev/null)" ] && [ -d "${rootdir}/steamcmd" ]; then + rm -rf "${steamcmddir:?}" + exitcode=$? + if [ "${exitcode}" != 0 ]; then + fn_script_log_fatal "Removing ${rootdir}/steamcmd" + else + fn_script_log_pass "Removing ${rootdir}/steamcmd" + fi + fi +} + +fn_check_steamcmd_exec() { + if [ "$(command -v steamcmd 2> /dev/null)" ]; then + steamcmdcommand="steamcmd" + else + steamcmdcommand="./steamcmd.sh" + fi +} + +fn_update_steamcmd_localbuild() { + # Gets local build info. + fn_print_dots "Checking local build: ${remotelocation}" + fn_appmanifest_check + # Uses appmanifest to find local build. + localbuild=$(grep buildid "${appmanifestfile}" | tr '[:blank:]"' ' ' | tr -s ' ' | cut -d\ -f3) + + # Set branch to public if no custom branch. + if [ -z "${branch}" ]; then + branch="public" + fi + + # Checks if localbuild variable has been set. + 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}" + fn_script_log_pass "Checking local build" + fi +} + +fn_update_steamcmd_remotebuild() { + # Get remote build info. + if [ -d "${steamcmddir}" ]; then + cd "${steamcmddir}" || exit + 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 + find "${HOME}" -type f -name "appinfo.vdf" -exec rm -f {} \; + fi + + # password for branch not needed to check the buildid + 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 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_steamcmd_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 [ -n "${betapassword}" ]; then + echo -e "* Branch password: ${betapassword}" + fi + echo -e "https://steamdb.info/app/${appid}/" + 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 + if [ -n "${betapassword}" ]; then + fn_script_log_info "Branch password: ${betapassword}" + fi + fn_script_log_info "${localbuild} > ${remotebuildversion}" + + if [ "${commandname}" == "UPDATE" ]; then + unset updateonstart + check_status.sh + # If server stopped. + if [ "${status}" == "0" ]; then + fn_dl_steamcmd + # If server started. + else + fn_print_restart_warning + exitbypass=1 + command_stop.sh + fn_firstcommand_reset + exitbypass=1 + fn_dl_steamcmd + 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 + if [ -n "${betapassword}" ]; then + echo -e "* Branch password: ${betapassword}" + fi + echo -e "https://steamdb.info/app/${appid}/" + 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 [ -n "${betapassword}" ]; then + fn_script_log_info "Branch password: ${betapassword}" + fi + fi +} + +fn_appmanifest_info() { + 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() { + fn_appmanifest_info + # Multiple or no matching appmanifest files may sometimes be present. + # This error is corrected if required. + if [ "${appmanifestfilewc}" -ge "2" ]; then + fn_print_error "Multiple appmanifest_${appid}.acf files found" + fn_script_log_error "Multiple appmanifest_${appid}.acf files found" + fn_print_dots "Removing x${appmanifestfilewc} appmanifest_${appid}.acf files" + for appfile in ${appmanifestfile}; do + rm -f "${appfile:?}" + done + appmanifestfilewc1="${appmanifestfilewc}" + fn_appmanifest_info + # if error can not be resolved. + if [ "${appmanifestfilewc}" -ge "2" ]; then + fn_print_fail "Unable to remove x${appmanifestfilewc} appmanifest_${appid}.acf files" + fn_script_log_fatal "Unable to remove x${appmanifestfilewc} appmanifest_${appid}.acf files" + echo -e "* Check user permissions" + for appfile in ${appmanifestfile}; do + echo -e " ${appfile}" + done + core_exit.sh + else + fn_print_ok "Removed x${appmanifestfilewc1} appmanifest_${appid}.acf files" + fn_script_log_pass "Removed x${appmanifestfilewc1} appmanifest_${appid}.acf files" + fn_print_info_nl "Forcing update to correct issue" + fn_script_log_info "Forcing update to correct issue" + fn_dl_steamcmd + fi + elif [ "${appmanifestfilewc}" -eq "0" ]; then + fn_print_error_nl "No appmanifest_${appid}.acf found" + fn_script_log_error "No appmanifest_${appid}.acf found" + fn_print_info_nl "Forcing update to correct issue" + fn_script_log_info "Forcing update to correct issue" + fn_dl_steamcmd + fn_appmanifest_info + if [ "${appmanifestfilewc}" -eq "0" ]; then + fn_print_fail_nl "Still no appmanifest_${appid}.acf found" + fn_script_log_fatal "Still no appmanifest_${appid}.acf found" + core_exit.sh + fi + fi +} diff --git a/lgsm/modules/core_trap.sh b/lgsm/modules/core_trap.sh new file mode 100644 index 0000000000..ea6fce8692 --- /dev/null +++ b/lgsm/modules/core_trap.sh @@ -0,0 +1,22 @@ +#!/bin/bash +# LinuxGSM core_trap.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Handles CTRL-C trap to give an exit code. + +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +fn_exit_trap() { + if [ -z "${exitcode}" ]; then + exitcode=$? + fi + echo -e "" + if [ -z "${exitcode}" ]; then + exitcode=0 + fi + core_exit.sh +} + +# trap to give an exit code. +trap fn_exit_trap INT diff --git a/lgsm/functions/fix.sh b/lgsm/modules/fix.sh old mode 100755 new mode 100644 similarity index 93% rename from lgsm/functions/fix.sh rename to lgsm/modules/fix.sh index 57f6a91fac..322091f5aa --- a/lgsm/functions/fix.sh +++ b/lgsm/modules/fix.sh @@ -3,10 +3,10 @@ # Author: Daniel Gibbs # Contributors: http://linuxgsm.com/contrib # Website: https://linuxgsm.com -# Description: Overall function for managing fixes. -# Runs functions that will fix an issue. +# Description: Overall module for managing fixes. +# Runs modules that will fix an issue. -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" # Messages that are displayed for some fixes. fn_fix_msg_start() { @@ -59,7 +59,7 @@ apply_post_install_fix=(av kf kf2 lo ro samp ut2k4 ut ut3) 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 + exitcode=1 core_exit.sh fi done diff --git a/lgsm/functions/fix_ark.sh b/lgsm/modules/fix_ark.sh old mode 100755 new mode 100644 similarity index 97% rename from lgsm/functions/fix_ark.sh rename to lgsm/modules/fix_ark.sh index f8e0447e3e..7ca0e60f89 --- a/lgsm/functions/fix_ark.sh +++ b/lgsm/modules/fix_ark.sh @@ -5,7 +5,7 @@ # Website: https://linuxgsm.com # Description: Resolves various issues with ARK: Survival Evolved. -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" # removes mulitple appworkshop_346110.acf if found. steamappsfilewc="$(find "${HOME}" -name appworkshop_346110.acf | wc -l)" diff --git a/lgsm/functions/fix_arma3.sh b/lgsm/modules/fix_arma3.sh old mode 100755 new mode 100644 similarity index 89% rename from lgsm/functions/fix_arma3.sh rename to lgsm/modules/fix_arma3.sh index bbf14c9d20..d417383777 --- a/lgsm/functions/fix_arma3.sh +++ b/lgsm/modules/fix_arma3.sh @@ -5,7 +5,7 @@ # Website: https://linuxgsm.com # Description: Resolves an issue with ARMA3. -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(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 diff --git a/lgsm/functions/fix_armar.sh b/lgsm/modules/fix_armar.sh similarity index 86% rename from lgsm/functions/fix_armar.sh rename to lgsm/modules/fix_armar.sh index 9db42f51ad..2a56daf418 100755 --- a/lgsm/functions/fix_armar.sh +++ b/lgsm/modules/fix_armar.sh @@ -5,7 +5,7 @@ # Website: https://linuxgsm.com # Description: Resolves an issue with Arma Reforger. -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +module_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" # Fixes: Profile directory doesn't exist. # Issue Link: https://feedback.bistudio.com/T164845 diff --git a/lgsm/functions/fix_av.sh b/lgsm/modules/fix_av.sh old mode 100755 new mode 100644 similarity index 90% rename from lgsm/functions/fix_av.sh rename to lgsm/modules/fix_av.sh index a61a8be658..c8fcdcfc5f --- a/lgsm/functions/fix_av.sh +++ b/lgsm/modules/fix_av.sh @@ -5,7 +5,7 @@ # Website: https://linuxgsm.com # Description: Resolves startup issue with Avorion -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${serverfiles}:${serverfiles}/linux64" diff --git a/lgsm/functions/fix_bo.sh b/lgsm/modules/fix_bo.sh similarity index 81% rename from lgsm/functions/fix_bo.sh rename to lgsm/modules/fix_bo.sh index 4536918748..3e09a880f8 100644 --- a/lgsm/functions/fix_bo.sh +++ b/lgsm/modules/fix_bo.sh @@ -5,6 +5,6 @@ # Website: https://linuxgsm.com # Description: Resolves various issues with Ballistic Overkill. -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${serverfiles}:${serverfiles}/BODS_Data/Plugins/x86_64" diff --git a/lgsm/functions/fix_bt.sh b/lgsm/modules/fix_bt.sh similarity index 91% rename from lgsm/functions/fix_bt.sh rename to lgsm/modules/fix_bt.sh index 07fd61ce57..bb26155d8c 100755 --- a/lgsm/functions/fix_bt.sh +++ b/lgsm/modules/fix_bt.sh @@ -5,7 +5,7 @@ # Website: https://linuxgsm.com # Description: Resolves an issue with Barotrauma. -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +module_selfname="$(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 diff --git a/lgsm/functions/fix_cmw.sh b/lgsm/modules/fix_cmw.sh old mode 100755 new mode 100644 similarity index 89% rename from lgsm/functions/fix_cmw.sh rename to lgsm/modules/fix_cmw.sh index 192f483e80..6b8f1caa84 --- a/lgsm/functions/fix_cmw.sh +++ b/lgsm/modules/fix_cmw.sh @@ -5,7 +5,7 @@ # Website: https://linuxgsm.com # Description: Resolves the issue of the not starting server on linux -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" if [ ! -f "${executabledir}/steam_appid.txt" ]; then fixname="steam_appid.txt" diff --git a/lgsm/functions/fix_csgo.sh b/lgsm/modules/fix_csgo.sh old mode 100755 new mode 100644 similarity index 95% rename from lgsm/functions/fix_csgo.sh rename to lgsm/modules/fix_csgo.sh index a393f2fd9c..eb8cc95606 --- a/lgsm/functions/fix_csgo.sh +++ b/lgsm/modules/fix_csgo.sh @@ -5,7 +5,7 @@ # Website: https://linuxgsm.com # Description: Resolves various issues with CS:GO. -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" # Fixes: server not always creating steam_appid.txt file. if [ ! -f "${serverfiles}/steam_appid.txt" ]; then diff --git a/lgsm/functions/fix_dst.sh b/lgsm/modules/fix_dst.sh old mode 100755 new mode 100644 similarity index 91% rename from lgsm/functions/fix_dst.sh rename to lgsm/modules/fix_dst.sh index e30507dc9e..e1f07dcb65 --- a/lgsm/functions/fix_dst.sh +++ b/lgsm/modules/fix_dst.sh @@ -5,7 +5,7 @@ # Website: https://linuxgsm.com # Description: Resolves various issues with Don't Starve Together. -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(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. diff --git a/lgsm/functions/fix_hw.sh b/lgsm/modules/fix_hw.sh old mode 100755 new mode 100644 similarity index 81% rename from lgsm/functions/fix_hw.sh rename to lgsm/modules/fix_hw.sh index af06924dbb..6a92a5c047 --- a/lgsm/functions/fix_hw.sh +++ b/lgsm/modules/fix_hw.sh @@ -5,6 +5,6 @@ # Website: https://linuxgsm.com # Description: Resolves various issues with Hurtworld. -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${serverfiles}:${serverfiles}/Hurtworld_Data/Plugins/x86_64" diff --git a/lgsm/functions/fix_ins.sh b/lgsm/modules/fix_ins.sh old mode 100755 new mode 100644 similarity index 89% rename from lgsm/functions/fix_ins.sh rename to lgsm/modules/fix_ins.sh index 21a979c4cf..21bea123aa --- a/lgsm/functions/fix_ins.sh +++ b/lgsm/modules/fix_ins.sh @@ -5,7 +5,7 @@ # Website: https://linuxgsm.com # Description: Resolves various issues with Insurgency. -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" # Fixes: ./srcds_linux: error while loading shared libraries: libtier0.so: cannot open shared object file: No such file or directory. diff --git a/lgsm/functions/fix_kf.sh b/lgsm/modules/fix_kf.sh old mode 100755 new mode 100644 similarity index 93% rename from lgsm/functions/fix_kf.sh rename to lgsm/modules/fix_kf.sh index e749a2d278..3cfb8fd84a --- a/lgsm/functions/fix_kf.sh +++ b/lgsm/modules/fix_kf.sh @@ -5,7 +5,7 @@ # Website: https://linuxgsm.com # Description: Resolves various issues with Killing Floor. -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" echo -e "Applying WebAdmin ROOst.css fix." echo -e "http://forums.tripwireinteractive.com/showpost.php?p=585435&postcount=13" diff --git a/lgsm/functions/fix_kf2.sh b/lgsm/modules/fix_kf2.sh old mode 100755 new mode 100644 similarity index 87% rename from lgsm/functions/fix_kf2.sh rename to lgsm/modules/fix_kf2.sh index b680a99378..7be311b4fa --- a/lgsm/functions/fix_kf2.sh +++ b/lgsm/modules/fix_kf2.sh @@ -5,7 +5,7 @@ # Website: https://linuxgsm.com # Description: Resolves various issues with Killing Floor 2. -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" startparameters="\"${defaultmap}?Game=KFGameContent.KFGameInfo_VersusSurvival\"" diff --git a/lgsm/functions/fix_lo.sh b/lgsm/modules/fix_lo.sh similarity index 80% rename from lgsm/functions/fix_lo.sh rename to lgsm/modules/fix_lo.sh index eec2ebd360..a042488678 100644 --- a/lgsm/functions/fix_lo.sh +++ b/lgsm/modules/fix_lo.sh @@ -1,10 +1,10 @@ #!/bin/bash -# LinuxGSM fix_lo.sh function +# LinuxGSM fix_lo.sh module # Author: Daniel Gibbs # Website: https://linuxgsm.com # Description: Resolves installation issue with Last Oasis -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" appidfile=${executabledir}/steam_appid.txt if [ ! -f "${appidfile}" ]; then diff --git a/lgsm/functions/fix_mcb.sh b/lgsm/modules/fix_mcb.sh old mode 100755 new mode 100644 similarity index 84% rename from lgsm/functions/fix_mcb.sh rename to lgsm/modules/fix_mcb.sh index 4768a40cfe..828225e72e --- a/lgsm/functions/fix_mcb.sh +++ b/lgsm/modules/fix_mcb.sh @@ -5,7 +5,7 @@ # Website: https://linuxgsm.com # Description: Resolves possible startup issue with Minecraft Bedrock. -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" # official docs state that the server should be started with: LD_LIBRARY_PATH=. ./bedrock_server export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${serverfiles}" diff --git a/lgsm/functions/fix_mta.sh b/lgsm/modules/fix_mta.sh old mode 100755 new mode 100644 similarity index 89% rename from lgsm/functions/fix_mta.sh rename to lgsm/modules/fix_mta.sh index 2c92e8d126..21292d7f3b --- a/lgsm/functions/fix_mta.sh +++ b/lgsm/modules/fix_mta.sh @@ -5,7 +5,7 @@ # Website: https://linuxgsm.com # Description: Installs the libmysqlclient for database functions on the server. -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" if [ ! -f "${lgsmdir}/lib/libmysqlclient.so.16" ]; then fixname="libmysqlclient16" diff --git a/lgsm/functions/fix_nmrih.sh b/lgsm/modules/fix_nmrih.sh old mode 100755 new mode 100644 similarity index 93% rename from lgsm/functions/fix_nmrih.sh rename to lgsm/modules/fix_nmrih.sh index 4bb70c6f9a..83a5ad4120 --- a/lgsm/functions/fix_nmrih.sh +++ b/lgsm/modules/fix_nmrih.sh @@ -6,7 +6,7 @@ # Description: Create symlinks for renamed No More Room In Hell serverfiles. # Solution from Steam Community post: https://steamcommunity.com/app/224260/discussions/2/1732089092441769414/ -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" ln -s "${serverfiles}/bin/vphysics_srv.so" "${serverfiles}/bin/vphysics.so" ln -s "${serverfiles}/bin/studiorender_srv.so" "${serverfiles}/bin/studiorender.so" diff --git a/lgsm/functions/fix_onset.sh b/lgsm/modules/fix_onset.sh old mode 100755 new mode 100644 similarity index 91% rename from lgsm/functions/fix_onset.sh rename to lgsm/modules/fix_onset.sh index e4183999df..7d644ef7b8 --- a/lgsm/functions/fix_onset.sh +++ b/lgsm/modules/fix_onset.sh @@ -5,7 +5,7 @@ # Website: https://linuxgsm.com # Description: Resolves various issues with Onset. -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${serverfiles}" diff --git a/lgsm/functions/fix_ro.sh b/lgsm/modules/fix_ro.sh old mode 100755 new mode 100644 similarity index 94% rename from lgsm/functions/fix_ro.sh rename to lgsm/modules/fix_ro.sh index 895c7c2da7..5dd1d3fb80 --- a/lgsm/functions/fix_ro.sh +++ b/lgsm/modules/fix_ro.sh @@ -5,7 +5,7 @@ # Website: https://linuxgsm.com # Description: Resolves various issues with Red Orchestra. -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" echo -e "Applying WebAdmin ROOst.css fix." echo -e "http://forums.tripwireinteractive.com/showpost.php?p=585435&postcount=13" diff --git a/lgsm/functions/fix_rust.sh b/lgsm/modules/fix_rust.sh old mode 100755 new mode 100644 similarity index 94% rename from lgsm/functions/fix_rust.sh rename to lgsm/modules/fix_rust.sh index 5f407e89f8..0699a8f00b --- a/lgsm/functions/fix_rust.sh +++ b/lgsm/modules/fix_rust.sh @@ -5,7 +5,7 @@ # Website: https://linuxgsm.com # Description: Resolves startup issue with Rust. -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" # Fixes: [Raknet] Server Shutting Down (Shutting Down). export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${serverfiles}:${serverfiles}/RustDedicated_Data/Plugins/x86_64" diff --git a/lgsm/functions/fix_rw.sh b/lgsm/modules/fix_rw.sh old mode 100755 new mode 100644 similarity index 80% rename from lgsm/functions/fix_rw.sh rename to lgsm/modules/fix_rw.sh index aef41a7031..2cc631122c --- a/lgsm/functions/fix_rw.sh +++ b/lgsm/modules/fix_rw.sh @@ -5,6 +5,6 @@ # Website: https://linuxgsm.com # Description: Resolves various issues with Rising World. -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${serverfiles}:${serverfiles}/linux64" diff --git a/lgsm/functions/fix_samp.sh b/lgsm/modules/fix_samp.sh similarity index 94% rename from lgsm/functions/fix_samp.sh rename to lgsm/modules/fix_samp.sh index a88bf154f6..146fc37af7 100644 --- a/lgsm/functions/fix_samp.sh +++ b/lgsm/modules/fix_samp.sh @@ -5,7 +5,7 @@ # Website: https://linuxgsm.com # Description: Resolves issue that the default rcon password is not changed -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" if [ -f "${servercfgfullpath}" ]; then # check if default password is set "changeme" diff --git a/lgsm/functions/fix_sdtd.sh b/lgsm/modules/fix_sdtd.sh old mode 100755 new mode 100644 similarity index 81% rename from lgsm/functions/fix_sdtd.sh rename to lgsm/modules/fix_sdtd.sh index e93db7970f..e46f7db8cb --- a/lgsm/functions/fix_sdtd.sh +++ b/lgsm/modules/fix_sdtd.sh @@ -5,6 +5,6 @@ # Website: https://linuxgsm.com # Description: Resolves various issues with 7 Days to Die. -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${serverfiles}/7DaysToDieServer_Data/Plugins/x86_64" diff --git a/lgsm/functions/fix_sfc.sh b/lgsm/modules/fix_sfc.sh old mode 100755 new mode 100644 similarity index 95% rename from lgsm/functions/fix_sfc.sh rename to lgsm/modules/fix_sfc.sh index 51b95b9d52..891b718034 --- a/lgsm/functions/fix_sfc.sh +++ b/lgsm/modules/fix_sfc.sh @@ -5,7 +5,7 @@ # Website: https://linuxgsm.com # Description: Resolves various issues with Source Forts Classic. -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" if [ ! -f "${serverfiles}/bin/datacache.so" ]; then ln -s "${serverfiles}/bin/datacache_srv.so" "${serverfiles}/bin/datacache.so" diff --git a/lgsm/functions/fix_sof2.sh b/lgsm/modules/fix_sof2.sh old mode 100755 new mode 100644 similarity index 82% rename from lgsm/functions/fix_sof2.sh rename to lgsm/modules/fix_sof2.sh index 002f429528..43d943cb18 --- a/lgsm/functions/fix_sof2.sh +++ b/lgsm/modules/fix_sof2.sh @@ -5,7 +5,7 @@ # Website: https://linuxgsm.com # Description: Resolves various issues with Soldier of Fortune 2. -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" # Fixes: error while loading shared libraries: libcxa.so.1 export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${serverfiles}" diff --git a/lgsm/functions/fix_squad.sh b/lgsm/modules/fix_squad.sh similarity index 92% rename from lgsm/functions/fix_squad.sh rename to lgsm/modules/fix_squad.sh index 7d5929b5df..e7162d310a 100644 --- a/lgsm/functions/fix_squad.sh +++ b/lgsm/modules/fix_squad.sh @@ -5,7 +5,7 @@ # Website: https://linuxgsm.com # Description: Resolves various issues with Squad. -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(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}" diff --git a/lgsm/functions/fix_st.sh b/lgsm/modules/fix_st.sh similarity index 84% rename from lgsm/functions/fix_st.sh rename to lgsm/modules/fix_st.sh index b9fb5b084a..44066bb379 100644 --- a/lgsm/functions/fix_st.sh +++ b/lgsm/modules/fix_st.sh @@ -5,7 +5,7 @@ # Website: https://linuxgsm.com # Description: Resolves startup issue with Stationeers. -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" # Fixes: [Raknet] Server Shutting Down (Shutting Down). export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${serverfiles}:${serverfiles}/rocketstation_DedicatedServer_Data/Plugins/x86_64" diff --git a/lgsm/functions/fix_steamcmd.sh b/lgsm/modules/fix_steamcmd.sh old mode 100755 new mode 100644 similarity index 98% rename from lgsm/functions/fix_steamcmd.sh rename to lgsm/modules/fix_steamcmd.sh index 9644208dc7..44980ab321 --- a/lgsm/functions/fix_steamcmd.sh +++ b/lgsm/modules/fix_steamcmd.sh @@ -5,7 +5,7 @@ # Website: https://linuxgsm.com # Description: Resolves various issues related to SteamCMD. -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" # function to simplify the steamclient.so fix # example diff --git a/lgsm/functions/fix_terraria.sh b/lgsm/modules/fix_terraria.sh old mode 100755 new mode 100644 similarity index 75% rename from lgsm/functions/fix_terraria.sh rename to lgsm/modules/fix_terraria.sh index 7758fdad96..7e5aa67e28 --- a/lgsm/functions/fix_terraria.sh +++ b/lgsm/modules/fix_terraria.sh @@ -5,6 +5,6 @@ # Website: https://linuxgsm.com # Description: Resolves an issue with Terraria. -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" export TERM=xterm diff --git a/lgsm/functions/fix_tf2.sh b/lgsm/modules/fix_tf2.sh old mode 100755 new mode 100644 similarity index 88% rename from lgsm/functions/fix_tf2.sh rename to lgsm/modules/fix_tf2.sh index 77e41a9698..085542eed9 --- a/lgsm/functions/fix_tf2.sh +++ b/lgsm/modules/fix_tf2.sh @@ -5,7 +5,7 @@ # Website: https://linuxgsm.com # Description: Resolves various issues with Team Fortress 2. -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(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 diff --git a/lgsm/functions/fix_ts3.sh b/lgsm/modules/fix_ts3.sh old mode 100755 new mode 100644 similarity index 94% rename from lgsm/functions/fix_ts3.sh rename to lgsm/modules/fix_ts3.sh index 7c7387cb60..9eb728f484 --- a/lgsm/functions/fix_ts3.sh +++ b/lgsm/modules/fix_ts3.sh @@ -5,7 +5,7 @@ # Website: https://linuxgsm.com # Description: Resolves various issues with Teamspeak 3. -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" # Fixes: makes libmariadb2 available #1924. if [ ! -f "${serverfiles}/libmariadb.so.2" ]; then diff --git a/lgsm/functions/fix_unt.sh b/lgsm/modules/fix_unt.sh old mode 100755 new mode 100644 similarity index 81% rename from lgsm/functions/fix_unt.sh rename to lgsm/modules/fix_unt.sh index eae2e63134..77253bd856 --- a/lgsm/functions/fix_unt.sh +++ b/lgsm/modules/fix_unt.sh @@ -5,6 +5,6 @@ # Website: https://linuxgsm.com # Description: Resolves startup issue with Unturned. -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${serverfiles}:${serverfiles}/Unturned_Headless_Data/Plugins/x86_64" diff --git a/lgsm/functions/fix_ut.sh b/lgsm/modules/fix_ut.sh old mode 100755 new mode 100644 similarity index 83% rename from lgsm/functions/fix_ut.sh rename to lgsm/modules/fix_ut.sh index 2e6686a8d5..aa958e86d7 --- a/lgsm/functions/fix_ut.sh +++ b/lgsm/modules/fix_ut.sh @@ -5,7 +5,7 @@ # Website: https://linuxgsm.com # Description: Resolves various issues with Unreal Tournament. -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" #Set Binary Executable echo -e "chmod +x ${executabledir}/${executable}" diff --git a/lgsm/functions/fix_ut2k4.sh b/lgsm/modules/fix_ut2k4.sh old mode 100755 new mode 100644 similarity index 93% rename from lgsm/functions/fix_ut2k4.sh rename to lgsm/modules/fix_ut2k4.sh index 49610e4b69..0a3b89b337 --- a/lgsm/functions/fix_ut2k4.sh +++ b/lgsm/modules/fix_ut2k4.sh @@ -5,7 +5,7 @@ # Website: https://linuxgsm.com # Description: Resolves various issues with Unreal Tournament 2004. -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" echo -e "applying WebAdmin ut2003.css fix." echo -e "http://forums.tripwireinteractive.com/showpost.php?p=585435&postcount=13" diff --git a/lgsm/functions/fix_ut3.sh b/lgsm/modules/fix_ut3.sh old mode 100755 new mode 100644 similarity index 91% rename from lgsm/functions/fix_ut3.sh rename to lgsm/modules/fix_ut3.sh index 6bd26a53a8..4958537f2e --- a/lgsm/functions/fix_ut3.sh +++ b/lgsm/modules/fix_ut3.sh @@ -5,7 +5,7 @@ # Website: https://linuxgsm.com # Description: Resolves various issues with Unreal Tournament 3. -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" startparameters="server VCTF-Suspense?Game=UTGameContent.UTVehicleCTFGame_Content?bIsDedicated=true?bIsLanMatch=false?bUsesStats=false?bShouldAdvertise=false?PureServer=1?bAllowJoinInProgress=true?ConfigSubDir=${selfname} -port=${port} -queryport=${queryport} -multihome=${ip} -nohomedir -unattended -log=${gamelog}" diff --git a/lgsm/functions/fix_vh.sh b/lgsm/modules/fix_vh.sh old mode 100755 new mode 100644 similarity index 92% rename from lgsm/functions/fix_vh.sh rename to lgsm/modules/fix_vh.sh index a90c5d0b0f..9849077470 --- a/lgsm/functions/fix_vh.sh +++ b/lgsm/modules/fix_vh.sh @@ -1,10 +1,10 @@ #!/bin/bash -# LinuxGSM fix_rust.sh function +# LinuxGSM fix_rust.sh module # Author: Alasdair Haig # Website: https://linuxgsm.com # Description: Resolves startup issue with Valheim -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" export LD_LIBRARY_PATH=./linux64:$LD_LIBRARY_PATH diff --git a/lgsm/functions/fix_wurm.sh b/lgsm/modules/fix_wurm.sh old mode 100755 new mode 100644 similarity index 87% rename from lgsm/functions/fix_wurm.sh rename to lgsm/modules/fix_wurm.sh index aba24d382b..1536df2e7e --- a/lgsm/functions/fix_wurm.sh +++ b/lgsm/modules/fix_wurm.sh @@ -5,7 +5,7 @@ # Website: https://linuxgsm.com # Description: Resolves various issues with Wurm Unlimited. -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" # First run requires start with no parms. # After first run new dirs are created. diff --git a/lgsm/functions/fix_zmr.sh b/lgsm/modules/fix_zmr.sh old mode 100755 new mode 100644 similarity index 95% rename from lgsm/functions/fix_zmr.sh rename to lgsm/modules/fix_zmr.sh index 491c366380..56f055fc31 --- a/lgsm/functions/fix_zmr.sh +++ b/lgsm/modules/fix_zmr.sh @@ -5,7 +5,7 @@ # Website: https://linuxgsm.com # Description: Resolves various issues with Zombie Master: Reborn. -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" if [ ! -f "${serverfiles}/bin/datacache.so" ]; then ln -s "${serverfiles}/bin/datacache_srv.so" "${serverfiles}/bin/datacache.so" diff --git a/lgsm/functions/info_distro.sh b/lgsm/modules/info_distro.sh old mode 100755 new mode 100644 similarity index 99% rename from lgsm/functions/info_distro.sh rename to lgsm/modules/info_distro.sh index f29e621d50..411a504587 --- a/lgsm/functions/info_distro.sh +++ b/lgsm/modules/info_distro.sh @@ -6,7 +6,7 @@ # Description: Variables providing useful info on the Operating System such as disk and performace info. # Used for command_details.sh, command_debug.sh and alert.sh. -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" ### Game Server pid if [ "${status}" == "1" ]; then diff --git a/lgsm/functions/info_game.sh b/lgsm/modules/info_game.sh similarity index 99% rename from lgsm/functions/info_game.sh rename to lgsm/modules/info_game.sh index 8c9ca310a8..59e8d37fae 100644 --- a/lgsm/functions/info_game.sh +++ b/lgsm/modules/info_game.sh @@ -5,7 +5,7 @@ # Website: https://linuxgsm.com # Description: Gathers various game server information. -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" ## Examples of filtering to get info from config files. # sed 's/foo//g' - remove foo diff --git a/lgsm/functions/info_messages.sh b/lgsm/modules/info_messages.sh old mode 100755 new mode 100644 similarity index 99% rename from lgsm/functions/info_messages.sh rename to lgsm/modules/info_messages.sh index 5478987f1c..4dbbdcd96e --- a/lgsm/functions/info_messages.sh +++ b/lgsm/modules/info_messages.sh @@ -5,7 +5,7 @@ # Website: https://linuxgsm.com # Description: Defines server info messages for details and alerts. -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" # Separator is different for details. fn_messages_separator() { diff --git a/lgsm/functions/info_stats.sh b/lgsm/modules/info_stats.sh old mode 100755 new mode 100644 similarity index 99% rename from lgsm/functions/info_stats.sh rename to lgsm/modules/info_stats.sh index 0589770f69..2afe3338dc --- a/lgsm/functions/info_stats.sh +++ b/lgsm/modules/info_stats.sh @@ -6,7 +6,7 @@ # Description: Collect optional Stats sent to LinuxGSM project. # Uses Google analytics. -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" info_distro.sh diff --git a/lgsm/functions/install_complete.sh b/lgsm/modules/install_complete.sh old mode 100755 new mode 100644 similarity index 86% rename from lgsm/functions/install_complete.sh rename to lgsm/modules/install_complete.sh index ad258b2245..58189a4bec --- a/lgsm/functions/install_complete.sh +++ b/lgsm/modules/install_complete.sh @@ -5,7 +5,7 @@ # Website: https://linuxgsm.com # Description: Prints installation completion message and hints. -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" echo -e "" echo -e "=================================" diff --git a/lgsm/functions/install_config.sh b/lgsm/modules/install_config.sh old mode 100755 new mode 100644 similarity index 99% rename from lgsm/functions/install_config.sh rename to lgsm/modules/install_config.sh index 35d7df7c6b..699a919c3a --- a/lgsm/functions/install_config.sh +++ b/lgsm/modules/install_config.sh @@ -5,7 +5,7 @@ # Website: https://linuxgsm.com # Description: Creates default server configs. -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" # Checks if server cfg dir exists, creates it if it doesn't. fn_check_cfgdir() { diff --git a/lgsm/functions/install_dst_token.sh b/lgsm/modules/install_dst_token.sh old mode 100755 new mode 100644 similarity index 95% rename from lgsm/functions/install_dst_token.sh rename to lgsm/modules/install_dst_token.sh index 50bc7ed972..43db58fabe --- a/lgsm/functions/install_dst_token.sh +++ b/lgsm/modules/install_dst_token.sh @@ -5,7 +5,7 @@ # Website: https://linuxgsm.com # Description: Configures Don't Starve Together cluster with given token. -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" echo -e "" echo -e "${lightyellow}Enter ${gamename} Cluster Token${default}" diff --git a/lgsm/functions/install_eula.sh b/lgsm/modules/install_eula.sh old mode 100755 new mode 100644 similarity index 95% rename from lgsm/functions/install_eula.sh rename to lgsm/modules/install_eula.sh index 3e51fac714..d70ca7d31d --- a/lgsm/functions/install_eula.sh +++ b/lgsm/modules/install_eula.sh @@ -5,7 +5,7 @@ # Website: https://linuxgsm.com # Description: Gets user to accept the EULA. -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" if [ "${shortname}" == "ts3" ]; then eulaurl="https://www.teamspeak.com/en/privacy-and-terms" diff --git a/lgsm/functions/install_factorio_save.sh b/lgsm/modules/install_factorio_save.sh old mode 100755 new mode 100644 similarity index 86% rename from lgsm/functions/install_factorio_save.sh rename to lgsm/modules/install_factorio_save.sh index f5fdb8a041..c86ee2f371 --- a/lgsm/functions/install_factorio_save.sh +++ b/lgsm/modules/install_factorio_save.sh @@ -5,7 +5,7 @@ # Website: https://linuxgsm.com # Description: Creates the initial save file for Factorio. -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" echo -e "" echo -e "${lightyellow}Creating initial Factorio savefile${default}" diff --git a/lgsm/functions/install_gslt.sh b/lgsm/modules/install_gslt.sh old mode 100755 new mode 100644 similarity index 96% rename from lgsm/functions/install_gslt.sh rename to lgsm/modules/install_gslt.sh index 1ae1ef3b01..e2224276f3 --- a/lgsm/functions/install_gslt.sh +++ b/lgsm/modules/install_gslt.sh @@ -5,7 +5,7 @@ # Website: https://linuxgsm.com # Description: Configures GSLT. -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" echo -e "" echo -e "${lightyellow}Game Server Login Token${default}" diff --git a/lgsm/functions/install_header.sh b/lgsm/modules/install_header.sh old mode 100755 new mode 100644 similarity index 91% rename from lgsm/functions/install_header.sh rename to lgsm/modules/install_header.sh index 4cf067f8f4..b52e116e7f --- a/lgsm/functions/install_header.sh +++ b/lgsm/modules/install_header.sh @@ -5,7 +5,7 @@ # Website: https://linuxgsm.com # Description: Prints installation header. -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" clear fn_print_ascii_logo diff --git a/lgsm/functions/install_logs.sh b/lgsm/modules/install_logs.sh old mode 100755 new mode 100644 similarity index 97% rename from lgsm/functions/install_logs.sh rename to lgsm/modules/install_logs.sh index 80a55fb944..31a4085063 --- a/lgsm/functions/install_logs.sh +++ b/lgsm/modules/install_logs.sh @@ -5,7 +5,7 @@ # Website: https://linuxgsm.com # Description: Creates log directories. -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" if [ "${checklogs}" != "1" ]; then echo -e "" diff --git a/lgsm/functions/install_mta_resources.sh b/lgsm/modules/install_mta_resources.sh old mode 100755 new mode 100644 similarity index 88% rename from lgsm/functions/install_mta_resources.sh rename to lgsm/modules/install_mta_resources.sh index 011ad9b71d..bafdbdbf12 --- a/lgsm/functions/install_mta_resources.sh +++ b/lgsm/modules/install_mta_resources.sh @@ -5,7 +5,7 @@ # Website: https://linuxgsm.com # Description: Installs the libmysqlclient for database functions on the server and optionally installs default resources required to run the server. -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_print_information_nl "${gamename} will not function without resources!" echo -e " * install default resources using ./${selfname} install-default-resources" diff --git a/lgsm/functions/install_retry.sh b/lgsm/modules/install_retry.sh old mode 100755 new mode 100644 similarity index 82% rename from lgsm/functions/install_retry.sh rename to lgsm/modules/install_retry.sh index a36b4fb38d..1fc4bf36a6 --- a/lgsm/functions/install_retry.sh +++ b/lgsm/modules/install_retry.sh @@ -5,7 +5,7 @@ # Website: https://linuxgsm.com # Description: Asks for installation retry after failure. -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" if fn_prompt_yn "Retry install?" Y; then command_install.sh diff --git a/lgsm/functions/install_server_dir.sh b/lgsm/modules/install_server_dir.sh old mode 100755 new mode 100644 similarity index 89% rename from lgsm/functions/install_server_dir.sh rename to lgsm/modules/install_server_dir.sh index 658f4360ca..08e83dce6c --- a/lgsm/functions/install_server_dir.sh +++ b/lgsm/modules/install_server_dir.sh @@ -5,7 +5,7 @@ # Website: https://linuxgsm.com # Description: Creates the server directory. -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" echo -e "" echo -e "${lightyellow}Server Directory${default}" diff --git a/lgsm/functions/install_server_files.sh b/lgsm/modules/install_server_files.sh old mode 100755 new mode 100644 similarity index 99% rename from lgsm/functions/install_server_files.sh rename to lgsm/modules/install_server_files.sh index 80075a76ac..717030df4d --- a/lgsm/functions/install_server_files.sh +++ b/lgsm/modules/install_server_files.sh @@ -5,7 +5,7 @@ # Website: https://linuxgsm.com # Description: Installs server files. -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_install_server_files() { if [ "${shortname}" == "ahl" ]; then diff --git a/lgsm/functions/install_squad_license.sh b/lgsm/modules/install_squad_license.sh old mode 100755 new mode 100644 similarity index 93% rename from lgsm/functions/install_squad_license.sh rename to lgsm/modules/install_squad_license.sh index 181646e85b..58053e134a --- a/lgsm/functions/install_squad_license.sh +++ b/lgsm/modules/install_squad_license.sh @@ -5,7 +5,7 @@ # Website: https://linuxgsm.com # Description: Configures the Squad server's license. -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" echo -e "" echo -e "${lightyellow}Squad Server License${default}" diff --git a/lgsm/functions/install_stats.sh b/lgsm/modules/install_stats.sh old mode 100755 new mode 100644 similarity index 93% rename from lgsm/functions/install_stats.sh rename to lgsm/modules/install_stats.sh index d3b45b40b8..8c65c007c2 --- a/lgsm/functions/install_stats.sh +++ b/lgsm/modules/install_stats.sh @@ -5,7 +5,7 @@ # Website: https://linuxgsm.com # Description: Enabled LinuxGSM Stats. -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" echo -e "" echo -e "${lightyellow}LinuxGSM Stats${default}" diff --git a/lgsm/functions/install_steamcmd.sh b/lgsm/modules/install_steamcmd.sh old mode 100755 new mode 100644 similarity index 83% rename from lgsm/functions/install_steamcmd.sh rename to lgsm/modules/install_steamcmd.sh index b1e64a42cd..8eeb2de539 --- a/lgsm/functions/install_steamcmd.sh +++ b/lgsm/modules/install_steamcmd.sh @@ -5,7 +5,7 @@ # Website: https://linuxgsm.com # Description: Downloads SteamCMD on install. -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" echo -e "" echo -e "${lightyellow}Installing SteamCMD${default}" diff --git a/lgsm/functions/install_ts3db.sh b/lgsm/modules/install_ts3db.sh old mode 100755 new mode 100644 similarity index 97% rename from lgsm/functions/install_ts3db.sh rename to lgsm/modules/install_ts3db.sh index ed879cd287..703f9b6454 --- a/lgsm/functions/install_ts3db.sh +++ b/lgsm/modules/install_ts3db.sh @@ -5,7 +5,7 @@ # Website: https://linuxgsm.com # Description: Installs the database server MariaDB for TeamSpeak 3. -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_install_ts3db_mariadb() { if [ ! -f "${serverfiles}/libts3db_mariadb.so" ]; then diff --git a/lgsm/functions/install_ut2k4_key.sh b/lgsm/modules/install_ut2k4_key.sh old mode 100755 new mode 100644 similarity index 93% rename from lgsm/functions/install_ut2k4_key.sh rename to lgsm/modules/install_ut2k4_key.sh index 124052d05d..c09c4590ce --- a/lgsm/functions/install_ut2k4_key.sh +++ b/lgsm/modules/install_ut2k4_key.sh @@ -5,7 +5,7 @@ # Website: https://linuxgsm.com # Description: Activates ut2k4 server with given key. -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" echo -e "" echo -e "${lightyellow}Enter ${gamename} CD Key${default}" diff --git a/lgsm/functions/mods_core.sh b/lgsm/modules/mods_core.sh old mode 100755 new mode 100644 similarity index 99% rename from lgsm/functions/mods_core.sh rename to lgsm/modules/mods_core.sh index 8e4ade7716..2078ae1673 --- a/lgsm/functions/mods_core.sh +++ b/lgsm/modules/mods_core.sh @@ -3,9 +3,9 @@ # Author: Daniel Gibbs # Contributors: http://linuxgsm.com/contrib # Website: https://linuxgsm.com -# Description: Core functions for mods list/install/update/remove +# Description: Core modules for mods list/install/update/remove -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" # Files and Directories. modsdir="${lgsmdir}/mods" diff --git a/lgsm/functions/mods_list.sh b/lgsm/modules/mods_list.sh old mode 100755 new mode 100644 similarity index 99% rename from lgsm/functions/mods_list.sh rename to lgsm/modules/mods_list.sh index a83b7e3032..e093124e96 --- a/lgsm/functions/mods_list.sh +++ b/lgsm/modules/mods_list.sh @@ -8,7 +8,7 @@ # Usage: Then add this array to the mods_global_array. # Usage: If needed, you can scrape the download URL first. -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" # Get a proper URL for mods that don't provide a good one (optional) fn_script_log_info "Retrieving latest mods URLs" diff --git a/lgsm/functions/query_gamedig.sh b/lgsm/modules/query_gamedig.sh old mode 100755 new mode 100644 similarity index 97% rename from lgsm/functions/query_gamedig.sh rename to lgsm/modules/query_gamedig.sh index 265607acd5..bbf24f5d79 --- a/lgsm/functions/query_gamedig.sh +++ b/lgsm/modules/query_gamedig.sh @@ -6,7 +6,7 @@ # Description: Querys a gameserver using node-gamedig. # https://github.com/sonicsnes/node-gamedig -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(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 diff --git a/lgsm/functions/query_gsquery.py b/lgsm/modules/query_gsquery.py old mode 100755 new mode 100644 similarity index 99% rename from lgsm/functions/query_gsquery.py rename to lgsm/modules/query_gsquery.py index 62c92082e4..09bb147d95 --- a/lgsm/functions/query_gsquery.py +++ b/lgsm/modules/query_gsquery.py @@ -1,6 +1,6 @@ #! /usr/bin/env python3 # -*- coding: utf-8 -*- -# LinuxGSM query_gsquery.py function +# LinuxGSM query_gsquery.py module # Author: Daniel Gibbs # Contributors: http://linuxgsm.com/contrib # Website: https://linuxgsm.com diff --git a/lgsm/functions/update_factorio.sh b/lgsm/modules/update_factorio.sh similarity index 98% rename from lgsm/functions/update_factorio.sh rename to lgsm/modules/update_factorio.sh index 548d53b159..2d58f0cf9a 100644 --- a/lgsm/functions/update_factorio.sh +++ b/lgsm/modules/update_factorio.sh @@ -5,7 +5,7 @@ # Website: https://linuxgsm.com # Description: Handles updating of Factorio servers. -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_update_dl() { # Download and extract files to serverfiles diff --git a/lgsm/functions/update_jediknight2.sh b/lgsm/modules/update_jediknight2.sh similarity index 98% rename from lgsm/functions/update_jediknight2.sh rename to lgsm/modules/update_jediknight2.sh index 7560f01580..8a6cd9bfca 100644 --- a/lgsm/functions/update_jediknight2.sh +++ b/lgsm/modules/update_jediknight2.sh @@ -5,7 +5,7 @@ # Website: https://linuxgsm.com # Description: Handles updating of Jedi Knight 2 servers. -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_update_dl() { # Download and extract files to serverfiles diff --git a/lgsm/functions/update_minecraft.sh b/lgsm/modules/update_minecraft.sh similarity index 98% rename from lgsm/functions/update_minecraft.sh rename to lgsm/modules/update_minecraft.sh index ace4713bc0..69dc118b13 100644 --- a/lgsm/functions/update_minecraft.sh +++ b/lgsm/modules/update_minecraft.sh @@ -5,7 +5,7 @@ # Website: https://linuxgsm.com # Description: Handles updating of Minecraft: Java Edition servers. -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_update_dl() { # Download and extract files to serverfiles diff --git a/lgsm/functions/update_minecraft_bedrock.sh b/lgsm/modules/update_minecraft_bedrock.sh similarity index 98% rename from lgsm/functions/update_minecraft_bedrock.sh rename to lgsm/modules/update_minecraft_bedrock.sh index cf61e3a2b1..a0d76aa20a 100644 --- a/lgsm/functions/update_minecraft_bedrock.sh +++ b/lgsm/modules/update_minecraft_bedrock.sh @@ -5,7 +5,7 @@ # Website: https://linuxgsm.com # Description: Handles updating of Minecraft Bedrock servers. -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_update_dl() { fn_fetch_file "${remotebuildurl}" "" "" "" "${tmpdir}" "bedrock_server.${remotebuildversion}.zip" diff --git a/lgsm/functions/update_mta.sh b/lgsm/modules/update_mta.sh similarity index 98% rename from lgsm/functions/update_mta.sh rename to lgsm/modules/update_mta.sh index 5252c13280..16b8278c70 100644 --- a/lgsm/functions/update_mta.sh +++ b/lgsm/modules/update_mta.sh @@ -5,7 +5,7 @@ # Website: https://linuxgsm.com # Description: Handles updating of Multi Theft Auto servers. -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_update_dl() { # Download and extract files to tmpdir. diff --git a/lgsm/functions/update_papermc.sh b/lgsm/modules/update_papermc.sh similarity index 98% rename from lgsm/functions/update_papermc.sh rename to lgsm/modules/update_papermc.sh index f48a66e39f..447f8808af 100644 --- a/lgsm/functions/update_papermc.sh +++ b/lgsm/modules/update_papermc.sh @@ -1,11 +1,11 @@ #!/bin/bash -# LinuxGSM update_papermc.sh function +# LinuxGSM update_papermc.sh module # Author: Daniel Gibbs # Contributors: http://linuxgsm.com/contrib # Website: https://linuxgsm.com # Description: Handles updating of PaperMC and Waterfall servers. -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +module_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_update_dl() { # Download and extract files to serverfiles diff --git a/lgsm/functions/update_steamcmd.sh b/lgsm/modules/update_steamcmd.sh similarity index 87% rename from lgsm/functions/update_steamcmd.sh rename to lgsm/modules/update_steamcmd.sh index eb773f016f..401da43a8e 100644 --- a/lgsm/functions/update_steamcmd.sh +++ b/lgsm/modules/update_steamcmd.sh @@ -5,7 +5,7 @@ # Website: https://linuxgsm.com # Description: Handles updating using SteamCMD. -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" # init steamcmd functions core_steamcmd.sh @@ -18,7 +18,7 @@ fn_print_dots "${remotelocation}" if [ "${forceupdate}" == "1" ]; then # forceupdate bypasses update checks. - if [ "${status}" != "0" ]&&[ -v "${status}" ]; then + if [ "${status}" != "0" ] && [ -v "${status}" ]; then fn_print_restart_warning exitbypass=1 command_stop.sh diff --git a/lgsm/functions/update_ts3.sh b/lgsm/modules/update_ts3.sh similarity index 98% rename from lgsm/functions/update_ts3.sh rename to lgsm/modules/update_ts3.sh index e76609b2dd..dc79090ed8 100644 --- a/lgsm/functions/update_ts3.sh +++ b/lgsm/modules/update_ts3.sh @@ -5,7 +5,7 @@ # Website: https://linuxgsm.com # Description: Handles updating of Teamspeak 3 servers. -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_update_dl() { # Download and extract files to serverfiles diff --git a/lgsm/functions/update_ut99.sh b/lgsm/modules/update_ut99.sh similarity index 98% rename from lgsm/functions/update_ut99.sh rename to lgsm/modules/update_ut99.sh index b6db783e27..a1dc2b3dda 100644 --- a/lgsm/functions/update_ut99.sh +++ b/lgsm/modules/update_ut99.sh @@ -5,7 +5,7 @@ # Website: https://linuxgsm.com # Description: Handles updating of Unreal Tournament 99 servers. -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +module_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_update_dl() { # Download and extract files to serverfiles diff --git a/lgsm/functions/update_vintagestory.sh b/lgsm/modules/update_vintagestory.sh old mode 100755 new mode 100644 similarity index 98% rename from lgsm/functions/update_vintagestory.sh rename to lgsm/modules/update_vintagestory.sh index 84e3192c9b..946b6ed0be --- a/lgsm/functions/update_vintagestory.sh +++ b/lgsm/modules/update_vintagestory.sh @@ -5,7 +5,7 @@ # Website: https://linuxgsm.com # Description: Handles updating of Vintage Story servers. -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_update_dl() { # Download and extract files to serverfiles diff --git a/linuxgsm.sh b/linuxgsm.sh index 3d8b7f376a..dd7d51bb35 100755 --- a/linuxgsm.sh +++ b/linuxgsm.sh @@ -32,7 +32,7 @@ logdir="${rootdir}/log" lgsmlogdir="${logdir}/lgsm" steamcmddir="${HOME}/.steam/steamcmd" serverfiles="${rootdir}/serverfiles" -functionsdir="${lgsmdir}/functions" +modulesdir="${lgsmdir}/modules" tmpdir="${lgsmdir}/tmp" datadir="${lgsmdir}/data" lockdir="${lgsmdir}/lock" @@ -57,14 +57,14 @@ if [ ! "$(command -v curl 2> /dev/null)" ]; then exit 1 fi -# Core function that is required first. -core_functions.sh() { - functionfile="${FUNCNAME[0]}" - fn_bootstrap_fetch_file_github "lgsm/functions" "core_functions.sh" "${functionsdir}" "chmodx" "run" "noforcedl" "nomd5" +# Core module that is required first. +core_modules.sh() { + modulefile="${FUNCNAME[0]}" + fn_bootstrap_fetch_file_github "lgsm/modules" "core_modules.sh" "${modulesdir}" "chmodx" "run" "noforcedl" "nomd5" } # Bootstrap -# Fetches the core functions required before passed off to core_dl.sh. +# Fetches the core modules required before passed off to core_dl.sh. fn_bootstrap_fetch_file() { remote_fileurl="${1}" remote_fileurl_backup="${2}" @@ -183,7 +183,7 @@ fn_bootstrap_fetch_file_github() { run="${5:-0}" forcedl="${6:-0}" md5="${7:-0}" - # Passes vars to the file download function. + # Passes vars to the file download module. fn_bootstrap_fetch_file "${remote_fileurl}" "${remote_fileurl_backup}" "${remote_fileurl_name}" "${remote_fileurl_backup_name}" "${local_filedir}" "${local_filename}" "${chmodx}" "${run}" "${forcedl}" "${md5}" } @@ -327,11 +327,11 @@ if [ "$(whoami)" == "root" ] && [ ! -f /.dockerenv ]; 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 "${modulesdir}/core_modules.sh" ] || [ ! -f "${modulesdir}/check_root.sh" ] || [ ! -f "${modulesdir}/core_messages.sh" ]; then echo -e "[ FAIL ] Do NOT run this script as root!" exit 1 else - core_functions.sh + core_modules.sh check_root.sh fi fi @@ -377,7 +377,7 @@ if [ "${shortname}" == "core" ]; then # LinuxGSM server mode. else - core_functions.sh + core_modules.sh if [ "${shortname}" != "core-dep" ]; then # Load LinuxGSM configs. # These are required to get all the default variables for the specific server. @@ -397,8 +397,8 @@ else echo -e "OK" fi else - function_file_diff=$(diff -q "${configdirdefault}/config-lgsm/${gameservername}/_default.cfg" "${configdirserver}/_default.cfg") - if [ "${function_file_diff}" != "" ]; then + config_file_diff=$(diff -q "${configdirdefault}/config-lgsm/${gameservername}/_default.cfg" "${configdirserver}/_default.cfg") + if [ "${config_file_diff}" != "" ]; then fn_print_warn_nl "_default.cfg has altered. reloading config." echo -en "copying _default.cfg...\c" cp -R "${configdirdefault}/config-lgsm/${gameservername}/_default.cfg" "${configdirserver}/_default.cfg" diff --git a/tests/tests_fctrserver.sh b/tests/tests_fctrserver.sh index b9ca2789ac..97981c0ccc 100644 --- a/tests/tests_fctrserver.sh +++ b/tests/tests_fctrserver.sh @@ -32,7 +32,7 @@ logdir="${rootdir}/log" lgsmlogdir="${logdir}/lgsm" steamcmddir="${HOME}/.steam/steamcmd" serverfiles="${rootdir}/serverfiles" -functionsdir="${lgsmdir}/functions" +modulesdir="${lgsmdir}/modules" tmpdir="${lgsmdir}/tmp" datadir="${lgsmdir}/data" lockdir="${lgsmdir}/lock" @@ -51,20 +51,20 @@ if [ -z "${TRAVIS}" ]; then fi travistest="1" ## GitHub Branch Select -# Allows for the use of different function files +# Allows for the use of different module files # from a different repo and/or branch. githubuser="GameServerManagers" githubrepo="LinuxGSM" githubbranch="${TRAVIS_BRANCH}" -# Core function that is required first. -core_functions.sh() { - functionfile="${FUNCNAME[0]}" - fn_bootstrap_fetch_file_github "lgsm/functions" "core_functions.sh" "${functionsdir}" "chmodx" "run" "noforcedl" "nohash" +# Core module that is required first. +core_modules.sh() { + modulefile="${FUNCNAME[0]}" + fn_bootstrap_fetch_file_github "lgsm/modules" "core_modules.sh" "${modulesdir}" "chmodx" "run" "noforcedl" "nohash" } # Bootstrap -# Fetches the core functions required before passed off to core_dl.sh. +# Fetches the core modules required before passed off to core_dl.sh. fn_bootstrap_fetch_file() { remote_fileurl="${1}" remote_fileurl_backup="${2}" @@ -183,7 +183,7 @@ fn_bootstrap_fetch_file_github() { run="${5:-0}" forcedl="${6:-0}" md5="${7:-0}" - # Passes vars to the file download function. + # Passes vars to the file download module. fn_bootstrap_fetch_file "${remote_fileurl}" "${remote_fileurl_backup}" "${remote_fileurl_name}" "${remote_fileurl_backup_name}" "${local_filedir}" "${local_filename}" "${chmodx}" "${run}" "${forcedl}" "${md5}" } @@ -327,11 +327,11 @@ if [ "$(whoami)" == "root" ]; 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 "${modulesdir}/core_modules.sh" ] || [ ! -f "${modulesdir}/check_root.sh" ] || [ ! -f "${modulesdir}/core_messages.sh" ]; then echo -e "[ FAIL ] Do NOT run this script as root!" exit 1 else - core_functions.sh + core_modules.sh check_root.sh fi fi @@ -377,7 +377,7 @@ if [ "${shortname}" == "core" ]; then # LinuxGSM server mode. else - core_functions.sh + core_modules.sh if [ "${shortname}" != "core-dep" ]; then # Load LinuxGSM configs. # These are required to get all the default variables for the specific server. @@ -398,8 +398,8 @@ else echo -e "OK" fi else - function_file_diff=$(diff -q "${configdirdefault}/config-lgsm/${gameservername}/_default.cfg" "${configdirserver}/_default.cfg") - if [ "${function_file_diff}" != "" ]; then + module_file_diff=$(diff -q "${configdirdefault}/config-lgsm/${gameservername}/_default.cfg" "${configdirserver}/_default.cfg") + if [ "${module_file_diff}" != "" ]; then fn_print_warn_nl "_default.cfg has been altered. reloading config." echo -en "copying _default.cfg...\c" cp -R "${configdirdefault}/config-lgsm/${gameservername}/_default.cfg" "${configdirserver}/_default.cfg" @@ -636,7 +636,7 @@ echo -e "" ) echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "0.2 - Enable dev-debug" @@ -653,7 +653,7 @@ echo -e "" fn_test_result_pass echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "1.0 - Pre-install tests" @@ -681,7 +681,7 @@ fi echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "1.2 - getopt" @@ -699,7 +699,7 @@ echo -e "" fn_test_result_pass echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "1.3 - getopt with incorrect args" @@ -718,7 +718,7 @@ getopt="abc123" fn_test_result_pass echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "2.0 - Installation" @@ -739,7 +739,7 @@ echo -e "Command: ./${gameservername} auto-install" fn_test_result_pass echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "3.0 - Start/Stop/Restart Tests" @@ -762,7 +762,7 @@ fn_setstatus fn_test_result_pass echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "3.2 - start - online" @@ -781,7 +781,7 @@ fn_setstatus fn_test_result_fail echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "3.3 - start - updateonstart" @@ -801,7 +801,7 @@ fn_setstatus fn_test_result_pass echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "3.4 - stop" @@ -820,7 +820,7 @@ fn_setstatus fn_test_result_pass echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "3.5 - stop - offline" @@ -839,7 +839,7 @@ fn_setstatus fn_test_result_fail echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "3.6 - restart" @@ -858,7 +858,7 @@ fn_setstatus fn_test_result_pass echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "3.7 - restart - offline" @@ -877,7 +877,7 @@ fn_setstatus fn_test_result_pass echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "4.0 - Update Tests" @@ -900,7 +900,7 @@ fn_setstatus fn_test_result_pass echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "4.2 - update-lgsm" @@ -920,7 +920,7 @@ fn_setstatus fn_test_result_pass echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "5.0 - Monitor Tests" @@ -947,7 +947,7 @@ fn_setstatus fn_test_result_pass echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "5.2 - monitor - offline - with lockfile" @@ -970,7 +970,7 @@ echo "${port}" >> "${lockdir}/${selfname}.lock" fn_test_result_pass echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "5.3 - monitor - offline - no lockfile" @@ -989,7 +989,7 @@ fn_setstatus fn_test_result_fail echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "5.4 - test-alert" @@ -1008,7 +1008,7 @@ fn_setstatus fn_test_result_fail echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "6.0 - Details Tests" @@ -1031,7 +1031,7 @@ fn_setstatus fn_test_result_pass echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "6.2 - postdetails" @@ -1050,7 +1050,7 @@ fn_setstatus fn_test_result_pass echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "7.0 - Backup Tests" @@ -1069,7 +1069,7 @@ echo -e "test de-activated until issue #1839 fixed" fn_test_result_pass echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "8.0 - Development Tools Tests" @@ -1092,7 +1092,7 @@ fn_setstatus fn_test_result_pass echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "8.2 - dev - detect ldd" @@ -1111,7 +1111,7 @@ fn_setstatus fn_test_result_pass echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "8.3 - dev - detect deps" @@ -1130,7 +1130,7 @@ fn_setstatus fn_test_result_pass echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "8.4 - dev - query-raw" @@ -1149,7 +1149,7 @@ fn_setstatus fn_test_result_na echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" @@ -1173,7 +1173,7 @@ fn_setstatus fn_test_result_pass echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "=================================" diff --git a/tests/tests_jc2server.sh b/tests/tests_jc2server.sh index 5c27870869..57dd28cc84 100644 --- a/tests/tests_jc2server.sh +++ b/tests/tests_jc2server.sh @@ -32,7 +32,7 @@ logdir="${rootdir}/log" lgsmlogdir="${logdir}/lgsm" steamcmddir="${HOME}/.steam/steamcmd" serverfiles="${rootdir}/serverfiles" -functionsdir="${lgsmdir}/functions" +modulesdir="${lgsmdir}/modules" tmpdir="${lgsmdir}/tmp" datadir="${lgsmdir}/data" lockdir="${lgsmdir}/lock" @@ -52,20 +52,20 @@ fi travistest="1" ## GitHub Branch Select -# Allows for the use of different function files +# Allows for the use of different module files # from a different repo and/or branch. githubuser="GameServerManagers" githubrepo="LinuxGSM" githubbranch="${TRAVIS_BRANCH}" -# Core function that is required first. -core_functions.sh() { - functionfile="${FUNCNAME[0]}" - fn_bootstrap_fetch_file_github "lgsm/functions" "core_functions.sh" "${functionsdir}" "chmodx" "run" "noforcedl" "nohash" +# Core module that is required first. +core_modules.sh() { + modulefile="${FUNCNAME[0]}" + fn_bootstrap_fetch_file_github "lgsm/modules" "core_modules.sh" "${modulesdir}" "chmodx" "run" "noforcedl" "nohash" } # Bootstrap -# Fetches the core functions required before passed off to core_dl.sh. +# Fetches the core modules required before passed off to core_dl.sh. fn_bootstrap_fetch_file() { remote_fileurl="${1}" remote_fileurl_backup="${2}" @@ -184,7 +184,7 @@ fn_bootstrap_fetch_file_github() { run="${5:-0}" forcedl="${6:-0}" md5="${7:-0}" - # Passes vars to the file download function. + # Passes vars to the file download module. fn_bootstrap_fetch_file "${remote_fileurl}" "${remote_fileurl_backup}" "${remote_fileurl_name}" "${remote_fileurl_backup_name}" "${local_filedir}" "${local_filename}" "${chmodx}" "${run}" "${forcedl}" "${md5}" } @@ -328,11 +328,11 @@ if [ "$(whoami)" == "root" ]; 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 "${modulesdir}/core_modules.sh" ] || [ ! -f "${modulesdir}/check_root.sh" ] || [ ! -f "${modulesdir}/core_messages.sh" ]; then echo -e "[ FAIL ] Do NOT run this script as root!" exit 1 else - core_functions.sh + core_modules.sh check_root.sh fi fi @@ -378,7 +378,7 @@ if [ "${shortname}" == "core" ]; then # LinuxGSM server mode. else - core_functions.sh + core_modules.sh if [ "${shortname}" != "core-dep" ]; then # Load LinuxGSM configs. # These are required to get all the default variables for the specific server. @@ -399,8 +399,8 @@ else echo -e "OK" fi else - function_file_diff=$(diff -q "${configdirdefault}/config-lgsm/${gameservername}/_default.cfg" "${configdirserver}/_default.cfg") - if [ "${function_file_diff}" != "" ]; then + module_file_diff=$(diff -q "${configdirdefault}/config-lgsm/${gameservername}/_default.cfg" "${configdirserver}/_default.cfg") + if [ "${module_file_diff}" != "" ]; then fn_print_warn_nl "_default.cfg has been altered. reloading config." echo -en "copying _default.cfg...\c" cp -R "${configdirdefault}/config-lgsm/${gameservername}/_default.cfg" "${configdirserver}/_default.cfg" @@ -641,7 +641,7 @@ echo -e "" ) echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "0.2 - Enable dev-debug" @@ -658,7 +658,7 @@ echo -e "" fn_test_result_pass echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "1.0 - Pre-install tests" @@ -686,7 +686,7 @@ fi echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "1.2 - getopt" @@ -704,7 +704,7 @@ echo -e "" fn_test_result_pass echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "1.3 - getopt with incorrect args" @@ -723,7 +723,7 @@ getopt="abc123" fn_test_result_pass echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "2.0 - Installation" @@ -744,7 +744,7 @@ echo -e "Command: ./${gameservername} auto-install" fn_test_result_pass echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "3.0 - Start/Stop/Restart Tests" @@ -767,7 +767,7 @@ fn_setstatus fn_test_result_pass echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "3.2 - start - online" @@ -786,7 +786,7 @@ fn_setstatus fn_test_result_fail echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "3.3 - start - updateonstart" @@ -806,7 +806,7 @@ fn_setstatus fn_test_result_pass echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "3.4 - stop" @@ -825,7 +825,7 @@ fn_setstatus fn_test_result_pass echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "3.5 - stop - offline" @@ -844,7 +844,7 @@ fn_setstatus fn_test_result_fail echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "3.6 - restart" @@ -863,7 +863,7 @@ fn_setstatus fn_test_result_pass echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "3.7 - restart - offline" @@ -882,7 +882,7 @@ fn_setstatus fn_test_result_pass echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "4.0 - Update Tests" @@ -905,7 +905,7 @@ fn_setstatus fn_test_result_pass echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "4.2 - update - change buildid" @@ -926,7 +926,7 @@ sed -i 's/[0-9]\+/0/' "${serverfiles}/steamapps/appmanifest_${appid}.acf" fn_test_result_pass echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "4.3 - update - change buildid - online" @@ -947,7 +947,7 @@ sed -i 's/[0-9]\+/0/' "${serverfiles}/steamapps/appmanifest_${appid}.acf" fn_test_result_pass echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "4.4 - update - remove appmanifest file" @@ -968,7 +968,7 @@ rm --verbose "${serverfiles:?}/steamapps/appmanifest_${appid}.acf" fn_test_result_pass echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "4.5 - force-update" @@ -988,7 +988,7 @@ fn_setstatus fn_test_result_pass echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "4.6 - force-update - online" @@ -1008,7 +1008,7 @@ fn_setstatus fn_test_result_pass echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "4.7 - validate" @@ -1027,7 +1027,7 @@ fn_setstatus fn_test_result_pass echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "4.8 - validate - online" @@ -1047,7 +1047,7 @@ fn_setstatus fn_test_result_pass echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "4.9 - update-lgsm" @@ -1067,7 +1067,7 @@ fn_setstatus fn_test_result_pass echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "Inserting IP address" @@ -1108,7 +1108,7 @@ fn_setstatus fn_test_result_pass echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "5.2 - monitor - offline - with lockfile" @@ -1131,7 +1131,7 @@ echo "${port}" >> "${lockdir}/${selfname}.lock" fn_test_result_pass echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "5.3 - monitor - offline - no lockfile" @@ -1150,7 +1150,7 @@ fn_setstatus fn_test_result_fail echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "5.4 - test-alert" @@ -1171,7 +1171,7 @@ sed -i 's/[0-9]\+/0/' "${servercfgfullpath}" fn_test_result_fail echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" fn_print_info_nl "Re-generating ${servercfg}." @@ -1199,7 +1199,7 @@ fn_setstatus fn_test_result_pass echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "6.2 - postdetails" @@ -1218,7 +1218,7 @@ fn_setstatus fn_test_result_pass echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "7.0 - Backup Tests" @@ -1237,7 +1237,7 @@ echo -e "test de-activated until issue #1839 fixed" fn_test_result_pass echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "8.0 - Development Tools Tests" @@ -1260,7 +1260,7 @@ fn_setstatus fn_test_result_pass echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "8.2 - dev - detect ldd" @@ -1279,7 +1279,7 @@ fn_setstatus fn_test_result_pass echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "8.3 - dev - detect deps" @@ -1298,7 +1298,7 @@ fn_setstatus fn_test_result_pass echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "8.4 - dev - query-raw" @@ -1317,7 +1317,7 @@ fn_setstatus fn_test_result_na echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "9.0 - Sponsor" @@ -1340,7 +1340,7 @@ fn_setstatus fn_test_result_pass echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "=================================" diff --git a/tests/tests_mcserver.sh b/tests/tests_mcserver.sh index 05676ad2fd..a32ffd8f55 100644 --- a/tests/tests_mcserver.sh +++ b/tests/tests_mcserver.sh @@ -32,7 +32,7 @@ logdir="${rootdir}/log" lgsmlogdir="${logdir}/lgsm" steamcmddir="${HOME}/.steam/steamcmd" serverfiles="${rootdir}/serverfiles" -functionsdir="${lgsmdir}/functions" +modulesdir="${lgsmdir}/modules" tmpdir="${lgsmdir}/tmp" datadir="${lgsmdir}/data" lockdir="${lgsmdir}/lock" @@ -52,20 +52,20 @@ fi travistest="1" ## GitHub Branch Select -# Allows for the use of different function files +# Allows for the use of different module files # from a different repo and/or branch. githubuser="GameServerManagers" githubrepo="LinuxGSM" githubbranch="${TRAVIS_BRANCH}" -# Core function that is required first. -core_functions.sh() { - functionfile="${FUNCNAME[0]}" - fn_bootstrap_fetch_file_github "lgsm/functions" "core_functions.sh" "${functionsdir}" "chmodx" "run" "noforcedl" "nohash" +# Core module that is required first. +core_modules.sh() { + modulefile="${FUNCNAME[0]}" + fn_bootstrap_fetch_file_github "lgsm/modules" "core_modules.sh" "${modulesdir}" "chmodx" "run" "noforcedl" "nohash" } # Bootstrap -# Fetches the core functions required before passed off to core_dl.sh. +# Fetches the core modules required before passed off to core_dl.sh. fn_bootstrap_fetch_file() { remote_fileurl="${1}" remote_fileurl_backup="${2}" @@ -184,7 +184,7 @@ fn_bootstrap_fetch_file_github() { run="${5:-0}" forcedl="${6:-0}" md5="${7:-0}" - # Passes vars to the file download function. + # Passes vars to the file download module. fn_bootstrap_fetch_file "${remote_fileurl}" "${remote_fileurl_backup}" "${remote_fileurl_name}" "${remote_fileurl_backup_name}" "${local_filedir}" "${local_filename}" "${chmodx}" "${run}" "${forcedl}" "${md5}" } @@ -328,11 +328,11 @@ if [ "$(whoami)" == "root" ]; 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 "${modulesdir}/core_modules.sh" ] || [ ! -f "${modulesdir}/check_root.sh" ] || [ ! -f "${modulesdir}/core_messages.sh" ]; then echo -e "[ FAIL ] Do NOT run this script as root!" exit 1 else - core_functions.sh + core_modules.sh check_root.sh fi fi @@ -378,7 +378,7 @@ if [ "${shortname}" == "core" ]; then # LinuxGSM server mode. else - core_functions.sh + core_modules.sh if [ "${shortname}" != "core-dep" ]; then # Load LinuxGSM configs. # These are required to get all the default variables for the specific server. @@ -399,8 +399,8 @@ else echo -e "OK" fi else - function_file_diff=$(diff -q "${configdirdefault}/config-lgsm/${gameservername}/_default.cfg" "${configdirserver}/_default.cfg") - if [ "${function_file_diff}" != "" ]; then + module_file_diff=$(diff -q "${configdirdefault}/config-lgsm/${gameservername}/_default.cfg" "${configdirserver}/_default.cfg") + if [ "${module_file_diff}" != "" ]; then fn_print_warn_nl "_default.cfg has been altered. reloading config." echo -en "copying _default.cfg...\c" cp -R "${configdirdefault}/config-lgsm/${gameservername}/_default.cfg" "${configdirserver}/_default.cfg" @@ -635,7 +635,7 @@ echo -e "" ) echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "0.2 - Enable dev-debug" @@ -652,7 +652,7 @@ echo -e "" fn_test_result_pass echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "1.0 - Pre-install tests" @@ -680,7 +680,7 @@ fi echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "1.2 - getopt" @@ -698,7 +698,7 @@ echo -e "" fn_test_result_pass echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "1.3 - getopt with incorrect args" @@ -717,7 +717,7 @@ getopt="abc123" fn_test_result_pass echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "2.0 - Installation" @@ -738,7 +738,7 @@ echo -e "Command: ./${gameservername} auto-install" fn_test_result_pass echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "3.0 - Start/Stop/Restart Tests" @@ -761,7 +761,7 @@ fn_setstatus fn_test_result_pass echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "3.2 - start - online" @@ -780,7 +780,7 @@ fn_setstatus fn_test_result_fail echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "3.3 - start - updateonstart" @@ -800,7 +800,7 @@ fn_setstatus fn_test_result_pass echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "30s Pause" echo -e "=================================" @@ -828,7 +828,7 @@ fn_setstatus fn_test_result_pass echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "3.5 - stop - offline" @@ -847,7 +847,7 @@ fn_setstatus fn_test_result_fail echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "3.6 - restart" @@ -866,7 +866,7 @@ fn_setstatus fn_test_result_pass echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "3.7 - restart - offline" @@ -885,7 +885,7 @@ fn_setstatus fn_test_result_pass echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "4.0 - Update Tests" @@ -908,7 +908,7 @@ fn_setstatus fn_test_result_pass echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "4.2 - update-lgsm" @@ -928,7 +928,7 @@ fn_setstatus fn_test_result_pass echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "Inserting IP address" @@ -979,7 +979,7 @@ fn_setstatus fn_test_result_pass echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "5.2 - monitor - offline - with lockfile" @@ -1002,7 +1002,7 @@ echo "${port}" >> "${lockdir}/${selfname}.lock" fn_test_result_pass echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "5.3 - monitor - offline - no lockfile" @@ -1021,7 +1021,7 @@ fn_setstatus fn_test_result_fail echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "5.4 - test-alert" @@ -1040,7 +1040,7 @@ fn_setstatus fn_test_result_fail echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "6.0 - Details Tests" @@ -1063,7 +1063,7 @@ fn_setstatus fn_test_result_pass echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "6.2 - postdetails" @@ -1082,7 +1082,7 @@ fn_setstatus fn_test_result_pass echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "7.0 - Backup Tests" @@ -1101,7 +1101,7 @@ echo -e "test de-activated until issue #1839 fixed" fn_test_result_pass echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "8.0 - Development Tools Tests" @@ -1124,7 +1124,7 @@ fn_setstatus fn_test_result_pass echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "8.2 - dev - detect ldd" @@ -1143,7 +1143,7 @@ fn_setstatus fn_test_result_pass echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "8.3 - dev - detect deps" @@ -1162,7 +1162,7 @@ fn_setstatus fn_test_result_pass echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "Inserting IP address" @@ -1195,7 +1195,7 @@ fn_setstatus fn_test_result_na echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "9.0 - Sponsor" @@ -1218,7 +1218,7 @@ fn_setstatus fn_test_result_pass echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "=================================" diff --git a/tests/tests_ts3server.sh b/tests/tests_ts3server.sh index 1f553fd51a..7d7ed7180c 100644 --- a/tests/tests_ts3server.sh +++ b/tests/tests_ts3server.sh @@ -32,7 +32,7 @@ logdir="${rootdir}/log" lgsmlogdir="${logdir}/lgsm" steamcmddir="${HOME}/.steam/steamcmd" serverfiles="${rootdir}/serverfiles" -functionsdir="${lgsmdir}/functions" +modulesdir="${lgsmdir}/modules" tmpdir="${lgsmdir}/tmp" datadir="${lgsmdir}/data" lockdir="${lgsmdir}/lock" @@ -52,20 +52,20 @@ fi travistest="1" ## GitHub Branch Select -# Allows for the use of different function files +# Allows for the use of different module files # from a different repo and/or branch. githubuser="GameServerManagers" githubrepo="LinuxGSM" githubbranch="${TRAVIS_BRANCH}" -# Core function that is required first. -core_functions.sh() { - functionfile="${FUNCNAME[0]}" - fn_bootstrap_fetch_file_github "lgsm/functions" "core_functions.sh" "${functionsdir}" "chmodx" "run" "noforcedl" "nohash" +# Core module that is required first. +core_modules.sh() { + modulefile="${FUNCNAME[0]}" + fn_bootstrap_fetch_file_github "lgsm/modules" "core_modules.sh" "${modulesdir}" "chmodx" "run" "noforcedl" "nohash" } # Bootstrap -# Fetches the core functions required before passed off to core_dl.sh. +# Fetches the core modules required before passed off to core_dl.sh. fn_bootstrap_fetch_file() { remote_fileurl="${1}" remote_fileurl_backup="${2}" @@ -184,7 +184,7 @@ fn_bootstrap_fetch_file_github() { run="${5:-0}" forcedl="${6:-0}" md5="${7:-0}" - # Passes vars to the file download function. + # Passes vars to the file download module. fn_bootstrap_fetch_file "${remote_fileurl}" "${remote_fileurl_backup}" "${remote_fileurl_name}" "${remote_fileurl_backup_name}" "${local_filedir}" "${local_filename}" "${chmodx}" "${run}" "${forcedl}" "${md5}" } @@ -328,11 +328,11 @@ if [ "$(whoami)" == "root" ]; 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 "${modulesdir}/core_modules.sh" ] || [ ! -f "${modulesdir}/check_root.sh" ] || [ ! -f "${modulesdir}/core_messages.sh" ]; then echo -e "[ FAIL ] Do NOT run this script as root!" exit 1 else - core_functions.sh + core_modules.sh check_root.sh fi fi @@ -378,7 +378,7 @@ if [ "${shortname}" == "core" ]; then # LinuxGSM server mode. else - core_functions.sh + core_modules.sh if [ "${shortname}" != "core-dep" ]; then # Load LinuxGSM configs. # These are required to get all the default variables for the specific server. @@ -399,8 +399,8 @@ else echo -e "OK" fi else - function_file_diff=$(diff -q "${configdirdefault}/config-lgsm/${gameservername}/_default.cfg" "${configdirserver}/_default.cfg") - if [ "${function_file_diff}" != "" ]; then + module_file_diff=$(diff -q "${configdirdefault}/config-lgsm/${gameservername}/_default.cfg" "${configdirserver}/_default.cfg") + if [ "${module_file_diff}" != "" ]; then fn_print_warn_nl "_default.cfg has been altered. reloading config." echo -en "copying _default.cfg...\c" cp -R "${configdirdefault}/config-lgsm/${gameservername}/_default.cfg" "${configdirserver}/_default.cfg" @@ -635,7 +635,7 @@ echo -e "" ) echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "0.2 - Enable dev-debug" @@ -652,7 +652,7 @@ echo -e "" fn_test_result_pass echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "1.0 - Pre-install tests" @@ -680,7 +680,7 @@ fi echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "1.2 - getopt" @@ -698,7 +698,7 @@ echo -e "" fn_test_result_pass echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "1.3 - getopt with incorrect args" @@ -717,7 +717,7 @@ getopt="abc123" fn_test_result_pass echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "2.0 - Installation" @@ -738,7 +738,7 @@ echo -e "Command: ./${gameservername} auto-install" fn_test_result_pass echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "3.0 - Start/Stop/Restart Tests" @@ -761,7 +761,7 @@ fn_setstatus fn_test_result_pass echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "3.2 - start - online" @@ -780,7 +780,7 @@ fn_setstatus fn_test_result_fail echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "3.3 - start - updateonstart" @@ -800,7 +800,7 @@ fn_setstatus fn_test_result_pass echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "3.4 - stop" @@ -819,7 +819,7 @@ fn_setstatus fn_test_result_pass echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "3.5 - stop - offline" @@ -838,7 +838,7 @@ fn_setstatus fn_test_result_fail echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "3.6 - restart" @@ -857,7 +857,7 @@ fn_setstatus fn_test_result_pass echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "3.7 - restart - offline" @@ -876,7 +876,7 @@ fn_setstatus fn_test_result_pass echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "4.0 - Update Tests" @@ -899,7 +899,7 @@ fn_setstatus fn_test_result_pass echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "4.2 - update-lgsm" @@ -919,7 +919,7 @@ fn_setstatus fn_test_result_pass echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "5.0 - Monitor Tests" @@ -946,7 +946,7 @@ fn_setstatus fn_test_result_pass echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "5.2 - monitor - offline - with lockfile" @@ -969,7 +969,7 @@ echo "${port}" >> "${lockdir}/${selfname}.lock" fn_test_result_pass echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "5.3 - monitor - offline - no lockfile" @@ -988,7 +988,7 @@ fn_setstatus fn_test_result_fail echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "5.4 - test-alert" @@ -1007,7 +1007,7 @@ fn_setstatus fn_test_result_fail echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "6.0 - Details Tests" @@ -1030,7 +1030,7 @@ fn_setstatus fn_test_result_pass echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "6.2 - postdetails" @@ -1049,7 +1049,7 @@ fn_setstatus fn_test_result_pass echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "7.0 - Backup Tests" @@ -1068,7 +1068,7 @@ echo -e "test de-activated until issue #1839 fixed" fn_test_result_pass echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "8.0 - Development Tools Tests" @@ -1091,7 +1091,7 @@ fn_setstatus fn_test_result_pass echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "8.2 - dev - detect ldd" @@ -1110,7 +1110,7 @@ fn_setstatus fn_test_result_pass echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "8.3 - dev - detect deps" @@ -1129,7 +1129,7 @@ fn_setstatus fn_test_result_pass echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "8.4 - dev - query-raw" @@ -1148,7 +1148,7 @@ fn_setstatus fn_test_result_na echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "9.0 - Sponsor" @@ -1171,7 +1171,7 @@ fn_setstatus fn_test_result_pass echo -e "run order" echo -e "=================" -grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +grep modulefile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/modulefile=//g' echo -e "" echo -e "=================================" From aa4f75c9a3842001a2628c424a61d7fe33bcfa7e Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Thu, 6 Apr 2023 21:57:05 +0100 Subject: [PATCH 033/181] chore: fix issue with vscode prettier --- .prettierrc.json => .prettierrc | 0 .vscode/extensions.json | 1 - 2 files changed, 1 deletion(-) rename .prettierrc.json => .prettierrc (100%) diff --git a/.prettierrc.json b/.prettierrc similarity index 100% rename from .prettierrc.json rename to .prettierrc diff --git a/.vscode/extensions.json b/.vscode/extensions.json index 0c9982e654..c7a7dab105 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -5,7 +5,6 @@ "yzhang.markdown-all-in-one", "esbenp.prettier-vscode", "timonwong.shellcheck", - "foxundermoon.shell-format", "redhat.vscode-yaml" ] } From ed1fbbecdf7706035fe4edbcec527fd9ca5272ce Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 6 Apr 2023 21:57:58 +0100 Subject: [PATCH 034/181] build(deps): bump actions/add-to-project from 0.4.1 to 0.5.0 (#4167) Bumps [actions/add-to-project](https://github.com/actions/add-to-project) from 0.4.1 to 0.5.0. - [Release notes](https://github.com/actions/add-to-project/releases) - [Commits](https://github.com/actions/add-to-project/compare/v0.4.1...v0.5.0) --- updated-dependencies: - dependency-name: actions/add-to-project 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/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 8e71d1cb59..1a20ef1900 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.1 + - uses: actions/add-to-project@v0.5.0 with: project-url: https://github.com/orgs/GameServerManagers/projects/11 github-token: ${{ secrets.ADD_TO_PROJECT_PAT }} From 8e3dfa1030aa9e787549045ae78e588e4216d4b0 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sat, 8 Apr 2023 13:11:46 +0100 Subject: [PATCH 035/181] fix: add command_update_linuxgsm.sh to functions dir --- lgsm/functions/command_update_linuxgsm.sh | 236 ++++++++++++++++++++++ 1 file changed, 236 insertions(+) create mode 100644 lgsm/functions/command_update_linuxgsm.sh diff --git a/lgsm/functions/command_update_linuxgsm.sh b/lgsm/functions/command_update_linuxgsm.sh new file mode 100644 index 0000000000..3c4e6d0809 --- /dev/null +++ b/lgsm/functions/command_update_linuxgsm.sh @@ -0,0 +1,236 @@ +#!/bin/bash +# LinuxGSM command_update_linuxgsm.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Deletes the modules dir to allow re-downloading of modules from GitHub. + +commandname="UPDATE-LGSM" +commandaction="Updating LinuxGSM" +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +fn_firstcommand_set + +check.sh +info_distro.sh + +fn_print_dots "" +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 +if [ $? != "0" ]; then + 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" + core_exit.sh + else + remotereponame="Bitbucket" + fn_print_ok_nl "Selecting repo: ${remotereponame}" + fi +else + remotereponame="GitHub" + fn_print_ok_nl "Selecting repo: ${remotereponame}" +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 +else + 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 + fn_script_log_fatal "Checking ${remotereponame} linuxgsm.sh" + fn_script_log_fatal "Curl returned error: $?" + core_exit.sh +fi + +if [ "${remotereponame}" == "GitHub" ]; then + tmp_script_diff=$(diff "${tmpdir}/linuxgsm.sh" <(curl --connect-timeout 10 -s "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/linuxgsm.sh")) +else + tmp_script_diff=$(diff "${tmpdir}/linuxgsm.sh" <(curl --connect-timeout 10 -s "https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/linuxgsm.sh")) +fi + +if [ "${tmp_script_diff}" != "" ]; then + fn_print_update_eol_nl + fn_script_log_update "Checking ${remotereponame} linuxgsm.sh" + rm -f "${tmpdir:?}/linuxgsm.sh" + fn_fetch_file_github "" "linuxgsm.sh" "${tmpdir}" "nochmodx" "norun" "noforcedl" "nohash" +else + fn_print_ok_eol_nl + fn_script_log_pass "Checking ${remotereponame} linuxgsm.sh" +fi + +# Check gameserver.sh +# Compare gameserver.sh against linuxgsm.sh in the tmp dir. +# Ignoring server specific vars. +echo -en "checking ${selfname}...\c" +fn_script_log_info "Checking ${selfname}" +script_diff=$(diff <(sed '\/shortname/d;\/gameservername/d;\/gamename/d;\/githubuser/d;\/githubrepo/d;\/githubbranch/d' "${tmpdir}/linuxgsm.sh") <(sed '\/shortname/d;\/gameservername/d;\/gamename/d;\/githubuser/d;\/githubrepo/d;\/githubbranch/d' "${rootdir}/${selfname}")) +if [ "${script_diff}" != "" ]; then + fn_print_update_eol_nl + fn_script_log_update "Checking ${selfname}" + echo -en "backup ${selfname}...\c" + fn_script_log_info "Backup ${selfname}" + if [ ! -d "${backupdir}/script" ]; then + mkdir -p "${backupdir}/script" + fi + cp "${rootdir}/${selfname}" "${backupdir}/script/${selfname}-$(date +"%m_%d_%Y_%M").bak" + if [ $? != 0 ]; then + fn_print_fail_eol_nl + fn_script_log_fatal "Backup ${selfname}" + core_exit.sh + else + fn_print_ok_eol_nl + fn_script_log_pass "Backup ${selfname}" + echo -e "backup location ${backupdir}/script/${selfname}-$(date +"%m_%d_%Y_%M").bak" + fn_script_log_pass "Backup location ${backupdir}/script/${selfname}-$(date +"%m_%d_%Y_%M").bak" + fi + + echo -en "copying ${selfname}...\c" + fn_script_log_info "copying ${selfname}" + cp "${tmpdir}/linuxgsm.sh" "${rootdir}/${selfname}" + sed -i "s+shortname=\"core\"+shortname=\"${shortname}\"+g" "${rootdir}/${selfname}" + sed -i "s+gameservername=\"core\"+gameservername=\"${gameservername}\"+g" "${rootdir}/${selfname}" + sed -i "s+gamename=\"core\"+gamename=\"${gamename}\"+g" "${rootdir}/${selfname}" + sed -i "s+githubuser=\"GameServerManagers\"+githubuser=\"${githubuser}\"+g" "${rootdir}/${selfname}" + sed -i "s+githubrepo=\"LinuxGSM\"+githubrepo=\"${githubrepo}\"+g" "${rootdir}/${selfname}" + sed -i "s+githubbranch=\"master\"+githubbranch=\"${githubbranch}\"+g" "${rootdir}/${selfname}" + + if [ $? != "0" ]; then + fn_print_fail_eol_nl + fn_script_log_fatal "copying ${selfname}" + core_exit.sh + else + fn_print_ok_eol_nl + fn_script_log_pass "copying ${selfname}" + fi +else + fn_print_ok_eol_nl + fn_script_log_info "Checking ${selfname}" +fi + +# Check _default.cfg. +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 +else + 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 + fn_script_log_fatal "Checking ${remotereponame} config _default.cfg" + fn_script_log_fatal "Curl returned error: $?" + core_exit.sh +fi + +if [ "${remotereponame}" == "GitHub" ]; then + config_file_diff=$(diff "${configdirdefault}/config-lgsm/${gameservername}/_default.cfg" <(curl --connect-timeout 10 -s "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/lgsm/config-default/config-lgsm/${gameservername}/_default.cfg")) +else + config_file_diff=$(diff "${configdirdefault}/config-lgsm/${gameservername}/_default.cfg" <(curl --connect-timeout 10 -s "https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/lgsm/config-default/config-lgsm/${gameservername}/_default.cfg")) +fi + +if [ "${config_file_diff}" != "" ]; then + fn_print_update_eol_nl + fn_script_log_update "Checking ${remotereponame} config _default.cfg" + rm -f "${configdirdefault:?}/config-lgsm/${gameservername:?}/_default.cfg" + fn_fetch_file_github "lgsm/config-default/config-lgsm/${gameservername}" "_default.cfg" "${configdirdefault}/config-lgsm/${gameservername}" "nochmodx" "norun" "noforce" "nohash" + alert="config" + alert.sh +else + fn_print_ok_eol_nl + fn_script_log_pass "Checking ${remotereponame} config _default.cfg" +fi + +# Check distro csv. ${datadir}/${distroid}-${distroversioncsv}.csv +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 + else + 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 + fn_script_log_fatal "Checking ${remotereponame} ${distroid}-${distroversioncsv}.csv" + fn_script_log_fatal "Curl returned error: $?" + core_exit.sh + fi + + if [ "${remotereponame}" == "GitHub" ]; then + config_file_diff=$(diff "${datadir}/${distroid}-${distroversioncsv}.csv" <(curl --connect-timeout 10 -s "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/lgsm/data/${distroid}-${distroversioncsv}.csv")) + else + config_file_diff=$(diff "${datadir}/${distroid}-${distroversioncsv}.csv" <(curl --connect-timeout 10 -s "https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/lgsm/data/${distroid}-${distroversioncsv}.csv")) + fi + + if [ "${config_file_diff}" != "" ]; then + fn_print_update_eol_nl + fn_script_log_update "Checking ${remotereponame} ${distroid}-${distroversioncsv}.csv" + rm -f "${datadir:?}/${distroid}-${distroversioncsv}.csv" + fn_fetch_file_github "lgsm/data" "${distroid}-${distroversioncsv}.csv" "${datadir}" "nochmodx" "norun" "noforce" "nohash" + else + fn_print_ok_eol_nl + fn_script_log_pass "Checking ${remotereponame} ${distroid}-${distroversioncsv}.csv" + fi +fi +# Check and update modules. +if [ -n "${modulesdir}" ]; then + if [ -d "${modulesdir}" ]; then + ( + cd "${modulesdir}" || exit + for modulefile in *; do + # check if module exists in the repo and remove if missing. + # commonly used if module names change. + echo -en "checking ${remotereponame} module ${modulefile}...\c" + github_file_url_dir="lgsm/modules" + if [ "${remotereponame}" == "GitHub" ]; then + curl --connect-timeout 10 -IsfL "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${modulefile}" 1> /dev/null + else + curl --connect-timeout 10 -IsfL "https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/${github_file_url_dir}/${modulefile}" 1> /dev/null + fi + if [ $? != 0 ]; then + fn_print_error_eol_nl + fn_script_log_error "Checking ${remotereponame} module ${modulefile}" + echo -en "removing module ${modulefile}...\c" + if ! rm -f "${modulefile:?}"; then + fn_print_fail_eol_nl + fn_script_log_fatal "Removing module ${modulefile}" + core_exit.sh + else + fn_print_ok_eol_nl + fn_script_log_pass "Removing module ${modulefile}" + fi + else + # compare file + if [ "${remotereponame}" == "GitHub" ]; then + module_file_diff=$(diff "${modulesdir}/${modulefile}" <(curl --connect-timeout 10 -s "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${modulefile}")) + else + module_file_diff=$(diff "${modulesdir}/${modulefile}" <(curl --connect-timeout 10 -s "https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/${github_file_url_dir}/${modulefile}")) + fi + + # results + if [ "${module_file_diff}" != "" ]; then + fn_print_update_eol_nl + fn_script_log_update "Checking ${remotereponame} module ${modulefile}" + rm -rf "${modulesdir:?}/${modulefile}" + fn_update_module + else + fn_print_ok_eol_nl + fn_script_log_pass "Checking ${remotereponame} module ${modulefile}" + fi + fi + done + ) + fi +fi + +fn_print_ok_nl "Updating modules" +fn_script_log_pass "Updating modules" + +core_exit.sh From 0720a79b472b5eea2baab4c9f486c7b1d7a7f8e5 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sun, 9 Apr 2023 11:09:04 +0100 Subject: [PATCH 036/181] fix(mc): correct variable name --- lgsm/functions/update_minecraft.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lgsm/functions/update_minecraft.sh b/lgsm/functions/update_minecraft.sh index ace4713bc0..04b4e9d04f 100644 --- a/lgsm/functions/update_minecraft.sh +++ b/lgsm/functions/update_minecraft.sh @@ -16,7 +16,7 @@ fn_update_localbuild() { # Gets local build info. fn_print_dots "Checking local build: ${remotelocation}" # Uses executable to get local build. - if [ -d "${exutabledir}" ]; then + if [ -d "${executabledir}" ]; then cd "${executabledir}" || exit localbuild=$(unzip -p "minecraft_server.jar" version.json | jq -r '.id') fi From 0172ed608a63ab367e73138bc3678d153389c016 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sun, 9 Apr 2023 11:10:33 +0100 Subject: [PATCH 037/181] Release v23.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 aa8a43659a..75e5f4f353 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.2.0" +modulesversion="v23.2.1" # Core diff --git a/linuxgsm.sh b/linuxgsm.sh index 3d8b7f376a..b116f957f3 100755 --- a/linuxgsm.sh +++ b/linuxgsm.sh @@ -20,7 +20,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="v23.2.0" +version="v23.2.1" shortname="core" gameservername="core" commandname="CORE" diff --git a/tests/tests_fctrserver.sh b/tests/tests_fctrserver.sh index 36060b0fe7..0071e24f84 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.2.0" +version="v23.2.1" shortname="fctr" gameservername="fctrserver" commandname="CORE" diff --git a/tests/tests_jc2server.sh b/tests/tests_jc2server.sh index fde7254124..07e31417fd 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.2.0" +version="v23.2.1" shortname="jc2" gameservername="jc2server" commandname="CORE" diff --git a/tests/tests_mcserver.sh b/tests/tests_mcserver.sh index 006cc38a2e..78301e39d4 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.2.0" +version="v23.2.1" shortname="mc" gameservername="mcserver" commandname="CORE" diff --git a/tests/tests_ts3server.sh b/tests/tests_ts3server.sh index 40c7d3787d..75464d9ae5 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.2.0" +version="v23.2.1" shortname="ts3" gameservername="ts3server" commandname="CORE" From ff19348722352501d8d50b199a132d4dc6957757 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 9 Apr 2023 12:53:12 +0100 Subject: [PATCH 038/181] build(deps): bump actions/add-to-project from 0.4.1 to 0.5.0 (#4176) Bumps [actions/add-to-project](https://github.com/actions/add-to-project) from 0.4.1 to 0.5.0. - [Release notes](https://github.com/actions/add-to-project/releases) - [Commits](https://github.com/actions/add-to-project/compare/v0.4.1...v0.5.0) --- updated-dependencies: - dependency-name: actions/add-to-project 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> From d28a0e74d2529e2216f30840efa28084fe534817 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sun, 9 Apr 2023 13:37:57 +0100 Subject: [PATCH 039/181] fix(update): incorrect variable name (#4179) --- lgsm/functions/update_factorio.sh | 2 +- lgsm/functions/update_vintagestory.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lgsm/functions/update_factorio.sh b/lgsm/functions/update_factorio.sh index 548d53b159..3fad634164 100644 --- a/lgsm/functions/update_factorio.sh +++ b/lgsm/functions/update_factorio.sh @@ -18,7 +18,7 @@ fn_update_localbuild() { # Gets local build info. fn_print_dots "Checking local build: ${remotelocation}" # Uses executable to get local build. - if [ -d "${exutabledir}" ]; then + if [ -d "${executabledir}" ]; then cd "${executabledir}" || exit localbuild=$(${executable} --version | grep "Version:" | awk '{print $2}') fi diff --git a/lgsm/functions/update_vintagestory.sh b/lgsm/functions/update_vintagestory.sh index 84e3192c9b..67b6e1a3d1 100755 --- a/lgsm/functions/update_vintagestory.sh +++ b/lgsm/functions/update_vintagestory.sh @@ -18,7 +18,7 @@ fn_update_localbuild() { # Gets local build info. fn_print_dots "Checking local build: ${remotelocation}" # Uses executable to get local build. - if [ -d "${exutabledir}" ]; then + if [ -d "${executabledir}" ]; then cd "${executabledir}" || exit localbuild="$(${preexecutable} ${executable} --version | sed '/^[[:space:]]*$/d')" fi From 818015d18971cd4e1b59211d0ff522518b099a22 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sun, 9 Apr 2023 13:38:48 +0100 Subject: [PATCH 040/181] fix(check-update): not getting steamcmd executable for check-update (#4180) --- lgsm/functions/check.sh | 2 +- lgsm/functions/command_check_update.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lgsm/functions/check.sh b/lgsm/functions/check.sh index 239a24140a..0f1e123687 100755 --- a/lgsm/functions/check.sh +++ b/lgsm/functions/check.sh @@ -77,7 +77,7 @@ for allowed_command in "${allowed_commands_array[@]}"; do fi done -allowed_commands_array=(DEBUG START UPDATE VALIDATE) +allowed_commands_array=(DEBUG START UPDATE VALIDATE CHECK-UPDATE) for allowed_command in "${allowed_commands_array[@]}"; do if [ "${allowed_command}" == "${commandname}" ]; then if [ "${appid}" ]; then diff --git a/lgsm/functions/command_check_update.sh b/lgsm/functions/command_check_update.sh index 3753c72c65..b2647e2a16 100755 --- a/lgsm/functions/command_check_update.sh +++ b/lgsm/functions/command_check_update.sh @@ -6,7 +6,7 @@ # Description: Handles updating of servers. commandname="CHECK-UPDATE" -commandaction="check for Update" +commandaction="Check for Update" functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_firstcommand_set From aaf9aa49532a04a0b2867d5d8e667dc2c675f5a2 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sun, 9 Apr 2023 13:40:16 +0100 Subject: [PATCH 041/181] Release v23.2.2 --- 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 75e5f4f353..d86f74762d 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.2.1" +modulesversion="v23.2.2" # Core diff --git a/linuxgsm.sh b/linuxgsm.sh index b116f957f3..d8015dd512 100755 --- a/linuxgsm.sh +++ b/linuxgsm.sh @@ -20,7 +20,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="v23.2.1" +version="v23.2.2" shortname="core" gameservername="core" commandname="CORE" diff --git a/tests/tests_fctrserver.sh b/tests/tests_fctrserver.sh index 0071e24f84..22bd97d3bb 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.2.1" +version="v23.2.2" shortname="fctr" gameservername="fctrserver" commandname="CORE" diff --git a/tests/tests_jc2server.sh b/tests/tests_jc2server.sh index 07e31417fd..f168007914 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.2.1" +version="v23.2.2" shortname="jc2" gameservername="jc2server" commandname="CORE" diff --git a/tests/tests_mcserver.sh b/tests/tests_mcserver.sh index 78301e39d4..389bbd69ed 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.2.1" +version="v23.2.2" shortname="mc" gameservername="mcserver" commandname="CORE" diff --git a/tests/tests_ts3server.sh b/tests/tests_ts3server.sh index 75464d9ae5..cf542b2379 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.2.1" +version="v23.2.2" shortname="ts3" gameservername="ts3server" commandname="CORE" From 976485b310fe5d1787100fbcbf85f661033fb0f0 Mon Sep 17 00:00:00 2001 From: Christian Date: Sun, 9 Apr 2023 14:47:23 +0200 Subject: [PATCH 042/181] regression(update): fix variable ref #4146 (#4182) From 6bd17366e1e8d207cff0df54b7f0449d9c4c5e28 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sun, 9 Apr 2023 15:42:18 +0100 Subject: [PATCH 043/181] fix(update): repair mc and pmc updater fix behavior of how the download of the jar file is handled. --- lgsm/functions/update_factorio.sh | 2 +- lgsm/functions/update_jediknight2.sh | 2 +- lgsm/functions/update_minecraft.sh | 6 ++++-- lgsm/functions/update_minecraft_bedrock.sh | 2 +- lgsm/functions/update_papermc.sh | 11 ++++++----- lgsm/functions/update_ts3.sh | 2 +- lgsm/functions/update_ut99.sh | 4 ++-- lgsm/functions/update_vintagestory.sh | 2 +- 8 files changed, 17 insertions(+), 14 deletions(-) diff --git a/lgsm/functions/update_factorio.sh b/lgsm/functions/update_factorio.sh index 3fad634164..852ab9d87e 100644 --- a/lgsm/functions/update_factorio.sh +++ b/lgsm/functions/update_factorio.sh @@ -8,7 +8,7 @@ functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_update_dl() { - # Download and extract files to serverfiles + # 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 diff --git a/lgsm/functions/update_jediknight2.sh b/lgsm/functions/update_jediknight2.sh index 7560f01580..a88b96f61f 100644 --- a/lgsm/functions/update_jediknight2.sh +++ b/lgsm/functions/update_jediknight2.sh @@ -8,7 +8,7 @@ functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_update_dl() { - # Download and extract files to serverfiles + # 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 diff --git a/lgsm/functions/update_minecraft.sh b/lgsm/functions/update_minecraft.sh index 04b4e9d04f..dbef26d341 100644 --- a/lgsm/functions/update_minecraft.sh +++ b/lgsm/functions/update_minecraft.sh @@ -8,8 +8,9 @@ functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_update_dl() { - # Download and extract files to serverfiles - fn_fetch_file "${remotebuildurl}" "" "" "" "${serverfiles}" "minecraft_server.jar" "chmodx" "norun" "noforce" "nohash" + # Download and extract files to serverfiles. + fn_fetch_file "${remotebuildurl}" "" "" "" "${tmpdir}" "${remotebuildfilename}" "chmodx" "norun" "noforce" "nohash" + cp -f "${tmpdir}/${remotebuildfilename}" "${serverfiles}/${executable#./}" } fn_update_localbuild() { @@ -45,6 +46,7 @@ fn_update_remotebuild() { else remotebuildversion=$(echo "${remotebuildresponse}" | jq -r --arg branch "${branch}" --arg mcversion "${mcversion}" '.versions | .[] | select(.type==$branch and .id==$mcversion) | .id') fi + remotebuildfilename="minecraft_server.${remotebuildversion}.jar" # 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 diff --git a/lgsm/functions/update_minecraft_bedrock.sh b/lgsm/functions/update_minecraft_bedrock.sh index cf61e3a2b1..aec9401268 100644 --- a/lgsm/functions/update_minecraft_bedrock.sh +++ b/lgsm/functions/update_minecraft_bedrock.sh @@ -8,7 +8,7 @@ functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_update_dl() { - fn_fetch_file "${remotebuildurl}" "" "" "" "${tmpdir}" "bedrock_server.${remotebuildversion}.zip" + fn_fetch_file "${remotebuildurl}" "" "" "" "${tmpdir}" "bedrock_server.${remotebuildversion}.zip" "nochmodx" "norun" "noforce" "nohash" echo -e "Extracting to ${serverfiles}...\c" if [ "${firstcommandname}" == "INSTALL" ]; then unzip -oq "${tmpdir}/bedrock_server.${remotebuildversion}.zip" -x "server.properties" -d "${serverfiles}" diff --git a/lgsm/functions/update_papermc.sh b/lgsm/functions/update_papermc.sh index f48a66e39f..102ef65701 100644 --- a/lgsm/functions/update_papermc.sh +++ b/lgsm/functions/update_papermc.sh @@ -8,16 +8,17 @@ functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_update_dl() { - # Download and extract files to serverfiles - fn_fetch_file "${remotebuildurl}" "" "" "" "${serverfiles}" "${executable#./}" "chmodx" "norun" "force" "${remotebuildhash}" + # Download and extract files to serverfiles. + fn_fetch_file "${remotebuildurl}" "" "" "" "${tmpdir}" "${remotebuildfilename}" "chmodx" "norun" "force" "${remotebuildhash}" + cp -f "${tmpdir}/${remotebuildfilename}" "${serverfiles}/${executable#./}" echo "${remotebuildversion}" > "${serverfiles}/build.txt" } fn_update_localbuild() { # Gets local build info. fn_print_dots "Checking local build: ${remotelocation}" - # Uses version file to get local build. - localbuild=$(head -n 1 "${serverfiles}/build.txt") + # Uses build file to get local build. + localbuild=$(head -n 1 "${serverfiles}/build.txt" 2> /dev/null) if [ -z "${localbuild}" ]; then fn_print_error "Checking local build: ${remotelocation}: missing local build info" fn_script_log_error "Missing local build info" @@ -31,7 +32,7 @@ fn_update_localbuild() { fn_update_remotebuild() { # Get remote build info. - apiurl="https://papermc.io/api/v2/projects/" + apiurl="https://papermc.io/api/v2/projects" # Get list of projects. remotebuildresponse=$(curl -s "${apiurl}") # Get list of Minecraft versions for project. diff --git a/lgsm/functions/update_ts3.sh b/lgsm/functions/update_ts3.sh index e76609b2dd..0f5327de28 100644 --- a/lgsm/functions/update_ts3.sh +++ b/lgsm/functions/update_ts3.sh @@ -8,7 +8,7 @@ functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_update_dl() { - # Download and extract files to serverfiles + # 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 diff --git a/lgsm/functions/update_ut99.sh b/lgsm/functions/update_ut99.sh index b6db783e27..045b29dbe1 100644 --- a/lgsm/functions/update_ut99.sh +++ b/lgsm/functions/update_ut99.sh @@ -8,7 +8,7 @@ functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_update_dl() { - # Download and extract files to serverfiles + # 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" @@ -19,7 +19,7 @@ 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") + localbuild=$(head -n 1 "${serverfiles}/build.txt" 2> /dev/null) if [ -z "${localbuild}" ]; then fn_print_error "Checking local build: ${remotelocation}: missing local build info" fn_script_log_error "Missing local build info" diff --git a/lgsm/functions/update_vintagestory.sh b/lgsm/functions/update_vintagestory.sh index 67b6e1a3d1..7307a4b770 100755 --- a/lgsm/functions/update_vintagestory.sh +++ b/lgsm/functions/update_vintagestory.sh @@ -8,7 +8,7 @@ functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_update_dl() { - # Download and extract files to serverfiles + # Download and extract files to serverfiles. fn_fetch_file "${remotebuildurl}" "" "" "" "${tmpdir}" "${remotebuildfilename}" "nochmodx" "norun" "force" "${remotebuildhash}" fn_dl_extract "${tmpdir}" "${remotebuildfilename}" "${serverfiles}" fn_clear_tmp From 38c810db2b7536ccd33f310912c5ef21df49caf7 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sun, 9 Apr 2023 15:55:17 +0100 Subject: [PATCH 044/181] Release v23.2.3 --- 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 d86f74762d..b301b7e465 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.2.2" +modulesversion="v23.2.3" # Core diff --git a/linuxgsm.sh b/linuxgsm.sh index d8015dd512..758b737259 100755 --- a/linuxgsm.sh +++ b/linuxgsm.sh @@ -20,7 +20,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="v23.2.2" +version="v23.2.3" shortname="core" gameservername="core" commandname="CORE" diff --git a/tests/tests_fctrserver.sh b/tests/tests_fctrserver.sh index 22bd97d3bb..cc841abd24 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.2.2" +version="v23.2.3" shortname="fctr" gameservername="fctrserver" commandname="CORE" diff --git a/tests/tests_jc2server.sh b/tests/tests_jc2server.sh index f168007914..a1cc5922a1 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.2.2" +version="v23.2.3" shortname="jc2" gameservername="jc2server" commandname="CORE" diff --git a/tests/tests_mcserver.sh b/tests/tests_mcserver.sh index 389bbd69ed..66b5af8046 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.2.2" +version="v23.2.3" shortname="mc" gameservername="mcserver" commandname="CORE" diff --git a/tests/tests_ts3server.sh b/tests/tests_ts3server.sh index cf542b2379..809c3eef7b 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.2.2" +version="v23.2.3" shortname="ts3" gameservername="ts3server" commandname="CORE" From b529f004ae076ba551a0a37af540f51918002ed0 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sun, 9 Apr 2023 20:54:54 +0100 Subject: [PATCH 045/181] version v23.2.3 --- lgsm/functions/core_modules.sh | 2 +- lgsm/modules/core_functions.sh | 2 +- lgsm/modules/core_modules.sh | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lgsm/functions/core_modules.sh b/lgsm/functions/core_modules.sh index 4c87019974..81a7a5ab60 100644 --- a/lgsm/functions/core_modules.sh +++ b/lgsm/functions/core_modules.sh @@ -8,7 +8,7 @@ moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" -modulesversion="v23.2.2" +modulesversion="v23.2.3" # Core diff --git a/lgsm/modules/core_functions.sh b/lgsm/modules/core_functions.sh index df51741868..57e6d96d88 100755 --- a/lgsm/modules/core_functions.sh +++ b/lgsm/modules/core_functions.sh @@ -8,7 +8,7 @@ module_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" -modulesversion="v23.2.2" +modulesversion="v23.2.3" # Core diff --git a/lgsm/modules/core_modules.sh b/lgsm/modules/core_modules.sh index 4c87019974..81a7a5ab60 100644 --- a/lgsm/modules/core_modules.sh +++ b/lgsm/modules/core_modules.sh @@ -8,7 +8,7 @@ moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" -modulesversion="v23.2.2" +modulesversion="v23.2.3" # Core From 4fd47dafb5e8a0189a6346cbb240b39dc9f61544 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 10 Apr 2023 23:18:02 +0100 Subject: [PATCH 046/181] build(deps): bump actions/add-to-project from 0.4.1 to 0.5.0 (#4183) Bumps [actions/add-to-project](https://github.com/actions/add-to-project) from 0.4.1 to 0.5.0. - [Release notes](https://github.com/actions/add-to-project/releases) - [Commits](https://github.com/actions/add-to-project/compare/v0.4.1...v0.5.0) --- updated-dependencies: - dependency-name: actions/add-to-project 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/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 8e71d1cb59..1a20ef1900 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.1 + - uses: actions/add-to-project@v0.5.0 with: project-url: https://github.com/orgs/GameServerManagers/projects/11 github-token: ${{ secrets.ADD_TO_PROJECT_PAT }} From 030d451a00f23ac21bf0a3bfe07806aef20a3da7 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Mon, 24 Apr 2023 22:13:48 +0100 Subject: [PATCH 047/181] fix: add docker distro to ats --- lgsm/data/serverlist.csv | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lgsm/data/serverlist.csv b/lgsm/data/serverlist.csv index ae9ae564c8..2bce540865 100644 --- a/lgsm/data/serverlist.csv +++ b/lgsm/data/serverlist.csv @@ -4,7 +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 +ats,atsserver,American Truck Simulator,ubuntu-22.04 av,avserver,Avorion,ubuntu-22.04 bb,bbserver,BrainBread,ubuntu-22.04 bb2,bb2server,BrainBread 2,ubuntu-22.04 From 40757ae9b5df1398fc4aa17ec3f4ba31d5fa12f6 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Tue, 16 May 2023 20:56:58 +0100 Subject: [PATCH 048/181] feat(details): refactor of game info (#4174) * feat(btl): rename bt1944 to btl (#4124) * fix(bt1944): update binary file * feat(btl): rename bt1944 to btl * rename gameworld to worldname * rename autosaveinverval to saveinterval * rust seed * add exit code to details * update some variables * comment * update random * current refactor * modules * json * xml * add core modules to functions dir * functions * fix * use xmllint for parsing xml * check root * check logs * sdtd * quakec * changes * remove dev null * arma3 * add detect details * config origin * fix: cmw mkdir bug * ini improvements * further ini improvements * dst ini * revert * httpport * max players * source engine * fix: cannot iterate over null * fix quakec * fix(nec): no query port * more updates * more updated * more * more * telnet ip * first test of details checking * more details updates * more standardizing * comment out steamport in not set * kf2 master server true * update roserver * fix bug * looks for file called config and uses that * test test test test test * download correct configs * test test test test test test test test test test test test test test test test test test test * remove blank lines * update var names * fail * continue on error * install xmllint * adjust quakec * fix dst * fix java * re order mcb * fix query port mc * fix mom * fix pc * pc add http port * add api and http port * change naming to http from web admin * api port * http * pc2 * add query raw * list cluster config * servercfgparse * update avserver * tidy up steam ports * more servers completed * fix sb * no config file * no config file * add emserver config install * codacy * add legacy vars * add more legacy * add xmllint * mta xmllint * codacy * codacy --- .github/workflows/details-check.yml | 74 + .../workflows/detals-check-generate-matrix.sh | 25 + .../config-lgsm/kf2server/_default.cfg | 2 +- .../config-lgsm/momserver/_default.cfg | 3 +- .../config-lgsm/necserver/_default.cfg | 4 +- .../config-lgsm/ns2cserver/_default.cfg | 8 +- .../config-lgsm/ns2server/_default.cfg | 8 +- .../config-lgsm/pc2server/_default.cfg | 2 +- .../config-lgsm/pcserver/_default.cfg | 2 +- .../config-lgsm/pstbsserver/_default.cfg | 6 +- .../config-lgsm/sbotsserver/_default.cfg | 2 - .../config-lgsm/stserver/_default.cfg | 10 +- .../config-lgsm/vhserver/_default.cfg | 4 +- lgsm/data/almalinux-8.csv | 4 +- lgsm/data/almalinux-9.csv | 4 +- lgsm/data/centos-7.csv | 4 +- lgsm/data/centos-8.csv | 4 +- lgsm/data/centos-9.csv | 4 +- lgsm/data/debian-10.csv | 4 +- lgsm/data/debian-11.csv | 4 +- lgsm/data/debian-9.csv | 4 +- lgsm/data/rhel-7.csv | 4 +- lgsm/data/rhel-8.csv | 4 +- lgsm/data/rhel-9.csv | 4 +- lgsm/data/rocky-8.csv | 4 +- lgsm/data/rocky-9.csv | 4 +- lgsm/data/ubuntu-16.04.csv | 2 +- lgsm/data/ubuntu-18.04.csv | 4 +- 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 +- lgsm/functions/check_logs.sh | 26 + lgsm/functions/check_root.sh | 21 + lgsm/functions/core_functions.sh | 290 +- lgsm/functions/core_modules copy.sh | 816 ++++ lgsm/modules/check_ip.sh | 8 +- lgsm/modules/command_dev_details.sh | 94 + lgsm/modules/command_dev_query_raw.sh | 71 +- lgsm/modules/command_sponsor.sh | 0 lgsm/modules/core_functions.sh | 0 lgsm/modules/core_getopt.sh | 5 +- lgsm/modules/core_legacy.sh | 24 + lgsm/modules/core_modules.sh | 5 + lgsm/modules/fix_cmw.sh | 4 +- lgsm/modules/fix_ro.sh | 4 +- lgsm/modules/info_game.sh | 4202 ++++++++--------- lgsm/modules/info_messages.sh | 156 +- lgsm/modules/install_config.sh | 3 + package-lock.json | 14 +- package.json | 2 +- 51 files changed, 3421 insertions(+), 2548 deletions(-) create mode 100644 .github/workflows/details-check.yml create mode 100755 .github/workflows/detals-check-generate-matrix.sh create mode 100644 lgsm/functions/check_logs.sh create mode 100644 lgsm/functions/check_root.sh mode change 100755 => 100644 lgsm/functions/core_functions.sh create mode 100644 lgsm/functions/core_modules copy.sh create mode 100644 lgsm/modules/command_dev_details.sh mode change 100644 => 100755 lgsm/modules/command_sponsor.sh mode change 100755 => 100644 lgsm/modules/core_functions.sh diff --git a/.github/workflows/details-check.yml b/.github/workflows/details-check.yml new file mode 100644 index 0000000000..0d1327682d --- /dev/null +++ b/.github/workflows/details-check.yml @@ -0,0 +1,74 @@ +name: Details Check +# This action will check that LinuxGSM is picking up game server config and parameter variables. +on: + workflow_dispatch: + push: + +jobs: + create-matrix: + runs-on: ubuntu-latest + outputs: + matrix: ${{ steps.set-matrix.outputs.matrix }} + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Generate matrix with generate-matrix.sh + run: chmod +x .github/workflows/detals-check-generate-matrix.sh; .github/workflows/detals-check-generate-matrix.sh + + - id: set-matrix + run: | + shortnamearray=$(cat shortnamearray.json) + echo "${shortnamearray}" + echo -n "matrix=${shortnamearray}" >> $GITHUB_OUTPUT + + details-check: + needs: create-matrix + continue-on-error: true + runs-on: ubuntu-latest + + strategy: + matrix: ${{ fromJSON(needs.create-matrix.outputs.matrix) }} + + steps: + - name: Install dependencies + run: sudo apt-get install libxml2-utils jq + + - name: Download linuxgsm.sh + run: wget https://raw.githubusercontent.com/GameServerManagers/LinuxGSM/feature/info_game-refactor/linuxgsm.sh; chmod +x linuxgsm.sh + + - name: Grab server + run: LGSM_GITHUBBRANCH="feature/info_game-refactor" ./linuxgsm.sh ${{ matrix.shortname }}server + + - name: Enable developer mode + run: LGSM_GITHUBBRANCH="feature/info_game-refactor" ./${{ matrix.shortname }}server developer + + - id: sets-servercfgname + name: Generate servercfgname + run: | + servercfg=$(sed -n "/^\/ { s/.*= *\"\?\([^\"']*\)\"\?/\1/p;q }" lgsm/config-lgsm/${{ matrix.shortname }}server/_default.cfg) + echo "servercfgname=$servercfg" >> "$GITHUB_OUTPUT" + + - name: Download config + run: | + if [ -z "${{ steps.sets-servercfgname.outputs.servercfgname }}" ]; then + echo "This game server has no config file." + else + curl -f -o config "https://raw.githubusercontent.com/GameServerManagers/Game-Server-Configs/rename/${{ matrix.shortname }}/${{ steps.sets-servercfgname.outputs.servercfgname }}" + fi + - name: Display config + run: | + if [ -z "${{ steps.sets-servercfgname.outputs.servercfgname }}" ]; then + echo "This game server has no config file." + else + cat config + fi + + - name: Display parameters + run: grep "startparameters" lgsm/config-default/config-lgsm/${{ matrix.shortname }}server/_default.cfg + + - name: Detect details + run: LGSM_GITHUBBRANCH="feature/info_game-refactor" ./${{ matrix.shortname }}server detect-details + + - name: Query Raw + run: LGSM_GITHUBBRANCH="feature/info_game-refactor" ./${{ matrix.shortname }}server query-raw diff --git a/.github/workflows/detals-check-generate-matrix.sh b/.github/workflows/detals-check-generate-matrix.sh new file mode 100755 index 0000000000..66f2bd0724 --- /dev/null +++ b/.github/workflows/detals-check-generate-matrix.sh @@ -0,0 +1,25 @@ +#!/bin/bash + +curl "https://raw.githubusercontent.com/GameServerManagers/LinuxGSM/master/lgsm/data/serverlist.csv" | grep -v '^[[:blank:]]*$' > serverlist.csv + +echo -n "{" > "shortnamearray.json" +echo -n "\"include\":[" >> "shortnamearray.json" + +while read -r line; do + shortname=$(echo "$line" | awk -F, '{ print $1 }') + export shortname + servername=$(echo "$line" | awk -F, '{ print $2 }') + export servername + gamename=$(echo "$line" | awk -F, '{ print $3 }') + export gamename + distro=$(echo "$line" | awk -F, '{ print $4 }') + export distro + echo -n "{" >> "shortnamearray.json" + echo -n "\"shortname\":" >> "shortnamearray.json" + echo -n "\"${shortname}\"" >> "shortnamearray.json" + echo -n "}," >> "shortnamearray.json" +done < serverlist.csv +sed -i '$ s/.$//' "shortnamearray.json" +echo -n "]" >> "shortnamearray.json" +echo -n "}" >> "shortnamearray.json" +rm serverlist.csv diff --git a/lgsm/config-default/config-lgsm/kf2server/_default.cfg b/lgsm/config-default/config-lgsm/kf2server/_default.cfg index a8c3c72bf3..a52dcfb1d5 100644 --- a/lgsm/config-default/config-lgsm/kf2server/_default.cfg +++ b/lgsm/config-default/config-lgsm/kf2server/_default.cfg @@ -121,7 +121,7 @@ steamcmdforcewindows="no" branch="" betapassword="" # Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server -steammaster="false" +steammaster="true" ## Stop Mode | https://docs.linuxgsm.com/features/stop-mode # 1: tmux kill diff --git a/lgsm/config-default/config-lgsm/momserver/_default.cfg b/lgsm/config-default/config-lgsm/momserver/_default.cfg index 6ebc106b9b..05787a4bd2 100644 --- a/lgsm/config-default/config-lgsm/momserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/momserver/_default.cfg @@ -12,10 +12,9 @@ ip="0.0.0.0" port="7777" beaconport="15000" -maxplayers="32" ## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters -startparameters="-port="${port}" -beaconport="${beaconport}" -MULTIHOME="${ip}" -maxplayers=${maxplayers}" +startparameters="-port="${port}" -beaconport="${beaconport}" -MULTIHOME="${ip}"" #### LinuxGSM Settings #### diff --git a/lgsm/config-default/config-lgsm/necserver/_default.cfg b/lgsm/config-default/config-lgsm/necserver/_default.cfg index 5d3b4d8873..ceb42033e2 100644 --- a/lgsm/config-default/config-lgsm/necserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/necserver/_default.cfg @@ -139,8 +139,8 @@ stopmode="2" # 3: gamedig # 4: gsquery # 5: tcp -querymode="2" -querytype="protocol-valve" +querymode="1" +querytype="" ## Console type consoleverbose="yes" diff --git a/lgsm/config-default/config-lgsm/ns2cserver/_default.cfg b/lgsm/config-default/config-lgsm/ns2cserver/_default.cfg index bc3e20cd1d..908ce97277 100644 --- a/lgsm/config-default/config-lgsm/ns2cserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/ns2cserver/_default.cfg @@ -14,9 +14,9 @@ port="27015" defaultmap="co_core" maxplayers="24" servername="LinuxGSM Server" -webadminuser="admin" -webadminpass="admin" -webadminport="8080" +httpuser="admin" +httppassword="admin" +httpport="8080" mods="" serverpassword="" # Add the following line to the parms if you want a private server. Ensuring @@ -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}\" -modstorage \"${modstoragedir}\" -mods \"${mods}\"" +startparameters="-name \"${servername}\" -port ${port} -webinterface -webdomain ${ip} -webuser ${httpuser} -webpassword \"${httppassword}\" -webport ${httpport} -map ${defaultmap} -limit ${maxplayers} -config_path \"${servercfgdir}\" -modstorage \"${modstoragedir}\" -mods \"${mods}\"" #### LinuxGSM Settings #### diff --git a/lgsm/config-default/config-lgsm/ns2server/_default.cfg b/lgsm/config-default/config-lgsm/ns2server/_default.cfg index d3fa2ad13d..5a6e8e5c72 100644 --- a/lgsm/config-default/config-lgsm/ns2server/_default.cfg +++ b/lgsm/config-default/config-lgsm/ns2server/_default.cfg @@ -14,9 +14,9 @@ port="27015" defaultmap="ns2_summit" maxplayers="24" servername="LinuxGSM Server" -webadminuser="admin" -webadminpass="admin" -webadminport="8080" +httpuser="admin" +httppassword="admin" +httpport="8080" mods="" serverpassword="" # Add the following line to the parms if you want a private server. Ensuring @@ -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}\" -mods2 \"${mods}\"" +startparameters="-name \"${servername}\" -port ${port} -webinterface -webdomain ${ip} -webuser ${httpuser} -webpassword \"${httppassword}\" -webport ${httpport} -map ${defaultmap} -limit ${maxplayers} -config_path \"${servercfgdir}\" -logdir \"${gamelogdir}\" -modstorage \"${modstoragedir}\" -mods2 \"${mods}\"" #### LinuxGSM Settings #### diff --git a/lgsm/config-default/config-lgsm/pc2server/_default.cfg b/lgsm/config-default/config-lgsm/pc2server/_default.cfg index 72f87b4f0f..0bf55aa53d 100644 --- a/lgsm/config-default/config-lgsm/pc2server/_default.cfg +++ b/lgsm/config-default/config-lgsm/pc2server/_default.cfg @@ -119,7 +119,7 @@ steamcmdforcewindows="no" branch="" betapassword="" # Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server -steammaster="false" +steammaster="true" ## Stop Mode | https://docs.linuxgsm.com/features/stop-mode # 1: tmux kill diff --git a/lgsm/config-default/config-lgsm/pcserver/_default.cfg b/lgsm/config-default/config-lgsm/pcserver/_default.cfg index af31b615be..53d9fc2103 100644 --- a/lgsm/config-default/config-lgsm/pcserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/pcserver/_default.cfg @@ -115,7 +115,7 @@ steamcmdforcewindows="no" branch="" betapassword="" # Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server -steammaster="false" +steammaster="true" ## Stop Mode | https://docs.linuxgsm.com/features/stop-mode # 1: tmux kill diff --git a/lgsm/config-default/config-lgsm/pstbsserver/_default.cfg b/lgsm/config-default/config-lgsm/pstbsserver/_default.cfg index f1ccede86f..426574aa6a 100644 --- a/lgsm/config-default/config-lgsm/pstbsserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/pstbsserver/_default.cfg @@ -10,15 +10,15 @@ ## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters ip="0.0.0.0" +maxplayers="40" port="10027" queryport="10037" -rconport="21114" randommap="NONE" -maxplayers="40" reservedslots="0" +tickrate="50" ## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters -startparameters="MULTIHOME=${ip} RANDOM=${randommap} Port=${port} QueryPort=${queryport} RCONPORT=${rconport} FIXEDMAXPLAYERS=${maxplayers} NumReservedSlots=${reservedslots}" +startparameters="MULTIHOME=${ip} RANDOM=${randommap} Port=${port} QueryPort=${queryport} FIXEDMAXPLAYERS=${maxplayers} FIXEDMAXTICKRATE=${tickrate} NumReservedSlots=${reservedslots}" #### LinuxGSM Settings #### diff --git a/lgsm/config-default/config-lgsm/sbotsserver/_default.cfg b/lgsm/config-default/config-lgsm/sbotsserver/_default.cfg index 899842b08d..f48afd3f05 100644 --- a/lgsm/config-default/config-lgsm/sbotsserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/sbotsserver/_default.cfg @@ -13,8 +13,6 @@ port="7777" queryport="27015" defaultmap="StationKappa" servername="LinuxGSM Server" -serverpassword="NOT SET" # 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}\"" diff --git a/lgsm/config-default/config-lgsm/stserver/_default.cfg b/lgsm/config-default/config-lgsm/stserver/_default.cfg index 834c2d054f..b304fa3900 100644 --- a/lgsm/config-default/config-lgsm/stserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/stserver/_default.cfg @@ -10,17 +10,17 @@ ## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters ip="0.0.0.0" -servername="LinuxGSM" +maxplayers="10" port="27500" queryport="27015" -worldtype="Moon" -maxplayers="10" -autosaveinterval=300 +saveinterval="300" +servername="LinuxGSM" worldname="moon_save" +worldtype="Moon" ## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters # Edit with care -startparameters="-LOADLATEST ${worldname} ${worldtype} -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 ${saveinterval}" #### LinuxGSM Settings #### diff --git a/lgsm/config-default/config-lgsm/vhserver/_default.cfg b/lgsm/config-default/config-lgsm/vhserver/_default.cfg index 8bb87887bd..8fe7cd4dc5 100644 --- a/lgsm/config-default/config-lgsm/vhserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/vhserver/_default.cfg @@ -13,7 +13,7 @@ servername="Valheim Server" # Minimum password length is 5. serverpassword="" port="2456" -gameworld="${selfname}" +worldname="${selfname}" public="1" savedir="$HOME/.config/unity3d/IronGate/Valheim" logFile="" @@ -26,7 +26,7 @@ backuplong="43200" 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}" +startparameters="-name '${servername}' -password ${serverpassword} -port ${port} -world ${worldname} -public ${public} -savedir '${savedir}' -logFile '${logFile}' -saveinterval ${saveinterval} -backups ${backups} -backupshort ${backupshort} -backuplong ${backuplong} ${crossplay:+-crossplay}" #### LinuxGSM Settings #### diff --git a/lgsm/data/almalinux-8.csv b/lgsm/data/almalinux-8.csv index 86ff4dc14b..8d4b452164 100644 --- a/lgsm/data/almalinux-8.csv +++ b/lgsm/data/almalinux-8.csv @@ -68,7 +68,7 @@ mcb,libnsl mh mohaa,compat-libstdc++-33.i686 mom -mta,ncurses-compat-libs +mta,ncurses-compat-libs,libxml2 nd nec nmrih,ncurses-libs.i686 @@ -97,7 +97,7 @@ sb sbots scpsl scpslsm -sdtd,telnet,expect +sdtd,telnet,expect,libxml2 sf sfc,ncurses-libs.i686 sof2 diff --git a/lgsm/data/almalinux-9.csv b/lgsm/data/almalinux-9.csv index 86ff4dc14b..8d4b452164 100644 --- a/lgsm/data/almalinux-9.csv +++ b/lgsm/data/almalinux-9.csv @@ -68,7 +68,7 @@ mcb,libnsl mh mohaa,compat-libstdc++-33.i686 mom -mta,ncurses-compat-libs +mta,ncurses-compat-libs,libxml2 nd nec nmrih,ncurses-libs.i686 @@ -97,7 +97,7 @@ sb sbots scpsl scpslsm -sdtd,telnet,expect +sdtd,telnet,expect,libxml2 sf sfc,ncurses-libs.i686 sof2 diff --git a/lgsm/data/centos-7.csv b/lgsm/data/centos-7.csv index c1d2b97b8d..0769c4ef8f 100644 --- a/lgsm/data/centos-7.csv +++ b/lgsm/data/centos-7.csv @@ -68,7 +68,7 @@ mcb,libnsl mh mohaa,compat-libstdc++-33.i686 mom -mta,ncurses-libs +mta,ncurses-libs,libxml2 nd nec nmrih,ncurses-libs.i686 @@ -97,7 +97,7 @@ sb sbots scpsl scpslsm -sdtd,telnet,expect +sdtd,telnet,expect,libxml2 sf sfc,ncurses-libs.i686 sof2 diff --git a/lgsm/data/centos-8.csv b/lgsm/data/centos-8.csv index 86ff4dc14b..8d4b452164 100644 --- a/lgsm/data/centos-8.csv +++ b/lgsm/data/centos-8.csv @@ -68,7 +68,7 @@ mcb,libnsl mh mohaa,compat-libstdc++-33.i686 mom -mta,ncurses-compat-libs +mta,ncurses-compat-libs,libxml2 nd nec nmrih,ncurses-libs.i686 @@ -97,7 +97,7 @@ sb sbots scpsl scpslsm -sdtd,telnet,expect +sdtd,telnet,expect,libxml2 sf sfc,ncurses-libs.i686 sof2 diff --git a/lgsm/data/centos-9.csv b/lgsm/data/centos-9.csv index 86ff4dc14b..8d4b452164 100644 --- a/lgsm/data/centos-9.csv +++ b/lgsm/data/centos-9.csv @@ -68,7 +68,7 @@ mcb,libnsl mh mohaa,compat-libstdc++-33.i686 mom -mta,ncurses-compat-libs +mta,ncurses-compat-libs,libxml2 nd nec nmrih,ncurses-libs.i686 @@ -97,7 +97,7 @@ sb sbots scpsl scpslsm -sdtd,telnet,expect +sdtd,telnet,expect,libxml2 sf sfc,ncurses-libs.i686 sof2 diff --git a/lgsm/data/debian-10.csv b/lgsm/data/debian-10.csv index 768be603f0..7058cc97ee 100644 --- a/lgsm/data/debian-10.csv +++ b/lgsm/data/debian-10.csv @@ -68,7 +68,7 @@ mcb mh mohaa,libstdc++5:i386 mom -mta,libncursesw5 +mta,libncursesw5,libxml2-utils nd nec nmrih,libtinfo5:i386 @@ -97,7 +97,7 @@ sb sbots scpsl,mono-complete scpslsm,mono-complete -sdtd,telnet,expect +sdtd,telnet,expect,libxml2-utils sf sfc,libtinfo5:i386 sof2 diff --git a/lgsm/data/debian-11.csv b/lgsm/data/debian-11.csv index 021e66e203..ff8c8ae761 100644 --- a/lgsm/data/debian-11.csv +++ b/lgsm/data/debian-11.csv @@ -68,7 +68,7 @@ mcb mh mohaa,libstdc++5:i386 mom -mta,libncursesw5 +mta,libncursesw5,libxml2-utils nd nec nmrih,libtinfo5:i386 @@ -97,7 +97,7 @@ sb sbots scpsl,mono-complete scpslsm,mono-complete -sdtd,telnet,expect +sdtd,telnet,expect,libxml2-utils sf sfc,libtinfo5:i386 sof2 diff --git a/lgsm/data/debian-9.csv b/lgsm/data/debian-9.csv index fa0d6a881b..507896a6ad 100644 --- a/lgsm/data/debian-9.csv +++ b/lgsm/data/debian-9.csv @@ -68,7 +68,7 @@ mcb mh mohaa,libstdc++5:i386 mom -mta,libncursesw5 +mta,libncursesw5,libxml2-utils nd nec nmrih,libtinfo5:i386 @@ -97,7 +97,7 @@ sb sbots scpsl,mono-complete scpslsm,mono-complete -sdtd,telnet,expect +sdtd,telnet,expect,libxml2-utils sf sfc,libtinfo5:i386 sof2 diff --git a/lgsm/data/rhel-7.csv b/lgsm/data/rhel-7.csv index 4cfe968482..c0b3f78043 100644 --- a/lgsm/data/rhel-7.csv +++ b/lgsm/data/rhel-7.csv @@ -68,7 +68,7 @@ mcb,libnsl mh mohaa,compat-libstdc++-33.i686 mom -mta,ncurses-libs +mta,ncurses-libs,libxml2 nd nec nmrih,ncurses-libs.i686 @@ -97,7 +97,7 @@ sb sbots scpsl scpslsm -sdtd,telnet,expect +sdtd,telnet,expect,libxml2 sf sfc,ncurses-libs.i686 sof2 diff --git a/lgsm/data/rhel-8.csv b/lgsm/data/rhel-8.csv index 86ff4dc14b..8d4b452164 100644 --- a/lgsm/data/rhel-8.csv +++ b/lgsm/data/rhel-8.csv @@ -68,7 +68,7 @@ mcb,libnsl mh mohaa,compat-libstdc++-33.i686 mom -mta,ncurses-compat-libs +mta,ncurses-compat-libs,libxml2 nd nec nmrih,ncurses-libs.i686 @@ -97,7 +97,7 @@ sb sbots scpsl scpslsm -sdtd,telnet,expect +sdtd,telnet,expect,libxml2 sf sfc,ncurses-libs.i686 sof2 diff --git a/lgsm/data/rhel-9.csv b/lgsm/data/rhel-9.csv index 86ff4dc14b..8d4b452164 100644 --- a/lgsm/data/rhel-9.csv +++ b/lgsm/data/rhel-9.csv @@ -68,7 +68,7 @@ mcb,libnsl mh mohaa,compat-libstdc++-33.i686 mom -mta,ncurses-compat-libs +mta,ncurses-compat-libs,libxml2 nd nec nmrih,ncurses-libs.i686 @@ -97,7 +97,7 @@ sb sbots scpsl scpslsm -sdtd,telnet,expect +sdtd,telnet,expect,libxml2 sf sfc,ncurses-libs.i686 sof2 diff --git a/lgsm/data/rocky-8.csv b/lgsm/data/rocky-8.csv index 86ff4dc14b..8d4b452164 100644 --- a/lgsm/data/rocky-8.csv +++ b/lgsm/data/rocky-8.csv @@ -68,7 +68,7 @@ mcb,libnsl mh mohaa,compat-libstdc++-33.i686 mom -mta,ncurses-compat-libs +mta,ncurses-compat-libs,libxml2 nd nec nmrih,ncurses-libs.i686 @@ -97,7 +97,7 @@ sb sbots scpsl scpslsm -sdtd,telnet,expect +sdtd,telnet,expect,libxml2 sf sfc,ncurses-libs.i686 sof2 diff --git a/lgsm/data/rocky-9.csv b/lgsm/data/rocky-9.csv index 86ff4dc14b..8d4b452164 100644 --- a/lgsm/data/rocky-9.csv +++ b/lgsm/data/rocky-9.csv @@ -68,7 +68,7 @@ mcb,libnsl mh mohaa,compat-libstdc++-33.i686 mom -mta,ncurses-compat-libs +mta,ncurses-compat-libs,libxml2 nd nec nmrih,ncurses-libs.i686 @@ -97,7 +97,7 @@ sb sbots scpsl scpslsm -sdtd,telnet,expect +sdtd,telnet,expect,libxml2 sf sfc,ncurses-libs.i686 sof2 diff --git a/lgsm/data/ubuntu-16.04.csv b/lgsm/data/ubuntu-16.04.csv index d0f8fcebc2..2b152ffef6 100644 --- a/lgsm/data/ubuntu-16.04.csv +++ b/lgsm/data/ubuntu-16.04.csv @@ -97,7 +97,7 @@ sb sbots scpsl,mono-complete scpslsm,mono-complete -sdtd,telnet,expect +sdtd,telnet,expect,libxml2-utils sf sfc,libtinfo5:i386 sof2 diff --git a/lgsm/data/ubuntu-18.04.csv b/lgsm/data/ubuntu-18.04.csv index 768be603f0..7058cc97ee 100644 --- a/lgsm/data/ubuntu-18.04.csv +++ b/lgsm/data/ubuntu-18.04.csv @@ -68,7 +68,7 @@ mcb mh mohaa,libstdc++5:i386 mom -mta,libncursesw5 +mta,libncursesw5,libxml2-utils nd nec nmrih,libtinfo5:i386 @@ -97,7 +97,7 @@ sb sbots scpsl,mono-complete scpslsm,mono-complete -sdtd,telnet,expect +sdtd,telnet,expect,libxml2-utils sf sfc,libtinfo5:i386 sof2 diff --git a/lgsm/data/ubuntu-20.04.csv b/lgsm/data/ubuntu-20.04.csv index d4e8d65337..764812a71c 100644 --- a/lgsm/data/ubuntu-20.04.csv +++ b/lgsm/data/ubuntu-20.04.csv @@ -68,7 +68,7 @@ mcb mh mohaa,libstdc++5:i386 mom -mta,libncursesw5 +mta,libncursesw5,libxml2-utils nd nec nmrih,libtinfo5:i386 @@ -97,7 +97,7 @@ sb sbots scpsl,mono-complete scpslsm,mono-complete -sdtd,telnet,expect +sdtd,telnet,expect,libxml2-utils sf sfc,libtinfo5:i386 sof2 diff --git a/lgsm/data/ubuntu-21.04.csv b/lgsm/data/ubuntu-21.04.csv index 021e66e203..ff8c8ae761 100644 --- a/lgsm/data/ubuntu-21.04.csv +++ b/lgsm/data/ubuntu-21.04.csv @@ -68,7 +68,7 @@ mcb mh mohaa,libstdc++5:i386 mom -mta,libncursesw5 +mta,libncursesw5,libxml2-utils nd nec nmrih,libtinfo5:i386 @@ -97,7 +97,7 @@ sb sbots scpsl,mono-complete scpslsm,mono-complete -sdtd,telnet,expect +sdtd,telnet,expect,libxml2-utils sf sfc,libtinfo5:i386 sof2 diff --git a/lgsm/data/ubuntu-21.10.csv b/lgsm/data/ubuntu-21.10.csv index 4284cdd9cc..ca9576ca03 100644 --- a/lgsm/data/ubuntu-21.10.csv +++ b/lgsm/data/ubuntu-21.10.csv @@ -66,7 +66,7 @@ mcb mh mohaa,libstdc++5:i386 mom -mta,libncursesw5 +mta,libncursesw5,libxml2-utils nd nec nmrih,libtinfo5:i386 @@ -95,7 +95,7 @@ sb sbots scpsl,mono-complete scpslsm,mono-complete -sdtd,telnet,expect +sdtd,telnet,expect,libxml2-utils sf sfc,libtinfo5:i386 sof2 diff --git a/lgsm/data/ubuntu-22.04.csv b/lgsm/data/ubuntu-22.04.csv index 5aaacff813..50886ad29a 100644 --- a/lgsm/data/ubuntu-22.04.csv +++ b/lgsm/data/ubuntu-22.04.csv @@ -68,7 +68,7 @@ mcb mh mohaa,libstdc++5:i386 mom -mta,libncursesw5 +mta,libncursesw5,libxml2-utils nd nec nmrih,libtinfo5:i386 @@ -97,7 +97,7 @@ sb sbots scpsl,mono-complete scpslsm,mono-complete -sdtd,telnet,expect +sdtd,telnet,expect,libxml2-utils sf sfc,libtinfo5:i386 sof2 diff --git a/lgsm/functions/check_logs.sh b/lgsm/functions/check_logs.sh new file mode 100644 index 0000000000..2087ac9157 --- /dev/null +++ b/lgsm/functions/check_logs.sh @@ -0,0 +1,26 @@ +#!/bin/bash +# LinuxGSM check_logs.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Checks if log files exist. + +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +fn_check_logs() { + fn_print_dots "Checking for log files" + fn_print_info_nl "Checking for log files: Creating log files" + checklogs=1 + install_logs.sh +} + +# Create directories for the script and console logs. +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 + fn_check_logs +fi diff --git a/lgsm/functions/check_root.sh b/lgsm/functions/check_root.sh new file mode 100644 index 0000000000..26475601a8 --- /dev/null +++ b/lgsm/functions/check_root.sh @@ -0,0 +1,21 @@ +#!/bin/bash +# LinuxGSM check_root.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Checks if the user tried to run the script as root. + +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +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 + fn_script_log_fatal "${selfname} attempted to run as root." + else + # Forces exit code is log does not yet exist. + exitcode=1 + fi + core_exit.sh + fi +fi diff --git a/lgsm/functions/core_functions.sh b/lgsm/functions/core_functions.sh old mode 100755 new mode 100644 index 57e6d96d88..cc054c129e --- a/lgsm/functions/core_functions.sh +++ b/lgsm/functions/core_functions.sh @@ -41,653 +41,653 @@ core_legacy.sh() { core_exit.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_function + fn_fetch_module } core_getopt.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_function + fn_fetch_module } core_trap.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_function + fn_fetch_module } core_steamcmd.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_function + fn_fetch_module } core_github.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_function + fn_fetch_module } # Commands command_backup.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_function + fn_fetch_module } command_console.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_function + fn_fetch_module } command_debug.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_function + fn_fetch_module } command_details.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_function + fn_fetch_module } command_sponsor.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_function + fn_fetch_module } command_postdetails.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_function + fn_fetch_module } command_test_alert.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_function + fn_fetch_module } command_monitor.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_function + fn_fetch_module } command_start.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_function + fn_fetch_module } command_stop.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_function + fn_fetch_module } command_validate.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_function + fn_fetch_module } command_install.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_function + fn_fetch_module } command_install_resources_mta.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_function + fn_fetch_module } install_squad_license.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_function + fn_fetch_module } command_mods_install.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_function + fn_fetch_module } command_mods_update.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_function + fn_fetch_module } command_mods_remove.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_function + fn_fetch_module } command_fastdl.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_function + fn_fetch_module } command_ts3_server_pass.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_function + fn_fetch_module } command_restart.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_function + fn_fetch_module } command_skeleton.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_function + fn_fetch_module } command_wipe.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_function + fn_fetch_module } command_send.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_function + fn_fetch_module } # Checks check.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_function + fn_fetch_module } check_config.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_function + fn_fetch_module } check_deps.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_function + fn_fetch_module } check_executable.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_function + fn_fetch_module } check_glibc.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_function + fn_fetch_module } check_ip.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_function + fn_fetch_module } check_last_update.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_function + fn_fetch_module } check_logs.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_function + fn_fetch_module } check_permissions.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_function + fn_fetch_module } check_root.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_function + fn_fetch_module } check_status.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_function + fn_fetch_module } check_steamcmd.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_function + fn_fetch_module } check_system_dir.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_function + fn_fetch_module } check_system_requirements.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_function + fn_fetch_module } check_tmuxception.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_function + fn_fetch_module } check_version.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_function + fn_fetch_module } # Compress compress_unreal2_maps.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_function + fn_fetch_module } compress_ut99_maps.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_function + fn_fetch_module } # Mods mods_list.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_function + fn_fetch_module } mods_core.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_function + fn_fetch_module } # Dev command_dev_clear_functions.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_function + fn_fetch_module } command_dev_debug.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_function + fn_fetch_module } command_dev_detect_deps.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_function + fn_fetch_module } command_dev_detect_glibc.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_function + fn_fetch_module } command_dev_detect_ldd.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_function + fn_fetch_module } command_dev_query_raw.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_function + fn_fetch_module } # Fix fix.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_function + fn_fetch_module } fix_ark.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_function + fn_fetch_module } fix_av.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_function + fn_fetch_module } fix_arma3.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_function + fn_fetch_module } fix_armar.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_function + fn_fetch_module } fix_bt.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_function + fn_fetch_module } fix_bo.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_function + fn_fetch_module } fix_cmw.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_function + fn_fetch_module } fix_csgo.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_function + fn_fetch_module } fix_dst.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_function + fn_fetch_module } fix_hw.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_function + fn_fetch_module } fix_ins.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_function + fn_fetch_module } fix_kf.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_function + fn_fetch_module } fix_kf2.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_function + fn_fetch_module } fix_lo.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_function + fn_fetch_module } fix_mcb.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_function + fn_fetch_module } fix_mta.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_function + fn_fetch_module } fix_nmrih.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_function + fn_fetch_module } fix_onset.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_function + fn_fetch_module } fix_ro.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_function + fn_fetch_module } fix_rust.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_function + fn_fetch_module } fix_rw.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_function + fn_fetch_module } fix_sfc.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_function + fn_fetch_module } fix_st.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_function + fn_fetch_module } fix_steamcmd.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_function + fn_fetch_module } fix_terraria.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_function + fn_fetch_module } fix_tf2.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_function + fn_fetch_module } fix_ut3.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_function + fn_fetch_module } fix_rust.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_function + fn_fetch_module } fix_samp.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_function + fn_fetch_module } fix_sdtd.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_function + fn_fetch_module } fix_sof2.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_function + fn_fetch_module } fix_squad.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_function + fn_fetch_module } fix_ts3.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_function + fn_fetch_module } fix_ut2k4.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_function + fn_fetch_module } fix_ut.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_function + fn_fetch_module } fix_unt.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_function + fn_fetch_module } fix_vh.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_function + fn_fetch_module } fix_wurm.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_function + fn_fetch_module } fix_zmr.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_function + fn_fetch_module } # Info info_distro.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_function + fn_fetch_module } info_game.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_function + fn_fetch_module } info_messages.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_function + fn_fetch_module } info_stats.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_function + fn_fetch_module } # Alert alert.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_function + fn_fetch_module } alert_discord.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_function + fn_fetch_module } alert_email.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_function + fn_fetch_module } alert_ifttt.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_function + fn_fetch_module } alert_mailgun.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_function + fn_fetch_module } alert_pushbullet.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_function + fn_fetch_module } alert_pushover.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_function + fn_fetch_module } alert_gotify.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_function + fn_fetch_module } alert_telegram.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_function + fn_fetch_module } alert_rocketchat.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_function + fn_fetch_module } alert_slack.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_function + fn_fetch_module } # Logs core_logs.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_function + fn_fetch_module } # Query query_gamedig.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_function + fn_fetch_module } # Update command_update_functions.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_function + fn_fetch_module } command_update_linuxgsm.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_function + fn_fetch_module } command_update.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_function + fn_fetch_module } command_check_update.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_function + fn_fetch_module } update_ts3.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_function + fn_fetch_module } update_minecraft.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_function + fn_fetch_module } update_minecraft_bedrock.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_function + fn_fetch_module } update_papermc.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_function + fn_fetch_module } update_mta.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_function + fn_fetch_module } update_factorio.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_function + fn_fetch_module } update_jediknight2.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_function + fn_fetch_module } update_steamcmd.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_function + fn_fetch_module } update_vintagestory.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_function + fn_fetch_module } update_ut99.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_function + fn_fetch_module } fn_update_functions.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_function + fn_fetch_module } # @@ -701,96 +701,96 @@ fn_autoinstall() { install_complete.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_function + fn_fetch_module } install_config.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_function + fn_fetch_module } install_factorio_save.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_function + fn_fetch_module } install_dst_token.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_function + fn_fetch_module } install_eula.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_function + fn_fetch_module } install_gsquery.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_function + fn_fetch_module } install_gslt.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_function + fn_fetch_module } install_header.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_function + fn_fetch_module } install_logs.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_function + fn_fetch_module } install_retry.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_function + fn_fetch_module } install_server_dir.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_function + fn_fetch_module } install_server_files.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_function + fn_fetch_module } install_stats.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_function + fn_fetch_module } install_steamcmd.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_function + fn_fetch_module } install_ts3.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_function + fn_fetch_module } install_ts3db.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_function + fn_fetch_module } install_ut2k4.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_function + fn_fetch_module } install_dl_ut2k4.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_function + fn_fetch_module } install_ut2k4_key.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_function + fn_fetch_module } # Calls code required for legacy servers diff --git a/lgsm/functions/core_modules copy.sh b/lgsm/functions/core_modules copy.sh new file mode 100644 index 0000000000..8eb843b5a5 --- /dev/null +++ b/lgsm/functions/core_modules copy.sh @@ -0,0 +1,816 @@ +#!/bin/bash +# LinuxGSM core_modules.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Defines all modules to allow download and execution of modules using fn_fetch_module. +# This module is called first before any other module. Without this file other modules will not load. + +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +modulesversion="v23.2.0" + +# Core + +core_dl.sh() { + modulefile="${FUNCNAME[0]}" + if [ "$(type fn_fetch_core_dl 2> /dev/null)" ]; then + fn_fetch_core_dl "lgsm/modules" "core_dl.sh" "${modulesdir}" "chmodx" "run" "noforcedl" "nohash" + else + fn_bootstrap_fetch_file_github "lgsm/modules" "core_dl.sh" "${modulesdir}" "chmodx" "run" "noforcedl" "nohash" + fi +} + +core_messages.sh() { + modulefile="${FUNCNAME[0]}" + if [ "$(type fn_fetch_core_dl 2> /dev/null)" ]; then + fn_fetch_core_dl "lgsm/modules" "core_messages.sh" "${modulesdir}" "chmodx" "run" "noforcedl" "nohash" + else + fn_bootstrap_fetch_file_github "lgsm/modules" "core_messages.sh" "${modulesdir}" "chmodx" "run" "noforcedl" "nohash" + fi +} + +core_legacy.sh() { + modulefile="${FUNCNAME[0]}" + if [ "$(type fn_fetch_core_dl 2> /dev/null)" ]; then + fn_fetch_core_dl "lgsm/modules" "core_legacy.sh" "${modulesdir}" "chmodx" "run" "noforcedl" "nohash" + else + fn_bootstrap_fetch_file_github "lgsm/modules" "core_legacy.sh" "${modulesdir}" "chmodx" "run" "noforcedl" "nohash" + fi +} + +core_exit.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +core_getopt.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +core_trap.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +core_steamcmd.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +core_github.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +# Commands + +command_backup.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +command_console.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +command_debug.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +command_details.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +command_sponsor.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +command_postdetails.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +command_test_alert.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +command_monitor.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +command_start.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +command_stop.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +command_validate.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +command_install.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +command_install_resources_mta.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +install_squad_license.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +command_mods_install.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +command_mods_update.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +command_mods_remove.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +command_fastdl.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +command_ts3_server_pass.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +command_restart.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +command_skeleton.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +command_wipe.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +command_send.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +# Checks + +check.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +check_config.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +check_deps.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +check_executable.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +check_glibc.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +check_ip.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +check_last_update.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +check_logs.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +check_permissions.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +check_root.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +check_status.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +check_steamcmd.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +check_system_dir.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +check_system_requirements.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +check_tmuxception.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +check_version.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +# Compress + +compress_unreal2_maps.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +compress_ut99_maps.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +# Mods + +mods_list.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +mods_core.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +# Dev + +command_dev_clear_modules.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +command_dev_debug.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +command_dev_detect_deps.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +command_dev_detect_glibc.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +command_dev_detect_ldd.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +command_dev_query_raw.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +# Fix + +fix.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +fix_ark.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +fix_av.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +fix_arma3.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +fix_armar.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +fix_bt.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +fix_bo.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +fix_cmw.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +fix_csgo.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +fix_dst.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +fix_hw.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +fix_ins.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +fix_kf.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +fix_kf2.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +fix_lo.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +fix_mcb.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +fix_mta.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +fix_nmrih.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +fix_onset.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +fix_ro.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +fix_rust.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +fix_rw.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +fix_sfc.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +fix_st.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +fix_steamcmd.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +fix_terraria.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +fix_tf2.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +fix_ut3.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +fix_rust.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +fix_samp.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +fix_sdtd.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +fix_sof2.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +fix_squad.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +fix_ts3.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +fix_ut2k4.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +fix_ut.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +fix_unt.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +fix_vh.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +fix_wurm.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +fix_zmr.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +# Info + +info_distro.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +info_game.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +info_messages.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +info_stats.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +# Alert + +alert.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +alert_discord.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +alert_email.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +alert_ifttt.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +alert_mailgun.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +alert_pushbullet.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +alert_pushover.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +alert_gotify.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +alert_telegram.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +alert_rocketchat.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +alert_slack.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} +# Logs + +core_logs.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +# Query + +query_gamedig.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +# Update + +command_update_modules.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +command_update_linuxgsm.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +command_update.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +command_check_update.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +update_ts3.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +update_minecraft.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +update_minecraft_bedrock.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +update_papermc.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +update_mta.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +update_factorio.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +update_jediknight2.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +update_steamcmd.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +update_vintagestory.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +update_ut99.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +fn_update_modules.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +# +## Installer modules +# + +fn_autoinstall() { + autoinstall=1 + command_install.sh +} + +install_complete.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +install_config.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +install_factorio_save.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +install_dst_token.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +install_eula.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +install_gsquery.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +install_gslt.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +install_header.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +install_logs.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +install_retry.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +install_server_dir.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} +install_server_files.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +install_stats.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +install_steamcmd.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +install_ts3.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +install_ts3db.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +install_ut2k4.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +install_dl_ut2k4.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +install_ut2k4_key.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + +# Calls code required for legacy servers +core_legacy.sh + +# Creates tmp dir if missing +if [ ! -d "${tmpdir}" ]; then + mkdir -p "${tmpdir}" +fi + +# Creates lock dir if missing +if [ ! -d "${lockdir}" ]; then + mkdir -p "${lockdir}" +fi + +# Calls on-screen messages (bootstrap) +core_messages.sh + +#Calls file downloader (bootstrap) +core_dl.sh + +# Calls the global Ctrl-C trap +core_trap.sh diff --git a/lgsm/modules/check_ip.sh b/lgsm/modules/check_ip.sh index 8dc0567b97..a2a16298ca 100644 --- a/lgsm/modules/check_ip.sh +++ b/lgsm/modules/check_ip.sh @@ -39,25 +39,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}") + httpip=("${ip}") telnetip=("${ip}") # If game config does have an IP set. elif fn_is_valid_ip "${configip}"; then queryips=("${configip}") ip="${configip}" - webadminip=("${configip}") + httpip=("${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[@]}") ip="0.0.0.0" - webadminip=("${current_ips[@]}") + httpip=("${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[@]}") ip="0.0.0.0" - webadminip=("${ip}") + httpip=("${ip}") telnetip=("${ip}") fi diff --git a/lgsm/modules/command_dev_details.sh b/lgsm/modules/command_dev_details.sh new file mode 100644 index 0000000000..330d7e2cd9 --- /dev/null +++ b/lgsm/modules/command_dev_details.sh @@ -0,0 +1,94 @@ +#!/bin/bash +# LinuxGSM command_dev_debug.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Dev only: Enables debugging log to be saved to dev-debug.log. + +if [ -f "config" ]; then + servercfgfullpath="config" +fi +if [ -f "clusterconfig" ]; then + clustercfgfullpath="clusterconfig" +fi + +info_game.sh + +carriagereturn=$(file -b "${servercfgfullpath}" | grep -q CRLF && echo "${red}CRLF${default}" || echo "${lightgreen}LF${default}") + +echo -e "" +echo -e "${lightgreen}Server Details${default}" +echo -e "==================================================================" +echo -e "" + +echo -e "Game: ${gamename}" +echo -e "Config type: ${configtype}" +echo -e "Config file: ${servercfgfullpath}" +if [ -f "${clustercfgfullpath}" ]; then + echo -e "Cluster config file: ${clustercfgfullpath}" +fi +echo -e "Carriage Return: ${carriagereturn}" + +# Create an associative array of the server details. +declare -A server_details=( + ['Admin Password']="${adminpassword}" + ['API Port']="${apiport}" + ['Cave']="${cave}" + ['Cluster']="${cluster}" + ['Config IP']="${configip}" + ['Default Map']="${defaultmap}" + ['Game Mode']="${gamemode}" + ['Game Type']="${gametype}" + ['HTTP Enabled']="${httpenabled}" + ['HTTP IP']="${httpip}" + ['HTTP Password']="${httppassword}" + ['HTTP Port']="${httpport}" + ['HTTP User']="${httpuser}" + ['ip']="${ip}" + ['LAN Port']="${lanport}" + ['Master Port']="${masterport}" + ['Master']="${master}" + ['Maxplayers']="${maxplayers}" + ['OldQueryPortNumber']="${oldqueryportnumber}" + ['Port']="${port}" + ['Query Port']="${queryport}" + ['RCON Enabled']="${rconenabled}" + ['RCON Password']="${rconpassword}" + ['RCON Port']="${rconport}" + ['Reserved Slots']="${reservedslots}" + ['Server Password']="${serverpassword}" + ['Servername']="${servername}" + ['Shard']="${shard}" + ['Sharding']="${sharding}" + ['Steam Auth Port']="${steamauthport}" + ['Telnet IP']="${telnetip}" + ['Tickrate']="${tickrate}" + ['World Name']="${worldname}" + ['World Type']="${worldtype}" +) + +# Initialize a variable to keep track of missing server details. +missing_details="" + +# Loop through the server details and output them. +echo -e "" +echo -e "${lightgreen}Available Server Details${default}" +echo -e "=================================" +for key in "${!server_details[@]}"; do + value=${server_details[$key]} + if [ -z "$value" ]; then + missing_details+="\n${key}" + else + echo -e "$key: $value " + fi +done + +# Output the missing server details if there are any. +if [ -n "$missing_details" ]; then + echo -e "" + echo -e "${lightgreen}Missing Server Details${default}" + echo -e "=================================" + echo -e "${missing_details}" +fi + +core_exit.sh diff --git a/lgsm/modules/command_dev_query_raw.sh b/lgsm/modules/command_dev_query_raw.sh index 0d30e75bfc..d75d12f313 100644 --- a/lgsm/modules/command_dev_query_raw.sh +++ b/lgsm/modules/command_dev_query_raw.sh @@ -28,169 +28,164 @@ 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 -c ${port}) \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 -c ${port}) \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 -c ${port}) \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 -c ${port}) \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 -c ${port401}) \t$(ss -tupl | grep ${port401} | grep tcp | awk '{ print $2 }') \t$(ss -tupl | grep ${port401} | grep udp | awk '{ print $2 }')" + echo -e "Game+400: \t${port401} \t$(ss -tupl | grep -c "${port401}") \t$(ss -tupl | grep "${port401}" | grep tcp | awk '{ print $2 }') \t$(ss -tupl | grep "${port401}" | grep udp | awk '{ print $2 }')" else echo -e "Game+400:" fi if [ -v portipv6 ]; then - 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 }')" + 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 -c ${queryport}) \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 -c ${httpport}) \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 -c ${httpqueryport}) \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 -c ${webadminport}) \t$(ss -tupl | grep ${webadminport} | grep tcp | awk '{ print $2 }') \t$(ss -tupl | grep ${webadminport} | grep udp | awk '{ print $2 }')" + if [ -v httpport ]; then + echo -e "Web Interface: \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 "Web Admin:" + echo -e "Web Interface:" fi if [ -v clientport ]; then - 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 }')" + 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 -c ${rconport}) \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 -c ${rawport}) \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 -c ${masterport}) \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 -c ${steamport}) \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 -c ${steamauthport}) \t$(ss -tupl | grep ${steamauthport} | grep tcp | awk '{ print $2 }') \t$(ss -tupl | grep ${steamauthport} | grep udp | awk '{ print $2 }')" + if [ -v steamworksport ]; then + echo -e "Steamworks P2P: \t${steamworksport} \t$(ss -tupl | grep -c "${steamworksport}") \t$(ss -tupl | grep "${steamworksport}" | grep tcp | awk '{ print $2 }') \t$(ss -tupl | grep "${steamworksport}" | grep udp | awk '{ print $2 }')" else - echo -e "Steam: Auth:" + echo -e "Steamworks P2P:" fi - if [ -v steammasterport ]; then - 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 }')" + if [ -v steamauthport ]; then + 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: Master:" + echo -e "Steam: Auth:" fi - if [ -v steamqueryport ]; then - 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 -c ${beaconport}) \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 -c ${appport}) \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 -c ${telnetport}) \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 -c ${sourcetvport}) \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 -c ${fileport}) \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 -c ${udplinkport}) \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 -c ${voiceport}) \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 -c ${voiceunusedport}) \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 -c ${battleeyeport}) \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 -c ${statsport}) \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 diff --git a/lgsm/modules/command_sponsor.sh b/lgsm/modules/command_sponsor.sh old mode 100644 new mode 100755 diff --git a/lgsm/modules/core_functions.sh b/lgsm/modules/core_functions.sh old mode 100755 new mode 100644 diff --git a/lgsm/modules/core_getopt.sh b/lgsm/modules/core_getopt.sh index 222ad0cf88..c758409c58 100644 --- a/lgsm/modules/core_getopt.sh +++ b/lgsm/modules/core_getopt.sh @@ -50,6 +50,7 @@ cmd_install_squad_license=("li;license" "install_squad_license.sh" "Add your Squ 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_details=("ddt;detect-details" "command_dev_details.sh" "Display parsed details.") 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.") @@ -145,7 +146,7 @@ currentopt+=("${cmd_install[@]}" "${cmd_auto_install[@]}") ## Developer commands. 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_modules[@]}") + currentopt+=("${cmd_dev_details[@]}" "${cmd_dev_detect_deps[@]}" "${cmd_dev_detect_glibc[@]}" "${cmd_dev_detect_ldd[@]}" "${cmd_dev_query_raw[@]}" "${cmd_dev_clear_modules[@]}") fi ## Sponsor. @@ -183,7 +184,7 @@ fn_opt_usage() { core_exit.sh } -# Check if command existw and run corresponding scripts, or display script usage. +# Check if command exists and run corresponding scripts, or display script usage. if [ -z "${getopt}" ]; then fn_opt_usage fi diff --git a/lgsm/modules/core_legacy.sh b/lgsm/modules/core_legacy.sh index 2ed942abd1..e9e5c9206d 100644 --- a/lgsm/modules/core_legacy.sh +++ b/lgsm/modules/core_legacy.sh @@ -15,6 +15,30 @@ for legacy_version in "${legacy_versions_array[@]}"; do fi done +if [ -n "${webadminuser}" ]; then + httpuser="${webadminuser}" +fi + +if [ -n "${webadminpass}" ]; then + httppassword="${webadminpass}" +fi + +if [ -n "${webadminport}" ]; then + httpport="${webadminport}" +fi + +if [ -n "${webadminip}" ]; then + httpip="${webadminip}" +fi + +if [ -n "${gameworld}" ]; then + worldname="${gameworld}" +fi + +if [ -n "${autosaveinterval}" ]; then + saveinterval="${autosaveinterval}" +fi + if [ -z "${serverfiles}" ]; then serverfiles="${filesdir}" fi diff --git a/lgsm/modules/core_modules.sh b/lgsm/modules/core_modules.sh index 81a7a5ab60..dd5334e5ad 100644 --- a/lgsm/modules/core_modules.sh +++ b/lgsm/modules/core_modules.sh @@ -299,6 +299,11 @@ command_dev_debug.sh() { fn_fetch_module } +command_dev_details.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + command_dev_detect_deps.sh() { modulefile="${FUNCNAME[0]}" fn_fetch_module diff --git a/lgsm/modules/fix_cmw.sh b/lgsm/modules/fix_cmw.sh index 6b8f1caa84..2a98d9e53a 100644 --- a/lgsm/modules/fix_cmw.sh +++ b/lgsm/modules/fix_cmw.sh @@ -17,7 +17,9 @@ fi if [ ! -f "${servercfgfullpath}" ]; then fn_fix_msg_start fixname="copy config" - mkdir "${servercfgdir}" + if [ ! -d "${servercfgdir}" ]; then + mkdir -p "${servercfgdir}" + fi cp "${systemdir}/UDKGame/Config/"*.ini "${servercfgdir}" fn_fix_msg_end fi diff --git a/lgsm/modules/fix_ro.sh b/lgsm/modules/fix_ro.sh index 5dd1d3fb80..f094c6b38f 100644 --- a/lgsm/modules/fix_ro.sh +++ b/lgsm/modules/fix_ro.sh @@ -7,12 +7,12 @@ moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" -echo -e "Applying WebAdmin ROOst.css fix." +echo -e "Applying webinterface ROOst.css fix." echo -e "http://forums.tripwireinteractive.com/showpost.php?p=585435&postcount=13" sed -i 's/none}/none;/g' "${serverfiles}/Web/ServerAdmin/ROOst.css" sed -i 's/underline}/underline;/g' "${serverfiles}/Web/ServerAdmin/ROOst.css" fn_sleep_time -echo -e "Applying WebAdmin CharSet fix." +echo -e "Applying webinterface CharSet fix." echo -e "http://forums.tripwireinteractive.com/showpost.php?p=442340&postcount=1" sed -i 's/CharSet="iso-8859-1"/CharSet="utf-8"/g' "${systemdir}/uweb.int" fn_sleep_time diff --git a/lgsm/modules/info_game.sh b/lgsm/modules/info_game.sh index 59e8d37fae..ff77f8471f 100644 --- a/lgsm/modules/info_game.sh +++ b/lgsm/modules/info_game.sh @@ -5,2310 +5,2103 @@ # Website: https://linuxgsm.com # Description: Gathers various game server information. +# shellcheck disable=SC2317 moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" -## Examples of filtering to get info from config files. -# sed 's/foo//g' - remove foo -# tr -cd '[:digit:]' leave only digits -# tr -d '=\"; ' remove selected characters =\"; -# grep -v "foo" filter out lines that contain foo -# cut -f1 -d "/" remove everything after / - +# Config Type: ini +# Comment: ; or # +# Note: this ini filter does not filter by section. Can cause issues with some games that have multiple sections with the same variable name. +fn_info_game_ini() { + # sed is used to process the file. + # -n: Suppresses automatic printing of pattern space. + # /^\<'"${2}"'\>/: Matches lines starting with the word provided as the second argument ($2), considering it as a whole word. + # { s/.*= *"\?\([^"]*\)"\?/\1/p;q }: Command block executed for lines that match the pattern. + # - s/.*= *"\?\([^"]*\)"\?/\1/: Matches and captures the value after an equals sign (=), possibly surrounded by optional double quotes. + # - .*: Matches any characters before the equals sign. + # - = *"\?: Matches the equals sign and any optional spaces before an optional double quote. + # - \([^"]*\): Captures any characters that are not double quotes. + # - "\?: Matches an optional double quote. + # - /1: Replaces the entire matched pattern with the captured value. + # - p: Prints the modified line. + # - q: Quits processing after modifying and printing the line. + + if [ -n "${3}" ]; then + servercfgparse="${3}" + else + servercfgparse="${servercfgfullpath}" + fi + eval "${1}=\"$(sed -n '/^\<'"${2}"'\>/ { s/.*= *\"\?\([^"]*\)\"\?/\1/p;q }' "${servercfgparse}" | tr -d '\r')\"" + configtype="ini" +} + +# Config Type: custom +# Comment: ; or # +# Note: this ini filter does not filter by section. Can cause issues with some games that have multiple sections with the same variable name. +fn_info_game_keyvalue_pairs() { + # sed is used to process the file. + # -n: Suppresses automatic printing of pattern space. + # /^\<'"${2}"'\>/: Matches lines starting with the word provided as the second argument ($2), considering it as a whole word. + # { s/.*= *"\?\([^"]*\)"\?/\1/p;q }: Command block executed for lines that match the pattern. + # - s/.*= *"\?\([^"]*\)"\?/\1/: Matches and captures the value after an equals sign (=), possibly surrounded by optional double quotes. + # - .*: Matches any characters before the equals sign. + # - = *"\?: Matches the equals sign and any optional spaces before an optional double quote. + # - \([^"]*\): Captures any characters that are not double quotes. + # - "\?: Matches an optional double quote. + # - /1: Replaces the entire matched pattern with the captured value. + # - p: Prints the modified line. + # - q: Quits processing after modifying and printing the line. + + if [ -n "${3}" ]; then + servercfgparse="${3}" + else + servercfgparse="${servercfgfullpath}" + fi + eval "${1}=\"$(sed -n '/^\<'"${2}"'\>/ { s/.*= *\"\?\([^"]*\)\"\?/\1/p;q }' "${servercfgparse}" | tr -d '\r')\"" + configtype="keyvalue_pairs" +} + +# Config Type: QuakeC +# Comment: // or /* */ +fn_info_game_quakec() { + # -n: Suppresses automatic printing of pattern space. + # /^[[:space:]]*\<'"${2}"'\>/: Matches lines starting with optional leading whitespace and the word provided as the second argument ($2), considering it as a whole word. + # { s/.* *"\?\([^"]*\)"\?/\1/p;q }: Command block executed for lines that match the pattern. + # - s/.* *"\?\([^"]*\)"\?/\1/: Matches and captures the value after any number of spaces, possibly surrounded by optional double quotes. + # - .*: Matches any characters before the spaces. + # - *: Matches any number of spaces. + # - "\?: Matches an optional double quote. + # - \([^"]*\): Captures any characters that are not double quotes. + # - "\?: Matches an optional double quote. + # - /1: Replaces the entire matched pattern with the captured value. + # - p: Prints the modified line. + # - q: Quits processing after modifying and printing the line. + + if [ -n "${3}" ]; then + servercfgparse="${3}" + else + servercfgparse="${servercfgfullpath}" + fi + eval "${1}=\"$(sed -n '/[[:space:]]\<'"${2}"'\>/ { s/.* *\"\?\([^"]*\)\"\?/\1/p;q }' "${servercfgparse}" | tr -d '\r')\"" + configtype="quakec" +} + +# Config Type: json +# Comment: // or /* */ +fn_info_game_json() { + if [ -n "${3}" ]; then + servercfgparse="${3}" + else + servercfgparse="${servercfgfullpath}" + fi + eval "${1}=\"$(jq -r "${2}" "${servercfgfullpath}")\"" + configtype="json" +} + +# Config Type: SQF +# Comment: // or /* */ +fn_info_game_sqf() { + # sed is the command itself, indicating that we want to use the sed utility. + # -n: Suppresses automatic printing of pattern space. + # /^\<'"${2}"'\>/: Matches lines starting with the word provided as the second argument ($2), considering it as a whole word. + # { s/.*= *"\?\([^"]*\)"\?/\1/;s/;$//p;q }: Command block executed for lines that match the pattern. + # - s/.*= *"\?\([^"]*\)"\?/\1/: Matches and captures the value after an equals sign (=), possibly surrounded by optional double quotes. + # - .*: Matches any characters before the equals sign. + # - = *"\?: Matches the equals sign and any optional spaces before an optional double quote. + # - \([^"]*\): Captures any characters that are not double quotes. + # - "\?: Matches an optional double quote. + # - /1: Replaces the entire matched pattern with the captured value. + # - s/;$//: Removes a semicolon (;) at the end of the line, if present. + # - p: Prints the modified line. + # - q: Quits processing after modifying and printing the line. + + if [ -n "${3}" ]; then + servercfgparse="${3}" + else + servercfgparse="${servercfgfullpath}" + fi + eval "${1}=\"$(sed -n '/^\<'"${2}"'\>/ { s/.*= *"\?\([^"]*\)"\?/\1/;s/;$//p;q }' "${servercfgparse}" | tr -d '\r')\"" + configtype="sqf" +} + +# Config Type: XML +# Comment: +fn_info_game_xml() { + if [ -n "${3}" ]; then + servercfgparse="${3}" + else + servercfgparse="${servercfgfullpath}" + fi + eval "${1}"="$(xmllint --xpath "string(${2})" "${servercfgparse}")" + configtype="xml" +} + +# Config Type: Valve KeyValues +# Comment: // +fn_info_game_valve_keyvalues() { + # sed is used to process the file. + # -n: Suppresses automatic printing of pattern space. + # /^[[:space:]]*\<'"${2}"'\>/: Matches lines starting with optional leading whitespace and the word provided as the second argument ($2), considering it as a whole word. + # { s/.* *"\?\([^"]*\)"\?/\1/p;q }: Command block executed for lines that match the pattern. + # - s/.* *"\?\([^"]*\)"\?/\1/: Matches and captures the value after any number of spaces, possibly surrounded by optional double quotes. + # - .*: Matches any characters before the spaces. + # - *: Matches any number of spaces. + # - "\?: Matches an optional double quote. + # - \([^"]*\): Captures any characters that are not double quotes. + # - "\?: Matches an optional double quote. + # - /1: Replaces the entire matched pattern with the captured value. + # - p: Prints the modified line. + # - q: Quits processing after modifying and printing the line. + + if [ -n "${3}" ]; then + servercfgparse="${3}" + else + servercfgparse="${servercfgfullpath}" + fi + eval "${1}=\"$(sed -n '/^\<'"${2}"'\>/ { s/.* *"\?\([^"]*\)"\?/\1/p;q }' "${servercfgparse}" | tr -d '\r')\"" + configtype="valve_keyvalues" +} + +# Config Type: Java properties +# Comment: # or ! +fn_info_game_java_properties() { + # sed is used to process the file. + # -n: Suppresses automatic printing of pattern space. + # /^\<'"${2}"'\>/: Matches lines starting with the word provided as the second argument ($2), considering it as a whole word. + # { s/.*= *"\?\([^"]*\)"\?/\1/p;q }: Command block executed for lines that match the pattern. + # - s/.*= *"\?\([^"]*\)"\?/\1/: Matches and captures the value after an equals sign (=), possibly surrounded by optional double quotes. + # - .*: Matches any characters before the equals sign. + # - = *"\?: Matches the equals sign and any optional spaces before an optional double quote. + # - \([^"]*\): Captures any characters that are not double quotes. + # - "\?: Matches an optional double quote. + # - /1: Replaces the entire matched pattern with the captured value. + # - p: Prints the modified line. + # - q: Quits processing after modifying and printing the line. + + if [ -n "${3}" ]; then + servercfgparse="${3}" + else + servercfgparse="${servercfgfullpath}" + fi + eval "${1}=\"$(sed -n '/^\<'"${2}"'\>/ { s/.*= *\"\?\([^"]*\)\"\?/\1/p;q }' "${servercfgparse}" | tr -d '\r')\"" + configtype="java" +} + +# Config Type: ini +# Comment: ; or # +# Note: this ini filter does not filter by section. Can cause issues with some games that have multiple sections with the same variable name. +fn_info_game_lua() { + # - The '-n' option suppresses automatic printing of pattern space. + # - The pattern '/^[[:space:]]*\<'"${2}"'\>/' matches lines that begin with optional whitespace characters, + # followed by the exact word specified by the second argument. + # - If the pattern matches, the following actions are performed within the curly braces: + # - 's/.*= *"\?\([^"]*\)"\?/\1/' extracts the value within double quotes after an equal sign (if present), + # removing any leading or trailing spaces. + # - 's#,.*##' removes everything after the first comma encountered. + # - 'p' prints the modified pattern space. + # - 'q' quits processing after printing the modified pattern space. + + if [ -n "${3}" ]; then + servercfgparse="${3}" + else + servercfgparse="${servercfgfullpath}" + fi + eval "${1}=\"$(sed -n '/^[[:space:]]*\<'"${2}"'\>/ { s/.*= *"\?\([^"]*\)"\?/\1/;s#,.*##;p;q }' "${servercfgparse}" | tr -d '\r')\"" + configtype="lua" +} + +# Config Type: custom (Project Cars) +# Comment: // +fn_info_game_pc_config() { + # sed is used to process the file. + # -n: Suppresses automatic printing of pattern space. + # /^\<'"${2}"'\>/: Matches lines starting with the word provided as the second argument ($2), considering it as a whole word. + # { s/.*: *"\?\([^"]*\)"\?/\1/p;q }: Command block executed for lines that match the pattern. + # - s/.*: *"\?\([^"]*\)"\?/\1/: Matches and captures the value after an equals sign (=), possibly surrounded by optional double quotes. + # - .*: Matches any characters before the equals sign. + # - : *"\?: Matches the : sign and any optional spaces before an optional double quote. + # - \([^"]*\): Captures any characters that are not double quotes. + # - "\?: Matches an optional double quote. + # - /1: Replaces the entire matched pattern with the captured value. + # - p: Prints the modified line. + # - q: Quits processing after modifying and printing the line. + + if [ -n "${3}" ]; then + servercfgparse="${3}" + else + servercfgparse="${servercfgfullpath}" + fi + eval "${1}=\"$(sed -n '/^\<'"${2}"'\>/ { s/.*: *\"\?\([^"]*\)\"\?/\1/p;q }' "${servercfgparse}" | tr -d '\r')\"" + configtype="pc_config" +} + +# Config Type: ini +# Parameters: false +# Comment: ; or # +# Example: NAME=SERVERNAME +# Filetype: ini fn_info_game_ac() { - # Config - if [ ! -f "${servercfgfullpath}" ]; then - adminpassword="${unavailable}" - httpport="${zero}" - port="${zero}" - queryport="${zero}" - servername="${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) - - # Not set - adminpassword=${adminpassword:-"NOT SET"} - httpport=${httpport:-"0"} - port=${port:-"0"} - queryport=${queryport:-"0"} - servername=${servername:-"NOT SET"} - - fi -} - + if [ -f "${servercfgfullpath}" ]; then + fn_info_game_ini "adminpassword" "ADMIN_PASSWORD" + fn_info_game_ini "httpport" "HTTP_PORT" + fn_info_game_ini "port" "TCP_PORT" + fn_info_game_ini "servername" "NAME" + fn_info_game_ini "serverpassword" "PASSWORD" + fi + adminpassword="${adminpassword:-NOT SET}" + httpport="${httpport:-0}" + port="${port:-0}" + queryport="${httpport:-0}" + servername="${servername:-NOT SET}" + serverpassword="${serverpassword:-NOT SET}" +} + +# Config Type: ini +# Parameters: true +# Comment: ; or # +# Example: SessionName=SERVERNAME +# Filetype: ini fn_info_game_ark() { - # Config - if [ ! -f "${servercfgfullpath}" ]; then - adminpassword="${unavailable}" - servername="${unavailable}" - serverpassword="${unavailable}" - else - 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 - adminpassword=${adminpassword:-"NOT SET"} - servername=${servername:-"NOT SET"} - serverpassword=${serverpassword:-"NOT SET"} - fi - - # Parameters - maxplayers=${maxplayers:-"0"} - port=${port:-"0"} - queryport=${queryport:-"0"} - rawport=$((port + 1)) - rconport=${rconport:-"0"} -} - + if [ -f "${servercfgfullpath}" ]; then + fn_info_game_ini "adminpassword" "ServerAdminPassword" + fn_info_game_ini "servername" "SessionName" + fn_info_game_ini "serverpassword" "ServerPassword" + fi + adminpassword="${adminpassword:-"NOT SET"}" + maxplayers="${maxplayers:-"0"}" + port="${port:-"0"}" + queryport="${queryport:-"0"}" + rawport="$((port + 1))" + rconport="${rconport:-"0"}" + servername="${servername:-"NOT SET"}" + serverpassword="${serverpassword:-"NOT SET"}" +} + +# Config Type: SQF +# Parameters: true +# Comment: // or /* */ +# Example: serverName = "SERVERNAME"; +# Filetype: cfg fn_info_game_arma3() { - # Config - if [ ! -f "${servercfgfullpath}" ]; then - adminpassword="${unavailable}" - maxplayers="${zero}" - servername="${unavailable}" - serverpassword="${unavailable}" - else - adminpassword=$(sed -nr 's/^passwordAdmin\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 - adminpassword=${adminpassword:-"NOT SET"} - maxplayers=${maxplayers:-"0"} - servername=${servername:-"NOT SET"} - serverpassword=${serverpassword:-"NOT SET"} - fi - - # Parameters - battleeyeport=$((port + 4)) - port=${port:-"2302"} - queryport=$((port + 1)) - steammasterport=$((port + 2)) - voiceport=${port:-"2302"} - voiceunusedport=$((port + 3)) -} - -fn_info_game_armar() { - 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}") - - # 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"} - fi -} - + if [ -f "${servercfgfullpath}" ]; then + fn_info_game_sqf "adminpassword" "passwordAdmin" + fn_info_game_sqf "maxplayers" "maxPlayers" + fn_info_game_sqf "servername" "hostname" + fn_info_game_sqf "serverpassword" "password" + fi + adminpassword="${adminpassword:-"NOT SET"}" + battleeyeport="$((port + 4))" + maxplayers="${maxplayers:-"0"}" + port="${port:-"0"}" + queryport="$((port + 1))" + servername="${servername:-"NOT SET"}" + serverpassword="${serverpassword:-"NOT SET"}" + steamport="$((port + 2))" + voiceport="${port:-"0"}" + voiceunusedport="$((port + 3))" +} + +# Config Type: ini +# Parameters: true +# Comment: ; or # +# Example: serverName=SERVERNAME +# Filetype: ini fn_info_game_av() { - # Config - if [ ! -f "${servercfgfullpath}" ]; then - maxplayers="${unavailable}" - servername="${unavailable}" - serverpassword="${unavailable}" - port=${zero} - queryport=${zero} - steamqueryport=${zero} - steammasterport=${zero} - rconport=${zero} - rconenabled="${unavailable}" - rconpassword="${unavailable}" - else - maxplayers=$(grep "maxPlayers=" "${servercfgfullpath}" | sed 's/maxPlayers=//') - servername=$(grep "name=" "${servercfgfullpath}" | sed 's/name=//') - serverpassword=$(grep "password=" "${servercfgfullpath}" | sed 's/password=//') - port=$(grep "port=" "${servercfgfullpath}" | sed 's/port=//') - queryport=$((port + 3)) - steamqueryport=$((port + 20)) - steammasterport=$((port + 21)) - rconport=$(grep "rconPort=" "${servercfgfullpath}" | sed 's/rconPort=//') - - rconpassword=$(grep "rconPassword=" "${servercfgfullpath}" | sed 's/rconPassword=//') + if [ -f "${servercfgfullpath}" ]; then + fn_info_game_ini "maxplayers" "maxPlayers" + fn_info_game_ini "port" "port" + fn_info_game_ini "rconport" "rconPort" + fn_info_game_ini "servername" "name" + fn_info_game_ini "serverpassword" "password" + fn_info_game_ini "rconpassword" "rconPassword" if [ -n "${rconpassword}" ]; then rconenabled="true" fi - - # Not set - maxplayers=${maxplayers:-"0"} - servername=${servername:-"NOT SET"} - serverpassword=${serverpassword:-"NOT SET"} - port=${port:-"0"} - queryport=${queryport:-"0"} - steamqueryport=${steamqueryport:-"0"} - steammasterport=${steammasterport:-"0"} - rconport=${rconport:-"0"} - rconenabled=${rconenabled:-"NOT SET"} - rconpassword=${rconpassword:-"NOT SET"} fi -} - -fn_info_game_bf1942() { - # Config - if [ ! -f "${servercfgfullpath}" ]; then - servername="${unavailable}" - serverpassword="${unavailable}" - maxplayers="${zero}" - port="${zero}" - queryport="${zero}" - else - servername=$(grep -E "^game.serverName " "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^--/d' -e 's/game.serverName //g' | tr -d '=\";,:' | xargs) - serverpassword=$(grep "game.serverPassword" "${servercfgfullpath}" | sed -e 's/^ *//g' -e '/^--/d' -e 's/game.serverPassword//g' | tr -d '=\";,:' | xargs) - maxplayers=$(grep "game.serverMaxPlayers" "${servercfgfullpath}" | grep -v "\--" | tr -cd '[:digit:]') - port=$(grep "game.serverPort" "${servercfgfullpath}" | grep -v "\--" | tr -cd '[:digit:]') - queryport="22000" - configip=$(grep "game.serverIP" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^--/d' -e 's/game.serverIP//g' | tr -d '=\";,:' | xargs) - - # Not set - servername=${servername:-"NOT SET"} - serverpassword=${serverpassword:-"NOT SET"} - maxplayers=${maxplayers:-"0"} - port=${port:-"0"} - queryport=${queryport:-"0"} - configip=${configip:-"0.0.0.0"} + maxplayers="${maxplayers:-"0"}" + port="${port:-"0"}" + + rconenabled="${rconenabled:-"false"}" + rconpassword="${rconpassword:-"NOT SET"}" + rconport="${rconport:-"0"}" + # queryport is port + 3 + # this doesnt respond to any queries, using tcp query on rconport instead. + queryport="${rconport:-"0"}" + servername="${servername:-"NOT SET"}" + serverpassword="${serverpassword:-"NOT SET"}" + steamport="$((port + 21))" + steamworksport="$((port + 20))" +} + +# Config Type: ini unknown (Source?) +# Parameters: true +# Comment: # or // +# Example: ServerName=SERVERNAME +# Filetype: txt +fn_info_game_bo() { + if [ -f "${servercfgfullpath}" ]; then + fn_info_game_ini "maxplayers" "MaxPlayers" + fn_info_game_ini "port" "ServerPort" + fn_info_game_ini "servername" "ServerName" + fn_info_game_ini "serverpassword" "Password" + fi + maxplayers="${maxplayers:-"0"}" + port="${port:-"0"}" + queryport="$((port + 1))" + servername="${servername:-"NOT SET"}" + serverpassword="${serverpassword:-"NOT SET"}" +} + +# Config Type: ini +# Parameters: true +# Comment: ; or # +# Example: ServerName=SERVERNAME +# Filetype: ini +fn_info_game_btl() { + if [ -f "${servercfgfullpath}" ]; then + fn_info_game_ini "adminpassword" "AdminPassword" + fn_info_game_ini "servername" "ServerName" + fi + adminpassword="${adminpassword:-"NOT SET"}" + port="${port:-"0"}" + queryport="${queryport:-"0"}" + rconport="$((port + 2))" + servername="${servername:-"NOT SET"}" +} + +# Config Type: ini +# Parameters: true +# Comment: ; or # +# Example: ServerName=SERVERNAME +# Filetype: ini +fn_info_game_cmw() { + if [ -f "${servercfgfullpath}" ]; then + fn_info_game_ini "maxplayers" "MaxPlayers" + fn_info_game_ini "servername" "ServerName" + fn_info_game_ini "serverpassword" "GamePassword" + fn_info_game_ini "rconport" "RConPort" "${servercfgdir}/DefaultGame.ini" + fi + defaultmap="${defaultmap:-"NOT SET"}" + maxplayers="${maxplayers:-"0"}" + port="${port:-"0"}" + queryport="${queryport:-"0"}" + rconport="${rconport:-"0"}" + servername="${servername:-"NOT SET"}" + serverpassword="${serverpassword:-"NOT SET"}" +} + +# Config Type: ini +# Parameters: true +# Comment: ; or # +# Example: iMaxClanMembers=1024 +# Filetype: ini +fn_info_game_dodr() { + if [ -f "${servercfgfullpath}" ]; then + fn_info_game_ini "maxplayers" "iMaxPlayers" fi + maxplayers="${maxplayers:-"0"}" + port="${port:-"0"}" + queryport="${queryport:-"0"}" + servername="${servername:-"NOT SET"}" } -fn_info_game_bfv() { - # Config - if [ ! -f "${servercfgfullpath}" ]; then - servername="${unavailable}" - serverpassword="${unavailable}" - maxplayers="${zero}" - port="${zero}" - queryport="${zero}" - else - servername=$(grep "game.serverName" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^--/d' -e 's/game.serverName//g' | tr -d '=\";,:' | xargs) - serverpassword=$(grep "game.serverPassword" "${servercfgfullpath}" | sed -e 's/^ *//g' -e '/^--/d' -e 's/game.serverPassword//g' | tr -d '=\";,:' | xargs) - maxplayers=$(grep "game.serverMaxPlayers" "${servercfgfullpath}" | grep -v "\--" | tr -cd '[:digit:]') - port=$(grep "game.serverPort" "${servercfgfullpath}" | grep -v "\--" | tr -cd '[:digit:]') - queryport="23000" - configip=$(grep "game.serverIP" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^--/d' -e 's/game.serverIP//g' | tr -d '=\";,:' | xargs) - - # Not set - servername=${servername:-"NOT SET"} - serverpassword=${serverpassword:-"NOT SET"} - maxplayers=${maxplayers:-"0"} - port=${port:-"0"} - queryport=${queryport:-"0"} - configip=${configip:-"0.0.0.0"} +# Config Type: ini +# Parameters: true +# Comment: ; or # +# Example: cluster_name = SERVERNAME +# Filetype: ini +fn_info_game_dst() { + if [ -f "${servercfgfullpath}" ]; then + fn_info_game_ini "port" "server_port" + fn_info_game_ini "steamauthport" "authentication_port" + fn_info_game_ini "steamport" "master_server_port" + fi + if [ -f "${clustercfgfullpath}" ]; then + fn_info_game_ini "maxplayers" "max_players" "${clustercfgfullpath}" + fn_info_game_ini "servername" "cluster_name" "${clustercfgfullpath}" + fn_info_game_ini "serverpassword" "cluster_password" "${clustercfgfullpath}" + fn_info_game_ini "tickrate" "tick_rate" "${clustercfgfullpath}" + fn_info_game_ini "masterport" "master_port" "${clustercfgfullpath}" + fn_info_game_ini "gamemode" "game_mode" "${clustercfgfullpath}" + fn_info_game_ini "configip" "bind_ip" "${clustercfgfullpath}" + fi + + cave="${cave:-"NOT SET"}" + cluster="${cluster:-"NOT SET"}" + configip="${configip:-"0.0.0.0"}" + gamemode="${gamemode:-"NOT SET"}" + master="${master:-"NOT SET"}" + masterport="${masterport:-"0"}" + maxplayers="${maxplayers:-"0"}" + port="${port:-"0"}" + servername="${servername:-"NOT SET"}" + serverpassword="${serverpassword:-"NOT SET"}" + shard="${shard:-"NOT SET"}" + sharding="${sharding:-"NOT SET"}" + steamauthport="${steamauthport:-"0"}" + steamport="${steamport:-"0"}" + tickrate="${tickrate:-"0"}" +} + +# Config Type: ini +# Parameters: true +# Comment: ; or # +# Example: ServerName=SERVERNAME +# Filetype: ini +fn_info_game_kf() { + if [ -f "${servercfgfullpath}" ]; then + fn_info_game_ini "adminpassword" "AdminPassword" + fn_info_game_ini "httpenabled" "bEnabled" + fn_info_game_ini "httppassword" "httppasswordword" + fn_info_game_ini "httpport" "ListenPort" + fn_info_game_ini "httpuser" "AdminName" + fn_info_game_ini "lanport" "LANServerPort" + fn_info_game_ini "maxplayers" "MaxPlayers" + fn_info_game_ini "port" "Port" + fn_info_game_ini "queryportgs" "QueryPort" + fn_info_game_ini "servername" "ServerName" + fn_info_game_ini "serverpassword" "GamePassword" + fi + adminpassword="${adminpassword:-"NOT SET"}" + defaultmap="${defaultmap:-"NOT SET"}" + httpenabled="${httpenabled:-"NOT SET"}" + httppassword="${adminpassword}" + httpport="${httpport:-"0"}" + httpuser="${httpuser:-"NOT SET"}" + lanport="${lanport:-"0"}" + maxplayers="${maxplayers:-"0"}" + port="${port:-"0"}" + queryport="$((port + 1))" + queryportgs="${queryportgs:-"0"}" + servername="${servername:-"NOT SET"}" + serverpassword="${serverpassword:-"NOT SET"}" + steamport="28852" + steamworksport="20560" +} + +# Config Type: ini +# Parameters: true +# Comment: ; or # +# Example: ServerName=SERVERNAME +# Filetype: ini +fn_info_game_kf2() { + if [ -f "${servercfgfullpath}" ]; then + fn_info_game_ini "adminpassword" "AdminPassword" + fn_info_game_ini "httpport" "ListenPort" "${servercfgdir}/KFWeb.ini" + fn_info_game_ini "port" "Port" + fn_info_game_ini "servername" "ServerName" + fn_info_game_ini "serverpassword" "GamePassword" + fn_info_game_ini "httpenabled" "bEnabled" + fn_info_game_ini "httppassword" "httppasswordword" + fi + adminpassword="${adminpassword:-"NOT SET"}" + defaultmap="${defaultmap:-"NOT SET"}" + httpport="${httpport:-"0"}" + port="${port:-"0"}" + queryport="${queryport:-"0"}" + servername="${servername:-"NOT SET"}" + serverpassword="${serverpassword:-"NOT SET"}" + httpenabled="${httpenabled:-"NOT SET"}" + httppassword="${httppassword:-"NOT SET"}" + httpuser="Admin" +} + +# Config Type: ini +# Parameters: true +# Comment: ; or # +# Example: ServerName=SERVERNAME +# Filetype: ini +fn_info_game_mh() { + if [ -f "${servercfgfullpath}" ]; then + fn_info_game_ini "servername" "ServerName" + fn_info_game_ini "serverpassword" "ServerPassword" + fn_info_game_ini "rconpassword" "AdminPassword" + fn_info_game_ini "maxplayers" "MaxSlots" + fi + servername="${servername:-"NOT SET"}" + serverpassword="${serverpassword:-"NOT SET"}" + rconpassword="${rconpassword:-"NOT SET"}" + maxplayers="${maxplayers:-"0"}" + port="${port:-"0"}" + queryport="${queryport:-"0"}" + beaconport="${beaconport:-"0"}" +} + +# Config Type: ini +# Parameters: true +# Comment: ; or # +# Example: ServerName="SERVERNAME" +# Filetype: cfg +fn_info_game_pstbs() { + if [ -f "${servercfgfullpath}" ]; then + fn_info_game_ini "servername" "ServerName" + fn_info_game_ini "maxplayers" "MaxPlayers" + fn_info_game_ini "reservedslots" "NumReservedSlots" + fn_info_game_ini "serverpassword" "ServerPassword" + fi + if [ -f "${servercfgdir}/Rcon.cfg" ]; then + fn_info_game_ini "rconpassword" "Password" "${servercfgdir}/Rcon.cfg" + fn_info_game_ini "rconport" "Port" "${servercfgdir}/Rcon.cfg" + fi + maxplayers="${maxplayers:-"0"}" + port="${port:-"0"}" + if [ -z "${queryport}" ]; then + queryport="${port:-"0"}" fi -} - -fn_info_game_bo() { - # Config - if [ ! -f "${servercfgfullpath}" ]; then - servername="${unavailable}" - serverpassword="${unavailable}" - port="${zero}" - queryport="${zero}" - maxplayers="${unavailable}" - else - servername=$(grep "ServerName=" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/ServerName//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - serverpassword=$(grep "Password=" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/Password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - port=$(grep "ServerPort=" "${servercfgfullpath}" | tr -cd '[:digit:]') - queryport=$((port + 1)) - maxplayers=$(grep "MaxPlayers=" "${servercfgfullpath}" | tr -cd '[:digit:]') - - # Not set - servername=${servername:-"NOT SET"} - serverpassword=${serverpassword:-"NOT SET"} - port=${port:-"0"} - queryport=${queryport:-"0"} - maxplayers=${maxplayers:-"0"} + randommap="${randommap:-"NOT SET"}" + if [ -z "${rconpassword}" ] || [ "${#rconpassword}" == 1 ]; then + rconpassword="NOT SET" fi + rconport="${rconport:-"0"}" + reservedslots="${reservedslots:-"0"}" + servername="${servername:-"NOT SET"}" + serverpassword="${serverpassword:-"NOT SET"}" + tickrate="${tickrate:-"0"}" } -fn_info_game_bt() { - # Config - if [ ! -f "${servercfgfullpath}" ]; then - servername="${unavailable}" - serverpassword="${unavailable}" - port="${zero}" - queryport="${zero}" - maxplayers="${unavailable}" - else - 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:]') - maxplayers=$(grep "maxplayers=" "${servercfgfullpath}" | tr -cd '[:digit:]') - - # Not set - servername=${servername:-"NOT SET"} - serverpassword=${serverpassword:-"NOT SET"} - port=${port:-"0"} - queryport=${queryport:-"0"} - maxplayers=${maxplayers:-"0"} +# Config Type: ini +# Parameters: false +# Comment: ; or # +# Example: ServerName=SERVERNAME +# Filetype: cfg +fn_info_game_pvr() { + if [ -f "${servercfgfullpath}" ]; then + fn_info_game_ini "servername" "ServerName" + fn_info_game_ini "maxplayers" "MaxPlayers" fi + maxplayers="${maxplayers:-"0"}" + port="${port:-"0"}" + port401="$((port + 400))" + queryport="${port:-"0"}" + servername="${servername:-"NOT SET"}" } -fn_info_game_btl() { - # Config - if [ ! -f "${servercfgfullpath}" ]; then - servername="${unavailable}" - serverpassword="${unavailable}" - gamemode="${unavailable}" - else - servername=$(grep -m2 "ServerName" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^--/d' -e 's/ServerName//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - serverpassword=$(grep "Password" "${servercfgfullpath}" | grep -v "RCONPassword" | sed -e 's/^[ \t]*//g' -e '/^--/d' -e 's/Password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - gamemode=$(grep -m2 "PlayMode" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^--/d' -e 's/PlayMode//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - - # Not set - servername=${servername:-"NOT SET"} - serverpassword=${serverpassword:-"NOT SET"} - gamemode=${gamemode:-"NOT SET"} - fi - - # Parameters - port=${port:-"0"} - queryport=${queryport:-"0"} - rconport=$((port + 2)) +# Config Type: ini +# Parameters: true +# Comment: ; or # +# Example: PublicName=SERVERNAME +# Filetype: ini +fn_info_game_pz() { + if [ -f "${servercfgfullpath}" ]; then + fn_info_game_ini "maxplayers" "MaxPlayers" + fn_info_game_ini "port" "DefaultPort" + fn_info_game_ini "rconpassword" "RCONPassword" + fn_info_game_ini "servername" "PublicName" + fn_info_game_ini "serverpassword" "Password" + fn_info_game_ini "worldname" "Map" + + fi + adminpassword="${adminpassword:-"NOT SET"}" + maxplayers="${maxplayers:-"0"}" + port="${port:-"0"}" + queryport="${port:-"0"}" + rconpassword="${rconpassword:-"NOT SET"}" + servername="${servername:-"NOT SET"}" + serverpassword="${serverpassword:-"NOT SET"}" + worldname="${worldname:-"NOT SET"}" } -fn_info_game_cd() { - if [ ! -f "${servercfgfullpath}" ]; then - servername="${unavailable}" - port="${zero}" - rconenabled="false" - rconport="${zero}" - rconpassword="${unavailable}" - steamport="${zero}" - maxplayers="${zero}" - else - servername=$(jq -r '.game_title' "${servercfgfullpath}") - port=$(jq -r '.game_port' "${servercfgfullpath}") - steamport=$(jq -r '.steam_port_messages' "${servercfgfullpath}") - rconenabled=$(jq -r '.rcon' "${servercfgfullpath}") - rconport=$(jq -r '.rcon_port' "${servercfgfullpath}") - rconpassword=$(jq -r '.rcon_password' "${servercfgfullpath}") - maxplayers=$(jq -r '.player_count' "${servercfgfullpath}") +# Config Type: ini +# Parameters: true +# Comment: ; or # +# Example: SERVERNAME=SERVERNAME +# Filetype: ini +fn_info_game_st() { + if [ -f "${servercfgfullpath}" ]; then + fn_info_game_ini "maxplayers" "MAXPLAYER" + fn_info_game_ini "rconpassword" "RCONPASSWORD" + fn_info_game_ini "servername" "SERVERNAME" + fn_info_game_ini "serverpassword" "PASSWORD" + fi + clearinterval="${clearinterval:-"0"}" + httpport="${port:-"0"}" + maxplayers="${maxplayers:-"0"}" + port="${port:-"0"}" + queryport="${queryport:-"0"}" + rconpassword="${rconpassword:-"NOT SET"}" + saveinterval="${saveinterval:-"0"}" + servername="${servername:-"NOT SET"}" + serverpassword="${serverpassword:-"NOT SET"}" + worldname="${worldname:-"NOT SET"}" + worldtype="${worldtype:-"NOT SET"}" + +} + +# Config Type: ini +# Parameters: true +# Comment: ; or # +# Example: ServerName=SERVERNAME +# Filetype: ini +fn_info_game_stn() { + if [ -f "${servercfgfullpath}" ]; then + fn_info_game_ini "configip" "ServerIP" + fn_info_game_ini "port" "ServerPort" + fn_info_game_ini "servername" "ServerName" + fn_info_game_ini "serverpassword" "ServerPassword" + fi + configip="${configip:-"0.0.0.0"}" + maxplayers="${maxplayers:-"0"}" + port="${port:-"0"}" + queryport="$((port + 1))" + servername="${servername:-"NOT SET"}" + serverpassword="${serverpassword:-"NOT SET"}" +} + +# Config Type: ini +# Parameters: true +# Comment: ; or # +# Example: ServerName=ServerName +# Filetype: ini +fn_info_game_ti() { + if [ -f "${servercfgfullpath}" ]; then + fn_info_game_ini "servername" "ServerName" + fn_info_game_ini "maxplayers" "MaxPlayerCount" fi + maxplayers="${maxplayers:-"0"}" + port="${port:-"0"}" + queryport="${queryport:-"0"}" + servername="${servername:-"NOT SET"}" } +# Config Type: ini +# Parameters: false +# Comment: ; or # +# Example: default_voice_port=9987 +# Filetype: ini +fn_info_game_ts3() { + if [ -f "${servercfgfullpath}" ]; then + fn_info_game_ini "configip" "voice_ip" + fn_info_game_ini "dbplugin" "dbplugin" + fn_info_game_ini "fileport" "filetransfer_port" + fn_info_game_ini "port" "default_voice_port" + fn_info_game_ini "queryhttpport" "query_http_port" + fn_info_game_ini "queryhttpsport" "query_https_port" + fn_info_game_ini "queryport" "query_port" + fn_info_game_ini "querysshport" "query_ssh_port" + fi + configip="${configip:-"0.0.0.0"}" + dbplugin="${dbplugin:-"NOT SET"}" + fileport="${fileport:-"0"}" + port="${port:-"0"}" + queryhttpport="${queryhttpport:-"0"}" + queryhttpsport="${queryhttpsport:-"0"}" + queryport="${queryport:-"0"}" + querysshport="${querysshport:-"0"}" + telnetport="${queryport}" +} + +# Config Type: ini +# Parameters: true +# Comment: ; or # +# Example: ServerTitle=SERVERNAME +# Filetype: ini +fn_info_game_tu() { + if [ -f "${servercfgfullpath}" ]; then + fn_info_game_ini "maxplayers" "MaxPlayers" + fn_info_game_ini "servername" "ServerTitle" + fi + maxplayers="${maxplayers:-"0"}" + port="${port:-"0"}" + queryport="${queryport:-"0"}" + servername="${servername:-"NOT SET"}" + steamport="$((port + 1))" +} + +# Config Type: ini +# Parameters: true +# Comment: ; or # +# Example: ServerName=SERVERNAME +# Filetype: ini +fn_info_game_ut99() { + if [ -f "${servercfgfullpath}" ]; then + fn_info_game_ini "adminpassword" "AdminPassword" + fn_info_game_ini "beaconport" "ServerBeaconPort" + fn_info_game_ini "port" "Port" + fn_info_game_ini "queryportgs" "OldQueryPortNumber" + fn_info_game_ini "servername" "ServerName" + fn_info_game_ini "serverpassword" "GamePassword" + fn_info_game_ini "httpenabled" "bEnabled" + fn_info_game_ini "httppassword" "AdminPassword" + fn_info_game_ini "httpport" "ListenPort" + fn_info_game_ini "httpuser" "AdminUserName" + fi + adminpassword="${adminpassword:-"NOT SET"}" + beaconport="${beaconport:-"0"}" + defaultmap="${defaultmap:-"NOT SET"}" + httpport="${httpport:-"0"}" + port="${port:-"0"}" + queryport="$((port + 1))" + queryportgs="${queryportgs:-"0"}" + servername="${servername:-"NOT SET"}" + serverpassword="${serverpassword:-"NOT SET"}" + httpenabled="${httpenabled:-"0"}" + httppassword="${httppassword:-"NOT SET"}" + httpuser="${httpuser:-"NOT SET"}" +} + +# Config Type: ini +# Parameters: true +# Comment: ; or # +# Example: ServerName=SERVERNAME +# Filetype: ini +fn_info_game_ut3() { + if [ -f "${servercfgfullpath}" ]; then + fn_info_game_ini "adminpassword" "AdminPassword" + fn_info_game_ini "maxplayers" "MaxPlayers" + fn_info_game_ini "servername" "ServerName" + fn_info_game_ini "serverpassword" "GamePassword" + fn_info_game_ini "httpenabled" "bEnabled" + fn_info_game_ini "httppassword" "AdminPassword" + fn_info_game_ini "httpport" "ListenPort" + fi + adminpassword="${adminpassword:-"NOT SET"}" + defaultmap="${defaultmap:-"NOT SET"}" + httpport="${httpport:-"0"}" + maxplayers="${maxplayers:-"0"}" + port="${port:-"0"}" + queryport="${queryport:-"0"}" + servername="${servername:-"NOT SET"}" + serverpassword="${serverpassword:-"NOT SET"}" + httpenabled="${httpenabled:-"0"}" + httppassword="${httppassword:-"NOT SET"}" + httpuser="Admin" +} + +# Config Type: ini +# Parameters: true +# Comment: ; or # +# Example: ServerName=SERVERNAME +# Filetype: ini +fn_info_game_unreal2() { + if [ -f "${servercfgfullpath}" ]; then + fn_info_game_ini "adminpassword" "AdminPassword" + fn_info_game_ini "httpport" "ListenPort" + fn_info_game_ini "port" "Port" + fn_info_game_ini "queryportgs" "OldQueryPortNumber" + fn_info_game_ini "servername" "ServerName" + fn_info_game_ini "serverpassword" "GamePassword" + fn_info_game_ini "httpenabled" "bEnabled" + fn_info_game_ini "httpuser" "AdminName" + fi + adminpassword="${adminpassword:-"NOT SET"}" + defaultmap="${defaultmap:-"NOT SET"}" + httpport="${httpport:-"0"}" + port="${port:-"0"}" + queryport="$((port + 1))" + queryportgs="${queryportgs:-"0"}" + servername="${servername:-"NOT SET"}" + serverpassword="${serverpassword:-"NOT SET"}" + httpenabled="${httpenabled:-"0"}" + httppassword="${adminpassword:-"NOT SET"}" + httpuser="${httpuser:-"NOT SET"}" +} + +# Config Type: ini +# Parameters: true +# Comment: ; or # +# Example: ServerName="SERVERNAME" +# Filetype: ini +fn_info_game_ut() { + if [ -f "${servercfgfullpath}" ]; then + fn_info_game_ini "servername" "ServerName" + fi + defaultmap="${defaultmap:-"NOT SET"}" + gametype="${gametype:-"NOT SET"}" + port="${port:-"0"}" + queryport="$((port + 1))" +} + +# Config Type: ini +# Parameters: true +# Comment: ; or # +# Example: ServerName=SERVERNAME +# Filetype: ini +fn_info_game_ut2k4() { + if [ -f "${servercfgfullpath}" ]; then + fn_info_game_ini "adminpassword" "AdminPassword" + fn_info_game_ini "httpport" "ListenPort" + fn_info_game_ini "lanport" "LANServerPort" + fn_info_game_ini "port" "Port" + fn_info_game_ini "queryportgs" "OldQueryPortNumber" + fn_info_game_ini "servername" "ServerName" + fn_info_game_ini "serverpassword" "GamePassword" + fn_info_game_ini "httpenabled" "bEnabled" + fn_info_game_ini "httpuser" "AdminName" + fi + adminpassword="${adminpassword:-"NOT SET"}" + defaultmap="${defaultmap:-"NOT SET"}" + httpport="${httpport:-"0"}" + lanport="${lanport:-"0"}" + port="${port:-"0"}" + queryport="$((port + 1))" + queryportgs="${queryportgs:-"0"}" + servername="${servername:-"NOT SET"}" + serverpassword="${serverpassword:-"NOT SET"}" + httpenabled="${httpenabled:-"0"}" + httppassword="${adminpassword}" + httpuser="${httpuser:-"NOT SET"}" +} + +# Config Type: json +# Parameters: true +# Comment: // or /* */ +# Example: "name": "SERVERNAME", +# Filetype: json +fn_info_game_armar() { + if [ -f "${servercfgfullpath}" ]; then + fn_info_game_json "adminpassword" ".adminPassword" + fn_info_game_json "configip" ".gameHostBindAddress" + fn_info_game_json "maxplayers" ".game.playerCountLimit" + fn_info_game_json "port" ".gameHostBindPort" + fn_info_game_json "queryport" ".steamQueryPort" + fn_info_game_json "servername" ".game.name" + fn_info_game_json "serverpassword" ".game.password" + fi + adminpassword="${adminpassword:-"NOT SET"}" + battleeyeport="$((port + 4))" + configip="${configip:-"0.0.0.0"}" + maxplayers="${maxplayers:-"0"}" + port="${port:-"0"}" + queryport="${queryport:-"0"}" + servername="${servername:-"NOT SET"}" + serverpassword="${serverpassword:-"NOT SET"}" +} + +# Config Type: con +# Parameters: true +# Comment: # or // +# Example: game.serverName "SERVERNAME" +# Filetype: con +fn_info_game_bf1942() { + if [ -f "${servercfgfullpath}" ]; then + fn_info_game_con "configip" "game.serverIp" + fn_info_game_con "maxplayers" "game.serverMaxPlayers" + fn_info_game_con "port" "game.serverPort" + fn_info_game_con "servername" "game.serverName" + fn_info_game_con "serverpassword" "game.serverPassword" + fi + configip="${configip:-"0.0.0.0"}" + maxplayers="${maxplayers:-"0"}" + port="${port:-"0"}" + queryport="22000" + servername="${servername:-"NOT SET"}" + serverpassword="${serverpassword:-"NOT SET"}" +} + +# Config Type: con +# Parameters: true +# Comment: # or // +# Example: game.serverName "SERVERNAME" +# Filetype: con +fn_info_game_bfv() { + if [ -f "${servercfgfullpath}" ]; then + fn_info_game_con "configip" "game.serverIp" + fn_info_game_con "maxplayers" "game.serverMaxPlayers" + fn_info_game_con "port" "game.serverPort" + fn_info_game_con "servername" "game.serverName" + fn_info_game_con "serverpassword" "game.serverPassword" + fi + configip="${configip:-"0.0.0.0"}" + maxplayers="${maxplayers:-"0"}" + port="${port:-"0"}" + queryport="22000" + servername="${servername:-"NOT SET"}" + serverpassword="${serverpassword:-"NOT SET"}" +} + +# Config Type: XML +# Parameters: false +# Comment: +# Example: +# Filetype: xml +fn_info_game_bt() { + if [ -f "${servercfgfullpath}" ]; then + fn_info_game_xml "maxplayers" "/serversettings/@MaxPlayers" + fn_info_game_xml "port" "/serversettings/@port" + fn_info_game_xml "queryport" "/serversettings/@queryport" + fn_info_game_xml "servername" "/serversettings/@name" + fn_info_game_xml "serverpassword" "/serversettings/@password" + fn_info_game_xml "tickrate" "/serversettings/@TickRate" + fi + maxplayers="${maxplayers:-"0"}" + port="${port:-"0"}" + queryport="${queryport:-"0"}" + servername="${servername:-"NOT SET"}" + serverpassword="${serverpassword:-"NOT SET"}" + tickrate="${tickrate:-"0"}" +} + +# Config Type: json +# Parameters: false +# Comment: // or /* */ +# Example: "game_title":"SERVERNAME" +# Filetype: json +fn_info_game_cd() { + if [ -f "${servercfgfullpath}" ]; then + fn_info_game_json "maxplayers" ".player_count" + fn_info_game_json "port" ".game_port" + fn_info_game_json "rconenabled" ".rcon" + fn_info_game_json "rconpassword" ".rcon_password" + fn_info_game_json "rconport" ".rcon_port" + fn_info_game_json "servername" ".game_title" + fn_info_game_json "steamport" ".steam_port_messages" + fi + maxplayers="${maxplayers:-"0"}" + port="${port:-"0"}" + rconenabled="${rconenabled:-"NOT SET"}" + rconpassword="${rconpassword:-"NOT SET"}" + rconport="${rconport:-"0"}" + servername="${servername:-"NOT SET"}" + steamport="${steamport:-"0"}" +} + +# Config Type: json +# Parameters: true +# Comment: // or /* */ +# Example: "worldName":"SERVERNAME" +# Filetype: json fn_info_game_ck() { - if [ ! -f "${servercfgfullpath}" ]; then - servername="${unavailable}" - maxplayers="${zero}" - else - servername=$(jq -r '.worldName' "${servercfgfullpath}") - maxplayers=$(jq -r '.maxNumberPlayers' "${servercfgfullpath}") + if [ -f "${servercfgfullpath}" ]; then + fn_info_game_json "servername" ".worldName" + fn_info_game_json "maxplayers" ".maxNumberPlayers" fi - queryport=$((port + 1)) + maxplayers="${maxplayers:-"0"}" + port="${port:-"0"}" + queryport="$((port + 1))" + servername="${servername:-"NOT SET"}" } -fn_info_game_cmw() { - # Config - if [ ! -f "${servercfgfullpath}" ]; then - adminpassword="${unavailable}" - rconport=${zero} - servername="${unavailable}" - serverpassword="${unavailable}" - - else - adminpassword=$(grep -E "^adminpassword=" "${servercfgfullpath}" | tr -cd '[:digit:]') - rconport=$(grep -E "^RConPort=" "${servercfgdir}/DefaultGame.ini" | tr -cd '[:digit:]') - servername=$(grep -E "^ServerName" "${servercfgfullpath}" | sed 's/^ServerName=//') - serverpassword=$(grep -E "^GamePassword" "${servercfgfullpath}" | sed 's/^ServerName=//') +# Config Type: QuakeC +# Parameters: true +# Comment: // or /* */ +# Example: set sv_hostname "SERVERNAME" +# Filetype: cfg +fn_info_game_cod() { + if [ -f "${servercfgfullpath}" ]; then + fn_info_game_quakec "rconpassword" "rconpassword" + fn_info_game_quakec "servername" "sv_hostname" + fi + defaultmap="${defaultmap:-"NOT SET"}" + maxplayers="${maxplayers:-"0"}" + port="${port:-"0"}" + queryport="${port}" + rconpassword="${rconpassword:-"NOT SET"}" + servername="${servername:-"NOT SET"}" +} + +# Config Type: QuakeC +# Parameters: true +# Comment: // or /* */ +# Example: set sv_hostname "SERVERNAME" +# Filetype: cfg +fn_info_game_coduo() { + if [ -f "${servercfgfullpath}" ]; then + fn_info_game_quakec "rconpassword" "rconpassword" + fn_info_game_quakec "servername" "sv_hostname" + fi + defaultmap="${defaultmap:-"NOT SET"}" + maxplayers="${maxplayers:-"0"}" + port="${port:-"0"}" + queryport="${port}" + rconpassword="${rconpassword:-"NOT SET"}" + servername="${servername:-"NOT SET"}" +} + +# Config Type: QuakeC +# Parameters: true +# Comment: // or /* */ +# Example: set sv_hostname "SERVERNAME" +# Filetype: cfg +fn_info_game_cod2() { + if [ -f "${servercfgfullpath}" ]; then + fn_info_game_quakec "rconpassword" "rconpassword" + fn_info_game_quakec "servername" "sv_hostname" + fi + defaultmap="${defaultmap:-"NOT SET"}" + maxplayers="${maxplayers:-"0"}" + port="${port:-"0"}" + queryport="${port}" + rconpassword="${rconpassword:-"NOT SET"}" + servername="${servername:-"NOT SET"}" +} + +# Config Type: QuakeC +# Parameters: true +# Comment: // or /* */ +# Example: set sv_hostname "SERVERNAME" +# Filetype: cfg +fn_info_game_cod4() { + if [ -f "${servercfgfullpath}" ]; then + fn_info_game_quakec "rconpassword" "rcon_password" + fn_info_game_quakec "servername" "sv_hostname" + fi + defaultmap="${defaultmap:-"NOT SET"}" + maxplayers="${maxplayers:-"0"}" + port="${port:-"0"}" + queryport="${port}" + rconpassword="${rconpassword:-"NOT SET"}" + servername="${servername:-"NOT SET"}" +} + +# Config Type: QuakeC +# Parameters: true +# Comment: // or /* */ +# Example: set sv_hostname "SERVERNAME" +# Filetype: cfg +fn_info_game_codwaw() { + if [ -f "${servercfgfullpath}" ]; then + fn_info_game_quakec "rconpassword" "rcon_password" + fn_info_game_quakec "servername" "sv_hostname" + fi + defaultmap="${defaultmap:-"NOT SET"}" + maxplayers="${maxplayers:-"0"}" + port="${port:-"0"}" + queryport="${port}" + rconpassword="${rconpassword:-"NOT SET"}" + servername="${servername:-"NOT SET"}" +} + +# Config Type: json +# Parameters: false +# Comment: // or /* */ +# Example: "ServerName": "SERVERNAME" +# Filetype: json +fn_info_game_col() { + if [ -f "${servercfgfullpath}" ]; then + fn_info_game_json "configip" ".ServerSettings.ServerIP" + fn_info_game_json "maxplayers" ".ServerSettings.MaxPlayerCount" + fn_info_game_json "port" ".ServerSettings.ServerGamePort" + fn_info_game_json "rconpassword" ".ServerSettings.RCONPassword" + fn_info_game_json "servername" ".ServerSettings.ServerName" + fn_info_game_json "serverpassword" ".ServerSettings.ServerPassword" + fn_info_game_json "steamport" ".ServerSettings.ServerSteamPort" + fi + configip="${configip:-"0.0.0.0"}" + maxplayers="${maxplayers:-"0"}" + port="${port:-"0"}" + queryport="${port:-"0"}" + rcpassword="${rconpassword:-"NOT SET"}" + servername="${servername:-"NOT SET"}" + serverpassword="${serverpassword:-"NOT SET"}" + steamport="${steamport:-"0"}" +} - # Not set - adminpassword=${adminpassword:-"NOT SET"} - rconport=${rconport:-"0"} - servername=${servername:-"NOT SET"} - serverpassword=${serverpassword:-"NOT SET"} +# Config Type: SQF +# Parameters: true +# Comment: // or /* */ +# Example: serverName = "SERVERNAME"; +# Filetype: cfg +fn_info_game_dayz() { + if [ -f "${servercfgfullpath}" ]; then + fn_info_game_sqf "adminpassword" "passwordAdmin" + fn_info_game_sqf "maxplayers" "maxPlayers" + fn_info_game_sqf "queryport" "steamQueryPort" + fn_info_game_sqf "servername" "hostname" + fn_info_game_sqf "serverpassword" "password" + fi + adminpassword="${adminpassword:-"NOT SET"}" + battleeyeport="$((port + 4))" + maxplayers="${maxplayers:-"0"}" + port="${port:-"0"}" + queryport="${queryport:-"0"}" + servername="${servername:-"NOT SET"}" + serverpassword="${serverpassword:-"NOT SET"}" + steamport="$((port + 2))" +} + +# Config Type: json +# Parameters: false +# Comment: // or /* */ +# Example: "Description": "SERVERNAME" +# Filetype: json +fn_info_game_eco() { + if [ -f "${servercfgfullpath}" ]; then + fn_info_game_json "configip" ".IPAddress" + fn_info_game_json "httpport" ".WebServerPort" + fn_info_game_json "maxplayers" ".MaxConnections" + fn_info_game_json "port" ".GameServerPort" + fn_info_game_json "servername" ".Description" + fn_info_game_json "serverpassword" ".Password" + fn_info_game_json "tickrate" ".Rate" + fi + configip="${configip:-"0.0.0.0"}" + httpport="${httpport:-"0"}" + maxplayers="${maxplayers:-"0"}" + port="${port:-"0"}" + servername="${servername:-"NOT SET"}" + serverpassword="${serverpassword:-"NOT SET"}" + tickrate="${tickrate:-"0"}" +} + +# Config Type: QuakeC +# Parameters: true +# Comment: // or /* */ +# Example: set sv_hostname "SERVERNAME" +# Filetype: cfg +fn_info_game_etl() { + if [ -f "${servercfgfullpath}" ]; then + fn_info_game_quakec "configip" "net_ip" + fn_info_game_quakec "maxplayers" "sv_maxclients" + fn_info_game_quakec "port" "net_port" + fn_info_game_quakec "rconpassword" "rconpassword" + fn_info_game_quakec "servername" "sv_hostname" + fn_info_game_quakec "serverpassword" "g_password" + fi + configip="${configip:-"0.0.0.0"}" + maxplayers="${maxplayers:-"0"}" + port="${port:-"0"}" + rconpassword="${rconpassword:-"NOT SET"}" + servername="${servername:-"NOT SET"}" + serverpassword="${serverpassword:-"NOT SET"}" +} + +# Config Type: json +# Parameters: true +# Comment: // or /* */ +# Example: "name": "SERVERNAME" +# Filetype: json +fn_info_game_fctr() { + if [ -f "${servercfgfullpath}" ]; then + fn_info_game_json "authtoken" ".token" + fn_info_game_json "maxplayers" ".max_players" + fn_info_game_json "savegameinterval" ".autosave_interval" + fn_info_game_json "servername" ".name" + fn_info_game_json "serverpassword" ".game_password" + fn_info_game_json "versioncount" ".autosave_slots" + fi + authtoken="${authtoken:-"NOT SET"}" + maxplayers="${maxplayers:-"0"}" + port="${port:-"0"}" + rconpassword="${rconpassword:-"NOT SET"}" + rconport="${rconport:-"0"}" + savegameinterval="${savegameinterval:-"0"}" + servername="${servername:-"NOT SET"}" + serverpassword="${serverpassword:-"NOT SET"}" + versioncount="${versioncount:-"0"}" + + # get server version if installed. + local factoriobin="${executabledir}${executable:1}" + if [ -f "${factoriobin}" ]; then + serverversion="$(${factoriobin} --version | grep "Version:" | awk '{print $2}')" fi +} - # Parameters - defaultmap=${defaultmap:-"NOT SET"} - port=${port:-"0"} - queryport=${queryport:-"0"} +# Config Type: parameters (json possibly supported) +# Parameters: true +# Comment: +# Example: -serverName="SERVERNAME" +# Filetype: parameters +fn_info_game_hw() { + servername="${servername:-"NOT SET"}" + port="${port:-"0"}" + queryport="${queryport:-"0"}" + maxplayers="${maxplayers:-"0"}" + defaultmap="${defaultmap:-"NOT SET"}" + creativemode="${creativemode:-"NOT SET"}" +} + +# Config Type: parameters +# Parameters: true +# Comment: +# Example: -hostname='SERVERNAME' +# Filetype: parameters +fn_info_game_inss() { + port="${port:-"0"}" + queryport="${queryport:-"0"}" + rconport="${rconport:-"0"}" + servername="${servername:-"NOT SET"}" + serverpassword="${serverpassword:-"NOT SET"}" + defaultmap="${defaultmap:-"NOT SET"}" + defaultscenario="${defaultscenario:-"NOT SET"}" + maxplayers="${maxplayers:-"0"}" +} + +# Config Type: lua (Custom) +# Parameters: false +# Comment: -- +# Example: Name = "SERVERNAME", +# Filetype: lua +fn_info_game_jc2() { + if [ -f "${servercfgfullpath}" ]; then + fn_info_game_lua "configip" "BindIP" + fn_info_game_lua "maxplayers" "MaxPlayers" + fn_info_game_lua "port" "BindPort" + fn_info_game_lua "serverdescription" "Description" + fn_info_game_lua "servername" "Name" + fn_info_game_lua "serverpassword" "Password" + fi + configip="${configip:-"0.0.0.0"}" + maxplayers="${maxplayers:-"0"}" + queryport="${port}" + queryport="${queryport:-"0"}" + serverdescription="${serverdescription:-"NOT SET"}" + servername="${servername:-"NOT SET"}" + serverpassword="${serverpassword:-"NOT SET"}" +} + +# Config Type: json +# Parameters: false +# Comment: // or /* */ +# Example: "name": "SERVERNAME" +# Filetype: json +fn_info_game_jc3() { + if [ -f "${servercfgfullpath}" ]; then + fn_info_game_json "configip" ".host" + fn_info_game_json "httpport" ".httpPort" + fn_info_game_json "maxplayers" ".maxPlayers" + fn_info_game_json "port" ".port" + fn_info_game_json "queryport" ".queryPort" + fn_info_game_json "serverdescription" ".description" + fn_info_game_json "servername" ".name" + fn_info_game_json "serverpassword" ".password" + fn_info_game_json "steamport" ".steamPort" + fn_info_game_json "tickrate" ".maxTickRate" + fi + configip="${configip:-"0.0.0.0"}" + httpport="${httpport:-"0"}" + maxplayers="${maxplayers:-"0"}" + port="${port:-"0"}" + queryport="${queryport:-"0"}" + serverdescription="${serverdescription:-"NOT SET"}" + servername="${servername:-"NOT SET"}" + serverpassword="${serverpassword:-"NOT SET"}" + steamport="${steamport:-"0"}" + tickrate="${tickrate:-"0"}" +} + +# Config Type: QuakeC +# Parameters: true +# Comment: // or /* */ +# Example: set sv_hostname "SERVERNAME" +# Filetype: cfg +fn_info_game_jk2() { + if [ -f "${servercfgfullpath}" ]; then + fn_info_game_quakec "maxplayers" "sv_maxclients" + fn_info_game_quakec "rconpassword" "rconpassword" + fn_info_game_quakec "servername" "sv_hostname" + fn_info_game_quakec "serverpassword" "g_password" + fn_info_game_quakec "serverversion" "mv_serverversion" + fi + defaultmap="${defaultmap:-"NOT SET"}" + maxplayers="${maxplayers:-"0"}" + port="${port:-"0"}" + queryport="${port}" + rconpassword="${rconpassword:-"NOT SET"}" + servername="${servername:-"NOT SET"}" + serverpassword="${serverpassword:-"NOT SET"}" + serverversion="${serverversion:-"NOT SET"}" +} + +# Config Type: unknown +fn_info_game_lo() { + servername="${servername:-"NOT SET"}" + port="${port:-"0"}" + queryport="${queryport:-"0"}" + maxplayers="${slots:-"0"}" } -fn_info_game_cod() { - # Config - if [ ! -f "${servercfgfullpath}" ]; then - servername="${unavailable}" - rconpassword="${unavailable}" - else - servername=$(grep "sv_hostname " "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set sv_hostname //g' | tr -d '=\";,:' | xargs) - rconpassword=$(grep "rconpassword" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set rconpassword //g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - - # Not set - servername=${servername:-"NOT SET"} - rconpassword=${rconpassword=:-"NOT SET"} - fi - - # Parameters - defaultmap=${defaultmap:-"NOT SET"} - maxplayers=${maxplayers:-"0"} - port=${port:-"0"} -} - -fn_info_game_coduo() { - # Config - if [ ! -f "${servercfgfullpath}" ]; then - servername="${unavailable}" - rconpassword="${unavailable}" - else - servername=$(grep "sv_hostname " "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set sv_hostname //g' | tr -d '=\";,:' | xargs) - rconpassword=$(grep "rconpassword" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set rconpassword //g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - - # Not set - servername=${servername:-"NOT SET"} - rconpassword=${rconpassword=:-"NOT SET"} - fi - - # Parameters - defaultmap=${defaultmap:-"NOT SET"} - maxplayers=${maxplayers:-"0"} - port=${port:-"0"} - queryport=${port:-"28960"} -} - -fn_info_game_cod2() { - # Config - if [ ! -f "${servercfgfullpath}" ]; then - servername="${unavailable}" - rconpassword="${unavailable}" - else - servername=$(grep "sv_hostname " "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set sv_hostname //g' | tr -d '=\";,:' | xargs) - rconpassword=$(grep "rconpassword" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set rconpassword //g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - - # Not set - servername=${servername:-"NOT SET"} - rconpassword=${rconpassword=:-"NOT SET"} - fi - - # Parameters - defaultmap=${defaultmap:-"NOT SET"} - maxplayers=${maxplayers:-"0"} - port=${port:-"0"} - queryport=${port:-"28960"} -} - -fn_info_game_cod4() { - # Config - if [ ! -f "${servercfgfullpath}" ]; then - servername="${unavailable}" - rconpassword="${unavailable}" - else - servername=$(sed -nr 's/^set\s*sv_hostname\s*"(.*)".*/\1/p' "${servercfgfullpath}") - rconpassword=$(sed -nr 's/^set\s*rcon_password\s*"(.*)"\s*\/.*/\1/p' "${servercfgfullpath}") - queryport=${port:-"28960"} - - # Not set - servername=${servername:-"NOT SET"} - rconpassword=${rconpassword=:-"NOT SET"} - queryport=${queryport:-"28960"} - fi - - # Parameters - defaultmap=${defaultmap:-"NOT SET"} - maxplayers=${maxplayers:-"0"} - port=${port:-"0"} - queryport=${port:-"28960"} -} - -fn_info_game_codwaw() { - # Config - if [ ! -f "${servercfgfullpath}" ]; then - servername="${unavailable}" - rconpassword="${unavailable}" - else - servername=$(grep "sv_hostname " "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set sv_hostname //g' | tr -d '=\";,:' | xargs) - rconpassword=$(grep "rconpassword" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set rconpassword //g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - - # Not set - servername=${servername:-"NOT SET"} - rconpassword=${rconpassword=:-"NOT SET"} - fi - - # Parameters - defaultmap=${defaultmap:-"NOT SET"} - maxplayers=${maxplayers:-"0"} - port=${port:-"0"} - queryport=${port:-"28960"} -} - -fn_info_game_col() { - # Config - if [ ! -f "${servercfgfullpath}" ]; then - servername="${unavailable}" - serverpassword="${unavailable}" - maxplayers="${unavailable}" - port="${zero}" - queryport="${zero}" - steamport="${zero}" - rconpassword="${unavailable}" - else - servername=$(jq -r '.ServerSettings.ServerName' "${servercfgfullpath}") - serverpassword=$(jq -r '.ServerSettings.ServerPassword' "${servercfgfullpath}") - maxplayers=$(jq -r '.ServerSettings.MaxPlayerCount' "${servercfgfullpath}") - port=$(jq -r '.ServerSettings.ServerGamePort' "${servercfgfullpath}") - queryport=${port:-"0"} - steamport=$(jq -r '.ServerSettings.ServerSteamPort' "${servercfgfullpath}") - rconpassword=$(jq -r '.ServerSettings.RCONPassword' "${servercfgfullpath}") - configip=$(jq -r '.ServerSettings.ServerIP' "${servercfgfullpath}") - - # Not set - servername=${servername:-"NOT SET"} - serverpassword=${serverpassword:-"NOT SET"} - maxplayers=${maxplayers:-"0"} - port=${port:-"27004"} - queryport=${queryport:-"0"} - steamport=${steamport:-"27005"} - rconpassword=${rconpassword:-"NOT SET"} - configip=${configip:-"0.0.0.0"} - fi -} - -fn_info_game_dodr() { - # Config - if [ ! -f "${servercfgfullpath}" ]; then - maxplayers="${zero}" - else - maxplayers=$(sed -nr 's/^iServerMaxPlayers=(.*)$/\1/p' "${servercfgfullpath}") - - # Not set - maxplayers=${maxplayers:-"0"} - fi - - # Parameters - servername=${servername:-"NOT SET"} - port=${port:-"7777"} - queryport=${queryport:-"27015"} -} - -fn_info_game_dayz() { - # Config - if [ ! -f "${servercfgfullpath}" ]; then - servername="${unavailable}" - adminpassword="${unavailable}" - serverpassword="${unavailable}" - maxplayers="${zero}" - 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}") - queryport=$(sed -nr 's/^steamQueryPort\s*=\s*([0-9]+)\s*;/\1/p' "${servercfgfullpath}") - - # Not Set - servername=${servername:-"NOT SET"} - adminpassword=${adminpassword:-"NOT SET"} - serverpassword=${serverpassword:-"NOT SET"} - maxplayers=${maxplayers:-"0"} - queryport=${queryport:-"27016"} - fi - - # Parameters - port=${port:-"2302"} - steammasterport=$((port + 2)) - battleeyeport=$((port + 4)) -} - -fn_info_game_dst() { - # Config - if [ ! -f "${clustercfgfullpath}" ]; then - servername="${unavailable}" - serverpassword="${unavailable}" - maxplayers="${zero}" - gamemode="${unavailable}" - tickrate="${zero}" - masterport="${zero}" - else - servername=$(grep "cluster_name" "${clustercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/cluster_name//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - serverpassword=$(grep "cluster_password" "${clustercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/cluster_password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - maxplayers=$(grep "max_players" "${clustercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') - gamemode=$(grep "game_mode" "${clustercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/game_mode//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - tickrate=$(grep "tick_rate" "${clustercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') - masterport=$(grep "master_port" "${clustercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') - configip=$(grep "bind_ip" "${clustercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/bind_ip//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - - # Not set - servername=${servername:-"NOT SET"} - serverpassword=${serverpassword:-"NOT SET"} - maxplayers=${maxplayers:-"0"} - gamemode=${gamemode:-"NOT SET"} - tickrate=${tickrate:-"0"} - masterport=${masterport:-"0"} - configip=${configip:-"0.0.0.0"} - fi - - if [ ! -f "${servercfgfullpath}" ]; then - port="${zero}" - steamauthport="${zero}" - steammasterport="${zero}" - else - port=$(grep "server_port" "${servercfgfullpath}" | grep "^server_port" | grep -v "#" | tr -cd '[:digit:]') - steamauthport=$(grep "authentication_port" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') - steammasterport=$(grep "master_server_port" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') - - # Not set - port=${port:-"0"} - steamauthport=${steamauthport:-"0"} - steammasterport=${steammasterport:-"0"} - fi - - # Parameters - sharding=${sharding:-"NOT SET"} - master=${master:-"NOT SET"} - shard=${shard:-"NOT SET"} - cluster=${cluster:-"NOT SET"} - cave=${cave:-"NOT SET"} -} - -fn_info_game_eco() { - # Config - if [ ! -f "${servercfgfullpath}" ]; then - servername="${unavailable}" - serverpassword="${unavailable}" - maxplayers="${zero}" - tickrate="${zero}" - port="${zero}" - webadminport="${zero}" - else - configip=$(jq -r '.IPAddress' "${servercfgfullpath}") - servername=$(jq -r '.Description' "${servercfgfullpath}") - serverpassword=$(jq -r '.Password' "${servercfgfullpath}") - maxplayers=$(jq -r '.MaxConnections' "${servercfgfullpath}") - tickrate=$(jq -r '.Rate' "${servercfgfullpath}") - port=$(jq -r '.GameServerPort' "${servercfgfullpath}") - webadminport=$(jq -r '.WebServerPort' "${servercfgfullpath}") - - # Not set - configip=${configip:-"0.0.0.0"} - servername=${servername:-"NOT SET"} - serverpassword=${serverpassword:-"NOT SET"} - maxplayers=${maxplayers=:-"0"} - tickrate=${tickrate=:-"0"} - port=${port=:-"0"} - webadminport=${webadminport=:-"0"} - fi -} - -fn_info_game_etl() { - # Config - if [ ! -f "${servercfgfullpath}" ]; then - rconpassword="${unavailable}" - servername="${unavailable}" - serverpassword="${unavailable}" - maxplayers="${zero}" - port="${zero}" - queryport="${zero}" - else - port=$(grep "set net_port" "${servercfgfullpath}" | grep -v "//" | tr -cd '[:digit:]') - queryport="${port}" - rconpassword=$(grep "set rconpassword" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set rconpassword //g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//g' -e '/^\//d' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - servername=$(grep "set sv_hostname" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set sv_hostname //g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - serverpassword=$(grep "set g_password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set g_password //g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - maxplayers=$(grep "set sv_maxclients" "${servercfgfullpath}" | grep -v "//" | tr -cd '[:digit:]') - configip=$(grep "set net_ip" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set net_ip//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - - # Not set - rconpassword=${rconpassword:-"NOT SET"} - servername=${servername:-"NOT SET"} - serverpassword=${serverpassword:-"NOT SET"} - maxplayers=${maxplayers:-"0"} - port=${port:-"27960"} - queryport=${queryport:-"27960"} - configip=${configip:-"0.0.0.0"} - fi -} - -fn_info_game_fctr() { - # Config - if [ ! -f "${servercfgfullpath}" ]; then - servername="Factorio Server" - serverpassword="${unavailable}" - maxplayers="${zero}" - authtoken="${unavailable}" - savegameinterval="${unavailable}" - versioncount="${unavailable}" - else - servername=$(jq -r '.name' "${servercfgfullpath}") - serverpassword=$(jq -r '.game_password' "${servercfgfullpath}") - maxplayers=$(jq -r '.max_players' "${servercfgfullpath}") - authtoken=$(jq -r '.token' "${servercfgfullpath}") - savegameinterval=$(jq -r '.autosave_interval' "${servercfgfullpath}") - versioncount=$(jq -r '.autosave_slots' "${servercfgfullpath}") - - # Not set - servername=${servername:-"NOT SET"} - serverpassword=${serverpassword:-"NOT SET"} - maxplayers=${maxplayers:-"0"} - authtoken=${authtoken:-"NOT SET"} - savegameinterval=${savegameinterval:-"0"} - versioncount=${versioncount:-"0"} - fi - - # Parameters - 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() { - # Config - if [ ! -f "${servercfgfullpath}" ]; then - servername="${unavailable}" - serverdescription="${unavailable}" - serverpassword="${unavailable}" - maxplayers="${zero}" - port="${zero}" - queryport="${zero}" - else - servername=$(grep "Name" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^--/d' -e 's/Name//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - serverdescription=$(grep "Description" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^--/d' -e 's/Description//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - serverpassword=$(grep "Password" "${servercfgfullpath}" | sed -e 's/^ *//g' -e '/^--/d' -e 's/Password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - maxplayers=$(grep "MaxPlayers" "${servercfgfullpath}" | grep -v "\--" | tr -cd '[:digit:]') - port=$(grep "BindPort" "${servercfgfullpath}" | grep -v "\--" | tr -cd '[:digit:]') - queryport="${port}" - configip=$(grep "BindIP" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^--/d' -e 's/BindIP//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - - # Not set - servername=${servername:-"NOT SET"} - serverpassword=${serverpassword:-"NOT SET"} - serverdescription=${serverdescription:-"NOT SET"} - maxplayers=${maxplayers:-"0"} - port=${port:-"0"} - queryport=${queryport:-"0"} - configip=${configip:-"0.0.0.0"} - fi -} - -fn_info_game_hw() { - # Parameters - servername=${servername:-"NOT SET"} - port=${port:-"0"} - queryport=${queryport:-"0"} - maxplayers=${maxplayers:-"0"} - defaultmap=${defaultmap:-"NOT SET"} - creativemode=${creativemode:-"NOT SET"} -} - -fn_info_game_inss() { - # Parameters - port=${port:-"0"} - queryport=${queryport:-"0"} - rconport=${rconport:-"0"} - servername=${servername:-"NOT SET"} - serverpassword=${serverpassword:-"NOT SET"} - defaultmap=${defaultmap:-"NOT SET"} - defaultscenario=${defaultscenario:-"NOT SET"} - maxplayers=${maxplayers:-"0"} -} - -fn_info_game_jc3() { - # Config - if [ ! -f "${servercfgfullpath}" ]; then - servername="${unavailable}" - serverdescription="${unavailable}" - serverpassword="${unavailable}" - maxplayers="${zero}" - port="${zero}" - queryPort="${zero}" - steamport="${zero}" - httpport="${zero}" - tickrate="${zero}" - else - servername=$(grep "name" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/name//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - serverdescription=$(grep "description" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/description//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - serverpassword=$(grep "password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - maxplayers=$(grep "\"maxPlayers\"" "${servercfgfullpath}" | tr -cd '[:digit:]') - port=$(grep "\"port\"" "${servercfgfullpath}" | tr -cd '[:digit:]') - queryport=$(grep "\"queryPort\"" "${servercfgfullpath}" | tr -cd '[:digit:]') - steamport=$(grep "\"steamPort\"" "${servercfgfullpath}" | tr -cd '[:digit:]') - httpport=$(grep "\"httpPort\"" "${servercfgfullpath}" | tr -cd '[:digit:]') - tickrate=$(grep "\"maxTickRate\"" "${servercfgfullpath}" | tr -cd '[:digit:]') - configip=$(grep "host" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/host//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - - # Not set - servername=${servername:-"NOT SET"} - serverdescription=${serverdescription:-"NOT SET"} - serverpassword=${serverpassword:-"NOT SET"} - maxplayers=${maxplayers=:-"0"} - port=${port=:-"0"} - queryport=${queryport=:-"0"} - steamport=${steamport=:-"0"} - httpport=${httpport=:-"0"} - tickrate=${tickrate=:-"0"} - configip=${configip:-"0.0.0.0"} - fi -} - -fn_info_game_jk2() { - # Config - if [ ! -f "${servercfgfullpath}" ]; then - rconpassword="${unavailable}" - servername="${unavailable}" - serverpassword="${unavailable}" - maxplayers="${zero}" - serverversion="${unavailable}" - else - rconpassword=$(grep "seta rconpassword" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/seta rconpassword//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - servername=$(grep "seta sv_hostname" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/seta sv_hostname//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - serverpassword=$(grep "seta g_password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/seta g_password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - maxplayers=$(grep "seta sv_maxclients" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') - serverversion=$(grep "seta mv_serverversion" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/seta mv_serverversion//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - - # Not set - rconpassword=${rconpassword:-"NOT SET"} - servername=${servername:-"NOT SET"} - serverpassword=${serverpassword:-"NOT SET"} - maxplayers=${maxplayers:-"0"} - serverversion=${serverversion:-"NOT SET"} - fi - - # Parameters - port=${port:-"0"} - queryport=${port} - defaultmap=${defaultmap:-"NOT SET"} -} - -fn_info_game_kf() { - # Config - if [ ! -f "${servercfgfullpath}" ]; then - servername="${unavailable}" - serverpassword="${unavailable}" - adminpassword="${unavailable}" - port="${zero}" - queryport="${zero}" - queryportgs="${zero}" - steamport="${zero}" - steammasterport="${zero}" - lanport="${zero}" - httpport="${zero}" - webadminenabled="${unavailable}" - webadminuser="${unavailable}" - webadminpass="${unavailable}" - else - servername=$(sed -nr 's/^ServerName=(.*)$/\1/p' "${servercfgfullpath}" | tr -d '=\";,:' | sed 's/\r$//') - serverpassword=$(sed -nr 's/^GamePassword=(.*)$/\1/p' "${servercfgfullpath}" | tr -d '=\";,:' | sed 's/\r$//') - adminpassword=$(sed -nr 's/^AdminPassword=(.*)$/\1/p' "${servercfgfullpath}" | tr -d '=\";,:' | sed 's/\r$//') - port=$(sed -nr 's/^Port=(.*)$/\1/p' "${servercfgfullpath}" | tr -cd '[:digit:]') - queryport=$((port + 1)) - queryportgs=$(sed -nr 's/^OldQueryPortNumber=(.*)$/\1/p' "${servercfgfullpath}" | tr -cd '[:digit:]') - steamport="20560" - steammasterport="28852" - lanport=$(grep "LANServerPort=" "${servercfgfullpath}" | tr -cd '[:digit:]') - httpport=$(sed -nr 's/^ListenPort=(.*)$/\1/p' "${servercfgfullpath}" | tr -cd '[:digit:]') - webadminenabled=$(sed -nr 's/^bEnabled=(.*)$/\1/p' "${servercfgfullpath}" | tr -d '=\";,:' | sed 's/\r$//') - webadminuser=$(sed -nr 's/^AdminName=(.*)$/\1/p' "${servercfgfullpath}" | tr -d '=\";,:' | sed 's/\r$//') - webadminpass="${adminpassword}" - - # Not set - servername=${servername:-"NOT SET"} - serverpassword=${serverpassword:-"NOT SET"} - adminpassword=${adminpassword:-"NOT SET"} - port=${port:-"0"} - queryport=${queryport:-"0"} - queryportgs=${queryportgs:-"0"} - steamport=${steamport:-"0"} - steammasterport=${steammasterport:-"0"} - lanport=${lanport:-"0"} - httpport=${httpport:-"0"} - webadminenabled=${webadminenabled:-"NOT SET"} - webadminuser=${webadminuser:-"NOT SET"} - webadminpass=${webadminpass:-"NOT SET"} - fi - - # Parameters - defaultmap=${defaultmap:-"NOT SET"} -} - -fn_info_game_kf2() { - # Config - if [ ! -f "${servercfgfullpath}" ]; then - servername="${unavailable}" - serverpassword="${unavailable}" - adminpassword="${unavailable}" - port=${zero} - queryport=${zero} - webadminenabled="${unavailable}" - httpport="${zero}" - webadminuser="${unavailable}" - webadminpass="${unavailable}" - else - servername=$(grep "ServerName" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/ServerName//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - serverpassword=$(grep "GamePassword" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/GamePassword//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - adminpassword=$(grep "AdminPassword" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/AdminPassword//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - port=$(grep "Port" "${servercfgdir}/LinuxServer-KFEngine.ini" | sed -e 's/^[ \t]*//g' | grep "^Port" | grep -v "#" | tr -cd '[:digit:]') - webadminenabled=$(grep "bEnabled" "${servercfgdir}/KFWeb.ini" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/bEnabled//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - httpport=$(grep "ListenPort" "${servercfgdir}/KFWeb.ini" | grep -v "#" | tr -cd '[:digit:]') - webadminuser="Admin" - webadminpass=$(grep "AdminPassword" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/AdminPassword//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - - # Not set - servername=${servername:-"NOT SET"} - serverpassword=${serverpassword:-"NOT SET"} - adminpassword=${adminpassword:-"NOT SET"} - port=${port:-"0"} - webadminenabled=${webadminenabled:-"NOT SET"} - httpport=${webadminport:-"0"} - webadminuser=${webadminuser:-"NOT SET"} - webadminpass=${webadminpass:-"NOT SET"} - fi - - # Parameters - queryport=${queryport:-"0"} - defaultmap=${defaultmap:-"NOT SET"} -} - -fn_info_game_lo() { - # Parameters - servername=${servername:-"NOT SET"} - port=${port:-"0"} - queryport=${queryport:-"0"} - maxplayers=${slots:-"0"} -} - -fn_info_game_mc() { - # Config - if [ ! -f "${servercfgfullpath}" ]; then - servername="${unavailable}" - rconpassword="${unavailable}" - rconport="${zero}" - maxplayers="${zero}" - port="${zero}" - queryport="${zero}" - queryenabled="${unavailable}" - gamemode="${unavailable}" - gameworld="${unavailable}" - else - servername=$(grep "motd" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/motd//g' | tr -d '=\";,:' | sed 's/\\u00A70//g;s/\\u00A71//g;s/\\u00A72//g;s/\\u00A73//g;s/\\u00A74//g;s/\\u00A75//g;s/\\u00A76//g;s/\\u00A77//g;s/\\u00A78//g;s/\\u00A79//g;s/\\u00A7a//g;s/\\u00A7b//g;s/\\u00A7c//g;s/\\u00A7d//g;s/\\u00A7e//g;s/\\u00A7f//g;s/\\u00A7l//g;s/\\u00A7o//g;s/\\u00A7n//g;s/\\u00A7m//g;s/\\u00A7k//g' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - rconpassword=$(grep "rcon.password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/rcon.password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - rconport=$(grep "rcon.port" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') - maxplayers=$(grep "max-players" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') - port=$(grep "server-port" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') - queryport=$(grep "query.port" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') - if [ -z "${queryport}" ]; then - queryport=${port} - fi - queryenabled=$(grep "enable-query" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/enable-query//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - gamemode=$(grep "gamemode" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') - gameworld=$(grep "level-name" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/level-name//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - configip=$(grep "server-ip" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^--/d' -e 's/server-ip//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - - # Not set - servername=${servername:-"NOT SET"} - rconpassword=${rconpassword:-"NOT SET"} - rconport=${rconport:-"NOT SET"} - maxplayers=${maxplayers:-"0"} - port=${port:-"NOT SET"} - queryport=${queryport:-"NOT SET"} - queryenabled="${queryenabled:-"NOT SET"}" - gamemode=${gamemode:-"NOT SET"} - gameworld=${gameworld:-"NOT SET"} - configip=${configip:-"0.0.0.0"} - fi -} - -fn_info_game_mcb() { - # Config - if [ ! -f "${servercfgfullpath}" ]; then - servername="${unavailable}" - maxplayers="${zero}" - port="${zero}" - portipv6="${zero}" - queryport="${zero}" - gamemode="${unavailable}" - gameworld="${unavailable}" - else - servername=$(grep "server-name" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/server-name//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - maxplayers=$(grep "max-players" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') - port=$(grep "server-port\b" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') - portipv6=$(grep "server-portv6\b" "${servercfgfullpath}" | sed 's/v6//g' | grep -v "#" | tr -cd '[:digit:]') - queryport=${port} - gamemode=$(grep "gamemode" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/gamemode//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - gameworld=$(grep "level-name" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/level-name//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - - # Not set - servername=${servername:-"NOT SET"} - maxplayers=${maxplayers:-"0"} - port=${port:-"NOT SET"} - portipv6=${portipv6:-"NOT SET"} - queryport=${queryport:-"NOT SET"} - gamemode=${gamemode:-"NOT SET"} - gameworld=${gameworld:-"NOT SET"} - fi -} - -fn_info_game_mh() { - # Config - if [ ! -f "${servercfgfullpath}" ]; then - servername="${unavailable}" - serverpassword="${unavailable}" - rconpassword="${unavailable}" - maxplayers="${unavailable}" - else - servername=$(grep "ServerName" "${servercfgfullpath}" | awk -F '=' '{print $2}') - serverpassword=$(grep "ServerPassword" "${servercfgfullpath}" | awk -F '=' '{print $2}') - rconpassword=$(grep "AdminPassword" "${servercfgfullpath}" | awk -F '=' '{print $2}') - maxplayers=$(grep "MaxSlots" "${servercfgfullpath}" | awk -F '=' '{print $2}') - - # Not set - servername=${servername:-"NOT SET"} - serverpassword=${serverpassword:-"NOT SET"} - rconpassword=${rconpassword:-"NOT SET"} - maxplayers=${maxplayers:-"0"} - fi - - # Parameters - port=${port:-"0"} - queryport=${queryport:-"0"} - beaconport=${beaconport:-"0"} -} - -fn_info_game_mohaa() { - # Config - if [ ! -f "${servercfgfullpath}" ]; then - rconpassword="${unavailable}" - servername="${unavailable}" - serverpassword="${unavailable}" - maxplayers="${zero}" - else - rconpassword=$(grep "rconpassword" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/seta rconpassword//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - servername=$(grep "sv_hostname" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/seta sv_hostname//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - serverpassword=$(grep "g_password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/seta g_password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - maxplayers=$(grep "sv_maxclients" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') - - # Not set - rconpassword=${rconpassword:-"NOT SET"} - servername=${servername:-"NOT SET"} - serverpassword=${serverpassword:-"NOT SET"} - maxplayers=${maxplayers:-"0"} - fi - - # Parameters - port=${port:-"0"} - queryport=${port:-"0"} - defaultmap=${defaultmap:-"NOT SET"} -} - -fn_info_game_mom() { - # Config - if [ ! -f "${servercfgfullpath}" ]; then - servername="${unavailable}" - serverpassword="${unavailable}" - 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]*$//') - serverpassword=$(grep "ServerPassword" "${servercfgfullpath}" | sed -e 's/^ *//g' -e '/^--/d' -e 's/ServerPassword//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - maxplayers=$(grep "MaxPlayers" "${servercfgfullpath}" | sed -e 's/^ *//g' -e '/^--/d' -e 's/MaxPlayers//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - defaultmap=$(grep "MapName" "${servercfgfullpath}" | sed -e 's/^ *//g' -e '/^--/d' -e 's/MapName//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - - # Not set - servername=${servername:-"NOT SET"} - serverpassword=${serverpassword:-"NOT SET"} - maxplayers=${maxplayers:-"0"} - defaultmap=${defaultmap:-"NOT SET"} - fi - - # Parameters - port=${port:-"7777"} - beaconport=${queryport:-"15000"} -} - -fn_info_game_mta() { - # Config - if [ ! -f "${servercfgfullpath}" ]; then - port=${zero} - queryport=${zero} - httpport=${zero} - ase="${unavailable}" - servername="${unavailable}" - serverpassword="${unavailable}" - maxplayers="${zero}" - else - port=$(grep -m 1 "serverport" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's///g' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//' | cut -f1 -d "<" | tr -cd '[:digit:]') - 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 "<") - maxplayers=$(grep -m 1 "maxplayers" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's///g' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//' | cut -f1 -d "<" | tr -cd '[:digit:]') - ase=$(grep -m 1 "ase" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's///g' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//' | cut -f1 -d "<" | tr -cd '[:digit:]') - if [ "${ase}" == "1" ]; then - ase="Enabled" - else - ase="Disabled" - fi - - # Not set - port=${port:-"22003"} - queryport=${queryport:-"2326"} - httpport=${httpport:-"22005"} - ase=${ase:-"Disabled"} - servername=${servername:-"NOT SET"} - serverpassword=${serverpassword:-"NOT SET"} - maxplayers=${maxplayers:-"0"} - 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 - servername="${unavailable}" - maxplayers="${zero}" - port="${zero}" - 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]*$//') - maxplayers=$(grep "maxplayers" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') - port=$(grep "port" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') - httpport=$((port - 2)) - queryport=$((port - 1)) - - # Not set - servername=${servername:-"NOT SET"} - maxplayers=${maxplayers:-"0"} - port=${port:-"NOT SET"} - httpport=${httpport:-"NOT SET"} - queryport=${queryport:-"NOT SET"} - fi -} - -fn_info_game_pc() { - # 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:-"0"} - port=${port:-"NOT SET"} - queryport=${queryport:-"NOT SET"} - steamport=${steamport:-"NOT SET"} - 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:-"0"} - port=${port:-"NOT SET"} - queryport=${queryport:-"NOT SET"} - steamport=${steamport:-"NOT SET"} - fi -} - -fn_info_game_pstbs() { - # Config - if [ ! -f "${servercfgfullpath}" ]; then - servername="${unavailable}" - maxplayers="${unavailable}" - reservedslots="${unavailable}" - else - servername=$(grep "ServerName=" "${servercfgfullpath}" | sed -e 's/^[ \t]//g' -e '/^#/d' -e 's/ServerName//g' | tr -d '=";,:' | sed -e 's/^[ \t]//' -e 's/[ \t]*$//') - maxplayers=$(grep "MaxPlayers=" "${servercfgfullpath}" | tr -cd '[:digit:]') - reservedslots=$(grep "NumReservedSlots=" "${servercfgfullpath}" | tr -cd '[:digit:]') - - # Not set - servername=${servername:-"NOT SET"} - maxplayers=${maxplayers:-"0"} - reservedslots=${reservedslots:-"0"} - fi - - if [ ! -f "${servercfgdir}/Rcon.cfg" ]; then - rconport=${unavailable} - rconpassword=${unavailable} - else - rconport=$(grep "Port=" "${servercfgdir}/Rcon.cfg" | tr -cd '[:digit:]') - rconpassword=$(grep "Password=" "${servercfgdir}/Rcon.cfg" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/Password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - - # Not set - rconport=${rconport:-"0"} - if [ -z "${rconpassword}" ] || [ ${#rconpassword} == 1 ]; then - rconpassword="NOT SET" - fi - fi - - # Parameters - port=${port:-"0"} - if [ -z "${queryport}" ]; then - queryport=${port:-"0"} - fi - rconport=${rconport:-"0"} - randommap=${randommap:-"NOT SET"} - maxplayers=${maxplayers:-"0"} - reservedslots=${reservedslots:-"0"} -} - -fn_info_game_pvr() { - # Config - if [ ! -f "${servercfgfullpath}" ]; then - servername="${unavailable}" - maxplayers="${unavailable}" - else - servername=$(grep "ServerName" "${servercfgfullpath}" | awk -F '=' '{print $2}') - maxplayers=$(grep "MaxPlayers" "${servercfgfullpath}" | awk -F '=' '{print $2}') - - # Not set - servername=${servername:-"NOT SET"} - maxplayers=${maxplayers:-"0"} - fi - - # Parameters - port=${port:-"0"} - port401=$((port + 400)) - queryport=${port:-"0"} -} - -fn_info_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 - servername="${unavailable}" - serverpassword="${unavailable}" - rconpassword="${unavailable}" - maxplayers="${zero}" - port="${zero}" - queryport="${zero}" - gameworld="${unavailable}" - else - servername=$(grep "PublicName" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/PublicName//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - serverpassword=$(grep "Password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' | grep "^Password" | sed -e '/^#/d' -e 's/Password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - rconpassword=$(grep "RCONPassword" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/RCONPassword//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - maxplayers=$(grep "MaxPlayers" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') - port=$(grep "DefaultPort" "${servercfgfullpath}" | tr -cd '[:digit:]') - queryport=${port} - gameworld=$(grep "Map" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' | grep "^Map" | sed -e '/^#/d' -e 's/Map//g' | tr -d '=\";' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - - # Not set - servername=${servername:-"NOT SET"} - serverpassword=${serverpassword:-"NOT SET"} - rconpassword=${rconpassword:-"NOT SET"} - maxplayers=${maxplayers:-"0"} - port=${port:-"0"} - queryport=${queryport:-"0"} - gameworld=${gameworld:-"NOT SET"} - fi - - # Parameters - adminpassword=${adminpassword:-"NOT SET"} - -} - -fn_info_game_q2() { - # Config - if [ ! -f "${servercfgfullpath}" ]; then - rconpassword="${unavailable}" - servername="${unavailable}" - maxplayers="${zero}" - else - rconpassword=$(grep "rcon_password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set rcon_password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - servername=$(grep "hostname" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set hostname//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - maxplayers=$(grep "maxclients" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') - - # Not set - rconpassword=${rconpassword:-"NOT SET"} - servername=${servername:-"NOT SET"} - maxplayers=${maxplayers:-"0"} - fi - - # Parameters - port=${port:-"0"} - queryport=${port} - defaultmap=${defaultmap:-"NOT SET"} -} - -fn_info_game_q3() { - # Config - if [ ! -f "${servercfgfullpath}" ]; then - rconpassword="${unavailable}" - servername="${unavailable}" - serverpassword="${unavailable}" - maxplayers="${zero}" - else - rconpassword=$(grep "zmq_rcon_password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set zmq_rcon_password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - servername=$(grep "sv_hostname" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set sv_hostname//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - serverpassword=$(grep "rconpassword" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set rconpassword//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - maxplayers=$(grep "sv_maxclients" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') - - # Not set - rconpassword=${rconpassword:-"NOT SET"} - servername=${servername:-"NOT SET"} - serverpassword=${serverpassword:-"NOT SET"} - maxplayers=${maxplayers:-"0"} - fi - - # Parameters - port=${port:-"0"} - queryport=${port} - defaultmap=${defaultmap:-"NOT SET"} -} - -fn_info_game_ql() { - # Config - if [ ! -f "${servercfgfullpath}" ]; then - rconpassword="${unavailable}" - servername="${unavailable}" - serverpassword="${unavailable}" - maxplayers="${zero}" - port="${zero}" - queryport="${zero}" - rconport="${zero}" - statsport="${zero}" - else - rconpassword=$(grep "zmq_rcon_password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set zmq_rcon_password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - servername=$(grep "sv_hostname" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set sv_hostname//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - serverpassword=$(grep "g_password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set g_password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - maxplayers=$(grep "sv_maxClients" "${servercfgfullpath}" | grep -v "//" | tr -cd '[:digit:]') - port=$(grep "net_port" "${servercfgfullpath}" | grep -v "//" | tr -cd '[:digit:]') - queryport=${port} - rconport=$(grep "zmq_rcon_port" "${servercfgfullpath}" | grep -v "//" | tr -cd '[:digit:]') - statsport=$(grep "zmq_stats_port" "${servercfgfullpath}" | grep -v "//" | tr -cd '[:digit:]') - configip=$(grep "set net_ip" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set net_ip//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - - # Not set - rconpassword=${rconpassword:-"NOT SET"} - servername=${servername:-"NOT SET"} - serverpassword=${serverpassword:-"NOT SET"} - maxplayers=${maxplayers:-"0"} - port=${port:-"0"} - queryport=${queryport:-"0"} - rconport=${rconport:-"0"} - statsport=${statsport:-"0"} - configip=${configip:-"0.0.0.0"} - fi -} - -fn_info_game_qw() { - # Config - if [ ! -f "${servercfgfullpath}" ]; then - rconpassword="${unavailable}" - servername="${unavailable}" - serverpassword="${unavailable}" - maxplayers="${zero}" - port="${zero}" - else - rconpassword=$(grep "rcon_password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set rcon_password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//' | cut -f1 -d "/") - servername=$(grep "hostname" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set hostname//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//' | cut -f1 -d "/") - maxplayers=$(grep "maxclients" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') - - # Not set - rconpassword=${rconpassword:-"NOT SET"} - servername=${servername:-"NOT SET"} - maxplayers=${maxplayers:-"0"} - fi - - # Parameters - port=${port:-"0"} - queryport=${port} -} - -fn_info_game_ro() { - # Config - if [ ! -f "${servercfgfullpath}" ]; then - servername="${unavailable}" - serverpassword="${unavailable}" - adminpassword="${unavailable}" - port="${zero}" - queryport="${zero}" - steamport="${zero}" - steammasterport="${zero}" - lanport="${zero}" - httpport="${zero}" - webadminenabled="${unavailable}" - webadminuser="${unavailable}" - webadminpass="${unavailable}" - else - servername=$(sed -nr 's/^ServerName=(.*)$/\1/p' "${servercfgfullpath}" | tr -d '=\";,:' | sed 's/\r$//') - serverpassword=$(sed -nr 's/^GamePassword=(.*)$/\1/p' "${servercfgfullpath}" | tr -d '=\";,:' | sed 's/\r$//') - adminpassword=$(sed -nr 's/^AdminPassword=(.*)$/\1/p' "${servercfgfullpath}" | tr -d '=\";,:' | sed 's/\r$//') - port=$(sed -nr 's/^Port=(.*)$/\1/p' "${servercfgfullpath}" | tr -cd '[:digit:]') - queryport=$((port + 1)) - steamport="20610" - steammasterport="28902" - lanport=$(grep "LANServerPort=" "${servercfgfullpath}" | tr -cd '[:digit:]') - httpport=$(sed -nr 's/^ListenPort=(.*)$/\1/p' "${servercfgfullpath}" | tr -cd '[:digit:]') - webadminenabled=$(sed -nr 's/^bEnabled=(.*)$/\1/p' "${servercfgfullpath}" | tr -d '=\";,:' | sed 's/\r$//') - webadminuser=$(sed -nr 's/^AdminName=(.*)$/\1/p' "${servercfgfullpath}" | tr -d '=\";,:' | sed 's/\r$//') - webadminpass="${adminpassword}" - - # Not set - servername=${servername:-"NOT SET"} - serverpassword=${serverpassword:-"NOT SET"} - adminpassword=${adminpassword:-"NOT SET"} - port=${port:-"0"} - queryport=${queryport:-"0"} - steamport=${steamport:-"0"} - steammasterport=${steammasterport:-"0"} - lanport=${lanport:-"0"} - httpport=${httpport:-"0"} - webadminenabled=${webadminenabled:-"NOT SET"} - webadminuser=${webadminuser:-"NOT SET"} - webadminpass=${webadminpass:-"NOT SET"} - fi - - # Parameters - defaultmap=${defaultmap:-"NOT SET"} -} - -fn_info_game_rtcw() { - # Config - if [ ! -f "${servercfgfullpath}" ]; then - rconpassword="${unavailable}" - servername="${unavailable}" - serverpassword="${unavailable}" - maxplayers="${zero}" - else - rconpassword=$(grep "rconpassword" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set rconpassword//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - servername=$(grep "sv_hostname" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set sv_hostname//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - serverpassword=$(grep "g_password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set g_password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - maxplayers=$(grep "sv_maxclients" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') - - # Not set - rconpassword=${rconpassword:-"NOT SET"} - servername=${servername:-"NOT SET"} - serverpassword=${serverpassword:-"NOT SET"} - maxplayers=${maxplayers:-"0"} - fi - - # Parameters - port=${port:-"0"} - queryport=${port:-"0"} - defaultmap=${defaultmap:-"NOT SET"} -} - -fn_info_game_rust() { - # Parameters - servername=${servername:-"NOT SET"} - port=${port:-"0"} - queryport=${queryport:-"0"} - appport=${appport:-"0"} - rconport=${rconport:-"0"} - gamemode=${gamemode:-"NOT SET"} - maxplayers=${maxplayers:-"0"} - rconpassword=${rconpassword:-"NOT SET"} - rconweb=${rconweb:-"NOT SET"} - tickrate=${tickrate:-"0"} - saveinterval=${saveinterval:-"0"} - serverlevel=${serverlevel:-"NOT SET"} - customlevelurl=${customlevelurl:-"NOT SET"} - worldsize=${worldsize:-"0"} - if [ -n "${seed}" ]; then - seed=${seed:-"0"} - elif [ -f "${datadir}/${selfname}-seed.txt" ]; then - seed=$(cat "${datadir}/${selfname}-seed.txt") - else - seed="0" - fi - salt=${salt:-"0"} -} - -fn_info_game_rw() { - # Config - if [ ! -f "${servercfgfullpath}" ]; then - servername="${unavailable}" - serverpassword="${unavailable}" - rconpassword="${unavailable}" - rconport="${zero}" - maxplayers="${zero}" - port="${zero}" - port2="${zero}" - port3="${zero}" - port4="${zero}" - queryport="${zero}" - gamemode="${unavailable}" - gameworld="${unavailable}" - else - servername=$(grep "server_name" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/server_name//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - serverpassword=$(grep "server_password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/server_password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - rconpassword=$(grep "rcon_password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/rcon_password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - rconport=$(grep "rcon_port" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') - maxplayers=$(grep "settings_max_players" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') - port=$(grep "server_port" "${servercfgfullpath}" | grep -v "database_mysql_server_port" | grep -v "#" | tr -cd '[:digit:]') - 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]*$//') - 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]*$//') - - # Not set - servername=${servername:-"NOT SET"} - serverpassword=${serverpassword:-"NOT SET"} - rconpassword=${rconpassword:-"NOT SET"} - rconport=${rconport:-"NOT SET"} - maxplayers=${maxplayers:-"0"} - port=${port:-"0"} - port2=${port2:-"0"} - port3=${port3:-"0"} - port4=${port4:-"0"} - queryport=${queryport:-"0"} - httpqueryport=${httpport:-"0"} - gamemode=${gamemode:-"NOT SET"} - gameworld=${gameworld:-"NOT SET"} - configip=${configip:-"0.0.0.0"} - fi -} - -fn_info_game_samp() { - # Config - if [ ! -f "${servercfgfullpath}" ]; then - servername="unnamed server" - rconpassword="${unavailable}" - port="7777" - rconport="${port}" - maxplayers="50" - else - servername=$(grep "hostname" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/hostname//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - rconpassword=$(grep "rcon_password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/^rcon_password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - port=$(grep "port" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') - queryport=${port} - rconport=${port} - maxplayers=$(grep "maxplayers" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') - - # Not set - servername=${servername:-"NOT SET"} - rconpassword=${rconpassword:-"NOT SET"} - port=${port:-"7777"} - queryport=${port:-"7777"} - rconport=${rconport:-"7777"} - maxplayers=${maxplayers:-"12"} - fi -} - -fn_info_game_sb() { - # Config - if [ ! -f "${servercfgfullpath}" ]; then - servername="${unavailable}" - queryenabled="${unavailable}" - rconenabled="${unavailable}" - rconpassword="${unavailable}" - port="21025" - queryport="21025" - rconport="21026" - maxplayers="8" - else - servername=$(grep "serverName" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e 's/serverName//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - queryenabled=$(grep "runQueryServer" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e 's/runQueryServer//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - rconenabled=$(grep "runRconServer" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e 's/runRconServer//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - rconpassword=$(grep "rconServerPassword" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e 's/rconServerPassword//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - port=$(grep "gameServerPort" "${servercfgfullpath}" | tr -cd '[:digit:]') - queryport=$(grep "queryServerPort" "${servercfgfullpath}" | tr -cd '[:digit:]') - rconport=$(grep "rconServerPort" "${servercfgfullpath}" | tr -cd '[:digit:]') - maxplayers=$(grep "maxPlayers" "${servercfgfullpath}" | tr -cd '[:digit:]') - - # Not set - servername=${servername:-"NOT SET"} - queryenabled=${queryenabled:-"NOT SET"} - rconenabled=${rconenabled:-"NOT SET"} - rconpassword=${rconpassword:-"NOT SET"} - port=${port:-"21025"} - queryport=${queryport:-"21025"} - rconport=${rconport:-"21026"} - maxplayers=${maxplayers:-"8"} - fi -} - -fn_info_game_sbots() { - # Config - if [ ! -f "${servercfgfullpath}" ]; then - servername="${unavailable}" - maxplayers="${unavailable}" - else - servername=$(grep "ServerName=" "${servercfgfullpath}" | sed -e 's/^[ \t]//g' -e '/^#/d' -e 's/ServerName//g' | tr -d '=";,:' | sed -e 's/^[ \t]//' -e 's/[ \t]*$//') - maxplayers=$(grep "MaxPlayers=" "${servercfgfullpath}" | tr -cd '[:digit:]') - - # Not set - servername=${servername:-"NOT SET"} - maxplayers=${maxplayers:-"0"} - fi - - # Parameters - port=${port:-"0"} - queryport=${queryport:-"0"} - servername=${servername:-"NOT SET"} - serverpassword=${serverpassword:-"NOT SET"} - defaultmap=${defaultmap:-"NOT SET"} - maxplayers=${maxplayers:-"0"} -} - -fn_info_game_scpsl() { - # Config - 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 - port=${port:-"0"} - queryport=${port} -} - -fn_info_game_sdtd() { - # Config - if [ ! -f "${servercfgfullpath}" ]; then - servername="${unavailable}" - serverpassword="${unavailable}" - port="${zero}" - port3="${zero}" - queryport="${zero}" - webadminenabled="${unavailable}" - webadminport="${zero}" - webadminpass="${unavailable}" - telnetenabled="${unavailable}" - telnetport="${zero}" - telnetpass="${unavailable}" - telnetip="${unavailable}" - maxplayers="${unavailable}" - gamemode="${unavailable}" - gameworld="${unavailable}" - else - servername=$(grep "ServerName" "${servercfgfullpath}" | sed 's/^.*value="//' | cut -f1 -d"\"") - serverpassword=$(grep "ServerPassword" "${servercfgfullpath}" | sed 's/^.*value="//' | cut -f1 -d"\"") - port=$(grep "ServerPort" "${servercfgfullpath}" | grep -Eo 'value="[0-9]+"' | tr -cd '[:digit:]') - port3=$((port + 2)) - queryport=${port:-"0"} - webadminenabled=$(grep "ControlPanelEnabled" "${servercfgfullpath}" | sed 's/^.*value="//' | cut -f1 -d"\"") - webadminport=$(grep "ControlPanelPort" "${servercfgfullpath}" | tr -cd '[:digit:]') - webadminpass=$(grep "ControlPanelPassword" "${servercfgfullpath}" | sed 's/^.*value="//' | cut -f1 -d"\"") - telnetenabled=$(grep "TelnetEnabled" "${servercfgfullpath}" | sed 's/^.*value="//' | cut -f1 -d"\"") - telnetport=$(grep "TelnetPort" "${servercfgfullpath}" | tr -cd '[:digit:]') - telnetpass=$(grep "TelnetPassword" "${servercfgfullpath}" | sed 's/^.*value="//' | cut -f1 -d"\"") - # Telnet IP will be localhost if no password is set - # check_ip will set the IP first. This will overwrite it. - if [ -z "${telnetpass}" ]; then - telnetip="127.0.0.1" - fi - maxplayers=$(grep "ServerMaxPlayerCount" "${servercfgfullpath}" | tr -cd '[:digit:]') - gamemode=$(grep "GameMode" "${servercfgfullpath}" | sed 's/^.*value="//' | cut -f1 -d"\"") - gameworld=$(grep "GameWorld" "${servercfgfullpath}" | sed 's/^.*value="//' | cut -f1 -d"\"") - - # Not set - servername=${servername:-"NOT SET"} - serverpassword=${serverpassword:-"NOT SET"} - port=${port:-"0"} - queryport=${queryport:-"0"} - webadminenabled=${webadminenabled:-"NOT SET"} - webadminport=${webadminport:-"0"} - webadminpass=${webadminpass:-"NOT SET"} - telnetenabled=${telnetenabled:-"NOT SET"} - telnetport=${telnetport:-"0"} - telnetpass=${telnetpass:-"NOT SET"} - maxplayers=${maxplayers:-"0"} - gamemode=${gamemode:-"NOT SET"} - gameworld=${gameworld:-"NOT SET"} - fi -} - -fn_info_game_sf() { - # Parameters - servername=${selfname:-"NOT SET"} - port=${port:-"0"} - queryport=${queryport:-"0"} - beaconport=${beaconport:-"0"} -} - -fn_info_game_sof2() { - # Config - if [ ! -f "${servercfgfullpath}" ]; then - rconpassword="${unavailable}" - servername="${unavailable}" - serverpassword="${unavailable}" - maxplayers="${zero}" - else - rconpassword=$(grep "rconpassword" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set rconpassword//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - servername=$(grep "sv_hostname" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set sv_hostname//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - serverpassword=$(grep "g_password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set g_password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - maxplayers=$(grep "sv_maxclients" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') - - # Not set - rconpassword=${rconpassword:-"NOT SET"} - servername=${servername:-"NOT SET"} - serverpassword=${serverpassword:-"NOT SET"} - maxplayers=${maxplayers:-"0"} - fi - - # Parameters - port=${port:-"0"} - queryport=${port} - defaultmap=${defaultmap:-"NOT SET"} -} - -fn_info_game_sol() { - # Config - if [ ! -f "${servercfgfullpath}" ]; then - adminpassword="${unavailable}" - maxplayers="${unavailable}" - port="${zero}" - queryport="${zero}" - servername="${unavailable}" - serverpassword="${unavailable}" - else - adminpassword=$(grep "Admin_Password=" "${servercfgfullpath}" | awk -F '=' '{print $2}') - maxplayers=$(grep "Max_Players=" "${servercfgfullpath}" | tr -cd '[:digit:]') - port=$(grep "Port=" "${servercfgfullpath}" | tr -cd '[:digit:]') - queryport="${port}" - filesport=$((port + 10)) - servername=$(grep "Server_Name=" "${servercfgfullpath}" | awk -F '=' '{print $2}') - serverpassword=$(grep "Game_Password=" "${servercfgfullpath}" | awk -F '=' '{print $2}') - - # Not set - adminpassword=${adminpassword:-"NOT SET"} - maxplayers=${maxplayers:-"0"} - port=${port:-"23073"} - queryport=${queryport:-"23083"} - servername=${servername:-"NOT SET"} - serverpassword=${serverpassword:-"NOT SET"} - fi -} - -fn_info_game_source() { - # Config - if [ ! -f "${servercfgfullpath}" ]; then - servername="${unavailable}" - serverpassword="${unavailable}" - rconpassword="${unavailable}" - else - servername=$(grep "hostname" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/hostname//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - serverpassword=$(grep "sv_password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/sv_password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - rconpassword=$(grep "rcon_password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/rcon_password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - - # Not set - servername=${servername:-"NOT SET"} - serverpassword=${serverpassword:-"NOT SET"} - rconpassword=${rconpassword:-"NOT SET"} - fi - - # Parameters - defaultmap=${defaultmap:-"NOT SET"} - maxplayers=${maxplayers:-"0"} - port=${port:-"0"} - rconport=${port:-"0"} - queryport=${port:-"0"} - clientport=${clientport:-"0"} - # Steamport can be between 26901-26910 and is normaly automatically set. - # Some servers might support -steamport parameter to set - if [ "${steamport}" == "0" ] || [ -v "${steamport}" ]; then - steamport="$(echo "${ssinfo}" | grep "${srcdslinuxpid}" | awk '{print $5}' | grep ":269" | cut -d ":" -f2)" - fi -} - -fn_info_game_spark() { - defaultmap=${defaultmap:-"NOT SET"} - maxplayers=${maxplayers:-"0"} - port=${port:-"0"} - queryport=$((port + 1)) - servername=${servername:-"NOT SET"} - serverpassword=${serverpassword:-"NOT SET"} - webadminuser=${webadminuser:-"NOT SET"} - webadminpass=${webadminpass:-"NOT SET"} - webadminport=${webadminport:-"0"} - # Commented out as displaying not set in details parameters - #mods=${mods:-"NOT SET"} -} - -fn_info_game_squad() { - # Config - if [ ! -f "${servercfgfullpath}" ]; then - servername="${unavailable}" - maxplayers="${unavailable}" - else - servername=$(grep "ServerName=" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/ServerName//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - maxplayers=$(grep "MaxPlayers=" "${servercfgfullpath}" | tr -cd '[:digit:]') - - servername=${servername:-"NOT SET"} - maxplayers=${maxplayers:-"0"} - fi - - if [ ! -f "${servercfgdir}/Rcon.cfg" ]; then - rconport=${unavailable} - rconpassword=${unavailable} - else - rconport=$(grep "Port=" "${servercfgdir}/Rcon.cfg" | tr -cd '[:digit:]') - rconpassword=$(grep "Password=" "${servercfgdir}/Rcon.cfg" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/Password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - - rconport=${rconport:-"0"} - if [ -z "${rconpassword}" ] || [ ${#rconpassword} == 1 ]; then - rconpassword="NOT SET" - fi - - fi - - # Parameters - port=${port:-"0"} - queryport=${queryport:-"0"} -} - -fn_info_game_st() { - # Config - if [ ! -f "${servercfgfullpath}" ]; then - servername="${unavailable}" - serverpassword="${unavailable}" - rconpassword="${unavailable}" - maxplayers="${unavailable}" - else - servername=$(grep "SERVERNAME" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/SERVERNAME//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - serverpassword=$(grep "PASSWORD" "${servercfgfullpath}" | grep "^PASSWORD" | sed -e 's/^[ \t]*//g' -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 "MAXPLAYER" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/MAXPLAYER//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - - # Not set - servername=${servername:-"NOT SET"} - serverpassword=${serverpassword:-"NOT SET"} - rconpassword=${rconpassword:-"NOT SET"} - maxplayers=${maxplayers:-"0"} - fi - - # Parameters - port=${port:-"0"} - queryport=${queryport:-"0"} - httpport=${port:-"0"} - worldtype=${worldtype:-"NOT SET"} - autosaveinterval=${autosaveinterval:-"0"} - clearinterval=${clearinterval:-"0"} - worldname=${worldname:-"NOT SET"} -} - -fn_info_game_terraria() { - # Config - if [ ! -f "${servercfgfullpath}" ]; then - servername="${unavailable}" - port="${zero}" - gameworld="${unavailable}" - maxplayers="${zero}" - queryport="${zero}" - else - servername=$(grep "worldname" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/worldname//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - port=$(grep "port" "${servercfgfullpath}" | tr -cd '[:digit:]') - queryport=${port:-"0"} - gameworld=$(grep "world=" "${servercfgfullpath}" | grep -v "//" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/world=//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - maxplayers=$(grep "maxplayers" "${servercfgfullpath}" | grep -v "//" | tr -cd '[:digit:]') - - # Not set - servername=${servername:-"NOT SET"} - port=${port:-"0"} - queryport=${queryport:-"0"} - gameworld=${gameworld:-"NOT SET"} - maxplayers=${maxplayers:-"0"} - fi -} - -fn_info_game_stn() { - # Config - 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}") - serverpassword=$(sed -nr 's/^ServerPassword=(.*)$/\1/p' "${servercfgfullpath}") - queryport=$((port + 1)) - - # Not set - serverpassword=${serverpassword:-"NOT SET"} - port=${port:-"0"} - serverpassword=${serverpassword:-"NOT SET"} - queryport=${queryport:-"0"} - fi -} - -fn_info_game_ti() { - 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() { - # Config - if [ ! -f "${servercfgfullpath}" ]; then - dbplugin="${unavailable}" - port="9987" - queryport="10011" - querysshport="10022" - queryhttpport="10080" - queryhttpsport="10443" - fileport="30033" - telnetport="10011" - else - dbplugin=$(grep "dbplugin=" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/dbplugin=//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - port=$(grep "default_voice_port" "${servercfgfullpath}" | tr -cd '[:digit:]') - queryport=$(grep "query_port" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') - querysshport=$(grep "query_ssh_port" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') - queryhttpport=$(grep "query_http_port" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') - queryhttpsport=$(grep "query_https_port" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') - fileport=$(grep "filetransfer_port" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') - telnetport="${queryport}" - configip=$(grep "voice_ip" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/voice_ip//g' | sed 's/,.*//' | tr -d '=\";,' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - - # Not set - dbplugin=${dbplugin:-"NOT SET"} - port=${port:-"9987"} - queryport=${queryport:-"10011"} - querysshport=${querysshport:-"10022"} - queryhttpport=${queryhttpport:-"10080"} - queryhttpsport=${queryhttpsport:-"10443"} - fileport=${fileport:-"30033"} - telnetport=${telnetport:-"10011"} - configip=${configip:-"0.0.0.0"} - fi -} - -fn_info_game_tu() { - # Config - if [ ! -f "${servercfgfullpath}" ]; then - servername="${unavailable}" - maxplayers="${zero}" - else - servername=$(grep "ServerTitle" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^--/d' -e 's/ServerTitle//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - maxplayers=$(grep "MaxPlayers" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') - - # Not set - servername=${servername:-"NOT SET"} - maxplayers=${maxplayers:-"0"} - fi - - # Parameters - port=${port:-"0"} - steamport=$((port + 1)) - queryport=${queryport:-"0"} -} - -fn_info_game_tw() { - # Config - if [ ! -f "${servercfgfullpath}" ]; then - servername="unnamed server" - serverpassword="${unavailable}" - rconpassword="${unavailable}" - port="8303" - queryport="8303" - maxplayers="12" - else - servername=$(grep "sv_name" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/^sv_name//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - serverpassword=$(grep "password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' | grep "^password" | sed -e '/^#/d' -e 's/^password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - rconpassword=$(grep "sv_rcon_password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/^sv_rcon_password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - port=$(grep "sv_port" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') - queryport="${port}" - maxplayers=$(grep "sv_max_clients" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') - - # Not set - servername=${servername:-"NOT SET"} - serverpassword=${serverpassword:-"NOT SET"} - rconpassword=${rconpassword:-"NOT SET"} - port=${port:-"8303"} - queryport=${port:-"8303"} - maxplayers=${maxplayers:-"12"} +# Config Type: Java properties +# Comment: # or ! +# Example: motd=SERVERNAME +# Filetype: properties +fn_info_game_mc() { + if [ -f "${servercfgfullpath}" ]; then + fn_info_game_java_properties "configip" "server-ip" + fn_info_game_java_properties "gamemode" "gamemode" + fn_info_game_java_properties "maxplayers" "max-players" + fn_info_game_java_properties "port" "server-port" + fn_info_game_java_properties "queryenabled" "enable-query" + fn_info_game_java_properties "queryport" "query.port" + fn_info_game_java_properties "rconpassword" "rcon.password" + fn_info_game_java_properties "rconport" "rcon.port" + fn_info_game_java_properties "servername" "motd" + fn_info_game_java_properties "worldname" "level-name" + fi + configip="${configip:-"0.0.0.0"}" + gamemode="${gamemode:-"NOT SET"}" + maxplayers="${maxplayers:-"0"}" + port="${port:-"NOT SET"}" + queryenabled="${queryenabled:-"NOT SET"}" + if [ -z "${queryport}" ]; then + queryport="${port}" fi + rconpassword="${rconpassword:-"NOT SET"}" + rconport="${rconport:-"NOT SET"}" + servername="${servername:-"NOT SET"}" + worldname="${worldname:-"NOT SET"}" } -fn_info_game_ut99() { - # Config - if [ ! -f "${servercfgfullpath}" ]; then - servername="${unavailable}" - serverpassword="${unavailable}" - adminpassword="${unavailable}" - port="${zero}" - queryport="${zero}" - queryportgs="${zero}" - webadminenabled="${unavailable}" - webadminport="${zero}" - webadminuser="${unavailable}" - webadminpass="${unavailable}" - else - servername=$(grep "ServerName" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/ServerName//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//' | sed 's/\r$//') - serverpassword=$(grep "GamePassword" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/GamePassword//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//' | sed 's/\r$//') - adminpassword=$(grep "AdminPassword" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/AdminPassword//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//' | sed 's/\r$//') - port=$(grep "Port" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' | grep "^Port" | grep -v "#" | tr -cd '[:digit:]') - queryport=$((port + 1)) - queryportgs=$(grep "OldQueryPortNumber" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') - beaconport=$(grep "ServerBeaconPort" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') - webadminenabled=$(grep "bEnabled" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/bEnabled//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//' | sed 's/\r$//') - httpport=$(grep "ListenPort" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') - webadminuser=$(grep "AdminUsername" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/AdminUsername//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//' | sed 's/\r$//') - webadminpass=$(grep "UTServerAdmin.UTServerAdmin" "${servercfgfullpath}" -A 4 | grep "AdminPassword" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/AdminPassword//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//' | sed 's/\r$//') +# Config Type: Java properties +# Comment: # or ! +# Example: server-name=SERVERNAME +# Filetype: properties +fn_info_game_mcb() { + if [ -f "${servercfgfullpath}" ]; then + fn_info_game_java_properties "gamemode" "gamemode" + fn_info_game_java_properties "maxplayers" "max-players" + fn_info_game_java_properties "port" "server-port" + fn_info_game_java_properties "portv6" "server-portv6" + fn_info_game_java_properties "servername" "server-name" + fn_info_game_java_properties "worldname" "level-name" + fi + gamemode="${gamemode:-"NOT SET"}" + maxplayers="${maxplayers:-"0"}" + portipv6="${portipv6:-"NOT SET"}" + queryport="${port}" + servername="${servername:-"NOT SET"}" + worldname="${worldname:-"NOT SET"}" +} + +# Config Type: QuakeC +# Comment: // or /* */ +# Example: set sv_hostname "SERVERNAME" +# Filetype: cfg +fn_info_game_mohaa() { + if [ -f "${servercfgfullpath}" ]; then + fn_info_game_quakec "maxplayers" "sv_maxclients" + fn_info_game_quakec "rconpassword" "rconPassword" + fn_info_game_quakec "servername" "sv_hostname" + fn_info_game_quakec "serverpassword" "g_password" + fi + defaultmap="${defaultmap:-"NOT SET"}" + maxplayers="${maxplayers:-"0"}" + port="${port:-"0"}" + queryport="${port:-"0"}" + rconpassword="${rconpassword:-"NOT SET"}" + servername="${servername:-"NOT SET"}" + serverpassword="${serverpassword:-"NOT SET"}" +} - # Not set - servername=${servername:-"NOT SET"} - serverpassword=${serverpassword:-"NOT SET"} - adminpassword=${adminpassword:-"NOT SET"} - port=${port:-"0"} - queryport=${queryport:-"0"} - beaconport=${beaconport:-"8777"} - queryportgs=${queryportgs:-"0"} - webadminenabled=${webadminenabled:-"NOT SET"} - webadminport=${webadminport:-"0"} - webadminuser=${webadminuser:-"NOT SET"} - webadminpass=${webadminpass:-"NOT SET"} +# Config Type: json +# Parameters: true +# Comment: // or /* */ +fn_info_game_mom() { + if [ -f "${servercfgfullpath}" ]; then + fn_info_game_json "defaultmap" ".MapName" + fn_info_game_json "maxplayers" ".MaxPlayers" + fn_info_game_json "servername" ".ServerName" + fn_info_game_json "serverpassword" ".ServerPassword" + fi + beaconport="${beaconport:-"0"}" + defaultmap="${defaultmap:-"NOT SET"}" + maxplayers="${maxplayers:-"0"}" + port="${port:-"0"}" + servername="${servername:-"NOT SET"}" + serverpassword="${serverpassword:-"NOT SET"}" +} + +# Config Type: xml +# Comment: +# Example: Default MTA Server +# Filetype: conf +fn_info_game_mta() { + if [ -f "${servercfgfullpath}" ]; then + fn_info_game_xml "port" "/config/@port" + fn_info_game_xml "httpport" "/config/@httpport" + fn_info_game_xml "servername" "/config/@servername" + fn_info_game_xml "maxplayers" "/config/@maxplayers" + fn_info_game_xml "ase" "/config/@ase" + fi + if [ "${ase}" == "1" ]; then + ase="Enabled" + else + ase="Disabled" + fi + port="${port:-"0"}" + queryport="$((port + 123))" + httpport="${httpport:-"0"}" + ase="${ase:-"Disabled"}" + servername="${servername:-"NOT SET"}" + serverpassword="${serverpassword:-"NOT SET"}" + maxplayers="${maxplayers:-"0"}" +} + +# Config Type: custom +# Comment: // +# Example: port = 14159, +# Filetype: cfg +fn_info_game_nec() { + if [ -f "${servercfgfullpath}" ]; then + fn_info_game_lua "maxplayers" "slots" + fn_info_game_lua "port" "port" + fn_info_game_lua "serverpassword" "password" fi + maxplayers="${maxplayers:-"0"}" + port="${port:-"0"}" + servername="Necesse Port ${port}" + serverpassword="${serverpassword:-"NOT SET"}" +} - # Parameters - defaultmap=${defaultmap:-"NOT SET"} +# Config Type: json +# Parameters: false +# Comment: // or /* */ +fn_info_game_onset() { + if [ -f "${servercfgfullpath}" ]; then + fn_info_game_json "maxplayers" ".maxplayers" + fn_info_game_json "port" ".port" + fn_info_game_json "servername" ".servername_short" + fn_info_game_json "serverpassword" ".password" + fi + maxplayers="${maxplayers:-"0"}" + port="${port:-"0"}" + httpport="$((port - 2))" + queryport="$((port - 1))" + servername="${servername:-"NOT SET"}" +} + +# Config Type: custom +# Parameters: false +# Comment: // +# Filetype: cfg +fn_info_game_pc() { + if [ -f "${servercfgfullpath}" ]; then + fn_info_game_pc_config "apiport" "httpApiPort" + fn_info_game_pc_config "httpenabled" "enableHttpApi" + fn_info_game_pc_config "httpport" "httpApiPort" + fn_info_game_pc_config "maxplayers" "maxPlayerCount" + fn_info_game_pc_config "port" "hostPort" + fn_info_game_pc_config "queryport" "queryPort" + fn_info_game_pc_config "servername" "name" + fn_info_game_pc_config "serverpassword" "password" + fn_info_game_pc_config "steamport" "steamPort" + fi + apiport="${apiport:-"0"}" + httpenabled="${httpenabled:-"0"}" + httpport="${httpport:-"0"}" + maxplayers="${maxplayers:-"0"}" + port="${port:-"0"}" + queryport="${queryport:-"0"}" + servername="${servername:-"NOT SET"}" + serverpassword="${serverpassword:-"NOT SET"}" + steamport="${steamport:-"0"}" } -fn_info_game_unreal2() { +fn_info_game_pc2() { + if [ -f "${servercfgfullpath}" ]; then + fn_info_game_pc_config "apiport" "httpApiPort" + fn_info_game_pc_config "httpenabled" "enableHttpApi" + fn_info_game_pc_config "httpport" "httpApiPort" + fn_info_game_pc_config "maxplayers" "maxPlayerCount" + fn_info_game_pc_config "port" "hostPort" + fn_info_game_pc_config "queryport" "queryPort" + fn_info_game_pc_config "servername" "name" + fn_info_game_pc_config "serverpassword" "password" + fn_info_game_pc_config "steamport" "steamPort" + fi + apiport="${apiport:-"0"}" + httpenabled="${httpenabled:-"0"}" + httpport="${httpport:-"0"}" + maxplayers="${maxplayers:-"0"}" + port="${port:-"0"}" + queryport="${queryport:-"0"}" + servername="${servername:-"NOT SET"}" + serverpassword="${serverpassword:-"NOT SET"}" + steamport="${steamport:-"0"}" +} + +# Config Type: SiiNunit +# Comment: // +# Example: lobby_name: "SERVERNAME" +# Filetype: ssi +fn_info_game_prism3d() { # Config if [ ! -f "${servercfgfullpath}" ]; then - servername="${unavailable}" - serverpassword="${unavailable}" - adminpassword="${unavailable}" + maxplayers="${unavailable}" port="${zero}" queryport="${zero}" - queryportgs="${zero}" - webadminenabled="${unavailable}" - webadminport="${zero}" - webadminuser="${unavailable}" - webadminpass="${unavailable}" + servername="${unavailable}" + serverpassword="${unavailable}" else - servername=$(sed -nr 's/^ServerName=(.*)$/\1/p' "${servercfgfullpath}" | tr -d '=\";,:' | sed 's/\r$//') - serverpassword=$(sed -nr 's/^GamePassword=(.*)$/\1/p' "${servercfgfullpath}" | tr -d '=\";,:' | sed 's/\r$//') - adminpassword=$(sed -nr 's/^AdminPassword=(.*)$/\1/p' "${servercfgfullpath}" | tr -d '=\";,:' | sed 's/\r$//') - port=$(sed -nr 's/^Port=(.*)$/\1/p' "${servercfgfullpath}" | tr -cd '[:digit:]') - queryport=$((port + 1)) - queryportgs=$(sed -nr 's/^OldQueryPortNumber=(.*)$/\1/p' "${servercfgfullpath}" | tr -cd '[:digit:]') - webadminenabled=$(sed -nr 's/^bEnabled=(.*)$/\1/p' "${servercfgfullpath}" | tr -d '=\";,:' | sed 's/\r$//') - webadminport=$(sed -nr 's/^ListenPort=(.*)$/\1/p' "${servercfgfullpath}" | tr -cd '[:digit:]') - webadminuser=$(sed -nr 's/^AdminName=(.*)$/\1/p' "${servercfgfullpath}" | tr -d '=\";,:' | sed 's/\r$//') - webadminpass="${adminpassword}" + 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"} - adminpassword=${adminpassword:-"NOT SET"} - port=${port:-"0"} - queryport=${queryport:-"0"} - queryportgs=${queryportgs:-"0"} - webadminenabled=${webadminenabled:-"NOT SET"} - webadminport=${webadminport:-"0"} - webadminuser=${webadminuser:-"NOT SET"} - webadminpass=${webadminpass:-"NOT SET"} fi - - # Parameters - defaultmap=${defaultmap:-"NOT SET"} } -fn_info_game_unt() { - # Parameters - servername=${selfname:-"NOT SET"} - port=${port:-"0"} - queryport=${port} - steamport=$((port + 1)) +# Config Type: QuakeC +# Comment: // or /* */ +# Example: set hostname "SERVERNAME" +# Filetype: cfg +fn_info_game_q2() { + if [ -f "${servercfgfullpath}" ]; then + fn_info_game_quakec "maxplayers" "maxclients" + fn_info_game_quakec "rconpassword" "rcon_password" + fn_info_game_quakec "servername" "hostname" + fi + defaultmap="${defaultmap:-"NOT SET"}" + maxplayers="${maxplayers:-"0"}" + port="${port:-"0"}" + queryport="${port}" + rconpassword="${rconpassword:-"NOT SET"}" + servername="${servername:-"NOT SET"}" +} + +# Config Type: QuakeC +# Comment: // or /* */ +# Example: set sv_hostname "SERVERNAME" +# Filetype: cfg +fn_info_game_q3() { + if [ -f "${servercfgfullpath}" ]; then + fn_info_game_quakec "maxplayers" "sv_maxclients" + fn_info_game_quakec "rconpassword" "rconpassword" + fn_info_game_quakec "servername" "sv_hostname" + fi + maxplayers="${maxplayers:-"0"}" + rconpassword="${rconpassword:-"NOT SET"}" + servername="${servername:-"NOT SET"}" + port="${port:-"0"}" + queryport="${port}" + defaultmap="${defaultmap:-"NOT SET"}" +} + +# Config Type: QuakeC +# Comment: // or /* */ +# Example: set sv_hostname "SERVERNAME" +# Filetype: cfg +fn_info_game_ql() { + if [ -f "${servercfgfullpath}" ]; then + fn_info_game_quakec "configip" "net_ip" + fn_info_game_quakec "maxplayers" "sv_maxClients" + fn_info_game_quakec "port" "net_port" + fn_info_game_quakec "rconpassword" "zmq_rcon_password" + fn_info_game_quakec "rconport" "zmq_rcon_port" + fn_info_game_quakec "servername" "sv_hostname" + fn_info_game_quakec "serverpassword" "g_password" + fn_info_game_quakec "statsport" "zmq_stats_port" + fi + configip="${configip:-"0.0.0.0"}" + maxplayers="${maxplayers:-"0"}" + port="${port:-"0"}" + queryport="${port}" + rconpassword="${rconpassword:-"NOT SET"}" + rconport="${rconport:-"0"}" + servername="${servername:-"NOT SET"}" + serverpassword="${serverpassword:-"NOT SET"}" + statsport="${statsport:-"0"}" +} + +# Config Type: QuakeC +# Comment: // or /* */ +# Example: hostname "SERVERNAME" +# Filetype: cfg +fn_info_game_qw() { + if [ -f "${servercfgfullpath}" ]; then + fn_info_game_quakec "maxplayers" "maxclients" + fn_info_game_quakec "rconpassword" "rcon_password" + fn_info_game_quakec "servername" "hostname" + fi + maxplayers="${maxplayers:-"0"}" + port="${port:-"0"}" + queryport="${port}" + rconpassword="${rconpassword:-"NOT SET"}" + servername="${servername:-"NOT SET"}" } -fn_info_game_ut() { - # Config - if [ ! -f "${servercfgfullpath}" ]; then - servername="${unavailable}" - else - servername=$(grep "ServerName" "${servercfgfullpath}" | awk -F '=' '{print $2}') - - # Not set - servername=${servername:-"NOT SET"} +fn_info_game_ro() { + if [ -f "${servercfgfullpath}" ]; then + fn_info_game_ini "adminpassword" "AdminPassword" + fn_info_game_ini "httpenabled" "bEnabled" + fn_info_game_ini "httppassword" "httppasswordword" + fn_info_game_ini "httpport" "ListenPort" + fn_info_game_ini "httpuser" "AdminName" + fn_info_game_ini "lanport" "LANServerPort" + fn_info_game_ini "maxplayers" "MaxPlayers" + fn_info_game_ini "port" "Port" + fn_info_game_ini "queryportgs" "QueryPort" + fn_info_game_ini "servername" "ServerName" + fn_info_game_ini "serverpassword" "GamePassword" + fi + adminpassword="${adminpassword:-"NOT SET"}" + defaultmap="${defaultmap:-"NOT SET"}" + httpenabled="${httpenabled:-"NOT SET"}" + httppassword="${adminpassword}" + httpport="${httpport:-"0"}" + httpuser="${httpuser:-"NOT SET"}" + lanport="${lanport:-"0"}" + maxplayers="${maxplayers:-"0"}" + port="${port:-"0"}" + queryport="$((port + 1))" + queryportgs="${queryportgs:-"0"}" + servername="${servername:-"NOT SET"}" + serverpassword="${serverpassword:-"NOT SET"}" + steamport="28902" + steamworksport="20610" +} + +# Config Type: QuakeC +# Comment: // or /* */ +# Example: set sv_hostname "SERVERNAME" +# Filetype: cfg +fn_info_game_rtcw() { + if [ -f "${servercfgfullpath}" ]; then + fn_info_game_quakec "rconpassword" "rconpassword" + fn_info_game_quakec "servername" "sv_hostname" + fn_info_game_quakec "serverpassword" "g_password" + fn_info_game_quakec "maxplayers" "sv_maxclients" fi + rconpassword=${rconpassword:-"NOT SET"} + servername=${servername:-"NOT SET"} + serverpassword=${serverpassword:-"NOT SET"} + maxplayers=${maxplayers:-"0"} + port=${port:-"0"} + queryport=${port:-"0"} + defaultmap=${defaultmap:-"NOT SET"} +} +# Config Type: Parameters (mostly) +fn_info_game_rust() { # Parameters + servername=${servername:-"NOT SET"} port=${port:-"0"} - queryport=$((port + 1)) + queryport=${queryport:-"0"} + appport=${appport:-"0"} + rconport=${rconport:-"0"} + gamemode=${gamemode:-"NOT SET"} + maxplayers=${maxplayers:-"0"} + rconpassword=${rconpassword:-"NOT SET"} + rconweb=${rconweb:-"NOT SET"} + tickrate=${tickrate:-"0"} + saveinterval=${saveinterval:-"0"} + serverlevel=${serverlevel:-"NOT SET"} + customlevelurl=${customlevelurl:-"NOT SET"} + worldsize=${worldsize:-"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"} } -fn_info_game_unreal2k4() { +fn_info_game_rw() { # Config if [ ! -f "${servercfgfullpath}" ]; then servername="${unavailable}" serverpassword="${unavailable}" - adminpassword="${unavailable}" + rconpassword="${unavailable}" + rconport="${zero}" + maxplayers="${zero}" port="${zero}" + port2="${zero}" + port3="${zero}" + port4="${zero}" queryport="${zero}" - queryportgs="${zero}" - lanport="${zero}" - webadminenabled="${unavailable}" - httpport="${zero}" - webadminuser="${unavailable}" - webadminpass="${unavailable}" + gamemode="${unavailable}" + worldname="${unavailable}" else - servername=$(sed -nr 's/^ServerName=(.*)$/\1/p' "${servercfgfullpath}" | tr -d '=\";,:' | sed 's/\r$//') - serverpassword=$(sed -nr 's/^GamePassword=(.*)$/\1/p' "${servercfgfullpath}" | tr -d '=\";,:' | sed 's/\r$//') - adminpassword=$(sed -nr 's/^AdminPassword=(.*)$/\1/p' "${servercfgfullpath}" | tr -d '=\";,:' | sed 's/\r$//') - port=$(sed -nr 's/^Port=(.*)$/\1/p' "${servercfgfullpath}" | tr -cd '[:digit:]') - queryport=$((port + 1)) - queryportgs=$(sed -nr 's/^OldQueryPortNumber=(.*)$/\1/p' "${servercfgfullpath}" | tr -cd '[:digit:]') - lanport=$(grep "LANServerPort=" "${servercfgfullpath}" | tr -cd '[:digit:]') - webadminenabled=$(sed -nr 's/^bEnabled=(.*)$/\1/p' "${servercfgfullpath}" | tr -d '=\";,:' | sed 's/\r$//') - httpport=$(sed -nr 's/^ListenPort=(.*)$/\1/p' "${servercfgfullpath}" | tr -cd '[:digit:]') - webadminuser=$(sed -nr 's/^AdminName=(.*)$/\1/p' "${servercfgfullpath}" | tr -d '=\";,:' | sed 's/\r$//') - webadminpass="${adminpassword}" + servername=$(grep "server_name" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/server_name//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + serverpassword=$(grep "server_password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/server_password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + rconpassword=$(grep "rcon_password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/rcon_password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + rconport=$(grep "rcon_port" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') + maxplayers=$(grep "settings_max_players" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') + port=$(grep "server_port" "${servercfgfullpath}" | grep -v "database_mysql_server_port" | grep -v "#" | tr -cd '[:digit:]') + port2=$((port + 1)) + port3=$((port + 2)) + port4=$((port + 3)) + queryport="${port}" + httpqueryport=$((port - 1)) + gamemode=$(grep "settings_default_gamemode=" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/settings_default_gamemode//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + worldname=$(grep "server_world_name" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/server_world_name//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + configip=$(grep "server_ip" "${servercfgfullpath}" | grep -v "database_mysql_server_ip" | sed -e 's/^[ \t]*//g' -e '/^--/d' -e 's/server_ip//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') # Not set servername=${servername:-"NOT SET"} serverpassword=${serverpassword:-"NOT SET"} - adminpassword=${adminpassword:-"NOT SET"} + rconpassword=${rconpassword:-"NOT SET"} + rconport=${rconport:-"NOT SET"} + maxplayers=${maxplayers:-"0"} port=${port:-"0"} + port2=${port2:-"0"} + port3=${port3:-"0"} + port4=${port4:-"0"} queryport=${queryport:-"0"} - queryportgs=${queryportgs:-"0"} - lanport=${lanport:-"0"} - webadminenabled=${webadminenabled:-"NOT SET"} - httpport=${httpport:-"0"} - webadminuser=${webadminuser:-"NOT SET"} - webadminpass=${webadminpass:-"NOT SET"} + httpqueryport=${httpport:-"0"} + gamemode=${gamemode:-"NOT SET"} + worldname=${worldname:-"NOT SET"} + configip=${configip:-"0.0.0.0"} fi } -fn_info_game_ut3() { +# Config Type: custom +# Comment: // or /* */ +# example: hostname "SERVERNAME" +# filetypes: cfg +fn_info_game_samp() { # Config if [ ! -f "${servercfgfullpath}" ]; then - servername="${unavailable}" - serverpassword="${unavailable}" - adminpassword="${unavailable}" - maxplayers="${unavailable}" - webadminenabled="${unavailable}" - webadminport="${zero}" - webadminuser="${unavailable}" - webadminpass="${unavailable}" + servername="unnamed server" + rconpassword="${unavailable}" + port="7777" + rconport="${port}" + maxplayers="50" else - servername=$(grep "ServerName" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/ServerName//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - serverpassword=$(grep "GamePassword" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/GamePassword//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - adminpassword=$(grep "AdminPassword" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/AdminPassword//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - maxplayers=$(grep "MaxPlayers" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') - webadminenabled=$(grep "bEnabled" "${servercfgdir}/UTWeb.ini" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/bEnabled//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - webadminport=$(grep "ListenPort" "${servercfgdir}/UTWeb.ini" | grep -v "#" | tr -cd '[:digit:]') - webadminuser="Admin" - webadminpass=$(grep "AdminPassword" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/AdminPassword//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + servername=$(grep "hostname" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/hostname//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + rconpassword=$(grep "rcon_password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/^rcon_password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + port=$(grep "port" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') + queryport=${port} + rconport=${port} + maxplayers=$(grep "maxplayers" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') # Not set servername=${servername:-"NOT SET"} - serverpassword=${serverpassword:-"NOT SET"} - adminpassword=${adminpassword:-"NOT SET"} - maxplayers=${maxplayers:-"0"} - webadminenabled=${webadminenabled:-"NOT SET"} - webadminport=${webadminport:-"0"} - webadminuser=${webadminuser:-"NOT SET"} - webadminpass=${webadminpass:-"NOT SET"} + rconpassword=${rconpassword:-"NOT SET"} + port=${port:-"7777"} + queryport=${port:-"7777"} + rconport=${rconport:-"7777"} + maxplayers=${maxplayers:-"12"} fi +} +# Config Type: json +# Parameters: false +# Comment: // or /* */ +fn_info_game_sb() { + if [ ! -f "${servercfgfullpath}" ]; then + fn_info_game_json "maxplayers" "maxPlayers" + fn_info_game_json "port" "gameServerPort" + fn_info_game_json "queryenabled" "runQueryServer" + fn_info_game_json "queryport" "queryServerPort" + fn_info_game_json "rconenabled" "runRconServer" + fn_info_game_json "rconpassword" "rconServerPassword" + fn_info_game_json "rconport" "rconServerPort" + fn_info_game_json "servername" "serverName" + fi + maxplayers="${maxplayers:-"0"}" + port="${port:-"0"}" + queryenabled="${queryenabled:-"NOT SET"}" + queryport="${queryport:-"0"}" + rconenabled="${rconenabled:-"NOT SET"}" + rconpassword="${rconpassword:-"NOT SET"}" + rconport="${rconport:-"0"}" + servername="${servername:-"NOT SET"}" +} + +# Config Type: Parameters +fn_info_game_sbots() { + port="${port:-"0"}" + queryport="${queryport:-"0"}" + servername="${servername:-"NOT SET"}" + serverpassword="${serverpassword:-"NOT SET"}" + defaultmap="${defaultmap:-"NOT SET"}" + maxplayers="${maxplayers:-"0"}" +} + +# Config Type: custom (possibly YAML) +# Comment: # +# Example: server_name: SERVERNAME +# Filetype: txt +fn_info_game_scpsl() { + if [ -f "${servercfgfullpath}" ]; then + fn_info_game_pc_config "adminpassword" "administrator_query_password" + fn_info_game_pc_config "configip" "ipv4_bind_ip" + fn_info_game_pc_config "maxplayers" "max_players" + fn_info_game_pc_config "servername" "server_name" + fn_info_game_pc_config "tickrate" "server_tickrate" + fi + adminpassword="${adminpassword:-"NOT SET"}" + configip="${configip:-"0.0.0.0"}" + maxplayers="${maxplayers:-"0"}" + port="${port:-"0"}" + queryport="${port}" + servername="${servername:-"NOT SET"}" + tickrate="${tickrate:-"NOT SET"}" +} + +# Config Type: xml +# Comment: +# Example: +# Filetype: xml +fn_info_game_sdtd() { + if [ -f "${servercfgfullpath}" ]; then + fn_info_game_xml "gamemode" "ServerSettings/@GameMode" + fn_info_game_xml "maxplayers" "ServerSettings/@MaxPlayers" + fn_info_game_xml "servername" "ServerSettings/@ServerName" + fn_info_game_xml "serverpassword" "ServerSettings/@ServerPassword" + fn_info_game_xml "serverport" "ServerSettings/@ServerPort" + fn_info_game_xml "telnetenabled" "ServerSettings/@TelnetEnabled" + fn_info_game_xml "telnetpass" "ServerSettings/@TelnetPassword" + fn_info_game_xml "telnetport" "ServerSettings/@TelnetPort" + fn_info_game_xml "httpenabled" "ServerSettings/@ControlPanelEnabled" + fn_info_game_xml "httppassword" "ServerSettings/@ControlPanelPassword" + fn_info_game_xml "httpport" "ServerSettings/@ControlPanelPort" + fn_info_game_xml "worldname" "ServerSettings/@GameWorld" + + fi + servername="${servername:-"NOT SET"}" + serverpassword="${serverpassword:-"NOT SET"}" + port="${port:-"0"}" + queryport="${queryport:-"0"}" + httpenabled="${httpenabled:-"NOT SET"}" + httpport="${httpport:-"0"}" + httppassword="${httppassword:-"NOT SET"}" + telnetenabled="${telnetenabled:-"NOT SET"}" + telnetport="${telnetport:-"0"}" + telnetpass="${telnetpass:-"NOT SET"}" + maxplayers="${maxplayers:-"0"}" + gamemode="${gamemode:-"NOT SET"}" + worldname="${worldname:-"NOT SET"}" + # Telnet IP will be localhost if no password is set + # check_ip will set the IP first. This will overwrite it. + if [ -z "${telnetpass}" ]; then + telnetip="127.0.0.1" + fi +} + +# Config Type: Parameters (with an ini) +fn_info_game_sf() { # Parameters + servername="${selfname:-"NOT SET"}" + port="${port:-"0"}" + queryport="${queryport:-"0"}" + beaconport="${beaconport:-"0"}" +} + +# Config Type: QuakeC +# Comment: // or /* */ +# Example: set sv_hostname "SERVERNAME" +# Filetype: cfg +fn_info_game_sof2() { + if [ -f "${servercfgfullpath}" ]; then + fn_info_game_quakec "rconpassword" "rconpassword" + fn_info_game_quakec "servername" "sv_hostname" + fn_info_game_quakec "serverpassword" "g_password" + fn_info_game_quakec "maxplayers" "sv_maxclients" + fi + rconpassword="${rconpassword:-"NOT SET"}" + servername="${servername:-"NOT SET"}" + serverpassword="${serverpassword:-"NOT SET"}" + maxplayers="${maxplayers:-"0"}" + port="${port:-"0"}" + queryport="${port}" + defaultmap="${defaultmap:-"NOT SET"}" +} + +# Config Type: ini +# Parameters: true +# Comment: ; or # +# Server_Name=SERVERNAME +# Filetype: ini +fn_info_game_sol() { + if [ -f "${servercfgfullpath}" ]; then + fn_info_config_ini "adminpassword" "Admin_Password" + fn_info_config_ini "maxplayers" "Max_Players" + fn_info_config_ini "port" "Port" + fn_info_config_ini "servername" "Server_Name" + fn_info_config_ini "serverpassword" "Game_Password" + fi + adminpassword="${adminpassword:-"NOT SET"}" + maxplayers="${maxplayers:-"0"}" + port="${port:-"0"}" + filesport="$((port + 10))" + queryport="${port}" + servername="${servername:-"NOT SET"}" + serverpassword="${serverpassword:-"NOT SET"}" +} + +# Config Type: Valve KeyValues +# Comment: // +# Example: hostname "SERVERNAME" +# Filetype: cfg +fn_info_game_source() { + if [ -f "${servercfgfullpath}" ]; then + fn_info_game_valve_keyvalues "rconpassword" "rcon_password" + fn_info_game_valve_keyvalues "servername" "hostname" + fn_info_game_valve_keyvalues "serverpassword" "sv_password" + fi + # Steamport can be between 26901-26910 and is normally automatically set. + # Some servers might support -steamport parameter to set + if [ "${steamport}" == "0" ] || [ -v "${steamport}" ]; then + steamport="$(echo "${ssinfo}" | grep "${srcdslinuxpid}" | awk '{print $5}' | grep ":269" | cut -d ":" -f2)" + fi + clientport="${clientport:-"0"}" + defaultmap="${defaultmap:-"NOT SET"}" + maxplayers="${maxplayers:-"0"}" + port="${port:-"0"}" + queryport="${port:-"0"}" + rconpassword="${rconpassword:-"NOT SET"}" + rconport="${port:-"0"}" + servername="${servername:-"NOT SET"}" + serverpassword="${serverpassword:-"NOT SET"}" + # steamport="${steamport:-"0"}" Steamport is optional so we dont want it to show as not set. +} + +fn_info_game_spark() { + defaultmap="${defaultmap:-"NOT SET"}" + maxplayers="${maxplayers:-"0"}" + port="${port:-"0"}" + queryport="$((port + 1))" + servername="${servername:-"NOT SET"}" + serverpassword="${serverpassword:-"NOT SET"}" + httpuser="${httpuser:-"NOT SET"}" + httppassword="${httppassword:-"NOT SET"}" + httpport="${httpport:-"0"}" +} + +# Config Type: Custom (key-value pairs) +# Parameters: true +# Comment: # or // +# Example: ServerName="SERVERNAME" +# Filetype: cfg +fn_info_game_squad() { + if [ -f "${servercfgfullpath}" ]; then + fn_info_game_keyvalue_pairs "servername" "ServerName" + fn_info_game_keyvalue_pairs "maxplayers" "MaxPlayers" + fi + if [ -f "${servercfgdir}/Rcon.cfg" ]; then + fn_info_game_keyvalue_pairs "rconport" "Port" + fn_info_game_keyvalue_pairs "rconpassword" "Password" + fi + maxplayers="${maxplayers:-"0"}" + port="${port:-"0"}" + queryport="${queryport:-"0"}" + rconport="${rconport:-"0"}" + servername="${servername:-"NOT SET"}" + if [ -z "${rconpassword}" ] || [ ${#rconpassword} == 1 ]; then + rconpassword="NOT SET" + fi +} + +# Config Type: Custom (key-value pairs) +# Comment: # or // +# Example: ServerName="SERVERNAME" +# Filetype: cfg +fn_info_game_terraria() { + if [ -f "${servercfgfullpath}" ]; then + fn_info_game_keyvalue_pairs "maxplayers" "maxplayers" + fn_info_game_keyvalue_pairs "port" "port" + fn_info_game_keyvalue_pairs "servername" "worldname" + fn_info_game_keyvalue_pairs "worldname" "world" + fi + queryport="${port:-"0"}" + servername="${servername:-"NOT SET"}" + port="${port:-"0"}" + queryport="${queryport:-"0"}" + worldname="${worldname:-"NOT SET"}" + maxplayers="${maxplayers:-"0"}" +} + +# Config Type: QuakeC (custom) +# Comment: // or /* */ +# Example: set sv_hostname "SERVERNAME" +# Filetype: cfg +fn_info_game_tw() { + if [ -f "${servercfgfullpath}" ]; then + fn_info_game_quakec "servername" "sv_name" + fn_info_game_quakec "serverpassword" "password" + fn_info_game_quakec "rconpassword" "sv_rcon_password" + fn_info_game_quakec "port" "sv_port" + fn_info_game_quakec "maxplayers" "sv_max_clients" + fi + queryport="${port}" + servername=${servername:-"NOT SET"} + serverpassword=${serverpassword:-"NOT SET"} + rconpassword=${rconpassword:-"NOT SET"} port=${port:-"0"} - queryport=${queryport:-"0"} - defaultmap=${defaultmap:-"NOT SET"} + maxplayers=${maxplayers:-"0"} +} + +# Config Type: Parameters +fn_info_game_unt() { + servername="${selfname:-"NOT SET"}" + port="${port:-"0"}" + queryport="${port}" + steamport="$((port + 1))" } +# Config Type: Parameters fn_info_game_vh() { - # Parameters - port=${port:-"0"} + port="${port:-"0"}" # Query port only enabled if public server if [ "${public}" != "0" ]; then - queryport=$((port + 1)) + queryport="$((port + 1))" else querymode="1" fi - gameworld=${gameworld:-"NOT SET"} - serverpassword=${serverpassword:-"NOT SET"} - servername=${servername:-"NOT SET"} + worldname="${worldname:-"NOT SET"}" + serverpassword="${serverpassword:-"NOT SET"}" + servername="${servername:-"NOT SET"}" } +# Config Type: json +# Parameters: false +# Comment: // or /* */ fn_info_game_vints() { - if [ ! -f "${servercfgfullpath}" ]; then - servername="${unavailable}" - maxplayers="${unavailable}" - serverpassword="${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}") - configip=$(jq -r 'select(.Ip != null) | .Ip' "${servercfgfullpath}") - fi - queryport=${port:-"0"} - serverpassword=${serverpassword:-"NOT SET"} - configip=${configip:-"0.0.0.0"} + if [ -f "${servercfgfullpath}" ]; then + fn_info_game_json "configip" "select(.Ip != null) | .Ip" + fn_info_game_json "maxplayers" ".MaxClients" + fn_info_game_json "port" ".Port" + fn_info_game_json "servername" ".ServerName" + fn_info_game_json "serverpassword" "select(.Password != null) | .Password" + fi + configip="${configip:-"0.0.0.0"}" + maxplayers="${maxplayers:-"0"}" + port="${port:-"0"}" + queryport="${port:-"0"}" + servername="${servername:-"NOT SET"}" + serverpassword="${serverpassword:-"NOT SET"}" } +# Config Type: Java properties +# Comment: # or ! +# Example: motd=SERVERNAME +# Filetype: properties 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"} + if [ -f "${servercfgfullpath}" ]; then + fn_info_game_java_properties "servername" "motd" + fn_info_game_java_properties "bindaddress" "bind" fi - queryport=${port:-"25577"} + configip="$(echo "${bindaddress}" | cut -d ':' -f 1)" + port="$(echo "${bindaddress}" | cut -d ':' -f 2)" + queryport="${port:-"0"}" + servername="${servername:-"NOT SET"}" } +# Config Type: QuakeC +# Comment: // or /* */ +# Example: set sv_hostname "SERVERNAME" +# Filetype: cfg fn_info_game_wet() { - # Config - if [ ! -f "${servercfgfullpath}" ]; then - rconpassword="${unavailable}" - servername="${unavailable}" - serverpassword="${unavailable}" - maxplayers="${zero}" - port="${zero}" - queryport="${zero}" - else - port=$(grep "set net_port" "${servercfgfullpath}" | grep -v "//" | tr -cd '[:digit:]') - queryport="${port}" - rconpassword=$(grep "set zmq_rcon_password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set zmq_rcon_password //g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//g' -e '/^\//d' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - servername=$(grep "set sv_hostname" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set sv_hostname //g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - serverpassword=$(grep "set g_password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set g_password //g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - maxplayers=$(grep "set sv_maxclients" "${servercfgfullpath}" | grep -v "//" | tr -cd '[:digit:]') - configip=$(grep "set net_ip" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set net_ip//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - - # Not set - rconpassword=${rconpassword:-"NOT SET"} - servername=${servername:-"NOT SET"} - serverpassword=${serverpassword:-"NOT SET"} - maxplayers=${maxplayers:-"0"} - port=${port:-"27960"} - queryport=${queryport:-"27960"} - configip=${configip:-"0.0.0.0"} - fi -} - + if [ -f "${servercfgfullpath}" ]; then + fn_info_game_quakec "configip" "net_ip" + fn_info_game_quakec "maxplayers" "sv_maxclients" + fn_info_game_quakec "port" "net_port" + fn_info_game_quakec "rconpassword" "zmq_rcon_password" + fn_info_game_quakec "servername" "sv_hostname" + fn_info_game_quakec "serverpassword" "g_password" + fi + configip="${configip:-"0.0.0.0"}" + maxplayers="${maxplayers:-"0"}" + port="${port:-"0"}" + queryport="${queryport:-"0"}" + rconpassword="${rconpassword:-"NOT SET"}" + servername="${servername:-"NOT SET"}" + serverpassword="${serverpassword:-"NOT SET"}" +} + +# Config Type: QuakeC +# Comment: // or /* */ +# Example: set sv_hostname "SERVERNAME" +# Filetype: cfg fn_info_game_wf() { - # Config - if [ ! -f "${servercfgfullpath}" ]; then - rconpassword="${unavailable}" - servername="${unavailable}" - maxplayers="${zero}" - else - rconpassword=$(grep "rcon_password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set rcon_password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - servername=$(grep "sv_hostname" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set sv_hostname//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - maxplayers=$(grep "sv_maxclients" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') - - # Not set - rconpassword=${rconpassword:-"NOT SET"} - servername=${servername:-"NOT SET"} - maxplayers=${maxplayers:-"0"} - fi - - # Parameters - port=${port:-"0"} + if [ -f "${servercfgfullpath}" ]; then + fn_info_game_quakec "maxplayers" "sv_maxclients" + fn_info_game_quakec "rconpassword" "rcon_password" + fn_info_game_quakec "servername" "sv_hostname" + fi + httpport="${httpport:-"0"}" + maxplayers="${maxplayers:-"0"}" + port="${port:-"0"}" queryport="${port:-"0"}" - webadminport=${webadminport:-"0"} + rconpassword="${rconpassword:-"NOT SET"}" + servername="${servername:-"NOT SET"}" } fn_info_game_wmc() { @@ -2339,6 +2132,9 @@ fn_info_game_wmc() { fi } +# Config Type: custom (key-value) +# Comment: # +# Example: SERVERNAME=SERVERNAME fn_info_game_wurm() { # Config if [ ! -f "${servercfgfullpath}" ]; then @@ -2518,7 +2314,7 @@ elif [ "${shortname}" == "unt" ]; then elif [ "${shortname}" == "ut" ]; then fn_info_game_ut elif [ "${shortname}" == "ut2k4" ]; then - fn_info_game_unreal2k4 + fn_info_game_ut2k4 elif [ "${shortname}" == "ut3" ]; then fn_info_game_ut3 elif [ "${shortname}" == "ut99" ]; then @@ -2557,10 +2353,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 "Unable to get external IP address" - else + if [ "${exitcode}" == "0" ]; then echo "${extip}" > "${tmpdir}/extip.txt" + else + echo "Unable to get external IP address" fi else extip="$(cat "${tmpdir}/extip.txt")" @@ -2579,15 +2375,15 @@ fi # 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 [ -n "${ip}" ] && [ -n "${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}" 'if .response.servers != null then .response.servers[] | select((.gameport == ($port|tonumber) or .gameport == ($queryport|tonumber))) | .addr else empty end' | 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}" 'if .response.servers != null then .response.servers[] | select((.gameport == ($port|tonumber) or .gameport == ($queryport|tonumber))) | .addr else empty end' | wc -l 2> /dev/null)" fi if [ "${masterserver}" == "0" ]; then displaymasterserver="false" diff --git a/lgsm/modules/info_messages.sh b/lgsm/modules/info_messages.sh index 4dbbdcd96e..d112764c47 100644 --- a/lgsm/modules/info_messages.sh +++ b/lgsm/modules/info_messages.sh @@ -35,8 +35,8 @@ fn_info_message_password_strip() { statspassword="********" fi - if [ "${webadminpass}" ]; then - webadminpass="********" + if [ "${httppassword}" ]; then + httppassword="********" fi if [ "${telnetpass}" ]; then @@ -593,6 +593,12 @@ fn_info_message_script() { if [ -n "${networkcfgfullpath}" ]; then echo -e "${lightblue}Network config file:\t${default}${networkcfgfullpath}" fi + + # Cluster config file location (DST) + if [ -n "${clustercfgfullpath}" ]; then + echo -e "${lightblue}Cluster config file:\t${default}${clustercfgfullpath}" + fi + } | column -s $'\t' -t } @@ -803,7 +809,7 @@ fn_info_message_arma3() { fn_port "Game" port udp fn_port "Voice" voiceport udp fn_port "Query" queryport udp - fn_port "Steam Master" steammasterport udp + fn_port "Steam" steamport udp fn_port "Voice (unused)" voiceunusedport udp fn_port "BattleEye" battleeyeport udp } | column -s $'\t' -t @@ -823,8 +829,8 @@ fn_info_message_av() { fn_port "header" fn_port "Game" port udp fn_port "Query" queryport udp - fn_port "Steam Master" steammasterport udp - fn_port "Steam Query" steamqueryport udp + fn_port "Steam" steamport udp + fn_port "Steamworks P2P" steamworksport udp fn_port "RCON" rconport tcp } | column -s $'\t' -t } @@ -962,7 +968,7 @@ fn_info_message_dayz() { fn_port "header" fn_port "Game" port udp fn_port "Query Steam" queryport udp - fn_port "Steam Master" steammasterport udp + fn_port "Steam" steamport udp fn_port "BattleEye" battleeyeport udp } | column -s $'\t' -t } @@ -980,8 +986,8 @@ fn_info_message_dst() { fn_port "header" fn_port "Game: Server" port udp fn_port "Game: Master" masterport udp + fn_port "Steam" steamport udp fn_port "Steam: Auth" steamauthport udp - fn_port "Steam: Master" steammasterport udp } | column -s $'\t' -t } @@ -989,7 +995,7 @@ fn_info_message_eco() { { fn_port "header" fn_port "Game" port udp - fn_port "Web Admin" webadminport tcp + fn_port "Web Interface" httpport tcp } | column -s $'\t' -t } @@ -1076,19 +1082,19 @@ fn_info_message_kf() { fn_port "Game" port udp fn_port "Query" queryport udp fn_port "Query (GameSpy)" queryportgs udp - fn_port "Web Admin" webadminport tcp + fn_port "Web Interface" httpport tcp fn_port "LAN" lanport udp + fn_port "Steamworks P2P" steamworksport 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}" + echo -e "${lightgreen}${servername} Web Interface${default}" fn_messages_separator { - echo -e "${lightblue}Web Admin enabled:\t${default}${webadminenabled}" - echo -e "${lightblue}Web Admin url:\t${default}http://${webadminip}:${webadminport}" - echo -e "${lightblue}Web Admin username:\t${default}${webadminuser}" - echo -e "${lightblue}Web Admin password:\t${default}${webadminpass}" + echo -e "${lightblue}Web Interface enabled:\t${default}${httpenabled}" + echo -e "${lightblue}Web Interface url:\t${default}http://${httpip}:${httpport}" + echo -e "${lightblue}Web Interface username:\t${default}${httpuser}" + echo -e "${lightblue}Web Interface password:\t${default}${httppassword}" } | column -s $'\t' -t } @@ -1098,16 +1104,16 @@ fn_info_message_kf2() { fn_port "header" fn_port "Game" port udp fn_port "Query" queryport udp - fn_port "Web Admin" webadminport tcp + fn_port "Web Interface" httpport tcp } | column -s $'\t' -t echo -e "" - echo -e "${lightgreen}${servername} Web Admin${default}" + echo -e "${lightgreen}${servername} Web Interface${default}" fn_messages_separator { - echo -e "${lightblue}Web Admin enabled:\t${default}${webadminenabled}" - echo -e "${lightblue}Web Admin url:\t${default}http://${webadminip}:${webadminport}" - echo -e "${lightblue}Web Admin username:\t${default}${webadminuser}" - echo -e "${lightblue}Web Admin password:\t${default}${webadminpass}" + echo -e "${lightblue}Web Interface enabled:\t${default}${httpenabled}" + echo -e "${lightblue}Web Interface url:\t${default}http://${httpip}:${httpport}" + echo -e "${lightblue}Web Interface username:\t${default}${httpuser}" + echo -e "${lightblue}Web Interface password:\t${default}${httppassword}" } | column -s $'\t' -t } @@ -1193,6 +1199,15 @@ fn_info_message_pc() { fn_port "Game" port udp fn_port "Query" queryport udp fn_port "Steam" steamport udp + fn_port "HTTP" httpport tcp + fn_port "API" apiport tcp + } | column -s $'\t' -t + echo -e "" + echo -e "${lightgreen}${gamename} Web Interface${default}" + fn_messages_separator + { + echo -e "${lightblue}Web Interface enabled:\t${default}${httpenabled}" + echo -e "${lightblue}Web Interface url:\t${default}http://${httpip}:${httpport}" } | column -s $'\t' -t } @@ -1268,19 +1283,19 @@ fn_info_message_ro() { fn_port "header" fn_port "Game" port udp fn_port "Query" queryport udp - fn_port "Web Admin" webadminport tcp + fn_port "Web Interface" httpport tcp fn_port "LAN" lanport udp + fn_port "Steamworks P2P" steamworksport 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}" + echo -e "${lightgreen}${servername} Web Interface${default}" fn_messages_separator { - echo -e "${lightblue}Web Admin enabled:\t${default}${webadminenabled}" - echo -e "${lightblue}Web Admin url:\t${default}http://${webadminip}:${webadminport}" - echo -e "${lightblue}Web Admin username:\t${default}${webadminuser}" - echo -e "${lightblue}Web Admin password:\t${default}${webadminpass}" + echo -e "${lightblue}Web Interface enabled:\t${default}${httpenabled}" + echo -e "${lightblue}Web Interface url:\t${default}http://${httpip}:${httpport}" + echo -e "${lightblue}Web Interface username:\t${default}${httpuser}" + echo -e "${lightblue}Web Interface password:\t${default}${httppassword}" } | column -s $'\t' -t } @@ -1356,17 +1371,17 @@ fn_info_message_sdtd() { fn_port "Game" port udp fn_port "Game+2" port3 udp fn_port "Query" queryport tcp - fn_port "Web Admin" webadminport tcp + fn_port "Web Interface" httpport tcp fn_port "Telnet" telnetport tcp } | column -s $'\t' -t echo -e "" - echo -e "${lightgreen}${gamename} Web Admin${default}" + echo -e "${lightgreen}${gamename} Web Interface${default}" fn_messages_separator { - echo -e "${lightblue}Web Admin enabled:\t${default}${webadminenabled}" - echo -e "${lightblue}Web Admin url:\t${default}http://${webadminip}:${webadminport}/index.html" - echo -e "${lightblue}Web Admin username:\t${default}${webadminuser}" - echo -e "${lightblue}Web Admin password:\t${default}${webadminpass}" + echo -e "${lightblue}Web Interface enabled:\t${default}${httpenabled}" + echo -e "${lightblue}Web Interface url:\t${default}http://${httpip}:${httpport}/index.html" + echo -e "${lightblue}Web Interface username:\t${default}${httpuser}" + echo -e "${lightblue}Web Interface password:\t${default}${httppassword}" } | column -s $'\t' -t echo -e "" echo -e "${lightgreen}${gamename} Telnet${default}" @@ -1433,15 +1448,15 @@ fn_info_message_spark() { fn_port "header" fn_port "Game" port udp fn_port "Query" queryport udp - fn_port "Web Admin" webadminport tcp + fn_port "Web Interface" httpport tcp } | column -s $'\t' -t echo -e "" - echo -e "${lightgreen}${gamename} Web Admin${default}" + echo -e "${lightgreen}${gamename} Web Interface${default}" fn_messages_separator { - echo -e "${lightblue}Web Admin url:\t${default}http://${webadminip}:${webadminport}/index.html" - echo -e "${lightblue}Web Admin username:\t${default}${webadminuser}" - echo -e "${lightblue}Web Admin password:\t${default}${webadminpass}" + echo -e "${lightblue}Web Interface url:\t${default}http://${httpip}:${httpport}/index.html" + echo -e "${lightblue}Web Interface username:\t${default}${httpuser}" + echo -e "${lightblue}Web Interface password:\t${default}${httppassword}" } | column -s $'\t' -t } @@ -1459,13 +1474,13 @@ fn_info_message_st() { fn_port "header" fn_port "Game" port udp fn_port "Query" queryport udp - fn_port "Web Admin" webadminport tcp + fn_port "Web Interface" httpport tcp } | column -s $'\t' -t echo -e "" - echo -e "${lightgreen}${gamename} Web Admin${default}" + echo -e "${lightgreen}${gamename} Web Interface${default}" fn_messages_separator { - echo -e "${lightblue}Web Admin url:\t${default}http://${webadminip}:${webadminport}" + echo -e "${lightblue}Web Interface url:\t${default}http://${httpip}:${httpport}" } | column -s $'\t' -t } @@ -1515,63 +1530,42 @@ fn_info_message_tu() { } | column -s $'\t' -t } -fn_info_message_unreal() { - fn_info_message_password_strip - { - fn_port "header" - fn_port "Game" port udp - fn_port "Query" queryport udp - fn_port "LAN Beacon" beaconport udp - fn_port "Web Admin" webadminport tcp - } | column -s $'\t' -t - echo -e "" - echo -e "${lightgreen}${servername} Web Admin${default}" - fn_messages_separator - { - echo -e "${lightblue}Web Admin enabled:\t${default}${webadminenabled}" - echo -e "${lightblue}Web Admin url:\t${default}http://${webadminip}:${webadminport}" - echo -e "${lightblue}Web Admin username:\t${default}${webadminuser}" - echo -e "${lightblue}Web Admin password:\t${default}${webadminpass}" - } | column -s $'\t' -t -} - 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 "Web Interface" httpport tcp fn_port "LAN" lanport udp } | column -s $'\t' -t echo -e "" - echo -e "${lightgreen}${servername} Web Admin${default}" + echo -e "${lightgreen}${servername} Web Interface${default}" fn_messages_separator { - echo -e "${lightblue}Web Admin enabled:\t${default}${webadminenabled}" - echo -e "${lightblue}Web Admin url:\t${default}http://${webadminip}:${webadminport}" - echo -e "${lightblue}Web Admin username:\t${default}${webadminuser}" - echo -e "${lightblue}Web Admin password:\t${default}${webadminpass}" + echo -e "${lightblue}Web Interface enabled:\t${default}${httpenabled}" + echo -e "${lightblue}Web Interface url:\t${default}http://${httpip}:${httpport}" + echo -e "${lightblue}Web Interface username:\t${default}${httpuser}" + echo -e "${lightblue}Web Interface password:\t${default}${httppassword}" } | column -s $'\t' -t } fn_info_message_unreal() { - fn_info_message_password_strip { fn_port "header" fn_port "Game" port udp fn_port "Query" queryport udp fn_port "LAN Beacon" beaconport udp - fn_port "Web Admin" webadminport tcp + fn_port "Web Interface" httpport tcp } | column -s $'\t' -t echo -e "" - echo -e "${lightgreen}${servername} Web Admin${default}" + echo -e "${lightgreen}${servername} Web Interface${default}" fn_messages_separator { - echo -e "${lightblue}Web Admin enabled:\t${default}${webadminenabled}" - echo -e "${lightblue}Web Admin url:\t${default}http://${webadminip}:${webadminport}" - echo -e "${lightblue}Web Admin username:\t${default}${webadminuser}" - echo -e "${lightblue}Web Admin password:\t${default}${webadminpass}" + echo -e "${lightblue}Web Interface enabled:\t${default}${httpenabled}" + echo -e "${lightblue}Web Interface url:\t${default}http://${httpip}:${httpport}" + echo -e "${lightblue}Web Interface username:\t${default}${httpuser}" + echo -e "${lightblue}Web Interface password:\t${default}${httppassword}" } | column -s $'\t' -t } @@ -1598,16 +1592,16 @@ fn_info_message_ut3() { fn_port "header" fn_port "Game" port udp fn_port "Query" queryport udp - fn_port "Web Admin" webadminport tcp + fn_port "Web Interface" httpport tcp } | column -s $'\t' -t echo -e "" - echo -e "${lightgreen}${servername} Web Admin${default}" + echo -e "${lightgreen}${servername} Web Interface${default}" fn_messages_separator { - echo -e "${lightblue}Web Admin enabled:\t${default}${webadminenabled}" - echo -e "${lightblue}Web Admin url:\t${default}http://${webadminip}:${webadminport}" - echo -e "${lightblue}Web Admin username:\t${default}${webadminuser}" - echo -e "${lightblue}Web Admin password:\t${default}${webadminpass}" + echo -e "${lightblue}Web Interface enabled:\t${default}${httpenabled}" + echo -e "${lightblue}Web Interface url:\t${default}http://${httpip}:${httpport}" + echo -e "${lightblue}Web Interface username:\t${default}${httpuser}" + echo -e "${lightblue}Web Interface password:\t${default}${httppassword}" } | column -s $'\t' -t } diff --git a/lgsm/modules/install_config.sh b/lgsm/modules/install_config.sh index 699a919c3a..b395390204 100644 --- a/lgsm/modules/install_config.sh +++ b/lgsm/modules/install_config.sh @@ -452,6 +452,9 @@ elif [ "${shortname}" == "eco" ]; then fn_default_config_remote fn_set_config_vars fn_list_config_locations +elif [ "${shortname}" == "em" ]; then + fn_default_config_local + fn_list_config_locations elif [ "${shortname}" == "etl" ]; then gamedirname="ETLegacy" array_configs+=(server.cfg) diff --git a/package-lock.json b/package-lock.json index b592f5beaf..8532248e02 100644 --- a/package-lock.json +++ b/package-lock.json @@ -7,7 +7,7 @@ "name": "linuxgsm", "license": "MIT", "devDependencies": { - "prettier": "^2.7.1", + "prettier": "^2.8.8", "prettier-plugin-sh": "^0.12.8" } }, @@ -127,9 +127,9 @@ "dev": true }, "node_modules/open": { - "version": "8.4.1", - "resolved": "https://registry.npmjs.org/open/-/open-8.4.1.tgz", - "integrity": "sha512-/4b7qZNhv6Uhd7jjnREh1NjnPxlTq+XNWPG88Ydkj5AILcA5m3ajvcg57pB24EQjKv0dK62XnDqk9c/hkIG5Kg==", + "version": "8.4.2", + "resolved": "https://registry.npmjs.org/open/-/open-8.4.2.tgz", + "integrity": "sha512-7x81NCL719oNbsq/3mh+hVrAWmFuEYUqrq/Iw3kUzH8ReypT9QQ0BLoJS7/G9k6N81XjW4qHWtjWwe/9eLy1EQ==", "dev": true, "dependencies": { "define-lazy-prop": "^2.0.0", @@ -159,9 +159,9 @@ "dev": true }, "node_modules/prettier": { - "version": "2.8.4", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.4.tgz", - "integrity": "sha512-vIS4Rlc2FNh0BySk3Wkd6xmwxB0FpOndW5fisM5H8hsZSxU2VWVB5CWIkIjWvrHjIhxk2g3bfMKM87zNTrZddw==", + "version": "2.8.8", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.8.tgz", + "integrity": "sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==", "dev": true, "bin": { "prettier": "bin-prettier.js" diff --git a/package.json b/package.json index c62ce31759..f3d3df0fdd 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,7 @@ "test": "tests" }, "devDependencies": { - "prettier": "^2.7.1", + "prettier": "^2.8.8", "prettier-plugin-sh": "^0.12.8" }, "scripts": { From 7fec81015c3dbda53055b80854853501fe857a56 Mon Sep 17 00:00:00 2001 From: Nicolas Le Cam Date: Tue, 16 May 2023 22:03:25 +0200 Subject: [PATCH 049/181] feat(pz): Add option to configure server memory usage (#4204) --- lgsm/config-default/config-lgsm/pzserver/_default.cfg | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lgsm/config-default/config-lgsm/pzserver/_default.cfg b/lgsm/config-default/config-lgsm/pzserver/_default.cfg index 399c43f0fd..55c3f587b7 100644 --- a/lgsm/config-default/config-lgsm/pzserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/pzserver/_default.cfg @@ -10,10 +10,11 @@ ## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters ip="0.0.0.0" +javaram="8192" # -Xmx$8192M 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} -Xmx${javaram}M" #### LinuxGSM Settings #### From a498a8830307ab5cb87acebf1064370e69592baa Mon Sep 17 00:00:00 2001 From: Nicolas Le Cam Date: Tue, 16 May 2023 22:18:32 +0200 Subject: [PATCH 050/181] feat(deps): Add depencency support for Debian 12 (bookworm) (#4203) * feat(deps): Add depencency support for Debian 12 (bookworm) * add xmllint --------- Co-authored-by: Daniel Gibbs --- .github/ISSUE_TEMPLATE/bug_report.yml | 1 + .github/ISSUE_TEMPLATE/feature_request.yml | 1 + lgsm/data/debian-12.csv | 131 +++++++++++++++++++++ 3 files changed, 133 insertions(+) create mode 100644 lgsm/data/debian-12.csv diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml index f0837b1086..2b339d1224 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -34,6 +34,7 @@ body: - Ubuntu 20.04 - Ubuntu 18.04 - Ubuntu 16.04 + - Debian 12 - Debian 11 - Debian 10 - Debian 9 diff --git a/.github/ISSUE_TEMPLATE/feature_request.yml b/.github/ISSUE_TEMPLATE/feature_request.yml index fb06052ac9..45aced3d1f 100644 --- a/.github/ISSUE_TEMPLATE/feature_request.yml +++ b/.github/ISSUE_TEMPLATE/feature_request.yml @@ -34,6 +34,7 @@ body: - Ubuntu 20.04 - Ubuntu 18.04 - Ubuntu 16.04 + - Debian 12 - Debian 11 - Debian 10 - Debian 9 diff --git a/lgsm/data/debian-12.csv b/lgsm/data/debian-12.csv new file mode 100644 index 0000000000..3f3e0aed1e --- /dev/null +++ b/lgsm/data/debian-12.csv @@ -0,0 +1,131 @@ +all,bc,binutils,bsdmainutils,bzip2,ca-certificates,cpio,curl,distro-info,file,gzip,hostname,jq,lib32gcc-s1,lib32stdc++6,netcat-traditional,python3,tar,tmux,unzip,util-linux,wget,xz-utils +steamcmd,lib32gcc-s1,lib32stdc++6,libsdl2-2.0-0:i386,steamcmd +ac +ahl +ahl2 +ark +arma3 +armar,libcurl4 +ats +av +bb +bb2,libcurl4-gnutls-dev:i386 +bd +bf1942,libncurses5:i386,libtinfo5:i386 +bfv,libncurses5:i386,libstdc++5:i386 +bmdm,libncurses5:i386 +bo +bs +bt,libicu-dev,dos2unix +btl +cc +cd +ck,xvfb +cmw +cod,libstdc++5:i386 +cod2,libstdc++5:i386 +cod4 +coduo,libstdc++5:i386 +codwaw +col +cs +cscz +csgo +css,libtinfo5:i386 +dab +dayz +dmc +dod +dodr +dods +doi +dst,libcurl4-gnutls-dev:i386 +dys +eco,libgdiplus +em +etl +ets2 +fctr +fof +gmod,libtinfo5:i386 +hl2dm +hldm +hldms +hw,lib32z1 +ins +inss +ios +jc2 +jc3 +jk2 +kf +kf2 +l4d +l4d2 +lo +mc,openjdk-17-jre +mcb +mh +mohaa,libstdc++5:i386 +mom +mta,libncursesw5,libxml2-utils +nd +nec +nmrih,libtinfo5:i386 +ns +ns2,speex,libtbb12 +ns2c,speex:i386,libtbb12 +onset,libmariadb-dev +opfor +pc +pmc,openjdk-17-jre +pstbs,libgconf-2-4 +pvkii +pvr,libc++1 +pz,openjdk-17-jre,rng-tools5 +q2 +q3 +ql +qw +ricochet +ro +rtcw +rust,lib32z1 +rw,openjdk-17-jre +samp +sb +sbots +scpsl,mono-complete +scpslsm,mono-complete +sdtd,telnet,expect,libxml2-utils +sf +sfc,libtinfo5:i386 +sof2 +sol +squad +st +stn +sven,libssl3:i386,zlib1g:i386 +terraria +tf2,libcurl4-gnutls-dev:i386 +tfc +ti +ts +ts3 +tu +tw +unt +ut +ut2k4 +ut3 +ut99 +vh,libc6-dev +vints,mono-complete +vpmc,openjdk-17-jre +vs +wet +wf +wmc,openjdk-17-jre +wurm,xvfb +zmr,libtinfo5:i386 +zps,libtinfo5:i386 From ecc9934d43baa5613baa4bed2990ef6f26506ab6 Mon Sep 17 00:00:00 2001 From: Christian Date: Tue, 16 May 2023 22:30:00 +0200 Subject: [PATCH 051/181] fix(tiserver): fix and update to latest version (#4190) * fix(tiserver): fix and update to latest version * update ti details --------- Co-authored-by: Daniel Gibbs --- .../config-default/config-lgsm/tiserver/_default.cfg | 5 ++++- lgsm/modules/info_game.sh | 12 +++++++++--- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/lgsm/config-default/config-lgsm/tiserver/_default.cfg b/lgsm/config-default/config-lgsm/tiserver/_default.cfg index f31864df30..652c9430e4 100644 --- a/lgsm/config-default/config-lgsm/tiserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/tiserver/_default.cfg @@ -15,8 +15,11 @@ queryport="27015" # Possible maps, see: https://isle.fandom.com/wiki/The_Isle_Server_Settings_and_Configuration#Optional_Maps map="" +# EAC start parameters +eaclaunch="-ini:Engine:[EpicOnlineServices]:DedicatedServerClientId=xyza7891gk5PRo3J7G9puCJGFJjmEguW -ini:Engine:[EpicOnlineServices]:DedicatedServerClientSecret=pKWl6t5i9NJK8gTpVlAxzENZ65P8hYzodV8Dqe5Rlc8" + ## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters -startparameters="${map} -MultiHome=${ip} -Port=${port} -QueryPort=${queryport} -log" +startparameters="${map} -MultiHome=${ip} -Port=${port} -QueryPort=${queryport} -log ${eaclaunch}" #### LinuxGSM Settings #### diff --git a/lgsm/modules/info_game.sh b/lgsm/modules/info_game.sh index ff77f8471f..2f32abf537 100644 --- a/lgsm/modules/info_game.sh +++ b/lgsm/modules/info_game.sh @@ -653,12 +653,18 @@ fn_info_game_stn() { # Filetype: ini fn_info_game_ti() { if [ -f "${servercfgfullpath}" ]; then - fn_info_game_ini "servername" "ServerName" fn_info_game_ini "maxplayers" "MaxPlayerCount" + fn_info_game_ini "queueenabled" "QueueEnabled" + fn_info_game_ini "queueport" "QueuePort" + fn_info_game_ini "rconenabled" "RconEnabled" + fn_info_game_ini "rconport" "RconPort" + fn_info_game_ini "servername" "ServerName" fi maxplayers="${maxplayers:-"0"}" - port="${port:-"0"}" - queryport="${queryport:-"0"}" + queueenabled="${queueenabled:-"NOT SET"}" + queueport="${queueport:-"0"}" + rconenabled="${rconenabled:-"NOT SET"}" + rconport="${rconport:-"0"}" servername="${servername:-"NOT SET"}" } From fae50c4c653deff8109dbdd6cb6974b2001f7f9f Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Thu, 18 May 2023 13:25:31 +0100 Subject: [PATCH 052/181] feat: optimise gamedig and master server query (#4206) * feat: update gamedig cli commands will speed up querying of servers * feat: master server query will now use extip first extip more likely to succeed thus will speed up query * minor tweaks * bug * ports alphabetical a * reduce gsquery timeout to 2s * display ss command output --- lgsm/modules/check_ip.sh | 10 +-- lgsm/modules/command_dev_query_raw.sh | 117 ++++++++++++++------------ lgsm/modules/info_game.sh | 13 +-- lgsm/modules/info_messages.sh | 17 ++-- lgsm/modules/query_gamedig.sh | 11 +-- lgsm/modules/query_gsquery.py | 2 +- 6 files changed, 89 insertions(+), 81 deletions(-) diff --git a/lgsm/modules/check_ip.sh b/lgsm/modules/check_ip.sh index a2a16298ca..7671429cd4 100644 --- a/lgsm/modules/check_ip.sh +++ b/lgsm/modules/check_ip.sh @@ -10,7 +10,7 @@ moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" info_game.sh -ip_commands_array=("/bin/ip" "/usr/sbin/ip" "ip") +ip_commands_array=("ip" "/bin/ip" "/usr/sbin/ip") for ip_command in "${ip_commands_array[@]}"; do if [ "$(command -v "${ip_command}" 2> /dev/null)" ]; then ipcommand="${ip_command}" @@ -18,7 +18,7 @@ for ip_command in "${ip_commands_array[@]}"; do fi done -ethtool_commands_array=("/bin/ethtool" "/usr/sbin/ethtool" "ethtool") +ethtool_commands_array=("ethtool" "/bin/ethtool" "/usr/sbin/ethtool") for ethtool_command in "${ethtool_commands_array[@]}"; do if [ "$(command -v "${ethtool_command}" 2> /dev/null)" ]; then ethtoolcommand="${ethtool_command}" @@ -34,21 +34,21 @@ function fn_is_valid_ip() { grep -qEe '^[1-9]+[0-9]*\.[0-9]+\.[0-9]+\.[0-9]+$' <<< "${ip}" } -# Check if server has multiple IP addresses +# Check if server has multiple IP addresses. # If the IP variable has been set by user. if fn_is_valid_ip "${ip}"; then queryips=("${ip}") httpip=("${ip}") telnetip=("${ip}") -# If game config does have an IP set. +# If the game config has an IP set. elif fn_is_valid_ip "${configip}"; then queryips=("${configip}") ip="${configip}" httpip=("${configip}") telnetip=("${configip}") # If there is only 1 server IP address. -# Some IP details can automaticly use the one IP +# Some IP details can automatically use the one IP. elif [ "${#current_ips[@]}" == "1" ]; then queryips=("127.0.0.1" "${current_ips[@]}") ip="0.0.0.0" diff --git a/lgsm/modules/command_dev_query_raw.sh b/lgsm/modules/command_dev_query_raw.sh index d75d12f313..a2cfa1f687 100644 --- a/lgsm/modules/command_dev_query_raw.sh +++ b/lgsm/modules/command_dev_query_raw.sh @@ -51,17 +51,20 @@ echo -e "==================================================================" echo -e "Game+3:" fi fi - - if [ -v port401 ]; then - echo -e "Game+400: \t${port401} \t$(ss -tupl | grep -c "${port401}") \t$(ss -tupl | grep "${port401}" | grep tcp | awk '{ print $2 }') \t$(ss -tupl | grep "${port401}" | grep udp | awk '{ print $2 }')" - else - echo -e "Game+400:" + if [ "${shortname}" == "pvr" ]; then + if [ -v port401 ]; then + echo -e "Game+400: \t${port401} \t$(ss -tupl | grep -c "${port401}") \t$(ss -tupl | grep "${port401}" | grep tcp | awk '{ print $2 }') \t$(ss -tupl | grep "${port401}" | grep udp | awk '{ print $2 }')" + else + echo -e "Game+400:" + fi fi - if [ -v portipv6 ]; then - 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:" + if [ "${shortname}" == "mcb" ]; then + if [ -v portipv6 ]; then + 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 fi if [ -v queryport ]; then @@ -70,6 +73,42 @@ echo -e "==================================================================" echo -e "Query:" fi + if [ -v apiport ]; then + echo -e "Game: \t${apiport} \t$(ss -tupl | grep -c "${apiport}") \t$(ss -tupl | grep "${apiport}" | grep tcp | awk '{ print $2 }') \t$(ss -tupl | grep "${apiport}" | grep udp | awk '{ print $2 }')" + else + echo -e "API:" + fi + + if [ -v appport ]; then + 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 battleeyeport ]; then + 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 beaconport ]; then + 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 clientport ]; then + 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 fileport ]; then + 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 httpport ]; then 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 @@ -77,7 +116,7 @@ echo -e "==================================================================" fi if [ -v httpqueryport ]; then - 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 }')" + 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 @@ -88,16 +127,10 @@ echo -e "==================================================================" echo -e "Web Interface:" fi - if [ -v clientport ]; then - 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 -c "${rconport}") \t$(ss -tupl | grep "${rconport}" | grep tcp | awk '{ print $2 }') \t$(ss -tupl | grep "${rconport}" | grep udp | awk '{ print $2 }')" + if [ -v masterport ]; then + 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 "RCON:" + echo -e "Game: Master:" fi if [ -v rawport ]; then @@ -106,10 +139,10 @@ echo -e "==================================================================" echo -e "RAW UDP Socket:" fi - if [ -v masterport ]; then - 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 }')" + if [ -v rconport ]; then + 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 "Game: Master:" + echo -e "RCON:" fi if [ -v steamport ]; then @@ -130,34 +163,22 @@ echo -e "==================================================================" echo -e "Steam: Auth:" fi - if [ -v beaconport ]; then - 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 -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 -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 -c "${sourcetvport}") \t$(ss -tupl | grep "${sourcetvport}" | grep tcp | awk '{ print $2 }') \t$(ss -tupl | grep "${sourcetvport}" | grep udp | awk '{ print $2 }')" + if [ -v statsport ]; then + 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 "SourceTV:" + echo -e "Stats:" fi - if [ -v fileport ]; then - 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 }')" + if [ -v sourcetvport ]; then + 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 "File:" + echo -e "SourceTV:" fi if [ -v udplinkport ]; then @@ -178,23 +199,13 @@ echo -e "==================================================================" echo -e "Voice (Unused):" fi - if [ -v battleeyeport ]; then - 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 -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 - -} | column -s $'\t' -t +} \ + | column -s $'\t' -t echo -e "" echo -e "${lightgreen}SS Output${default}" echo -e "=================================" fn_info_message_ports +eval "${portcommand}" echo -e "" echo -e "${lightgreen}Query Port - Raw Output${default}" echo -e "==================================================================" diff --git a/lgsm/modules/info_game.sh b/lgsm/modules/info_game.sh index 2f32abf537..52ddfb0086 100644 --- a/lgsm/modules/info_game.sh +++ b/lgsm/modules/info_game.sh @@ -2383,13 +2383,14 @@ if [ -z "${displaymasterserver}" ]; then if [ "$(command -v jq 2> /dev/null)" ]; then if [ -n "${ip}" ] && [ -n "${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}" 'if .response.servers != null then .response.servers[] | select((.gameport == ($port|tonumber) or .gameport == ($queryport|tonumber))) | .addr else empty end' | wc -l 2> /dev/null)" - done - # Should that not work it will try the external IP. + # Query external IP first as most liky to succeed. + 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}" 'if .response.servers != null then .response.servers[] | select((.gameport == ($port|tonumber) or .gameport == ($queryport|tonumber))) | .addr else empty end' | wc -l 2> /dev/null)" + 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}" 'if .response.servers != null then .response.servers[] | select((.gameport == ($port|tonumber) or .gameport == ($queryport|tonumber))) | .addr else empty end' | wc -l 2> /dev/null)" + # Loop though server IP addresses if external IP fails. + 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}" 'if .response.servers != null then .response.servers[] | select((.gameport == ($port|tonumber) or .gameport == ($queryport|tonumber))) | .addr else empty end' | wc -l 2> /dev/null)" + done fi if [ "${masterserver}" == "0" ]; then displaymasterserver="false" diff --git a/lgsm/modules/info_messages.sh b/lgsm/modules/info_messages.sh index d112764c47..cc2463af1e 100644 --- a/lgsm/modules/info_messages.sh +++ b/lgsm/modules/info_messages.sh @@ -688,23 +688,24 @@ fn_info_message_ports_edit() { fn_info_message_ports() { echo -e "${lightblue}Useful port diagnostic command:${default}" if [ "${shortname}" == "armar" ]; then - echo -e "ss -tuplwn | grep enfMain" + portcommand="ss -tuplwn | grep enfMain" elif [ "${shortname}" == "av" ]; then - echo -e "ss -tuplwn | grep AvorionServer" + portcommand="ss -tuplwn | grep AvorionServer" elif [ "${shortname}" == "bf1942" ]; then - echo -e "ss -tuplwn | grep bf1942_lnxded" + portcommand="ss -tuplwn | grep bf1942_lnxded" elif [ "${shortname}" == "mc" ] || [ "${shortname}" == "nec" ] || [ "${shortname}" == "pmc" ] || [ "${shortname}" == "rw" ] || [ "${shortname}" == "vpmc" ] || [ "${shortname}" == "wmc" ]; then - echo -e "ss -tuplwn | grep java" + portcommand="ss -tuplwn | grep java" elif [ "${shortname}" == "terraria" ]; then - echo -e "ss -tuplwn | grep Main" + portcommand="ss -tuplwn | grep Main" elif [ "${engine}" == "source" ]; then - echo -e "ss -tuplwn | grep srcds_linux" + portcommand="ss -tuplwn | grep srcds_linux" elif [ "${engine}" == "goldsrc" ]; then - echo -e "ss -tuplwn | grep hlds_linux" + portcommand="ss -tuplwn | grep hlds_linux" else executableshort="$(basename "${executable}" | cut -c -15)" - echo -e "ss -tuplwn | grep ${executableshort}" + portcommand="ss -tuplwn | grep ${executableshort}" fi + echo -e "${portcommand}" echo -e "" } diff --git a/lgsm/modules/query_gamedig.sh b/lgsm/modules/query_gamedig.sh index bbf24f5d79..138e014a06 100644 --- a/lgsm/modules/query_gamedig.sh +++ b/lgsm/modules/query_gamedig.sh @@ -7,6 +7,7 @@ # https://github.com/sonicsnes/node-gamedig moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +# Default query status to failure. Will be changed to 0 if query is successful. querystatus="2" # Check if gamedig and jq are installed. if [ "$(command -v gamedig 2> /dev/null)" ] && [ "$(command -v jq 2> /dev/null)" ]; then @@ -19,16 +20,10 @@ if [ "$(command -v gamedig 2> /dev/null)" ] && [ "$(command -v jq 2> /dev/null)" queryport="${port}" fi # checks if query is working null = pass. - gamedigcmd=$(echo -e "gamedig --type \"${querytype}\" --host \"${queryip}\" --query_port \"${queryport}\"|jq") - gamedigraw=$(gamedig --type "${querytype}" --host "${queryip}" --query_port "${queryport}") + gamedigcmd=$(echo -e "gamedig --type \"${querytype}\" \"${queryip}:${queryport}\"|jq") + gamedigraw=$(gamedig --type "${querytype}" "${queryip}:${queryport}") querystatus=$(echo "${gamedigraw}" | jq '.error|length') - if [ "${querystatus}" != "null" ]; then - gamedigcmd=$(echo -e "gamedig --type \"${querytype}\" --host \"${queryip}\" --port \"${queryport}\"|jq") - gamedigraw=$(gamedig --type "${querytype}" --host "${queryip}" --port "${queryport}") - querystatus=$(echo "${gamedigraw}" | jq '.error|length') - fi - if [ "${querytype}" == "teamspeak3" ]; then fn_info_game_ts3 fi diff --git a/lgsm/modules/query_gsquery.py b/lgsm/modules/query_gsquery.py index 09bb147d95..9fbb6a2541 100644 --- a/lgsm/modules/query_gsquery.py +++ b/lgsm/modules/query_gsquery.py @@ -13,7 +13,7 @@ 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 + server_response_timeout = 2 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') From 5997f8b1b5a07d36d4b9f03924b56c9c21e83eda Mon Sep 17 00:00:00 2001 From: Christian Date: Thu, 18 May 2023 17:13:43 +0200 Subject: [PATCH 053/181] fix(hwserver): fix startup and change logging (#4189) * fix(hwserver): fix startup and change logging * Update info_game.sh --------- Co-authored-by: Daniel Gibbs --- lgsm/config-default/config-lgsm/hwserver/_default.cfg | 3 +-- lgsm/modules/info_game.sh | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/lgsm/config-default/config-lgsm/hwserver/_default.cfg b/lgsm/config-default/config-lgsm/hwserver/_default.cfg index 6f156f9d95..fddcfebfa5 100644 --- a/lgsm/config-default/config-lgsm/hwserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/hwserver/_default.cfg @@ -16,7 +16,6 @@ queryport="12881" maxplayers="20" defaultmap="" # Optional creativemode="0" # Free Build: creativemode="1" -gamelog="gamelog.txt" ## Add admins using STEAMID64 # Example : addadmin 012345678901234567; addadmin 987654321098765432 @@ -28,7 +27,7 @@ loadsave="" ## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters # Edit with care | http://hurtworld.wikia.com/wiki/Hosting_A_Server -startparameters="-batchmode -nographics -exec \"host ${port} ${defaultmap} ${loadsave};queryport ${queryport};maxplayers ${maxplayers};servername ${servername};creativemode ${creativemode};${admins}\"" +startparameters="-batchmode -nographics -logfile ${gamelog} -exec \"host ${port} ${defaultmap} ${loadsave};queryport ${queryport};maxplayers ${maxplayers};servername ${servername};creativemode ${creativemode};${admins}\"" #### LinuxGSM Settings #### diff --git a/lgsm/modules/info_game.sh b/lgsm/modules/info_game.sh index 52ddfb0086..be0286a5c2 100644 --- a/lgsm/modules/info_game.sh +++ b/lgsm/modules/info_game.sh @@ -1201,7 +1201,8 @@ fn_info_game_hw() { port="${port:-"0"}" queryport="${queryport:-"0"}" maxplayers="${maxplayers:-"0"}" - defaultmap="${defaultmap:-"NOT SET"}" + # #4189 option setting can be blank + # defaultmap="${defaultmap:-"NOT SET"}" creativemode="${creativemode:-"NOT SET"}" } @@ -2385,7 +2386,6 @@ if [ -z "${displaymasterserver}" ]; then if [ "${steammaster}" == "true" ] || [ "${commandname}" == "DEV-QUERY-RAW" ]; then # Query external IP first as most liky to succeed. 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}" 'if .response.servers != null then .response.servers[] | select((.gameport == ($port|tonumber) or .gameport == ($queryport|tonumber))) | .addr else empty end' | wc -l 2> /dev/null)" - if [ "${masterserver}" == "0" ]; then # Loop though server IP addresses if external IP fails. for queryip in "${queryips[@]}"; do From c2e31552a4e7df6aa2528ff3ca0c27eca6146ffd Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Thu, 18 May 2023 18:59:36 +0100 Subject: [PATCH 054/181] fix: add all modules from v23.2.3 to functions dir This will reduce chances of migration issues functions dir will eventually be removed --- lgsm/functions/README.md | 17 + lgsm/functions/alert.sh | 238 ++ lgsm/functions/alert_discord.sh | 59 + lgsm/functions/alert_email.sh | 25 + lgsm/functions/alert_gotify.sh | 30 + lgsm/functions/alert_ifttt.sh | 29 + lgsm/functions/alert_mailgun.sh | 32 + lgsm/functions/alert_pushbullet.sh | 30 + lgsm/functions/alert_pushover.sh | 33 + lgsm/functions/alert_rocketchat.sh | 50 + lgsm/functions/alert_slack.sh | 75 + lgsm/functions/alert_telegram.sh | 30 + lgsm/functions/check.sh | 101 + lgsm/functions/check_config.sh | 35 + lgsm/functions/check_deps.sh | 363 +++ lgsm/functions/check_executable.sh | 20 + lgsm/functions/check_glibc.sh | 29 + lgsm/functions/check_ip.sh | 63 + lgsm/functions/check_last_update.sh | 26 + lgsm/functions/check_permissions.sh | 233 ++ lgsm/functions/check_status.sh | 10 + lgsm/functions/check_steamcmd.sh | 22 + lgsm/functions/check_system_dir.sh | 22 + lgsm/functions/check_system_requirements.sh | 55 + lgsm/functions/check_tmuxception.sh | 33 + lgsm/functions/check_version.sh | 23 + lgsm/functions/command_backup.sh | 268 ++ lgsm/functions/command_check_update.sh | 39 + lgsm/functions/command_console.sh | 58 + lgsm/functions/command_debug.sh | 142 + lgsm/functions/command_details.sh | 41 + lgsm/functions/command_dev_clear_functions.sh | 24 + lgsm/functions/command_dev_debug.sh | 23 + lgsm/functions/command_dev_detect_deps.sh | 231 ++ lgsm/functions/command_dev_detect_glibc.sh | 92 + lgsm/functions/command_dev_detect_ldd.sh | 61 + lgsm/functions/command_dev_query_raw.sh | 280 ++ lgsm/functions/command_donate.sh | 26 + lgsm/functions/command_fastdl.sh | 442 +++ lgsm/functions/command_install.sh | 52 + .../command_install_resources_mta.sh | 32 + lgsm/functions/command_mods_install.sh | 135 + lgsm/functions/command_mods_remove.sh | 153 + lgsm/functions/command_mods_update.sh | 109 + lgsm/functions/command_monitor.sh | 245 ++ lgsm/functions/command_postdetails.sh | 78 + lgsm/functions/command_restart.sh | 18 + lgsm/functions/command_send.sh | 41 + lgsm/functions/command_skeleton.sh | 23 + lgsm/functions/command_start.sh | 224 ++ lgsm/functions/command_stop.sh | 283 ++ lgsm/functions/command_test_alert.sh | 19 + lgsm/functions/command_ts3_server_pass.sh | 57 + lgsm/functions/command_update.sh | 40 + lgsm/functions/command_validate.sh | 49 + lgsm/functions/command_wipe.sh | 183 ++ lgsm/functions/compress_unreal2_maps.sh | 35 + lgsm/functions/compress_ut99_maps.sh | 35 + lgsm/functions/fix.sh | 88 + lgsm/functions/fix_ark.sh | 62 + lgsm/functions/fix_arma3.sh | 16 + lgsm/functions/fix_armar.sh | 17 + lgsm/functions/fix_av.sh | 19 + lgsm/functions/fix_bo.sh | 10 + lgsm/functions/fix_bt.sh | 24 + lgsm/functions/fix_cmw.sh | 23 + lgsm/functions/fix_csgo.sh | 42 + lgsm/functions/fix_dst.sh | 17 + lgsm/functions/fix_hw.sh | 10 + lgsm/functions/fix_ins.sh | 20 + lgsm/functions/fix_kf.sh | 36 + lgsm/functions/fix_kf2.sh | 20 + lgsm/functions/fix_lo.sh | 17 + lgsm/functions/fix_mcb.sh | 11 + lgsm/functions/fix_mta.sh | 16 + lgsm/functions/fix_nmrih.sh | 17 + lgsm/functions/fix_onset.sh | 19 + lgsm/functions/fix_ro.sh | 39 + lgsm/functions/fix_rust.sh | 32 + lgsm/functions/fix_rw.sh | 10 + lgsm/functions/fix_samp.sh | 34 + lgsm/functions/fix_sdtd.sh | 10 + lgsm/functions/fix_sfc.sh | 48 + lgsm/functions/fix_sof2.sh | 11 + lgsm/functions/fix_squad.sh | 26 + lgsm/functions/fix_st.sh | 11 + lgsm/functions/fix_steamcmd.sh | 141 + lgsm/functions/fix_terraria.sh | 10 + lgsm/functions/fix_tf2.sh | 16 + lgsm/functions/fix_ts3.sh | 33 + lgsm/functions/fix_unt.sh | 10 + lgsm/functions/fix_ut.sh | 13 + lgsm/functions/fix_ut2k4.sh | 36 + lgsm/functions/fix_ut3.sh | 20 + lgsm/functions/fix_vh.sh | 35 + lgsm/functions/fix_wurm.sh | 23 + lgsm/functions/fix_zmr.sh | 48 + lgsm/functions/info_distro.sh | 281 ++ lgsm/functions/info_game.sh | 2600 +++++++++++++++++ lgsm/functions/info_messages.sh | 1847 ++++++++++++ lgsm/functions/info_stats.sh | 173 ++ lgsm/functions/install_complete.sh | 18 + lgsm/functions/install_config.sh | 937 ++++++ lgsm/functions/install_dst_token.sh | 45 + lgsm/functions/install_eula.sh | 47 + lgsm/functions/install_factorio_save.sh | 15 + lgsm/functions/install_gslt.sh | 47 + lgsm/functions/install_header.sh | 22 + lgsm/functions/install_logs.sh | 100 + lgsm/functions/install_mta_resources.sh | 12 + lgsm/functions/install_retry.sh | 16 + lgsm/functions/install_server_dir.sh | 26 + lgsm/functions/install_server_files.sh | 255 ++ lgsm/functions/install_squad_license.sh | 25 + lgsm/functions/install_stats.sh | 28 + lgsm/functions/install_steamcmd.sh | 14 + lgsm/functions/install_ts3db.sh | 76 + lgsm/functions/install_ut2k4_key.sh | 30 + lgsm/functions/mods_core.sh | 755 +++++ lgsm/functions/mods_list.sh | 209 ++ lgsm/functions/query_gamedig.sh | 93 + lgsm/functions/query_gsquery.py | 151 + lgsm/functions/update_factorio.sh | 168 ++ lgsm/functions/update_jediknight2.sh | 163 ++ lgsm/functions/update_minecraft.sh | 176 ++ lgsm/functions/update_minecraft_bedrock.sh | 181 ++ lgsm/functions/update_mta.sh | 166 ++ lgsm/functions/update_papermc.sh | 194 ++ lgsm/functions/update_steamcmd.sh | 39 + lgsm/functions/update_ts3.sh | 181 ++ lgsm/functions/update_ut99.sh | 163 ++ lgsm/functions/update_vintagestory.sh | 170 ++ 132 files changed, 15734 insertions(+) create mode 100644 lgsm/functions/README.md create mode 100644 lgsm/functions/alert.sh create mode 100644 lgsm/functions/alert_discord.sh create mode 100644 lgsm/functions/alert_email.sh create mode 100644 lgsm/functions/alert_gotify.sh create mode 100644 lgsm/functions/alert_ifttt.sh create mode 100644 lgsm/functions/alert_mailgun.sh create mode 100644 lgsm/functions/alert_pushbullet.sh create mode 100644 lgsm/functions/alert_pushover.sh create mode 100644 lgsm/functions/alert_rocketchat.sh create mode 100644 lgsm/functions/alert_slack.sh create mode 100644 lgsm/functions/alert_telegram.sh create mode 100644 lgsm/functions/check.sh create mode 100644 lgsm/functions/check_config.sh create mode 100644 lgsm/functions/check_deps.sh create mode 100644 lgsm/functions/check_executable.sh create mode 100644 lgsm/functions/check_glibc.sh create mode 100644 lgsm/functions/check_ip.sh create mode 100644 lgsm/functions/check_last_update.sh create mode 100644 lgsm/functions/check_permissions.sh create mode 100644 lgsm/functions/check_status.sh create mode 100644 lgsm/functions/check_steamcmd.sh create mode 100644 lgsm/functions/check_system_dir.sh create mode 100644 lgsm/functions/check_system_requirements.sh create mode 100644 lgsm/functions/check_tmuxception.sh create mode 100644 lgsm/functions/check_version.sh create mode 100644 lgsm/functions/command_backup.sh create mode 100644 lgsm/functions/command_check_update.sh create mode 100644 lgsm/functions/command_console.sh create mode 100644 lgsm/functions/command_debug.sh create mode 100644 lgsm/functions/command_details.sh create mode 100644 lgsm/functions/command_dev_clear_functions.sh create mode 100644 lgsm/functions/command_dev_debug.sh create mode 100644 lgsm/functions/command_dev_detect_deps.sh create mode 100644 lgsm/functions/command_dev_detect_glibc.sh create mode 100644 lgsm/functions/command_dev_detect_ldd.sh create mode 100644 lgsm/functions/command_dev_query_raw.sh create mode 100644 lgsm/functions/command_donate.sh create mode 100644 lgsm/functions/command_fastdl.sh create mode 100644 lgsm/functions/command_install.sh create mode 100644 lgsm/functions/command_install_resources_mta.sh create mode 100644 lgsm/functions/command_mods_install.sh create mode 100644 lgsm/functions/command_mods_remove.sh create mode 100644 lgsm/functions/command_mods_update.sh create mode 100644 lgsm/functions/command_monitor.sh create mode 100644 lgsm/functions/command_postdetails.sh create mode 100644 lgsm/functions/command_restart.sh create mode 100644 lgsm/functions/command_send.sh create mode 100644 lgsm/functions/command_skeleton.sh create mode 100644 lgsm/functions/command_start.sh create mode 100644 lgsm/functions/command_stop.sh create mode 100644 lgsm/functions/command_test_alert.sh create mode 100644 lgsm/functions/command_ts3_server_pass.sh create mode 100644 lgsm/functions/command_update.sh create mode 100644 lgsm/functions/command_validate.sh create mode 100644 lgsm/functions/command_wipe.sh create mode 100644 lgsm/functions/compress_unreal2_maps.sh create mode 100644 lgsm/functions/compress_ut99_maps.sh create mode 100644 lgsm/functions/fix.sh create mode 100644 lgsm/functions/fix_ark.sh create mode 100644 lgsm/functions/fix_arma3.sh create mode 100644 lgsm/functions/fix_armar.sh create mode 100644 lgsm/functions/fix_av.sh create mode 100644 lgsm/functions/fix_bo.sh create mode 100644 lgsm/functions/fix_bt.sh create mode 100644 lgsm/functions/fix_cmw.sh create mode 100644 lgsm/functions/fix_csgo.sh create mode 100644 lgsm/functions/fix_dst.sh create mode 100644 lgsm/functions/fix_hw.sh create mode 100644 lgsm/functions/fix_ins.sh create mode 100644 lgsm/functions/fix_kf.sh create mode 100644 lgsm/functions/fix_kf2.sh create mode 100644 lgsm/functions/fix_lo.sh create mode 100644 lgsm/functions/fix_mcb.sh create mode 100644 lgsm/functions/fix_mta.sh create mode 100644 lgsm/functions/fix_nmrih.sh create mode 100644 lgsm/functions/fix_onset.sh create mode 100644 lgsm/functions/fix_ro.sh create mode 100644 lgsm/functions/fix_rust.sh create mode 100644 lgsm/functions/fix_rw.sh create mode 100644 lgsm/functions/fix_samp.sh create mode 100644 lgsm/functions/fix_sdtd.sh create mode 100644 lgsm/functions/fix_sfc.sh create mode 100644 lgsm/functions/fix_sof2.sh create mode 100644 lgsm/functions/fix_squad.sh create mode 100644 lgsm/functions/fix_st.sh create mode 100644 lgsm/functions/fix_steamcmd.sh create mode 100644 lgsm/functions/fix_terraria.sh create mode 100644 lgsm/functions/fix_tf2.sh create mode 100644 lgsm/functions/fix_ts3.sh create mode 100644 lgsm/functions/fix_unt.sh create mode 100644 lgsm/functions/fix_ut.sh create mode 100644 lgsm/functions/fix_ut2k4.sh create mode 100644 lgsm/functions/fix_ut3.sh create mode 100644 lgsm/functions/fix_vh.sh create mode 100644 lgsm/functions/fix_wurm.sh create mode 100644 lgsm/functions/fix_zmr.sh create mode 100644 lgsm/functions/info_distro.sh create mode 100644 lgsm/functions/info_game.sh create mode 100644 lgsm/functions/info_messages.sh create mode 100644 lgsm/functions/info_stats.sh create mode 100644 lgsm/functions/install_complete.sh create mode 100644 lgsm/functions/install_config.sh create mode 100644 lgsm/functions/install_dst_token.sh create mode 100644 lgsm/functions/install_eula.sh create mode 100644 lgsm/functions/install_factorio_save.sh create mode 100644 lgsm/functions/install_gslt.sh create mode 100644 lgsm/functions/install_header.sh create mode 100644 lgsm/functions/install_logs.sh create mode 100644 lgsm/functions/install_mta_resources.sh create mode 100644 lgsm/functions/install_retry.sh create mode 100644 lgsm/functions/install_server_dir.sh create mode 100644 lgsm/functions/install_server_files.sh create mode 100644 lgsm/functions/install_squad_license.sh create mode 100644 lgsm/functions/install_stats.sh create mode 100644 lgsm/functions/install_steamcmd.sh create mode 100644 lgsm/functions/install_ts3db.sh create mode 100644 lgsm/functions/install_ut2k4_key.sh create mode 100644 lgsm/functions/mods_core.sh create mode 100644 lgsm/functions/mods_list.sh create mode 100644 lgsm/functions/query_gamedig.sh create mode 100644 lgsm/functions/query_gsquery.py create mode 100644 lgsm/functions/update_factorio.sh create mode 100644 lgsm/functions/update_jediknight2.sh create mode 100644 lgsm/functions/update_minecraft.sh create mode 100644 lgsm/functions/update_minecraft_bedrock.sh create mode 100644 lgsm/functions/update_mta.sh create mode 100644 lgsm/functions/update_papermc.sh create mode 100644 lgsm/functions/update_steamcmd.sh create mode 100644 lgsm/functions/update_ts3.sh create mode 100644 lgsm/functions/update_ut99.sh create mode 100644 lgsm/functions/update_vintagestory.sh diff --git a/lgsm/functions/README.md b/lgsm/functions/README.md new file mode 100644 index 0000000000..de008ecfa3 --- /dev/null +++ b/lgsm/functions/README.md @@ -0,0 +1,17 @@ +# LinuxGSM - Modules + +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. diff --git a/lgsm/functions/alert.sh b/lgsm/functions/alert.sh new file mode 100644 index 0000000000..59deae2b6e --- /dev/null +++ b/lgsm/functions/alert.sh @@ -0,0 +1,238 @@ +#!/bin/bash +# LinuxGSM alert.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Overall function for managing alerts. + +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() { + info_distro.sh + info_game.sh + info_messages.sh + if [ -f "${alertlog}" ]; then + rm -f "${alertlog:?}" + fi + + { + fn_info_message_head + fn_info_message_distro + fn_info_message_server_resource + 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 +} + +fn_alert_test() { + fn_script_log_info "Sending test alert" + alertsubject="Alert - ${selfname} - Test" + alertemoji="🚧" + alertsound="1" + alerturl="not enabled" + alertbody="Testing LinuxGSM Alert. No action to be taken." +} + +fn_alert_restart() { + fn_script_log_info "Sending alert: Restarted: ${executable} not running" + alertsubject="Alert - ${selfname} - Restarted" + alertemoji="🚨" + alertsound="2" + alerturl="not enabled" + alertbody="${selfname} ${executable} not running" +} + +fn_alert_restart_query() { + fn_script_log_info "Sending alert: Restarted: ${selfname}" + alertsubject="Alert - ${selfname} - Restarted" + alertemoji="🚨" + alertsound="2" + alerturl="not enabled" + alertbody="Unable to query: ${selfname}" +} + +fn_alert_update() { + fn_script_log_info "Sending alert: Updated" + alertsubject="Alert - ${selfname} - Updated" + alertemoji="🎮" + alertsound="1" + alerturl="not enabled" + alertbody="${gamename} received update: ${remotebuildversion}" +} + +fn_alert_check_update() { + fn_script_log_info "Sending alert: Update available" + alertsubject="Alert - ${selfname} - Update available" + alertemoji="🎮" + alertsound="1" + alerturl="not enabled" + alertbody="${gamename} update available: ${remotebuildversion}" +} + +fn_alert_permissions() { + fn_script_log_info "Sending alert: Permissions error" + alertsubject="Alert - ${selfname}: Permissions error" + alertemoji="❗" + alertsound="2" + alerturl="not enabled" + alertbody="${selfname} has permissions issues" +} + +fn_alert_config() { + fn_script_log_info "Sending alert: New _default.cfg" + alertsubject="Alert - ${selfname} - New _default.cfg" + alertemoji="🎮" + alertsound="1" + alerturl="not enabled" + alertbody="${selfname} has received a new _default.cfg. Check file for changes." +} + +if [ "${alert}" == "permissions" ]; then + fn_alert_permissions +elif [ "${alert}" == "restart" ]; then + fn_alert_restart +elif [ "${alert}" == "restartquery" ]; then + fn_alert_restart_query +elif [ "${alert}" == "test" ]; then + fn_alert_test +elif [ "${alert}" == "update" ]; then + fn_alert_update +elif [ "${alert}" == "check-update" ]; then + fn_alert_check_update +elif [ "${alert}" == "config" ]; then + fn_alert_config +fi + +# Generate alert log. +fn_alert_log + +# Generates the more info link. +if [ "${postalert}" == "on" ] && [ -n "${postalert}" ]; then + exitbypass=1 + command_postdetails.sh + fn_firstcommand_reset + unset exitbypass +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 + alert_discord.sh +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 + 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 + alert_email.sh +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 + fn_print_error_nl "Email not set" + fn_script_log_error "Email not set" +fi + +if [ "${gotifyalert}" == "on" ] && [ -n "${gotifyalert}" ]; then + alert_gotify.sh +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 + 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 + 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 + alert_ifttt.sh +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 + 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 + alert_mailgun.sh +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 + 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 + alert_pushbullet.sh +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 + 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 + alert_pushover.sh +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 + 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 + alert_telegram.sh +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 + 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 + 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 + alert_rocketchat.sh +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 + 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 + alert_slack.sh +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 + fn_print_error_nl "Slack token not set" + echo -e "* https://docs.linuxgsm.com/alerts/slack" + fn_script_error "Slack token not set" +fi diff --git a/lgsm/functions/alert_discord.sh b/lgsm/functions/alert_discord.sh new file mode 100644 index 0000000000..7708175163 --- /dev/null +++ b/lgsm/functions/alert_discord.sh @@ -0,0 +1,59 @@ +#!/bin/bash +# LinuxGSM alert_discord.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Sends Discord alert. + +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +json=$( + cat << EOF +{ + "username":"LinuxGSM", + "avatar_url":"https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/lgsm/data/alert_discord_logo.jpg", + "file":"content", + "embeds": [{ + "color": "2067276", + "author": { + "name": "${alertemoji} ${alertsubject} ${alertemoji}", + "icon_url": "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/lgsm/data/alert_discord_logo.jpg" + }, + "title": "${servername}", + "description": "${alertbody} \n More info: ${alerturl}", + "url": "", + "type": "content", + "thumbnail": {}, + "fields": [ + { + "name": "Game", + "value": "${gamename}", + "inline": true + }, + { + "name": "Server IP", + "value": "[${alertip}:${port}](https://www.gametracker.com/server_info/${alertip}:${port})", + "inline": true + }, + { + "name": "Hostname", + "value": "${HOSTNAME}", + "inline": true + } + ] + }] +} +EOF +) + +fn_print_dots "Sending Discord alert" + +discordsend=$(curl --connect-timeout 10 -sSL -H "Content-Type: application/json" -X POST -d "$(echo -n "${json}" | jq -c .)" "${discordwebhook}") + +if [ -n "${discordsend}" ]; then + fn_print_fail_nl "Sending Discord alert: ${discordsend}" + fn_script_log_fatal "Sending Discord alert: ${discordsend}" +else + fn_print_ok_nl "Sending Discord alert" + fn_script_log_pass "Sending Discord alert" +fi diff --git a/lgsm/functions/alert_email.sh b/lgsm/functions/alert_email.sh new file mode 100644 index 0000000000..ad90e880f1 --- /dev/null +++ b/lgsm/functions/alert_email.sh @@ -0,0 +1,25 @@ +#!/bin/bash +# LinuxGSM alert_email.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Sends email alert. + +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +fn_print_dots "Sending Email alert: ${email}" +fn_sleep_time + +if [ -n "${emailfrom}" ]; then + mail -s "${alertsubject}" -r "${emailfrom}" "${email}" < "${alertlog}" +else + mail -s "${alertsubject}" "${email}" < "${alertlog}" +fi +exitcode=$? +if [ "${exitcode}" == "0" ]; then + fn_print_ok_nl "Sending Email alert: ${email}" + fn_script_log_pass "Sending Email alert: ${email}" +else + fn_print_fail_nl "Sending Email alert: ${email}" + fn_script_log_fatal "Sending Email alert: ${email}" +fi diff --git a/lgsm/functions/alert_gotify.sh b/lgsm/functions/alert_gotify.sh new file mode 100644 index 0000000000..faeba45934 --- /dev/null +++ b/lgsm/functions/alert_gotify.sh @@ -0,0 +1,30 @@ +#!/bin/bash +# LinuxGSM alert_gotify.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Sends Gotify alert. + +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +json=$( + cat << EOF +{ + "title": "${alertemoji} ${alertsubject} ${alertemoji}", + "message": "Server name\n${servername}\n\nMessage\n${alertbody}\n\nGame\n${gamename}\n\nServer IP\n${alertip}:${port}\n\nHostname\n${HOSTNAME}\n\nMore info\n${alerturl}", + "priority": 5 +} +EOF +) + +fn_print_dots "Sending Gotify alert" + +gotifysend=$(curl --connect-timeout 10 -sSL "${gotifywebhook}/message"?token="${gotifytoken}" -H "Content-Type: application/json" -X POST -d "$(echo -n "${json}" | jq -c .)") + +if [ -n "${gotifysend}" ]; then + fn_print_ok_nl "Sending Gotify alert" + fn_script_log_pass "Sending Gotify alert" +else + fn_print_fail_nl "Sending Gotify alert: ${gotifysend}" + fn_script_log_fatal "Sending Gotify alert: ${gotifysend}" +fi diff --git a/lgsm/functions/alert_ifttt.sh b/lgsm/functions/alert_ifttt.sh new file mode 100644 index 0000000000..f8bbc24ad8 --- /dev/null +++ b/lgsm/functions/alert_ifttt.sh @@ -0,0 +1,29 @@ +#!/bin/bash +# LinuxGSM alert_ifttt.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Sends IFTTT alert. + +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +json=$( + cat << EOF +{ + "value1": "${selfname}", + "value2": "${alertemoji} ${alertsubject} ${alertemoji}", + "value3": "Message: \n${alertbody}\n\nGame: \n${gamename}\n\nServer name: \n${servername}\n\nHostname: \n${HOSTNAME}\n\nServer IP: \n${alertip}:${port}\n\nMore info: \n${alerturl}" +} +EOF +) + +fn_print_dots "Sending IFTTT alert" +iftttsend=$(curl --connect-timeout 10 -sSL -H "Content-Type: application/json" -X POST -d "$(echo -n "${json}" | jq -c .)" "https://maker.ifttt.com/trigger/${iftttevent}/with/key/${ifttttoken}" | grep "Bad Request") + +if [ -n "${iftttsend}" ]; then + fn_print_fail_nl "Sending IFTTT alert: ${pushbulletsend}" + fn_script_log_fatal "Sending IFTTT alert: ${pushbulletsend}" +else + fn_print_ok_nl "Sending IFTTT alert" + fn_script_log_pass "Sent IFTTT alert" +fi diff --git a/lgsm/functions/alert_mailgun.sh b/lgsm/functions/alert_mailgun.sh new file mode 100644 index 0000000000..25576209cd --- /dev/null +++ b/lgsm/functions/alert_mailgun.sh @@ -0,0 +1,32 @@ +#!/bin/bash +# LinuxGSM alert_mailgun.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Sends Mailgun Email alert. + +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +if [ "${mailgunapiregion}" == "eu" ]; then + mailgunapiurl="https://api.eu.mailgun.net" +else + mailgunapiurl="https://api.mailgun.net" +fi + +fn_print_dots "Sending Email alert: Mailgun: ${mailgunemail}" + +mailgunsend=$(curl --connect-timeout 10 -s --user "api:${mailguntoken}" \ + -F from="LinuxGSM <${mailgunemailfrom}>" \ + -F to="LinuxGSM Admin <${mailgunemail}>" \ + -F subject="${alertemoji} ${alertsubject} ${alertemoji}" \ + -F o:tag='alert' \ + -F o:tag='LinuxGSM' \ + -F text="$(cat "${alertlog}")" "${mailgunapiurl}/v3/${mailgundomain}/messages") + +if [ -z "${mailgunsend}" ]; then + fn_print_fail_nl "Sending Email alert: Mailgun: ${mailgunemail}" + fn_script_log_fatal "Sending Email alert: Mailgun: ${mailgunemail}" +else + fn_print_ok_nl "Sending Email alert: Mailgun: ${mailgunemail}" + fn_script_log_pass "Sending Email alert: Mailgun: ${mailgunemail}" +fi diff --git a/lgsm/functions/alert_pushbullet.sh b/lgsm/functions/alert_pushbullet.sh new file mode 100644 index 0000000000..3e82d0db02 --- /dev/null +++ b/lgsm/functions/alert_pushbullet.sh @@ -0,0 +1,30 @@ +#!/bin/bash +# LinuxGSM alert_pushbullet.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Sends Pushbullet Messenger alert. + +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +json=$( + cat << EOF +{ + "channel_tag": "${channeltag}", + "type": "note", + "title": "${alertemoji} ${alertsubject} ${alertemoji}", + "body": "Server name\n${servername}\n\nMessage\n${alertbody}\n\nGame\n${gamename}\n\nServer IP\n${alertip}:${port}\n\nHostname\n${HOSTNAME}\n\nMore info\n${alerturl}" +} +EOF +) + +fn_print_dots "Sending Pushbullet alert" +pushbulletsend=$(curl --connect-timeout 10 -sSL -u """${pushbullettoken}"":" -H "Content-Type: application/json" -X POST -d "$(echo -n "${json}" | jq -c .)" "https://api.pushbullet.com/v2/pushes" | grep "error_code") + +if [ -n "${pushbulletsend}" ]; then + fn_print_fail_nl "Sending Pushbullet alert: ${pushbulletsend}" + fn_script_log_fatal "Sending Pushbullet alert: ${pushbulletsend}" +else + fn_print_ok_nl "Sending Pushbullet alert" + fn_script_log_pass "Sent Pushbullet alert" +fi diff --git a/lgsm/functions/alert_pushover.sh b/lgsm/functions/alert_pushover.sh new file mode 100644 index 0000000000..d7c0864787 --- /dev/null +++ b/lgsm/functions/alert_pushover.sh @@ -0,0 +1,33 @@ +#!/bin/bash +# LinuxGSM alert_pushover.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Sends Pushover alert. + +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +fn_print_dots "Sending Pushover alert" + +# Different alerts are given different priorities and notification sounds. +if [ "${alertsound}" == "1" ]; then + alertsound="" + alertpriority="0" +elif [ "${alertsound}" == "2" ]; then + # restarted. + alertsound="siren" + alertpriority="1" +else + alertsound="" + alertpriority="0" +fi + +pushoversend=$(curl --connect-timeout 10 -sS -F token="${pushovertoken}" -F user="${pushoveruserkey}" -F html="1" -F sound="${alertsound}" -F priority="${alertpriority}" -F title="${alertemoji} ${alertsubject} ${alertemoji}" -F message=" Server name
${servername}

Message
${alertbody}

Game
${gamename}

Server IP
${alertip}:${port}

Hostname
${HOSTNAME}

More info
${alerturl}" "https://api.pushover.net/1/messages.json" | grep errors) + +if [ -n "${pushoversend}" ]; then + fn_print_fail_nl "Sending Pushover alert: ${pushoversend}" + fn_script_log_fatal "Sending Pushover alert: ${pushoversend}" +else + fn_print_ok_nl "Sending Pushover alert" + fn_script_log_pass "Sent Pushover alert" +fi diff --git a/lgsm/functions/alert_rocketchat.sh b/lgsm/functions/alert_rocketchat.sh new file mode 100644 index 0000000000..34d018e386 --- /dev/null +++ b/lgsm/functions/alert_rocketchat.sh @@ -0,0 +1,50 @@ +#!/bin/bash +# LinuxGSM alert_rocketchat.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Sends Rocketchat alert. + +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +json=$( + cat << EOF +{ + "alias": "LinuxGSM", + "text": "*${alertemoji} ${alertsubject} ${alertemoji}* \n *${servername}* \n ${alertbody} \n More info: ${alerturl}", + "attachments": [ + { + "fields": [ + { + "short": true, + "title": "Game:", + "value": "${gamename}" + }, + { + "short": true, + "title": "Server IP:", + "value": "${alertip}:${port}" + }, + { + "short": true, + "title": "Hostname:", + "value": "${HOSTNAME}" + } + ] + } + ] +} +EOF +) + +fn_print_dots "Sending Rocketchat alert" + +rocketchatsend=$(curl --connect-timeout 10 -sSL -H "Content-Type: application/json" -X POST -d "$(echo -n "${json}" | jq -c .)" "${rocketchatwebhook}") + +if [ -n "${rocketchatsend}" ]; then + fn_print_ok_nl "Sending Rocketchat alert" + fn_script_log_pass "Sending Rocketchat alert" +else + fn_print_fail_nl "Sending Rocketchat alert: ${rocketchatsend}" + fn_script_log_fatal "Sending Rocketchat alert: ${rocketchatsend}" +fi diff --git a/lgsm/functions/alert_slack.sh b/lgsm/functions/alert_slack.sh new file mode 100644 index 0000000000..2e87c1571a --- /dev/null +++ b/lgsm/functions/alert_slack.sh @@ -0,0 +1,75 @@ +#!/bin/bash +# LinuxGSM alert_slack.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Sends Slack alert. + +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +json=$( + cat << EOF +{ + "attachments": [ + { + "color": "#36a64f", + "blocks": [ + { + "type": "section", + "text": { + "type": "mrkdwn", + "text": "*LinuxGSM Alert*" + } + }, + { + "type": "section", + "text": { + "type": "mrkdwn", + "text": "*${alertemoji} ${alertsubject}* \n ${alertbody}" + } + }, + { + "type": "divider" + }, + { + "type": "section", + "fields": [ + { + "type": "mrkdwn", + "text": "*Game:* \n ${gamename}" + }, + { + "type": "mrkdwn", + "text": "*Server IP:* \n ${alertip}:${port}" + }, + { + "type": "mrkdwn", + "text": "*Server Name:* \n ${servername}" + } + ] + }, + { + "type": "section", + "text": { + "type": "mrkdwn", + "text": "Hostname: ${HOSTNAME} / More info: ${alerturl}" + } + } + ] + } + ] +} +EOF +) + +fn_print_dots "Sending Slack alert" + +slacksend=$(curl --connect-timeout 10 -sSL -H "Content-Type: application/json" -X POST -d "$(echo -n "${json}" | jq -c .)" "${slackwebhook}") + +if [ "${slacksend}" == "ok" ]; then + fn_print_ok_nl "Sending Slack alert" + fn_script_log_pass "Sending Slack alert" +else + fn_print_fail_nl "Sending Slack alert: ${slacksend}" + fn_script_log_fatal "Sending Slack alert: ${slacksend}" +fi diff --git a/lgsm/functions/alert_telegram.sh b/lgsm/functions/alert_telegram.sh new file mode 100644 index 0000000000..27e34beb4c --- /dev/null +++ b/lgsm/functions/alert_telegram.sh @@ -0,0 +1,30 @@ +#!/bin/bash +# LinuxGSM alert_telegram.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Sends Telegram Messenger alert. + +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +json=$( + cat << EOF +{ + "chat_id": "${telegramchatid}", + "parse_mode": "HTML", + "text": "${alertemoji} ${alertsubject} ${alertemoji}\n\nServer name\n${servername}\n\nMessage\n${alertbody}\n\nGame\n${gamename}\n\nServer IP\n${alertip}:${port}\n\nHostname\n${HOSTNAME}\n\nMore info\n${alerturl}", + "disable_web_page_preview": "yes" +} +EOF +) + +fn_print_dots "Sending Telegram alert" +telegramsend=$(curl --connect-timeout 10 -sSL -H "Content-Type: application/json" -X POST -d "$(echo -n "${json}" | jq -c .)" ${curlcustomstring} "https://${telegramapi}/bot${telegramtoken}/sendMessage" | grep "error_code") + +if [ -n "${telegramsend}" ]; then + fn_print_fail_nl "Sending Telegram alert: ${telegramsend}" + fn_script_log_fatal "Sending Telegram alert: ${telegramsend}" +else + fn_print_ok_nl "Sending Telegram alert" + fn_script_log_pass "Sent Telegram alert" +fi diff --git a/lgsm/functions/check.sh b/lgsm/functions/check.sh new file mode 100644 index 0000000000..0f1e123687 --- /dev/null +++ b/lgsm/functions/check.sh @@ -0,0 +1,101 @@ +#!/bin/bash +# LinuxGSM check.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Overall function for managing checks. +# Runs checks that will either halt on or fix an issue. + +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +# Every command that requires checks just references check.sh. +# check.sh selects which checks to run by using arrays. + +if [ "${commandname}" != "INSTALL" ]; then + check_root.sh +fi + +if [ "${commandname}" != "UPDATE-LGSM" ]; then + check_version.sh +fi + +check_tmuxception.sh + +if [ "$(whoami)" != "root" ] || [ -f /.dockerenv ]; then + if [ "${commandname}" != "MONITOR" ]; then + check_permissions.sh + fi +fi + +if [ "${commandname}" != "INSTALL" ] && [ "${commandname}" != "UPDATE-LGSM" ] && [ "${commandname}" != "DETAILS" ] && [ "${commandname}" != "POST-DETAILS" ]; then + check_system_dir.sh +fi + +allowed_commands_array=(START DEBUG) +for allowed_command in "${allowed_commands_array[@]}"; do + if [ "${allowed_command}" == "${commandname}" ]; then + check_executable.sh + fi +done + +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 + check_glibc.sh + fi + done +fi + +allowed_commands_array=(BACKUP CONSOLE DEBUG DETAILS MAP-COMPRESSOR FASTDL MODS-INSTALL MODS-REMOVE MODS-UPDATE MONITOR POST-DETAILS RESTART START STOP TEST-ALERT CHANGE-PASSWORD UPDATE UPDATE-LGSM VALIDATE WIPE) +for allowed_command in "${allowed_commands_array[@]}"; do + if [ "${allowed_command}" == "${commandname}" ]; then + check_logs.sh + fi +done + +allowed_commands_array=(DEBUG START) +for allowed_command in "${allowed_commands_array[@]}"; do + if [ "${allowed_command}" == "${commandname}" ]; then + check_deps.sh + fi +done + +allowed_commands_array=(CONSOLE DEBUG MONITOR START STOP) +for allowed_command in "${allowed_commands_array[@]}"; do + if [ "${allowed_command}" == "${commandname}" ]; then + check_config.sh + fi +done + +allowed_commands_array=(DEBUG DETAILS DEV-QUERY-RAW MONITOR POST_DETAILS START STOP POST-DETAILS) +for allowed_command in "${allowed_commands_array[@]}"; do + if [ "${allowed_command}" == "${commandname}" ]; then + if [ -z "${installflag}" ]; then + check_ip.sh + fi + fi +done + +allowed_commands_array=(DEBUG START UPDATE VALIDATE CHECK-UPDATE) +for allowed_command in "${allowed_commands_array[@]}"; do + if [ "${allowed_command}" == "${commandname}" ]; then + if [ "${appid}" ]; then + check_steamcmd.sh + fi + fi +done + +allowed_commands_array=(CHANGE-PASSWORD DETAILS MONITOR START STOP UPDATE VALIDATE POST-DETAILS) +for allowed_command in "${allowed_commands_array[@]}"; do + if [ "${allowed_command}" == "${commandname}" ]; then + check_status.sh + fi +done + +allowed_commands_array=(DEBUG START INSTALL) +for allowed_command in "${allowed_commands_array[@]}"; do + if [ "${allowed_command}" == "${commandname}" ]; then + check_system_requirements.sh + fi +done diff --git a/lgsm/functions/check_config.sh b/lgsm/functions/check_config.sh new file mode 100644 index 0000000000..2c65243eb5 --- /dev/null +++ b/lgsm/functions/check_config.sh @@ -0,0 +1,35 @@ +#!/bin/bash +# LinuxGSM check_config.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Checks if the server config is missing and warns the user if needed. + +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +if [ -n "${servercfgfullpath}" ] && [ ! -f "${servercfgfullpath}" ]; then + fn_print_dots "" + fn_print_warn_nl "Configuration file missing!" + echo -e "${servercfgfullpath}" + fn_script_log_warn "Configuration file missing!" + fn_script_log_warn "${servercfgfullpath}" + install_config.sh +fi + +if [ "${shortname}" == "rust" ] && [ -v rconpassword ] && [ -z "${rconpassword}" ]; then + fn_print_dots "" + fn_print_fail_nl "RCON password is not set" + fn_script_log_warn "RCON password is not set" +elif [ -v rconpassword ] && [ "${rconpassword}" == "CHANGE_ME" ]; then + fn_print_dots "" + 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 diff --git a/lgsm/functions/check_deps.sh b/lgsm/functions/check_deps.sh new file mode 100644 index 0000000000..bb8507769c --- /dev/null +++ b/lgsm/functions/check_deps.sh @@ -0,0 +1,363 @@ +#!/bin/bash +# LinuxGSM check_deps.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Checks and installs missing dependencies. + +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +fn_install_mono_repo() { + if [ "${autodepinstall}" == "0" ]; then + fn_print_information_nl "Automatically adding Mono repository." + fn_script_log_info "Automatically adding Mono repository." + echo -en ".\r" + sleep 1 + echo -en "..\r" + sleep 1 + echo -en "...\r" + sleep 1 + echo -en " \r" + if [ "${distroid}" == "ubuntu" ]; then + if [ "${distroversion}" == "20.04" ]; then + cmd="sudo apt install gnupg ca-certificates;sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF;echo 'deb https://download.mono-project.com/repo/ubuntu stable-focal main' | sudo tee /etc/apt/sources.list.d/mono-official-stable.list;sudo apt update" + elif [ "${distroversion}" == "18.04" ]; then + cmd="sudo apt install gnupg ca-certificates;sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF;echo 'deb https://download.mono-project.com/repo/ubuntu stable-bionic main' | sudo tee /etc/apt/sources.list.d/mono-official-stable.list;sudo apt update" + elif [ "${distroversion}" == "16.04" ]; then + cmd="sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF;sudo apt install apt-transport-https ca-certificates;echo 'deb https://download.mono-project.com/repo/ubuntu stable-xenial main' | sudo tee /etc/apt/sources.list.d/mono-official-stable.list;sudo apt update" + else + monoautoinstall="1" + fi + elif [ "${distroid}" == "debian" ]; then + if [ "${distroversion}" == "10" ]; then + cmd="sudo apt install apt-transport-https dirmngr gnupg ca-certificates;sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF;echo 'deb https://download.mono-project.com/repo/debian stable-buster main' | sudo tee /etc/apt/sources.list.d/mono-official-stable.list;sudo apt update" + elif [ "${distroversion}" == "9" ]; then + cmd="sudo apt install apt-transport-https dirmngr gnupg ca-certificates;sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF;echo 'deb https://download.mono-project.com/repo/debian stable-stretch main' | sudo tee /etc/apt/sources.list.d/mono-official-stable.list;sudo apt update" + else + monoautoinstall="1" + fi + elif [ "${distroid}" == "centos" ] || [ "${distroid}" == "almalinux" ] || [ "${distroid}" == "rocky" ]; then + if [ "${distroversion}" == "8" ]; then + cmd="sudo rpmkeys --import 'https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF';su -c 'curl https://download.mono-project.com/repo/centos8-stable.repo | tee /etc/yum.repos.d/mono-centos8-stable.repo'" + elif [ "${distroversion}" == "7" ]; then + cmd="sudo rpmkeys --import 'https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF';su -c 'curl https://download.mono-project.com/repo/centos7-stable.repo | tee /etc/yum.repos.d/mono-centos7-stable.repo'" + else + monoautoinstall="1" + fi + elif [ "${distroid}" == "fedora" ]; then + if [ "${distroversion}" -ge "29" ]; then + cmd="sudo rpm --import 'https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF';su -c 'curl https://download.mono-project.com/repo/centos8-stable.repo | tee /etc/yum.repos.d/mono-centos8-stable.repo';dnf update" + else + cmd="sudo rpm --import 'https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF';su -c 'curl https://download.mono-project.com/repo/centos7-stable.repo | tee /etc/yum.repos.d/mono-centos7-stable.repo';dnf update" + fi + else + monoautoinstall="1" + fi + + # Run the mono repo install. + eval "${cmd}" + + # Did Mono repo install correctly? + if [ "${monoautoinstall}" != "1" ]; then + if [ $? != 0 ]; then + fn_print_failure_nl "Unable to install Mono repository." + fn_script_log_fatal "Unable to install Mono repository." + else + fn_print_complete_nl "Installing Mono repository completed." + fn_script_log_pass "Installing Mono repository completed." + fi + fi + + # Mono can not be auto installed with this distro. + if [ "${monoautoinstall}" == "1" ]; then + fn_print_warning_nl "Mono auto install not available for ${distroname}." + echo -e "Follow instructions on Mono website to install." + echo -e "https://www.mono-project.com/download/stable/#download-lin" + fn_script_log_warn "Unable to install Mono repository. Mono auto install not available for ${distroname}." + fi + + else + fn_print_information_nl "Installing Mono repository." + fn_print_warning_nl "$(whoami) does not have sudo access." + echo -e "Follow instructions on Mono website to install." + echo -e "https://www.mono-project.com/download/stable/#download-lin" + fn_script_log_warn "Unable to install Mono repository. $(whoami) does not have sudo access." + fi +} + +fn_deps_email() { + # Adds postfix to required dependencies if email alert is enabled. + if [ "${emailalert}" == "on" ]; then + if [ -f /usr/bin/mailx ]; then + if [ -d /etc/exim4 ]; then + array_deps_required+=(exim4) + elif [ -d /etc/sendmail ]; then + 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) + fi + fi + fi +} + +fn_install_missing_deps() { + # If any dependencies are not installed. + if [ "${#array_deps_missing[*]}" != "0" ]; then + if [ "${commandname}" == "INSTALL" ]; then + fn_print_warning_nl "Missing dependencies: ${red}${array_deps_missing[*]}${default}" + fn_script_log_warn "Missing dependencies: ${array_deps_missing[*]}" + else + fn_print_dots "Missing dependencies" + fn_print_warn "Missing dependencies: ${red}${array_deps_missing[*]}${default}" + fn_script_log_warn "Missing dependencies: ${array_deps_missing[*]}" + fi + fn_sleep_time + + # Attempt automatic dependency installation + if [ "${autoinstall}" == "1" ]; then + sudo -n true > /dev/null 2>&1 + else + sudo -v > /dev/null 2>&1 + fi + autodepinstall="$?" + + if [ "${monostatus}" == "1" ]; then + fn_install_mono_repo + fi + + if [ "${commandname}" == "INSTALL" ]; then + if [ "${autodepinstall}" == "0" ]; then + fn_print_information_nl "$(whoami) has sudo access." + fn_script_log_info "$(whoami) has sudo access." + else + fn_print_warning_nl "$(whoami) does not have sudo access. Manually install dependencies." + fn_script_log_warn "$(whoami) does not have sudo access. Manually install dependencies." + fi + fi + + # Add sudo dpkg --add-architecture i386 if using i386 packages. + 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 + fi + + # If automatic dependency install is available + if [ "${autodepinstall}" == "0" ]; then + fn_print_information_nl "Automatically installing missing dependencies." + fn_script_log_info "Automatically installing missing dependencies." + echo -en ".\r" + sleep 1 + echo -en "..\r" + sleep 1 + echo -en "...\r" + sleep 1 + echo -en " \r" + 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 + cmd="sudo dnf -y install ${array_deps_missing[*]}" + eval "${cmd}" + elif [ "$(command -v yum 2> /dev/null)" ]; then + cmd="sudo yum -y install ${array_deps_missing[*]}" + eval "${cmd}" + fi + autodepinstall="$?" + + # If auto install passes remove steamcmd install failure. + if [ "${autodepinstall}" == "0" ]; then + unset steamcmdfail + fi + fi + + # If automatic dependency install is unavailable. + if [ "${autodepinstall}" != "0" ]; 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 + echo -e "sudo dnf install ${array_deps_missing[*]}" + elif [ "$(command -v yum 2> /dev/null)" ]; then + echo -e "sudo yum install ${array_deps_missing[*]}" + fi + fi + + if [ "${steamcmdfail}" ]; then + if [ "${commandname}" == "INSTALL" ]; then + fn_print_failure_nl "Missing dependencies required to run SteamCMD." + fn_script_log_fatal "Missing dependencies required to run SteamCMD." + core_exit.sh + else + fn_print_error_nl "Missing dependencies required to run SteamCMD." + fn_script_log_error "Missing dependencies required to run SteamCMD." + fi + fi + + else + if [ "${commandname}" == "INSTALL" ]; then + fn_print_information_nl "Required dependencies already installed." + fn_script_log_info "Required dependencies already installed." + fi + fi +} + +fn_check_loop() { + # Loop though required depenencies checking if they are installed. + for deptocheck in ${array_deps_required[*]}; do + fn_deps_detector + done + + # user will be informed of any missing dependencies. + fn_install_missing_deps +} + +# Checks if dependency is installed or not. +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/}") + steamcmdstatus=1 + 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/}") + steamcmdstatus=1 + # Java: Added for users using Oracle JRE to bypass check. + elif [[ ${deptocheck} == "openjdk"* ]] || [[ ${deptocheck} == "java"* ]]; then + # Is java already installed? + if [ -n "${javaversion}" ]; then + # Added for users using Oracle JRE to bypass check. + depstatus=0 + deptocheck="${javaversion}" + else + depstatus=1 + fi + # Mono: A Mono repo needs to be installed. + elif [ "${deptocheck}" == "mono-complete" ]; then + if [ -n "${monoversion}" ] && [ "${monoversion}" -ge "5" ]; then + # Mono >= 5.0.0 already installed. + depstatus=0 + monostatus=0 + else + # Mono not installed or installed Mono < 5.0.0. + 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' + depstatus=$? + 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 + rpm -q "${deptocheck}" > /dev/null 2>&1 + depstatus=$? + fi + + # Outcome of Check. + if [ "${steamcmdstatus}" == "1" ]; then + # If SteamCMD is not available in repo dont check for it. + unset steamcmdstatus + elif [ "${depstatus}" == "0" ]; then + # If dependency is found. + missingdep=0 + if [ "${commandname}" == "INSTALL" ]; then + echo -e "${green}${deptocheck}${default}" + sleep 0.1 + fi + elif [ "${depstatus}" != "0" ]; then + # If dependency is not found. + missingdep=1 + if [ "${commandname}" == "INSTALL" ]; then + echo -e "${red}${deptocheck}${default}" + sleep 0.1 + 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 + fi + fi + unset depstatus + + # Missing dependencies are added to array_deps_missing. + if [ "${missingdep}" == "1" ]; then + array_deps_missing+=("${deptocheck}") + fi +} + +if [ "${commandname}" == "INSTALL" ]; then + if [ "$(whoami)" == "root" ] && [ ! -f /.dockerenv ]; then + echo -e "" + echo -e "${lightyellow}Checking Dependencies as root${default}" + echo -e "=================================" + fn_print_information_nl "Checking any missing dependencies for ${gamename} server only." + fn_print_information_nl "This will NOT install a ${gamename} server." + fn_sleep_time + else + echo -e "" + echo -e "${lightyellow}Checking Dependencies${default}" + echo -e "=================================" + 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 + # Check that the distro dependency csv file exists. + fn_check_file_github "lgsm/data" "${distroid}-${distroversioncsv}.csv" + if [ -n "${checkflag}" ] && [ "${checkflag}" == "0" ]; then + fn_fetch_file_github "lgsm/data" "${distroid}-${distroversioncsv}.csv" "lgsm/data" "chmodx" "norun" "noforce" "nohash" + fi +fi + +# If the file successfully downloaded run the dependency check. +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") + + # Generate array of missing deps. + array_deps_missing=() + + array_deps_required=("${depall} ${depsteamcmd} ${depshortname}") + array_deps_required_steamcmd=("${depsteamcmd}") + fn_deps_email + # Unique sort dependency array. + IFS=" " read -r -a array_deps_required <<< "$(echo "${array_deps_required[@]}" | tr ' ' '\n' | sort -u | tr '\n' ' ')" + + fn_check_loop +# Warn the user that dependency checking is unavailable for their distro. +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 + # Allow LinuxGSM to try a dependency check if LinuxGSM has been recently updated. + nocheckversion=$(cat "${tmpdir}/dependency-no-check.tmp") + if [ "${version}" != "${nocheckversion}" ]; then + rm -f "${tmpdir:?}/dependency-no-check.tmp" + fi +fi diff --git a/lgsm/functions/check_executable.sh b/lgsm/functions/check_executable.sh new file mode 100644 index 0000000000..d1b5c3efd0 --- /dev/null +++ b/lgsm/functions/check_executable.sh @@ -0,0 +1,20 @@ +#!/bin/bash +# LinuxGSM check_executable.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Checks if server executable exists. + +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}" + if [ -d "${lgsmlogdir}" ]; then + fn_script_log_fatal "Executable was not found: ${executabledir}/${execname}" + fi + unset exitbypass + core_exit.sh +fi diff --git a/lgsm/functions/check_glibc.sh b/lgsm/functions/check_glibc.sh new file mode 100644 index 0000000000..b1a959f5b4 --- /dev/null +++ b/lgsm/functions/check_glibc.sh @@ -0,0 +1,29 @@ +#!/bin/bash +# LinuxGSM check_glibc.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Checks if the server has the correct Glibc version. + +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +info_distro.sh + +if [ "${glibc}" == "null" ]; then + # Glibc is not required. + : +elif [ -z "${glibc}" ]; then + fn_print_dots "glibc" + fn_print_error_nl "glibc requirement unknown" + fn_script_log_error "glibc requirement unknown" +elif [ "$(printf '%s\n'${glibc}'\n' "${glibcversion}" | sort -V | head -n 1)" != "${glibc}" ]; then + fn_print_dots "glibc" + fn_print_error_nl "glibc requirements not met" + fn_script_log_error "glibc requirements not met" + echo -en "\n" + echo -e " * glibc required: ${glibc}" + echo -e " * glibc installed: ${red}${glibcversion}${default}" + echo -en "\n" + fn_print_information_nl "distro upgrade is required" + fn_script_log_info "distro upgrade is required" +fi diff --git a/lgsm/functions/check_ip.sh b/lgsm/functions/check_ip.sh new file mode 100644 index 0000000000..4b8eca5ec9 --- /dev/null +++ b/lgsm/functions/check_ip.sh @@ -0,0 +1,63 @@ +#!/bin/bash +# LinuxGSM check_ip.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Automatically identifies the server interface IP. +# If multiple interfaces are detected the user will need to manually set using ip="0.0.0.0". + +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +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 + ipcommand="${ip_command}" + break + fi +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 + ethtoolcommand="${ethtool_command}" + break + fi +done + +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 fn_is_valid_ip "${ip}"; then + queryips=("${ip}") + webadminip=("${ip}") + telnetip=("${ip}") +# If game config does have an IP set. +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[@]}") + 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[@]}") + ip="0.0.0.0" + webadminip=("${ip}") + telnetip=("${ip}") +fi diff --git a/lgsm/functions/check_last_update.sh b/lgsm/functions/check_last_update.sh new file mode 100644 index 0000000000..ee86c0ba14 --- /dev/null +++ b/lgsm/functions/check_last_update.sh @@ -0,0 +1,26 @@ +#!/bin/bash +# LinuxGSM check_last_update.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Checks lock file to see when last update happened. +# Will reboot server if instance not rebooted since update. + +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +if [ -f "${lockdir}/${selfname}-laststart.lock" ]; then + laststart=$(cat "${lockdir}/${selfname}-laststart.lock") +fi +if [ -f "${lockdir}/lastupdate.lock" ]; then + lastupdate=$(cat "${lockdir}/lastupdate.lock") +fi + +check_status.sh +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 + fn_firstcommand_reset + fi +fi diff --git a/lgsm/functions/check_permissions.sh b/lgsm/functions/check_permissions.sh new file mode 100644 index 0000000000..0094456ec3 --- /dev/null +++ b/lgsm/functions/check_permissions.sh @@ -0,0 +1,233 @@ +#!/bin/bash +# LinuxGSM check_permissions.sh +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Checks ownership & permissions of scripts, files and directories. + +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +fn_check_ownership() { + if [ -f "${rootdir}/${selfname}" ]; then + if [ "$(find "${rootdir}/${selfname}" -not -user "$(whoami)" | wc -l)" -ne "0" ]; then + selfownissue=1 + fi + fi + if [ -d "${functionsdir}" ]; then + if [ "$(find "${functionsdir}" -not -user "$(whoami)" | wc -l)" -ne "0" ]; then + funcownissue=1 + fi + fi + if [ -d "${serverfiles}" ]; then + if [ "$(find "${serverfiles}" -not -user "$(whoami)" | wc -l)" -ne "0" ]; then + filesownissue=1 + fi + fi + 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:" + fn_script_log_info "The current user ($(whoami)) does not have ownership of the following files:" + { + echo -e "User\tGroup\tFile\n" + if [ "${selfownissue}" == "1" ]; then + find "${rootdir}/${selfname}" -not -user "$(whoami)" -printf "%u\t%g\t%p\n" + fi + if [ "${funcownissue}" == "1" ]; then + find "${functionsdir}" -not -user "$(whoami)" -printf "%u\t%g\t%p\n" + fi + if [ "${filesownissue}" == "1" ]; then + find "${serverfiles}" -not -user "$(whoami)" -printf "%u\t%g\t%p\n" + fi + + } | column -s $'\t' -t | tee -a "${lgsmlog}" + echo -e "" + fn_print_information_nl "please see https://docs.linuxgsm.com/support/faq#fail-starting-game-server-permission-issues-found" + fn_script_log "For more information, please see https://docs.linuxgsm.com/support/faq#fail-starting-game-server-permission-issues-found" + if [ "${monitorflag}" == 1 ]; then + alert="permissions" + alert.sh + fi + core_exit.sh + fi +} + +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" + fn_script_log_fatal "Permissions issues found" + fn_print_information_nl "The following files are not executable:" + fn_script_log_info "The following files are not executable:" + { + echo -e "File\n" + find "${functionsdir}" -type f -not -executable -printf "%p\n" + } | column -s $'\t' -t | tee -a "${lgsmlog}" + if [ "${monitorflag}" == 1 ]; then + alert="permissions" + alert.sh + fi + core_exit.sh + fi + fi + + # Check rootdir permissions. + if [ "${rootdir}" ]; then + # Get permission numbers on directory under the form 775. + rootdirperm=$(stat -c %a "${rootdir}") + # 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 + 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:" + fn_script_log_info "The following directory does not have the correct permissions:" + fn_script_log_info "${rootdir}" + ls -l "${rootdir}" + if [ "${monitorflag}" == 1 ]; then + alert="permissions" + alert.sh + fi + core_exit.sh + fi + fi + # Check if executable is executable and attempt to fix it. + # First get executable name. + execname=$(basename "${executable}") + if [ -f "${executabledir}/${execname}" ]; then + # Get permission numbers on file under the form 775. + execperm=$(stat -c %a "${executabledir}/${execname}") + # Grab the first and second digit for user and group permission. + userexecperm="${execperm:0:1}" + groupexecperm="${execperm:1:1}" + # Check for invalid user permission. + 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 permission issues are found. + fn_print_warn_nl "Permissions issue found" + fn_script_log_warn "Permissions issue found" + fn_print_information_nl "The following file is not executable:" + ls -l "${executabledir}/${execname}" + fn_script_log_info "The following file is not executable:" + fn_script_log_info "${executabledir}/${execname}" + fn_print_information_nl "Applying chmod u+x,g+x ${executabledir}/${execname}" + fn_script_log_info "Applying chmod u+x,g+x ${execperm}" + # Make the executable executable. + chmod u+x,g+x "${executabledir}/${execname}" + # Second check to see if it's been successfully applied. + # Get permission numbers on file under the form 775. + execperm=$(stat -c %a "${executabledir}/${execname}") + # 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 + fi + fi + fi + fi + fi +} + +## 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() { + # 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 + sysdirpermerror="1" + fi + if [ ! -r "/sys/class" ] || [ ! -x "/sys/class" ]; then + classdirpermerror="1" + fi + 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() { + 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." + echo -e " * To fix this issue, run the following command as root:" + fn_script_log_info "To fix this issue, run the following command as root:" + echo -e " chmod a+rx /sys /sys/class /sys/class/net" + fn_script_log "chmod a+rx /sys /sys/class /sys/class/net" + fn_sleep_time + if [ "${monitorflag}" == 1 ]; then + alert="permissions" + alert.sh + fi + core_exit.sh +} + +# 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 + fn_print_dots "Automatically fixing /sys permissions" + fn_script_log_info "Automatically fixing /sys permissions." + if [ "${sysdirpermerror}" == "1" ]; then + sudo chmod a+rx "/sys" + fi + if [ "${classdirpermerror}" == "1" ]; then + sudo chmod a+rx "/sys/class" + fi + if [ "${netdirpermerror}" == "1" ]; then + sudo chmod a+rx "/sys/class/net" + fi + # Run check again to see if it's fixed. + fn_sys_perm_errors_detect + 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 + # Show the user how to fix. + fn_sys_perm_fix_manually_msg + else + fn_print_ok_nl "Automatically fixing /sys permissions" + fn_script_log_pass "Permissions in /sys fixed" + fi + else + # 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_errors_detect + # If any error was found. + 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 + fn_sys_perm_errors_fix + fi +} + +## Run permisions checks when not root or docker. +if [ "$(whoami)" != "root" ] && [ ! -f /.dockerenv ]; then + fn_check_ownership + fn_check_permissions + if [ "${commandname}" == "START" ]; then + fn_sys_perm_error_process + fi +fi diff --git a/lgsm/functions/check_status.sh b/lgsm/functions/check_status.sh new file mode 100644 index 0000000000..28ec38eb25 --- /dev/null +++ b/lgsm/functions/check_status.sh @@ -0,0 +1,10 @@ +#!/bin/bash +# LinuxGSM check_status.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Checks the process status of the server. Either online or offline. + +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +status=$(tmux list-sessions -F "#{session_name}" 2> /dev/null | grep -Ecx "^${sessionname}") diff --git a/lgsm/functions/check_steamcmd.sh b/lgsm/functions/check_steamcmd.sh new file mode 100644 index 0000000000..d41e8669f4 --- /dev/null +++ b/lgsm/functions/check_steamcmd.sh @@ -0,0 +1,22 @@ +#!/bin/bash +# LinuxGSM check_steamcmd.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Checks if SteamCMD is installed correctly. + +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +# init steamcmd functions +core_steamcmd.sh + +fn_check_steamcmd_clear +fn_check_steamcmd +if [ "${shortname}" == "ark" ]; then + fn_check_steamcmd_ark +fi +fn_check_steamcmd_dir +fn_check_steamcmd_dir_legacy +fn_check_steamcmd_steamapp +fn_check_steamcmd_user +fn_check_steamcmd_exec diff --git a/lgsm/functions/check_system_dir.sh b/lgsm/functions/check_system_dir.sh new file mode 100644 index 0000000000..0a732d6d13 --- /dev/null +++ b/lgsm/functions/check_system_dir.sh @@ -0,0 +1,22 @@ +#!/bin/bash +# LinuxGSM check_system_dir.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Checks if systemdir/serverfiles is accessible. + +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +if [ "${commandname}" != "VALIDATE" ]; then + checkdir="${serverfiles}" +else + checkdir="${systemdir}" +fi + +if [ ! -d "${checkdir}" ]; then + fn_print_fail_nl "Cannot access ${checkdir}: No such directory" + if [ -d "${lgsmlogdir}" ]; then + fn_script_log_fatal "Cannot access ${checkdir}: No such directory." + fi + core_exit.sh +fi diff --git a/lgsm/functions/check_system_requirements.sh b/lgsm/functions/check_system_requirements.sh new file mode 100644 index 0000000000..bfe597135c --- /dev/null +++ b/lgsm/functions/check_system_requirements.sh @@ -0,0 +1,55 @@ +#!/bin/bash +# LinuxGSM check_system_requirements.sh +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Checks RAM requirements. + +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +info_distro.sh + +# RAM requirements in megabytes for each game or engine. + +if [ "${shortname}" == "ark" ]; then + ramrequirementmb="4000" + ramrequirementgb="4" +elif [ "${shortname}" == "bt" ]; then + ramrequirementmb="1000" + ramrequirementgb="1" +elif [ "${shortname}" == "mh" ]; then + ramrequirementmb="4000" + ramrequirementgb="4" +elif [ "${shortname}" == "arma3" ]; then + ramrequirementmb="1000" + ramrequirementgb="1" +elif [ "${shortname}" == "rust" ]; then + ramrequirementmb="4000" + ramrequirementgb="4" +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 + ramrequirementmb="1000" + ramrequirementgb="1" +elif [ "${shortname}" == "st" ]; then + ramrequirementmb="1000" + ramrequirementgb="1" +elif [ "${shortname}" == "pvr" ]; then + ramrequirementmb="2000" + ramrequirementgb="2" +fi + +# If the game or engine has a minimum RAM Requirement, compare it to system's available RAM. +if [ "${ramrequirementmb}" ]; then + if [ "${physmemtotalmb}" -lt "${ramrequirementmb}" ]; then + fn_print_dots "Check RAM" + # Warn the user. + fn_print_warn_nl "Check RAM: ${ramrequirementgb}G required, ${physmemtotal} available" + echo "* ${gamename} server may fail to run or experience poor performance." + fn_sleep_time + fi +fi diff --git a/lgsm/functions/check_tmuxception.sh b/lgsm/functions/check_tmuxception.sh new file mode 100644 index 0000000000..64705a3a8b --- /dev/null +++ b/lgsm/functions/check_tmuxception.sh @@ -0,0 +1,33 @@ +#!/bin/bash +# LinuxGSM check_config.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Checks if run from tmux or screen. + +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +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." + echo -e "It is not possible to run a tmux session inside another tmux session" + echo -e "https://docs.linuxgsm.com/requirements/tmux#tmuxception" + core_exit.sh + fi +} + +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." + fn_print_information_nl "LinuxGSM creates a tmux session when starting the server." + echo -e "It is not possible to run a tmux session inside screen session" + echo -e "https://docs.linuxgsm.com/requirements/tmux#tmuxception" + core_exit.sh + fi +} + +fn_check_is_in_tmux +fn_check_is_in_screen diff --git a/lgsm/functions/check_version.sh b/lgsm/functions/check_version.sh new file mode 100644 index 0000000000..657e32b54c --- /dev/null +++ b/lgsm/functions/check_version.sh @@ -0,0 +1,23 @@ +#!/bin/bash +# LinuxGSM command_version.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Will run update-lgsm if gameserver.sh and modules version does not match +# this will allow gameserver.sh to update - useful for multi instance servers. + +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +if [ -n "${modulesversion}" ] && [ -n "${version}" ] && [ "${version}" != "${modulesversion}" ]; then + exitbypass=1 + echo -e "" + fn_print_error_nl "LinuxGSM version mismatch" + echo -e "" + echo -e "* ${selfname}: ${version}" + echo -e "* modules: ${modulesversion}" + echo -e "" + fn_sleep_time + fn_script_log_error "LinuxGSM Version mismatch: ${selfname}: ${version}: modules: ${modulesversion}" + command_update_linuxgsm.sh + fn_firstcommand_reset +fi diff --git a/lgsm/functions/command_backup.sh b/lgsm/functions/command_backup.sh new file mode 100644 index 0000000000..d69c57a0fd --- /dev/null +++ b/lgsm/functions/command_backup.sh @@ -0,0 +1,268 @@ +#!/bin/bash +# LinuxGSM command_backup.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Creates a .tar.gz file in the backup directory. + +commandname="BACKUP" +commandaction="Backing up" +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +fn_firstcommand_set + +check.sh + +# Trap to remove lockfile on quit. +fn_backup_trap() { + echo -e "" + echo -en "backup ${backupname}.tar.gz..." + fn_print_canceled_eol_nl + fn_script_log_info "Backup ${backupname}.tar.gz: CANCELED" + rm -f "${backupdir:?}/${backupname}.tar.gz" | tee -a "${lgsmlog}" + echo -en "backup ${backupname}.tar.gz..." + fn_print_removed_eol_nl + fn_script_log_info "Backup ${backupname}.tar.gz: REMOVED" + # Remove lock file. + rm -f "${lockdir:?}/backup.lock" + fn_backup_start_server + unset exitbypass + core_exit.sh +} + +# Check if a backup is pending or has been aborted using backup.lock. +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" + core_exit.sh + fi +} + +# Initialisation. +fn_backup_init() { + # Backup file name with selfname and current date. + backupname="${selfname}-$(date '+%Y-%m-%d-%H%M%S')" + + info_distro.sh + fn_print_dots "Backup starting" + fn_script_log_info "Backup starting" + fn_print_ok_nl "Backup starting" + if [ ! -d "${backupdir}" ] || [ "${backupcount}" == "0" ]; then + fn_print_info_nl "There are no previous backups" + else + if [ "${lastbackupdaysago}" == "0" ]; then + daysago="less than 1 day ago" + elif [ "${lastbackupdaysago}" == "1" ]; then + daysago="1 day ago" + else + daysago="${lastbackupdaysago} days ago" + fi + echo -e "* Previous backup was created ${daysago}, total size ${lastbackupsize}" + fi +} + +# Check if server is started and whether to stop it. +fn_backup_stop_server() { + check_status.sh + # Server is running but will not be stopped. + if [ "${stoponbackup}" == "off" ]; then + fn_print_warn_nl "${selfname} is currently running" + echo -e "* Although unlikely; creating a backup while ${selfname} is running might corrupt the backup." + fn_script_log_warn "${selfname} is currently running" + fn_script_log_warn "Although unlikely; creating a backup while ${selfname} is running might corrupt the backup" + # Server is running and will be stopped if stoponbackup=on or unset. + # If server is started + elif [ "${status}" != "0" ]; then + fn_print_restart_warning + startserver="1" + exitbypass=1 + command_stop.sh + fn_firstcommand_reset + fi +} + +# Create required folders. +fn_backup_dir() { + # Create backupdir if it doesn't exist. + if [ ! -d "${backupdir}" ]; then + mkdir -p "${backupdir}" + fi +} + +# Migrate Backups from old dir before refactor +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 + exitcode=$? + if [ "${exitcode}" == 0 ]; then + rmdir "${rootdir}/backups" 2> /dev/null + exitcode=$? + fi + 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 +} + +fn_backup_create_lockfile() { + # Create lockfile. + date '+%s' > "${lockdir}/backup.lock" + fn_script_log_info "Lockfile generated" + fn_script_log_info "${lockdir}/backup.lock" + # trap to remove lockfile on quit. + trap fn_backup_trap INT +} + +# Compressing files. +fn_backup_compression() { + # Tells how much will be compressed using rootdirduexbackup value from info_distro and prompt for continue. + fn_print_info "A total of ${rootdirduexbackup} will be compressed." + fn_script_log_info "A total of ${rootdirduexbackup} will be compressed: ${backupdir}/${backupname}.tar.gz" + fn_print_dots "Backup (${rootdirduexbackup}) ${backupname}.tar.gz, in progress..." + fn_script_log_info "backup ${rootdirduexbackup} ${backupname}.tar.gz, in progress" + excludedir=$(fn_backup_relpath) + + # Check that excludedir is a valid path. + 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 + fi + + tar -czf "${backupdir}/${backupname}.tar.gz" -C "${rootdir}" --exclude "${excludedir}" --exclude "${lockdir}/backup.lock" ./. + local exitcode=$? + if [ "${exitcode}" != 0 ]; then + fn_print_fail_eol + fn_script_log_fatal "Backup in progress: FAIL" + echo -e "${extractcmd}" | tee -a "${lgsmlog}" + fn_print_fail_nl "Starting backup" + fn_script_log_fatal "Starting backup" + else + fn_print_ok_eol + fn_print_ok_nl "Completed: ${backupname}.tar.gz, total size $(du -sh "${backupdir}/${backupname}.tar.gz" | awk '{print $1}')" + fn_script_log_pass "Backup created: ${backupname}.tar.gz, total size $(du -sh "${backupdir}/${backupname}.tar.gz" | awk '{print $1}')" + fi + # Remove lock file + rm -f "${lockdir:?}/backup.lock" +} + +# Clear old backups according to maxbackups and maxbackupdays variables. +fn_backup_prune() { + # Clear if backup variables are set. + if [ "${maxbackups}" ] && [ -n "${maxbackupdays}" ]; then + # How many backups there are. + info_distro.sh + # How many backups exceed maxbackups. + backupquotadiff=$((backupcount - maxbackups)) + # How many backups exceed maxbackupdays. + 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 + fn_print_dots "Pruning" + fn_script_log_info "Backup pruning activated" + fn_print_ok_nl "Pruning" + # If maxbackups greater or equal to backupsoutdatedcount, then it is over maxbackupdays. + if [ "${backupquotadiff}" -ge "${backupsoudatedcount}" ]; then + # Display how many backups will be cleared. + echo -e "* Pruning: ${backupquotadiff} backup(s) has exceeded the ${maxbackups} backups limit" + fn_script_log_info "Pruning: ${backupquotadiff} backup(s) has exceeded the ${maxbackups} backups limit" + fn_sleep_time + fn_print_dots "Pruning: Clearing ${backupquotadiff} backup(s)" + fn_script_log_info "Pruning: Clearing ${backupquotadiff} backup(s)" + # Clear backups over quota. + find "${backupdir}"/ -type f -name "*.tar.gz" -printf '%T@ %p\n' | sort -rn | tail -${backupquotadiff} | cut -f2- -d" " | xargs rm + fn_print_ok_nl "Pruning: Clearing ${backupquotadiff} backup(s)" + fn_script_log_pass "Pruning: Cleared ${backupquotadiff} backup(s)" + # If maxbackupdays is used over maxbackups. + elif [ "${backupquotadiff}" -lt "${backupsoudatedcount}" ]; then + # Display how many backups will be cleared. + echo -e "* Pruning: ${backupsoudatedcount} backup(s) are older than ${maxbackupdays} days." + fn_script_log_info "Pruning: ${backupsoudatedcount} backup(s) older than ${maxbackupdays} days." + fn_sleep_time + fn_print_dots "Pruning: Clearing ${backupquotadiff} backup(s)." + fn_script_log_info "Pruning: Clearing ${backupquotadiff} backup(s)" + # Clear backups over quota + find "${backupdir}"/ -type f -mtime +"${maxbackupdays}" -exec rm -f {} \; + fn_print_ok_nl "Pruning: Clearing ${backupquotadiff} backup(s)" + fn_script_log_pass "Pruning: Cleared ${backupquotadiff} backup(s)" + fi + fi + fi +} + +fn_backup_relpath() { + # Written by CedarLUG as a "realpath --relative-to" alternative in bash. + # Populate an array of tokens initialized from the rootdir components. + declare -a rdirtoks=($(readlink -f "${rootdir}" | sed "s/\// /g")) + if [ ${#rdirtoks[@]} -eq 0 ]; then + fn_print_fail_nl "Problem assessing rootdir during relative path assessment" + fn_script_log_fatal "Problem assessing rootdir during relative path assessment: ${rootdir}" + core_exit.sh + fi + + # Populate an array of tokens initialized from the backupdir components. + declare -a bdirtoks=($(readlink -f "${backupdir}" | sed "s/\// /g")) + if [ ${#bdirtoks[@]} -eq 0 ]; then + fn_print_fail_nl "Problem assessing backupdir during relative path assessment" + fn_script_log_fatal "Problem assessing backupdir during relative path assessment: ${rootdir}" + core_exit.sh + fi + + # 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 + [[ "${rdirtoks[$base]}" != "${bdirtoks[$base]}" ]] && break + done + + # Next, climb out of the remaining rootdir location with updir references. + 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 + 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))]}" + else + echo + fi +} + +# Start the server if it was stopped for the backup. +fn_backup_start_server() { + if [ -n "${startserver}" ]; then + exitbypass=1 + command_start.sh + fn_firstcommand_reset + fi +} + +# Run functions. +fn_backup_check_lockfile +fn_backup_init +fn_backup_stop_server +fn_backup_dir +fn_backup_migrate_olddir +fn_backup_create_lockfile +fn_backup_compression +fn_backup_prune +fn_backup_start_server + +core_exit.sh diff --git a/lgsm/functions/command_check_update.sh b/lgsm/functions/command_check_update.sh new file mode 100644 index 0000000000..b2647e2a16 --- /dev/null +++ b/lgsm/functions/command_check_update.sh @@ -0,0 +1,39 @@ +#!/bin/bash +# LinuxGSM command_check_update.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Handles updating of servers. + +commandname="CHECK-UPDATE" +commandaction="Check for Update" +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +fn_firstcommand_set + +fn_print_dots "" +check.sh +core_logs.sh + +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_console.sh b/lgsm/functions/command_console.sh new file mode 100644 index 0000000000..5b84789e66 --- /dev/null +++ b/lgsm/functions/command_console.sh @@ -0,0 +1,58 @@ +#!/bin/bash +# LinuxGSM command_console.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Gives access to the server tmux console. + +commandname="CONSOLE" +commandaction="Access console" +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +fn_firstcommand_set + +check.sh +fn_print_header + +if [ "${consoleverbose}" == "yes" ]; then + echo -e "* Verbose output: ${lightgreen}yes${default}" +elif [ "${consoleverbose}" == "no" ]; then + echo -e "* Verbose output: ${red}no${default}" +else + echo -e "* Verbose output: ${red}unknown${default}" +fi + +if [ "${consoleinteract}" == "yes" ]; then + echo -e "* Interactive output: ${lightgreen}yes${default}" +elif [ "${consoleinteract}" == "no" ]; then + echo -e "* Interactive output: ${red}no${default}" +else + echo -e "* Interactive output: ${red}unknown${default}" +fi +echo "" +fn_print_information_nl "Press \"CTRL+b\" then \"d\" to exit console." +fn_print_warning_nl "Do NOT press CTRL+c to exit." +echo -e "* https://docs.linuxgsm.com/commands/console" +echo -e "" +if ! fn_prompt_yn "Continue?" Y; then + exitcode=0 + core_exit.sh +fi +fn_print_dots "Accessing console" +check_status.sh +if [ "${status}" != "0" ]; then + fn_print_ok_nl "Accessing console" + fn_script_log_pass "Console accessed" + tmux attach-session -t "${sessionname}" + fn_print_ok_nl "Closing console" + fn_script_log_pass "Console closed" +else + fn_print_error_nl "Server not running" + fn_script_log_error "Failed to access: Server not running" + if fn_prompt_yn "Do you want to start the server?" Y; then + exitbypass=1 + command_start.sh + fn_firstcommand_reset + fi +fi + +core_exit.sh diff --git a/lgsm/functions/command_debug.sh b/lgsm/functions/command_debug.sh new file mode 100644 index 0000000000..c6422be651 --- /dev/null +++ b/lgsm/functions/command_debug.sh @@ -0,0 +1,142 @@ +#!/bin/bash +# LinuxGSM command_debug.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Runs the server without tmux and directly from the terminal. + +commandname="DEBUG" +commandaction="Debuging" +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +fn_firstcommand_set + +# Trap to remove lockfile on quit. +fn_lockfile_trap() { + # Remove lockfile. + rm -f "${lockdir:?}/${selfname}.lock" + # resets terminal. Servers can sometimes mess up the terminal on exit. + reset + fn_print_dots "Stopping debug" + fn_print_ok_nl "Stopping debug" + fn_script_log_pass "Stopping debug" + # remove trap. + trap - INT + core_exit.sh +} + +check.sh +fix.sh +info_distro.sh +info_game.sh +fn_print_header +{ + echo -e "${lightblue}Distro:\t\t${default}${distroname}" + echo -e "${lightblue}Architecture:\t\t${default}${arch}" + echo -e "${lightblue}Kernel:\t\t${default}${kernel}" + echo -e "${lightblue}Hostname:\t\t${default}${HOSTNAME}" + echo -e "${lightblue}tmux:\t\t${default}${tmuxv}" + echo -e "${lightblue}Avg Load:\t\t${default}${load}" + 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 [ -n "${glibc}" ]; then + if [ "${glibc}" == "null" ]; then + # Glibc is not required. + : + elif [ -z "${glibc}" ]; then + echo -e "${lightblue}glibc required:\t${red}UNKNOWN${default}" + elif [ "$(printf '%s\n'${glibc}'\n' ${glibcversion} | sort -V | head -n 1)" != "${glibc}" ]; then + echo -e "${lightblue}glibc required:\t${red}${glibc} ${default}(${red}distro glibc ${glibcversion} too old${default})" + else + echo -e "${lightblue}glibc required:\t${green}${glibc}${default}" + fi +fi + +# Server IP. +echo -e "${lightblue}Game Server IP:\t${default}${ip}:${port}" + +# External server IP. +if [ "${extip}" ]; then + if [ "${ip}" != "${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}" +fi + +fn_reload_startparameters +echo -e "${lightblue}Start parameters:${default}" +if [ "${engine}" == "source" ] || [ "${engine}" == "goldsrc" ]; then + echo -e "${executable} ${startparameters} -debug" +elif [ "${engine}" == "quake" ]; then + echo -e "${executable} ${startparameters} -condebug" +else + echo -e "${preexecutable} ${executable} ${startparameters}" +fi +echo -e "" +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 "" +if ! fn_prompt_yn "Continue?" Y; then + exitcode=0 + core_exit.sh +fi + +fn_print_info_nl "Stopping any running servers" +fn_script_log_info "Stopping any running servers" +exitbypass=1 +command_stop.sh +fn_firstcommand_reset +unset exitbypass +fn_print_dots "Starting debug" +fn_script_log_info "Starting debug" +fn_print_ok_nl "Starting debug" + +# Create lockfile. +date '+%s' > "${lockdir}/${selfname}.lock" +echo "${version}" >> "${lockdir}/${selfname}.lock" +echo "${port}" >> "${lockdir}/${selfname}.lock" +fn_script_log_info "Lockfile generated" +fn_script_log_info "${lockdir}/${selfname}.lock" + +if [ "${shortname}" == "av" ]; then + cd "${systemdir}" || exit +else + cd "${executabledir}" || exit +fi + +# Note: do not add double quotes to ${executable} ${startparameters}. +if [ "${engine}" == "source" ] || [ "${engine}" == "goldsrc" ]; then + eval "${executable} ${startparameters} -debug" +elif [ "${engine}" == "quake" ]; then + eval "${executable} ${startparameters} -condebug" +else + # shellcheck disable=SC2086 + 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" +fn_print_ok_nl "Stopping debug" +fn_script_log_info "Stopping debug" + +core_exit.sh diff --git a/lgsm/functions/command_details.sh b/lgsm/functions/command_details.sh new file mode 100644 index 0000000000..08d9f031b4 --- /dev/null +++ b/lgsm/functions/command_details.sh @@ -0,0 +1,41 @@ +#!/bin/bash +# LinuxGSM command_details.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Displays server information. + +commandname="DETAILS" +commandaction="Viewing details" +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +fn_firstcommand_set + +# Run checks and gathers details to display. +check.sh +info_distro.sh +info_game.sh +info_messages.sh +if [ "${querymode}" == "2" ] || [ "${querymode}" == "3" ]; then + for queryip in "${queryips[@]}"; do + query_gamedig.sh + if [ "${querystatus}" == "0" ]; then + break + fi + done +fi +fn_info_message_distro +fn_info_message_server_resource +fn_info_message_gameserver_resource +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 + fn_info_message_commandlineparms +fi +fn_info_message_ports_edit +fn_info_message_ports +fn_info_message_select_engine +fn_info_message_statusbottom + +core_exit.sh diff --git a/lgsm/functions/command_dev_clear_functions.sh b/lgsm/functions/command_dev_clear_functions.sh new file mode 100644 index 0000000000..87c77515d3 --- /dev/null +++ b/lgsm/functions/command_dev_clear_functions.sh @@ -0,0 +1,24 @@ +#!/bin/bash +# LinuxGSM command_dev_clear_functions.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Deletes the contents of the functions dir. + +commandname="DEV-CLEAR-MODULES" +commandaction="Clearing modules" +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +fn_firstcommand_set + +echo -e "=================================" +echo -e "Clear Functions" +echo -e "=================================" +echo -e "" +if fn_prompt_yn "Do you want to delete all functions?" Y; then + rm -rfv "${functionsdir:?}/"* + rm -rfv "${configdirdefault:?}/"* + fn_script_log_info "Cleared modules directory" + fn_script_log_info "Cleared default config directory" +fi + +core_exit.sh diff --git a/lgsm/functions/command_dev_debug.sh b/lgsm/functions/command_dev_debug.sh new file mode 100644 index 0000000000..19f16d58e2 --- /dev/null +++ b/lgsm/functions/command_dev_debug.sh @@ -0,0 +1,23 @@ +#!/bin/bash +# LinuxGSM command_dev_debug.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Dev only: Enables debugging log to be saved to dev-debug.log. + +commandname="DEV-DEBUG" +commandaction="Developer debug" +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +fn_firstcommand_reset + +if [ -f "${rootdir}/.dev-debug" ]; then + rm -f "${rootdir:?}/.dev-debug" + fn_print_ok_nl "Disabled dev-debug" + fn_script_log_info "Disabled dev-debug" +else + date '+%s' > "${rootdir}/.dev-debug" + fn_print_ok_nl "Enabled dev-debug" + fn_script_log_info "Enabled dev-debug" +fi + +core_exit.sh diff --git a/lgsm/functions/command_dev_detect_deps.sh b/lgsm/functions/command_dev_detect_deps.sh new file mode 100644 index 0000000000..d16b744189 --- /dev/null +++ b/lgsm/functions/command_dev_detect_deps.sh @@ -0,0 +1,231 @@ +#!/bin/bash +# LinuxGSM command_dev_detect_deps.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Detects dependencies the server binary requires. + +commandname="DEV-DETECT-DEPS" +commandaction="Developer detect deps" +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +fn_firstcommand_set + +echo -e "=================================" +echo -e "Dependencies Checker" +echo -e "=================================" +echo -e "Checking directory: " +echo -e "${serverfiles}" +if [ "$(command -v eu-readelf 2> /dev/null)" ]; then + readelf=eu-readelf +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 + +sort "${tmpdir}/.depdetect_readelf" | uniq > "${tmpdir}/.depdetect_readelf_uniq" + +touch "${tmpdir}/.depdetect_centos_list" +touch "${tmpdir}/.depdetect_ubuntu_list" +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) + for lib_file in "${libs_array[@]}"; do + if [ "${lib}" == "${lib_file}" ]; then + echo -e "glibc.i686" >> "${tmpdir}/.depdetect_centos_list" + echo -e "lib32gcc1" >> "${tmpdir}/.depdetect_ubuntu_list" + echo -e "lib32gcc1" >> "${tmpdir}/.depdetect_debian_list" + libdetected=1 + fi + done + + 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" + echo -e "default-jre" >> "${tmpdir}/.depdetect_ubuntu_list" + echo -e "default-jre" >> "${tmpdir}/.depdetect_debian_list" + libdetected=1 + 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) + for lib_file in "${libs_array[@]}"; do + # Known shared libs what dont requires dependencies. + if [ "${lib}" == "${lib_file}" ]; then + libdetected=1 + fi + done + + if [ "${lib}" == "libstdc++.so.6" ]; then + echo -e "libstdc++.i686" >> "${tmpdir}/.depdetect_centos_list" + echo -e "libstdc++6:i386" >> "${tmpdir}/.depdetect_ubuntu_list" + echo -e "libstdc++6:i386" >> "${tmpdir}/.depdetect_debian_list" + libdetected=1 + elif [ "${lib}" == "libstdc++.so.5" ]; then + echo -e "compat-libstdc++-33.i686" >> "${tmpdir}/.depdetect_centos_list" + echo -e "libstdc++5:i386" >> "${tmpdir}/.depdetect_ubuntu_list" + echo -e "libstdc++5:i386" >> "${tmpdir}/.depdetect_debian_list" + libdetected=1 + elif [ "${lib}" == "libcurl-gnutls.so.4" ]; then + echo -e "libcurl.i686" >> "${tmpdir}/.depdetect_centos_list" + 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 + 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 + echo -e "SDL.i686" >> "${tmpdir}/.depdetect_centos_list" + echo -e "libsdl1.2debian" >> "${tmpdir}/.depdetect_ubuntu_list" + echo -e "libsdl1.2debian" >> "${tmpdir}/.depdetect_debian_list" + libdetected=1 + elif [ "${lib}" == "libtbb.so.2" ]; then + echo -e "tbb.i686" >> "${tmpdir}/.depdetect_centos_list" + echo -e "libtbb2" >> "${tmpdir}/.depdetect_ubuntu_list" + echo -e "libtbb2" >> "${tmpdir}/.depdetect_debian_list" + libdetected=1 + + elif [ "${lib}" == "libXrandr.so.2" ]; then + echo -e "libXrandr" >> "${tmpdir}/.depdetect_centos_list" + echo -e "libxrandr2" >> "${tmpdir}/.depdetect_ubuntu_list" + echo -e "libxrandr2" >> "${tmpdir}/.depdetect_debian_list" + libdetected=1 + elif [ "${lib}" == "libXext.so.6" ]; then + echo -e "libXext" >> "${tmpdir}/.depdetect_centos_list" + echo -e "libxext6" >> "${tmpdir}/.depdetect_ubuntu_list" + echo -e "libxext6" >> "${tmpdir}/.depdetect_debian_list" + libdetected=1 + elif [ "${lib}" == "libXtst.so.6" ]; then + echo -e "libXtst" >> "${tmpdir}/.depdetect_centos_list" + echo -e "libxtst6" >> "${tmpdir}/.depdetect_ubuntu_list" + echo -e "libxtst6" >> "${tmpdir}/.depdetect_debian_list" + libdetected=1 + elif [ "${lib}" == "libpulse.so.0" ]; then + echo -e "pulseaudio-libs" >> "${tmpdir}/.depdetect_centos_list" + echo -e "libpulse0" >> "${tmpdir}/.depdetect_ubuntu_list" + echo -e "libpulse0" >> "${tmpdir}/.depdetect_debian_list" + libdetected=1 + elif [ "${lib}" == "libopenal.so.1" ]; then + echo -e "" >> "${tmpdir}/.depdetect_centos_list" + echo -e "libopenal1" >> "${tmpdir}/.depdetect_ubuntu_list" + echo -e "libopenal1" >> "${tmpdir}/.depdetect_debian_list" + libdetected=1 + elif [ "${lib}" == "libgconf-2.so.4" ]; then + echo -e "GConf2" >> "${tmpdir}/.depdetect_centos_list" + echo -e "libgconf2-4" >> "${tmpdir}/.depdetect_ubuntu_list" + echo -e "libgconf2-4" >> "${tmpdir}/.depdetect_debian_list" + libdetected=1 + elif [ "${lib}" == "libz.so.1" ]; then + echo -e "zlib" >> "${tmpdir}/.depdetect_centos_list" + echo -e "zlib1g" >> "${tmpdir}/.depdetect_ubuntu_list" + echo -e "zlib1g" >> "${tmpdir}/.depdetect_debian_list" + libdetected=1 + elif [ "${lib}" == "libatk-1.0.so.0" ]; then + echo -e "atk" >> "${tmpdir}/.depdetect_centos_list" + echo -e "libatk1.0-0" >> "${tmpdir}/.depdetect_ubuntu_list" + echo -e "libatk1.0-0" >> "${tmpdir}/.depdetect_debian_list" + libdetected=1 + elif [ "${lib}" == "libcairo.so.2" ]; then + echo -e "cairo" >> "${tmpdir}/.depdetect_centos_list" + echo -e "libcairo2" >> "${tmpdir}/.depdetect_ubuntu_list" + echo -e "libcairo2" >> "${tmpdir}/.depdetect_debian_list" + libdetected=1 + elif [ "${lib}" == "libfontconfig.so.1" ]; then + echo -e "fontconfig" >> "${tmpdir}/.depdetect_centos_list" + echo -e "libfontconfig1" >> "${tmpdir}/.depdetect_ubuntu_list" + echo -e "libfontconfig1" >> "${tmpdir}/.depdetect_debian_list" + libdetected=1 + elif [ "${lib}" == "libfreetype.so.6" ]; then + echo -e "freetype" >> "${tmpdir}/.depdetect_centos_list" + echo -e "libfreetype6" >> "${tmpdir}/.depdetect_ubuntu_list" + echo -e "libfreetype6" >> "${tmpdir}/.depdetect_debian_list" + libdetected=1 + elif [ "${lib}" == "libc++.so.1" ]; then + echo -e "libcxx" >> "${tmpdir}/.depdetect_centos_list" + echo -e "libc++1" >> "${tmpdir}/.depdetect_ubuntu_list" + echo -e "libc++1" >> "${tmpdir}/.depdetect_debian_list" + libdetected=1 + fi + + if [ "${libdetected}" != "1" ]; then + unknownlib=1 + echo -e "${lib}" >> "${tmpdir}/.depdetect_unknown" + fi + unset libdetected +done < "${tmpdir}/.depdetect_readelf_uniq" + +sort "${tmpdir}/.depdetect_centos_list" | uniq >> "${tmpdir}/.depdetect_centos_list_uniq" +sort "${tmpdir}/.depdetect_ubuntu_list" | uniq >> "${tmpdir}/.depdetect_ubuntu_list_uniq" +sort "${tmpdir}/.depdetect_debian_list" | uniq >> "${tmpdir}/.depdetect_debian_list_uniq" +if [ "${unknownlib}" == "1" ]; then + sort "${tmpdir}/.depdetect_unknown" | uniq >> "${tmpdir}/.depdetect_unknown_uniq" +fi + +awk -vORS='' '{ print $1,$2 }' "${tmpdir}/.depdetect_centos_list_uniq" > "${tmpdir}/.depdetect_centos_line" +awk -vORS='' '{ print $1,$2 }' "${tmpdir}/.depdetect_ubuntu_list_uniq" > "${tmpdir}/.depdetect_ubuntu_line" +awk -vORS='' '{ print $1,$2 }' "${tmpdir}/.depdetect_debian_list_uniq" > "${tmpdir}/.depdetect_debian_line" +echo -e "" +echo -e "" +echo -e "Required Dependencies" +echo -e "=================================" +echo -e "${executable}" +echo -e "" +echo -e "CentOS" +echo -e "=================================" +cat "${tmpdir}/.depdetect_centos_line" +echo -e "" +echo -e "" +echo -e "Ubuntu" +echo -e "=================================" +cat "${tmpdir}/.depdetect_ubuntu_line" +echo -e "" +echo -e "" +echo -e "Debian" +echo -e "=================================" +cat "${tmpdir}/.depdetect_debian_line" +echo -e "" +if [ "${unknownlib}" == "1" ]; then + echo -e "" + echo -e "Unknown shared Library" + echo -e "=================================" + cat "${tmpdir}/.depdetect_unknown" +fi +echo -e "" +echo -e "Required Librarys" +echo -e "=================================" +sort "${tmpdir}/.depdetect_readelf" | uniq +echo -en "\n" +rm -f "${tmpdir:?}/.depdetect_centos_line" +rm -f "${tmpdir:?}/.depdetect_centos_list" +rm -f "${tmpdir:?}/.depdetect_centos_list_uniq" + +rm -f "${tmpdir:?}/.depdetect_debian_line" +rm -f "${tmpdir:?}/.depdetect_debian_list" +rm -f "${tmpdir:?}/.depdetect_debian_list_uniq" + +rm -f "${tmpdir:?}/.depdetect_ubuntu_line" +rm -f "${tmpdir:?}/.depdetect_ubuntu_list" +rm -f "${tmpdir:?}/.depdetect_ubuntu_list_uniq" + +rm -f "${tmpdir:?}/.depdetect_readelf" +rm -f "${tmpdir:?}/.depdetect_readelf_uniq" +rm -f "${tmpdir:?}/.depdetect_unknown" +rm -f "${tmpdir:?}/.depdetect_unknown_uniq" + +core_exit.sh diff --git a/lgsm/functions/command_dev_detect_glibc.sh b/lgsm/functions/command_dev_detect_glibc.sh new file mode 100644 index 0000000000..73280e55d3 --- /dev/null +++ b/lgsm/functions/command_dev_detect_glibc.sh @@ -0,0 +1,92 @@ +#!/bin/bash +# LinuxGSM command_dev_detect_glibc.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Automatically detects the version of GLIBC that is required. +# Can check a file or directory recursively. + +commandname="DEV-DETECT-GLIBC" +commandaction="Developer detect glibc" +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +fn_firstcommand_set + +echo -e "=================================" +echo -e "glibc Requirements Checker" +echo -e "=================================" + +if [ ! "$(command -v objdump)" ]; then + fn_print_failure_nl "objdump is missing" + fn_script_log_fatal "objdump is missing" + core_exit.sh +fi + +if [ -z "${serverfiles}" ]; then + dir=$(dirname "$(readlink -f "${BASH_SOURCE[0]}")") +fi + +if [ -d "${serverfiles}" ]; then + echo -e "Checking directory: " + echo -e "${serverfiles}" +elif [ -f "${serverfiles}" ]; then + echo -e "Checking file: " + echo -e "${serverfiles}" +fi +echo -e "" + +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}" + glibc_check_name="${gamename}" + elif [ "${glibc_check_var}" == "steamcmddir" ]; then + glibc_check_dir="${steamcmddir}" + glibc_check_name="SteamCMD" + fi + + 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 "=================================" + 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" + echo -e "" + echo -e "Files requiring GLIBC" + echo -e "Highest verion required: filename" + cat "${tmpdir}/detect_glibc_files_${glibc_check_var}.tmp" + echo -e "" + echo -e "All required GLIBC versions" + cat "${tmpdir}/detect_glibc_${glibc_check_var}.tmp" | sort | uniq | sort -r --version-sort + rm -f "${tmpdir:?}/detect_glibc_${glibc_check_var}.tmp" + rm -f "${tmpdir:?}/detect_glibc_files_${glibc_check_var}.tmp" + else + fn_print_information_nl "glibc is not required" + fi + else + fn_print_information_nl "${glibc_check_name} is not installed" + fi +done +echo -e "" +echo -e "Final glibc Requirement" +echo -e "=================================" +if [ -f "${tmpdir}/detect_glibc_highest.tmp" ]; then + cat "${tmpdir}/detect_glibc_highest.tmp" | sort | uniq | sort -r --version-sort | head -1 + rm -f "${tmpdir:?}/detect_glibc_highest.tmp" +else + fn_print_information_nl "glibc is not required" +fi + +core_exit.sh diff --git a/lgsm/functions/command_dev_detect_ldd.sh b/lgsm/functions/command_dev_detect_ldd.sh new file mode 100644 index 0000000000..43630d4e93 --- /dev/null +++ b/lgsm/functions/command_dev_detect_ldd.sh @@ -0,0 +1,61 @@ +#!/bin/bash +# LinuxGSM command_dev_detect_ldd.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Automatically detects required deps using ldd. +# Can check a file or directory recursively. + +commandname="DEV-DETECT-LDD" +commandaction="Developer detect ldd" +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +fn_firstcommand_set + +echo -e "=================================" +echo -e "Shared Object dependencies Checker" +echo -e "=================================" + +if [ -z "${serverfiles}" ]; then + dir=$(dirname "$(readlink -f "${BASH_SOURCE[0]}")") +fi + +if [ -d "${serverfiles}" ]; then + echo -e "Checking directory: " + echo -e "${serverfiles}" +elif [ -f "${serverfiles}" ]; then + echo -e "Checking file: " + echo -e "${serverfiles}" +fi +echo -e "" +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" + fi + fi + echo -n "$i / $files" $'\r' + ((i++)) + done +echo -e "" +echo -e "" +echo -e "All" +echo -e "=================================" +cat "${tmpdir}/detect_ldd.tmp" + +echo -e "" +echo -e "Not Found" +echo -e "=================================" +cat "${tmpdir}/detect_ldd_not_found.tmp" + +rm -f "${tmpdir:?}/detect_ldd.tmp" +rm -f "${tmpdir:?}/detect_ldd_not_found.tmp" + +core_exit.sh diff --git a/lgsm/functions/command_dev_query_raw.sh b/lgsm/functions/command_dev_query_raw.sh new file mode 100644 index 0000000000..26884b2598 --- /dev/null +++ b/lgsm/functions/command_dev_query_raw.sh @@ -0,0 +1,280 @@ +#!/bin/bash +# LinuxGSM command_dev_query_raw.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Raw gamedig output of the server. + +commandname="DEV-QUERY-RAW" +commandaction="Developer query raw" +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +fn_firstcommand_set + +check.sh +info_game.sh +info_distro.sh +info_messages.sh + +echo -e "" +echo -e "${lightgreen}Query IP Addresses${default}" +echo -e "==================================================================" +echo -e "" +for queryip in "${queryips[@]}"; do + echo -e "${queryip}" +done +echo -e "" +echo -e "${lightgreen}Game Server Ports${default}" +echo -e "==================================================================" +{ + echo -e "${lightblue}Port Name \tPort Number \tStatus \tTCP \tUDP${default}" + if [ -v port ]; then + echo -e "Game: \t${port} \t$(ss -tupl | grep -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 -c ${port}) \t$(ss -tupl | grep ${port2} | grep tcp | awk '{ print $2 }') \t$(ss -tupl | grep ${port2} | grep udp | awk '{ print $2 }')" + else + echo -e "Game+1:" + fi + + if [ -v port3 ]; then + echo -e "Game+2: \t${port3} \t$(ss -tupl | grep -c ${port}) \t$(ss -tupl | grep ${port3} | grep tcp | awk '{ print $2 }') \t$(ss -tupl | grep ${port3} | grep udp | awk '{ print $2 }')" + else + echo -e "Game+2:" + fi + + if [ -v port4 ]; then + echo -e "Game+3: \t${port4} \t$(ss -tupl | grep -c ${port}) \t$(ss -tupl | grep ${port4} | grep tcp | awk '{ print $2 }') \t$(ss -tupl | grep ${port4} | grep udp | awk '{ print $2 }')" + else + echo -e "Game+3:" + fi + fi + + if [ -v port401 ]; then + echo -e "Game+400: \t${port401} \t$(ss -tupl | grep -c ${port401}) \t$(ss -tupl | grep ${port401} | grep tcp | awk '{ print $2 }') \t$(ss -tupl | grep ${port401} | grep udp | awk '{ print $2 }')" + else + echo -e "Game+400:" + fi + + if [ -v portipv6 ]; then + 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 -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 -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 -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 -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 -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 -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 -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 -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 -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 -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 -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 -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 -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 -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 -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 -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 -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 -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 -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 -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 -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 -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 + +} | column -s $'\t' -t +echo -e "" +echo -e "${lightgreen}SS Output${default}" +echo -e "=================================" +fn_info_message_ports +echo -e "" +echo -e "${lightgreen}Query Port - Raw Output${default}" +echo -e "==================================================================" +echo -e "" +echo -e "PORT: ${port}" +echo -e "QUERY PORT: ${queryport}" +echo -e "" +echo -e "${lightgreen}Gamedig Raw Output${default}" +echo -e "=================================" +echo -e "" +if [ ! "$(command -v gamedig 2> /dev/null)" ]; then + fn_print_failure_nl "gamedig not installed" +fi +if [ ! "$(command -v jq 2> /dev/null)" ]; then + fn_print_failure_nl "jq not installed" +fi +for queryip in "${queryips[@]}"; do + query_gamedig.sh + echo -e "${gamedigcmd}" + echo"" + echo "${gamedigraw}" | jq +done +echo -e "" +echo -e "${lightgreen}gsquery Raw Output${default}" +echo -e "=================================" +echo -e "" +for queryip in "${queryips[@]}"; do + echo -e "./query_gsquery.py -a \"${queryip}\" -p \"${queryport}\" -e \"${querytype}\"" + echo -e "" + if [ ! -f "${functionsdir}/query_gsquery.py" ]; then + fn_fetch_file_github "lgsm/functions" "query_gsquery.py" "${functionsdir}" "chmodx" "norun" "noforce" "nohash" + fi + "${functionsdir}"/query_gsquery.py -a "${queryip}" -p "${queryport}" -e "${querytype}" +done +echo -e "" +echo -e "${lightgreen}TCP Raw Output${default}" +echo -e "=================================" +echo -e "" +for queryip in "${queryips[@]}"; do + echo -e "bash -c 'exec 3<> /dev/tcp/'${queryip}'/'${queryport}''" + echo -e "" + timeout 3 bash -c 'exec 3<> /dev/tcp/'${queryip}'/'${queryport}'' + querystatus="$?" + echo -e "" + if [ "${querystatus}" == "0" ]; then + echo -e "TCP query PASS" + else + echo -e "TCP query FAIL" + fi +done +echo -e "" +echo -e "${lightgreen}Game Port - Raw Output${default}" +echo -e "==================================================================" +echo -e "" +echo -e "${lightgreen}TCP Raw Output${default}" +echo -e "=================================" +echo -e "" +for queryip in "${queryips[@]}"; do + echo -e "bash -c 'exec 3<> /dev/tcp/'${queryip}'/'${port}''" + echo -e "" + timeout 3 bash -c 'exec 3<> /dev/tcp/'${queryip}'/'${port}'' + querystatus="$?" + echo -e "" + if [ "${querystatus}" == "0" ]; then + echo -e "TCP query PASS" + else + echo -e "TCP query FAIL" + fi +done +echo -e "" +echo -e "${lightgreen}Steam Master Server Response${default}" +echo -e "==================================================================" +echo -e "" +echo -e "Response: ${displaymasterserver}" +echo -e "" + +exitcode=0 +core_exit.sh diff --git a/lgsm/functions/command_donate.sh b/lgsm/functions/command_donate.sh new file mode 100644 index 0000000000..f00a4d7025 --- /dev/null +++ b/lgsm/functions/command_donate.sh @@ -0,0 +1,26 @@ +#!/bin/bash +# LinuxGSM command_donate.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Shows ways to donate. + +commandname="DONATE" +commandaction="Donate" +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +fn_firstcommand_set + +fn_print_ascii_logo +echo -e "${lightyellow}Support LinuxGSM${default}" +echo -e "=================================" +echo -e "" +echo -e "Been using LinuxGSM?" +echo -e "Consider donating 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}PayPal:${default} https://linuxgsm.com/paypal" +echo -e "" +echo -e "LinuxGSM est. 2012" + +core_exit.sh diff --git a/lgsm/functions/command_fastdl.sh b/lgsm/functions/command_fastdl.sh new file mode 100644 index 0000000000..78abd650a1 --- /dev/null +++ b/lgsm/functions/command_fastdl.sh @@ -0,0 +1,442 @@ +#!/bin/bash +# LinuxGSM command_fastdl.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Creates a FastDL directory. + +commandname="FASTDL" +commandaction="Fastdl" +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +fn_firstcommand_set + +check.sh + +# Directories. +if [ -z "${webdir}" ]; then + webdir="${rootdir}/public_html" +fi +fastdldir="${webdir}/fastdl" +addonsdir="${systemdir}/addons" +# Server lua autorun dir, used to autorun lua on client connect to the server. +luasvautorundir="${systemdir}/lua/autorun/server" +luafastdlfile="lgsm_cl_force_fastdl.lua" +luafastdlfullpath="${luasvautorundir}/${luafastdlfile}" + +# Check if bzip2 is installed. +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 +fi + +# Header +fn_print_header +echo -e "More info: https://docs.linuxgsm.com/commands/fastdl" +echo -e "" + +# Prompts user for FastDL creation settings. +echo -e "${commandaction} setup" +echo -e "=================================" + +# Prompt for clearing old files if directory was already here. +if [ -d "${fastdldir}" ]; then + fn_print_warning_nl "FastDL directory already exists." + echo -e "${fastdldir}" + echo -e "" + if fn_prompt_yn "Overwrite existing directory?" Y; then + fn_script_log_info "Overwrite existing directory: YES" + else + core_exit.sh + fi +fi + +# Garry's Mod Specific. +if [ "${shortname}" == "gmod" ]; then + # Prompt for download enforcer, which is using a .lua addfile resource generator. + if fn_prompt_yn "Force clients to download files?" Y; then + luaresource="on" + fn_script_log_info "Force clients to download files: YES" + else + luaresource="off" + fn_script_log_info "Force clients to download filesr: NO" + fi +fi + +# Clears any fastdl directory content. +fn_clear_old_fastdl() { + # Clearing old FastDL. + if [ -d "${fastdldir}" ]; then + echo -en "clearing existing FastDL directory ${fastdldir}..." + rm -rf "${fastdldir:?}" + exitcode=$? + if [ "${exitcode}" != 0 ]; then + fn_print_fail_eol_nl + fn_script_log_fatal "Clearing existing FastDL directory ${fastdldir}" + core_exit.sh + else + fn_print_ok_eol_nl + fn_script_log_pass "Clearing existing FastDL directory ${fastdldir}" + fi + fi +} + +fn_fastdl_dirs() { + # Check and create directories. + if [ ! -d "${webdir}" ]; then + echo -en "creating web directory ${webdir}..." + mkdir -p "${webdir}" + exitcode=$? + if [ "${exitcode}" != 0 ]; then + fn_print_fail_eol_nl + fn_script_log_fatal "Creating web directory ${webdir}" + core_exit.sh + else + fn_print_ok_eol_nl + fn_script_log_pass "Creating web directory ${webdir}" + fi + fi + if [ ! -d "${fastdldir}" ]; then + echo -en "creating fastdl directory ${fastdldir}..." + mkdir -p "${fastdldir}" + exitcode=$? + if [ "${exitcode}" != 0 ]; then + fn_print_fail_eol_nl + fn_script_log_fatal "Creating fastdl directory ${fastdldir}" + core_exit.sh + else + fn_print_ok_eol_nl + fn_script_log_pass "Creating fastdl directory ${fastdldir}" + fi + fi +} + +# Using this gist https://gist.github.com/agunnerson-ibm/efca449565a3e7356906 +fn_human_readable_file_size() { + local abbrevs=( + $((1 << 60)):ZB + $((1 << 50)):EB + $((1 << 40)):TB + $((1 << 30)):GB + $((1 << 20)):MB + $((1 << 10)):KB + $((1)):bytes + ) + + local bytes="${1}" + local precision="${2}" + + if [[ "${bytes}" == "1" ]]; then + echo -e "1 byte" + else + for item in "${abbrevs[@]}"; do + local factor="${item%:*}" + local abbrev="${item#*:}" + if [[ "${bytes}" -ge "${factor}" ]]; then + size=$(bc -l <<< "${bytes} / ${factor}") + printf "%.*f %s\n" "${precision}" "${size}" "${abbrev}" + break + fi + done + fi +} + +# Provides info about the fastdl directory content and prompts for confirmation. +fn_fastdl_preview() { + # Remove any file list. + if [ -f "${tmpdir}/fastdl_files_to_compress.txt" ]; then + rm -f "${tmpdir:?}/fastdl_files_to_compress.txt" + fi + echo -e "analysing required files" + fn_script_log_info "Analysing required files" + # 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") + for allowed_extention in "${allowed_extentions_array[@]}"; do + fileswc=0 + tput sc + while read -r ext; do + ((fileswc++)) + 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}") + if [ ${fileswc} != 0 ]; then + fn_print_ok_eol_nl + else + fn_print_info_eol_nl + fi + done + # Source engine + else + 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") + elif [ "${directory}" == "materials" ]; then + 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") + elif [ "${directory}" == "particles" ]; then + local allowed_extentions_array=("*.pcf") + elif [ "${directory}" == "sound" ]; then + 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 + 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 + echo -e "gathering ${directory} ${allowed_extention} : ${fileswc}..." + if [ ${fileswc} != 0 ]; then + fn_print_ok_eol_nl + else + fn_print_info_eol_nl + fi + done + fi + done + fi + 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") + # Calculates total file size. + while read -r dufile; do + filesize=$(stat -c %s "${dufile}") + 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" + else + fn_print_fail_eol_nl "generating file list" + fn_script_log_fatal "Generating file list." + core_exit.sh + fi + echo -e "about to compress ${totalfiles} files, total size $(fn_human_readable_file_size ${filesizetotal} 0)" + fn_script_log_info "${totalfiles} files, total size $(fn_human_readable_file_size ${filesizetotal} 0)" + rm -f "${tmpdir:?}/fastdl_files_to_compress.txt" + if ! fn_prompt_yn "Continue?" Y; then + fn_script_log "User exited" + core_exit.sh + fi +} + +# Builds Garry's Mod fastdl directory content. +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 + echo -e "copying ${allowed_extention} : ${fileswc}..." + cp --parents "${fastdlfile}" "${fastdldir}" + exitcode=$? + if [ "${exitcode}" != 0 ]; then + fn_print_fail_eol_nl + fn_script_log_fatal "Copying ${fastdlfile} > ${fastdldir}" + core_exit.sh + else + fn_script_log_pass "Copying ${fastdlfile} > ${fastdldir}" + fi + done < <(find . -type f -iname "${allowed_extention}") + if [ ${fileswc} != 0 ]; then + fn_print_ok_eol_nl + fi + done + # Correct addons directory structure for FastDL. + if [ -d "${fastdldir}/addons" ]; then + echo -en "updating addons file structure..." + cp -Rf "${fastdldir}"/addons/*/* "${fastdldir}" + exitcode=$? + if [ "${exitcode}" != 0 ]; then + fn_print_fail_eol_nl + fn_script_log_fatal "Updating addons file structure" + core_exit.sh + else + fn_print_ok_eol_nl + fn_script_log_pass "Updating addons file structure" + fi + # Clear addons directory in fastdl. + echo -en "clearing addons dir from fastdl dir..." + fn_sleep_time + rm -rf "${fastdldir:?}/addons" + exitcode=$? + if [ "${exitcode}" != 0 ]; then + fn_print_fail_eol_nl + fn_script_log_fatal "Clearing addons dir from fastdl dir" + core_exit.sh + else + fn_print_ok_eol_nl + fn_script_log_pass "Clearing addons dir from fastdl dir" + fi + fi + # Correct content that may be into a lua directory by mistake like some darkrpmodification addons. + if [ -d "${fastdldir}/lua" ]; then + echo -en "correcting DarkRP files..." + fn_sleep_time + cp -Rf "${fastdldir}/lua/"* "${fastdldir}" + exitcode=$? + if [ "${exitcode}" != 0 ]; then + fn_print_fail_eol_nl + fn_script_log_fatal "Correcting DarkRP files" + core_exit.sh + else + fn_print_ok_eol_nl + fn_script_log_pass "Correcting DarkRP files" + fi + fi + if [ -f "${tmpdir}/fastdl_files_to_compress.txt" ]; then + 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" + fi +} + +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") + elif [ "${directory}" == "materials" ]; then + local allowed_extentions_array=("*.vtf" "*.vmt" "*.vbf" "*.png" "*.svg") + elif [ "${directory}" == "models" ]; then + local allowed_extentions_array=("*.vtx" "*.vvd" "*.mdl" "*.phy" "*.jpg" "*.png") + elif [ "${directory}" == "particles" ]; then + local allowed_extentions_array=("*.pcf") + elif [ "${directory}" == "sound" ]; then + 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 + echo -e "copying ${directory} ${allowed_extention} : ${fileswc}..." + fn_sleep_time + # get relative path of file in the dir + tmprelfilepath="${fastdlfile#"${systemdir}/"}" + copytodir="${tmprelfilepath%/*}" + # create relative path for fastdl + if [ ! -d "${fastdldir}/${copytodir}" ]; then + mkdir -p "${fastdldir}/${copytodir}" + fi + cp "${fastdlfile}" "${fastdldir}/${copytodir}" + exitcode=$? + if [ "${exitcode}" != 0 ]; then + fn_print_fail_eol_nl + fn_script_log_fatal "Copying ${fastdlfile} > ${fastdldir}/${copytodir}" + core_exit.sh + else + fn_script_log_pass "Copying ${fastdlfile} > ${fastdldir}/${copytodir}" + fi + done < <(find "${systemdir}/${directory}" -type f -iname "${allowed_extention}") + if [ ${fileswc} != 0 ]; then + fn_print_ok_eol_nl + fi + done + fi + done +} + +# Builds the fastdl directory content. +fn_fastdl_build() { + # Copy all needed files for FastDL. + echo -e "copying files to ${fastdldir}" + fn_script_log_info "Copying files to ${fastdldir}" + if [ "${shortname}" == "gmod" ]; then + fn_fastdl_gmod + fn_fastdl_gmod_dl_enforcer + else + fn_fastdl_source + fi +} + +# Generate lua file that will force download any file into the FastDL directory. +fn_fastdl_gmod_dl_enforcer() { + # Clear old lua file. + if [ -f "${luafastdlfullpath}" ]; then + echo -en "removing existing download enforcer: ${luafastdlfile}..." + rm -f "${luafastdlfullpath:?}" + exitcode=$? + if [ "${exitcode}" != 0 ]; then + fn_print_fail_eol_nl + fn_script_log_fatal "Removing existing download enforcer ${luafastdlfullpath}" + core_exit.sh + else + fn_print_ok_eol_nl + fn_script_log_pass "Removing existing download enforcer ${luafastdlfullpath}" + fi + fi + # Generate new one if user said yes. + if [ "${luaresource}" == "on" ]; then + echo -en "creating new download enforcer: ${luafastdlfile}..." + 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}" + done < <(find "${fastdldir:?}" \( -type f ! -name "*.bz2" \) -printf '%P\n') + exitcode=$? + if [ "${exitcode}" != 0 ]; then + fn_print_fail_eol_nl + fn_script_log_fatal "Creating new download enforcer ${luafastdlfullpath}" + core_exit.sh + else + fn_print_ok_eol_nl + fn_script_log_pass "Creating new download enforcer ${luafastdlfullpath}" + fi + fi +} + +# Compresses FastDL files using bzip2. +fn_fastdl_bzip2() { + while read -r filetocompress; do + echo -en "\r\033[Kcompressing ${filetocompress}..." + bzip2 -f "${filetocompress}" + exitcode=$? + if [ "${exitcode}" != 0 ]; then + fn_print_fail_eol_nl + fn_script_log_fatal "Compressing ${filetocompress}" + core_exit.sh + else + fn_script_log_pass "Compressing ${filetocompress}" + fi + done < <(find "${fastdldir:?}" \( -type f ! -name "*.bz2" \)) + fn_print_ok_eol_nl +} + +# Run functions. +fn_fastdl_preview +fn_clear_old_fastdl +fn_fastdl_dirs +fn_fastdl_build +fn_fastdl_bzip2 +# Finished message. +echo -e "FastDL files are located in:" +echo -e "${fastdldir}" +echo -e "FastDL completed" +fn_script_log_info "FastDL completed" + +core_exit.sh diff --git a/lgsm/functions/command_install.sh b/lgsm/functions/command_install.sh new file mode 100644 index 0000000000..19dc59c7ee --- /dev/null +++ b/lgsm/functions/command_install.sh @@ -0,0 +1,52 @@ +#!/bin/bash +# LinuxGSM command_install.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Overall function for the installer. + +commandname="INSTALL" +commandaction="Installing" +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +fn_firstcommand_set + +check.sh +if [ "$(whoami)" == "root" ] && [ ! -f /.dockerenv ]; then + check_deps.sh +else + install_header.sh + install_server_dir.sh + install_logs.sh + check_deps.sh + installflag=1 + # Download and install. + if [ "${shortname}" == "ut2k4" ]; then + install_server_files.sh + install_ut2k4_key.sh + elif [ -z "${appid}" ]; then + install_server_files.sh + elif [ "${appid}" ]; then + install_steamcmd.sh + install_server_files.sh + fi + + # Configuration. + install_config.sh + if [ -v gslt ]; then + install_gslt.sh + elif [ "${shortname}" == "dst" ]; then + install_dst_token.sh + elif [ "${shortname}" == "squad" ]; then + install_squad_license.sh + elif [ "${shortname}" == "ts3" ]; then + install_ts3db.sh + elif [ "${shortname}" == "mta" ]; then + command_install_resources_mta.sh + fn_firstcommand_reset + fi + + fix.sh + install_stats.sh + install_complete.sh +fi +core_exit.sh diff --git a/lgsm/functions/command_install_resources_mta.sh b/lgsm/functions/command_install_resources_mta.sh new file mode 100644 index 0000000000..daf0395511 --- /dev/null +++ b/lgsm/functions/command_install_resources_mta.sh @@ -0,0 +1,32 @@ +#!/bin/bash +# LinuxGSM command_install_resources_mta.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Installs the default resources for Multi Theft Auto. + +commandname="DEFAULT-RESOURCES" +commandaction="Default Resources" +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +fn_firstcommand_set + +fn_install_resources() { + echo -e "" + 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}" + echo -e "Default Resources Installed." +} + +fn_print_header + +if [ -z "${autoinstall}" ]; then + fn_print_warning_nl "Installing the default resources with existing resources may cause issues." + if fn_prompt_yn "Do you want to install MTA default resources?" Y; then + fn_install_resources + fi +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 diff --git a/lgsm/functions/command_mods_install.sh b/lgsm/functions/command_mods_install.sh new file mode 100644 index 0000000000..0edbe5bc04 --- /dev/null +++ b/lgsm/functions/command_mods_install.sh @@ -0,0 +1,135 @@ +#!/bin/bash +# LinuxGSM command_mods_install.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: List and installs available mods along with mods_list.sh and mods_core.sh. + +commandname="MODS-INSTALL" +commandaction="Installing mods" +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +fn_firstcommand_set + +check.sh +mods_core.sh + +fn_print_header + +# Displays a list of installed mods. +fn_mods_installed_list +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 + # Current mod is the "llindex" value of the array we're going through. + currentmod="${installedmodslist[llindex]}" + fn_mod_get_info + # Display mod info to the user. + echo -e " * ${green}${modcommand}${default}${default}" + done + echo -e "" +fi + +echo -e "Available addons/mods" +echo -e "=================================" +# Display available mods from mods_list.sh. +# Set and reset vars +compatiblemodslistindex=0 +# As long as we're within index values. +while [ "${compatiblemodslistindex}" -lt "${#compatiblemodslist[@]}" ]; do + # Set values for convenience. + displayedmodname="${compatiblemodslist[compatiblemodslistindex]}" + 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}" + # Increment index from the amount of values we just displayed. + let "compatiblemodslistindex+=4" + ((totalmodsavailable++)) +done + +# If no mods are available for a specific game. +if [ -z "${compatiblemodslist}" ]; then + fn_print_fail_nl "No mods are currently available for ${gamename}." + fn_script_log_info "No mods are currently available for ${gamename}." + core_exit.sh +fi +fn_script_log_info "${totalmodsavailable} addons/mods are available for install" + +## User selects a mod. +echo -e "" +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 + # Supplementary output upon invalid user input. + elif [[ ! " ${availablemodscommands[@]} " =~ " ${usermodselect} " ]]; then + fn_print_error2_nl "${usermodselect} is not a valid addon/mod." + fi +done +# Get mod info. +currentmod="${usermodselect}" +fn_mod_get_info + +echo -e "" +echo -e "Installing ${modprettyname}" +echo -e "=================================" +fn_script_log_info "${modprettyname} selected for install" + +# Check if the mod is already installed and warn the user. +if [ -f "${modsinstalledlistfullpath}" ]; then + if [ "$(sed -n "/^${modcommand}$/p" "${modsinstalledlistfullpath}")" ]; then + fn_print_warning_nl "${modprettyname} is already installed" + fn_script_log_warn "${modprettyname} is already installed" + echo -e " * Any configs may be overwritten." + if ! fn_prompt_yn "Continue?" Y; then + core_exit.sh + fi + fn_script_log_info "User selected to continue" + fi +fi + +## Installation. +# If amxmodx check if metamod exists first +if [ "${modcommand}" == "amxmodx" ]; then + fn_mod_exist "metamod" +fi + +if [ "${modcommand}" == "amxmodxcs" ] \ + || [ "${modcommand}" == "amxmodxdod" ] \ + || [ "${modcommand}" == "amxmodxtfc" ] \ + || [ "${modcommand}" == "amxmodxns" ] \ + || [ "${modcommand}" == "amxmodxts" ]; then + fn_mod_exist "amxmodx" +fi + +fn_create_mods_dir +fn_mods_clear_tmp_dir +fn_mods_create_tmp_dir +fn_mod_install_files +fn_mod_lowercase +fn_mod_create_filelist +fn_mod_copy_destination +fn_mod_add_list +fn_mod_tidy_files_list +fn_mods_clear_tmp_dir + +# Create/modify existing liblist.gam file for Metamod +if [ "${modcommand}" == "metamod" ]; then + fn_mod_install_liblist_gam_file +fi + +# Create/modify plugins.ini file for Metamod +if [ "${modcommand}" == "amxmodx" ]; then + fn_mod_install_amxmodx_file +fi + +echo -e "${modprettyname} installed" +fn_script_log_pass "${modprettyname} installed." + +core_exit.sh diff --git a/lgsm/functions/command_mods_remove.sh b/lgsm/functions/command_mods_remove.sh new file mode 100644 index 0000000000..7127dcb3ca --- /dev/null +++ b/lgsm/functions/command_mods_remove.sh @@ -0,0 +1,153 @@ +#!/bin/bash +# LinuxGSM command_mods_uninstall.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Uninstall mods along with mods_list.sh and mods_core.sh. + +commandname="MODS-REMOVE" +commandaction="Removing mods" +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +fn_firstcommand_set + +check.sh +mods_core.sh +fn_mods_check_installed + +fn_print_header +echo -e "Remove addons/mods" +echo -e "=================================" + +# Displays list of installed mods. +# Generates list to display to user. +fn_mods_installed_list +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. + fn_mod_get_info + # Display mod info to the user. + echo -e "${red}${modcommand}${default} - ${modprettyname} - ${moddescription}" +done + +echo -e "" +# Keep prompting as long as the user input doesn't correspond to an available mod. +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 + core_exit.sh + # Supplementary output upon invalid user input. + elif [[ ! " ${availablemodscommands[@]} " =~ " ${usermodselect} " ]]; then + fn_print_error2_nl "${usermodselect} is not a valid addon/mod." + fi +done + +fn_print_warning_nl "You are about to remove ${cyan}${usermodselect}${default}." +echo -e " * Any custom files/configuration will be removed." +if ! fn_prompt_yn "Continue?" Y; then + core_exit.sh +fi + +currentmod="${usermodselect}" +fn_mod_get_info +fn_check_mod_files_list + +# Uninstall the mod. +fn_script_log_info "Removing ${modsfilelistsize} files from ${modprettyname}" +echo -e "removing ${modprettyname}" +echo -e "* ${modsfilelistsize} files to be removed" +echo -e "* location: ${modinstalldir}" +fn_sleep_time +# Go through every file and remove it. +modfileline="1" +tput sc +while [ "${modfileline}" -le "${modsfilelistsize}" ]; do + # Current line defines current file to remove. + 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 + rm -rf "${modinstalldir:?}/${currentfileremove:?}" + ((exitcode = $?)) + if [ "${exitcode}" != 0 ]; then + fn_script_log_fatal "Removing ${modinstalldir}/${currentfileremove}" + break + else + fn_script_log_pass "Removing ${modinstalldir}/${currentfileremove}" + fi + fi + tput rc + tput el + echo -e "removing ${modprettyname} ${modfileline} / ${modsfilelistsize} : ${currentfileremove}..." + ((modfileline++)) +done + +# Added logic not to fail since removing game specific mods (amxmodxcs) removes files that will +# not be found when removing the base (amxmodx) mod +if [ "${modcommand}" != "amxmodx" ]; then + if [ "${exitcode}" != 0 ]; then + fn_print_fail_eol_nl + core_exit.sh + else + fn_print_ok_eol_nl + fi +else + fn_print_ok_eol_nl +fi + +# Remove file list. +echo -en "removing ${modcommand}-files.txt..." +fn_sleep_time +rm -rf "${modsdir:?}/${modcommand}-files.txt" +exitcode=$? +if [ "${exitcode}" != 0 ]; then + fn_script_log_fatal "Removing ${modsdir}/${modcommand}-files.txt" + fn_print_fail_eol_nl + core_exit.sh +else + fn_script_log_pass "Removing ${modsdir}/${modcommand}-files.txt" + fn_print_ok_eol_nl +fi + +# Remove mods from installed mods list. +echo -en "removing ${modcommand} from ${modsinstalledlist}..." +fn_sleep_time + +sed -i "/^${modcommand}$/d" "${modsinstalledlistfullpath}" +exitcode=$? +if [ "${exitcode}" != 0 ]; then + fn_script_log_fatal "Removing ${modcommand} from ${modsinstalledlist}" + fn_print_fail_eol_nl + core_exit.sh +else + fn_script_log_pass "Removing ${modcommand} from ${modsinstalledlist}" + fn_print_ok_eol_nl +fi + +# Oxide fix +# Oxide replaces server files, so a validate is required after uninstall. +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" + command_validate.sh + fn_firstcommand_reset + unset exitbypass +fi + +# Remove/modify existing liblist.gam file for Metamod +if [ "${modcommand}" == "metamod" ]; then + fn_mod_remove_liblist_gam_file +fi + +# Remove/modify plugins.ini file for AMX Mod X +if [ "${modcommand}" == "amxmodx" ]; then + fn_mod_remove_amxmodx_file +fi + +echo -e "${modprettyname} removed" +fn_script_log "${modprettyname} removed" + +core_exit.sh diff --git a/lgsm/functions/command_mods_update.sh b/lgsm/functions/command_mods_update.sh new file mode 100644 index 0000000000..80b23fea9c --- /dev/null +++ b/lgsm/functions/command_mods_update.sh @@ -0,0 +1,109 @@ +#!/bin/bash +# LinuxGSM command_mods_update.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Updates installed mods along with mods_list.sh and mods_core.sh. + +commandname="MODS-UPDATE" +commandaction="Updating mods" +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +fn_firstcommand_set + +check.sh +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 + 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 + # Put the current file we are looking for into a variable. + 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 "${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" + fi + echo -e "${filetopreserve}" >> "${modsdir}/.removedfiles.tmp" + fi + done + fi +} + +fn_print_dots "Update addons/mods" +fn_mods_check_installed +fn_print_info_nl "Update addons/mods: ${installedmodscount} addons/mods will be updated" +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 + # Current mod is the "ulindex" value of the array we're going through. + currentmod="${installedmodslist[ulindex]}" + fn_mod_get_info + # Display installed mods and the update policy. + if [ -z "${modkeepfiles}" ]; then + # If modkeepfiles is not set for some reason, that's a problem. + fn_script_log_error "Could not find update policy for ${modprettyname}" + fn_print_error_nl "Could not find update policy for ${modprettyname}" + exitcode="1" + core_exit.sh + # If the mod won't get updated. + elif [ "${modkeepfiles}" == "NOUPDATE" ]; then + echo -e " * ${red}{modprettyname}${default} (won't be updated)" + # If the mode is just overwritten. + elif [ "${modkeepfiles}" == "OVERWRITE" ]; then + echo -e " * ${modprettyname} (overwrite)" + else + echo -e " * ${yellow}${modprettyname}${default} (retain common custom files)" + fi +done + +## Update +# List all installed mods and apply update. +# Reset line value. +installedmodsline="1" +while [ "${installedmodsline}" -le "${installedmodscount}" ]; do + currentmod=$(sed "${installedmodsline}q;d" "${modsinstalledlistfullpath}") + if [ "${currentmod}" ]; then + fn_mod_get_info + # Don not update mod if the policy is set to "NOUPDATE". + if [ "${modkeepfiles}" == "NOUPDATE" ]; then + fn_print_info "${modprettyname} will not be updated to preserve custom files" + fn_script_log_info "${modprettyname} will not be updated to preserve custom files" + else + echo -e "" + echo -e "==> Updating ${modprettyname}" + fn_create_mods_dir + fn_mods_clear_tmp_dir + fn_mods_create_tmp_dir + fn_mod_install_files + fn_mod_lowercase + fn_remove_cfg_files + fn_mod_create_filelist + fn_mod_copy_destination + fn_mod_add_list + fn_mod_tidy_files_list + fn_mods_clear_tmp_dir + fi + ((installedmodsline++)) + else + fn_print_fail "No mod was selected" + fn_script_log_fatal "No mod was selected" + exitcode="1" + core_exit.sh + fi +done +echo -e "" +fn_print_ok_nl "Mods update complete" +fn_script_log_info "Mods update complete" + +core_exit.sh diff --git a/lgsm/functions/command_monitor.sh b/lgsm/functions/command_monitor.sh new file mode 100644 index 0000000000..20c830e0b8 --- /dev/null +++ b/lgsm/functions/command_monitor.sh @@ -0,0 +1,245 @@ +#!/bin/bash +# LinuxGSM command_monitor.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Monitors server by checking for running processes +# then passes to gamedig and gsquery. + +commandname="MONITOR" +commandaction="Monitoring" +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +fn_firstcommand_set + +fn_monitor_check_lockfile() { + # Monitor does not run it lockfile is not found. + if [ ! -f "${lockdir}/${selfname}.lock" ]; then + fn_print_dots "Checking lockfile: " + fn_print_checking_eol + fn_script_log_info "Checking lockfile: CHECKING" + fn_print_error "Checking lockfile: No lockfile found: " + fn_print_error_eol_nl + fn_script_log_error "Checking lockfile: No lockfile found: ERROR" + echo -e "* Start ${selfname} to run monitor." + core_exit.sh + 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 + date '+%s' > "${lockdir}/${selfname}.lock" + echo "${version}" >> "${lockdir}/${selfname}.lock" + echo "${port}" >> "${lockdir}/${selfname}.lock" + fi +} + +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: " + fn_print_checking_eol + fn_script_log_info "Checking active updates: CHECKING" + fn_print_error_nl "Checking active updates: SteamCMD is currently checking for updates: " + fn_print_error_eol + fn_script_log_error "Checking active updates: SteamCMD is currently checking for updates: ERROR" + core_exit.sh + fi +} + +fn_monitor_check_session() { + fn_print_dots "Checking session: " + fn_print_checking_eol + fn_script_log_info "Checking session: CHECKING" + # uses status var from check_status.sh + if [ "${status}" != "0" ]; then + fn_print_ok "Checking session: " + fn_print_ok_eol_nl + fn_script_log_pass "Checking session: OK" + else + fn_print_error "Checking session: " + fn_print_fail_eol_nl + fn_script_log_fatal "Checking session: FAIL" + alert="restart" + alert.sh + fn_script_log_info "Checking session: Monitor is restarting ${selfname}" + command_restart.sh + core_exit.sh + fi +} + +fn_monitor_check_queryport() { + # Monitor will check queryport is set before continuing. + 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 + 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 + fn_print_error "Checking port: Unable to query, queryport is not set" + fn_script_log_error "Checking port: Unable to query, queryport is not set" + fi + core_exit.sh + fi +} + +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 + "${functionsdir}"/query_gsquery.py -a "${queryip}" -p "${queryport}" -e "${querytype}" > /dev/null 2>&1 + querystatus="$?" +} + +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 + + 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 + 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. + 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 + 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}" + sleep 0.5 + totalseconds=$((totalseconds + 1)) + if [ "${seconds}" == "15" ]; then + break + fi + done + done +} + +fn_monitor_loop() { + # loop though query methods selected by querymode. + totalseconds=0 + if [ "${querymode}" == "2" ]; then + local query_methods_array=(gamedig gsquery) + elif [ "${querymode}" == "3" ]; then + local query_methods_array=(gamedig) + elif [ "${querymode}" == "4" ]; then + local query_methods_array=(gsquery) + elif [ "${querymode}" == "5" ]; then + 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 [ -z "${monitorpass}" ]; then + fn_monitor_query + fi + else + fn_script_log_info "gamedig is not installed" + fn_script_log_info "https://docs.linuxgsm.com/requirements/gamedig" + fi + else + # will not query if query already passed. + if [ -z "${monitorpass}" ]; then + fn_monitor_query + fi + fi + done +} + +monitorflag=1 +check.sh +core_logs.sh +info_game.sh + +# query pre-checks +fn_monitor_check_lockfile +fn_monitor_check_update +fn_monitor_check_session +# Monitor will not continue if session only check. +if [ "${querymode}" != "1" ]; then + fn_monitor_check_queryport + + # Add a querydelay of 1 min if var missing. + if [ -z "${querydelay}" ]; then + querydelay="1" + fi + + fn_monitor_loop +fi +core_exit.sh diff --git a/lgsm/functions/command_postdetails.sh b/lgsm/functions/command_postdetails.sh new file mode 100644 index 0000000000..dad44d9afb --- /dev/null +++ b/lgsm/functions/command_postdetails.sh @@ -0,0 +1,78 @@ +#!/bin/bash +# LinuxGSM command_postdetails.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Strips sensitive information out of Details output. + +commandname="POST-DETAILS" +commandaction="Posting details" +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +fn_firstcommand_set + +posttarget="https://termbin.com" + +# source all of the functions defined in the details command. +info_messages.sh + +fn_bad_postdetailslog() { + fn_print_fail_nl "Unable to create temporary file ${postdetailslog}." + core_exit.sh +} + +# Remove any existing postdetails.log file. +if [ -f "${postdetailslog}" ]; then + rm -f "${postdetailslog:?}" +fi + +# Rather than a one-pass sed parser, default to using a temporary directory. +if [ "${exitbypass}" ]; then + postdetailslog="${alertlog}" +else + # Run checks and gathers details to display. + check.sh + info_game.sh + info_distro.sh + info_messages.sh + for queryip in "${queryips[@]}"; do + query_gamedig.sh + if [ "${querystatus}" == "0" ]; then + break + fi + done + touch "${postdetailslog}" || fn_bad_postdetailslog + { + fn_info_message_distro + fn_info_message_server_resource + fn_info_message_gameserver_resource + fn_info_message_gameserver + 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 + fn_info_message_commandlineparms + fi + fn_info_message_ports_edit + fn_info_message_ports + fn_info_message_select_engine + fn_info_message_statusbottom + } | sed -r "s/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]//g" | tee -a "${postdetailslog}" > /dev/null 2>&1 +fi + +fn_print_dots "termbin.com" +link=$(cat "${postdetailslog}" | nc termbin.com 9999 | tr -d '\n\0') +fn_print_ok_nl "termbin.com for 30D" +fn_script_log_pass "termbin.com for 30D" +pdurl="${link}" + +if [ "${firstcommandname}" == "POST-DETAILS" ]; then + echo -e "" + echo -e "Please share the following url for support: " + echo -e "${pdurl}" +fi +fn_script_log_info "${pdurl}" +alerturl="${pdurl}" + +if [ -z "${exitbypass}" ]; then + core_exit.sh +fi diff --git a/lgsm/functions/command_restart.sh b/lgsm/functions/command_restart.sh new file mode 100644 index 0000000000..3bf60c32cd --- /dev/null +++ b/lgsm/functions/command_restart.sh @@ -0,0 +1,18 @@ +#!/bin/bash +# LinuxGSM command_restart.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Restarts the server. + +commandname="MODS-INSTALL" +commandaction="Restarting" +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +fn_firstcommand_set + +info_game.sh +exitbypass=1 +command_stop.sh +command_start.sh +fn_firstcommand_reset +core_exit.sh diff --git a/lgsm/functions/command_send.sh b/lgsm/functions/command_send.sh new file mode 100644 index 0000000000..c143276f62 --- /dev/null +++ b/lgsm/functions/command_send.sh @@ -0,0 +1,41 @@ +#!/bin/bash +# LinuxGSM command_send.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Send command to the server tmux console. + +commandname="SEND" +commandaction="Send" +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +fn_firstcommand_set + +check.sh +if [ -z "${userinput2}" ]; then + fn_print_header + fn_print_information_nl "Send a command to the console." +fi + +check_status.sh +if [ "${status}" != "0" ]; then + if [ -n "${userinput2}" ]; then + commandtosend="${userinput2}" + else + echo "" + commandtosend=$(fn_prompt_message "send: ") + fi + echo "" + fn_print_dots "Sending command to console: \"${commandtosend}\"" + tmux send-keys -t "${servicename}" "${commandtosend}" ENTER + fn_print_ok_nl "Sending command to console: \"${commandtosend}\"" + fn_script_log_pass "Command \"${commandtosend}\" sent to console" +else + fn_print_error_nl "Server not running" + fn_script_log_error "Failed to access: Server not running" + if fn_prompt_yn "Do you want to start the server?" Y; then + exitbypass=1 + command_start.sh + fi +fi + +core_exit.sh diff --git a/lgsm/functions/command_skeleton.sh b/lgsm/functions/command_skeleton.sh new file mode 100644 index 0000000000..53c4ddec52 --- /dev/null +++ b/lgsm/functions/command_skeleton.sh @@ -0,0 +1,23 @@ +#!/bin/bash +# LinuxGSM command_skeleton.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Creates an copy of a game servers directorys. + +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +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 +exitcode=$? +if [ "${exitcode}" != 0 ]; then + fn_print_fail_nl "Creating skeleton directory" + fn_script_log_fatal "Creating skeleton directory" +else + fn_print_ok_nl "Creating skeleton directory: ./skel" + fn_script_log_pass "Creating skeleton directory: ./skel" +fi +core_exit.sh diff --git a/lgsm/functions/command_start.sh b/lgsm/functions/command_start.sh new file mode 100644 index 0000000000..04c6b4e645 --- /dev/null +++ b/lgsm/functions/command_start.sh @@ -0,0 +1,224 @@ +#!/bin/bash +# LinuxGSM command_start.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Starts the server. + +commandname="START" +commandaction="Starting" +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +addtimestamp="gawk '{ print strftime(\\\"[$logtimestampformat]\\\"), \\\$0 }'" +fn_firstcommand_set + +fn_start_teamspeak3() { + if [ ! -f "${servercfgfullpath}" ]; then + fn_print_warn_nl "${servercfgfullpath} is missing" + fn_script_log_warn "${servercfgfullpath} is missing" + echo " * Creating blank ${servercfg}" + fn_script_log_info "Creating blank ${servercfg}" + fn_sleep_time + echo " * ${servercfg} can remain blank by default." + fn_script_log_info "${servercfgfullpath} can remain blank by default." + fn_sleep_time + echo " * ${servercfg} is located in ${servercfgfullpath}." + fn_script_log_info "${servercfg} is located in ${servercfgfullpath}." + sleep 5 + touch "${servercfgfullpath}" + fi + # Accept license. + if [ ! -f "${executabledir}/.ts3server_license_accepted" ]; then + install_eula.sh + fi + fn_start_tmux +} + +# This will allow the Jedi Knight 2 version to be printed in console on start. +# Used to allow update to detect JK2MV server version. +fn_start_jk2() { + fn_start_tmux + tmux send -t "${sessionname}" version ENTER > /dev/null 2>&1 +} + +fn_start_tmux() { + if [ "${parmsbypass}" ]; then + startparameters="" + fi + # check for tmux size variables. + if [[ "${servercfgtmuxwidth}" =~ ^[0-9]+$ ]]; then + sessionwidth="${servercfgtmuxwidth}" + else + sessionwidth="80" + fi + if [[ "${servercfgtmuxheight}" =~ ^[0-9]+$ ]]; then + sessionheight="${servercfgtmuxheight}" + else + sessionheight="23" + fi + + # Log rotation. + fn_script_log_info "Rotating log files" + if [ "${engine}" == "unreal2" ] && [ -f "${gamelog}" ]; then + mv "${gamelog}" "${gamelogdate}" + fi + if [ -f "${lgsmlog}" ]; then + mv "${lgsmlog}" "${lgsmlogdate}" + fi + if [ -f "${consolelog}" ]; then + mv "${consolelog}" "${consolelogdate}" + fi + + # Create lockfile + date '+%s' > "${lockdir}/${selfname}.lock" + echo "${version}" >> "${lockdir}/${selfname}.lock" + echo "${port}" >> "${lockdir}/${selfname}.lock" + fn_reload_startparameters + + if [ "${shortname}" == "av" ]; then + cd "${systemdir}" || exit + else + cd "${executabledir}" || exit + fi + + tmux new-session -d -x "${sessionwidth}" -y "${sessionheight}" -s "${sessionname}" "${preexecutable} ${executable} ${startparameters}" 2> "${lgsmlogdir}/.${selfname}-tmux-error.tmp" + + # Create logfile. + touch "${consolelog}" + + # Create last start lock file + date +%s > "${lockdir}/${selfname}-laststart.lock" + + # tmux compiled from source will return "master", therefore ignore it. + 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 [ "$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 + echo -e "Console logging disabled: tmux => 1.6 required + https://linuxgsm.com/tmux-upgrade + Currently installed: $(tmux -V)" > "${consolelog}" + + # Console logging disabled: Bug in tmux 1.8 breaks logging. + elif [ "${tmuxvdigit}" -eq "18" ]; then + echo -e "Console logging disabled: Bug in tmux 1.8 breaks logging + https://linuxgsm.com/tmux-upgrade + Currently installed: $(tmux -V)" > "${consolelog}" + # Console logging enable or not set. + elif [ "${consolelogging}" == "on" ] || [ -z "${consolelogging}" ]; then + 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}" + fn_script_log_warn "Unable to detect tmux version" + fi + + # Console logging disabled. + if [ "${consolelogging}" == "off" ]; then + echo -e "Console logging disabled by user" >> "${consolelog}" + fn_script_log_info "Console logging disabled by user" + fi + fn_sleep_time + + # If the server fails to start. + check_status.sh + if [ "${status}" == "0" ]; then + fn_print_fail_nl "Unable to start ${servername}" + fn_script_log_fatal "Unable to start ${servername}" + if [ -s "${lgsmlogdir}/.${selfname}-tmux-error.tmp" ]; then + fn_print_fail_nl "Unable to start ${servername}: tmux error:" + fn_script_log_fatal "Unable to start ${servername}: tmux error:" + echo -e "" + echo -e "Command" + echo -e "=================================" + echo -e "tmux new-session -d -s \"${sessionname}\" \"${preexecutable} ${executable} ${startparameters}\"" | tee -a "${lgsmlog}" + echo -e "" + echo -e "Error" + echo -e "=================================" + 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 + 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." + group=$(grep tty /etc/group) + echo -e "" + echo -e " ${group}" + fn_script_log_info "${group}" + echo -e "" + echo -e "Run the following command with root privileges." + echo -e "" + echo -e " usermod -G tty $(whoami)" + echo -e "" + echo -e "https://linuxgsm.com/tmux-op-perm" + fn_script_log_info "https://linuxgsm.com/tmux-op-perm" + else + echo -e "No known fix currently. Please log an issue." + fn_script_log_info "No known fix currently. Please log an issue." + echo -e "https://linuxgsm.com/support" + fn_script_log_info "https://linuxgsm.com/support" + fi + fi + fi + core_exit.sh + else + fn_print_ok "${servername}" + fn_script_log_pass "Started ${servername}" + fi + rm -f "${lgsmlogdir:?}/.${selfname}-tmux-error.tmp" 2> /dev/null + echo -en "\n" +} + +check.sh + +# Is the server already started. +# $status comes from check_status.sh, which is run by check.sh for this command +if [ "${status}" != "0" ]; then + fn_print_dots "${servername}" + fn_print_info_nl "${servername} is already running" + fn_script_log_error "${servername} is already running" + if [ -z "${exitbypass}" ]; then + core_exit.sh + fi +fi +if [ -z "${fixbypass}" ]; then + fix.sh +fi +info_game.sh +core_logs.sh + +# Will check for updates is updateonstart is yes. +if [ "${updateonstart}" == "yes" ] || [ "${updateonstart}" == "1" ] || [ "${updateonstart}" == "on" ]; then + exitbypass=1 + unset updateonstart + command_update.sh + fn_firstcommand_reset +fi + +fn_print_dots "${servername}" + +if [ "${shortname}" == "ts3" ]; then + fn_start_teamspeak3 +elif [ "${shortname}" == "jk2" ]; then + fn_start_jk2 +else + fn_start_tmux +fi + +core_exit.sh diff --git a/lgsm/functions/command_stop.sh b/lgsm/functions/command_stop.sh new file mode 100644 index 0000000000..d18ef7c23a --- /dev/null +++ b/lgsm/functions/command_stop.sh @@ -0,0 +1,283 @@ +#!/bin/bash +# LinuxGSM command_stop.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Stops the server. + +commandname="STOP" +commandaction="Stopping" +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +fn_firstcommand_set + +# Attempts graceful shutdown by sending 'CTRL+c'. +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 + # Waits up to 30 seconds giving the server time to shutdown gracefuly. + for seconds in {1..30}; do + check_status.sh + if [ "${status}" == "0" ]; then + fn_print_ok "Graceful: CTRL+c: ${seconds}: " + fn_print_ok_eol_nl + fn_script_log_pass "Graceful: CTRL+c: OK: ${seconds} seconds" + break + fi + sleep 1 + fn_print_dots "Graceful: CTRL+c: ${seconds}" + done + check_status.sh + if [ "${status}" != "0" ]; then + fn_print_error "Graceful: CTRL+c: " + fn_print_fail_eol_nl + fn_script_log_error "Graceful: CTRL+c: FAIL" + fi +} + +# 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_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 + check_status.sh + if [ "${status}" == "0" ]; then + fn_print_ok "Graceful: sending \"${1}\": ${seconds}: " + fn_print_ok_eol_nl + fn_script_log_pass "Graceful: sending \"${1}\": OK: ${seconds} seconds" + break + fi + sleep 1 + fn_print_dots "Graceful: sending \"${1}\": ${seconds}" + done + check_status.sh + if [ "${status}" != "0" ]; then + fn_print_error "Graceful: sending \"${1}\": " + fn_print_fail_eol_nl + fn_script_log_error "Graceful: sending \"${1}\": FAIL" + fi +} + +# 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_print_dots "Graceful: sending \"quit\"" + fn_script_log_info "Graceful: sending \"quit\"" + # sends quit + tmux send -t "${sessionname}" quit ENTER > /dev/null 2>&1 + # Waits 3 seconds as goldsrc servers restart with the quit command. + for seconds in {1..3}; do + sleep 1 + fn_print_dots "Graceful: sending \"quit\": ${seconds}" + done + fn_print_ok "Graceful: sending \"quit\": ${seconds}: " + fn_print_ok_eol_nl + fn_script_log_pass "Graceful: sending \"quit\": OK: ${seconds} seconds" +} + +# telnet command for sdtd graceful shutdown. +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 + } + spawn telnet '"${telnetip}"' '"${telnetport}"' + expect { + "session." { send "shutdown\r" } + default abort + } + expect { eof } + puts "Completed.\n" + ') + else + sdtd_telnet_shutdown=$(expect -c ' + proc abort {} { + puts "Timeout or EOF\n" + exit 1 + } + spawn telnet '"${telnetip}"' '"${telnetport}"' + expect { + "password:" { send "'"${telnetpass}"'\r" } + default abort + } + expect { + "session." { send "shutdown\r" } + default abort + } + expect { eof } + puts "Completed.\n" + ') + fi +} + +# Attempts graceful shutdown of 7 Days To Die using telnet. +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 + # 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}" + fn_script_log_info "Graceful: telnet: ${telnetip}:${telnetport}" + fn_stop_graceful_sdtd_telnet + completed=$(echo -en "\n ${sdtd_telnet_shutdown}" | grep "Completed.") + refused=$(echo -en "\n ${sdtd_telnet_shutdown}" | grep "Timeout or EOF") + if [ "${refused}" ]; then + fn_print_error "Graceful: telnet: ${telnetip}:${telnetport} : " + fn_print_fail_eol_nl + fn_script_log_error "Graceful: telnet: ${telnetip}:${telnetport} : FAIL" + elif [ "${completed}" ]; then + break + fi + done + + # If telnet shutdown was successful will use telnet again to check + # the connection has closed, confirming that the tmux session can now be killed. + if [ "${completed}" ]; then + for seconds in {1..30}; do + fn_stop_graceful_sdtd_telnet + refused=$(echo -en "\n ${sdtd_telnet_shutdown}" | grep "Timeout or EOF") + if [ "${refused}" ]; then + fn_print_ok "Graceful: telnet: ${telnetip}:${telnetport} : " + fn_print_ok_eol_nl + fn_script_log_pass "Graceful: telnet: ${telnetip}:${telnetport} : ${seconds} seconds" + break + fi + sleep 1 + fn_print_dots "Graceful: telnet: ${seconds}" + done + # If telnet shutdown fails tmux shutdown will be used, this risks loss of world save. + else + if [ "${refused}" ]; then + fn_print_error "Graceful: telnet: " + fn_print_fail_eol_nl + fn_script_log_error "Graceful: telnet: ${telnetip}:${telnetport} : FAIL" + else + fn_print_error_nl "Graceful: telnet: Unknown error" + fn_script_log_error "Graceful: telnet: Unknown error" + fi + echo -en "\n" | tee -a "${lgsmlog}" + echo -en "Telnet output:" | tee -a "${lgsmlog}" + echo -en "\n ${sdtd_telnet_shutdown}" | tee -a "${lgsmlog}" + echo -en "\n\n" | tee -a "${lgsmlog}" + fi + else + fn_print_warn "Graceful: telnet: expect not installed: " + fn_print_fail_eol_nl + fn_script_log_warn "Graceful: telnet: expect not installed: FAIL" + fi +} + +# Attempts graceful shutdown by sending /save /stop. +fn_stop_graceful_avorion() { + fn_print_dots "Graceful: /save /stop" + fn_script_log_info "Graceful: /save /stop" + # Sends /save. + tmux send-keys -t "${sessionname}" /save ENTER > /dev/null 2>&1 + sleep 5 + # Sends /quit. + tmux send-keys -t "${sessionname}" /stop ENTER > /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 + if [ "${status}" == "0" ]; then + fn_print_ok "Graceful: /save /stop: ${seconds}: " + fn_print_ok_eol_nl + fn_script_log_pass "Graceful: /save /stop: OK: ${seconds} seconds" + break + fi + sleep 1 + fn_print_dots "Graceful: /save /stop: ${seconds}" + done + check_status.sh + if [ "${status}" != "0" ]; then + fn_print_error "Graceful: /save /stop: " + fn_print_fail_eol_nl + fn_script_log_error "Graceful: /save /stop: FAIL" + fi +} + +fn_stop_graceful_select() { + if [ "${stopmode}" == "1" ]; then + fn_stop_tmux + elif [ "${stopmode}" == "2" ]; then + fn_stop_graceful_ctrlc + elif [ "${stopmode}" == "3" ]; then + fn_stop_graceful_cmd "quit" 30 + elif [ "${stopmode}" == "4" ]; then + fn_stop_graceful_cmd "quit" 120 + elif [ "${stopmode}" == "5" ]; then + fn_stop_graceful_cmd "stop" 30 + elif [ "${stopmode}" == "6" ]; then + fn_stop_graceful_cmd "q" 30 + elif [ "${stopmode}" == "7" ]; then + fn_stop_graceful_cmd "exit" 30 + elif [ "${stopmode}" == "8" ]; then + fn_stop_graceful_sdtd + elif [ "${stopmode}" == "9" ]; then + fn_stop_graceful_goldsrc + elif [ "${stopmode}" == "10" ]; then + 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 +} + +fn_stop_tmux() { + fn_print_dots "${servername}" + fn_script_log_info "tmux kill-session: ${sessionname}: ${servername}" + # Kill tmux session. + tmux kill-session -t "${sessionname}" > /dev/null 2>&1 + sleep 0.5 + check_status.sh + if [ "${status}" == "0" ]; then + fn_print_ok_nl "${servername}" + fn_script_log_pass "Stopped ${servername}" + else + fn_print_fail_nl "Unable to stop ${servername}" + fn_script_log_fatal "Unable to stop ${servername}" + fi +} + +# Checks if the server is already stopped. +fn_stop_pre_check() { + if [ "${status}" == "0" ]; then + fn_print_info_nl "${servername} is already stopped" + fn_script_log_error "${servername} is already stopped" + else + # Select graceful shutdown. + fn_stop_graceful_select + fi + # Check status again, a kill tmux session if graceful shutdown failed. + check_status.sh + if [ "${status}" != "0" ]; then + fn_stop_tmux + fi +} + +check.sh +fn_print_dots "${servername}" + +info_game.sh +fn_stop_pre_check +# Remove lockfile. +if [ -f "${lockdir}/${selfname}.lock" ]; then + rm -f "${lockdir:?}/${selfname}.lock" +fi + +if [ -z "${exitbypass}" ]; then + core_exit.sh +fi diff --git a/lgsm/functions/command_test_alert.sh b/lgsm/functions/command_test_alert.sh new file mode 100644 index 0000000000..7fe61e48a9 --- /dev/null +++ b/lgsm/functions/command_test_alert.sh @@ -0,0 +1,19 @@ +#!/bin/bash +# LinuxGSM command_test_alert.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Sends a test alert. + +commandname="TEST-ALERT" +commandaction="Sending Alert" +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +fn_firstcommand_set + +fn_print_dots "${servername}" +check.sh +info_game.sh +alert="test" +alert.sh + +core_exit.sh diff --git a/lgsm/functions/command_ts3_server_pass.sh b/lgsm/functions/command_ts3_server_pass.sh new file mode 100644 index 0000000000..be0816d15f --- /dev/null +++ b/lgsm/functions/command_ts3_server_pass.sh @@ -0,0 +1,57 @@ +#!/bin/bash +# LinuxGSM command_ts3_server_pass.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Changes TS3 serveradmin password. + +commandname="CHANGE-PASSWORD" +commandaction="Changing password" +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +fn_firstcommand_set + +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." + echo -e "" + if ! fn_prompt_yn "Continue?" Y; then + exitcode=0 + core_exit.sh + fi + fn_script_log_info "Initiating ${gamename} ServerAdmin password change" + read -rp "Enter new password: " newpassword + fn_print_info_nl "Changing password" + fn_script_log_info "Changing password" +} + +fn_serveradmin_password_set() { + # Start server in "new password mode". + ts3serverpass="1" + exitbypass="1" + command_start.sh + fn_firstcommand_reset + fn_print_ok_nl "New password applied" + fn_script_log_pass "New ServerAdmin password applied" +} + +# Running functions. +check.sh +fn_serveradmin_password_prompt +if [ "${status}" != "0" ]; then + # Stop any running server. + exitbypass="1" + command_stop.sh + fn_firstcommand_reset + fn_serveradmin_password_set + parms="serveradmin_password=\"${newpassword}\" inifile=\"${servercfgfullpath}\" > /dev/null 2>&1" + ts3serverpass="0" + command_restart.sh + fn_firstcommand_reset +else + fn_serveradmin_password_set + command_stop.sh + fn_firstcommand_reset +fi + +core_exit.sh diff --git a/lgsm/functions/command_update.sh b/lgsm/functions/command_update.sh new file mode 100644 index 0000000000..ae5c2065c6 --- /dev/null +++ b/lgsm/functions/command_update.sh @@ -0,0 +1,40 @@ +#!/bin/bash +# LinuxGSM command_update.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Handles updating of servers. + +commandname="UPDATE" +commandaction="Updating" +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +fn_firstcommand_set + +fn_print_dots "" +check.sh +core_logs.sh +check_last_update.sh + +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_validate.sh b/lgsm/functions/command_validate.sh new file mode 100644 index 0000000000..15257a3e28 --- /dev/null +++ b/lgsm/functions/command_validate.sh @@ -0,0 +1,49 @@ +#!/bin/bash +# LinuxGSM command_validate.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Runs a server validation. + +commandname="VALIDATE" +commandaction="Validating" +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +fn_firstcommand_set + +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 + for seconds in {3..1}; do + fn_print_warn "Validate might overwrite some customised files: ${totalseconds}" + totalseconds=$((totalseconds - 1)) + sleep 1 + if [ "${seconds}" == "0" ]; then + break + fi + done + fn_print_warn_nl "Validate might overwrite some customised files" + + fn_dl_steamcmd +} + +# The location where the builds are checked and downloaded. +remotelocation="SteamCMD" +check.sh + +fn_print_dots "${remotelocation}" + +if [ "${status}" != "0" ]; then + fn_print_restart_warning + exitbypass=1 + command_stop.sh + fn_firstcommand_reset + fn_validate + exitbypass=1 + command_start.sh + fn_firstcommand_reset +else + fn_validate +fi + +core_exit.sh diff --git a/lgsm/functions/command_wipe.sh b/lgsm/functions/command_wipe.sh new file mode 100644 index 0000000000..e1677e8276 --- /dev/null +++ b/lgsm/functions/command_wipe.sh @@ -0,0 +1,183 @@ +#!/bin/bash +# LinuxGSM command_backup.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Wipes server data, useful after updates for some games like Rust. + +commandname="WIPE" +commandaction="Wiping" +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +fn_firstcommand_set + +# Provides an exit code upon error. +fn_wipe_exit_code() { + exitcode=$? + if [ "${exitcode}" != 0 ]; then + fn_print_fail_eol_nl + core_exit.sh + else + fn_print_ok_eol_nl + fi +} + +# Removes files to wipe server. +fn_wipe_files() { + fn_print_start_nl "${wipetype}" + fn_script_log_info "${wipetype}" + + # Remove Map files + 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" -delete | tee -a "${lgsmlog}" + fn_wipe_exit_code + else + echo -e "no .map file(s) to remove" + fn_sleep_time + fn_script_log_pass "no .map file(s) to remove" + fi + fi + # Remove Save files. + 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*" -delete + fn_wipe_exit_code + else + echo -e "no .sav file(s) to remove" + fn_script_log_pass "no .sav file(s) to remove" + fn_sleep_time + fi + fi + # Remove db files for full wipe. + # Excluding player.tokens.db for Rust+. + if [ -n "${serverwipe}" ]; then + if [ -n "$(find "${serveridentitydir}" -type f ! -name 'player.tokens.db' -name "*.db")" ]; then + echo -en "removing .db file(s)..." + fn_script_log_info "removing .db file(s)" + fn_sleep_time + find "${serveridentitydir:?}" -type f ! -name 'player.tokens.db' -name "*.db" -printf "%f\n" >> "${lgsmlog}" + find "${serveridentitydir:?}" -type f ! -name 'player.tokens.db' -name "*.db" -delete + fn_wipe_exit_code + else + echo -e "no .db file(s) to remove" + fn_sleep_time + fn_script_log_pass "no .db file(s) to remove" + fi + fi +} + +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 + for seconds in {3..1}; do + fn_print_warn "Map wipe will reset the map data and keep blueprint data: ${totalseconds}" + totalseconds=$((totalseconds - 1)) + sleep 1 + if [ "${seconds}" == "0" ]; then + break + fi + done + fn_print_warn_nl "Map wipe will reset the map data and keep blueprint data" +} + +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 + for seconds in {3..1}; do + fn_print_warn "Server wipe will reset the map data and remove blueprint data: ${totalseconds}" + totalseconds=$((totalseconds - 1)) + sleep 1 + if [ "${seconds}" == "0" ]; then + break + fi + done + fn_print_warn_nl "Server wipe will reset the map data and remove blueprint data" +} + +# 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 + shuf -i 1-2147483647 -n 1 > "${datadir}/${selfname}-seed.txt" + 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_sleep_time + fn_print_ok_eol_nl + fi +} + +# A summary of what wipe is going to do. +fn_wipe_details() { + fn_print_information_nl "Wipe does not remove Rust+ data." + echo -en "* Wipe map data: " + if [ -n "${serverwipe}" ] || [ -n "${mapwipe}" ]; then + fn_print_yes_eol_nl + else + fn_print_no_eol_nl + fi + + echo -en "* Wipe blueprint data: " + if [ -n "${serverwipe}" ]; then + fn_print_yes_eol_nl + else + fn_print_no_eol_nl + fi + + echo -en "* Change Procedural Map seed: " + if [ -n "${randomseed}" ]; then + fn_print_yes_eol_nl + else + fn_print_no_eol_nl + fi +} + +fn_print_dots "" +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 "${serverwipe}" ]; then + wipetype="Full wipe" + fn_full_wipe_warning + fn_wipe_details + elif [ -n "${mapwipe}" ]; then + wipetype="Map wipe" + fn_map_wipe_warning + fn_wipe_details + fi + check_status.sh + if [ "${status}" != "0" ]; then + fn_print_restart_warning + exitbypass=1 + command_stop.sh + fn_firstcommand_reset + fn_wipe_files + fn_wipe_random_seed + fn_print_complete_nl "${wipetype}" + fn_script_log_pass "${wipetype}" + exitbypass=1 + command_start.sh + fn_firstcommand_reset + else + fn_wipe_files + fn_wipe_random_seed + fn_print_complete_nl "${wipetype}" + fn_script_log_pass "${wipetype}" + fi +else + fn_print_ok_nl "Wipe not required" + fn_script_log_pass "Wipe not required" +fi +core_exit.sh diff --git a/lgsm/functions/compress_unreal2_maps.sh b/lgsm/functions/compress_unreal2_maps.sh new file mode 100644 index 0000000000..0c32d3c77b --- /dev/null +++ b/lgsm/functions/compress_unreal2_maps.sh @@ -0,0 +1,35 @@ +#!/bin/bash +# LinuxGSM compress_unreal2_maps.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Compresses unreal maps. + +commandname="MAP-COMPRESSOR" +commandaction="Compressing maps" +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +fn_firstcommand_set + +check.sh +fn_print_header +echo -e "Will compress all maps in:" +echo -e "" +pwd +echo -e "" +echo -e "Compressed maps saved to:" +echo -e "" +echo -e "${compressedmapsdir}" +echo -e "" +if ! fn_prompt_yn "Start compression?" Y; then + exitcode=0 + core_exit.sh +fi +mkdir -pv "${compressedmapsdir}" > /dev/null 2>&1 +rm -rfv "${serverfiles:?}/Maps/"*.ut2.uz2 +cd "${systemdir}" || exit +for map in "${serverfiles}/Maps/"*; do + ./ucc-bin compress "${map}" --nohomedir +done +mv -fv "${serverfiles}/Maps/"*.ut2.uz2 "${compressedmapsdir}" + +core_exit.sh diff --git a/lgsm/functions/compress_ut99_maps.sh b/lgsm/functions/compress_ut99_maps.sh new file mode 100644 index 0000000000..9aa074ba9a --- /dev/null +++ b/lgsm/functions/compress_ut99_maps.sh @@ -0,0 +1,35 @@ +#!/bin/bash +# LinuxGSM compress_ut99_maps.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Compresses unreal maps. + +commandname="MAP-COMPRESSOR" +commandaction="Compressing maps" +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +fn_firstcommand_set + +check.sh +fn_print_header +echo -e "Will compress all maps in:" +echo -e "" +pwd +echo -e "" +echo -e "Compressed maps saved to:" +echo -e "" +echo -e "${compressedmapsdir}" +echo -e "" +if ! fn_prompt_yn "Start compression?" Y; then + exitcode=0 + core_exit.sh +fi +mkdir -pv "${compressedmapsdir}" > /dev/null 2>&1 +rm -rfv "${serverfiles:?}/Maps/"*.unr.uz +cd "${systemdir}" || exit +for map in "${serverfiles}/Maps/"*; do + ./ucc-bin compress "${map}" --nohomedir +done +mv -fv "${serverfiles}/Maps/"*.unr.uz "${compressedmapsdir}" + +core_exit.sh diff --git a/lgsm/functions/fix.sh b/lgsm/functions/fix.sh new file mode 100644 index 0000000000..57f6a91fac --- /dev/null +++ b/lgsm/functions/fix.sh @@ -0,0 +1,88 @@ +#!/bin/bash +# LinuxGSM fix.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Overall function for managing fixes. +# Runs functions that will fix an issue. + +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +# Messages that are displayed for some fixes. +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_print_dots "Applying ${fixname} fix: ${gamename}" + fn_print_info_nl "Applying ${fixname} fix: ${gamename}" + fn_script_log_info "Applying ${fixname} fix: ${gamename}" +} + +fn_fix_msg_end() { + if [ $? != 0 ]; then + fn_print_error_nl "Applying ${fixname} fix: ${gamename}" + fn_script_log_error "Applying ${fixname} fix: ${gamename}" + else + fn_print_ok_nl "Applying ${fixname} fix: ${gamename}" + fn_script_log_pass "Applying ${fixname} fix: ${gamename}" + 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 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 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 + fn_apply_fix "post install" "${shortname}" + fi +fi diff --git a/lgsm/functions/fix_ark.sh b/lgsm/functions/fix_ark.sh new file mode 100644 index 0000000000..f8e0447e3e --- /dev/null +++ b/lgsm/functions/fix_ark.sh @@ -0,0 +1,62 @@ +#!/bin/bash +# LinuxGSM fix_ark.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Resolves various issues with ARK: Survival Evolved. + +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +# removes mulitple appworkshop_346110.acf if found. +steamappsfilewc="$(find "${HOME}" -name appworkshop_346110.acf | wc -l)" +if [ "${steamappsfilewc}" -gt "1" ]; then + fixname="multiple appworkshop acf files" + fn_fix_msg_start + find "${HOME}" -name appworkshop_346110.acf -exec rm -f {} \; + fn_fix_msg_end +elif [ "${steamappsfilewc}" -eq "1" ]; then + # Steam mods directory selecter + # 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 + ) + + # removes the symlink if exists. + # fixes issue with older versions of LinuxGSM linking to /home/arkserver/steamcmd + if [ -L "${serverfiles}/Engine/Binaries/ThirdParty/SteamCMD/Linux" ]; then + fixname="broken SteamCMD symlink" + fn_fix_msg_start + unlink "${serverfiles:?}/Engine/Binaries/ThirdParty/SteamCMD/Linux" + fn_fix_msg_end + check_steamcmd.sh + fi + + # removed ARK steamcmd directory if steamcmd is missing. + if [ ! -f "${serverfiles}/Engine/Binaries/ThirdParty/SteamCMD/Linux/steamcmd.sh" ]; then + fixname="remove invalid ARK SteamCMD directory" + fn_fix_msg_start + rm -rf "${serverfiles:?}/Engine/Binaries/ThirdParty/SteamCMD/Linux" + fn_fix_msg_end + check_steamcmd.sh + 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 + fixname="incorrect steamapps symlink" + fn_fix_msg_start + unlink "${serverfiles:?}/Engine/Binaries/ThirdParty/SteamCMD/Linux/steamapps" + fn_fix_msg_end + fi + + # Put symlink to steamapps directory into the ARK SteamCMD directory to link the downloaded mods to the correct location. + if [ ! -L "${serverfiles}/Engine/Binaries/ThirdParty/SteamCMD/Linux/steamapps" ]; then + fixname="steamapps symlink" + fn_fix_msg_start + ln -s "${steamappspath}" "${serverfiles}/Engine/Binaries/ThirdParty/SteamCMD/Linux/steamapps" + fn_fix_msg_end + fi +fi diff --git a/lgsm/functions/fix_arma3.sh b/lgsm/functions/fix_arma3.sh new file mode 100644 index 0000000000..bbf14c9d20 --- /dev/null +++ b/lgsm/functions/fix_arma3.sh @@ -0,0 +1,16 @@ +#!/bin/bash +# LinuxGSM fix_arma3.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Resolves an issue with ARMA3. + +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 + fixname="20150 Segmentation fault (core dumped)" + fn_fix_msg_start + mkdir -p "${XDG_DATA_HOME:="${HOME}/.local/share"}/Arma 3 - Other Profiles" + fn_fix_msg_end +fi diff --git a/lgsm/functions/fix_armar.sh b/lgsm/functions/fix_armar.sh new file mode 100644 index 0000000000..9db42f51ad --- /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/fix_av.sh b/lgsm/functions/fix_av.sh new file mode 100644 index 0000000000..a61a8be658 --- /dev/null +++ b/lgsm/functions/fix_av.sh @@ -0,0 +1,19 @@ +#!/bin/bash +# LinuxGSM fix_av.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Resolves startup issue with Avorion + +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${serverfiles}:${serverfiles}/linux64" + +# 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 + cd "${systemdir}" || exit + eval "${executable} ${startparameters}" +fi diff --git a/lgsm/functions/fix_bo.sh b/lgsm/functions/fix_bo.sh new file mode 100644 index 0000000000..4536918748 --- /dev/null +++ b/lgsm/functions/fix_bo.sh @@ -0,0 +1,10 @@ +#!/bin/bash +# LinuxGSM fix_hw.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Resolves various issues with Ballistic Overkill. + +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${serverfiles}:${serverfiles}/BODS_Data/Plugins/x86_64" diff --git a/lgsm/functions/fix_bt.sh b/lgsm/functions/fix_bt.sh new file mode 100644 index 0000000000..07fd61ce57 --- /dev/null +++ b/lgsm/functions/fix_bt.sh @@ -0,0 +1,24 @@ +#!/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 + +# 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 diff --git a/lgsm/functions/fix_cmw.sh b/lgsm/functions/fix_cmw.sh new file mode 100644 index 0000000000..192f483e80 --- /dev/null +++ b/lgsm/functions/fix_cmw.sh @@ -0,0 +1,23 @@ +#!/bin/bash +# LinuxGSM fix_cmw.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Resolves the issue of the not starting server on linux + +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +if [ ! -f "${executabledir}/steam_appid.txt" ]; then + fixname="steam_appid.txt" + fn_fix_msg_start + echo 219640 > "${executabledir}/steam_appid.txt" + fn_fix_msg_end +fi + +if [ ! -f "${servercfgfullpath}" ]; then + fn_fix_msg_start + fixname="copy config" + mkdir "${servercfgdir}" + cp "${systemdir}/UDKGame/Config/"*.ini "${servercfgdir}" + fn_fix_msg_end +fi diff --git a/lgsm/functions/fix_csgo.sh b/lgsm/functions/fix_csgo.sh new file mode 100644 index 0000000000..a393f2fd9c --- /dev/null +++ b/lgsm/functions/fix_csgo.sh @@ -0,0 +1,42 @@ +#!/bin/bash +# LinuxGSM fix_csgo.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Resolves various issues with CS:GO. + +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +# Fixes: server not always creating steam_appid.txt file. +if [ ! -f "${serverfiles}/steam_appid.txt" ]; then + fixname="730 steam_appid.txt" + fn_fix_msg_start + echo -n "730" >> "${serverfiles}/steam_appid.txt" + fn_fix_msg_end +fi + +# Fixes: Error parsing BotProfile.db - unknown attribute 'Rank'". +if [ -f "${systemdir}/botprofile.db" ] && grep "^\s*Rank" "${systemdir}/botprofile.db" > /dev/null 2>&1; then + fixname="botprofile.db" + fn_fix_msg_start + sed -i 's/^\s*Rank/\t\/\/Rank/g' "${systemdir}/botprofile.db" > /dev/null 2>&1 + fn_fix_msg_end +fi + +# Fixes: Unknown command "cl_bobamt_vert" and exec: couldn't exec joystick.cfg. +if [ -f "${servercfgdir}/valve.rc" ] && grep -E '^\s*exec\s*(default|joystick)\.cfg' "${servercfgdir}/valve.rc" > /dev/null 2>&1; then + fixname="valve.rc" + fn_fix_msg_start + sed -i 's/^\s*exec\s*default.cfg/\/\/exec default.cfg/g' "${servercfgdir}/valve.rc" > /dev/null 2>&1 + 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 diff --git a/lgsm/functions/fix_dst.sh b/lgsm/functions/fix_dst.sh new file mode 100644 index 0000000000..e30507dc9e --- /dev/null +++ b/lgsm/functions/fix_dst.sh @@ -0,0 +1,17 @@ +#!/bin/bash +# LinuxGSM fix_dst.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Resolves various issues with Don't Starve Together. + +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 + fixname="libcurl-gnutls.so.4" + fn_fix_msg_start + ln -s "/usr/lib/libcurl.so.4" "${serverfiles}/bin/lib32/libcurl-gnutls.so.4" + fn_fix_msg_end +fi diff --git a/lgsm/functions/fix_hw.sh b/lgsm/functions/fix_hw.sh new file mode 100644 index 0000000000..af06924dbb --- /dev/null +++ b/lgsm/functions/fix_hw.sh @@ -0,0 +1,10 @@ +#!/bin/bash +# LinuxGSM fix_hw.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Resolves various issues with Hurtworld. + +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${serverfiles}:${serverfiles}/Hurtworld_Data/Plugins/x86_64" diff --git a/lgsm/functions/fix_ins.sh b/lgsm/functions/fix_ins.sh new file mode 100644 index 0000000000..21a979c4cf --- /dev/null +++ b/lgsm/functions/fix_ins.sh @@ -0,0 +1,20 @@ +#!/bin/bash +# LinuxGSM fix_ins.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Resolves various issues with Insurgency. + +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +# Fixes: ./srcds_linux: error while loading shared libraries: libtier0.so: cannot open shared object file: No such file or directory. + +export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${serverfiles}:${serverfiles}/bin" + +# Fixes: issue #529 - gamemode not passed to debug or start. + +if [ "${commandname}" == "DEBUG" ]; then + defaultmap="\"${defaultmap}\"" +else + defaultmap="\\\"${defaultmap}\\\"" +fi diff --git a/lgsm/functions/fix_kf.sh b/lgsm/functions/fix_kf.sh new file mode 100644 index 0000000000..e749a2d278 --- /dev/null +++ b/lgsm/functions/fix_kf.sh @@ -0,0 +1,36 @@ +#!/bin/bash +# LinuxGSM fix_kf.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Resolves various issues with Killing Floor. + +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +echo -e "Applying WebAdmin ROOst.css fix." +echo -e "http://forums.tripwireinteractive.com/showpost.php?p=585435&postcount=13" +sed -i 's/none}/none;/g' "${serverfiles}/Web/ServerAdmin/ROOst.css" +sed -i 's/underline}/underline;/g' "${serverfiles}/Web/ServerAdmin/ROOst.css" +fn_sleep_time +echo -e "Applying WebAdmin CharSet fix." +echo -e "http://forums.tripwireinteractive.com/showpost.php?p=442340&postcount=1" +sed -i 's/CharSet="iso-8859-1"/CharSet="utf-8"/g' "${systemdir}/UWeb.int" +fn_sleep_time +echo -e "applying server name fix." +fn_sleep_time +echo -e "forcing server restart..." +fn_sleep_time +exitbypass=1 +command_start.sh +fn_firstcommand_reset +sleep 5 +exitbypass=1 +command_stop.sh +fn_firstcommand_reset +exitbypass=1 +command_start.sh +fn_firstcommand_reset +sleep 5 +exitbypass=1 +command_stop.sh +fn_firstcommand_reset diff --git a/lgsm/functions/fix_kf2.sh b/lgsm/functions/fix_kf2.sh new file mode 100644 index 0000000000..b680a99378 --- /dev/null +++ b/lgsm/functions/fix_kf2.sh @@ -0,0 +1,20 @@ +#!/bin/bash +# LinuxGSM fix_kf2.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Resolves various issues with Killing Floor 2. + +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +startparameters="\"${defaultmap}?Game=KFGameContent.KFGameInfo_VersusSurvival\"" + +fn_print_information "starting ${gamename} server to generate configs." +fn_sleep_time +exitbypass=1 +command_start.sh +fn_firstcommand_reset +sleep 10 +exitbypass=1 +command_stop.sh +fn_firstcommand_reset diff --git a/lgsm/functions/fix_lo.sh b/lgsm/functions/fix_lo.sh new file mode 100644 index 0000000000..eec2ebd360 --- /dev/null +++ b/lgsm/functions/fix_lo.sh @@ -0,0 +1,17 @@ +#!/bin/bash +# LinuxGSM fix_lo.sh function +# Author: Daniel Gibbs +# Website: https://linuxgsm.com +# Description: Resolves installation issue with Last Oasis + +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +appidfile=${executabledir}/steam_appid.txt +if [ ! -f "${appidfile}" ]; then + fn_print_information "adding ${appidfile} to ${gamename} server." + fn_sleep_time + echo "903950" > "${appidfile}" +else + fn_print_information "${appidfile} already exists. No action to be taken." + fn_sleep_time +fi diff --git a/lgsm/functions/fix_mcb.sh b/lgsm/functions/fix_mcb.sh new file mode 100644 index 0000000000..4768a40cfe --- /dev/null +++ b/lgsm/functions/fix_mcb.sh @@ -0,0 +1,11 @@ +#!/bin/bash +# LinuxGSM fix_mcb.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Resolves possible startup issue with Minecraft Bedrock. + +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +# official docs state that the server should be started with: LD_LIBRARY_PATH=. ./bedrock_server +export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${serverfiles}" diff --git a/lgsm/functions/fix_mta.sh b/lgsm/functions/fix_mta.sh new file mode 100644 index 0000000000..2c92e8d126 --- /dev/null +++ b/lgsm/functions/fix_mta.sh @@ -0,0 +1,16 @@ +#!/bin/bash +# LinuxGSM fix_mta.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Installs the libmysqlclient for database functions on the server. + +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +if [ ! -f "${lgsmdir}/lib/libmysqlclient.so.16" ]; then + fixname="libmysqlclient16" + fn_fix_msg_start_nl + fn_sleep_time + fn_fetch_file "https://nightly.mtasa.com/files/modules/64/libmysqlclient.so.16" "" "" "" "${lgsmdir}/lib" "libmysqlclient.so.16" "chmodx" "norun" "noforce" "6c188e0f8fb5d7a29f4bc413b9fed6c2" + fn_fix_msg_end +fi diff --git a/lgsm/functions/fix_nmrih.sh b/lgsm/functions/fix_nmrih.sh new file mode 100644 index 0000000000..4bb70c6f9a --- /dev/null +++ b/lgsm/functions/fix_nmrih.sh @@ -0,0 +1,17 @@ +#!/bin/bash +# LinuxGSM fix_nmrih.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Create symlinks for renamed No More Room In Hell serverfiles. +# Solution from Steam Community post: https://steamcommunity.com/app/224260/discussions/2/1732089092441769414/ + +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +ln -s "${serverfiles}/bin/vphysics_srv.so" "${serverfiles}/bin/vphysics.so" +ln -s "${serverfiles}/bin/studiorender_srv.so" "${serverfiles}/bin/studiorender.so" +ln -s "${serverfiles}/bin/soundemittersystem_srv.so" "${serverfiles}/bin/soundemittersystem.so" +ln -s "${serverfiles}/bin/shaderapiempty_srv.so" "${serverfiles}/bin/shaderapiempty.so" +ln -s "${serverfiles}/bin/scenefilecache_srv.so" "${serverfiles}/bin/scenefilecache.so" +ln -s "${serverfiles}/bin/replay_srv.so" "${serverfiles}/bin/replay.so" +ln -s "${serverfiles}/bin/materialsystem_srv.so" "${serverfiles}/bin/materialsystem.so" diff --git a/lgsm/functions/fix_onset.sh b/lgsm/functions/fix_onset.sh new file mode 100644 index 0000000000..e4183999df --- /dev/null +++ b/lgsm/functions/fix_onset.sh @@ -0,0 +1,19 @@ +#!/bin/bash +# LinuxGSM fix_onset.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Resolves various issues with Onset. + +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +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 + fixname="libmariadbclient.so.18" + fn_fix_msg_start + ln -s "/usr/lib64/libmariadb.so.3" "${serverfiles}/libmariadbclient.so.18" + fn_fix_msg_end +fi diff --git a/lgsm/functions/fix_ro.sh b/lgsm/functions/fix_ro.sh new file mode 100644 index 0000000000..895c7c2da7 --- /dev/null +++ b/lgsm/functions/fix_ro.sh @@ -0,0 +1,39 @@ +#!/bin/bash +# LinuxGSM fix_ro.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Resolves various issues with Red Orchestra. + +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +echo -e "Applying WebAdmin ROOst.css fix." +echo -e "http://forums.tripwireinteractive.com/showpost.php?p=585435&postcount=13" +sed -i 's/none}/none;/g' "${serverfiles}/Web/ServerAdmin/ROOst.css" +sed -i 's/underline}/underline;/g' "${serverfiles}/Web/ServerAdmin/ROOst.css" +fn_sleep_time +echo -e "Applying WebAdmin CharSet fix." +echo -e "http://forums.tripwireinteractive.com/showpost.php?p=442340&postcount=1" +sed -i 's/CharSet="iso-8859-1"/CharSet="utf-8"/g' "${systemdir}/uweb.int" +fn_sleep_time +echo -e "Applying Steam AppID fix." +sed -i 's/1210/1200/g' "${systemdir}/steam_appid.txt" +fn_sleep_time +echo -e "applying server name fix." +fn_sleep_time +echo -e "forcing server restart..." +fn_sleep_time +exitbypass=1 +command_start.sh +fn_firstcommand_reset +sleep 5 +exitbypass=1 +command_stop.sh +fn_firstcommand_reset +exitbypass=1 +command_start.sh +fn_firstcommand_reset +sleep 5 +exitbypass=1 +command_stop.sh +fn_firstcommand_reset diff --git a/lgsm/functions/fix_rust.sh b/lgsm/functions/fix_rust.sh new file mode 100644 index 0000000000..5f407e89f8 --- /dev/null +++ b/lgsm/functions/fix_rust.sh @@ -0,0 +1,32 @@ +#!/bin/bash +# LinuxGSM fix_rust.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Resolves startup issue with Rust. + +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +# Fixes: [Raknet] Server Shutting Down (Shutting Down). +export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${serverfiles}:${serverfiles}/RustDedicated_Data/Plugins/x86_64" + +# Part of random seed feature. +# If seed is not defined by user generate a seed file. +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 +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/fix_rw.sh b/lgsm/functions/fix_rw.sh new file mode 100644 index 0000000000..aef41a7031 --- /dev/null +++ b/lgsm/functions/fix_rw.sh @@ -0,0 +1,10 @@ +#!/bin/bash +# LinuxGSM fix_rw.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Resolves various issues with Rising World. + +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${serverfiles}:${serverfiles}/linux64" diff --git a/lgsm/functions/fix_samp.sh b/lgsm/functions/fix_samp.sh new file mode 100644 index 0000000000..a88bf154f6 --- /dev/null +++ b/lgsm/functions/fix_samp.sh @@ -0,0 +1,34 @@ +#!/bin/bash +# LinuxGSM fix_sfc.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Resolves issue that the default rcon password is not changed + +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 //') + 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) + rconpass="admin${random}" + sed -i "s/rcon_password changeme/rcon_password ${rconpass}/g" "${servercfgfullpath}" + fn_fix_msg_end + fi + # check if the hostname is the default name + currenthostname=$(grep -E "^hostname" "${servercfgfullpath}" | sed 's/^hostname //') + defaulthostname="SA-MP 0.3 Server" + if [ "${currenthostname}" == "${defaulthostname}" ]; then + fixname="change default hostname" + fn_fix_msg_start + fn_script_log_info "changing default hostname to LinuxGSM" + sed -i "s/hostname ${defaulthostname}/hostname LinuxGSM/g" "${servercfgfullpath}" + fn_fix_msg_end + fi +fi diff --git a/lgsm/functions/fix_sdtd.sh b/lgsm/functions/fix_sdtd.sh new file mode 100644 index 0000000000..e93db7970f --- /dev/null +++ b/lgsm/functions/fix_sdtd.sh @@ -0,0 +1,10 @@ +#!/bin/bash +# LinuxGSM fix_sdtd.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Resolves various issues with 7 Days to Die. + +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${serverfiles}/7DaysToDieServer_Data/Plugins/x86_64" diff --git a/lgsm/functions/fix_sfc.sh b/lgsm/functions/fix_sfc.sh new file mode 100644 index 0000000000..51b95b9d52 --- /dev/null +++ b/lgsm/functions/fix_sfc.sh @@ -0,0 +1,48 @@ +#!/bin/bash +# LinuxGSM fix_sfc.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Resolves various issues with Source Forts Classic. + +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +if [ ! -f "${serverfiles}/bin/datacache.so" ]; then + ln -s "${serverfiles}/bin/datacache_srv.so" "${serverfiles}/bin/datacache.so" +fi + +if [ ! -f "${serverfiles}/bin/dedicated.so" ]; then + ln -s "${serverfiles}/bin/dedicated_srv.so" "${serverfiles}/bin/dedicated.so" +fi + +if [ ! -f "${serverfiles}/bin/engine.so" ]; then + ln -s "${serverfiles}/bin/engine_srv.so" "${serverfiles}/bin/engine.so" +fi + +if [ ! -f "${serverfiles}/bin/materialsystem.so" ]; then + ln -s "${serverfiles}/bin/materialsystem_srv.so" "${serverfiles}/bin/materialsystem.so" +fi + +if [ ! -f "${serverfiles}/bin/replay.so" ]; then + ln -s "${serverfiles}/bin/replay_srv.so" "${serverfiles}/bin/replay.so" +fi + +if [ ! -f "${serverfiles}/bin/shaderapiempty.so" ]; then + ln -s "${serverfiles}/bin/shaderapiempty_srv.so" "${serverfiles}/bin/shaderapiempty.so" +fi + +if [ ! -f "${serverfiles}/bin/soundemittersystem.so" ]; then + ln -s "${serverfiles}/bin/soundemittersystem_srv.so" "${serverfiles}/bin/soundemittersystem.so" +fi + +if [ ! -f "${serverfiles}/bin/studiorender.so" ]; then + ln -s "${serverfiles}/bin/studiorender_srv.so" "${serverfiles}/bin/studiorender.so" +fi + +if [ ! -f "${serverfiles}/bin/vphysics.so" ]; then + ln -s "${serverfiles}/bin/vphysics_srv.so" "${serverfiles}/bin/vphysics.so" +fi + +if [ ! -f "${serverfiles}/bin/scenefilecache.so" ]; then + ln -s "${serverfiles}/bin/scenefilecache_srv.so" "${serverfiles}/bin/scenefilecache.so" +fi diff --git a/lgsm/functions/fix_sof2.sh b/lgsm/functions/fix_sof2.sh new file mode 100644 index 0000000000..002f429528 --- /dev/null +++ b/lgsm/functions/fix_sof2.sh @@ -0,0 +1,11 @@ +#!/bin/bash +# LinuxGSM fix_rust.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Resolves various issues with Soldier of Fortune 2. + +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +# Fixes: error while loading shared libraries: libcxa.so.1 +export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${serverfiles}" diff --git a/lgsm/functions/fix_squad.sh b/lgsm/functions/fix_squad.sh new file mode 100644 index 0000000000..7d5929b5df --- /dev/null +++ b/lgsm/functions/fix_squad.sh @@ -0,0 +1,26 @@ +#!/bin/bash +# LinuxGSM fix_squad.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Resolves various issues with Squad. + +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 + # 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" + fn_fix_msg_start + mv -v "${oldservercfg}" "${servercfgfullpath}" + fn_fix_msg_end + else + fixname="remove the same config from old configdir" + fn_fix_msg_start + rm -f "${oldservercfg}" + fn_fix_msg_end + + fi +fi diff --git a/lgsm/functions/fix_st.sh b/lgsm/functions/fix_st.sh new file mode 100644 index 0000000000..b9fb5b084a --- /dev/null +++ b/lgsm/functions/fix_st.sh @@ -0,0 +1,11 @@ +#!/bin/bash +# LinuxGSM fix_rust.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Resolves startup issue with Stationeers. + +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +# Fixes: [Raknet] Server Shutting Down (Shutting Down). +export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${serverfiles}:${serverfiles}/rocketstation_DedicatedServer_Data/Plugins/x86_64" diff --git a/lgsm/functions/fix_steamcmd.sh b/lgsm/functions/fix_steamcmd.sh new file mode 100644 index 0000000000..9644208dc7 --- /dev/null +++ b/lgsm/functions/fix_steamcmd.sh @@ -0,0 +1,141 @@ +#!/bin/bash +# LinuxGSM fix_steamcmd.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Resolves various issues related to SteamCMD. + +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() { + # $1 type of fix 32 or 64 as possible values + # $2 as destination where the lib will be copied to + if [ "$1" == "32" ]; then + # steamclient.so x86 fix. + if [ ! -f "${2}/steamclient.so" ]; then + fixname="steamclient.so x86" + fn_fix_msg_start + if [ ! -d "${2}" ]; then + mkdir -p "${2}" + fi + if [ -f "${HOME}/.steam/steamcmd/linux32/steamclient.so" ]; then + cp "${HOME}/.steam/steamcmd/linux32/steamclient.so" "${2}/steamclient.so" + elif [ -f "${steamcmddir}/linux32/steamclient.so" ]; then + cp "${steamcmddir}/linux32/steamclient.so" "${2}/steamclient.so" + elif [ -f "${HOME}/.local/share/Steam/steamcmd/linux32/steamclient.so" ]; then + cp "${HOME}/.local/share/Steam/steamcmd/linux32/steamclient.so" "${2}/steamclient.so" + fi + fn_fix_msg_end + fi + elif [ "$1" == "64" ]; then + # steamclient.so x86_64 fix. + if [ ! -f "${2}/steamclient.so" ]; then + fixname="steamclient.so x86_64" + fn_fix_msg_start + if [ ! -d "${2}" ]; then + mkdir -p "${2}" + fi + if [ -f "${HOME}/.steam/steamcmd/linux64/steamclient.so" ]; then + cp "${HOME}/.steam/steamcmd/linux64/steamclient.so" "${2}/steamclient.so" + elif [ -f "${steamcmddir}/linux64/steamclient.so" ]; then + cp "${steamcmddir}/linux64/steamclient.so" "${2}/steamclient.so" + elif [ -f "${HOME}/.local/share/Steam/steamcmd/linux64/steamclient.so" ]; then + cp "${HOME}/.local/share/Steam/steamcmd/linux64/steamclient.so" "${2}/steamclient.so" + fi + fn_fix_msg_end + fi + fi +} + +# Helps fix: [S_API FAIL] SteamAPI_Init() failed; unable to locate a running instance of Steam,or a local steamclient.so. +steamsdk64="${HOME}/.steam/sdk64" +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" + fn_fix_msg_start + rm -f "${steamclientsdk64}" + fn_fix_msg_end + fi +fi + +# place new hardlink for the file to the disk +if [ ! -f "${steamclientsdk64}" ]; then + fixname="steamclient.so sdk64 hardlink" + fn_fix_msg_start + if [ ! -d "${steamsdk64}" ]; then + mkdir -p "${steamsdk64}" + fi + if [ -f "${HOME}/.steam/steamcmd/linux64/steamclient.so" ]; then + ln "${HOME}/.steam/steamcmd/linux64/steamclient.so" "${steamclientsdk64}" + elif [ -f "${steamcmddir}/linux64/steamclient.so" ]; then + ln "${steamcmddir}/linux64/steamclient.so" "${steamclientsdk64}" + elif [ -f "${HOME}/.local/share/Steam/steamcmd/linux64/steamclient.so" ]; then + ln "${HOME}/.local/share/Steam/steamcmd/linux64/steamclient.so" "${steamclientsdk64}" + else + fn_print_fail_nl "Could not copy any steamclient.so 64bit for the gameserver" + fi + fn_fix_msg_end +fi + +# Helps fix: [S_API FAIL] SteamAPI_Init() failed; unable to locate a running instance of Steam,or a local steamclient.so. +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" + fn_fix_msg_start + rm -f "${steamclientsdk32}" + fn_fix_msg_end + fi +fi + +# place new hardlink for the file to the disk +if [ ! -f "${steamclientsdk32}" ]; then + fixname="steamclient.so sdk32 link" + fn_fix_msg_start + if [ ! -d "${steamsdk32}" ]; then + mkdir -p "${steamsdk32}" + fi + if [ -f "${HOME}/.steam/steamcmd/linux32/steamclient.so" ]; then + ln "${HOME}/.steam/steamcmd/linux32/steamclient.so" "${steamclientsdk32}" + elif [ -f "${steamcmddir}/linux32/steamclient.so" ]; then + ln "${steamcmddir}/linux32/steamclient.so" "${steamclientsdk32}" + elif [ -f "${HOME}/.local/share/Steam/steamcmd/linux32/steamclient.so" ]; then + ln "${HOME}/.local/share/Steam/steamcmd/linux32/steamclient.so" "${steamclientsdk32}" + else + fn_print_fail_nl "Could not copy any steamclient.so 32bit for the gameserver" + fi + fn_fix_msg_end +fi + +# steamclient.so fixes +if [ "${shortname}" == "bo" ]; then + fn_fix_steamclient_so "32" "${serverfiles}/BODS_Data/Plugins/x86" + fn_fix_steamclient_so "64" "${serverfiles}/BODS_Data/Plugins/x86_64" +elif [ "${shortname}" == "cmw" ]; then + fn_fix_steamclient_so "32" "${executabledir}/lib" +elif [ "${shortname}" == "cs" ]; then + fn_fix_steamclient_so "32" "${serverfiles}" +elif [ "${shortname}" == "col" ]; then + fn_fix_steamclient_so "64" "${serverfiles}" +elif [ "${shortname}" == "ins" ]; then + fn_fix_steamclient_so "32" "${serverfiles}/bin" +elif [ "${shortname}" == "pz" ]; then + fn_fix_steamclient_so "32" "${serverfiles}/linux32" + fn_fix_steamclient_so "64" "${serverfiles}/linux64" +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 + fn_fix_steamclient_so "64" "${executabledir}" +elif [ "${shortname}" == "unt" ]; then + fn_fix_steamclient_so "64" "${serverfiles}" +elif [ "${shortname}" == "wurm" ]; then + fn_fix_steamclient_so "64" "${serverfiles}/nativelibs" +fi diff --git a/lgsm/functions/fix_terraria.sh b/lgsm/functions/fix_terraria.sh new file mode 100644 index 0000000000..7758fdad96 --- /dev/null +++ b/lgsm/functions/fix_terraria.sh @@ -0,0 +1,10 @@ +#!/bin/bash +# LinuxGSM fix_terraria.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Resolves an issue with Terraria. + +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +export TERM=xterm diff --git a/lgsm/functions/fix_tf2.sh b/lgsm/functions/fix_tf2.sh new file mode 100644 index 0000000000..77e41a9698 --- /dev/null +++ b/lgsm/functions/fix_tf2.sh @@ -0,0 +1,16 @@ +#!/bin/bash +# LinuxGSM fix_tf2.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Resolves various issues with Team Fortress 2. + +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 + fixname="libcurl-gnutls.so.4" + fn_fix_msg_start + ln -s "/usr/lib/libcurl.so.4" "${serverfiles}/bin/libcurl-gnutls.so.4" + fn_fix_msg_end +fi diff --git a/lgsm/functions/fix_ts3.sh b/lgsm/functions/fix_ts3.sh new file mode 100644 index 0000000000..7c7387cb60 --- /dev/null +++ b/lgsm/functions/fix_ts3.sh @@ -0,0 +1,33 @@ +#!/bin/bash +# LinuxGSM fix_ts3.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Resolves various issues with Teamspeak 3. + +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +# Fixes: makes libmariadb2 available #1924. +if [ ! -f "${serverfiles}/libmariadb.so.2" ]; then + fixname="libmariadb.so.2" + fn_fix_msg_start + cp "${serverfiles}/redist/libmariadb.so.2" "${serverfiles}/libmariadb.so.2" + fn_fix_msg_end +fi + +# Fixes: failed to register local accounting service: No such file or directory. +accountingfile="/dev/shm/7gbhujb54g8z9hu43jre8" +if [ -f "${accountingfile}" ] && [ "${status}" == "0" ]; then + # Check permissions for the file if the current user owns it, if not exit. + if [ "$(stat -c %U ${accountingfile})" == "$(whoami)" ]; then + fixname="Delete file ${accountingfile}" + fn_fix_msg_start + rm -f "${accountingfile}" + fn_fix_msg_end + # file is not owned by the current user and needs to be deleted manually. + else + fn_print_error_nl "File ${accountingfile} is not owned by $(whoami) and needs to be deleted manually" + fn_script_log_fatal "File ${accountingfile} is not owned by $(whoami) and needs to be deleted manually" + core_exit.sh + fi +fi diff --git a/lgsm/functions/fix_unt.sh b/lgsm/functions/fix_unt.sh new file mode 100644 index 0000000000..eae2e63134 --- /dev/null +++ b/lgsm/functions/fix_unt.sh @@ -0,0 +1,10 @@ +#!/bin/bash +# LinuxGSM fix_rust.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Resolves startup issue with Unturned. + +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${serverfiles}:${serverfiles}/Unturned_Headless_Data/Plugins/x86_64" diff --git a/lgsm/functions/fix_ut.sh b/lgsm/functions/fix_ut.sh new file mode 100644 index 0000000000..2e6686a8d5 --- /dev/null +++ b/lgsm/functions/fix_ut.sh @@ -0,0 +1,13 @@ +#!/bin/bash +# LinuxGSM fix_ut.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Resolves various issues with Unreal Tournament. + +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +#Set Binary Executable +echo -e "chmod +x ${executabledir}/${executable}" +chmod +x "${executabledir}/${executable}" +fn_sleep_time diff --git a/lgsm/functions/fix_ut2k4.sh b/lgsm/functions/fix_ut2k4.sh new file mode 100644 index 0000000000..49610e4b69 --- /dev/null +++ b/lgsm/functions/fix_ut2k4.sh @@ -0,0 +1,36 @@ +#!/bin/bash +# LinuxGSM fix_ut2k4.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Resolves various issues with Unreal Tournament 2004. + +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +echo -e "applying WebAdmin ut2003.css fix." +echo -e "http://forums.tripwireinteractive.com/showpost.php?p=585435&postcount=13" +sed -i 's/none}/none;/g' "${serverfiles}/Web/ServerAdmin/ut2003.css" +sed -i 's/underline}/underline;/g' "${serverfiles}/Web/ServerAdmin/ut2003.css" +fn_sleep_time +echo -e "applying WebAdmin CharSet fix." +echo -e "http://forums.tripwireinteractive.com/showpost.php?p=442340&postcount=1" +sed -i 's/CharSet="iso-8859-1"/CharSet="utf-8"/g' "${systemdir}/UWeb.int" +fn_sleep_time +echo -e "applying server name fix." +fn_sleep_time +echo -e "forcing server restart." +fn_sleep_time +exitbypass=1 +command_start.sh +fn_firstcommand_reset +sleep 5 +exitbypass=1 +command_stop.sh +fn_firstcommand_reset +exitbypass=1 +command_start.sh +fn_firstcommand_reset +sleep 5 +exitbypass=1 +command_stop.sh +fn_firstcommand_reset diff --git a/lgsm/functions/fix_ut3.sh b/lgsm/functions/fix_ut3.sh new file mode 100644 index 0000000000..6bd26a53a8 --- /dev/null +++ b/lgsm/functions/fix_ut3.sh @@ -0,0 +1,20 @@ +#!/bin/bash +# LinuxGSM fix_ut2.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Resolves various issues with Unreal Tournament 3. + +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +startparameters="server VCTF-Suspense?Game=UTGameContent.UTVehicleCTFGame_Content?bIsDedicated=true?bIsLanMatch=false?bUsesStats=false?bShouldAdvertise=false?PureServer=1?bAllowJoinInProgress=true?ConfigSubDir=${selfname} -port=${port} -queryport=${queryport} -multihome=${ip} -nohomedir -unattended -log=${gamelog}" + +fn_print_information "starting ${gamename} server to generate configs." +fn_sleep_time +exitbypass=1 +command_start.sh +fn_firstcommand_reset +sleep 10 +exitbypass=1 +command_stop.sh +fn_firstcommand_reset diff --git a/lgsm/functions/fix_vh.sh b/lgsm/functions/fix_vh.sh new file mode 100644 index 0000000000..a90c5d0b0f --- /dev/null +++ b/lgsm/functions/fix_vh.sh @@ -0,0 +1,35 @@ +#!/bin/bash +# LinuxGSM fix_rust.sh function +# Author: Alasdair Haig +# Website: https://linuxgsm.com +# Description: Resolves startup issue with Valheim + +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +export LD_LIBRARY_PATH=./linux64:$LD_LIBRARY_PATH + +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/fix_wurm.sh b/lgsm/functions/fix_wurm.sh new file mode 100644 index 0000000000..aba24d382b --- /dev/null +++ b/lgsm/functions/fix_wurm.sh @@ -0,0 +1,23 @@ +#!/bin/bash +# LinuxGSM fix_wurm.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Resolves various issues with Wurm Unlimited. + +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +# First run requires start with no parms. +# After first run new dirs are created. +if [ ! -d "${serverfiles}/Creative" ]; then + parmsbypass=1 + fixbypass=1 + exitbypass=1 + command_start.sh + fn_firstcommand_reset + sleep 10 + exitbypass=1 + command_stop.sh + fn_firstcommand_reset + unset parmsbypass +fi diff --git a/lgsm/functions/fix_zmr.sh b/lgsm/functions/fix_zmr.sh new file mode 100644 index 0000000000..491c366380 --- /dev/null +++ b/lgsm/functions/fix_zmr.sh @@ -0,0 +1,48 @@ +#!/bin/bash +# LinuxGSM fix_sfc.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Resolves various issues with Zombie Master: Reborn. + +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +if [ ! -f "${serverfiles}/bin/datacache.so" ]; then + ln -s "${serverfiles}/bin/datacache_srv.so" "${serverfiles}/bin/datacache.so" +fi + +if [ ! -f "${serverfiles}/bin/dedicated.so" ]; then + ln -s "${serverfiles}/bin/dedicated_srv.so" "${serverfiles}/bin/dedicated.so" +fi + +if [ ! -f "${serverfiles}/bin/engine.so" ]; then + ln -s "${serverfiles}/bin/engine_srv.so" "${serverfiles}/bin/engine.so" +fi + +if [ ! -f "${serverfiles}/bin/materialsystem.so" ]; then + ln -s "${serverfiles}/bin/materialsystem_srv.so" "${serverfiles}/bin/materialsystem.so" +fi + +if [ ! -f "${serverfiles}/bin/replay.so" ]; then + ln -s "${serverfiles}/bin/replay_srv.so" "${serverfiles}/bin/replay.so" +fi + +if [ ! -f "${serverfiles}/bin/shaderapiempty.so" ]; then + ln -s "${serverfiles}/bin/shaderapiempty_srv.so" "${serverfiles}/bin/shaderapiempty.so" +fi + +if [ ! -f "${serverfiles}/bin/soundemittersystem.so" ]; then + ln -s "${serverfiles}/bin/soundemittersystem_srv.so" "${serverfiles}/bin/soundemittersystem.so" +fi + +if [ ! -f "${serverfiles}/bin/studiorender.so" ]; then + ln -s "${serverfiles}/bin/studiorender_srv.so" "${serverfiles}/bin/studiorender.so" +fi + +if [ ! -f "${serverfiles}/bin/vphysics.so" ]; then + ln -s "${serverfiles}/bin/vphysics_srv.so" "${serverfiles}/bin/vphysics.so" +fi + +if [ ! -f "${serverfiles}/bin/scenefilecache.so" ]; then + ln -s "${serverfiles}/bin/scenefilecache_srv.so" "${serverfiles}/bin/scenefilecache.so" +fi diff --git a/lgsm/functions/info_distro.sh b/lgsm/functions/info_distro.sh new file mode 100644 index 0000000000..f29e621d50 --- /dev/null +++ b/lgsm/functions/info_distro.sh @@ -0,0 +1,281 @@ +#!/bin/bash +# LinuxGSM info_distro.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Variables providing useful info on the Operating System such as disk and performace info. +# Used for command_details.sh, command_debug.sh and alert.sh. + +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +### Game Server pid +if [ "${status}" == "1" ]; then + gameserverpid="$(tmux list-sessions -F "#{session_name} #{pane_pid}" | grep "^${sessionname} " | awk '{print $NF}')" + if [ "${engine}" == "source" ]; then + srcdslinuxpid="$(ps -ef | grep -v grep | grep "${gameserverpid}" | grep srcds_linux | awk '{print $2}')" + elif [ "${engine}" == "goldsrc" ]; then + hldslinuxpid="$(ps -ef | grep -v grep | grep "${gameserverpid}" | grep hlds_linux | awk '{print $2}')" + fi +fi +### Distro information + +## Distro +# Returns architecture, kernel and distro/os. +arch="$(uname -m)" +kernel="$(uname -r)" + +# Distro Name - Ubuntu 16.04 LTS +# Distro Version - 16.04 +# Distro ID - ubuntu +# 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) +for distro_info in "${distro_info_array[@]}"; do + 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. + distroversionrh="$(sed -nr 's/^VERSION_ID="([0-9]*).+?"/\1/p' /etc/os-release)" + 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 + distroname="$(lsb_release -sd)" + elif [ -z "${distroversion}" ]; then + distroversion="$(lsb_release -sr)" + elif [ -z "${distroid}" ]; then + distroid="$(lsb_release -si)" + elif [ -z "${distrocodename}" ]; then + distrocodename="$(lsb_release -sc)" + fi + 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 + if [ -z "${distroname}" ]; then + distroname="Debian $(cat /etc/debian_version)" + elif [ -z "${distroversion}" ]; then + distroversion="$(cat /etc/debian_version)" + elif [ -z "${distroid}" ]; then + distroid="debian" + fi + elif [ -f "/etc/redhat-release" ] && [ "${distro_info}" == "redhat-release" ]; then + if [ -z "${distroname}" ]; then + distroname="$(cat /etc/redhat-release)" + elif [ -z "${distroversion}" ]; then + distroversion="$(rpm -qa \*-release | grep -Ei "oracle|redhat|centos|fedora" | cut -d"-" -f3)" + elif [ -z "${distroid}" ]; then + distroid="$(awk '{print $1}' /etc/redhat-release)" + fi + fi +done + +# some RHEL based distros use 8.4 instead of just 8. +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 + 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 + +## Glibc version +# e.g: 1.17 +glibcversion="$(ldd --version | sed -n '1s/.* //p')" + +## tmux version +# e.g: tmux 1.6 +if [ ! "$(command -V tmux 2> /dev/null)" ]; then + tmuxv="${red}NOT INSTALLED!${default}" + tmuxvdigit="0" +else + tmuxvdigit="$(tmux -V | sed "s/tmux //" | sed -n '1 p' | tr -cd '[:digit:]')" + if [ "${tmuxvdigit}" -lt "16" ]; then + tmuxv="$(tmux -V) (>= 1.6 required for console log)" + else + tmuxv="$(tmux -V)" + fi +fi + +if [ "$(command -V java 2> /dev/null)" ]; then + javaversion="$(java -version 2>&1 | grep "version")" +fi + +if [ "$(command -v mono 2> /dev/null)" ]; then + monoversion="$(mono --version 2>&1 | grep -Po '(?<=version )\d')" +fi + +## Uptime +uptime="$(< /proc/uptime)" +uptime=${uptime/[. ]*/} +minutes="$((uptime / 60 % 60))" +hours="$((uptime / 60 / 60 % 24))" +days="$((uptime / 60 / 60 / 24))" + +### Performance information + +## Average server load +load="$(uptime | awk -F 'load average: ' '{ print $2 }')" + +## CPU information +cpumodel="$(awk -F: '/model name/ {name=$2} END {print name}' /proc/cpuinfo | sed 's/^[ \t]*//;s/[ \t]*$//')" +cpucores="$(awk -F: '/model name/ {core++} END {print core}' /proc/cpuinfo)" +cpufreqency="$(awk -F: '/cpu MHz/ {freq=$2} END {print freq}' /proc/cpuinfo | sed 's/^[ \t]*//;s/[ \t]*$//')" +# CPU usage of the game server pid +if [ -n "${gameserverpid}" ]; then + cpuused="$(ps --forest -o pcpu -g "${gameserverpid}" | awk '{s+=$1} END {print s}')" + cpuusedmhz="$(echo "${cpufreqency} * ${cpuused} / 100" | bc)" +fi + +## Memory information +# Available RAM and swap. + +# Newer distros can use numfmt to give more accurate results. +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. + physmemtotalkb="$(grep MemTotal /proc/meminfo | awk '{print $2}')" + physmemfreekb="$(grep ^MemFree /proc/meminfo | awk '{print $2}')" + physmembufferskb="$(grep ^Buffers /proc/meminfo | awk '{print $2}')" + physmemcachedkb="$(grep ^Cached /proc/meminfo | awk '{print $2}')" + physmemreclaimablekb="$(grep ^SReclaimable /proc/meminfo | awk '{print $2}')" + + # check if MemAvailable Exists. + if grep -q ^MemAvailable /proc/meminfo; then + physmemactualfreekb="$(grep ^MemAvailable /proc/meminfo | awk '{print $2}')" + else + physmemactualfreekb="$((physmemfreekb + physmembufferskb + physmemcachedkb))" + fi + + # Available RAM and swap. + 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")" + physmemavailable="$(numfmt --to=iec --from=iec --suffix=B "${physmemactualfreekb}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")" + # 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}')" + # % + 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 + humanreadable="-m" + else + humanreadable="-h" + fi + physmemtotalmb="$(free -m | awk '/Mem:/ {print $2}')" + physmemtotal="$(free ${humanreadable} | awk '/Mem:/ {print $2}')" + physmemfree="$(free ${humanreadable} | awk '/Mem:/ {print $4}')" + physmemused="$(free ${humanreadable} | awk '/Mem:/ {print $3}')" + + oldfree="$(free ${humanreadable} | awk '/cache:/')" + if [ "${oldfree}" ]; then + physmemavailable="n/a" + physmemcached="n/a" + else + physmemavailable="$(free ${humanreadable} | awk '/Mem:/ {print $7}')" + physmemcached="$(free ${humanreadable} | awk '/Mem:/ {print $6}')" + fi + + swaptotal="$(free ${humanreadable} | awk '/Swap:/ {print $2}')" + swapused="$(free ${humanreadable} | awk '/Swap:/ {print $3}')" + swapfree="$(free ${humanreadable} | awk '/Swap:/ {print $4}')" +fi + +### Disk information + +## Available disk space on the partition. +filesystem="$(LC_ALL=C df -hP "${rootdir}" | tail -n 1 | awk '{print $1}')" +totalspace="$(LC_ALL=C df -hP "${rootdir}" | tail -n 1 | awk '{print $2}')" +usedspace="$(LC_ALL=C df -hP "${rootdir}" | tail -n 1 | awk '{print $3}')" +availspace="$(LC_ALL=C df -hP "${rootdir}" | tail -n 1 | awk '{print $4}')" + +## LinuxGSM used space total. +rootdirdu="$(du -sh "${rootdir}" 2> /dev/null | awk '{print $1}')" +if [ -z "${rootdirdu}" ]; then + rootdirdu="0M" +fi + +## LinuxGSM used space in serverfiles dir. +serverfilesdu="$(du -sh "${serverfiles}" 2> /dev/null | awk '{print $1}')" +if [ -z "${serverfilesdu}" ]; then + serverfilesdu="0M" +fi + +## LinuxGSM used space total minus backup dir. +rootdirduexbackup="$(du -sh --exclude="${backupdir}" "${serverfiles}" 2> /dev/null | awk '{print $1}')" +if [ -z "${rootdirduexbackup}" ]; then + rootdirduexbackup="0M" +fi + +## Backup info +if [ -d "${backupdir}" ]; then + # Used space in backups dir. + backupdirdu="$(du -sh "${backupdir}" | awk '{print $1}')" + # If no backup dir, size is 0M. + if [ -z "${backupdirdu}" ]; then + backupdirdu="0M" + fi + + # number of backups set to 0 by default. + backupcount=0 + + # If there are backups in backup dir. + if [ "$(find "${backupdir}" -name "*.tar.gz" | wc -l)" -ne "0" ]; then + # number of backups. + backupcount="$(find "${backupdir}"/*.tar.gz | wc -l)" + # most recent backup. + lastbackup="$(ls -1t "${backupdir}"/*.tar.gz | head -1)" + # 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))" + # size of most recent backup. + lastbackupsize="$(du -h "${lastbackup}" | awk '{print $1}')" + fi +fi + +# Network Interface name +netint=$(${ipcommand} -o addr | grep "${ip}" | 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 + glibc="2.14" + fi +fi + +# Gather Port Info using ss +ssinfo="$(ss -tuplwn)" diff --git a/lgsm/functions/info_game.sh b/lgsm/functions/info_game.sh new file mode 100644 index 0000000000..8c9ca310a8 --- /dev/null +++ b/lgsm/functions/info_game.sh @@ -0,0 +1,2600 @@ +#!/bin/bash +# LinuxGSM info_game.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Gathers various game server information. + +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +## Examples of filtering to get info from config files. +# sed 's/foo//g' - remove foo +# tr -cd '[:digit:]' leave only digits +# tr -d '=\"; ' remove selected characters =\"; +# grep -v "foo" filter out lines that contain foo +# cut -f1 -d "/" remove everything after / + +fn_info_game_ac() { + # Config + if [ ! -f "${servercfgfullpath}" ]; then + adminpassword="${unavailable}" + httpport="${zero}" + port="${zero}" + queryport="${zero}" + servername="${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) + + # Not set + adminpassword=${adminpassword:-"NOT SET"} + httpport=${httpport:-"0"} + port=${port:-"0"} + queryport=${queryport:-"0"} + servername=${servername:-"NOT SET"} + + fi +} + +fn_info_game_ark() { + # Config + if [ ! -f "${servercfgfullpath}" ]; then + adminpassword="${unavailable}" + servername="${unavailable}" + serverpassword="${unavailable}" + else + 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 + adminpassword=${adminpassword:-"NOT SET"} + servername=${servername:-"NOT SET"} + serverpassword=${serverpassword:-"NOT SET"} + fi + + # Parameters + maxplayers=${maxplayers:-"0"} + port=${port:-"0"} + queryport=${queryport:-"0"} + rawport=$((port + 1)) + rconport=${rconport:-"0"} +} + +fn_info_game_arma3() { + # Config + if [ ! -f "${servercfgfullpath}" ]; then + adminpassword="${unavailable}" + maxplayers="${zero}" + servername="${unavailable}" + serverpassword="${unavailable}" + else + adminpassword=$(sed -nr 's/^passwordAdmin\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 + adminpassword=${adminpassword:-"NOT SET"} + maxplayers=${maxplayers:-"0"} + servername=${servername:-"NOT SET"} + serverpassword=${serverpassword:-"NOT SET"} + fi + + # Parameters + battleeyeport=$((port + 4)) + port=${port:-"2302"} + queryport=$((port + 1)) + steammasterport=$((port + 2)) + voiceport=${port:-"2302"} + voiceunusedport=$((port + 3)) +} + +fn_info_game_armar() { + 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}") + + # 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"} + fi +} + +fn_info_game_av() { + # Config + if [ ! -f "${servercfgfullpath}" ]; then + maxplayers="${unavailable}" + servername="${unavailable}" + serverpassword="${unavailable}" + port=${zero} + queryport=${zero} + steamqueryport=${zero} + steammasterport=${zero} + rconport=${zero} + rconenabled="${unavailable}" + rconpassword="${unavailable}" + else + maxplayers=$(grep "maxPlayers=" "${servercfgfullpath}" | sed 's/maxPlayers=//') + servername=$(grep "name=" "${servercfgfullpath}" | sed 's/name=//') + serverpassword=$(grep "password=" "${servercfgfullpath}" | sed 's/password=//') + port=$(grep "port=" "${servercfgfullpath}" | sed 's/port=//') + queryport=$((port + 3)) + steamqueryport=$((port + 20)) + steammasterport=$((port + 21)) + rconport=$(grep "rconPort=" "${servercfgfullpath}" | sed 's/rconPort=//') + + rconpassword=$(grep "rconPassword=" "${servercfgfullpath}" | sed 's/rconPassword=//') + if [ -n "${rconpassword}" ]; then + rconenabled="true" + fi + + # Not set + maxplayers=${maxplayers:-"0"} + servername=${servername:-"NOT SET"} + serverpassword=${serverpassword:-"NOT SET"} + port=${port:-"0"} + queryport=${queryport:-"0"} + steamqueryport=${steamqueryport:-"0"} + steammasterport=${steammasterport:-"0"} + rconport=${rconport:-"0"} + rconenabled=${rconenabled:-"NOT SET"} + rconpassword=${rconpassword:-"NOT SET"} + fi +} + +fn_info_game_bf1942() { + # Config + if [ ! -f "${servercfgfullpath}" ]; then + servername="${unavailable}" + serverpassword="${unavailable}" + maxplayers="${zero}" + port="${zero}" + queryport="${zero}" + else + servername=$(grep -E "^game.serverName " "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^--/d' -e 's/game.serverName //g' | tr -d '=\";,:' | xargs) + serverpassword=$(grep "game.serverPassword" "${servercfgfullpath}" | sed -e 's/^ *//g' -e '/^--/d' -e 's/game.serverPassword//g' | tr -d '=\";,:' | xargs) + maxplayers=$(grep "game.serverMaxPlayers" "${servercfgfullpath}" | grep -v "\--" | tr -cd '[:digit:]') + port=$(grep "game.serverPort" "${servercfgfullpath}" | grep -v "\--" | tr -cd '[:digit:]') + queryport="22000" + configip=$(grep "game.serverIP" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^--/d' -e 's/game.serverIP//g' | tr -d '=\";,:' | xargs) + + # Not set + servername=${servername:-"NOT SET"} + serverpassword=${serverpassword:-"NOT SET"} + maxplayers=${maxplayers:-"0"} + port=${port:-"0"} + queryport=${queryport:-"0"} + configip=${configip:-"0.0.0.0"} + fi +} + +fn_info_game_bfv() { + # Config + if [ ! -f "${servercfgfullpath}" ]; then + servername="${unavailable}" + serverpassword="${unavailable}" + maxplayers="${zero}" + port="${zero}" + queryport="${zero}" + else + servername=$(grep "game.serverName" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^--/d' -e 's/game.serverName//g' | tr -d '=\";,:' | xargs) + serverpassword=$(grep "game.serverPassword" "${servercfgfullpath}" | sed -e 's/^ *//g' -e '/^--/d' -e 's/game.serverPassword//g' | tr -d '=\";,:' | xargs) + maxplayers=$(grep "game.serverMaxPlayers" "${servercfgfullpath}" | grep -v "\--" | tr -cd '[:digit:]') + port=$(grep "game.serverPort" "${servercfgfullpath}" | grep -v "\--" | tr -cd '[:digit:]') + queryport="23000" + configip=$(grep "game.serverIP" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^--/d' -e 's/game.serverIP//g' | tr -d '=\";,:' | xargs) + + # Not set + servername=${servername:-"NOT SET"} + serverpassword=${serverpassword:-"NOT SET"} + maxplayers=${maxplayers:-"0"} + port=${port:-"0"} + queryport=${queryport:-"0"} + configip=${configip:-"0.0.0.0"} + fi +} + +fn_info_game_bo() { + # Config + if [ ! -f "${servercfgfullpath}" ]; then + servername="${unavailable}" + serverpassword="${unavailable}" + port="${zero}" + queryport="${zero}" + maxplayers="${unavailable}" + else + servername=$(grep "ServerName=" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/ServerName//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + serverpassword=$(grep "Password=" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/Password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + port=$(grep "ServerPort=" "${servercfgfullpath}" | tr -cd '[:digit:]') + queryport=$((port + 1)) + maxplayers=$(grep "MaxPlayers=" "${servercfgfullpath}" | tr -cd '[:digit:]') + + # Not set + servername=${servername:-"NOT SET"} + serverpassword=${serverpassword:-"NOT SET"} + port=${port:-"0"} + queryport=${queryport:-"0"} + maxplayers=${maxplayers:-"0"} + fi +} + +fn_info_game_bt() { + # Config + if [ ! -f "${servercfgfullpath}" ]; then + servername="${unavailable}" + serverpassword="${unavailable}" + port="${zero}" + queryport="${zero}" + maxplayers="${unavailable}" + else + 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:]') + maxplayers=$(grep "maxplayers=" "${servercfgfullpath}" | tr -cd '[:digit:]') + + # Not set + servername=${servername:-"NOT SET"} + serverpassword=${serverpassword:-"NOT SET"} + port=${port:-"0"} + queryport=${queryport:-"0"} + maxplayers=${maxplayers:-"0"} + fi +} + +fn_info_game_btl() { + # Config + if [ ! -f "${servercfgfullpath}" ]; then + servername="${unavailable}" + serverpassword="${unavailable}" + gamemode="${unavailable}" + else + servername=$(grep -m2 "ServerName" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^--/d' -e 's/ServerName//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + serverpassword=$(grep "Password" "${servercfgfullpath}" | grep -v "RCONPassword" | sed -e 's/^[ \t]*//g' -e '/^--/d' -e 's/Password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + gamemode=$(grep -m2 "PlayMode" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^--/d' -e 's/PlayMode//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + + # Not set + servername=${servername:-"NOT SET"} + serverpassword=${serverpassword:-"NOT SET"} + gamemode=${gamemode:-"NOT SET"} + fi + + # Parameters + port=${port:-"0"} + queryport=${queryport:-"0"} + rconport=$((port + 2)) +} + +fn_info_game_cd() { + if [ ! -f "${servercfgfullpath}" ]; then + servername="${unavailable}" + port="${zero}" + rconenabled="false" + rconport="${zero}" + rconpassword="${unavailable}" + steamport="${zero}" + maxplayers="${zero}" + else + servername=$(jq -r '.game_title' "${servercfgfullpath}") + port=$(jq -r '.game_port' "${servercfgfullpath}") + steamport=$(jq -r '.steam_port_messages' "${servercfgfullpath}") + rconenabled=$(jq -r '.rcon' "${servercfgfullpath}") + rconport=$(jq -r '.rcon_port' "${servercfgfullpath}") + rconpassword=$(jq -r '.rcon_password' "${servercfgfullpath}") + maxplayers=$(jq -r '.player_count' "${servercfgfullpath}") + fi +} + +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}" + rconport=${zero} + servername="${unavailable}" + serverpassword="${unavailable}" + + else + adminpassword=$(grep -E "^adminpassword=" "${servercfgfullpath}" | tr -cd '[:digit:]') + rconport=$(grep -E "^RConPort=" "${servercfgdir}/DefaultGame.ini" | tr -cd '[:digit:]') + servername=$(grep -E "^ServerName" "${servercfgfullpath}" | sed 's/^ServerName=//') + serverpassword=$(grep -E "^GamePassword" "${servercfgfullpath}" | sed 's/^ServerName=//') + + # Not set + adminpassword=${adminpassword:-"NOT SET"} + rconport=${rconport:-"0"} + servername=${servername:-"NOT SET"} + serverpassword=${serverpassword:-"NOT SET"} + fi + + # Parameters + defaultmap=${defaultmap:-"NOT SET"} + port=${port:-"0"} + queryport=${queryport:-"0"} +} + +fn_info_game_cod() { + # Config + if [ ! -f "${servercfgfullpath}" ]; then + servername="${unavailable}" + rconpassword="${unavailable}" + else + servername=$(grep "sv_hostname " "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set sv_hostname //g' | tr -d '=\";,:' | xargs) + rconpassword=$(grep "rconpassword" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set rconpassword //g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + + # Not set + servername=${servername:-"NOT SET"} + rconpassword=${rconpassword=:-"NOT SET"} + fi + + # Parameters + defaultmap=${defaultmap:-"NOT SET"} + maxplayers=${maxplayers:-"0"} + port=${port:-"0"} +} + +fn_info_game_coduo() { + # Config + if [ ! -f "${servercfgfullpath}" ]; then + servername="${unavailable}" + rconpassword="${unavailable}" + else + servername=$(grep "sv_hostname " "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set sv_hostname //g' | tr -d '=\";,:' | xargs) + rconpassword=$(grep "rconpassword" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set rconpassword //g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + + # Not set + servername=${servername:-"NOT SET"} + rconpassword=${rconpassword=:-"NOT SET"} + fi + + # Parameters + defaultmap=${defaultmap:-"NOT SET"} + maxplayers=${maxplayers:-"0"} + port=${port:-"0"} + queryport=${port:-"28960"} +} + +fn_info_game_cod2() { + # Config + if [ ! -f "${servercfgfullpath}" ]; then + servername="${unavailable}" + rconpassword="${unavailable}" + else + servername=$(grep "sv_hostname " "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set sv_hostname //g' | tr -d '=\";,:' | xargs) + rconpassword=$(grep "rconpassword" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set rconpassword //g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + + # Not set + servername=${servername:-"NOT SET"} + rconpassword=${rconpassword=:-"NOT SET"} + fi + + # Parameters + defaultmap=${defaultmap:-"NOT SET"} + maxplayers=${maxplayers:-"0"} + port=${port:-"0"} + queryport=${port:-"28960"} +} + +fn_info_game_cod4() { + # Config + if [ ! -f "${servercfgfullpath}" ]; then + servername="${unavailable}" + rconpassword="${unavailable}" + else + servername=$(sed -nr 's/^set\s*sv_hostname\s*"(.*)".*/\1/p' "${servercfgfullpath}") + rconpassword=$(sed -nr 's/^set\s*rcon_password\s*"(.*)"\s*\/.*/\1/p' "${servercfgfullpath}") + queryport=${port:-"28960"} + + # Not set + servername=${servername:-"NOT SET"} + rconpassword=${rconpassword=:-"NOT SET"} + queryport=${queryport:-"28960"} + fi + + # Parameters + defaultmap=${defaultmap:-"NOT SET"} + maxplayers=${maxplayers:-"0"} + port=${port:-"0"} + queryport=${port:-"28960"} +} + +fn_info_game_codwaw() { + # Config + if [ ! -f "${servercfgfullpath}" ]; then + servername="${unavailable}" + rconpassword="${unavailable}" + else + servername=$(grep "sv_hostname " "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set sv_hostname //g' | tr -d '=\";,:' | xargs) + rconpassword=$(grep "rconpassword" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set rconpassword //g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + + # Not set + servername=${servername:-"NOT SET"} + rconpassword=${rconpassword=:-"NOT SET"} + fi + + # Parameters + defaultmap=${defaultmap:-"NOT SET"} + maxplayers=${maxplayers:-"0"} + port=${port:-"0"} + queryport=${port:-"28960"} +} + +fn_info_game_col() { + # Config + if [ ! -f "${servercfgfullpath}" ]; then + servername="${unavailable}" + serverpassword="${unavailable}" + maxplayers="${unavailable}" + port="${zero}" + queryport="${zero}" + steamport="${zero}" + rconpassword="${unavailable}" + else + servername=$(jq -r '.ServerSettings.ServerName' "${servercfgfullpath}") + serverpassword=$(jq -r '.ServerSettings.ServerPassword' "${servercfgfullpath}") + maxplayers=$(jq -r '.ServerSettings.MaxPlayerCount' "${servercfgfullpath}") + port=$(jq -r '.ServerSettings.ServerGamePort' "${servercfgfullpath}") + queryport=${port:-"0"} + steamport=$(jq -r '.ServerSettings.ServerSteamPort' "${servercfgfullpath}") + rconpassword=$(jq -r '.ServerSettings.RCONPassword' "${servercfgfullpath}") + configip=$(jq -r '.ServerSettings.ServerIP' "${servercfgfullpath}") + + # Not set + servername=${servername:-"NOT SET"} + serverpassword=${serverpassword:-"NOT SET"} + maxplayers=${maxplayers:-"0"} + port=${port:-"27004"} + queryport=${queryport:-"0"} + steamport=${steamport:-"27005"} + rconpassword=${rconpassword:-"NOT SET"} + configip=${configip:-"0.0.0.0"} + fi +} + +fn_info_game_dodr() { + # Config + if [ ! -f "${servercfgfullpath}" ]; then + maxplayers="${zero}" + else + maxplayers=$(sed -nr 's/^iServerMaxPlayers=(.*)$/\1/p' "${servercfgfullpath}") + + # Not set + maxplayers=${maxplayers:-"0"} + fi + + # Parameters + servername=${servername:-"NOT SET"} + port=${port:-"7777"} + queryport=${queryport:-"27015"} +} + +fn_info_game_dayz() { + # Config + if [ ! -f "${servercfgfullpath}" ]; then + servername="${unavailable}" + adminpassword="${unavailable}" + serverpassword="${unavailable}" + maxplayers="${zero}" + 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}") + queryport=$(sed -nr 's/^steamQueryPort\s*=\s*([0-9]+)\s*;/\1/p' "${servercfgfullpath}") + + # Not Set + servername=${servername:-"NOT SET"} + adminpassword=${adminpassword:-"NOT SET"} + serverpassword=${serverpassword:-"NOT SET"} + maxplayers=${maxplayers:-"0"} + queryport=${queryport:-"27016"} + fi + + # Parameters + port=${port:-"2302"} + steammasterport=$((port + 2)) + battleeyeport=$((port + 4)) +} + +fn_info_game_dst() { + # Config + if [ ! -f "${clustercfgfullpath}" ]; then + servername="${unavailable}" + serverpassword="${unavailable}" + maxplayers="${zero}" + gamemode="${unavailable}" + tickrate="${zero}" + masterport="${zero}" + else + servername=$(grep "cluster_name" "${clustercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/cluster_name//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + serverpassword=$(grep "cluster_password" "${clustercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/cluster_password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + maxplayers=$(grep "max_players" "${clustercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') + gamemode=$(grep "game_mode" "${clustercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/game_mode//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + tickrate=$(grep "tick_rate" "${clustercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') + masterport=$(grep "master_port" "${clustercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') + configip=$(grep "bind_ip" "${clustercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/bind_ip//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + + # Not set + servername=${servername:-"NOT SET"} + serverpassword=${serverpassword:-"NOT SET"} + maxplayers=${maxplayers:-"0"} + gamemode=${gamemode:-"NOT SET"} + tickrate=${tickrate:-"0"} + masterport=${masterport:-"0"} + configip=${configip:-"0.0.0.0"} + fi + + if [ ! -f "${servercfgfullpath}" ]; then + port="${zero}" + steamauthport="${zero}" + steammasterport="${zero}" + else + port=$(grep "server_port" "${servercfgfullpath}" | grep "^server_port" | grep -v "#" | tr -cd '[:digit:]') + steamauthport=$(grep "authentication_port" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') + steammasterport=$(grep "master_server_port" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') + + # Not set + port=${port:-"0"} + steamauthport=${steamauthport:-"0"} + steammasterport=${steammasterport:-"0"} + fi + + # Parameters + sharding=${sharding:-"NOT SET"} + master=${master:-"NOT SET"} + shard=${shard:-"NOT SET"} + cluster=${cluster:-"NOT SET"} + cave=${cave:-"NOT SET"} +} + +fn_info_game_eco() { + # Config + if [ ! -f "${servercfgfullpath}" ]; then + servername="${unavailable}" + serverpassword="${unavailable}" + maxplayers="${zero}" + tickrate="${zero}" + port="${zero}" + webadminport="${zero}" + else + configip=$(jq -r '.IPAddress' "${servercfgfullpath}") + servername=$(jq -r '.Description' "${servercfgfullpath}") + serverpassword=$(jq -r '.Password' "${servercfgfullpath}") + maxplayers=$(jq -r '.MaxConnections' "${servercfgfullpath}") + tickrate=$(jq -r '.Rate' "${servercfgfullpath}") + port=$(jq -r '.GameServerPort' "${servercfgfullpath}") + webadminport=$(jq -r '.WebServerPort' "${servercfgfullpath}") + + # Not set + configip=${configip:-"0.0.0.0"} + servername=${servername:-"NOT SET"} + serverpassword=${serverpassword:-"NOT SET"} + maxplayers=${maxplayers=:-"0"} + tickrate=${tickrate=:-"0"} + port=${port=:-"0"} + webadminport=${webadminport=:-"0"} + fi +} + +fn_info_game_etl() { + # Config + if [ ! -f "${servercfgfullpath}" ]; then + rconpassword="${unavailable}" + servername="${unavailable}" + serverpassword="${unavailable}" + maxplayers="${zero}" + port="${zero}" + queryport="${zero}" + else + port=$(grep "set net_port" "${servercfgfullpath}" | grep -v "//" | tr -cd '[:digit:]') + queryport="${port}" + rconpassword=$(grep "set rconpassword" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set rconpassword //g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//g' -e '/^\//d' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + servername=$(grep "set sv_hostname" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set sv_hostname //g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + serverpassword=$(grep "set g_password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set g_password //g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + maxplayers=$(grep "set sv_maxclients" "${servercfgfullpath}" | grep -v "//" | tr -cd '[:digit:]') + configip=$(grep "set net_ip" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set net_ip//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + + # Not set + rconpassword=${rconpassword:-"NOT SET"} + servername=${servername:-"NOT SET"} + serverpassword=${serverpassword:-"NOT SET"} + maxplayers=${maxplayers:-"0"} + port=${port:-"27960"} + queryport=${queryport:-"27960"} + configip=${configip:-"0.0.0.0"} + fi +} + +fn_info_game_fctr() { + # Config + if [ ! -f "${servercfgfullpath}" ]; then + servername="Factorio Server" + serverpassword="${unavailable}" + maxplayers="${zero}" + authtoken="${unavailable}" + savegameinterval="${unavailable}" + versioncount="${unavailable}" + else + servername=$(jq -r '.name' "${servercfgfullpath}") + serverpassword=$(jq -r '.game_password' "${servercfgfullpath}") + maxplayers=$(jq -r '.max_players' "${servercfgfullpath}") + authtoken=$(jq -r '.token' "${servercfgfullpath}") + savegameinterval=$(jq -r '.autosave_interval' "${servercfgfullpath}") + versioncount=$(jq -r '.autosave_slots' "${servercfgfullpath}") + + # Not set + servername=${servername:-"NOT SET"} + serverpassword=${serverpassword:-"NOT SET"} + maxplayers=${maxplayers:-"0"} + authtoken=${authtoken:-"NOT SET"} + savegameinterval=${savegameinterval:-"0"} + versioncount=${versioncount:-"0"} + fi + + # Parameters + 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() { + # Config + if [ ! -f "${servercfgfullpath}" ]; then + servername="${unavailable}" + serverdescription="${unavailable}" + serverpassword="${unavailable}" + maxplayers="${zero}" + port="${zero}" + queryport="${zero}" + else + servername=$(grep "Name" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^--/d' -e 's/Name//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + serverdescription=$(grep "Description" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^--/d' -e 's/Description//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + serverpassword=$(grep "Password" "${servercfgfullpath}" | sed -e 's/^ *//g' -e '/^--/d' -e 's/Password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + maxplayers=$(grep "MaxPlayers" "${servercfgfullpath}" | grep -v "\--" | tr -cd '[:digit:]') + port=$(grep "BindPort" "${servercfgfullpath}" | grep -v "\--" | tr -cd '[:digit:]') + queryport="${port}" + configip=$(grep "BindIP" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^--/d' -e 's/BindIP//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + + # Not set + servername=${servername:-"NOT SET"} + serverpassword=${serverpassword:-"NOT SET"} + serverdescription=${serverdescription:-"NOT SET"} + maxplayers=${maxplayers:-"0"} + port=${port:-"0"} + queryport=${queryport:-"0"} + configip=${configip:-"0.0.0.0"} + fi +} + +fn_info_game_hw() { + # Parameters + servername=${servername:-"NOT SET"} + port=${port:-"0"} + queryport=${queryport:-"0"} + maxplayers=${maxplayers:-"0"} + defaultmap=${defaultmap:-"NOT SET"} + creativemode=${creativemode:-"NOT SET"} +} + +fn_info_game_inss() { + # Parameters + port=${port:-"0"} + queryport=${queryport:-"0"} + rconport=${rconport:-"0"} + servername=${servername:-"NOT SET"} + serverpassword=${serverpassword:-"NOT SET"} + defaultmap=${defaultmap:-"NOT SET"} + defaultscenario=${defaultscenario:-"NOT SET"} + maxplayers=${maxplayers:-"0"} +} + +fn_info_game_jc3() { + # Config + if [ ! -f "${servercfgfullpath}" ]; then + servername="${unavailable}" + serverdescription="${unavailable}" + serverpassword="${unavailable}" + maxplayers="${zero}" + port="${zero}" + queryPort="${zero}" + steamport="${zero}" + httpport="${zero}" + tickrate="${zero}" + else + servername=$(grep "name" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/name//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + serverdescription=$(grep "description" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/description//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + serverpassword=$(grep "password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + maxplayers=$(grep "\"maxPlayers\"" "${servercfgfullpath}" | tr -cd '[:digit:]') + port=$(grep "\"port\"" "${servercfgfullpath}" | tr -cd '[:digit:]') + queryport=$(grep "\"queryPort\"" "${servercfgfullpath}" | tr -cd '[:digit:]') + steamport=$(grep "\"steamPort\"" "${servercfgfullpath}" | tr -cd '[:digit:]') + httpport=$(grep "\"httpPort\"" "${servercfgfullpath}" | tr -cd '[:digit:]') + tickrate=$(grep "\"maxTickRate\"" "${servercfgfullpath}" | tr -cd '[:digit:]') + configip=$(grep "host" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/host//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + + # Not set + servername=${servername:-"NOT SET"} + serverdescription=${serverdescription:-"NOT SET"} + serverpassword=${serverpassword:-"NOT SET"} + maxplayers=${maxplayers=:-"0"} + port=${port=:-"0"} + queryport=${queryport=:-"0"} + steamport=${steamport=:-"0"} + httpport=${httpport=:-"0"} + tickrate=${tickrate=:-"0"} + configip=${configip:-"0.0.0.0"} + fi +} + +fn_info_game_jk2() { + # Config + if [ ! -f "${servercfgfullpath}" ]; then + rconpassword="${unavailable}" + servername="${unavailable}" + serverpassword="${unavailable}" + maxplayers="${zero}" + serverversion="${unavailable}" + else + rconpassword=$(grep "seta rconpassword" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/seta rconpassword//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + servername=$(grep "seta sv_hostname" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/seta sv_hostname//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + serverpassword=$(grep "seta g_password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/seta g_password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + maxplayers=$(grep "seta sv_maxclients" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') + serverversion=$(grep "seta mv_serverversion" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/seta mv_serverversion//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + + # Not set + rconpassword=${rconpassword:-"NOT SET"} + servername=${servername:-"NOT SET"} + serverpassword=${serverpassword:-"NOT SET"} + maxplayers=${maxplayers:-"0"} + serverversion=${serverversion:-"NOT SET"} + fi + + # Parameters + port=${port:-"0"} + queryport=${port} + defaultmap=${defaultmap:-"NOT SET"} +} + +fn_info_game_kf() { + # Config + if [ ! -f "${servercfgfullpath}" ]; then + servername="${unavailable}" + serverpassword="${unavailable}" + adminpassword="${unavailable}" + port="${zero}" + queryport="${zero}" + queryportgs="${zero}" + steamport="${zero}" + steammasterport="${zero}" + lanport="${zero}" + httpport="${zero}" + webadminenabled="${unavailable}" + webadminuser="${unavailable}" + webadminpass="${unavailable}" + else + servername=$(sed -nr 's/^ServerName=(.*)$/\1/p' "${servercfgfullpath}" | tr -d '=\";,:' | sed 's/\r$//') + serverpassword=$(sed -nr 's/^GamePassword=(.*)$/\1/p' "${servercfgfullpath}" | tr -d '=\";,:' | sed 's/\r$//') + adminpassword=$(sed -nr 's/^AdminPassword=(.*)$/\1/p' "${servercfgfullpath}" | tr -d '=\";,:' | sed 's/\r$//') + port=$(sed -nr 's/^Port=(.*)$/\1/p' "${servercfgfullpath}" | tr -cd '[:digit:]') + queryport=$((port + 1)) + queryportgs=$(sed -nr 's/^OldQueryPortNumber=(.*)$/\1/p' "${servercfgfullpath}" | tr -cd '[:digit:]') + steamport="20560" + steammasterport="28852" + lanport=$(grep "LANServerPort=" "${servercfgfullpath}" | tr -cd '[:digit:]') + httpport=$(sed -nr 's/^ListenPort=(.*)$/\1/p' "${servercfgfullpath}" | tr -cd '[:digit:]') + webadminenabled=$(sed -nr 's/^bEnabled=(.*)$/\1/p' "${servercfgfullpath}" | tr -d '=\";,:' | sed 's/\r$//') + webadminuser=$(sed -nr 's/^AdminName=(.*)$/\1/p' "${servercfgfullpath}" | tr -d '=\";,:' | sed 's/\r$//') + webadminpass="${adminpassword}" + + # Not set + servername=${servername:-"NOT SET"} + serverpassword=${serverpassword:-"NOT SET"} + adminpassword=${adminpassword:-"NOT SET"} + port=${port:-"0"} + queryport=${queryport:-"0"} + queryportgs=${queryportgs:-"0"} + steamport=${steamport:-"0"} + steammasterport=${steammasterport:-"0"} + lanport=${lanport:-"0"} + httpport=${httpport:-"0"} + webadminenabled=${webadminenabled:-"NOT SET"} + webadminuser=${webadminuser:-"NOT SET"} + webadminpass=${webadminpass:-"NOT SET"} + fi + + # Parameters + defaultmap=${defaultmap:-"NOT SET"} +} + +fn_info_game_kf2() { + # Config + if [ ! -f "${servercfgfullpath}" ]; then + servername="${unavailable}" + serverpassword="${unavailable}" + adminpassword="${unavailable}" + port=${zero} + queryport=${zero} + webadminenabled="${unavailable}" + httpport="${zero}" + webadminuser="${unavailable}" + webadminpass="${unavailable}" + else + servername=$(grep "ServerName" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/ServerName//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + serverpassword=$(grep "GamePassword" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/GamePassword//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + adminpassword=$(grep "AdminPassword" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/AdminPassword//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + port=$(grep "Port" "${servercfgdir}/LinuxServer-KFEngine.ini" | sed -e 's/^[ \t]*//g' | grep "^Port" | grep -v "#" | tr -cd '[:digit:]') + webadminenabled=$(grep "bEnabled" "${servercfgdir}/KFWeb.ini" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/bEnabled//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + httpport=$(grep "ListenPort" "${servercfgdir}/KFWeb.ini" | grep -v "#" | tr -cd '[:digit:]') + webadminuser="Admin" + webadminpass=$(grep "AdminPassword" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/AdminPassword//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + + # Not set + servername=${servername:-"NOT SET"} + serverpassword=${serverpassword:-"NOT SET"} + adminpassword=${adminpassword:-"NOT SET"} + port=${port:-"0"} + webadminenabled=${webadminenabled:-"NOT SET"} + httpport=${webadminport:-"0"} + webadminuser=${webadminuser:-"NOT SET"} + webadminpass=${webadminpass:-"NOT SET"} + fi + + # Parameters + queryport=${queryport:-"0"} + defaultmap=${defaultmap:-"NOT SET"} +} + +fn_info_game_lo() { + # Parameters + servername=${servername:-"NOT SET"} + port=${port:-"0"} + queryport=${queryport:-"0"} + maxplayers=${slots:-"0"} +} + +fn_info_game_mc() { + # Config + if [ ! -f "${servercfgfullpath}" ]; then + servername="${unavailable}" + rconpassword="${unavailable}" + rconport="${zero}" + maxplayers="${zero}" + port="${zero}" + queryport="${zero}" + queryenabled="${unavailable}" + gamemode="${unavailable}" + gameworld="${unavailable}" + else + servername=$(grep "motd" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/motd//g' | tr -d '=\";,:' | sed 's/\\u00A70//g;s/\\u00A71//g;s/\\u00A72//g;s/\\u00A73//g;s/\\u00A74//g;s/\\u00A75//g;s/\\u00A76//g;s/\\u00A77//g;s/\\u00A78//g;s/\\u00A79//g;s/\\u00A7a//g;s/\\u00A7b//g;s/\\u00A7c//g;s/\\u00A7d//g;s/\\u00A7e//g;s/\\u00A7f//g;s/\\u00A7l//g;s/\\u00A7o//g;s/\\u00A7n//g;s/\\u00A7m//g;s/\\u00A7k//g' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + rconpassword=$(grep "rcon.password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/rcon.password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + rconport=$(grep "rcon.port" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') + maxplayers=$(grep "max-players" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') + port=$(grep "server-port" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') + queryport=$(grep "query.port" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') + if [ -z "${queryport}" ]; then + queryport=${port} + fi + queryenabled=$(grep "enable-query" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/enable-query//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + gamemode=$(grep "gamemode" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') + gameworld=$(grep "level-name" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/level-name//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + configip=$(grep "server-ip" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^--/d' -e 's/server-ip//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + + # Not set + servername=${servername:-"NOT SET"} + rconpassword=${rconpassword:-"NOT SET"} + rconport=${rconport:-"NOT SET"} + maxplayers=${maxplayers:-"0"} + port=${port:-"NOT SET"} + queryport=${queryport:-"NOT SET"} + queryenabled="${queryenabled:-"NOT SET"}" + gamemode=${gamemode:-"NOT SET"} + gameworld=${gameworld:-"NOT SET"} + configip=${configip:-"0.0.0.0"} + fi +} + +fn_info_game_mcb() { + # Config + if [ ! -f "${servercfgfullpath}" ]; then + servername="${unavailable}" + maxplayers="${zero}" + port="${zero}" + portipv6="${zero}" + queryport="${zero}" + gamemode="${unavailable}" + gameworld="${unavailable}" + else + servername=$(grep "server-name" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/server-name//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + maxplayers=$(grep "max-players" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') + port=$(grep "server-port\b" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') + portipv6=$(grep "server-portv6\b" "${servercfgfullpath}" | sed 's/v6//g' | grep -v "#" | tr -cd '[:digit:]') + queryport=${port} + gamemode=$(grep "gamemode" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/gamemode//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + gameworld=$(grep "level-name" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/level-name//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + + # Not set + servername=${servername:-"NOT SET"} + maxplayers=${maxplayers:-"0"} + port=${port:-"NOT SET"} + portipv6=${portipv6:-"NOT SET"} + queryport=${queryport:-"NOT SET"} + gamemode=${gamemode:-"NOT SET"} + gameworld=${gameworld:-"NOT SET"} + fi +} + +fn_info_game_mh() { + # Config + if [ ! -f "${servercfgfullpath}" ]; then + servername="${unavailable}" + serverpassword="${unavailable}" + rconpassword="${unavailable}" + maxplayers="${unavailable}" + else + servername=$(grep "ServerName" "${servercfgfullpath}" | awk -F '=' '{print $2}') + serverpassword=$(grep "ServerPassword" "${servercfgfullpath}" | awk -F '=' '{print $2}') + rconpassword=$(grep "AdminPassword" "${servercfgfullpath}" | awk -F '=' '{print $2}') + maxplayers=$(grep "MaxSlots" "${servercfgfullpath}" | awk -F '=' '{print $2}') + + # Not set + servername=${servername:-"NOT SET"} + serverpassword=${serverpassword:-"NOT SET"} + rconpassword=${rconpassword:-"NOT SET"} + maxplayers=${maxplayers:-"0"} + fi + + # Parameters + port=${port:-"0"} + queryport=${queryport:-"0"} + beaconport=${beaconport:-"0"} +} + +fn_info_game_mohaa() { + # Config + if [ ! -f "${servercfgfullpath}" ]; then + rconpassword="${unavailable}" + servername="${unavailable}" + serverpassword="${unavailable}" + maxplayers="${zero}" + else + rconpassword=$(grep "rconpassword" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/seta rconpassword//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + servername=$(grep "sv_hostname" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/seta sv_hostname//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + serverpassword=$(grep "g_password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/seta g_password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + maxplayers=$(grep "sv_maxclients" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') + + # Not set + rconpassword=${rconpassword:-"NOT SET"} + servername=${servername:-"NOT SET"} + serverpassword=${serverpassword:-"NOT SET"} + maxplayers=${maxplayers:-"0"} + fi + + # Parameters + port=${port:-"0"} + queryport=${port:-"0"} + defaultmap=${defaultmap:-"NOT SET"} +} + +fn_info_game_mom() { + # Config + if [ ! -f "${servercfgfullpath}" ]; then + servername="${unavailable}" + serverpassword="${unavailable}" + 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]*$//') + serverpassword=$(grep "ServerPassword" "${servercfgfullpath}" | sed -e 's/^ *//g' -e '/^--/d' -e 's/ServerPassword//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + maxplayers=$(grep "MaxPlayers" "${servercfgfullpath}" | sed -e 's/^ *//g' -e '/^--/d' -e 's/MaxPlayers//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + defaultmap=$(grep "MapName" "${servercfgfullpath}" | sed -e 's/^ *//g' -e '/^--/d' -e 's/MapName//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + + # Not set + servername=${servername:-"NOT SET"} + serverpassword=${serverpassword:-"NOT SET"} + maxplayers=${maxplayers:-"0"} + defaultmap=${defaultmap:-"NOT SET"} + fi + + # Parameters + port=${port:-"7777"} + beaconport=${queryport:-"15000"} +} + +fn_info_game_mta() { + # Config + if [ ! -f "${servercfgfullpath}" ]; then + port=${zero} + queryport=${zero} + httpport=${zero} + ase="${unavailable}" + servername="${unavailable}" + serverpassword="${unavailable}" + maxplayers="${zero}" + else + port=$(grep -m 1 "serverport" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's///g' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//' | cut -f1 -d "<" | tr -cd '[:digit:]') + 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 "<") + maxplayers=$(grep -m 1 "maxplayers" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's///g' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//' | cut -f1 -d "<" | tr -cd '[:digit:]') + ase=$(grep -m 1 "ase" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's///g' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//' | cut -f1 -d "<" | tr -cd '[:digit:]') + if [ "${ase}" == "1" ]; then + ase="Enabled" + else + ase="Disabled" + fi + + # Not set + port=${port:-"22003"} + queryport=${queryport:-"2326"} + httpport=${httpport:-"22005"} + ase=${ase:-"Disabled"} + servername=${servername:-"NOT SET"} + serverpassword=${serverpassword:-"NOT SET"} + maxplayers=${maxplayers:-"0"} + 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 + servername="${unavailable}" + maxplayers="${zero}" + port="${zero}" + 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]*$//') + maxplayers=$(grep "maxplayers" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') + port=$(grep "port" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') + httpport=$((port - 2)) + queryport=$((port - 1)) + + # Not set + servername=${servername:-"NOT SET"} + maxplayers=${maxplayers:-"0"} + port=${port:-"NOT SET"} + httpport=${httpport:-"NOT SET"} + queryport=${queryport:-"NOT SET"} + fi +} + +fn_info_game_pc() { + # 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:-"0"} + port=${port:-"NOT SET"} + queryport=${queryport:-"NOT SET"} + steamport=${steamport:-"NOT SET"} + 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:-"0"} + port=${port:-"NOT SET"} + queryport=${queryport:-"NOT SET"} + steamport=${steamport:-"NOT SET"} + fi +} + +fn_info_game_pstbs() { + # Config + if [ ! -f "${servercfgfullpath}" ]; then + servername="${unavailable}" + maxplayers="${unavailable}" + reservedslots="${unavailable}" + else + servername=$(grep "ServerName=" "${servercfgfullpath}" | sed -e 's/^[ \t]//g' -e '/^#/d' -e 's/ServerName//g' | tr -d '=";,:' | sed -e 's/^[ \t]//' -e 's/[ \t]*$//') + maxplayers=$(grep "MaxPlayers=" "${servercfgfullpath}" | tr -cd '[:digit:]') + reservedslots=$(grep "NumReservedSlots=" "${servercfgfullpath}" | tr -cd '[:digit:]') + + # Not set + servername=${servername:-"NOT SET"} + maxplayers=${maxplayers:-"0"} + reservedslots=${reservedslots:-"0"} + fi + + if [ ! -f "${servercfgdir}/Rcon.cfg" ]; then + rconport=${unavailable} + rconpassword=${unavailable} + else + rconport=$(grep "Port=" "${servercfgdir}/Rcon.cfg" | tr -cd '[:digit:]') + rconpassword=$(grep "Password=" "${servercfgdir}/Rcon.cfg" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/Password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + + # Not set + rconport=${rconport:-"0"} + if [ -z "${rconpassword}" ] || [ ${#rconpassword} == 1 ]; then + rconpassword="NOT SET" + fi + fi + + # Parameters + port=${port:-"0"} + if [ -z "${queryport}" ]; then + queryport=${port:-"0"} + fi + rconport=${rconport:-"0"} + randommap=${randommap:-"NOT SET"} + maxplayers=${maxplayers:-"0"} + reservedslots=${reservedslots:-"0"} +} + +fn_info_game_pvr() { + # Config + if [ ! -f "${servercfgfullpath}" ]; then + servername="${unavailable}" + maxplayers="${unavailable}" + else + servername=$(grep "ServerName" "${servercfgfullpath}" | awk -F '=' '{print $2}') + maxplayers=$(grep "MaxPlayers" "${servercfgfullpath}" | awk -F '=' '{print $2}') + + # Not set + servername=${servername:-"NOT SET"} + maxplayers=${maxplayers:-"0"} + fi + + # Parameters + port=${port:-"0"} + port401=$((port + 400)) + queryport=${port:-"0"} +} + +fn_info_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 + servername="${unavailable}" + serverpassword="${unavailable}" + rconpassword="${unavailable}" + maxplayers="${zero}" + port="${zero}" + queryport="${zero}" + gameworld="${unavailable}" + else + servername=$(grep "PublicName" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/PublicName//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + serverpassword=$(grep "Password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' | grep "^Password" | sed -e '/^#/d' -e 's/Password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + rconpassword=$(grep "RCONPassword" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/RCONPassword//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + maxplayers=$(grep "MaxPlayers" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') + port=$(grep "DefaultPort" "${servercfgfullpath}" | tr -cd '[:digit:]') + queryport=${port} + gameworld=$(grep "Map" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' | grep "^Map" | sed -e '/^#/d' -e 's/Map//g' | tr -d '=\";' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + + # Not set + servername=${servername:-"NOT SET"} + serverpassword=${serverpassword:-"NOT SET"} + rconpassword=${rconpassword:-"NOT SET"} + maxplayers=${maxplayers:-"0"} + port=${port:-"0"} + queryport=${queryport:-"0"} + gameworld=${gameworld:-"NOT SET"} + fi + + # Parameters + adminpassword=${adminpassword:-"NOT SET"} + +} + +fn_info_game_q2() { + # Config + if [ ! -f "${servercfgfullpath}" ]; then + rconpassword="${unavailable}" + servername="${unavailable}" + maxplayers="${zero}" + else + rconpassword=$(grep "rcon_password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set rcon_password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + servername=$(grep "hostname" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set hostname//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + maxplayers=$(grep "maxclients" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') + + # Not set + rconpassword=${rconpassword:-"NOT SET"} + servername=${servername:-"NOT SET"} + maxplayers=${maxplayers:-"0"} + fi + + # Parameters + port=${port:-"0"} + queryport=${port} + defaultmap=${defaultmap:-"NOT SET"} +} + +fn_info_game_q3() { + # Config + if [ ! -f "${servercfgfullpath}" ]; then + rconpassword="${unavailable}" + servername="${unavailable}" + serverpassword="${unavailable}" + maxplayers="${zero}" + else + rconpassword=$(grep "zmq_rcon_password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set zmq_rcon_password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + servername=$(grep "sv_hostname" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set sv_hostname//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + serverpassword=$(grep "rconpassword" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set rconpassword//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + maxplayers=$(grep "sv_maxclients" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') + + # Not set + rconpassword=${rconpassword:-"NOT SET"} + servername=${servername:-"NOT SET"} + serverpassword=${serverpassword:-"NOT SET"} + maxplayers=${maxplayers:-"0"} + fi + + # Parameters + port=${port:-"0"} + queryport=${port} + defaultmap=${defaultmap:-"NOT SET"} +} + +fn_info_game_ql() { + # Config + if [ ! -f "${servercfgfullpath}" ]; then + rconpassword="${unavailable}" + servername="${unavailable}" + serverpassword="${unavailable}" + maxplayers="${zero}" + port="${zero}" + queryport="${zero}" + rconport="${zero}" + statsport="${zero}" + else + rconpassword=$(grep "zmq_rcon_password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set zmq_rcon_password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + servername=$(grep "sv_hostname" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set sv_hostname//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + serverpassword=$(grep "g_password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set g_password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + maxplayers=$(grep "sv_maxClients" "${servercfgfullpath}" | grep -v "//" | tr -cd '[:digit:]') + port=$(grep "net_port" "${servercfgfullpath}" | grep -v "//" | tr -cd '[:digit:]') + queryport=${port} + rconport=$(grep "zmq_rcon_port" "${servercfgfullpath}" | grep -v "//" | tr -cd '[:digit:]') + statsport=$(grep "zmq_stats_port" "${servercfgfullpath}" | grep -v "//" | tr -cd '[:digit:]') + configip=$(grep "set net_ip" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set net_ip//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + + # Not set + rconpassword=${rconpassword:-"NOT SET"} + servername=${servername:-"NOT SET"} + serverpassword=${serverpassword:-"NOT SET"} + maxplayers=${maxplayers:-"0"} + port=${port:-"0"} + queryport=${queryport:-"0"} + rconport=${rconport:-"0"} + statsport=${statsport:-"0"} + configip=${configip:-"0.0.0.0"} + fi +} + +fn_info_game_qw() { + # Config + if [ ! -f "${servercfgfullpath}" ]; then + rconpassword="${unavailable}" + servername="${unavailable}" + serverpassword="${unavailable}" + maxplayers="${zero}" + port="${zero}" + else + rconpassword=$(grep "rcon_password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set rcon_password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//' | cut -f1 -d "/") + servername=$(grep "hostname" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set hostname//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//' | cut -f1 -d "/") + maxplayers=$(grep "maxclients" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') + + # Not set + rconpassword=${rconpassword:-"NOT SET"} + servername=${servername:-"NOT SET"} + maxplayers=${maxplayers:-"0"} + fi + + # Parameters + port=${port:-"0"} + queryport=${port} +} + +fn_info_game_ro() { + # Config + if [ ! -f "${servercfgfullpath}" ]; then + servername="${unavailable}" + serverpassword="${unavailable}" + adminpassword="${unavailable}" + port="${zero}" + queryport="${zero}" + steamport="${zero}" + steammasterport="${zero}" + lanport="${zero}" + httpport="${zero}" + webadminenabled="${unavailable}" + webadminuser="${unavailable}" + webadminpass="${unavailable}" + else + servername=$(sed -nr 's/^ServerName=(.*)$/\1/p' "${servercfgfullpath}" | tr -d '=\";,:' | sed 's/\r$//') + serverpassword=$(sed -nr 's/^GamePassword=(.*)$/\1/p' "${servercfgfullpath}" | tr -d '=\";,:' | sed 's/\r$//') + adminpassword=$(sed -nr 's/^AdminPassword=(.*)$/\1/p' "${servercfgfullpath}" | tr -d '=\";,:' | sed 's/\r$//') + port=$(sed -nr 's/^Port=(.*)$/\1/p' "${servercfgfullpath}" | tr -cd '[:digit:]') + queryport=$((port + 1)) + steamport="20610" + steammasterport="28902" + lanport=$(grep "LANServerPort=" "${servercfgfullpath}" | tr -cd '[:digit:]') + httpport=$(sed -nr 's/^ListenPort=(.*)$/\1/p' "${servercfgfullpath}" | tr -cd '[:digit:]') + webadminenabled=$(sed -nr 's/^bEnabled=(.*)$/\1/p' "${servercfgfullpath}" | tr -d '=\";,:' | sed 's/\r$//') + webadminuser=$(sed -nr 's/^AdminName=(.*)$/\1/p' "${servercfgfullpath}" | tr -d '=\";,:' | sed 's/\r$//') + webadminpass="${adminpassword}" + + # Not set + servername=${servername:-"NOT SET"} + serverpassword=${serverpassword:-"NOT SET"} + adminpassword=${adminpassword:-"NOT SET"} + port=${port:-"0"} + queryport=${queryport:-"0"} + steamport=${steamport:-"0"} + steammasterport=${steammasterport:-"0"} + lanport=${lanport:-"0"} + httpport=${httpport:-"0"} + webadminenabled=${webadminenabled:-"NOT SET"} + webadminuser=${webadminuser:-"NOT SET"} + webadminpass=${webadminpass:-"NOT SET"} + fi + + # Parameters + defaultmap=${defaultmap:-"NOT SET"} +} + +fn_info_game_rtcw() { + # Config + if [ ! -f "${servercfgfullpath}" ]; then + rconpassword="${unavailable}" + servername="${unavailable}" + serverpassword="${unavailable}" + maxplayers="${zero}" + else + rconpassword=$(grep "rconpassword" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set rconpassword//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + servername=$(grep "sv_hostname" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set sv_hostname//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + serverpassword=$(grep "g_password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set g_password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + maxplayers=$(grep "sv_maxclients" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') + + # Not set + rconpassword=${rconpassword:-"NOT SET"} + servername=${servername:-"NOT SET"} + serverpassword=${serverpassword:-"NOT SET"} + maxplayers=${maxplayers:-"0"} + fi + + # Parameters + port=${port:-"0"} + queryport=${port:-"0"} + defaultmap=${defaultmap:-"NOT SET"} +} + +fn_info_game_rust() { + # Parameters + servername=${servername:-"NOT SET"} + port=${port:-"0"} + queryport=${queryport:-"0"} + appport=${appport:-"0"} + rconport=${rconport:-"0"} + gamemode=${gamemode:-"NOT SET"} + maxplayers=${maxplayers:-"0"} + rconpassword=${rconpassword:-"NOT SET"} + rconweb=${rconweb:-"NOT SET"} + tickrate=${tickrate:-"0"} + saveinterval=${saveinterval:-"0"} + serverlevel=${serverlevel:-"NOT SET"} + customlevelurl=${customlevelurl:-"NOT SET"} + worldsize=${worldsize:-"0"} + if [ -n "${seed}" ]; then + seed=${seed:-"0"} + elif [ -f "${datadir}/${selfname}-seed.txt" ]; then + seed=$(cat "${datadir}/${selfname}-seed.txt") + else + seed="0" + fi + salt=${salt:-"0"} +} + +fn_info_game_rw() { + # Config + if [ ! -f "${servercfgfullpath}" ]; then + servername="${unavailable}" + serverpassword="${unavailable}" + rconpassword="${unavailable}" + rconport="${zero}" + maxplayers="${zero}" + port="${zero}" + port2="${zero}" + port3="${zero}" + port4="${zero}" + queryport="${zero}" + gamemode="${unavailable}" + gameworld="${unavailable}" + else + servername=$(grep "server_name" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/server_name//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + serverpassword=$(grep "server_password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/server_password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + rconpassword=$(grep "rcon_password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/rcon_password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + rconport=$(grep "rcon_port" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') + maxplayers=$(grep "settings_max_players" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') + port=$(grep "server_port" "${servercfgfullpath}" | grep -v "database_mysql_server_port" | grep -v "#" | tr -cd '[:digit:]') + 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]*$//') + 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]*$//') + + # Not set + servername=${servername:-"NOT SET"} + serverpassword=${serverpassword:-"NOT SET"} + rconpassword=${rconpassword:-"NOT SET"} + rconport=${rconport:-"NOT SET"} + maxplayers=${maxplayers:-"0"} + port=${port:-"0"} + port2=${port2:-"0"} + port3=${port3:-"0"} + port4=${port4:-"0"} + queryport=${queryport:-"0"} + httpqueryport=${httpport:-"0"} + gamemode=${gamemode:-"NOT SET"} + gameworld=${gameworld:-"NOT SET"} + configip=${configip:-"0.0.0.0"} + fi +} + +fn_info_game_samp() { + # Config + if [ ! -f "${servercfgfullpath}" ]; then + servername="unnamed server" + rconpassword="${unavailable}" + port="7777" + rconport="${port}" + maxplayers="50" + else + servername=$(grep "hostname" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/hostname//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + rconpassword=$(grep "rcon_password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/^rcon_password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + port=$(grep "port" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') + queryport=${port} + rconport=${port} + maxplayers=$(grep "maxplayers" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') + + # Not set + servername=${servername:-"NOT SET"} + rconpassword=${rconpassword:-"NOT SET"} + port=${port:-"7777"} + queryport=${port:-"7777"} + rconport=${rconport:-"7777"} + maxplayers=${maxplayers:-"12"} + fi +} + +fn_info_game_sb() { + # Config + if [ ! -f "${servercfgfullpath}" ]; then + servername="${unavailable}" + queryenabled="${unavailable}" + rconenabled="${unavailable}" + rconpassword="${unavailable}" + port="21025" + queryport="21025" + rconport="21026" + maxplayers="8" + else + servername=$(grep "serverName" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e 's/serverName//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + queryenabled=$(grep "runQueryServer" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e 's/runQueryServer//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + rconenabled=$(grep "runRconServer" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e 's/runRconServer//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + rconpassword=$(grep "rconServerPassword" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e 's/rconServerPassword//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + port=$(grep "gameServerPort" "${servercfgfullpath}" | tr -cd '[:digit:]') + queryport=$(grep "queryServerPort" "${servercfgfullpath}" | tr -cd '[:digit:]') + rconport=$(grep "rconServerPort" "${servercfgfullpath}" | tr -cd '[:digit:]') + maxplayers=$(grep "maxPlayers" "${servercfgfullpath}" | tr -cd '[:digit:]') + + # Not set + servername=${servername:-"NOT SET"} + queryenabled=${queryenabled:-"NOT SET"} + rconenabled=${rconenabled:-"NOT SET"} + rconpassword=${rconpassword:-"NOT SET"} + port=${port:-"21025"} + queryport=${queryport:-"21025"} + rconport=${rconport:-"21026"} + maxplayers=${maxplayers:-"8"} + fi +} + +fn_info_game_sbots() { + # Config + if [ ! -f "${servercfgfullpath}" ]; then + servername="${unavailable}" + maxplayers="${unavailable}" + else + servername=$(grep "ServerName=" "${servercfgfullpath}" | sed -e 's/^[ \t]//g' -e '/^#/d' -e 's/ServerName//g' | tr -d '=";,:' | sed -e 's/^[ \t]//' -e 's/[ \t]*$//') + maxplayers=$(grep "MaxPlayers=" "${servercfgfullpath}" | tr -cd '[:digit:]') + + # Not set + servername=${servername:-"NOT SET"} + maxplayers=${maxplayers:-"0"} + fi + + # Parameters + port=${port:-"0"} + queryport=${queryport:-"0"} + servername=${servername:-"NOT SET"} + serverpassword=${serverpassword:-"NOT SET"} + defaultmap=${defaultmap:-"NOT SET"} + maxplayers=${maxplayers:-"0"} +} + +fn_info_game_scpsl() { + # Config + 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 + port=${port:-"0"} + queryport=${port} +} + +fn_info_game_sdtd() { + # Config + if [ ! -f "${servercfgfullpath}" ]; then + servername="${unavailable}" + serverpassword="${unavailable}" + port="${zero}" + port3="${zero}" + queryport="${zero}" + webadminenabled="${unavailable}" + webadminport="${zero}" + webadminpass="${unavailable}" + telnetenabled="${unavailable}" + telnetport="${zero}" + telnetpass="${unavailable}" + telnetip="${unavailable}" + maxplayers="${unavailable}" + gamemode="${unavailable}" + gameworld="${unavailable}" + else + servername=$(grep "ServerName" "${servercfgfullpath}" | sed 's/^.*value="//' | cut -f1 -d"\"") + serverpassword=$(grep "ServerPassword" "${servercfgfullpath}" | sed 's/^.*value="//' | cut -f1 -d"\"") + port=$(grep "ServerPort" "${servercfgfullpath}" | grep -Eo 'value="[0-9]+"' | tr -cd '[:digit:]') + port3=$((port + 2)) + queryport=${port:-"0"} + webadminenabled=$(grep "ControlPanelEnabled" "${servercfgfullpath}" | sed 's/^.*value="//' | cut -f1 -d"\"") + webadminport=$(grep "ControlPanelPort" "${servercfgfullpath}" | tr -cd '[:digit:]') + webadminpass=$(grep "ControlPanelPassword" "${servercfgfullpath}" | sed 's/^.*value="//' | cut -f1 -d"\"") + telnetenabled=$(grep "TelnetEnabled" "${servercfgfullpath}" | sed 's/^.*value="//' | cut -f1 -d"\"") + telnetport=$(grep "TelnetPort" "${servercfgfullpath}" | tr -cd '[:digit:]') + telnetpass=$(grep "TelnetPassword" "${servercfgfullpath}" | sed 's/^.*value="//' | cut -f1 -d"\"") + # Telnet IP will be localhost if no password is set + # check_ip will set the IP first. This will overwrite it. + if [ -z "${telnetpass}" ]; then + telnetip="127.0.0.1" + fi + maxplayers=$(grep "ServerMaxPlayerCount" "${servercfgfullpath}" | tr -cd '[:digit:]') + gamemode=$(grep "GameMode" "${servercfgfullpath}" | sed 's/^.*value="//' | cut -f1 -d"\"") + gameworld=$(grep "GameWorld" "${servercfgfullpath}" | sed 's/^.*value="//' | cut -f1 -d"\"") + + # Not set + servername=${servername:-"NOT SET"} + serverpassword=${serverpassword:-"NOT SET"} + port=${port:-"0"} + queryport=${queryport:-"0"} + webadminenabled=${webadminenabled:-"NOT SET"} + webadminport=${webadminport:-"0"} + webadminpass=${webadminpass:-"NOT SET"} + telnetenabled=${telnetenabled:-"NOT SET"} + telnetport=${telnetport:-"0"} + telnetpass=${telnetpass:-"NOT SET"} + maxplayers=${maxplayers:-"0"} + gamemode=${gamemode:-"NOT SET"} + gameworld=${gameworld:-"NOT SET"} + fi +} + +fn_info_game_sf() { + # Parameters + servername=${selfname:-"NOT SET"} + port=${port:-"0"} + queryport=${queryport:-"0"} + beaconport=${beaconport:-"0"} +} + +fn_info_game_sof2() { + # Config + if [ ! -f "${servercfgfullpath}" ]; then + rconpassword="${unavailable}" + servername="${unavailable}" + serverpassword="${unavailable}" + maxplayers="${zero}" + else + rconpassword=$(grep "rconpassword" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set rconpassword//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + servername=$(grep "sv_hostname" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set sv_hostname//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + serverpassword=$(grep "g_password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set g_password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + maxplayers=$(grep "sv_maxclients" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') + + # Not set + rconpassword=${rconpassword:-"NOT SET"} + servername=${servername:-"NOT SET"} + serverpassword=${serverpassword:-"NOT SET"} + maxplayers=${maxplayers:-"0"} + fi + + # Parameters + port=${port:-"0"} + queryport=${port} + defaultmap=${defaultmap:-"NOT SET"} +} + +fn_info_game_sol() { + # Config + if [ ! -f "${servercfgfullpath}" ]; then + adminpassword="${unavailable}" + maxplayers="${unavailable}" + port="${zero}" + queryport="${zero}" + servername="${unavailable}" + serverpassword="${unavailable}" + else + adminpassword=$(grep "Admin_Password=" "${servercfgfullpath}" | awk -F '=' '{print $2}') + maxplayers=$(grep "Max_Players=" "${servercfgfullpath}" | tr -cd '[:digit:]') + port=$(grep "Port=" "${servercfgfullpath}" | tr -cd '[:digit:]') + queryport="${port}" + filesport=$((port + 10)) + servername=$(grep "Server_Name=" "${servercfgfullpath}" | awk -F '=' '{print $2}') + serverpassword=$(grep "Game_Password=" "${servercfgfullpath}" | awk -F '=' '{print $2}') + + # Not set + adminpassword=${adminpassword:-"NOT SET"} + maxplayers=${maxplayers:-"0"} + port=${port:-"23073"} + queryport=${queryport:-"23083"} + servername=${servername:-"NOT SET"} + serverpassword=${serverpassword:-"NOT SET"} + fi +} + +fn_info_game_source() { + # Config + if [ ! -f "${servercfgfullpath}" ]; then + servername="${unavailable}" + serverpassword="${unavailable}" + rconpassword="${unavailable}" + else + servername=$(grep "hostname" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/hostname//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + serverpassword=$(grep "sv_password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/sv_password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + rconpassword=$(grep "rcon_password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/rcon_password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + + # Not set + servername=${servername:-"NOT SET"} + serverpassword=${serverpassword:-"NOT SET"} + rconpassword=${rconpassword:-"NOT SET"} + fi + + # Parameters + defaultmap=${defaultmap:-"NOT SET"} + maxplayers=${maxplayers:-"0"} + port=${port:-"0"} + rconport=${port:-"0"} + queryport=${port:-"0"} + clientport=${clientport:-"0"} + # Steamport can be between 26901-26910 and is normaly automatically set. + # Some servers might support -steamport parameter to set + if [ "${steamport}" == "0" ] || [ -v "${steamport}" ]; then + steamport="$(echo "${ssinfo}" | grep "${srcdslinuxpid}" | awk '{print $5}' | grep ":269" | cut -d ":" -f2)" + fi +} + +fn_info_game_spark() { + defaultmap=${defaultmap:-"NOT SET"} + maxplayers=${maxplayers:-"0"} + port=${port:-"0"} + queryport=$((port + 1)) + servername=${servername:-"NOT SET"} + serverpassword=${serverpassword:-"NOT SET"} + webadminuser=${webadminuser:-"NOT SET"} + webadminpass=${webadminpass:-"NOT SET"} + webadminport=${webadminport:-"0"} + # Commented out as displaying not set in details parameters + #mods=${mods:-"NOT SET"} +} + +fn_info_game_squad() { + # Config + if [ ! -f "${servercfgfullpath}" ]; then + servername="${unavailable}" + maxplayers="${unavailable}" + else + servername=$(grep "ServerName=" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/ServerName//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + maxplayers=$(grep "MaxPlayers=" "${servercfgfullpath}" | tr -cd '[:digit:]') + + servername=${servername:-"NOT SET"} + maxplayers=${maxplayers:-"0"} + fi + + if [ ! -f "${servercfgdir}/Rcon.cfg" ]; then + rconport=${unavailable} + rconpassword=${unavailable} + else + rconport=$(grep "Port=" "${servercfgdir}/Rcon.cfg" | tr -cd '[:digit:]') + rconpassword=$(grep "Password=" "${servercfgdir}/Rcon.cfg" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/Password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + + rconport=${rconport:-"0"} + if [ -z "${rconpassword}" ] || [ ${#rconpassword} == 1 ]; then + rconpassword="NOT SET" + fi + + fi + + # Parameters + port=${port:-"0"} + queryport=${queryport:-"0"} +} + +fn_info_game_st() { + # Config + if [ ! -f "${servercfgfullpath}" ]; then + servername="${unavailable}" + serverpassword="${unavailable}" + rconpassword="${unavailable}" + maxplayers="${unavailable}" + else + servername=$(grep "SERVERNAME" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/SERVERNAME//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + serverpassword=$(grep "PASSWORD" "${servercfgfullpath}" | grep "^PASSWORD" | sed -e 's/^[ \t]*//g' -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 "MAXPLAYER" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/MAXPLAYER//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + + # Not set + servername=${servername:-"NOT SET"} + serverpassword=${serverpassword:-"NOT SET"} + rconpassword=${rconpassword:-"NOT SET"} + maxplayers=${maxplayers:-"0"} + fi + + # Parameters + port=${port:-"0"} + queryport=${queryport:-"0"} + httpport=${port:-"0"} + worldtype=${worldtype:-"NOT SET"} + autosaveinterval=${autosaveinterval:-"0"} + clearinterval=${clearinterval:-"0"} + worldname=${worldname:-"NOT SET"} +} + +fn_info_game_terraria() { + # Config + if [ ! -f "${servercfgfullpath}" ]; then + servername="${unavailable}" + port="${zero}" + gameworld="${unavailable}" + maxplayers="${zero}" + queryport="${zero}" + else + servername=$(grep "worldname" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/worldname//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + port=$(grep "port" "${servercfgfullpath}" | tr -cd '[:digit:]') + queryport=${port:-"0"} + gameworld=$(grep "world=" "${servercfgfullpath}" | grep -v "//" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/world=//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + maxplayers=$(grep "maxplayers" "${servercfgfullpath}" | grep -v "//" | tr -cd '[:digit:]') + + # Not set + servername=${servername:-"NOT SET"} + port=${port:-"0"} + queryport=${queryport:-"0"} + gameworld=${gameworld:-"NOT SET"} + maxplayers=${maxplayers:-"0"} + fi +} + +fn_info_game_stn() { + # Config + 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}") + serverpassword=$(sed -nr 's/^ServerPassword=(.*)$/\1/p' "${servercfgfullpath}") + queryport=$((port + 1)) + + # Not set + serverpassword=${serverpassword:-"NOT SET"} + port=${port:-"0"} + serverpassword=${serverpassword:-"NOT SET"} + queryport=${queryport:-"0"} + fi +} + +fn_info_game_ti() { + 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() { + # Config + if [ ! -f "${servercfgfullpath}" ]; then + dbplugin="${unavailable}" + port="9987" + queryport="10011" + querysshport="10022" + queryhttpport="10080" + queryhttpsport="10443" + fileport="30033" + telnetport="10011" + else + dbplugin=$(grep "dbplugin=" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/dbplugin=//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + port=$(grep "default_voice_port" "${servercfgfullpath}" | tr -cd '[:digit:]') + queryport=$(grep "query_port" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') + querysshport=$(grep "query_ssh_port" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') + queryhttpport=$(grep "query_http_port" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') + queryhttpsport=$(grep "query_https_port" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') + fileport=$(grep "filetransfer_port" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') + telnetport="${queryport}" + configip=$(grep "voice_ip" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/voice_ip//g' | sed 's/,.*//' | tr -d '=\";,' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + + # Not set + dbplugin=${dbplugin:-"NOT SET"} + port=${port:-"9987"} + queryport=${queryport:-"10011"} + querysshport=${querysshport:-"10022"} + queryhttpport=${queryhttpport:-"10080"} + queryhttpsport=${queryhttpsport:-"10443"} + fileport=${fileport:-"30033"} + telnetport=${telnetport:-"10011"} + configip=${configip:-"0.0.0.0"} + fi +} + +fn_info_game_tu() { + # Config + if [ ! -f "${servercfgfullpath}" ]; then + servername="${unavailable}" + maxplayers="${zero}" + else + servername=$(grep "ServerTitle" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^--/d' -e 's/ServerTitle//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + maxplayers=$(grep "MaxPlayers" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') + + # Not set + servername=${servername:-"NOT SET"} + maxplayers=${maxplayers:-"0"} + fi + + # Parameters + port=${port:-"0"} + steamport=$((port + 1)) + queryport=${queryport:-"0"} +} + +fn_info_game_tw() { + # Config + if [ ! -f "${servercfgfullpath}" ]; then + servername="unnamed server" + serverpassword="${unavailable}" + rconpassword="${unavailable}" + port="8303" + queryport="8303" + maxplayers="12" + else + servername=$(grep "sv_name" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/^sv_name//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + serverpassword=$(grep "password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' | grep "^password" | sed -e '/^#/d' -e 's/^password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + rconpassword=$(grep "sv_rcon_password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/^sv_rcon_password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + port=$(grep "sv_port" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') + queryport="${port}" + maxplayers=$(grep "sv_max_clients" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') + + # Not set + servername=${servername:-"NOT SET"} + serverpassword=${serverpassword:-"NOT SET"} + rconpassword=${rconpassword:-"NOT SET"} + port=${port:-"8303"} + queryport=${port:-"8303"} + maxplayers=${maxplayers:-"12"} + fi +} + +fn_info_game_ut99() { + # Config + if [ ! -f "${servercfgfullpath}" ]; then + servername="${unavailable}" + serverpassword="${unavailable}" + adminpassword="${unavailable}" + port="${zero}" + queryport="${zero}" + queryportgs="${zero}" + webadminenabled="${unavailable}" + webadminport="${zero}" + webadminuser="${unavailable}" + webadminpass="${unavailable}" + else + servername=$(grep "ServerName" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/ServerName//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//' | sed 's/\r$//') + serverpassword=$(grep "GamePassword" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/GamePassword//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//' | sed 's/\r$//') + adminpassword=$(grep "AdminPassword" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/AdminPassword//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//' | sed 's/\r$//') + port=$(grep "Port" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' | grep "^Port" | grep -v "#" | tr -cd '[:digit:]') + queryport=$((port + 1)) + queryportgs=$(grep "OldQueryPortNumber" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') + beaconport=$(grep "ServerBeaconPort" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') + webadminenabled=$(grep "bEnabled" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/bEnabled//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//' | sed 's/\r$//') + httpport=$(grep "ListenPort" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') + webadminuser=$(grep "AdminUsername" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/AdminUsername//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//' | sed 's/\r$//') + webadminpass=$(grep "UTServerAdmin.UTServerAdmin" "${servercfgfullpath}" -A 4 | grep "AdminPassword" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/AdminPassword//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//' | sed 's/\r$//') + + # Not set + servername=${servername:-"NOT SET"} + serverpassword=${serverpassword:-"NOT SET"} + adminpassword=${adminpassword:-"NOT SET"} + port=${port:-"0"} + queryport=${queryport:-"0"} + beaconport=${beaconport:-"8777"} + queryportgs=${queryportgs:-"0"} + webadminenabled=${webadminenabled:-"NOT SET"} + webadminport=${webadminport:-"0"} + webadminuser=${webadminuser:-"NOT SET"} + webadminpass=${webadminpass:-"NOT SET"} + fi + + # Parameters + defaultmap=${defaultmap:-"NOT SET"} +} + +fn_info_game_unreal2() { + # Config + if [ ! -f "${servercfgfullpath}" ]; then + servername="${unavailable}" + serverpassword="${unavailable}" + adminpassword="${unavailable}" + port="${zero}" + queryport="${zero}" + queryportgs="${zero}" + webadminenabled="${unavailable}" + webadminport="${zero}" + webadminuser="${unavailable}" + webadminpass="${unavailable}" + else + servername=$(sed -nr 's/^ServerName=(.*)$/\1/p' "${servercfgfullpath}" | tr -d '=\";,:' | sed 's/\r$//') + serverpassword=$(sed -nr 's/^GamePassword=(.*)$/\1/p' "${servercfgfullpath}" | tr -d '=\";,:' | sed 's/\r$//') + adminpassword=$(sed -nr 's/^AdminPassword=(.*)$/\1/p' "${servercfgfullpath}" | tr -d '=\";,:' | sed 's/\r$//') + port=$(sed -nr 's/^Port=(.*)$/\1/p' "${servercfgfullpath}" | tr -cd '[:digit:]') + queryport=$((port + 1)) + queryportgs=$(sed -nr 's/^OldQueryPortNumber=(.*)$/\1/p' "${servercfgfullpath}" | tr -cd '[:digit:]') + webadminenabled=$(sed -nr 's/^bEnabled=(.*)$/\1/p' "${servercfgfullpath}" | tr -d '=\";,:' | sed 's/\r$//') + webadminport=$(sed -nr 's/^ListenPort=(.*)$/\1/p' "${servercfgfullpath}" | tr -cd '[:digit:]') + webadminuser=$(sed -nr 's/^AdminName=(.*)$/\1/p' "${servercfgfullpath}" | tr -d '=\";,:' | sed 's/\r$//') + webadminpass="${adminpassword}" + + # Not set + servername=${servername:-"NOT SET"} + serverpassword=${serverpassword:-"NOT SET"} + adminpassword=${adminpassword:-"NOT SET"} + port=${port:-"0"} + queryport=${queryport:-"0"} + queryportgs=${queryportgs:-"0"} + webadminenabled=${webadminenabled:-"NOT SET"} + webadminport=${webadminport:-"0"} + webadminuser=${webadminuser:-"NOT SET"} + webadminpass=${webadminpass:-"NOT SET"} + fi + + # Parameters + defaultmap=${defaultmap:-"NOT SET"} +} + +fn_info_game_unt() { + # Parameters + servername=${selfname:-"NOT SET"} + port=${port:-"0"} + queryport=${port} + steamport=$((port + 1)) +} + +fn_info_game_ut() { + # Config + if [ ! -f "${servercfgfullpath}" ]; then + servername="${unavailable}" + else + servername=$(grep "ServerName" "${servercfgfullpath}" | awk -F '=' '{print $2}') + + # Not set + servername=${servername:-"NOT SET"} + fi + + # Parameters + port=${port:-"0"} + queryport=$((port + 1)) +} + +fn_info_game_unreal2k4() { + # Config + if [ ! -f "${servercfgfullpath}" ]; then + servername="${unavailable}" + serverpassword="${unavailable}" + adminpassword="${unavailable}" + port="${zero}" + queryport="${zero}" + queryportgs="${zero}" + lanport="${zero}" + webadminenabled="${unavailable}" + httpport="${zero}" + webadminuser="${unavailable}" + webadminpass="${unavailable}" + else + servername=$(sed -nr 's/^ServerName=(.*)$/\1/p' "${servercfgfullpath}" | tr -d '=\";,:' | sed 's/\r$//') + serverpassword=$(sed -nr 's/^GamePassword=(.*)$/\1/p' "${servercfgfullpath}" | tr -d '=\";,:' | sed 's/\r$//') + adminpassword=$(sed -nr 's/^AdminPassword=(.*)$/\1/p' "${servercfgfullpath}" | tr -d '=\";,:' | sed 's/\r$//') + port=$(sed -nr 's/^Port=(.*)$/\1/p' "${servercfgfullpath}" | tr -cd '[:digit:]') + queryport=$((port + 1)) + queryportgs=$(sed -nr 's/^OldQueryPortNumber=(.*)$/\1/p' "${servercfgfullpath}" | tr -cd '[:digit:]') + lanport=$(grep "LANServerPort=" "${servercfgfullpath}" | tr -cd '[:digit:]') + webadminenabled=$(sed -nr 's/^bEnabled=(.*)$/\1/p' "${servercfgfullpath}" | tr -d '=\";,:' | sed 's/\r$//') + httpport=$(sed -nr 's/^ListenPort=(.*)$/\1/p' "${servercfgfullpath}" | tr -cd '[:digit:]') + webadminuser=$(sed -nr 's/^AdminName=(.*)$/\1/p' "${servercfgfullpath}" | tr -d '=\";,:' | sed 's/\r$//') + webadminpass="${adminpassword}" + + # Not set + servername=${servername:-"NOT SET"} + serverpassword=${serverpassword:-"NOT SET"} + adminpassword=${adminpassword:-"NOT SET"} + port=${port:-"0"} + queryport=${queryport:-"0"} + queryportgs=${queryportgs:-"0"} + lanport=${lanport:-"0"} + webadminenabled=${webadminenabled:-"NOT SET"} + httpport=${httpport:-"0"} + webadminuser=${webadminuser:-"NOT SET"} + webadminpass=${webadminpass:-"NOT SET"} + fi +} + +fn_info_game_ut3() { + # Config + if [ ! -f "${servercfgfullpath}" ]; then + servername="${unavailable}" + serverpassword="${unavailable}" + adminpassword="${unavailable}" + maxplayers="${unavailable}" + webadminenabled="${unavailable}" + webadminport="${zero}" + webadminuser="${unavailable}" + webadminpass="${unavailable}" + else + servername=$(grep "ServerName" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/ServerName//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + serverpassword=$(grep "GamePassword" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/GamePassword//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + adminpassword=$(grep "AdminPassword" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/AdminPassword//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + maxplayers=$(grep "MaxPlayers" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') + webadminenabled=$(grep "bEnabled" "${servercfgdir}/UTWeb.ini" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/bEnabled//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + webadminport=$(grep "ListenPort" "${servercfgdir}/UTWeb.ini" | grep -v "#" | tr -cd '[:digit:]') + webadminuser="Admin" + webadminpass=$(grep "AdminPassword" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/AdminPassword//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + + # Not set + servername=${servername:-"NOT SET"} + serverpassword=${serverpassword:-"NOT SET"} + adminpassword=${adminpassword:-"NOT SET"} + maxplayers=${maxplayers:-"0"} + webadminenabled=${webadminenabled:-"NOT SET"} + webadminport=${webadminport:-"0"} + webadminuser=${webadminuser:-"NOT SET"} + webadminpass=${webadminpass:-"NOT SET"} + fi + + # Parameters + port=${port:-"0"} + queryport=${queryport:-"0"} + defaultmap=${defaultmap:-"NOT SET"} +} + +fn_info_game_vh() { + # Parameters + port=${port:-"0"} + # Query port only enabled if public server + if [ "${public}" != "0" ]; then + queryport=$((port + 1)) + else + querymode="1" + fi + gameworld=${gameworld:-"NOT SET"} + serverpassword=${serverpassword:-"NOT SET"} + servername=${servername:-"NOT SET"} +} + +fn_info_game_vints() { + if [ ! -f "${servercfgfullpath}" ]; then + servername="${unavailable}" + maxplayers="${unavailable}" + serverpassword="${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}") + configip=$(jq -r 'select(.Ip != null) | .Ip' "${servercfgfullpath}") + fi + queryport=${port:-"0"} + serverpassword=${serverpassword:-"NOT SET"} + 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 + rconpassword="${unavailable}" + servername="${unavailable}" + serverpassword="${unavailable}" + maxplayers="${zero}" + port="${zero}" + queryport="${zero}" + else + port=$(grep "set net_port" "${servercfgfullpath}" | grep -v "//" | tr -cd '[:digit:]') + queryport="${port}" + rconpassword=$(grep "set zmq_rcon_password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set zmq_rcon_password //g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//g' -e '/^\//d' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + servername=$(grep "set sv_hostname" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set sv_hostname //g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + serverpassword=$(grep "set g_password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set g_password //g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + maxplayers=$(grep "set sv_maxclients" "${servercfgfullpath}" | grep -v "//" | tr -cd '[:digit:]') + configip=$(grep "set net_ip" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set net_ip//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + + # Not set + rconpassword=${rconpassword:-"NOT SET"} + servername=${servername:-"NOT SET"} + serverpassword=${serverpassword:-"NOT SET"} + maxplayers=${maxplayers:-"0"} + port=${port:-"27960"} + queryport=${queryport:-"27960"} + configip=${configip:-"0.0.0.0"} + fi +} + +fn_info_game_wf() { + # Config + if [ ! -f "${servercfgfullpath}" ]; then + rconpassword="${unavailable}" + servername="${unavailable}" + maxplayers="${zero}" + else + rconpassword=$(grep "rcon_password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set rcon_password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + servername=$(grep "sv_hostname" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/set sv_hostname//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + maxplayers=$(grep "sv_maxclients" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') + + # Not set + rconpassword=${rconpassword:-"NOT SET"} + servername=${servername:-"NOT SET"} + maxplayers=${maxplayers:-"0"} + fi + + # Parameters + port=${port:-"0"} + queryport="${port:-"0"}" + webadminport=${webadminport:-"0"} +} + +fn_info_game_wmc() { + if [ ! -f "${servercfgfullpath}" ]; then + servername="${unavailable}" + maxplayers="${zero}" + port="${zero}" + queryport="${zero}" + queryenabled="${unavailable}" + else + servername=$(sed -e '/^listeners:/,/^[a-z]/!d' "${servercfgfullpath}" | sed -nr 's/^[ ]+motd: (.*)$/\1/p' | tr -d "'" | sed 's/&1//') + queryport=$(sed -nr 's/^[ -]+query_port: ([0-9]+)/\1/p' "${servercfgfullpath}") + queryenabled=$(sed -nr 's/^[ ]+query_enabled: (.*)$/\1/p' "${servercfgfullpath}") + port=$(sed -nr 's/^[ ]+host: [0-9]+\.[0-9]+\.[0-9]+\.[0-9]+:([0-9]+)/\1/p' "${servercfgfullpath}") + # the normal max_players does only show in on the client side and has no effect how many players can connect. + 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 + maxplayers="UNLIMITED" + fi + + # Not set + servername=${servername:-"NOT SET"} + queryport=${queryport:-"25577"} + maxplayers=${maxplayers:-"0"} + configip=${configip:-"0.0.0.0"} + fi +} + +fn_info_game_wurm() { + # Config + if [ ! -f "${servercfgfullpath}" ]; then + port="${zero}" + queryport="${zero}" + rconpassword="${unavailable}" + servername="${unavailable}" + serverpassword="${unavailable}" + adminpassword="${unavailable}" + maxplayers="${zero}" + else + port=$(grep "EXTERNALPORT=" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') + queryport=$(grep "QUERYPORT=" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') + servername=$(grep "SERVERNAME=" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/SERVERNAME//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + serverpassword=$(grep "SERVERPASSWORD=" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/SERVERPASSWORD//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + adminpassword=$(grep "ADMINPWD=" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/ADMINPWD//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + maxplayers=$(grep "MAXPLAYERS=" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') + configip=$(grep "IP" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/IP//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + + # Not set + port=${port:-"3724"} + queryport=${queryport:-"27017"} + servername=${servername:-"NOT SET"} + serverpassword=${serverpassword:-"NOT SET"} + adminpassword=${adminpassword:-"NOT SET"} + maxplayers=${maxplayers:-"0"} + fi +} + +unavailable="${red}UNAVAILABLE${default}" +zero="${red}0${default}" + +if [ "${shortname}" == "ac" ]; then + fn_info_game_ac +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 + fn_info_game_bf1942 +elif [ "${shortname}" == "bfv" ]; then + fn_info_game_bfv +elif [ "${shortname}" == "bo" ]; then + fn_info_game_bo +elif [ "${shortname}" == "bt" ]; then + fn_info_game_bt +elif [ "${shortname}" == "btl" ]; then + fn_info_game_btl +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 + fn_info_game_cod +elif [ "${shortname}" == "coduo" ]; then + fn_info_game_cod +elif [ "${shortname}" == "cod2" ]; then + fn_info_game_cod2 +elif [ "${shortname}" == "cod4" ]; then + fn_info_game_cod4 +elif [ "${shortname}" == "codwaw" ]; then + fn_info_game_codwaw +elif [ "${shortname}" == "col" ]; then + fn_info_game_col +elif [ "${shortname}" == "dayz" ]; then + fn_info_game_dayz +elif [ "${shortname}" == "dodr" ]; then + fn_info_game_dodr +elif [ "${shortname}" == "dst" ]; then + fn_info_game_dst +elif [ "${shortname}" == "eco" ]; then + fn_info_game_eco +elif [ "${shortname}" == "etl" ]; then + fn_info_game_etl +elif [ "${shortname}" == "fctr" ]; then + fn_info_game_fctr +elif [ "${shortname}" == "hw" ]; then + fn_info_game_hw +elif [ "${shortname}" == "inss" ]; then + fn_info_game_inss +elif [ "${shortname}" == "jc2" ]; then + fn_info_game_jc2 +elif [ "${shortname}" == "jc3" ]; then + fn_info_game_jc3 +elif [ "${shortname}" == "jk2" ]; then + fn_info_game_jk2 +elif [ "${shortname}" == "kf" ]; then + fn_info_game_kf +elif [ "${shortname}" == "kf2" ]; then + fn_info_game_kf2 +elif [ "${shortname}" == "lo" ]; then + fn_info_game_lo +elif [ "${shortname}" == "mc" ] || [ "${shortname}" == "pmc" ]; then + fn_info_game_mc +elif [ "${shortname}" == "mcb" ]; then + fn_info_game_mcb +elif [ "${shortname}" == "mh" ]; then + fn_info_game_mh +elif [ "${shortname}" == "mohaa" ]; then + fn_info_game_mohaa +elif [ "${shortname}" == "mom" ]; then + fn_info_game_mom +elif [ "${shortname}" == "mta" ]; then + fn_info_game_mta +elif [ "${shortname}" == "nec" ]; then + fn_info_game_nec +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 + fn_info_game_pvr +elif [ "${shortname}" == "pz" ]; then + fn_info_game_pz +elif [ "${shortname}" == "q2" ]; then + fn_info_game_q2 +elif [ "${shortname}" == "q3" ]; then + fn_info_game_q3 +elif [ "${shortname}" == "ql" ]; then + fn_info_game_ql +elif [ "${shortname}" == "qw" ]; then + fn_info_game_qw +elif [ "${shortname}" == "ro" ]; then + fn_info_game_ro +elif [ "${shortname}" == "rtcw" ]; then + fn_info_game_rtcw +elif [ "${shortname}" == "rust" ]; then + fn_info_game_rust +elif [ "${shortname}" == "rw" ]; then + fn_info_game_rw +elif [ "${shortname}" == "samp" ]; then + fn_info_game_samp +elif [ "${shortname}" == "sb" ]; then + fn_info_game_sb +elif [ "${shortname}" == "sbots" ]; then + fn_info_game_sbots +elif [ "${shortname}" == "scpsl" ] || [ "${shortname}" == "scpslsm" ]; then + fn_info_game_scpsl +elif [ "${shortname}" == "sdtd" ]; then + fn_info_game_sdtd +elif [ "${shortname}" == "sf" ]; then + fn_info_game_sf +elif [ "${shortname}" == "sof2" ]; then + fn_info_game_sof2 +elif [ "${shortname}" == "sol" ]; then + fn_info_game_sol +elif [ "${engine}" == "spark" ]; then + fn_info_game_spark +elif [ "${shortname}" == "squad" ]; then + fn_info_game_squad +elif [ "${shortname}" == "st" ]; then + fn_info_game_st +elif [ "${shortname}" == "stn" ]; then + fn_info_game_stn +elif [ "${shortname}" == "terraria" ]; then + fn_info_game_terraria +elif [ "${shortname}" == "ti" ]; then + fn_info_game_ti +elif [ "${shortname}" == "ts3" ]; then + fn_info_game_ts3 +elif [ "${shortname}" == "tu" ]; then + fn_info_game_tu +elif [ "${shortname}" == "tw" ]; then + fn_info_game_tw +elif [ "${shortname}" == "unt" ]; then + fn_info_game_unt +elif [ "${shortname}" == "ut" ]; then + fn_info_game_ut +elif [ "${shortname}" == "ut2k4" ]; then + fn_info_game_unreal2k4 +elif [ "${shortname}" == "ut3" ]; then + fn_info_game_ut3 +elif [ "${shortname}" == "ut99" ]; then + fn_info_game_ut99 +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 + fn_info_game_wf +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 + fn_info_game_unreal2 +fi + +# External IP address +# 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=$? + # if curl passes add extip to externalip.txt + if [ "${exitcode}" != "0" ]; then + echo "Unable to get external IP address" + else + echo "${extip}" > "${tmpdir}/extip.txt" + fi +else + extip="$(cat "${tmpdir}/extip.txt")" +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 diff --git a/lgsm/functions/info_messages.sh b/lgsm/functions/info_messages.sh new file mode 100644 index 0000000000..5478987f1c --- /dev/null +++ b/lgsm/functions/info_messages.sh @@ -0,0 +1,1847 @@ +#!/bin/bash +# LinuxGSM info_messages.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Defines server info messages for details and alerts. + +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +# Separator is different for details. +fn_messages_separator() { + if [ "${commandname}" == "DETAILS" ]; then + printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' = + else + echo -e "=================================" + fi +} + +# Removes the passwords form all but details. +fn_info_message_password_strip() { + if [ "${commandname}" != "DETAILS" ]; then + if [ "${serverpassword}" ]; then + serverpassword="********" + fi + + if [ "${rconpassword}" ]; then + rconpassword="********" + fi + + if [ "${adminpassword}" ]; then + adminpassword="********" + fi + + if [ "${statspassword}" ]; then + statspassword="********" + fi + + if [ "${webadminpass}" ]; then + webadminpass="********" + fi + + if [ "${telnetpass}" ]; then + telnetpass="********" + fi + + if [ "${wsapikey}" ]; then + wsapikey="********" + fi + + if [ "${gslt}" ]; then + gslt="********" + fi + fi +} + +# Alert Summary +# used with alertlog +fn_info_message_head() { + echo -e "" + echo -e "${lightyellow}Alert Summary${default}" + fn_messages_separator + echo -e "Message" + echo -e "${alertbody}" + echo -e "" + echo -e "Game" + echo -e "${gamename}" + echo -e "" + echo -e "Server name" + echo -e "${servername}" + echo -e "" + echo -e "Hostname" + echo -e "${HOSTNAME}" + echo -e "" + echo -e "Server IP" + echo -e "${ip}:${port}" +} + +fn_info_message_distro() { + # + # Distro Details + # ================================= + # Date: Sun 21 Feb 2021 09:22:53 AM UTC + # Distro: Ubuntu 20.04.2 LTS + # Arch: x86_64 + # Kernel: 5.4.0-65-generic + # Hostname: server + # Uptime: 16d, 5h, 18m + # tmux: tmux 3.0a + # glibc: 2.31 + + echo -e "" + echo -e "${lightyellow}Distro Details${default}" + fn_messages_separator + { + echo -e "${lightblue}Date:\t${default}$(date)" + echo -e "${lightblue}Distro:\t${default}${distroname}" + echo -e "${lightblue}Arch:\t${default}${arch}" + echo -e "${lightblue}Kernel:\t${default}${kernel}" + echo -e "${lightblue}Hostname:\t${default}${HOSTNAME}" + echo -e "${lightblue}Uptime:\t${default}${days}d, ${hours}h, ${minutes}m" + echo -e "${lightblue}tmux:\t${default}${tmuxv}" + echo -e "${lightblue}glibc:\t${default}${glibcversion}" + if [ -n "${javaram}" ]; then + echo -e "${lightblue}Java:\t${default}${javaversion}" + fi + } | column -s $'\t' -t +} + +fn_info_message_server_resource() { + # + # Server Resource + # ================================= + # CPU + # Model: AMD EPYC 7601 32-Core Processor + # Cores: 2 + # Frequency: 2199.994MHz + # Avg Load: 0.01, 0.05, 0.18 + # + # Memory + # Mem: total used free cached available + # Physical: 3.9GB 350MB 3.3GB 3.2GB 3.3GB + # Swap: 512MB 55MB 458MB + # + # Storage + # Filesystem: /dev/sda + # Total: 79G + # Used: 73G + # Available: 1.4G + # + # Network + # IP: 0.0.0.0 + # Internet IP: 176.58.124.96 + + echo -e "" + echo -e "${lightyellow}Server Resource${default}" + fn_messages_separator + { + echo -e "${lightyellow}CPU\t${default}" + echo -e "${lightblue}Model:\t${default}${cpumodel}" + echo -e "${lightblue}Cores:\t${default}${cpucores}" + echo -e "${lightblue}Frequency:\t${default}${cpufreqency}MHz" + echo -e "${lightblue}Avg Load:\t${default}${load}" + } | column -s $'\t' -t + echo -e "" + { + echo -e "${lightyellow}Memory\t${default}" + echo -e "${lightblue}Mem:\t${lightblue}total\tused\tfree\tcached\tavailable${default}" + echo -e "${lightblue}Physical:\t${default}${physmemtotal}\t${physmemused}\t${physmemfree}\t${physmemcached}\t${physmemavailable}${default}" + echo -e "${lightblue}Swap:\t${default}${swaptotal}\t${swapused}\t${swapfree}${default}" + } | column -s $'\t' -t + echo -e "" + { + echo -e "${lightyellow}Storage${default}" + echo -e "${lightblue}Filesystem:\t${default}${filesystem}" + echo -e "${lightblue}Total:\t\t${default}${totalspace}" + echo -e "${lightblue}Used:\t\t${default}${usedspace}" + echo -e "${lightblue}Available:\t${default}${availspace}" + } | column -s $'\t' -t + echo -e "" + { + echo -e "${lightyellow}Network${default}" + if [ -n "${netint}" ]; then + echo -e "${lightblue}Interface:\t${default}${netint}" + fi + if [ -n "${netlink}" ]; then + echo -e "${lightblue}Link Speed:\t${default}${netlink}" + fi + echo -e "${lightblue}IP:\t${default}${ip}" + if [ "${ip}" != "${extip}" ]; then + echo -e "${lightblue}Internet IP:\t${default}${extip}" + fi + } | column -s $'\t' -t +} + +fn_info_message_gameserver_resource() { + # + # Game Server Resource Usage + # ================================= + # CPU Used: 1.1% + # Mem Used: 4.8% 189MB + # + # Storage + # Total: 241M + # Serverfiles: 240M + # Backups: 24K + + echo -e "" + echo -e "${lightyellow}Game Server Resource Usage${default}" + fn_messages_separator + { + if [ "${status}" != "0" ] && [ -v status ]; then + if [ -n "${cpuused}" ]; then + echo -e "${lightblue}CPU Used:\t${default}${cpuused}%${default}" + else + echo -e "${lightblue}CPU Used:\t${red}unknown${default}" + fi + if [ -n "${memused}" ]; then + echo -e "${lightblue}Mem Used:\t${default}${pmemused}%\t${memused}MB${default}" + else + echo -e "${lightblue}Mem Used:\t${default}${pmemused}\t${red}unknown${default}" + fi + else + echo -e "${lightblue}CPU Used:\t${default}0%${default}" + echo -e "${lightblue}Mem Used:\t${default}0%\t0MB${default}" + fi + } | column -s $'\t' -t + echo -e "" + { + echo -e "${lightyellow}Storage${default}" + echo -e "${lightblue}Total:\t${default}${rootdirdu}" + echo -e "${lightblue}Serverfiles:\t${default}${serverfilesdu}" + if [ -d "${backupdir}" ]; then + echo -e "${lightblue}Backups:\t${default}${backupdirdu}" + fi + } | column -s $'\t' -t +} + +fn_info_message_gameserver() { + # + # Counter-Strike: Global Offensive Server Details + # ================================= + # Server name: LinuxGSM + # Server IP: 0.0.0.0:27015 + # Internet IP: 176.48.124.96:34197 + # Server password: NOT SET + # RCON password: adminF54CC0VR + # Players: 0/16 + # Current map: de_mirage + # Default map: de_mirage + # Game type: 0 + # Game mode: 0 + # Tick rate: 64 + # Master Server: listed + # Status: STARTED + + echo -e "" + echo -e "${lightgreen}${gamename} Server Details${default}" + fn_info_message_password_strip + fn_messages_separator + { + # Server name + if [ -n "${gdname}" ]; then + echo -e "${lightblue}Server name:\t${default}${gdname}" + elif [ -n "${servername}" ]; then + echo -e "${lightblue}Server name:\t${default}${servername}" + fi + + # Server description + if [ -n "${serverdescription}" ]; then + echo -e "${lightblue}Server Description:\t${default}${serverdescription}" + fi + + # Appid + if [ -n "${appid}" ]; then + echo -e "${lightblue}App ID:\t${default}${appid}" + fi + + # Branch + if [ -n "${branch}" ]; then + echo -e "${lightblue}Branch:\t${default}${branch}" + fi + + # Beta Password + if [ -n "${betapassword}" ]; then + echo -e "${lightblue}Beta Password:\t${default}${betapassword}" + fi + + # Server Version + if [ -n "${gdversion}" ]; then + echo -e "${lightblue}Server Version:\t${default}${gdversion}" + fi + + # Server ip + echo -e "${lightblue}Server IP:\t${default}${ip}:${port}" + + # Internet ip + if [ -n "${extip}" ]; then + if [ "${ip}" != "${extip}" ]; then + echo -e "${lightblue}Internet IP:\t${default}${extip}:${port}" + fi + fi + + # Display ip + if [ -n "${displayip}" ]; then + echo -e "${lightblue}Display IP:\t${default}${displayip}:${port}" + fi + + # Server password + if [ -n "${serverpassword}" ]; then + echo -e "${lightblue}Server password:\t${default}${serverpassword}" + fi + + # Query enabled (Starbound) + if [ -n "${queryenabled}" ]; then + echo -e "${lightblue}Query enabled:\t${default}${queryenabled}" + fi + + # RCON enabled (Starbound) + if [ -n "${rconenabled}" ]; then + echo -e "${lightblue}RCON enabled:\t${default}${rconenabled}" + fi + + # RCON password + if [ -n "${rconpassword}" ]; then + echo -e "${lightblue}RCON password:\t${default}${rconpassword}" + fi + + # RCON web (Rust) + if [ -n "${rconweb}" ]; then + echo -e "${lightblue}RCON web:\t${default}${rconweb}" + fi + + # Admin password + if [ -n "${adminpassword}" ]; then + echo -e "${lightblue}Admin password:\t${default}${adminpassword}" + fi + + # Stats password (Quake Live) + if [ -n "${statspassword}" ]; then + echo -e "${lightblue}Stats password:\t${default}${statspassword}" + fi + + # Players + if [ "${querystatus}" != "0" ]; then + if [ -n "${maxplayers}" ]; then + echo -e "${lightblue}Maxplayers:\t${default}${maxplayers}" + fi + else + if [ -n "${gdplayers}" ] && [ -n "${gdmaxplayers}" ]; then + echo -e "${lightblue}Players:\t${default}${gdplayers}/${gdmaxplayers}" + elif [ -n "${gdplayers}" ] && [ -n "${maxplayers}" ]; then + echo -e "${lightblue}Players:\t${default}${gdplayers}/${maxplayers}" + elif [ -z "${gdplayers}" ] && [ -n "${gdmaxplayers}" ]; then + echo -e "${lightblue}Players:\t${default}0/${gdmaxplayers}" + elif [ -n "${gdplayers}" ] && [ -z "${gdmaxplayers}" ]; then + echo -e "${lightblue}Players:\t${default}${gdplayers}/∞" + elif [ -z "${gdplayers}" ] && [ -z "${gdmaxplayers}" ] && [ -n "${maxplayers}" ]; then + echo -e "${lightblue}Maxplayers:\t${default}${maxplayers}" + fi + fi + + # Reverved Slots + if [ -n "${statspassword}" ]; then + echo -e "${lightblue}Reserved Slots:\t${default}${reservedslots}" + fi + + # Bots + if [ -n "${gdbots}" ]; then + echo -e "${lightblue}Bots:\t${default}${gdbots}" + fi + + # Current map + if [ -n "${gdmap}" ]; then + echo -e "${lightblue}Current map:\t${default}${gdmap}" + fi + + # Default map + if [ -n "${defaultmap}" ]; then + echo -e "${lightblue}Default map:\t${default}${defaultmap}" + fi + + if [ -n "${defaultscenario}" ]; then + # Current scenario (Insurgency: Sandstorm) + if [ -n "${gdgamemode}" ]; then + echo -e "${lightblue}Current scenario:\t${default}${gdgamemode}" + fi + else + # Current game mode + if [ -n "${gdgamemode}" ]; then + echo -e "${lightblue}Current game mode:\t${default}${gdgamemode}" + fi + fi + + # Default scenario + if [ -n "${defaultscenario}" ]; then + echo -e "${lightblue}Default scenario:\t${default}${defaultscenario}" + fi + + # Game type + if [ -n "${gametype}" ]; then + echo -e "${lightblue}Game type:\t${default}${gametype}" + fi + + # Game mode + if [ -n "${gamemode}" ]; then + echo -e "${lightblue}Game mode:\t${default}${gamemode}" + fi + + # Game world + if [ -n "${gameworld}" ]; then + echo -e "${lightblue}Game world:\t${default}${gameworld}" + fi + + # Tick rate + if [ -n "${tickrate}" ]; then + echo -e "${lightblue}Tick rate:\t${default}${tickrate}" + fi + + # Sharding (Don't Starve Together) + if [ -n "${sharding}" ]; then + echo -e "${lightblue}Sharding:\t${default}${sharding}" + fi + + # Master (Don't Starve Together) + if [ -n "${master}" ]; then + echo -e "${lightblue}Master:\t${default}${master}" + fi + + # Shard (Don't Starve Together) + if [ -n "${shard}" ]; then + echo -e "${lightblue}Shard:\t${default}${shard}" + fi + + # Cluster (Don't Starve Together) + if [ -n "${cluster}" ]; then + echo -e "${lightblue}Cluster:\t${default}${cluster}" + fi + + # Cave (Don't Starve Together) + if [ -n "${cave}" ]; then + echo -e "${lightblue}Cave:\t${default}${cave}" + fi + + # Creativemode (Hurtworld) + if [ -n "${creativemode}" ]; then + echo -e "${lightblue}Creativemode:\t${default}${creativemode}" + fi + + # TeamSpeak dbplugin + if [ -n "${dbplugin}" ]; then + echo -e "${lightblue}dbplugin:\t${default}${dbplugin}" + fi + + # ASE (Multi Theft Auto) + if [ -n "${ase}" ]; then + echo -e "${lightblue}ASE:\t${default}${ase}" + fi + + # Save interval (Rust) + if [ -n "${saveinterval}" ]; then + echo -e "${lightblue}Save interval:\t${default}${saveinterval}s" + fi + + # Seed (Rust) + if [ -n "${seed}" ]; then + echo -e "${lightblue}Seed:\t${default}${seed}" + fi + + # Salt (Rust) + if [ -n "${salt}" ]; then + echo -e "${lightblue}Salt:\t${default}${salt}" + fi + + # World Size (Rust) + if [ -n "${worldsize}" ]; then + echo -e "${lightblue}World size:\t${default}${worldsize}m" + fi + + # Random map rotation mode (Squad and Post Scriptum) + if [ -n "${randommap}" ]; then + echo -e "${lightblue}Map rotation:\t${default}${randommap}" + fi + + # Server Version (Jedi Knight II: Jedi Outcast) + if [ -n "${serverversion}" ]; then + echo -e "${lightblue}Server Version:\t${default}${serverversion}" + fi + + # authentication token (Factorio) + if [ -n "${authtoken}" ]; then + echo -e "${lightblue}Auth Token:\t${default}${authtoken}" + fi + + # savegameinterval (Factorio) + if [ -n "${savegameinterval}" ]; then + echo -e "${lightblue}Savegame Interval:\t${default}${savegameinterval}" + fi + + # versioncount (Factorio) + if [ -n "${versioncount}" ]; then + echo -e "${lightblue}Version Count:\t${default}${versioncount}" + fi + + # Listed on Master server + if [ -n "${displaymasterserver}" ]; then + if [ "${displaymasterserver}" == "true" ]; then + echo -e "${lightblue}Master server:\t${green}listed${default}" + else + echo -e "${lightblue}Master server:\t${red}not listed${default}" + fi + fi + + # Game server status + if [ "${status}" == "0" ]; then + echo -e "${lightblue}Status:\t${red}STOPPED${default}" + else + echo -e "${lightblue}Status:\t${green}STARTED${default}" + fi + } | column -s $'\t' -t + echo -e "" +} + +fn_info_message_script() { + # csgoserver Script Details + # ================================= + # Script name: csgoserver + # LinuxGSM version: v21.1.3 + # glibc required: 2.18 + # Discord alert: off + # Email alert: off + # Gotify alert: off + # IFTTT alert: off + # Mailgun (email) alert: off + # Pushbullet alert: off + # Pushover alert: off + # Rocketchat alert: off + # Slack alert: off + # Telegram alert: off + # Update on start: off + # User: lgsm + # Location: /home/lgsm/csgoserver + # Config file: /home/lgsm/csgoserver/serverfiles/csgo/cfg/csgoserver.cfg + + echo -e "${lightgreen}${selfname} Script Details${default}" + fn_messages_separator + { + # Script name + echo -e "${lightblue}Script name:\t${default}${selfname}" + + # LinuxGSM version + if [ -n "${version}" ]; then + echo -e "${lightblue}LinuxGSM version:\t${default}${version}" + fi + + # glibc required + if [ -n "${glibc}" ]; then + if [ "${glibc}" == "null" ]; then + # Glibc is not required. + : + elif [ -z "${glibc}" ]; then + echo -e "${lightblue}glibc required:\t${red}UNKNOWN${default}" + elif [ "$(printf '%s\n'${glibc}'\n' ${glibcversion} | sort -V | head -n 1)" != "${glibc}" ]; then + echo -e "${lightblue}glibc required:\t${red}${glibc} ${default}(${red}distro glibc ${glibcversion} too old${default})" + else + echo -e "${lightblue}glibc required:\t${green}${glibc}${default}" + fi + fi + + # Discord alert + echo -e "${lightblue}Discord alert:\t${default}${discordalert}" + # Email alert + echo -e "${lightblue}Email alert:\t${default}${emailalert}" + # Gotify alert + echo -e "${lightblue}Gotify alert:\t${default}${gotifyalert}" + # IFTTT alert + echo -e "${lightblue}IFTTT alert:\t${default}${iftttalert}" + # Mailgun alert + echo -e "${lightblue}Mailgun (email) alert:\t${default}${mailgunalert}" + # Pushbullet alert + echo -e "${lightblue}Pushbullet alert:\t${default}${pushbulletalert}" + # Pushover alert + echo -e "${lightblue}Pushover alert:\t${default}${pushoveralert}" + # Rocketchat alert + echo -e "${lightblue}Rocketchat alert:\t${default}${rocketchatalert}" + # Slack alert + echo -e "${lightblue}Slack alert:\t${default}${slackalert}" + # Telegram alert + echo -e "${lightblue}Telegram alert:\t${default}${telegramalert}" + + # Update on start + if [ -n "${updateonstart}" ]; then + echo -e "${lightblue}Update on start:\t${default}${updateonstart}" + fi + + # User + echo -e "${lightblue}User:\t${default}$(whoami)" + + # Script location + echo -e "${lightblue}Location:\t${default}${rootdir}" + + # Config file location + if [ -n "${servercfgfullpath}" ]; then + if [ -f "${servercfgfullpath}" ]; then + echo -e "${lightblue}Config file:\t${default}${servercfgfullpath}" + elif [ -d "${servercfgfullpath}" ]; then + echo -e "${lightblue}Config dir:\t${default}${servercfgfullpath}" + else + echo -e "${lightblue}Config file:\t${default}${red}${servercfgfullpath}${default} (${red}FILE MISSING${default})" + fi + fi + + # Network config file location (ARMA 3) + if [ -n "${networkcfgfullpath}" ]; then + echo -e "${lightblue}Network config file:\t${default}${networkcfgfullpath}" + fi + } | column -s $'\t' -t +} + +fn_info_message_backup() { + # + # Backups + # ================================= + # No. of backups: 1 + # Latest backup: + # date: Fri May 6 18:34:19 UTC 2016 + # file: /home/lgsm/qlserver/backups/ql-server-2016-05-06-183239.tar.gz + # size: 945M + + echo -e "" + echo -e "${lightgreen}Backups${default}" + fn_messages_separator + if [ ! -d "${backupdir}" ] || [ "${backupcount}" == "0" ]; then + echo -e "No Backups created" + else + { + echo -e "${lightblue}No. of backups:\t${default}${backupcount}" + echo -e "${lightblue}Latest backup:${default}" + if [ "${lastbackupdaysago}" == "0" ]; then + echo -e "${lightblue} date:\t${default}${lastbackupdate} (less than 1 day ago)" + elif [ "${lastbackupdaysago}" == "1" ]; then + echo -e "${lightblue} date:\t${default}${lastbackupdate} (1 day ago)" + else + echo -e "${lightblue} date:\t${default}${lastbackupdate} (${lastbackupdaysago} days ago)" + fi + echo -e "${lightblue} file:\t${default}${lastbackup}" + echo -e "${lightblue} size:\t${default}${lastbackupsize}" + } | column -s $'\t' -t + fi +} + +fn_info_message_commandlineparms() { + # + # Command-line Parameters + # ================================= + # ./run_server_x86.sh +set net_strict 1 + + echo -e "" + echo -e "${lightgreen}Command-line Parameters${default}" + fn_info_message_password_strip + fn_messages_separator + if [ "${serverpassword}" == "NOT SET" ]; then + unset serverpassword + fi + fn_reload_startparameters + echo -e "${preexecutable} ${executable} ${startparameters}" +} + +fn_info_message_ports_edit() { + # + # Ports + # ================================= + # Change ports by editing the parameters in: + # /home/lgsm/qlserver/serverfiles/baseq3/ql-server.cfg + echo -e "" + echo -e "${lightgreen}Ports${default}" + fn_messages_separator + echo -e "${lightblue}Change ports by editing the parameters in:${default}" + + 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" "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" + elif [ "${shortname}" == "kf2" ]; then + startparameterslocation="${servercfgdir}/LinuxServer-KFEngine.ini\n${servercfgdir}/KFWeb.ini" + 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" "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}" + fi + done + echo -e "${startparameterslocation}" + echo -e "" +} + +fn_info_message_ports() { + echo -e "${lightblue}Useful port diagnostic command:${default}" + 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" + 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" + elif [ "${engine}" == "source" ]; then + echo -e "ss -tuplwn | grep srcds_linux" + elif [ "${engine}" == "goldsrc" ]; then + echo -e "ss -tuplwn | grep hlds_linux" + else + executableshort="$(basename "${executable}" | cut -c -15)" + echo -e "ss -tuplwn | grep ${executableshort}" + fi + echo -e "" +} + +fn_info_message_statusbottom() { + echo -e "" + if [ "${status}" == "0" ]; then + echo -e "${lightblue}Status:\t${red}STOPPED${default}" + else + echo -e "${lightblue}Status:\t${green}STARTED${default}" + fi + echo -e "" +} + +fn_info_logs() { + echo -e "" + echo -e "${selfname} Logs" + echo -e "=================================" + + if [ -n "${lgsmlog}" ]; then + echo -e "\nScript log\n===================" + if [ ! "$(ls -A "${lgsmlogdir}")" ]; then + echo -e "${lgsmlogdir} (NO LOG FILES)" + elif [ ! -s "${lgsmlog}" ]; then + echo -e "${lgsmlog} (LOG FILE IS EMPTY)" + else + echo -e "${lgsmlog}" + tail -25 "${lgsmlog}" + fi + echo -e "" + fi + + if [ -n "${consolelog}" ]; then + echo -e "\nConsole log\n====================" + if [ ! "$(ls -A "${consolelogdir}")" ]; then + echo -e "${consolelogdir} (NO LOG FILES)" + elif [ ! -s "${consolelog}" ]; then + echo -e "${consolelog} (LOG FILE IS EMPTY)" + else + echo -e "${consolelog}" + tail -25 "${consolelog}" | awk '{ sub("\r$", ""); print }' + fi + echo -e "" + fi + + if [ -n "${gamelogdir}" ]; then + echo -e "\nServer log\n===================" + if [ ! "$(ls -A "${gamelogdir}")" ]; then + echo -e "${gamelogdir} (NO LOG FILES)" + else + echo -e "${gamelogdir}" + # dos2unix sed 's/\r//' + tail "${gamelogdir}"/* 2> /dev/null | grep -v "==>" | sed '/^$/d' | sed 's/\r//' | tail -25 + fi + echo -e "" + fi +} + +# Engine/Game Specific details + +# Function used to generate port info. by passing info to function. (Reduces repeating code) +# example output +# DESCRIPTION PORT PROTOCOL LISTEN +# Game 7777 udp 1 +# RAW UDP Socket 7778 udp 1 +# Query 27015 udp 1 +# RCON 27020 tcp 1 + +fn_port() { + if [ "${1}" == "header" ]; then + echo -e "${lightblue}DESCRIPTION\tPORT\tPROTOCOL\tLISTEN${default}" + else + portname="${1}" + porttype="${2}" + portprotocol="${3}" + echo -e "${portname}\t${!porttype}\t${portprotocol}\t$(echo "${ssinfo}" | grep "${portprotocol}" | grep -c "${!porttype}")" + fi +} + +fn_info_message_ac() { + { + fn_port "header" + fn_port "Game" port udp + fn_port "Game" port tcp + fn_port "Query" queryport udp + fn_port "HTTP" httpport tcp + } | column -s $'\t' -t +} + +fn_info_message_ark() { + { + fn_port "header" + fn_port "Game" port udp + fn_port "RAW UDP Socket" rawport udp + fn_port "Query" queryport udp + fn_port "RCON" rconport tcp + } | column -s $'\t' -t +} + +fn_info_message_arma3() { + { + fn_port "header" + fn_port "Game" port udp + fn_port "Voice" voiceport udp + fn_port "Query" queryport udp + fn_port "Steam Master" steammasterport udp + fn_port "Voice (unused)" voiceunusedport udp + fn_port "BattleEye" battleeyeport udp + } | column -s $'\t' -t +} + +fn_info_message_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" + fn_port "Game" port udp + fn_port "Query" queryport udp + fn_port "Steam Master" steammasterport udp + fn_port "Steam Query" steamqueryport udp + fn_port "RCON" rconport tcp + } | column -s $'\t' -t +} + +fn_info_message_bf1942() { + { + fn_port "header" + fn_port "Game" port udp + fn_port "Query" queryport udp + } | column -s $'\t' -t +} + +fn_info_message_bfv() { + { + fn_port "header" + fn_port "Game" port udp + fn_port "Query" queryport udp + } | column -s $'\t' -t +} + +fn_info_message_bo() { + { + fn_port "header" + fn_port "Game" port udp + fn_port "Query" queryport udp + } | column -s $'\t' -t +} + +fn_info_message_bt() { + { + fn_port "header" + fn_port "Game" port udp + fn_port "Query" queryport udp + } | column -s $'\t' -t +} + +fn_info_message_btl() { + { + fn_port "header" + fn_port "Game" port udp + fn_port "Query" queryport udp + fn_port "RCON" rconport tcp + } | column -s $'\t' -t +} + +fn_info_messages_cd() { + { + fn_port "header" + fn_port "Game" port udp + fn_port "Steam" steamport udp + fn_port "RCON" rconport tcp + } | 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 + { + fn_port "header" + fn_port "Game" port udp + fn_port "Query" queryport udp + fn_port "RCON" rconport tcp + } | column -s $'\t' -t +} + +fn_info_message_cod() { + { + fn_port "header" + fn_port "Game" port udp + fn_port "Query" queryport udp + } | column -s $'\t' -t +} + +fn_info_message_coduo() { + { + fn_port "header" + fn_port "Game" port udp + fn_port "Query" queryport udp + } | column -s $'\t' -t +} + +fn_info_message_cod2() { + { + fn_port "header" + fn_port "Game" port udp + fn_port "Query" queryport udp + } | column -s $'\t' -t +} + +fn_info_message_cod4() { + { + fn_port "header" + fn_port "Game" port udp + fn_port "Query" queryport udp + } | column -s $'\t' -t +} + +fn_info_message_codwaw() { + { + fn_port "header" + fn_port "Game" port udp + fn_port "Query" queryport udp + } | column -s $'\t' -t +} + +fn_info_message_col() { + { + fn_port "header" + fn_port "Game" port udp + fn_port "Query" queryport tcp + fn_port "Steam" steamport tcp + } | column -s $'\t' -t +} + +fn_info_message_csgo() { + { + fn_port "header" + fn_port "Game" port udp + fn_port "Query" queryport tcp + fn_port "RCON" rconport tcp + fn_port "SourceTV" sourcetvport udp + fn_port "Client" clientport udp + } | column -s $'\t' -t +} + +fn_info_message_dayz() { + { + fn_port "header" + fn_port "Game" port udp + fn_port "Query Steam" queryport udp + fn_port "Steam Master" steammasterport udp + fn_port "BattleEye" battleeyeport udp + } | column -s $'\t' -t +} + +fn_info_message_dodr() { + { + fn_port "header" + fn_port "Game" port udp + fn_port "Query" queryport udp + } | column -s $'\t' -t +} + +fn_info_message_dst() { + { + fn_port "header" + fn_port "Game: Server" port udp + fn_port "Game: Master" masterport udp + fn_port "Steam: Auth" steamauthport udp + fn_port "Steam: Master" steammasterport udp + } | column -s $'\t' -t +} + +fn_info_message_eco() { + { + fn_port "header" + fn_port "Game" port udp + fn_port "Web Admin" webadminport tcp + } | column -s $'\t' -t +} + +fn_info_message_etl() { + { + fn_port "header" + fn_port "Game" port udp + fn_port "Query" queryport udp + } | column -s $'\t' -t +} + +fn_info_message_fctr() { + { + fn_port "header" + fn_port "Game" port udp + fn_port "RCON" rconport tcp + } | column -s $'\t' -t +} + +fn_info_message_goldsrc() { + { + fn_port "header" + fn_port "Game" port udp + fn_port "Client" clientport udp + } | column -s $'\t' -t +} + +fn_info_message_hw() { + { + fn_port "header" + fn_port "Game" port udp + fn_port "Query" queryport udp + } | column -s $'\t' -t +} + +fn_info_message_ins() { + { + fn_port "header" + fn_port "Game" port udp + fn_port "Query" queryport tcp + fn_port "RCON" rconport tcp + fn_port "SourceTV" sourcetvport udp + fn_port "Client" clientport udp + } | column -s $'\t' -t +} + +fn_info_message_inss() { + { + fn_port "header" + fn_port "Game" port udp + fn_port "Query" queryport udp + fn_port "RCON" rconport tcp + } | column -s $'\t' -t +} + +fn_info_message_jc2() { + { + fn_port "header" + fn_port "Game" port udp + fn_port "Query" queryport udp + } | column -s $'\t' -t +} + +fn_info_message_jc3() { + { + fn_port "header" + fn_port "Game" port udp + fn_port "Query" queryport udp + fn_port "Steam" steamport udp + fn_port "HTTP" httpport tcp + } | column -s $'\t' -t +} + +fn_info_message_jk2() { + { + fn_port "header" + fn_port "Game" port udp + } | column -s $'\t' -t +} + +fn_info_message_kf() { + { + fn_port "header" + fn_port "Game" port udp + fn_port "Query" queryport udp + fn_port "Query (GameSpy)" queryportgs udp + fn_port "Web Admin" webadminport tcp + fn_port "LAN" lanport udp + fn_port "Steam" steamport udp + fn_port "Steam Master" steammasterport udp + } | column -s $'\t' -t + echo -e "" + echo -e "${lightgreen}${servername} Web Admin${default}" + fn_messages_separator + { + echo -e "${lightblue}Web Admin enabled:\t${default}${webadminenabled}" + echo -e "${lightblue}Web Admin url:\t${default}http://${webadminip}:${webadminport}" + echo -e "${lightblue}Web Admin username:\t${default}${webadminuser}" + echo -e "${lightblue}Web Admin password:\t${default}${webadminpass}" + } | column -s $'\t' -t +} + +fn_info_message_kf2() { + fn_info_message_password_strip + { + fn_port "header" + fn_port "Game" port udp + fn_port "Query" queryport udp + fn_port "Web Admin" webadminport tcp + } | column -s $'\t' -t + echo -e "" + echo -e "${lightgreen}${servername} Web Admin${default}" + fn_messages_separator + { + echo -e "${lightblue}Web Admin enabled:\t${default}${webadminenabled}" + echo -e "${lightblue}Web Admin url:\t${default}http://${webadminip}:${webadminport}" + echo -e "${lightblue}Web Admin username:\t${default}${webadminuser}" + echo -e "${lightblue}Web Admin password:\t${default}${webadminpass}" + } | column -s $'\t' -t +} + +fn_info_message_lo() { + { + fn_port "header" + fn_port "Game" port udp + fn_port "Query" queryport udp + } | column -s $'\t' -t +} + +fn_info_message_mc() { + { + fn_port "header" + fn_port "Game" port tcp + fn_port "Query" queryport udp + fn_port "RCON" rconport tcp + } | column -s $'\t' -t +} + +fn_info_message_mcb() { + { + fn_port "header" + fn_port "Game" port udp + fn_port "Game" portipv6 udp6 + } | column -s $'\t' -t +} + +fn_info_message_mh() { + { + fn_port "header" + fn_port "Game" port udp + fn_port "Query" queryport udp + fn_port "Beacon" beaconport udp + } | column -s $'\t' -t +} + +fn_info_message_mohaa() { + { + fn_port "header" + fn_port "Game" port udp + } | column -s $'\t' -t +} + +fn_info_message_mom() { + { + fn_port "header" + fn_port "Game" port udp + fn_port "Beacon" beaconport udp + } | column -s $'\t' -t +} + +fn_info_message_mta() { + { + fn_port "header" + fn_port "Game" port udp + if [ "${ase}" == "Enabled" ]; then + fn_port "Query" queryport udp + fi + fn_port "HTTP" httpport tcp + } | column -s $'\t' -t +} + +fn_info_message_nec() { + { + fn_port "header" + fn_port "Game" port udp + } | column -s $'\t' -t +} + +fn_info_message_onset() { + { + fn_port "header" + fn_port "Game" port udp + fn_port "Query" queryport udp + fn_port "HTTP" httpport tcp + } | column -s $'\t' -t +} + +fn_info_message_pc() { + { + 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_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" + fn_port "Game" port udp + fn_port "Query" queryport udp + fn_port "RCON" rconport tcp + } | column -s $'\t' -t +} + +fn_info_message_pvr() { + { + fn_port "header" + fn_port "Game" port udp + fn_port "Game" port tcp + fn_port "Game+400" port401 udp + fn_port "Query" queryport tcp + } | column -s $'\t' -t +} + +fn_info_message_pz() { + { + fn_port "header" + fn_port "Game" port udp + fn_port "Query" queryport udp + } | column -s $'\t' -t +} + +fn_info_message_qw() { + { + fn_port "header" + fn_port "Game" port udp + } | column -s $'\t' -t +} + +fn_info_message_q2() { + { + fn_port "header" + fn_port "Game" port udp + } | column -s $'\t' -t +} + +fn_info_message_q3() { + { + fn_port "header" + fn_port "Game" port udp + } | column -s $'\t' -t +} + +fn_info_message_ql() { + { + fn_port "header" + fn_port "Game" port udp + fn_port "Query" queryport udp + fn_port "RCON" rconport tcp + fn_port "Stats" statsport udp + } | column -s $'\t' -t +} + +fn_info_message_ro() { + { + fn_port "header" + fn_port "Game" port udp + fn_port "Query" queryport udp + fn_port "Web Admin" webadminport tcp + fn_port "LAN" lanport udp + fn_port "Steam" steamport udp + fn_port "Steam Master" steammasterport udp + } | column -s $'\t' -t + echo -e "" + echo -e "${lightgreen}${servername} Web Admin${default}" + fn_messages_separator + { + echo -e "${lightblue}Web Admin enabled:\t${default}${webadminenabled}" + echo -e "${lightblue}Web Admin url:\t${default}http://${webadminip}:${webadminport}" + echo -e "${lightblue}Web Admin username:\t${default}${webadminuser}" + echo -e "${lightblue}Web Admin password:\t${default}${webadminpass}" + } | column -s $'\t' -t +} + +fn_info_message_rtcw() { + { + fn_port "header" + fn_port "Game" port udp + } | column -s $'\t' -t +} + +fn_info_message_rust() { + { + fn_port "header" + fn_port "Game" port udp + fn_port "Query" queryport udp + fn_port "RCON" rconport tcp + fn_port "App" appport tcp + } | column -s $'\t' -t +} + +fn_info_message_rw() { + { + fn_port "header" + fn_port "Game" port udp + fn_port "Game+1" port2 udp + fn_port "Game+2" port3 udp + fn_port "Game+3" port4 udp + fn_port "Game+1" port2 tcp + fn_port "Game+2" port3 tcp + fn_port "Game+3" port4 tcp + fn_port "Query" queryport tcp + fn_port "Query HTTP" httpqueryport tcp + fn_port "RCON" rconport tcp + } | column -s $'\t' -t +} + +fn_info_message_samp() { + { + fn_port "header" + fn_port "Game" port udp + fn_port "RCON" rconport udp + } | column -s $'\t' -t +} + +fn_info_message_sb() { + { + fn_port "header" + fn_port "Game" port udp + fn_port "Query" queryport tcp + fn_port "RCON" rconport tcp + } | column -s $'\t' -t +} + +fn_info_message_sbots() { + { + fn_port "header" + fn_port "Game" port udp + fn_port "Query" queryport udp + } | column -s $'\t' -t +} + +fn_info_message_scpsl() { + { + fn_port "header" + fn_port "Game" port tcp + } | column -s $'\t' -t +} + +fn_info_message_sdtd() { + fn_info_message_password_strip + { + fn_port "header" + fn_port "Game" port udp + fn_port "Game+2" port3 udp + fn_port "Query" queryport tcp + fn_port "Web Admin" webadminport tcp + fn_port "Telnet" telnetport tcp + } | column -s $'\t' -t + echo -e "" + echo -e "${lightgreen}${gamename} Web Admin${default}" + fn_messages_separator + { + echo -e "${lightblue}Web Admin enabled:\t${default}${webadminenabled}" + echo -e "${lightblue}Web Admin url:\t${default}http://${webadminip}:${webadminport}/index.html" + echo -e "${lightblue}Web Admin username:\t${default}${webadminuser}" + echo -e "${lightblue}Web Admin password:\t${default}${webadminpass}" + } | column -s $'\t' -t + echo -e "" + echo -e "${lightgreen}${gamename} Telnet${default}" + fn_messages_separator + { + echo -e "${lightblue}Telnet enabled:\t${default}${telnetenabled}" + echo -e "${lightblue}Telnet address:\t${default}${telnetip} ${telnetport}" + echo -e "${lightblue}Telnet password:\t${default}${telnetpass}" + } | column -s $'\t' -t +} + +fn_info_message_sf() { + { + fn_port "header" + fn_port "Game" port udp + fn_port "Query" queryport udp + fn_port "Beacon" beaconport udp + } | column -s $'\t' -t +} + +fn_info_message_sof2() { + { + fn_port "header" + fn_port "Game" port udp + fn_port "Query" queryport udp + } | column -s $'\t' -t +} + +fn_info_message_sol() { + { + fn_port "header" + fn_port "Game" port udp + fn_port "Query" queryport udp + fn_port "Files" filesport tcp + } | column -s $'\t' -t +} + +fn_info_message_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" + fn_port "Game" port udp + fn_port "Query" queryport tcp + fn_port "RCON" rconport tcp + fn_port "SourceTV" sourcetvport udp + # Will not show if unaviable + 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_password_strip + { + fn_port "header" + fn_port "Game" port udp + fn_port "Query" queryport udp + fn_port "Web Admin" webadminport tcp + } | column -s $'\t' -t + echo -e "" + echo -e "${lightgreen}${gamename} Web Admin${default}" + fn_messages_separator + { + echo -e "${lightblue}Web Admin url:\t${default}http://${webadminip}:${webadminport}/index.html" + echo -e "${lightblue}Web Admin username:\t${default}${webadminuser}" + echo -e "${lightblue}Web Admin password:\t${default}${webadminpass}" + } | column -s $'\t' -t +} + +fn_info_message_squad() { + { + fn_port "header" + fn_port "Game" port udp + fn_port "Query" queryport udp + fn_port "RCON" rconport tcp + } | column -s $'\t' -t +} + +fn_info_message_st() { + { + fn_port "header" + fn_port "Game" port udp + fn_port "Query" queryport udp + fn_port "Web Admin" webadminport tcp + } | column -s $'\t' -t + echo -e "" + echo -e "${lightgreen}${gamename} Web Admin${default}" + fn_messages_separator + { + echo -e "${lightblue}Web Admin url:\t${default}http://${webadminip}:${webadminport}" + } | column -s $'\t' -t +} + +fn_info_message_ti() { + { + fn_port "header" + fn_port "Game" port udp + fn_port "Query" queryport udp + } | column -s $'\t' -t +} + +fn_info_message_ts3() { + { + fn_port "header" + fn_port "Voice" port udp + fn_port "Query" queryport tcp + fn_port "Query (SSH)" querysshport tcp + fn_port "Query (http)" queryhttpport tcp + fn_port "Query (https)" queryhttpsport tcp + fn_port "File Transfer" fileport tcp + fn_port "Telnet" telnetport tcp + } | column -s $'\t' -t +} + +fn_info_message_tw() { + { + fn_port "header" + fn_port "Game" port udp + fn_port "Query" queryport udp + } | column -s $'\t' -t +} + +fn_info_message_terraria() { + { + fn_port "header" + fn_port "Game" port tcp + fn_port "Query" queryport tcp + } | column -s $'\t' -t +} + +fn_info_message_tu() { + { + fn_port "header" + fn_port "Game" port udp + fn_port "Query" queryport udp + fn_port "Steam" steamport udp + } | column -s $'\t' -t +} + +fn_info_message_unreal() { + fn_info_message_password_strip + { + fn_port "header" + fn_port "Game" port udp + fn_port "Query" queryport udp + fn_port "LAN Beacon" beaconport udp + fn_port "Web Admin" webadminport tcp + } | column -s $'\t' -t + echo -e "" + echo -e "${lightgreen}${servername} Web Admin${default}" + fn_messages_separator + { + echo -e "${lightblue}Web Admin enabled:\t${default}${webadminenabled}" + echo -e "${lightblue}Web Admin url:\t${default}http://${webadminip}:${webadminport}" + echo -e "${lightblue}Web Admin username:\t${default}${webadminuser}" + echo -e "${lightblue}Web Admin password:\t${default}${webadminpass}" + } | column -s $'\t' -t +} + +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 + } | column -s $'\t' -t + echo -e "" + echo -e "${lightgreen}${servername} Web Admin${default}" + fn_messages_separator + { + echo -e "${lightblue}Web Admin enabled:\t${default}${webadminenabled}" + echo -e "${lightblue}Web Admin url:\t${default}http://${webadminip}:${webadminport}" + echo -e "${lightblue}Web Admin username:\t${default}${webadminuser}" + echo -e "${lightblue}Web Admin password:\t${default}${webadminpass}" + } | column -s $'\t' -t +} + +fn_info_message_unreal() { + fn_info_message_password_strip + { + fn_port "header" + fn_port "Game" port udp + fn_port "Query" queryport udp + fn_port "LAN Beacon" beaconport udp + fn_port "Web Admin" webadminport tcp + } | column -s $'\t' -t + echo -e "" + echo -e "${lightgreen}${servername} Web Admin${default}" + fn_messages_separator + { + echo -e "${lightblue}Web Admin enabled:\t${default}${webadminenabled}" + echo -e "${lightblue}Web Admin url:\t${default}http://${webadminip}:${webadminport}" + echo -e "${lightblue}Web Admin username:\t${default}${webadminuser}" + echo -e "${lightblue}Web Admin password:\t${default}${webadminpass}" + } | column -s $'\t' -t +} + +fn_info_message_unt() { + { + 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_ut() { + { + fn_port "header" + fn_port "Game" port udp + fn_port "Query" queryport udp + } | column -s $'\t' -t +} + +fn_info_message_ut3() { + fn_info_message_password_strip + { + fn_port "header" + fn_port "Game" port udp + fn_port "Query" queryport udp + fn_port "Web Admin" webadminport tcp + } | column -s $'\t' -t + echo -e "" + echo -e "${lightgreen}${servername} Web Admin${default}" + fn_messages_separator + { + echo -e "${lightblue}Web Admin enabled:\t${default}${webadminenabled}" + echo -e "${lightblue}Web Admin url:\t${default}http://${webadminip}:${webadminport}" + echo -e "${lightblue}Web Admin username:\t${default}${webadminuser}" + echo -e "${lightblue}Web Admin password:\t${default}${webadminpass}" + } | column -s $'\t' -t +} + +fn_info_message_vh() { + { + fn_port "header" + fn_port "Game" port udp + fn_port "Query" queryport udp + } | column -s $'\t' -t +} + +fn_info_message_vints() { + { + fn_port "header" + fn_port "Game" port tcp + } | 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" + fn_port "Game" port udp + fn_port "Query" queryport udp + } | column -s $'\t' -t +} + +fn_info_message_wf() { + { + fn_port "header" + fn_port "Game" port udp + fn_port "HTTP" httpport tcp + } | column -s $'\t' -t +} + +fn_info_message_wurm() { + { + fn_port "header" + fn_port "Game" port tcp + fn_port "Query" queryport udp + } | column -s $'\t' -t +} + +fn_info_message_stn() { + { + fn_port "header" + fn_port "Game" port udp + fn_port "Query" queryport udp + } | column -s $'\t' -t +} + +fn_info_message_select_engine() { + # Display details depending on game or engine. + if [ "${shortname}" == "ac" ]; then + fn_info_message_ac + elif [ "${shortname}" == "ark" ]; then + 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 + fn_info_message_bf1942 + elif [ "${shortname}" == "bfv" ]; then + fn_info_message_bfv + elif [ "${shortname}" == "bo" ]; then + fn_info_message_bo + elif [ "${shortname}" == "bt" ]; then + fn_info_message_bt + elif [ "${shortname}" == "btl" ]; then + fn_info_message_btl + 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 + fn_info_message_cmw + elif [ "${shortname}" == "cod" ]; then + fn_info_message_cod + elif [ "${shortname}" == "coduo" ]; then + fn_info_message_coduo + elif [ "${shortname}" == "cod2" ]; then + fn_info_message_cod2 + elif [ "${shortname}" == "cod4" ]; then + fn_info_message_cod4 + elif [ "${shortname}" == "codwaw" ]; then + fn_info_message_codwaw + elif [ "${shortname}" == "col" ]; then + fn_info_message_col + elif [ "${shortname}" == "dayz" ]; then + fn_info_message_dayz + elif [ "${shortname}" == "dodr" ]; then + fn_info_message_dodr + elif [ "${shortname}" == "dst" ]; then + fn_info_message_dst + elif [ "${shortname}" == "eco" ]; then + fn_info_message_eco + elif [ "${shortname}" == "etl" ]; then + fn_info_message_etl + elif [ "${shortname}" == "fctr" ]; then + fn_info_message_fctr + elif [ "${shortname}" == "hw" ]; then + fn_info_message_hw + elif [ "${shortname}" == "ins" ]; then + fn_info_message_ins + elif [ "${shortname}" == "inss" ]; then + fn_info_message_inss + elif [ "${shortname}" == "jc2" ]; then + fn_info_message_jc2 + elif [ "${shortname}" == "jc3" ]; then + fn_info_message_jc3 + elif [ "${shortname}" == "jk2" ]; then + fn_info_message_jk2 + elif [ "${shortname}" == "kf" ]; then + fn_info_message_kf + elif [ "${shortname}" == "kf2" ]; then + fn_info_message_kf2 + elif [ "${shortname}" == "lo" ]; then + fn_info_message_lo + elif [ "${shortname}" == "mc" ] || [ "${shortname}" == "pmc" ] || [ "${shortname}" == "wmc" ]; then + fn_info_message_mc + elif [ "${shortname}" == "mcb" ]; then + fn_info_message_mcb + elif [ "${shortname}" == "mh" ]; then + 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}" == "nec" ]; then + fn_info_message_nec + elif [ "${shortname}" == "onset" ]; then + 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 + fn_info_message_pvr + elif [ "${shortname}" == "pz" ]; then + fn_info_message_pz + elif [ "${shortname}" == "q2" ]; then + fn_info_message_q2 + elif [ "${shortname}" == "q3" ]; then + fn_info_message_q3 + elif [ "${shortname}" == "ql" ]; then + fn_info_message_ql + elif [ "${shortname}" == "qw" ]; then + fn_info_message_qw + elif [ "${shortname}" == "ro" ]; then + fn_info_message_ro + elif [ "${shortname}" == "rtcw" ]; then + fn_info_message_rtcw + elif [ "${shortname}" == "samp" ]; then + fn_info_message_samp + elif [ "${shortname}" == "sb" ]; then + fn_info_message_sb + elif [ "${shortname}" == "sbots" ]; then + fn_info_message_sbots + elif [ "${shortname}" == "scpsl" ] || [ "${shortname}" == "scpslsm" ]; then + fn_info_message_scpsl + elif [ "${shortname}" == "sdtd" ]; then + fn_info_message_sdtd + elif [ "${shortname}" == "sf" ]; then + fn_info_message_sf + elif [ "${shortname}" == "sof2" ]; then + fn_info_message_sof2 + elif [ "${shortname}" == "sol" ]; then + fn_info_message_sol + elif [ "${shortname}" == "squad" ]; then + fn_info_message_squad + elif [ "${shortname}" == "st" ]; then + fn_info_message_st + elif [ "${shortname}" == "stn" ]; then + fn_info_message_stn + elif [ "${shortname}" == "terraria" ]; then + fn_info_message_terraria + elif [ "${shortname}" == "ti" ]; then + fn_info_message_ti + elif [ "${shortname}" == "ts3" ]; then + fn_info_message_ts3 + elif [ "${shortname}" == "tu" ]; then + fn_info_message_tu + elif [ "${shortname}" == "tw" ]; then + fn_info_message_tw + elif [ "${shortname}" == "unt" ]; then + fn_info_message_unt + elif [ "${shortname}" == "vh" ]; then + fn_info_message_vh + elif [ "${shortname}" == "vints" ]; then + fn_info_message_vints + elif [ "${shortname}" == "rust" ]; then + fn_info_message_rust + elif [ "${shortname}" == "rw" ]; then + fn_info_message_rw + elif [ "${shortname}" == "ut" ]; then + fn_info_message_ut + elif [ "${shortname}" == "ut2k4" ]; then + fn_info_message_ut2k4 + elif [ "${shortname}" == "ut3" ]; then + fn_info_message_ut3 + elif [ "${shortname}" == "vpmc" ]; then + fn_info_message_vpmc + elif [ "${shortname}" == "wet" ]; then + fn_info_message_wet + elif [ "${shortname}" == "wf" ]; then + fn_info_message_wf + elif [ "${shortname}" == "wurm" ]; then + fn_info_message_wurm + elif [ "${engine}" == "goldsrc" ]; then + fn_info_message_goldsrc + elif [ "${engine}" == "prism3d" ]; then + fn_info_message_prism3d + elif [ "${engine}" == "source" ]; then + fn_info_message_source + elif [ "${engine}" == "spark" ]; then + fn_info_message_spark + elif [ "${engine}" == "unreal" ]; then + fn_info_message_unreal + else + fn_print_error_nl "Unable to detect game server." + fi +} diff --git a/lgsm/functions/info_stats.sh b/lgsm/functions/info_stats.sh new file mode 100644 index 0000000000..0589770f69 --- /dev/null +++ b/lgsm/functions/info_stats.sh @@ -0,0 +1,173 @@ +#!/bin/bash +# LinuxGSM info_stats.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Collect optional Stats sent to LinuxGSM project. +# Uses Google analytics. + +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +info_distro.sh + +# remove uuid that was used in v20.2.0 and below +if [ -f "${datadir}/uuid.txt" ]; then + rm -f "${datadir:?}/uuid.txt" +fi + +# generate uuid's +# this consists of a standard uuid and a docker style name +# 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 + # download dictionary words + if [ ! -f "${datadir}/name-left.csv" ]; then + fn_fetch_file_github "lgsm/data" "name-left.csv" "${datadir}" "nochmodx" "norun" "forcedl" "nohash" + fi + if [ ! -f "${datadir}/name-right.csv" ]; then + fn_fetch_file_github "lgsm/data" "name-right.csv" "${datadir}" "nochmodx" "norun" "forcedl" "nohash" + fi + + # generate instance uuid + if [ -n "$(command -v uuidgen 2> /dev/null)" ]; then + uuid="$(uuidgen)" + else + uuid="$(cat /proc/sys/kernel/random/uuid)" + fi + + nameleft="$(shuf -n 1 "${datadir}/name-left.csv")" + 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 + echo "${nameleft}_${nameright}_${uuid}" > "${datadir}/uuid-install.txt" + fi +fi + +uuidinstance=$(cat "${datadir}/uuid-${selfname}.txt") +uuidinstall=$(cat "${datadir}/uuid-install.txt") +# machine-id is a unique id set on OS install +uuidhardware=$(cat "/etc/machine-id") + +# results are rounded up to reduce number of different results in analytics. +# nearest 100Mhz. +cpuusedmhzroundup="$(((cpuusedmhz + 99) / 100 * 100))" +# nearest 100MB +memusedroundup="$(((memused + 99) / 100 * 100))" + +# Spliting the metrics in to 3 propertys allows more accurate metrics on numbers of invidual instances, installs and hardware. +# Instance Property - UA-165287622-1 +# Install Property - UA-165287622-2 +# Hardware Property - UA-165287622-3 + +## Distro. +curl https://www.google-analytics.com/collect -d "tid=UA-165287622-1" -d "aip=1" -d "cid=${uuidinstance}" -d "t=event" -d "ec=distro" -d "ea=${distroname}" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 +curl https://www.google-analytics.com/collect -d "tid=UA-165287622-2" -d "aip=1" -d "cid=${uuidinstall}" -d "t=event" -d "ec=distro" -d "ea=${distroname}" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 +curl https://www.google-analytics.com/collect -d "tid=UA-165287622-3" -d "aip=1" -d "cid=${uuidhardware}" -d "t=event" -d "ec=distro" -d "ea=${distroname}" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 + +## Game Server Name. +curl https://www.google-analytics.com/collect -d "tid=UA-165287622-1" -d "aip=1" -d "cid=${uuidinstance}" -d "t=event" -d "ec=game" -d "ea=${gamename}" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 +curl https://www.google-analytics.com/collect -d "tid=UA-165287622-2" -d "aip=1" -d "cid=${uuidinstall}" -d "t=event" -d "ec=game" -d "ea=${gamename}" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 +curl https://www.google-analytics.com/collect -d "tid=UA-165287622-3" -d "aip=1" -d "cid=${uuidhardware}" -d "t=event" -d "ec=game" -d "ea=${gamename}" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 + +## LinuxGSM Version. +curl https://www.google-analytics.com/collect -d "tid=UA-165287622-1" -d "aip=1" -d "cid=${uuidinstance}" -d "t=event" -d "ec=version" -d "ea=${version}" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 +curl https://www.google-analytics.com/collect -d "tid=UA-165287622-2" -d "aip=1" -d "cid=${uuidinstall}" -d "t=event" -d "ec=version" -d "ea=${version}" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 +curl https://www.google-analytics.com/collect -d "tid=UA-165287622-3" -d "aip=1" -d "cid=${uuidhardware}" -d "t=event" -d "ec=version" -d "ea=${version}" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 + +## CPU usage of a game server. +if [ -n "${cpuusedmhzroundup}" ]; then + curl https://www.google-analytics.com/collect -d "tid=UA-165287622-1" -d "aip=1" -d "cid=${uuidinstance}" -d "t=event" -d "ec=cpuused" -d "ea=${cpuusedmhzroundup}MHz" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 + curl https://www.google-analytics.com/collect -d "tid=UA-165287622-2" -d "aip=1" -d "cid=${uuidinstall}" -d "t=event" -d "ec=cpuused" -d "ea=${cpuusedmhzroundup}MHz" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 + curl https://www.google-analytics.com/collect -d "tid=UA-165287622-3" -d "aip=1" -d "cid=${uuidhardware}" -d "t=event" -d "ec=cpuused" -d "ea=${cpuusedmhzroundup}MHz" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 +fi +## Ram usage of a game server. +if [ -n "${memusedroundup}" ]; then + curl https://www.google-analytics.com/collect -d "tid=UA-165287622-1" -d "aip=1" -d "cid=${uuidinstance}" -d "t=event" -d "ec=ramused" -d "ea=${memusedroundup}MB" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 + curl https://www.google-analytics.com/collect -d "tid=UA-165287622-2" -d "aip=1" -d "cid=${uuidinstall}" -d "t=event" -d "ec=ramused" -d "ea=${memusedroundup}MB" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 + curl https://www.google-analytics.com/collect -d "tid=UA-165287622-3" -d "aip=1" -d "cid=${uuidhardware}" -d "t=event" -d "ec=ramused" -d "ea=${memusedroundup}MB" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 +fi +## Disk usage of a game server. +if [ -n "${serverfilesdu}" ]; then + curl https://www.google-analytics.com/collect -d "tid=UA-165287622-1" -d "aip=1" -d "cid=${uuidinstance}" -d "t=event" -d "ec=diskused" -d "ea=${serverfilesdu}" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 + curl https://www.google-analytics.com/collect -d "tid=UA-165287622-2" -d "aip=1" -d "cid=${uuidinstall}" -d "t=event" -d "ec=diskused" -d "ea=${serverfilesdu}" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 + curl https://www.google-analytics.com/collect -d "tid=UA-165287622-3" -d "aip=1" -d "cid=${uuidhardware}" -d "t=event" -d "ec=diskused" -d "ea=${serverfilesdu}" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 +fi + +## CPU Model. +if [ -n "${cpumodel}" ]; then + curl https://www.google-analytics.com/collect -d "tid=UA-165287622-1" -d "aip=1" -d "cid=${uuidinstance}" -d "t=event" -d "ec=servercpu" -d "ea=${cpumodel} ${cpucores} cores" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 + curl https://www.google-analytics.com/collect -d "tid=UA-165287622-2" -d "aip=1" -d "cid=${uuidinstall}" -d "t=event" -d "ec=servercpu" -d "ea=${cpumodel} ${cpucores} cores" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 + curl https://www.google-analytics.com/collect -d "tid=UA-165287622-3" -d "aip=1" -d "cid=${uuidhardware}" -d "t=event" -d "ec=servercpu" -d "ea=${cpumodel} ${cpucores} cores" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 + +fi + +## CPU Frequency. +if [ -n "${cpufreqency}" ]; then + curl https://www.google-analytics.com/collect -d "tid=UA-165287622-1" -d "aip=1" -d "cid=${uuidinstance}" -d "t=event" -d "ec=servercpufreq" -d "ea=${cpufreqency} x${cpucores}" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 + curl https://www.google-analytics.com/collect -d "tid=UA-165287622-2" -d "aip=1" -d "cid=${uuidinstall}" -d "t=event" -d "ec=servercpufreq" -d "ea=${cpufreqency} x${cpucores}" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 + curl https://www.google-analytics.com/collect -d "tid=UA-165287622-3" -d "aip=1" -d "cid=${uuidhardware}" -d "t=event" -d "ec=servercpufreq" -d "ea=${cpufreqency} x${cpucores}" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 +fi + +## Server RAM. +if [ -n "${physmemtotal}" ]; then + curl https://www.google-analytics.com/collect -d "tid=UA-165287622-1" -d "aip=1" -d "cid=${uuidinstance}" -d "t=event" -d "ec=serverram" -d "ea=${physmemtotal}" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 + curl https://www.google-analytics.com/collect -d "tid=UA-165287622-2" -d "aip=1" -d "cid=${uuidinstall}" -d "t=event" -d "ec=serverram" -d "ea=${physmemtotal}" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 + curl https://www.google-analytics.com/collect -d "tid=UA-165287622-3" -d "aip=1" -d "cid=${uuidhardware}" -d "t=event" -d "ec=serverram" -d "ea=${physmemtotal}" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 +fi + +## Server Disk. +if [ -n "${totalspace}" ]; then + curl https://www.google-analytics.com/collect -d "tid=UA-165287622-1" -d "aip=1" -d "cid=${uuidinstance}" -d "t=event" -d "ec=serverdisk" -d "ea=${totalspace}" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 + curl https://www.google-analytics.com/collect -d "tid=UA-165287622-2" -d "aip=1" -d "cid=${uuidinstall}" -d "t=event" -d "ec=serverdisk" -d "ea=${totalspace}" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 + curl https://www.google-analytics.com/collect -d "tid=UA-165287622-3" -d "aip=1" -d "cid=${uuidhardware}" -d "t=event" -d "ec=serverdisk" -d "ea=${totalspace}" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 +fi + +## Alert Stats. +if [ "${discordalert}" == "on" ]; then + curl https://www.google-analytics.com/collect -d "tid=UA-165287622-1" -d "aip=1" -d "cid=${uuidinstance}" -d "t=event" -d "ec=alert" -d "ea=Discord" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 +fi +if [ "${emailalert}" == "on" ]; then + curl https://www.google-analytics.com/collect -d "tid=UA-165287622-1" -d "aip=1" -d "cid=${uuidinstance}" -d "t=event" -d "ec=alert" -d "ea=Email" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 +fi +if [ "${iftttalert}" == "on" ]; then + curl https://www.google-analytics.com/collect -d "tid=UA-165287622-1" -d "aip=1" -d "cid=${uuidinstance}" -d "t=event" -d "ec=alert" -d "ea=IFTTT" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 +fi +if [ "${mailgunalert}" == "on" ]; then + curl https://www.google-analytics.com/collect -d "tid=UA-165287622-1" -d "aip=1" -d "cid=${uuidinstance}" -d "t=event" -d "ec=alert" -d "ea=Mailgun" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 +fi +if [ "${pushbulletalert}" == "on" ]; then + curl https://www.google-analytics.com/collect -d "tid=UA-165287622-1" -d "aip=1" -d "cid=${uuidinstance}" -d "t=event" -d "ec=alert" -d "ea=Pushbullet" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 +fi +if [ "${pushoveralert}" == "on" ]; then + curl https://www.google-analytics.com/collect -d "tid=UA-165287622-1" -d "aip=1" -d "cid=${uuidinstance}" -d "t=event" -d "ec=alert" -d "ea=Pushover" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 +fi +if [ "${rocketchatalert}" == "on" ]; then + curl https://www.google-analytics.com/collect -d "tid=UA-165287622-1" -d "aip=1" -d "cid=${uuidinstance}" -d "t=event" -d "ec=alert" -d "ea=Rocket Chat" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 +fi +if [ "${slackalert}" == "on" ]; then + curl https://www.google-analytics.com/collect -d "tid=UA-165287622-1" -d "aip=1" -d "cid=${uuidinstance}" -d "t=event" -d "ec=alert" -d "ea=Slack" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 +fi +if [ "${telegramalert}" == "on" ]; then + curl https://www.google-analytics.com/collect -d "tid=UA-165287622-1" -d "aip=1" -d "cid=${uuidinstance}" -d "t=event" -d "ec=alert" -d "ea=Telegram" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 +fi + +## Summary Stats +curl https://www.google-analytics.com/collect -d "tid=UA-165287622-1" -d "aip=1" -d "cid=${uuidinstance}" -d "t=event" -d "ec=summary" -d "ea=GAME: ${gamename} | DISTRO: ${distroname} | CPU MODEL: ${cpumodel} ${cpucores} cores | RAM: ${physmemtotal} | DISK: ${totalspace}" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 +curl https://www.google-analytics.com/collect -d "tid=UA-165287622-2" -d "aip=1" -d "cid=${uuidinstall}" -d "t=event" -d "ec=summary" -d "ea=GAME: ${gamename} | DISTRO: ${distroname} | CPU MODEL: ${cpumodel} ${cpucores} cores | RAM: ${physmemtotal} | DISK: ${totalspace}" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 +curl https://www.google-analytics.com/collect -d "tid=UA-165287622-3" -d "aip=1" -d "cid=${uuidhardware}" -d "t=event" -d "ec=summary" -d "ea=GAME: ${gamename} | DISTRO: ${distroname} | CPU MODEL: ${cpumodel} ${cpucores} cores | RAM: ${physmemtotal} | DISK: ${totalspace}" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 + +fn_script_log_info "Send LinuxGSM stats" +fn_script_log_info "* uuid-${selfname}: ${uuidinstance}" +fn_script_log_info "* uuid-install: ${uuidinstall}" +fn_script_log_info "* uuid-hardware: ${uuidhardware}" +fn_script_log_info "* Game Name: ${gamename}" +fn_script_log_info "* Distro Name: ${distroname}" +fn_script_log_info "* Game Server CPU Used: ${cpuusedmhzroundup}MHz" +fn_script_log_info "* Game Server RAM Used: ${memusedroundup}MB" +fn_script_log_info "* Game Server Disk Used: ${serverfilesdu}" +fn_script_log_info "* Server CPU Model: ${cpumodel}" +fn_script_log_info "* Server CPU Frequency: ${cpufreqency}" +fn_script_log_info "* Server RAM: ${physmemtotal}" +fn_script_log_info "* Server Disk: ${totalspace}" diff --git a/lgsm/functions/install_complete.sh b/lgsm/functions/install_complete.sh new file mode 100644 index 0000000000..ad258b2245 --- /dev/null +++ b/lgsm/functions/install_complete.sh @@ -0,0 +1,18 @@ +#!/bin/bash +# LinuxGSM install_complete.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Prints installation completion message and hints. + +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +echo -e "" +echo -e "=================================" +echo -e "Install Complete!" +fn_script_log_info "Install Complete!" +echo -e "" +echo -e "To start server type:" +echo -e "./${selfname} start" +echo -e "" +core_exit.sh diff --git a/lgsm/functions/install_config.sh b/lgsm/functions/install_config.sh new file mode 100644 index 0000000000..35d7df7c6b --- /dev/null +++ b/lgsm/functions/install_config.sh @@ -0,0 +1,937 @@ +#!/bin/bash +# LinuxGSM install_config.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Creates default server configs. + +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +# Checks if server cfg dir exists, creates it if it doesn't. +fn_check_cfgdir() { + if [ ! -d "${servercfgdir}" ]; then + echo -e "creating ${servercfgdir} config directory." + fn_script_log_info "creating ${servercfgdir} config directory." + mkdir -pv "${servercfgdir}" + fi +} + +# Downloads default configs from Game-Server-Configs repo to lgsm/config-default. +fn_fetch_default_config() { + echo -e "" + echo -e "${lightyellow}Downloading ${gamename} Configs${default}" + echo -e "=================================" + echo -e "default configs from https://github.com/GameServerManagers/Game-Server-Configs" + fn_sleep_time + mkdir -p "${lgsmdir}/config-default/config-game" + githuburl="https://raw.githubusercontent.com/GameServerManagers/Game-Server-Configs/master" + for config in "${array_configs[@]}"; do + fn_fetch_file "${githuburl}/${gamedirname}/${config}" "${remote_fileurl_backup}" "GitHub" "Bitbucket" "${lgsmdir}/config-default/config-game" "${config}" "nochmodx" "norun" "forcedl" "nohash" + done +} + +# Copys default configs from Game-Server-Configs repo to server config location. +fn_default_config_remote() { + for config in "${array_configs[@]}"; do + # every config is copied + echo -e "copying ${config} config file." + fn_script_log_info "copying ${servercfg} config file." + if [ "${config}" == "${servercfgdefault}" ]; then + mkdir -p "${servercfgdir}" + cp -nv "${lgsmdir}/config-default/config-game/${config}" "${servercfgfullpath}" + elif [ "${shortname}" == "arma3" ] && [ "${config}" == "${networkcfgdefault}" ]; then + mkdir -p "${servercfgdir}" + cp -nv "${lgsmdir}/config-default/config-game/${config}" "${networkcfgfullpath}" + elif [ "${shortname}" == "dst" ] && [ "${config}" == "${clustercfgdefault}" ]; then + cp -nv "${lgsmdir}/config-default/config-game/${clustercfgdefault}" "${clustercfgfullpath}" + else + mkdir -p "${servercfgdir}" + cp -nv "${lgsmdir}/config-default/config-game/${config}" "${servercfgdir}/${config}" + fi + done + fn_sleep_time +} + +# Copys local default config to server config location. +fn_default_config_local() { + echo -e "copying ${servercfgdefault} config file." + cp -nv "${servercfgdir}/${servercfgdefault}" "${servercfgfullpath}" + fn_sleep_time +} + +# Changes some variables within the default configs. +# SERVERNAME to LinuxGSM +# PASSWORD to random password +fn_set_config_vars() { + if [ -f "${servercfgfullpath}" ]; then + random=$(tr -dc A-Za-z0-9_ < /dev/urandom | head -c 8 | xargs) + servername="LinuxGSM" + rconpass="admin${random}" + echo -e "changing hostname." + 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 + sed -i "s/SERVERNAME=SERVERNAME/SERVERNAME=${servername}/g" "${servercfgfullpath}" + 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}" + fi + echo -e "changing rcon/admin password." + fn_script_log_info "changing rcon/admin password." + if [ "${shortname}" == "squad" ]; then + sed -i "s/ADMINPASSWORD/${rconpass}/g" "${servercfgdir}/Rcon.cfg" + else + sed -i "s/ADMINPASSWORD/${rconpass}/g" "${servercfgfullpath}" + fi + fn_sleep_time + else + fn_script_log_warn "Config file not found, cannot alter it." + echo -e "Config file not found, cannot alter it." + fn_sleep_time + fi +} + +# Changes some variables within the default Don't Starve Together configs. +fn_set_dst_config_vars() { + ## cluster.ini + if grep -Fq "SERVERNAME" "${clustercfgfullpath}"; then + echo -e "changing server name." + fn_script_log_info "changing server name." + sed -i "s/SERVERNAME/LinuxGSM/g" "${clustercfgfullpath}" + fn_sleep_time + echo -e "changing shard mode." + fn_script_log_info "changing shard mode." + sed -i "s/USESHARDING/${sharding}/g" "${clustercfgfullpath}" + fn_sleep_time + echo -e "randomizing cluster key." + fn_script_log_info "randomizing cluster key." + randomkey=$(tr -dc A-Za-z0-9_ < /dev/urandom | head -c 8 | xargs) + sed -i "s/CLUSTERKEY/${randomkey}/g" "${clustercfgfullpath}" + fn_sleep_time + else + echo -e "${clustercfg} is already configured." + fn_script_log_info "${clustercfg} is already configured." + fi + + ## server.ini + # removing unnecessary options (dependent on sharding & shard type). + if [ "${sharding}" == "false" ]; then + sed -i "s/ISMASTER//g" "${servercfgfullpath}" + sed -i "/SHARDNAME/d" "${servercfgfullpath}" + elif [ "${master}" == "true" ]; then + sed -i "/SHARDNAME/d" "${servercfgfullpath}" + fi + + echo -e "changing shard name." + fn_script_log_info "changing shard name." + sed -i "s/SHARDNAME/${shard}/g" "${servercfgfullpath}" + fn_sleep_time + echo -e "changing master setting." + fn_script_log_info "changing master setting." + sed -i "s/ISMASTER/${master}/g" "${servercfgfullpath}" + fn_sleep_time + + ## worldgenoverride.lua + if [ "${cave}" == "true" ]; then + echo -e "defining ${shard} as cave in ${servercfgdir}/worldgenoverride.lua." + fn_script_log_info "defining ${shard} as cave in ${servercfgdir}/worldgenoverride.lua." + echo 'return { override_enabled = true, preset = "DST_CAVE", }' > "${servercfgdir}/worldgenoverride.lua" + fi + fn_sleep_time + echo -e "" +} + +# Lists local config file locations +fn_list_config_locations() { + echo -e "" + echo -e "${lightyellow}Config File Locations${default}" + echo -e "=================================" + if [ -n "${servercfgfullpath}" ]; then + if [ -f "${servercfgfullpath}" ]; then + echo -e "Game Server Config File: ${servercfgfullpath}" + elif [ -d "${servercfgfullpath}" ]; then + echo -e "Game Server Config Dir: ${servercfgfullpath}" + else + echo -e "Config file: ${red}${servercfgfullpath} (${red}FILE MISSING${default})" + fi + fi + echo -e "LinuxGSM Config: ${lgsmdir}/config-lgsm/${gameservername}" + echo -e "Documentation: https://docs.linuxgsm.com/configuration/game-server-config" +} + +if [ "${shortname}" == "sdtd" ]; then + gamedirname="7DaysToDie" + fn_default_config_local + fn_list_config_locations +elif [ "${shortname}" == "ac" ]; then + gamedirname="AssettoCorsa" + 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) + 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) + fn_fetch_default_config + fn_default_config_remote + fn_set_config_vars + fn_list_config_locations +elif [ "${shortname}" == "ark" ]; then + gamedirname="ARKSurvivalEvolved" + fn_check_cfgdir + array_configs+=(GameUserSettings.ini) + fn_fetch_default_config + fn_default_config_remote + fn_set_config_vars + fn_list_config_locations +elif [ "${shortname}" == "arma3" ]; then + gamedirname="Arma3" + fn_check_cfgdir + array_configs+=(server.cfg network.cfg) + fn_fetch_default_config + 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}" == "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) + fn_fetch_default_config + fn_default_config_remote + fn_set_config_vars + fn_list_config_locations +elif [ "${shortname}" == "bd" ]; then + gamedirname="BaseDefense" + array_configs+=(server.cfg) + fn_fetch_default_config + fn_default_config_remote + fn_set_config_vars + fn_list_config_locations +elif [ "${shortname}" == "bt" ]; then + gamedirname="Barotrauma" + fn_check_cfgdir + array_configs+=(serversettings.xml) + fn_fetch_default_config + fn_default_config_remote + fn_set_config_vars + fn_list_config_locations +elif [ "${shortname}" == "btl" ]; then + gamedirname="BattalionLegacy" + fn_check_cfgdir + 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) + 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) + 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) + 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) + 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) + 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) + 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) + fn_fetch_default_config + 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) + 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) + 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) + 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) + 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) + 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) + 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) + 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) + 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) + 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) + 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) + fn_fetch_default_config + fn_default_config_remote + fn_set_config_vars + fn_list_config_locations +elif [ "${shortname}" == "dayz" ]; then + gamedirname="DayZ" + 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}" == "dod" ]; then + gamedirname="DayOfDefeat" + 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) + fn_fetch_default_config + fn_default_config_remote + fn_list_config_locations +elif [ "${shortname}" == "dods" ]; then + gamedirname="DayOfDefeatSource" + 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) + 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) + fn_fetch_default_config + fn_default_config_remote + fn_set_config_vars + fn_list_config_locations +elif [ "${shortname}" == "dst" ]; then + gamedirname="DontStarveTogether" + fn_check_cfgdir + 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) + 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) + 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) + 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) + fn_fetch_default_config + 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) + 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) + 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) + 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) + 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) + 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) + 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) + 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) + 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) + 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) + 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) + 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) + 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) + 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) + fn_fetch_default_config + fn_default_config_remote + fn_set_config_vars + fn_list_config_locations +elif [ "${shortname}" == "mc" ] || [ "${shortname}" == "pmc" ]; then + gamedirname="Minecraft" + 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) + 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) + fn_fetch_default_config + fn_default_config_remote + fn_set_config_vars + fn_list_config_locations +elif [ "${shortname}" == "mh" ]; then + gamedirname="Mordhau" + fn_check_cfgdir + 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) + 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) + 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) + fn_fetch_default_config + fn_default_config_remote + fn_set_config_vars + fn_list_config_locations +elif [ "${shortname}" == "mta" ]; then + gamedirname="MultiTheftAuto" + fn_check_cfgdir + array_configs+=(acl.xml mtaserver.conf vehiclecolors.conf) + fn_fetch_default_config + fn_default_config_remote + fn_list_config_locations +elif [ "${shotname}" == "mom" ]; then + gamedirname="MemoriesofMars" + array_configs+=(DedicatedServerConfig.cfg) + fn_fetch_default_config + fn_default_config_remote + fn_set_config_vars + fn_list_config_locations +elif [ "${shortname}" == "pvr" ]; then + gamedirname="PavlovVR" + fn_check_cfgdir + 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) + fn_fetch_default_config + fn_default_config_remote + fn_set_config_vars + fn_list_config_locations +elif [ "${shortname}" == "pz" ]; then + gamedirname="ProjectZomboid" + fn_check_cfgdir + array_configs+=(server.ini) + fn_fetch_default_config + 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) + fn_fetch_default_config + 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) + 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) + 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) + 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) + fn_fetch_default_config + fn_default_config_remote + fn_set_config_vars +elif [ "${shortname}" == "qw" ]; then + gamedirname="QuakeWorld" + 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) + 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) + fn_fetch_default_config + fn_default_config_remote + fn_set_config_vars + fn_list_config_locations +elif [ "${shortname}" == "rust" ]; then + gamedirname="Rust" + fn_check_cfgdir + array_configs+=(server.cfg) + fn_fetch_default_config + fn_default_config_remote + fn_list_config_locations +elif [ "${shortname}" == "scpsl" ] || [ "${shortname}" == "scpslsm" ]; then + gamedirname="SCPSecretLaboratory" + 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) + 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) + 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) + 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) + 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) + 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) + 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) + 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) + 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) + 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) + 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) + 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) + 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) + 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) + 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) + 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) + fn_fetch_default_config + fn_default_config_remote + fn_set_config_vars + fn_list_config_locations +elif [ "${shortname}" == "tu" ]; then + gamedirname="TowerUnite" + fn_check_cfgdir + 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) + 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) + 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) + 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) + 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) + 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) + 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) + 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) + 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) + fn_fetch_default_config + fn_default_config_remote + fn_set_config_vars +elif [ "${shortname}" == "wurm" ]; then + gamedirname="WurmUnlimited" + 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) + 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) + fn_fetch_default_config + fn_default_config_remote + fn_set_config_vars + fn_list_config_locations +fi diff --git a/lgsm/functions/install_dst_token.sh b/lgsm/functions/install_dst_token.sh new file mode 100644 index 0000000000..50bc7ed972 --- /dev/null +++ b/lgsm/functions/install_dst_token.sh @@ -0,0 +1,45 @@ +#!/bin/bash +# LinuxGSM install_dst_token.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Configures Don't Starve Together cluster with given token. + +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +echo -e "" +echo -e "${lightyellow}Enter ${gamename} Cluster Token${default}" +echo -e "=================================" +fn_sleep_time +echo -e "A cluster token is required to run this server!" +echo -e "Follow the instructions in this link to obtain this key:" +echo -e "https://linuxgsm.com/dst-auth-token" +echo -e "" +if [ -z "${autoinstall}" ]; then + overwritetoken="true" + if [ -s "${clustercfgdir}/cluster_token.txt" ]; then + echo -e "The cluster token is already set. Do you want to overwrite it?" + fn_script_log_info "Don't Starve Together cluster token is already set" + if fn_prompt_yn "Continue?" N; then + overwritetoken="true" + else + overwritetoken="false" + fi + fi + if [ "${overwritetoken}" == "true" ]; then + echo -e "Once you have the cluster token, enter it below" + echo -n "Cluster Token: " + read -r token + mkdir -pv "${clustercfgdir}" + echo -e "${token}" > "${clustercfgdir}/cluster_token.txt" + if [ -f "${clustercfgdir}/cluster_token.txt" ]; then + echo -e "Don't Starve Together cluster token created" + fn_script_log_info "Don't Starve Together cluster token created" + fi + unset overwritetoken + fi +else + echo -e "You can add your cluster token using the following command" + echo -e "./${selfname} cluster-token" +fi +echo -e "" diff --git a/lgsm/functions/install_eula.sh b/lgsm/functions/install_eula.sh new file mode 100644 index 0000000000..3e51fac714 --- /dev/null +++ b/lgsm/functions/install_eula.sh @@ -0,0 +1,47 @@ +#!/bin/bash +# LinuxGSM install_eula.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Gets user to accept the EULA. + +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 + 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" +fi + +echo -e "" +echo -e "${lightyellow}Accept ${gamename} EULA${default}" +echo -e "=================================" +fn_sleep_time +echo -e "You are required to accept the EULA:" +echo -e "${eulaurl}" +echo -e "" +if [ -z "${autoinstall}" ]; then + echo -e "By continuing you are indicating your agreement to the EULA." + echo -e "" + if ! fn_prompt_yn "Continue?" Y; then + exitcode=0 + core_exit.sh + fi +elif [ "${commandname}" == "START" ]; then + fn_print_info "By continuing you are indicating your agreement to the EULA." + sleep 5 +else + echo -e "By using auto-install you are indicating your agreement to the EULA." + sleep 5 +fi + +if [ "${shortname}" == "ts3" ]; then + touch "${executabledir}/.ts3server_license_accepted" +elif [ "${shortname}" == "mc" ] || [ "${shortname}" == "pmc" ]; then + touch "${serverfiles}/eula.txt" + echo -e "eula=true" > "${serverfiles}/eula.txt" +elif [ "${shortname}" == "ut" ]; then + : +fi diff --git a/lgsm/functions/install_factorio_save.sh b/lgsm/functions/install_factorio_save.sh new file mode 100644 index 0000000000..f5fdb8a041 --- /dev/null +++ b/lgsm/functions/install_factorio_save.sh @@ -0,0 +1,15 @@ +#!/bin/bash +# LinuxGSM install_factorio_save.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Creates the initial save file for Factorio. + +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +echo -e "" +echo -e "${lightyellow}Creating initial Factorio savefile${default}" +echo -e "=================================" +fn_sleep_time +check_glibc.sh +"${executabledir}"/factorio --create "${serverfiles}/save1" diff --git a/lgsm/functions/install_gslt.sh b/lgsm/functions/install_gslt.sh new file mode 100644 index 0000000000..1ae1ef3b01 --- /dev/null +++ b/lgsm/functions/install_gslt.sh @@ -0,0 +1,47 @@ +#!/bin/bash +# LinuxGSM install_gslt.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Configures GSLT. + +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +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 + 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 + echo -e "GSLT is an optional feature for ${gamename} server" + fn_script_log_info "GSLT is an optional feature for ${gamename} server" +fi + +echo -e "Get more info and a token here:" +echo -e "https://docs.linuxgsm.com/steamcmd/gslt" +fn_script_log_info "Get more info and a token here:" +fn_script_log_info "https://docs.linuxgsm.com/steamcmd/gslt" +echo -e "" +if [ -z "${autoinstall}" ]; then + if [ "${shortname}" != "tu" ]; then + echo -e "Enter token below (Can be blank)." + echo -n "GSLT TOKEN: " + read -r token + if ! grep -q "^gslt=" "${configdirserver}/${selfname}.cfg" > /dev/null 2>&1; then + echo -e "\ngslt=\"${token}\"" >> "${configdirserver}/${selfname}.cfg" + else + sed -i -e "s/gslt=\"[^\"]*\"/gslt=\"${token}\"/g" "${configdirserver}/${selfname}.cfg" + fi + fi +fi +fn_sleep_time +if [ "${shortname}" == "tu" ]; then + echo -e "The GSLT can be changed by editing ${servercfgdir}/${servercfg}." + fn_script_log_info "The GSLT can be changed by editing ${servercfgdir}/${servercfg}." +else + echo -e "The GSLT can be changed by editing ${configdirserver}/${selfname}.cfg." + fn_script_log_info "The GSLT can be changed by editing ${configdirserver}/${selfname}.cfg." +fi +echo -e "" diff --git a/lgsm/functions/install_header.sh b/lgsm/functions/install_header.sh new file mode 100644 index 0000000000..4cf067f8f4 --- /dev/null +++ b/lgsm/functions/install_header.sh @@ -0,0 +1,22 @@ +#!/bin/bash +# LinuxGSM install_header.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Prints installation header. + +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +clear +fn_print_ascii_logo +fn_sleep_time +echo -e "=================================" +echo -e "${lightyellow}Linux${default}GSM_" +echo -e "by Daniel Gibbs" +echo -e "${lightblue}Version:${default} ${version}" +echo -e "${lightblue}Game:${default} ${gamename}" +echo -e "${lightblue}Website:${default} https://linuxgsm.com" +echo -e "${lightblue}Contributors:${default} https://linuxgsm.com/contrib" +echo -e "${lightblue}Sponsor:${default} https://linuxgsm.com/sponsor" +echo -e "=================================" +fn_sleep_time diff --git a/lgsm/functions/install_logs.sh b/lgsm/functions/install_logs.sh new file mode 100644 index 0000000000..80a55fb944 --- /dev/null +++ b/lgsm/functions/install_logs.sh @@ -0,0 +1,100 @@ +#!/bin/bash +# LinuxGSM install_logs.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Creates log directories. + +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +if [ "${checklogs}" != "1" ]; then + echo -e "" + echo -e "${lightyellow}Creating log directories${default}" + echo -e "=================================" +fi +fn_sleep_time +# Create LinuxGSM logs. +echo -en "installing log dir: ${logdir}..." +mkdir -p "${logdir}" +if [ $? != 0 ]; then + fn_print_fail_eol_nl + core_exit.sh +else + fn_print_ok_eol_nl +fi + +echo -en "installing LinuxGSM log dir: ${lgsmlogdir}..." +mkdir -p "${lgsmlogdir}" +if [ $? != 0 ]; then + fn_print_fail_eol_nl + core_exit.sh +else + fn_print_ok_eol_nl +fi +echo -en "creating LinuxGSM log: ${lgsmlog}..." +touch "${lgsmlog}" +if [ $? != 0 ]; then + fn_print_fail_eol_nl + core_exit.sh +else + fn_print_ok_eol_nl +fi +# Create Console logs. +if [ "${consolelogdir}" ]; then + echo -en "installing console log dir: ${consolelogdir}..." + mkdir -p "${consolelogdir}" + if [ $? != 0 ]; then + fn_print_fail_eol_nl + core_exit.sh + else + fn_print_ok_eol_nl + fi + echo -en "creating console log: ${consolelog}..." + if ! touch "${consolelog}"; then + fn_print_fail_eol_nl + core_exit.sh + else + fn_print_ok_eol_nl + fi +fi + +# Create Game logs. +if [ "${gamelogdir}" ] && [ ! -d "${gamelogdir}" ]; then + echo -en "installing game log dir: ${gamelogdir}..." + if ! mkdir -p "${gamelogdir}"; then + fn_print_fail_eol_nl + core_exit.sh + else + fn_print_ok_eol_nl + fi +fi + +# Symlink to gamelogdir +# unless gamelogdir is within logdir. +# e.g serverfiles/log is not within log/: symlink created +# log/server is in log/: symlink not created +if [ "${gamelogdir}" ]; then + if [ "${gamelogdir:0:${#logdir}}" != "${logdir}" ]; then + echo -en "creating symlink to game log dir: ${logdir}/server -> ${gamelogdir}..." + if ! ln -nfs "${gamelogdir}" "${logdir}/server"; then + fn_print_fail_eol_nl + core_exit.sh + else + fn_print_ok_eol_nl + fi + fi +fi + +# If server uses SteamCMD create a symbolic link to the Steam logs. +if [ -d "${rootdir}/Steam/logs" ]; then + if [ ! -L "${logdir}/steamcmd" ]; then + echo -en "creating symlink to steam log dir: ${logdir}/steamcmd -> ${rootdir}/Steam/logs..." + if ! ln -nfs "${rootdir}/Steam/logs" "${logdir}/steamcmd"; then + fn_print_fail_eol_nl + core_exit.sh + else + fn_print_ok_eol_nl + fi + fi +fi +fn_script_log_info "Logs installed" diff --git a/lgsm/functions/install_mta_resources.sh b/lgsm/functions/install_mta_resources.sh new file mode 100644 index 0000000000..011ad9b71d --- /dev/null +++ b/lgsm/functions/install_mta_resources.sh @@ -0,0 +1,12 @@ +#!/bin/bash +# LinuxGSM install_mta_resources.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Installs the libmysqlclient for database functions on the server and optionally installs default resources required to run the server. + +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +fn_print_information_nl "${gamename} will not function without resources!" +echo -e " * install default resources using ./${selfname} install-default-resources" +echo -e " * download resources from https://community.multitheftauto.com" diff --git a/lgsm/functions/install_retry.sh b/lgsm/functions/install_retry.sh new file mode 100644 index 0000000000..a36b4fb38d --- /dev/null +++ b/lgsm/functions/install_retry.sh @@ -0,0 +1,16 @@ +#!/bin/bash +# LinuxGSM install_retry.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Asks for installation retry after failure. + +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +if fn_prompt_yn "Retry install?" Y; then + command_install.sh + core_exit.sh +else + exitcode=0 + core_exit.sh +fi diff --git a/lgsm/functions/install_server_dir.sh b/lgsm/functions/install_server_dir.sh new file mode 100644 index 0000000000..658f4360ca --- /dev/null +++ b/lgsm/functions/install_server_dir.sh @@ -0,0 +1,26 @@ +#!/bin/bash +# LinuxGSM install_server_dir.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Creates the server directory. + +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +echo -e "" +echo -e "${lightyellow}Server Directory${default}" +echo -e "=================================" +fn_sleep_time +if [ -d "${serverfiles}" ]; then + fn_print_warning_nl "A server is already installed here." +fi +pwd +if [ -z "${autoinstall}" ]; then + if ! fn_prompt_yn "Continue?" Y; then + exitcode=0 + core_exit.sh + fi +fi +if [ ! -d "${serverfiles}" ]; then + mkdir -v "${serverfiles}" +fi diff --git a/lgsm/functions/install_server_files.sh b/lgsm/functions/install_server_files.sh new file mode 100644 index 0000000000..e550e14550 --- /dev/null +++ b/lgsm/functions/install_server_files.sh @@ -0,0 +1,255 @@ +#!/bin/bash +# LinuxGSM install_server_files.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Installs server files. + +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +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" + 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" + 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" + 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" + 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" + 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" + elif [ "${shortname}" == "cod4" ]; then + remote_fileurl="http://linuxgsm.download/CallOfDuty4/cod4x18_lnxded.tar.xz" + local_filedir="${tmpdir}" + local_filename="cod4x18_lnxded.tar.xz" + chmodx="nochmodx" run="norun" + force="noforce" + md5="d255b59b9756d7dbead67718208512ee" + 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" + 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" + 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" + 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" + 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" + 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" + 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" + 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" + 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" + 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" + 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" + 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" + 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" + 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" + 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" + 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" + 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" + 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" + elif [ "${shortname}" == "zmr" ]; then + remote_fileurl="http://linuxgsm.download/ZombieMasterReborn/zombie_master_reborn_b6_1.tar.xz" + local_filedir="${tmpdir}" + local_filename="zombie_master_reborn_b6_1.tar.xz" + 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}" +} + +echo -e "" +echo -e "${lightyellow}Installing ${gamename} Server${default}" +echo -e "=================================" +fn_sleep_time + +if [ "${appid}" ]; then + remotelocation="SteamCMD" + fn_dl_steamcmd +fi + +if [ "${shortname}" == "ts3" ]; then + update_ts3.sh +elif [ "${shortname}" == "mc" ]; then + install_eula.sh + update_minecraft.sh +elif [ "${shortname}" == "mcb" ]; then + update_minecraft_bedrock.sh +elif [ "${shortname}" == "pmc" ]; then + install_eula.sh + update_papermc.sh +elif [ "${shortname}" == "wmc" ] || [ "${shortname}" == "vpmc" ]; then + update_papermc.sh +elif [ "${shortname}" == "mta" ]; then + update_mta.sh +elif [ "${shortname}" == "fctr" ]; then + update_factorio.sh + install_factorio_save.sh +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 + fi + fn_install_server_files +fi + +if [ -z "${autoinstall}" ]; then + echo -e "" + echo -e "=================================" + if ! fn_prompt_yn "Was the install successful?" Y; then + install_retry.sh + fi +fi diff --git a/lgsm/functions/install_squad_license.sh b/lgsm/functions/install_squad_license.sh new file mode 100644 index 0000000000..181646e85b --- /dev/null +++ b/lgsm/functions/install_squad_license.sh @@ -0,0 +1,25 @@ +#!/bin/bash +# LinuxGSM install_squad_license.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Configures the Squad server's license. + +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +echo -e "" +echo -e "${lightyellow}Squad Server License${default}" +echo -e "=================================" +fn_sleep_time +echo -e "Server license is an optional feature for ${gamename} server" +fn_script_log_info "Server license is an optional feature for ${gamename} server" + +echo -e "Get more info and a server license here:" +echo -e "http://forums.joinsquad.com/topic/16519-server-licensing-general-info/" +fn_script_log_info "Get more info and a server license here:" +fn_script_log_info "http://forums.joinsquad.com/topic/16519-server-licensing-general-info/" +echo -e "" +fn_sleep_time +echo -e "The Squad server license can be changed by editing ${servercfgdir}/License.cfg." +fn_script_log_info "The Squad server license can be changed by editing ${selfname}." +echo -e "" diff --git a/lgsm/functions/install_stats.sh b/lgsm/functions/install_stats.sh new file mode 100644 index 0000000000..d3b45b40b8 --- /dev/null +++ b/lgsm/functions/install_stats.sh @@ -0,0 +1,28 @@ +#!/bin/bash +# LinuxGSM install_stats.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Enabled LinuxGSM Stats. + +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +echo -e "" +echo -e "${lightyellow}LinuxGSM Stats${default}" +echo -e "=================================" +fn_sleep_time +echo -e "Assist LinuxGSM development by sending anonymous stats to developers." +echo -e "More info: https://docs.linuxgsm.com/configuration/linuxgsm-stats" +echo -e "The following info will be sent:" +echo -e "* game server" +echo -e "* distro" +echo -e "* game server resource usage" +echo -e "* server hardware info" +if [ -z "${autoinstall}" ]; then + if fn_prompt_yn "Allow anonymous usage statistics?" Y; then + echo "stats=\"on\"" >> "${configdirserver}/common.cfg" + fn_print_information_nl "Stats setting is now enabled in common.cfg." + fi +else + fn_print_information_nl "auto-install leaves stats off by default. Stats can be enabled in common.cfg" +fi diff --git a/lgsm/functions/install_steamcmd.sh b/lgsm/functions/install_steamcmd.sh new file mode 100644 index 0000000000..b1e64a42cd --- /dev/null +++ b/lgsm/functions/install_steamcmd.sh @@ -0,0 +1,14 @@ +#!/bin/bash +# LinuxGSM install_steamcmd.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Downloads SteamCMD on install. + +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +echo -e "" +echo -e "${lightyellow}Installing SteamCMD${default}" +echo -e "=================================" +fn_sleep_time +check_steamcmd.sh diff --git a/lgsm/functions/install_ts3db.sh b/lgsm/functions/install_ts3db.sh new file mode 100644 index 0000000000..ed879cd287 --- /dev/null +++ b/lgsm/functions/install_ts3db.sh @@ -0,0 +1,76 @@ +#!/bin/bash +# LinuxGSM install_ts3db.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Installs the database server MariaDB for TeamSpeak 3. + +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +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}" + local exitcode=$? + 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 + + echo -e "" + echo -e "${lightyellow}Configure ${gamename} Server for MariaDB${default}" + echo -e "=================================" + fn_sleep_time + read -rp "Enter MariaDB hostname: " mariahostname + read -rp "Enter MariaDB port: " mariaport + read -rp "Enter MariaDB username: " mariausername + read -rp "Enter MariaDB password: " mariapassword + read -rp "Enter MariaDB database name: " mariadbname + 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}'" + } >> "${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}" + sed -i "s/dbsqlcreatepath=create_sqlite\//dbsqlcreatepath=create_mariadb\//g" "${servercfgfullpath}" + echo -e "updating ts3db_mariadb.ini." + fn_sleep_time +} + +echo -e "" +echo -e "${lightyellow}Select Database${default}" +echo -e "=================================" +fn_sleep_time +if [ -z "${autoinstall}" ]; then + if fn_prompt_yn "Do you want to use MariaDB instead of sqlite? (MariaDB must be pre-configured)" N; then + fn_install_ts3db_mariadb + fi +else + fn_print_information_nl "./${selfname} auto-install is uses sqlite. For MariaDB use ./${selfname} install" +fi + +install_eula.sh + +echo -e "" +echo -e "${lightyellow}Getting Privilege Key${default}" +echo -e "=================================" +fn_sleep_time +fn_print_information_nl "Save these details for later." +fn_print_information_nl "Key also saved in:" +echo -e "${serverfiles}/privilege_key.txt" +cd "${executabledir}" || exit +./ts3server_startscript.sh start inifile=ts3-server.ini 2>&1 | tee "${serverfiles}/privilege_key.txt" +sleep 5 +./ts3server_startscript.sh stop diff --git a/lgsm/functions/install_ut2k4_key.sh b/lgsm/functions/install_ut2k4_key.sh new file mode 100644 index 0000000000..124052d05d --- /dev/null +++ b/lgsm/functions/install_ut2k4_key.sh @@ -0,0 +1,30 @@ +#!/bin/bash +# LinuxGSM install_ut2k4_key.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Activates ut2k4 server with given key. + +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +echo -e "" +echo -e "${lightyellow}Enter ${gamename} CD Key${default}" +echo -e "=================================" +fn_sleep_time +echo -e "To get your server listed on the Master Server list" +echo -e "you must get a free CD key. Get a key here:" +echo -e "https://www.epicgames.com/unrealtournament/forums/cdkey.php?2004" +echo -e "" +if [ -z "${autoinstall}" ]; then + echo -e "Once you have the key enter it below" + echo -n "KEY: " + read -r CODE + echo -e ""\""CDKey"\""="\""${CODE}"\""" > "${systemdir}/cdkey" + if [ -f "${systemdir}/cdkey" ]; then + fn_script_log_info "UT2K4 Server CD Key created" + fi +else + echo -e "You can add your key using the following command" + echo -e "./${selfname} server-cd-key" +fi +echo -e "" diff --git a/lgsm/functions/mods_core.sh b/lgsm/functions/mods_core.sh new file mode 100644 index 0000000000..8e4ade7716 --- /dev/null +++ b/lgsm/functions/mods_core.sh @@ -0,0 +1,755 @@ +#!/bin/bash +# LinuxGSM command_mods_install.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Core functions for mods list/install/update/remove + +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +# Files and Directories. +modsdir="${lgsmdir}/mods" +modstmpdir="${modsdir}/tmp" +extractdest="${modstmpdir}/extract" +modsinstalledlist="installed-mods.txt" +modsinstalledlistfullpath="${modsdir}/${modsinstalledlist}" + +## Installation. + +# Download management. +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 + fn_print_failure "An issue occurred downloading ${modprettyname}" + fn_script_log_fatal "An issue occurred downloading ${modprettyname}" + core_exit.sh + fi + if [ ! -d "${extractdest}" ]; then + mkdir -p "${extractdest}" + fi + fn_dl_extract "${modstmpdir}" "${modfilename}" "${extractdest}" +} + +# 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" + # Total files and directories for the mod, to output to the user + fileswc=$(find "${extractdest}" | wc -l) + # Total uppercase files and directories for the mod, to output to the user + 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) + while read -r src; do + # 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=$? + if [ "${exitcode}" != 0 ]; then + fn_print_fail_eol_nl + core_exit.sh + fi + fi + done < <(find "${extractdest}" -depth -name '*[[:upper:]]*') + fn_print_ok_eol_nl + fi +} + +# Create ${modcommand}-files.txt containing the full extracted file/directory list. +fn_mod_create_filelist() { + echo -en "building ${modcommand}-files.txt..." + fn_sleep_time + # ${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 + fn_script_log_fatal "Building ${modsdir}/${modcommand}-files.txt" + core_exit.sh + else + fn_print_ok_eol_nl + fn_script_log_pass "Building ${modsdir}/${modcommand}-files.txt" + fi + # Adding removed files if needed. + if [ -f "${modsdir}/.removedfiles.tmp" ]; then + cat "${modsdir}/.removedfiles.tmp" >> "${modsdir}/${modcommand}-files.txt" + fi +} + +# Copy the mod into serverfiles. +fn_mod_copy_destination() { + echo -en "copying ${modprettyname} to ${modinstalldir}..." + fn_sleep_time + cp -Rf "${extractdest}/." "${modinstalldir}/" + local exitcode=$? + if [ "${exitcode}" != 0 ]; then + fn_print_fail_eol_nl + fn_script_log_fatal "Copying ${modprettyname} to ${modinstalldir}" + else + fn_print_ok_eol_nl + fn_script_log_pass "Copying ${modprettyname} to ${modinstalldir}" + fi +} + +# Add the mod to the installed-mods.txt. +fn_mod_add_list() { + if [ -z "$(sed -n "/^${modcommand}$/p" "${modsinstalledlistfullpath}")" ]; then + echo -e "${modcommand}" >> "${modsinstalledlistfullpath}" + fn_script_log_info "${modcommand} added to ${modsinstalledlist}" + fi +} + +# Prevent sensitive directories from being erased upon uninstall by removing them from: ${modcommand}-files.txt. +fn_mod_tidy_files_list() { + # Check file list validity. + fn_check_mod_files_list + # Output to the user + echo -en "tidy up ${modcommand}-files.txt..." + fn_sleep_time + fn_script_log_info "Tidy up ${modcommand}-files.txt" + # Lines/files to remove from file list (end with ";" separator). + removefromlist="cfg;addons;RustDedicated_Data;RustDedicated_Data\/Managed;RustDedicated_Data\/Managed\/x86;RustDedicated_Data\/Managed\/x64;" + # Loop through files to remove from file 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 + # Put current file into test variable. + removefilevar=$(echo -e "${removefromlist}" | awk -F ';' -v x=${filesindex} '{ print $x }') + # Delete line(s) matching exactly. + sed -i "/^${removefilevar}$/d" "${modsdir}/${modcommand}-files.txt" + # Exit on error. + local exitcode=$? + if [ "${exitcode}" != 0 ]; then + fn_print_fail_eol_nl + fn_script_log_fatal "Error while tidying line: ${removefilevar} from: ${modsdir}/${modcommand}-files.txt" + core_exit.sh + break + fi + done + fn_print_ok_eol_nl + # Sourcemod fix + # Remove metamod from sourcemod fileslist. + if [ "${modcommand}" == "sourcemod" ]; then + # Remove addons/metamod & addons/metamod/sourcemod.vdf from ${modcommand}-files.txt. + sed -i "/^addons\/metamod$/d" "${modsdir}/${modcommand}-files.txt" + sed -i "/^addons\/metamod\/sourcemod.vdf$/d" "${modsdir}/${modcommand}-files.txt" + fi + + # Remove common paths from deletion list (Add your sourcemod mod here) + if [ "${modcommand}" == "gokz" ] || [ "${modcommand}" == "ttt" ] || [ "${modcommand}" == "steamworks" ] || [ "${modcommand}" == "get5" ]; then + sed -i "/^addons\/sourcemod$/d" "${modsdir}/${modcommand}-files.txt" + sed -i "/^addons\/sourcemod\/configs$/d" "${modsdir}/${modcommand}-files.txt" + sed -i "/^addons\/sourcemod\/extensions$/d" "${modsdir}/${modcommand}-files.txt" + sed -i "/^addons\/sourcemod\/logs$/d" "${modsdir}/${modcommand}-files.txt" + sed -i "/^addons\/sourcemod\/plugins$/d" "${modsdir}/${modcommand}-files.txt" + sed -i "/^addons\/sourcemod\/plugins\/disabled$/d" "${modsdir}/${modcommand}-files.txt" + sed -i "/^addons\/sourcemod\/scripting$/d" "${modsdir}/${modcommand}-files.txt" + sed -i "/^addons\/sourcemod\/scripting\/include$/d" "${modsdir}/${modcommand}-files.txt" + sed -i "/^addons\/sourcemod\/translations$/d" "${modsdir}/${modcommand}-files.txt" + # Don't delete directories of translations like 'fr', 'sv', 'de', etc + sed -i "/^addons\/sourcemod\/translations\/[A-Za-z0-9_]*$/d" "${modsdir}/${modcommand}-files.txt" + sed -i "/^cfg\/sourcemod$/d" "${modsdir}/${modcommand}-files.txt" + sed -i "/^maps$/d" "${modsdir}/${modcommand}-files.txt" + sed -i "/^materialss$/d" "${modsdir}/${modcommand}-files.txt" + sed -i "/^materials\/models$/d" "${modsdir}/${modcommand}-files.txt" + sed -i "/^materials\/models\/weapons$/d" "${modsdir}/${modcommand}-files.txt" + sed -i "/^materials\/darkness$/d" "${modsdir}/${modcommand}-files.txt" + sed -i "/^materials\/decals$/d" "${modsdir}/${modcommand}-files.txt" + sed -i "/^materials\/overlays$/d" "${modsdir}/${modcommand}-files.txt" + sed -i "/^models$/d" "${modsdir}/${modcommand}-files.txt" + sed -i "/^models\/weapons$/d" "${modsdir}/${modcommand}-files.txt" + sed -i "/^sound$/d" "${modsdir}/${modcommand}-files.txt" + sed -i "/^sound\/weapons$/d" "${modsdir}/${modcommand}-files.txt" + fi + + # Remove paths of specific mods from deletion list + if [ "${modcommand}" == "gokz" ]; then + sed -i "/^addons\/sourcemod\/scripting\/include\/smjansson.inc$/d" "${modsdir}/${modcommand}-files.txt" + sed -i "/^addons\/sourcemod\/scripting\/include\/GlobalAPI-Core.inc$/d" "${modsdir}/${modcommand}-files.txt" + sed -i "/^addons\/sourcemod\/scripting\/include\/sourcebanspp.inc$/d" "${modsdir}/${modcommand}-files.txt" + sed -i "/^addons\/sourcemod\/scripting\/include\/autoexecconfig.inc$/d" "${modsdir}/${modcommand}-files.txt" + sed -i "/^addons\/sourcemod\/scripting\/include\/colorvariables.inc$/d" "${modsdir}/${modcommand}-files.txt" + sed -i "/^addons\/sourcemod\/scripting\/include\/movementapi.inc$/d" "${modsdir}/${modcommand}-files.txt" + sed -i "/^addons\/sourcemod\/scripting\/include\/movement.inc$/d" "${modsdir}/${modcommand}-files.txt" + sed -i "/^addons\/sourcemod\/scripting\/include\/dhooks.inc$/d" "${modsdir}/${modcommand}-files.txt" + sed -i "/^addons\/sourcemod\/scripting\/include\/updater.inc$/d" "${modsdir}/${modcommand}-files.txt" + fi +} + +## Information Gathering. + +# Get details of a mod any (relevant and unique, such as full mod name or install command) value. +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 + # 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 + # When "MOD" is found. + if [ "${mods_global_array[index]}" == "MOD" ]; then + # Get info. + fn_mods_define + modinfocommand="1" + break + fi + done + fi + # Exit the loop if job is done. + if [ "${modinfocommand}" == "1" ]; then + break + fi + done + + # What happens if mod is not found. + if [ "${modinfocommand}" == "0" ]; then + fn_script_log_error "Could not find information for ${currentmod}" + fn_print_error_nl "Could not find information for ${currentmod}" + core_exit.sh + fi +} + +# 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]}" +} + +# Builds list of installed mods. +# using installed-mods.txt grabing mod info from mods_list.sh. +fn_mods_installed_list() { + fn_mods_count_installed + # Set/reset variables. + installedmodsline="1" + installedmodslist=() + modprettynamemaxlength="0" + modsitemaxlength="0" + moddescriptionmaxlength="0" + modcommandmaxlength="0" + # Loop through every line of the installed mods list ${modsinstalledlistfullpath}. + while [ "${installedmodsline}" -le "${installedmodscount}" ]; do + currentmod=$(sed "${installedmodsline}q;d" "${modsinstalledlistfullpath}") + # Get mod info to make sure mod exists. + fn_mod_get_info + # Add the mod to available commands. + installedmodslist+=("${modcommand}") + # Increment line check. + ((installedmodsline++)) + done + if [ "${installedmodscount}" ]; then + fn_script_log_info "${installedmodscount} addons/mods are currently installed" + fi +} + +# Loops through mods_global_array to define available mods & provide available commands for mods installation. +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 + # If current value is a separator; then. + if [ "${mods_global_array[index]}" == "${modseparator}" ]; then + # Set mod variables. + fn_mods_define + # Test if game is compatible. + fn_mod_compatible_test + # If game is compatible. + if [ "${modcompatibility}" == "1" ]; then + # Put it into an array to prepare user output. + compatiblemodslist+=("${modprettyname}" "${modcommand}" "${modsite}" "${moddescription}") + # Keep available commands in an array to make life easier. + availablemodscommands+=("${modcommand}") + fi + fi + done +} + +## 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() { + # Reset test value. + modcompatiblegame="0" + # If value is set to GAMES (ignore). + if [ "${modgames}" != "GAMES" ]; then + # 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 + # Put current game name into modtest variable. + gamemodtest=$(echo -e "${modgames}" | awk -F ';' -v x=${gamevarindex} '{ print $x }') + # If game name matches. + if [ "${gamemodtest}" == "${gamename}" ]; then + # Mod is compatible. + modcompatiblegame="1" + fi + done + fi +} + +# 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() { + # Reset test value. + modcompatibleengine="0" + # If value is set to ENGINES (ignore). + if [ "${modengines}" != "ENGINES" ]; then + # 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 + # Put current engine name into modtest variable. + enginemodtest=$(echo -e "${modengines}" | awk -F ';' -v x=${gamevarindex} '{ print $x }') + # If engine name matches. + if [ "${enginemodtest}" == "${engine}" ]; then + # Mod is compatible. + modcompatibleengine="1" + fi + done + fi +} + +# 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() { + # Reset test value. + modeincompatiblegame="0" + # If value is set to NOTGAMES (ignore). + if [ "${modexcludegames}" != "NOTGAMES" ]; then + # 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 + # Put current engine name into modtest variable. + excludegamemodtest=$(echo -e "${modexcludegames}" | awk -F ';' -v x=${gamevarindex} '{ print $x }') + # If engine name matches. + if [ "${excludegamemodtest}" == "${gamename}" ]; then + # Mod is compatible. + modeincompatiblegame="1" + fi + done + fi +} + +# Sums up if a mod is compatible or not with modcompatibility=0/1. +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 + modcompatibility="1" + else + modcompatibility="0" + fi +} + +## Directory management. + +# Create mods files and directories if it doesn't exist. +fn_create_mods_dir() { + # Create lgsm data modsdir. + if [ ! -d "${modsdir}" ]; then + echo -en "creating LinuxGSM mods data directory ${modsdir}..." + mkdir -p "${modsdir}" + exitcode=$? + if [ "${exitcode}" != 0 ]; then + fn_print_fail_eol_nl + fn_script_log_fatal "Creating mod download dir ${modsdir}" + core_exit.sh + else + fn_print_ok_eol_nl + fn_script_log_pass "Creating mod download dir ${modsdir}" + fi + fi + # Create mod install directory. + if [ ! -d "${modinstalldir}" ]; then + echo -en "creating mods install directory ${modinstalldir}..." + mkdir -p "${modinstalldir}" + exitcode=$? + if [ "${exitcode}" != 0 ]; then + fn_print_fail_eol_nl + fn_script_log_fatal "Creating mod install directory ${modinstalldir}" + core_exit.sh + else + fn_print_ok_eol_nl + fn_script_log_pass "Creating mod install directory ${modinstalldir}" + fi + fi + + # Create lgsm/data/${modsinstalledlist}. + if [ ! -f "${modsinstalledlistfullpath}" ]; then + touch "${modsinstalledlistfullpath}" + fn_script_log_info "Created ${modsinstalledlistfullpath}" + fi +} + +# Create tmp download mod directory. +fn_mods_create_tmp_dir() { + if [ ! -d "${modstmpdir}" ]; then + mkdir -p "${modstmpdir}" + exitcode=$? + echo -en "creating mod download directory ${modstmpdir}..." + if [ "${exitcode}" != 0 ]; then + fn_print_fail_eol_nl + fn_script_log_fatal "Creating mod download directory ${modstmpdir}" + core_exit.sh + else + fn_print_ok_eol_nl + fn_script_log_pass "Creating mod download directory ${modstmpdir}" + fi + fi +} + +# Remove the tmp mod download directory when finished. +fn_mods_clear_tmp_dir() { + if [ -d "${modstmpdir}" ]; then + echo -en "clearing mod download directory ${modstmpdir}..." + rm -rf "${modstmpdir:?}" + exitcode=$? + if [ "${exitcode}" != 0 ]; then + fn_print_fail_eol_nl + fn_script_log_fatal "Clearing mod download directory ${modstmpdir}" + core_exit.sh + else + fn_print_ok_eol_nl + fn_script_log_pass "Clearing mod download directory ${modstmpdir}" + fi + + fi + # Clear temp file list as well. + if [ -f "${modsdir}/.removedfiles.tmp" ]; then + rm -f "${modsdir:?}/.removedfiles.tmp" + fi +} + +# Counts how many mods were installed. +fn_mods_count_installed() { + if [ -f "${modsinstalledlistfullpath}" ]; then + installedmodscount=$(wc -l < "${modsinstalledlistfullpath}") + else + installedmodscount=0 + fi +} + +# Exits if no mods were installed. +fn_mods_check_installed() { + # Count installed mods. + fn_mods_count_installed + # If no mods are found. + if [ ${installedmodscount} -eq 0 ]; then + echo -e "" + fn_print_failure_nl "No installed mods or addons were found" + echo -e " * Install mods using LinuxGSM first with: ./${selfname} mods-install" + fn_script_log_error "No installed mods or addons were found." + core_exit.sh + fi +} + +# Checks that mod files list exists and isn't empty. +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. + modsfilelistsize=$(wc -l < "${modsdir}/${modcommand}-files.txt") + # If file list is empty. + if [ "${modsfilelistsize}" -eq 0 ]; then + fn_print_failure "${modcommand}-files.txt is empty" + echo -e "* Unable to remove ${modprettyname}" + fn_script_log_fatal "${modcommand}-files.txt is empty: Unable to remove ${modprettyname}." + core_exit.sh + fi + else + fn_print_failure "${modsdir}/${modcommand}-files.txt does not exist" + fn_script_log_fatal "${modsdir}/${modcommand}-files.txt does not exist: Unable to remove ${modprettyname}." + core_exit.sh + fi +} + +fn_mod_exist() { + modreq=$1 + # requires one parameter, the mod + if [ -f "${modsdir}/${modreq}-files.txt" ]; then + # how many lines is the file list + modsfilelistsize=$(wc -l < "${modsdir}/${modreq}-files.txt") + # if file list is empty + if [ "${modsfilelistsize}" -eq 0 ]; then + fn_mod_required_fail_exist "${modreq}" + fi + else + fn_mod_required_fail_exist "${modreq}" + fi +} + +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" + echo -en "* Unable to find '${modreq}' which is required prior to installing this mod..." + fn_print_fail_eol_nl + core_exit.sh +} + +fn_mod_liblist_gam_filenames() { + # clear variables just in case + moddll="" + modso="" + moddylib="" + + # default libraries + case ${gamename} in + "Counter-Strike 1.6") + 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_liblist_gam_filenames + + if [ -f "${modinstalldir}/liblist.gam" ]; then + # modify the liblist.gam file to initialize Metamod + logentry="sed replace (dlls\\${moddll}) ${modinstalldir}/liblist.gam" + echo -en "modifying gamedll in liblist.gam..." + rpldll="s/dlls\\\\${moddll}/addons\/metamod\/dlls\/metamod.dll/g" + sed -i $rpldll "${modinstalldir}/liblist.gam" + grep -q "addons/metamod/dlls/metamod.dll" "${modinstalldir}/liblist.gam" + exitcode=$? + # if replacement back didn't happen, error out. + if [ "${exitcode}" != 0 ]; then + fn_script_log_fatal "${logentry}" + fn_print_fail_eol_nl + else + fn_script_log_pass "${logentry}" + fn_print_ok_eol_nl + fi + + # modify the liblist.gam file to initialize metamod + logentry="sed replace (dlls\\${modso}) ${modinstalldir}/liblist.gam" + echo -en "modifying gamedll_linux in liblist.gam..." + rplso="s/dlls\/${modso}/addons\/metamod\/dlls\/metamod.so/g" + sed -i $rplso "${modinstalldir}/liblist.gam" + grep -q "addons/metamod/dlls/metamod.so" "${modinstalldir}/liblist.gam" + exitcode=$? + # if replacement back didn't happen, error out + if [ "${exitcode}" != 0 ]; then + fn_script_log_fatal "${logentry}" + fn_print_fail_eol_nl + else + fn_script_log_pass "${logentry}" + fn_print_ok_eol_nl + fi + + # mac os needs to be checked not all mods support mac os + if [ -n "${moddylib}" ]; then + # modify the liblist.gam file to initialize metamod + logentry="sed replace (dlls\\${moddylib}) ${modinstalldir}/liblist.gam" + echo -en "modifying gamedll_osx in liblist.gam..." + rpldylib="s/dlls\/${moddylib}/addons\/metamod\/dlls\/metamod.dylib/g" + sed -i $rpldylib "${modinstalldir}/liblist.gam" + grep -q "addons/metamod/dlls/metamod.dylib" "${modinstalldir}/liblist.gam" + exitcode=$? + # if replacement back didn't happen, error out. + if [ "${exitcode}" != 0 ]; then + fn_script_log_fatal "${logentry}" + fn_print_fail_eol_nl + else + fn_script_log_pass ${logentry} + fn_print_ok_eol_nl + fi + fi + fi +} + +fn_mod_remove_liblist_gam_file() { + + fn_mod_liblist_gam_filenames + + if [ -f "${modinstalldir}/liblist.gam" ]; then + # modify the liblist.gam file back to defaults + logentry="sed replace (addons/metamod/dlls/metamod.dll) ${modinstalldir}/liblist.gam" + echo -en "modifying gamedll in liblist.gam..." + rpldll="s/addons\/metamod\/dlls\/metamod.dll/dlls\\\\${moddll}/g" + sed -i $rpldll "${modinstalldir}/liblist.gam" + grep -q "${moddll}" "${modinstalldir}/liblist.gam" + exitcode=$? + # if replacement back didn't happen, error out. + if [ "${exitcode}" != 0 ]; then + fn_script_log_fatal "${logentry}" + fn_print_fail_eol_nl + else + fn_script_log_pass ${logentry} + fn_print_ok_eol_nl + fi + + # modify the liblist.gam file back to defaults + logentry="sed replace (addons/metamod/dlls/metamod.so) ${modinstalldir}/liblist.gam" + echo -en "modifying gamedll_linux in liblist.gam..." + rplso="s/addons\/metamod\/dlls\/metamod.so/dlls\/${modso}/g" + sed -i $rplso "${modinstalldir}/liblist.gam" + grep -q "${modso}" "${modinstalldir}/liblist.gam" + exitcode=$? + # if replacement back didn't happen, error out + if [ "${exitcode}" != 0 ]; then + fn_script_log_fatal "${logentry}" + fn_print_fail_eol_nl + else + fn_script_log_pass ${logentry} + fn_print_ok_eol_nl + fi + + # mac os needs to be checked not all mods support mac os + if [ -n "${moddylib}" ]; then + # modify the liblist.gam file back to defaults + logentry="sed replace (addons/metamod/dlls/metamod.dylib) ${modinstalldir}/liblist.gam" + echo -en "modifying gamedll_osx in liblist.gam..." + rpldylib="s/addons\/metamod\/dlls\/metamod.dylib/dlls\/${moddylib}/g" + sed -i $rpldylib "${modinstalldir}/liblist.gam" + grep -q "${moddylib}" "${modinstalldir}/liblist.gam" + # if replacement back didn't happen, error out. + exitcode=$? + if [ "${exitcode}" != 0 ]; then + fn_script_log_fatal "${logentry}" + fn_print_fail_eol_nl + else + fn_script_log_pass ${logentry} + fn_print_ok_eol_nl + fi + fi + fi +} + +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 + logentry="line (linux addons/amxmodx/dlls/amxmodx_mm_i386.so) inserted into ${modinstalldir}/addons/metamod/plugins.ini" + echo -en "adding amxmodx_mm_i386.so in plugins.ini..." + grep -q "amxmodx_mm_i386.so" "${modinstalldir}/addons/metamod/plugins.ini" + exitcode=$? + if [ "${exitcode}" != 0 ]; then + # file exists but the entry does not, let's add it + echo "linux addons/amxmodx/dlls/amxmodx_mm_i386.so" >> "${modinstalldir}/addons/metamod/plugins.ini" + exitcode=$? + if [ "${exitcode}" != 0 ]; then + fn_script_log_fatal "${logentry}" + fn_print_fail_eol_nl + else + fn_script_log_pass ${logentry} + fn_print_ok_eol_nl + fi + fi + else + # create new file and add the mod to it + echo "linux addons/amxmodx/dlls/amxmodx_mm_i386.so" > "${modinstalldir}/addons/metamod/plugins.ini" + exitcode=$? + if [ "${exitcode}" != 0 ]; then + fn_script_log_fatal "${logentry}" + fn_print_fail_eol_nl + core_exit.sh + else + fn_script_log_pass ${logentry} + fn_print_ok_eol_nl + fi + fi +} + +fn_mod_remove_amxmodx_file() { + if [ -f "${modinstalldir}/addons/metamod/plugins.ini" ]; then + # 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" + # iIs it found? If so remove it and clean up + exitcode=$? + if [ "${exitcode}" == 0 ]; then + # delete the line we inserted + sed -i '/linux addons\/amxmodx\/dlls\/amxmodx_mm_i386.so/d' "${modinstalldir}/addons/metamod/plugins.ini" + # remove empty lines + sed -i '/^$/d' "${modinstalldir}/addons/metamod/plugins.ini" + exitcode=$? + if [ "${exitcode}" != 0 ]; then + fn_script_log_fatal "${logentry}" + fn_print_fail_eol_nl + else + fn_script_log_pass ${logentry} + fn_print_ok_eol_nl + fi + + # if file is empty, remove it. + if [ -f "${modinstalldir}/addons/metamod/plugins.ini" ]; then + rm -f "${modinstalldir}/addons/metamod/plugins.ini" + fn_script_log_pass "file removed ${modinstalldir}/addons/metamod/plugins.ini because it was empty" + fi + fi + fi +} + +## Database initialisation. + +mods_list.sh +fn_mods_available diff --git a/lgsm/functions/mods_list.sh b/lgsm/functions/mods_list.sh new file mode 100644 index 0000000000..a83b7e3032 --- /dev/null +++ b/lgsm/functions/mods_list.sh @@ -0,0 +1,209 @@ +#!/bin/bash +# LinuxGSM mods_list.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Lists and defines available mods for LinuxGSM supported servers; works along with mods_core.sh. +# Usage: To add a mod, you need to add an array variable following the guide to set proper values; +# Usage: Then add this array to the mods_global_array. +# Usage: If needed, you can scrape the download URL first. + +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +# Get a proper URL for mods that don't provide a good one (optional) +fn_script_log_info "Retrieving latest mods URLs" + +# Metamod (Half-life 1 Classic Engine) +metamodversion="1.21.1-am" +metamodlatestfile="metamod-${metamodversion}.zip" +metamoddownloadurl="https://www.amxmodx.org/release/${metamodlatestfile}" +metamodurl="${metamoddownloadurl}" +# AMX Mod X: Base +amxxbaseversion="1.8.2" +amxxbasemod="base" +amxxbaselatestfile="amxmodx-${amxxbaseversion}-${amxxbasemod}-linux.tar.gz" +amxxbasedownloadurl="https://www.amxmodx.org/release/${amxxbaselatestfile}" +amxxbaseurl="${amxxbasedownloadurl}" +# AMX Mod X: Counter-Strike +amxxcsversion="1.8.2" +amxxcsmod="cstrike" +amxxcslatestfile="amxmodx-${amxxbaseversion}-${amxxcsmod}-linux.tar.gz" +amxxcsdownloadurl="https://www.amxmodx.org/release/${amxxcslatestfile}" +amxxcsurl="${amxxcsdownloadurl}" +# AMX Mod X: Day of Defeat +amxxdodversion="1.8.2" +amxxdodmod="dod" +amxxdodlatestfile="amxmodx-${amxxdodversion}-${amxxdodmod}-linux.tar.gz" +amxxdoddownloadurl="https://www.amxmodx.org/release/${amxxdodlatestfile}" +amxxdodurl="${amxxdoddownloadurl}" +# AMX Mod X: Team Fortress Classic +amxxtfcversion="1.8.2" +amxxtfcmod="tfc" +amxxtfclatestfile="amxmodx-${amxxtfcversion}-${amxxtfcmod}-linux.tar.gz" +amxxtfcdownloadurl="https://www.amxmodx.org/release/${amxxtfclatestfile}" +amxxtfcurl="${amxxtfcdownloadurl}" +# AMX Mod X: Natural Selection +amxxnsversion="1.8.2" +amxxnsmod="ns" +amxxnslatestfile="amxmodx-${amxxnsversion}-${amxxnsmod}-linux.tar.gz" +amxxnsdownloadurl="https://www.amxmodx.org/release/${amxxnslatestfile}" +amxxnsurl="${amxxnsdownloadurl}" +# AMX Mod X: The Specialists +amxxtsversion="1.8.2" +amxxtsmod="ts" +amxxtslatestfile="amxmodx-${amxxtsversion}-${amxxtsmod}-linux.tar.gz" +amxxtsdownloadurl="https://www.amxmodx.org/release/${amxxtslatestfile}" +amxxtsurl="${amxxtsdownloadurl}" +# Metamod:Source +metamodsourceversion="1.11" +metamodsourcescrapeurl="https://mms.alliedmods.net/mmsdrop/${metamodsourceversion}/mmsource-latest-linux" +metamodsourcelatestfile=$(wget "${metamodsourcescrapeurl}" -q -O -) +metamodsourcedownloadurl="https://www.metamodsource.net/latest.php?os=linux&version=${metamodsourceversion}" +metamodsourceurl="${metamodsourcedownloadurl}" +# Sourcemod +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}" +sourcemodurl="${sourcemoddownloadurl}" +# Steamworks +steamworksscrapeurl="https://users.alliedmods.net/~kyles/builds/SteamWorks" +steamworkslatestfile=$(curl --connect-timeout 10 -sL ${steamworksscrapeurl} | grep -m 1 linux | cut -d '"' -f 4) +steamworksdownloadurl="${steamworksscrapeurl}/${steamworkslatestfile}" +steamworksurl="${steamworksdownloadurl}" +# CS:GO Mods +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') +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}" + +# 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') +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) + +# Separator name +modseparator="MOD" + +# REQUIRED: mod_info_name=( MOD "modcommand" "Pretty Name" "URL" "filename" "modsubdirs" "LowercaseOn/Off" "/files/to/keep;" "/install/path" "ENGINES" "GAMES" "NOTGAMES" "AUTHOR_URL" "Short Description" ) +# Example 1) Well made mod: mod_info_name=( MOD "awesomemod" "This is an Awesome Mod" "https://awesomemod.com/latest.zip" "awesomemod.zip" "0" "LowercaseOff" "OVERWRITE" "${systemdir}/addons" "source;unity3d;" "GAMES" "NOTGAMES" "https://awesomemod.com/" "This mod knows that 42 is the answer" ) +# Example 2) Poorly made mod: mod_info_name=( MOD "stupidmod" "This is a stupid mod" "${crappymodurl}" "StupidMod.zip" "2" "LowercaseOn" "cfg;data/crappymod;" "${systemdir}" "source;" "GAMES" "Garry's mod;Counter-Strike: Source;" "This mod is dumber than dumb" ) +# None of those values can be empty +# index | Usage +# [0] | MOD: separator, all mods must begin with it +# [1] | "modcommand": the LGSM name and command to install the mod (must be unique and lowercase) +# [2] | "Pretty Name": the common name people use to call the mod that will be displayed to the user +# [3] | "URL": link to the mod archive file; can be a variable previously defined while scraping a URL +# [4] | "filename": the output filename +# [5] | "modsubdirs": in how many subdirectories is the mod (none is 0) (not used at release, but could be in the future) +# [6] | "LowercaseOn/Off": LowercaseOff or LowercaseOn: enable/disable converting extracted files and directories to lowercase (some games require it) +# [7] | "modinstalldir": the directory in which to install the mode (use LGSM dir variables such as ${systemdir}) +# [8] | "/files/to/keep;", files & directories that should not be overwritten upon update, separated and ended with a semicolon; you can also use "OVERWRITE" value to ignore the value or "NOUPDATE" to disallow updating; for files to keep upon uninstall, see fn_mod_tidy_files_list from mods_core.sh +# [9] | "Supported Engines;": list them according to LGSM ${engine} variables, separated and ended with a semicolon, or use ENGINES to ignore the value +# [10] | "Supported Games;": list them according to LGSM ${gamename} variables, separated and ended with a semicolon, or use GAMES to ignore the value +# [11] | "Unsupported Games;": list them according to LGSM ${gamename} variables, separated and ended with a semicolon, or use NOTGAMES to ignore the value (useful to exclude a game when using Supported Engines) +# [12] | "AUTHOR_URL" is the author's website, displayed to the user when chosing mods to install +# [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)") + +# 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)") + +# 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)") + +# 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)") + +# 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)") + +# 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)") + +# 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)") + +# 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" "${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") +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") + +# 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") +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") + +# 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_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[@]}") diff --git a/lgsm/functions/query_gamedig.sh b/lgsm/functions/query_gamedig.sh new file mode 100644 index 0000000000..265607acd5 --- /dev/null +++ b/lgsm/functions/query_gamedig.sh @@ -0,0 +1,93 @@ +#!/bin/bash +# LinuxGSM query_gamedig.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Querys a gameserver using node-gamedig. +# 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 + + # will bypass query if server offline. + check_status.sh + if [ "${status}" != "0" ]; then + # GameDig requires you use the voice port when querying. + if [ "${querytype}" == "teamspeak3" ]; then + queryport="${port}" + fi + # checks if query is working null = pass. + gamedigcmd=$(echo -e "gamedig --type \"${querytype}\" --host \"${queryip}\" --query_port \"${queryport}\"|jq") + gamedigraw=$(gamedig --type "${querytype}" --host "${queryip}" --query_port "${queryport}") + querystatus=$(echo "${gamedigraw}" | jq '.error|length') + + if [ "${querystatus}" != "null" ]; then + gamedigcmd=$(echo -e "gamedig --type \"${querytype}\" --host \"${queryip}\" --port \"${queryport}\"|jq") + gamedigraw=$(gamedig --type "${querytype}" --host "${queryip}" --port "${queryport}") + querystatus=$(echo "${gamedigraw}" | jq '.error|length') + fi + + if [ "${querytype}" == "teamspeak3" ]; then + fn_info_game_ts3 + fi + + # server name. + gdname=$(echo "${gamedigraw}" | jq -re '.name') + if [ "${gdname}" == "null" ]; then + unset gdname + fi + + # numplayers. + if [ "${querytype}" == "minecraft" ]; then + gdplayers=$(echo "${gamedigraw}" | jq -re '.players | length-1') + elif [ "${querytype}" == "teamspeak3" ]; then + gdplayers=$(echo "${gamedigraw}" | jq -re '.raw.virtualserver_clientsonline') + else + gdplayers=$(echo "${gamedigraw}" | jq -re '.players | length') + fi + if [ "${gdplayers}" == "null" ]; then + unset gdplayers + elif [ "${gdplayers}" == "[]" ] || [ "${gdplayers}" == "-1" ]; then + gdplayers=0 + fi + + # maxplayers. + gdmaxplayers=$(echo "${gamedigraw}" | jq -re '.maxplayers') + if [ "${gdmaxplayers}" == "null" ]; then + unset gdmaxplayers + elif [ "${gdmaxplayers}" == "[]" ]; then + gdmaxplayers=0 + fi + + # current map. + gdmap=$(echo "${gamedigraw}" | jq -re '.map') + if [ "${gdmap}" == "null" ]; then + unset gdmap + fi + + # current gamemode. + gdgamemode=$(echo "${gamedigraw}" | jq -re '.raw.rules.GameMode_s') + if [ "${gdgamemode}" == "null" ]; then + unset gdgamemode + fi + + # numbots. + gdbots=$(echo "${gamedigraw}" | jq -re '.bots | length') + if [ "${gdbots}" == "null" ] || [ "${gdbots}" == "0" ]; then + unset gdbots + fi + + # server version. + if [ "${querytype}" == "teamspeak3" ]; then + gdversion=$(echo "${gamedigraw}" | jq -re '.raw.virtualserver_version') + else + gdversion=$(echo "${gamedigraw}" | jq -re '.raw.version') + fi + + if [ "${gdversion}" == "null" ] || [ "${gdversion}" == "0" ]; then + unset gdversion + fi + fi +fi diff --git a/lgsm/functions/query_gsquery.py b/lgsm/functions/query_gsquery.py new file mode 100644 index 0000000000..62c92082e4 --- /dev/null +++ b/lgsm/functions/query_gsquery.py @@ -0,0 +1,151 @@ +#! /usr/bin/env python3 +# -*- coding: utf-8 -*- +# LinuxGSM query_gsquery.py function +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Allows querying of various game servers. + +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: + 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 + # + if self.argument.engine in self.sourcequery: + self.query_prompt_string = b'\xFF\xFF\xFF\xFFTSource Engine Query\0' + elif self.argument.engine in self.idtech2query: + self.query_prompt_string = b'\xff\xff\xff\xffstatus\x00' + elif self.argument.engine in self.idtech3query: + self.query_prompt_string = b'\xff\xff\xff\xffgetstatus' + elif self.argument.engine in self.jc2mpquery: + self.query_prompt_string = b'\xFE\xFD\x09\x10\x20\x30\x40' + elif self.argument.engine in self.minecraftquery: + self.query_prompt_string = b'\xFE\xFD\x09\x3d\x54\x1f\x93' + 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.argument.engine in self.mumblequery: + self.query_prompt_string = b'\x00\x00\x00\x00\x01\x02\x03\x04\x05\x06\x07\x08' + elif self.argument.engine in self.soldatquery: + self.query_prompt_string = b'\x69\x00' + 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.argument.engine in self.unreal2query: + self.query_prompt_string = b'\x79\x00\x00\x00\x00' + 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 + + @staticmethod + def fatal_error(error_message, error_code=1): + sys.stderr.write('ERROR: ' + str(error_message) + '\n') + sys.exit(error_code) + + @staticmethod + def exit_success(success_message=''): + sys.stdout.write('OK: ' + str(success_message) + '\n') + sys.exit(0) + + def responding(self): + # Connect. + connection = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) + connection.settimeout(self.server_response_timeout) + try: + self.connected = connection.connect((self.argument.address, int(self.argument.port))) + except socket.timeout: + self.fatal_error('Request timed out', 1) + except Exception: + self.fatal_error('Unable to connect', 1) + # Send. + connection.send(self.query_prompt_string) + # Receive. + try: + self.response = connection.recv(self.default_buffer_length) + except socket.error: + self.fatal_error('Unable to receive', 2) + connection.close() + # Response. + if self.response is None: + self.fatal_error('No response', 3) + if len(self.response) < 5: + sys.exit('Short response.', 3) + else: + self.exit_success(str(self.response)) + +def parse_args(): + parser = argparse.ArgumentParser( + description='Allows querying of various game servers.', + usage='usage: python3 %(prog)s [options]', + add_help=False + ) + parser.add_argument( + '-a', '--address', + type=str, + required=True, + help='The IPv4 address of the server.' + ) + parser.add_argument( + '-p', '--port', + type=int, + required=True, + help='The IPv4 port of the server.' + ) + parser.add_argument( + '-e', '--engine', + metavar='ENGINE', + choices=engine_types, + help='Engine type: ' + ' '.join(engine_types) + ) + parser.add_argument( + '-v', '--verbose', + action='store_true', + help='Display verbose output.' + ) + parser.add_argument( + '-d', '--debug', + action='store_true', + help='Display debugging output.' + ) + 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() diff --git a/lgsm/functions/update_factorio.sh b/lgsm/functions/update_factorio.sh new file mode 100644 index 0000000000..852ab9d87e --- /dev/null +++ b/lgsm/functions/update_factorio.sh @@ -0,0 +1,168 @@ +#!/bin/bash +# LinuxGSM update_factorio.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Handles updating of Factorio 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}" "factorio_headless_${factorioarch}-${remotebuildversion}.tar.xz" "${serverfiles}" "factorio" + fn_clear_tmp +} + +fn_update_localbuild() { + # Gets local build info. + fn_print_dots "Checking local build: ${remotelocation}" + # Uses executable to get local build. + if [ -d "${executabledir}" ]; then + cd "${executabledir}" || exit + localbuild=$(${executable} --version | grep "Version:" | awk '{print $2}') + 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" + fi +} + +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 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} ${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: ${remotebuildversion} ${factorioarch}" + 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} ${factorioarch}${default}" + 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: ${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 +} + +# Game server architecture. +factorioarch="linux64" + +# The location where the builds are checked and downloaded. +remotelocation="factorio.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_jediknight2.sh b/lgsm/functions/update_jediknight2.sh new file mode 100644 index 0000000000..a88b96f61f --- /dev/null +++ b/lgsm/functions/update_jediknight2.sh @@ -0,0 +1,163 @@ +#!/bin/bash +# LinuxGSM update_jk2.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Handles updating of Jedi Knight 2 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}/GameData" "linux-amd64" + fn_clear_tmp +} + +fn_update_localbuild() { + # Gets local build info. + fn_print_dots "Checking local build: ${remotelocation}" + # 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 + 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/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 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 + 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_localbuild + fn_update_remotebuild + fn_update_compare +fi diff --git a/lgsm/functions/update_minecraft.sh b/lgsm/functions/update_minecraft.sh new file mode 100644 index 0000000000..dbef26d341 --- /dev/null +++ b/lgsm/functions/update_minecraft.sh @@ -0,0 +1,176 @@ +#!/bin/bash +# LinuxGSM update_minecraft.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Handles updating of Minecraft: Java Edition servers. + +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +fn_update_dl() { + # Download and extract files to serverfiles. + fn_fetch_file "${remotebuildurl}" "" "" "" "${tmpdir}" "${remotebuildfilename}" "chmodx" "norun" "noforce" "nohash" + cp -f "${tmpdir}/${remotebuildfilename}" "${serverfiles}/${executable#./}" +} + +fn_update_localbuild() { + # Gets local build info. + fn_print_dots "Checking local build: ${remotelocation}" + # Uses executable to get local build. + if [ -d "${executabledir}" ]; 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" + fi +} + +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 + remotebuildversion=$(echo "${remotebuildresponse}" | jq -r '.latest.release') + # Latest snapshot. + elif [ "${branch}" == "snapshot" ] && [ "${mcversion}" == "latest" ]; then + remotebuildversion=$(echo "${remotebuildresponse}" | jq -r '.latest.snapshot') + # Specific release/snapshot. + else + remotebuildversion=$(echo "${remotebuildresponse}" | jq -r --arg branch "${branch}" --arg mcversion "${mcversion}" '.versions | .[] | select(.type==$branch and .id==$mcversion) | .id') + fi + remotebuildfilename="minecraft_server.${remotebuildversion}.jar" + # 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 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="mojang.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_minecraft_bedrock.sh b/lgsm/functions/update_minecraft_bedrock.sh new file mode 100644 index 0000000000..aec9401268 --- /dev/null +++ b/lgsm/functions/update_minecraft_bedrock.sh @@ -0,0 +1,181 @@ +#!/bin/bash +# LinuxGSM update_minecraft_bedrock.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Handles updating of Minecraft Bedrock servers. + +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +fn_update_dl() { + fn_fetch_file "${remotebuildurl}" "" "" "" "${tmpdir}" "bedrock_server.${remotebuildversion}.zip" "nochmodx" "norun" "noforce" "nohash" + echo -e "Extracting to ${serverfiles}...\c" + if [ "${firstcommandname}" == "INSTALL" ]; then + unzip -oq "${tmpdir}/bedrock_server.${remotebuildversion}.zip" -x "server.properties" -d "${serverfiles}" + else + 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_fail_eol_nl + 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_localbuild() { + # Gets local build info. + fn_print_dots "Checking local build: ${remotelocation}" + # 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 + 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() { + # Random number for userAgent + randnum=$((1 + RANDOM % 5000)) + # Get remote build info. + if [ "${mcversion}" == "latest" ]; then + 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 + 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 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="minecraft.net" + +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_mta.sh b/lgsm/functions/update_mta.sh new file mode 100644 index 0000000000..5252c13280 --- /dev/null +++ b/lgsm/functions/update_mta.sh @@ -0,0 +1,166 @@ +#!/bin/bash +# LinuxGSM update_mta.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Handles updating of Multi Theft Auto servers. + +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +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_localbuild() { + # Gets local build info. + fn_print_dots "Checking local build: ${remotelocation}" + # 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 + 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/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 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 + 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 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="linux.mtasa.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_papermc.sh b/lgsm/functions/update_papermc.sh new file mode 100644 index 0000000000..102ef65701 --- /dev/null +++ b/lgsm/functions/update_papermc.sh @@ -0,0 +1,194 @@ +#!/bin/bash +# LinuxGSM update_papermc.sh function +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Handles updating of PaperMC and Waterfall servers. + +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +fn_update_dl() { + # Download and extract files to serverfiles. + fn_fetch_file "${remotebuildurl}" "" "" "" "${tmpdir}" "${remotebuildfilename}" "chmodx" "norun" "force" "${remotebuildhash}" + cp -f "${tmpdir}/${remotebuildfilename}" "${serverfiles}/${executable#./}" + echo "${remotebuildversion}" > "${serverfiles}/build.txt" +} + +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" 2> /dev/null) + 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://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 + # 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_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="papermc.io" + +if [ "${shortname}" == "pmc" ]; then + paperproject="paper" +elif [ "${shortname}" == "vpmc" ]; then + paperproject="velocity" +elif [ "${shortname}" == "wmc" ]; then + paperproject="waterfall" +fi + +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_steamcmd.sh b/lgsm/functions/update_steamcmd.sh new file mode 100644 index 0000000000..85bacb8997 --- /dev/null +++ b/lgsm/functions/update_steamcmd.sh @@ -0,0 +1,39 @@ +#!/bin/bash +# LinuxGSM update_steamcmd.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Handles updating using SteamCMD. + +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +# init steamcmd functions +core_steamcmd.sh + +# The location where the builds are checked and downloaded. +remotelocation="SteamCMD" +check.sh + +fn_print_dots "${remotelocation}" + +if [ "${forceupdate}" == "1" ]; then + # forceupdate bypasses update checks. + if [ "${status}" != "0" ]; then + fn_print_restart_warning + exitbypass=1 + command_stop.sh + fn_firstcommand_reset + fn_dl_steamcmd + date +%s > "${lockdir}/lastupdate.lock" + exitbypass=1 + command_start.sh + fn_firstcommand_reset + else + fn_dl_steamcmd + date +%s > "${lockdir}/lastupdate.lock" + fi +else + fn_update_steamcmd_localbuild + fn_update_steamcmd_remotebuild + fn_update_steamcmd_compare +fi diff --git a/lgsm/functions/update_ts3.sh b/lgsm/functions/update_ts3.sh new file mode 100644 index 0000000000..0f5327de28 --- /dev/null +++ b/lgsm/functions/update_ts3.sh @@ -0,0 +1,181 @@ +#!/bin/bash +# LinuxGSM command_ts3.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Handles updating of Teamspeak 3 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" "${remotebuildhash}" + fn_dl_extract "${tmpdir}" "${remotebuildfilename}" "${serverfiles}" "teamspeak3-server_linux_${ts3arch}" + fn_clear_tmp +} + +fn_update_localbuild() { + # Gets local build info. + fn_print_dots "Checking local build: ${remotelocation}" + # 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 + 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://www.teamspeak.com/versions/server.json" + remotebuildresponse=$(curl -s "${apiurl}") + + if [ "${ts3arch}" == "amd64" ]; then + 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 + 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 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 +} + +# Game server architecture. +info_distro.sh +if [ "${arch}" == "x86_64" ]; then + ts3arch="amd64" +elif [ "${arch}" == "i386" ] || [ "${arch}" == "i686" ]; then + ts3arch="x86" +else + fn_print_failure "Unknown or unsupported architecture: ${arch}" + fn_script_log_fatal "Unknown or unsupported architecture: ${arch}" + core_exit.sh +fi + +# The location where the builds are checked and downloaded. +remotelocation="teamspeak.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_ut99.sh b/lgsm/functions/update_ut99.sh new file mode 100644 index 0000000000..045b29dbe1 --- /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" 2> /dev/null) + 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 new file mode 100644 index 0000000000..7307a4b770 --- /dev/null +++ b/lgsm/functions/update_vintagestory.sh @@ -0,0 +1,170 @@ +#!/bin/bash +# LinuxGSM update_vintagestory.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Handles updating of Vintage Story 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" "${remotebuildhash}" + fn_dl_extract "${tmpdir}" "${remotebuildfilename}" "${serverfiles}" + fn_clear_tmp +} + +fn_update_localbuild() { + # Gets local build info. + fn_print_dots "Checking local build: ${remotelocation}" + # Uses executable to get local build. + if [ -d "${executabledir}" ]; 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" + fi +} + +fn_update_remotebuild() { + # Get remote build info. + apiurl="http://api.vintagestory.at/stable-unstable.json" + remotebuildresponse=$(curl -s "${apiurl}") + if [ "${branch}" == "stable" ]; then + remotebuildversion=$(echo "${remotebuildresponse}" | jq -r '[ to_entries[] ] | .[].key' | grep -Ev "\-rc|\-pre" | sort -r -V | head -1) + else + 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 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="vintagestory.at" + +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 From f9a5ed089ab688edd2ff20a5bad267cb42b68ec5 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Thu, 18 May 2023 21:10:43 +0100 Subject: [PATCH 055/181] fix: revert modules in functions dir to v23.2.3 --- lgsm/functions/check_logs.sh | 2 +- lgsm/functions/check_root.sh | 2 +- lgsm/functions/command_update_linuxgsm.sh | 48 ++-- lgsm/functions/core_dl.sh | 110 ++++---- lgsm/functions/core_exit.sh | 18 +- lgsm/functions/core_functions.sh | 294 +++++++++++----------- lgsm/functions/core_getopt.sh | 14 +- lgsm/functions/core_github.sh | 6 +- lgsm/functions/core_legacy.sh | 11 +- lgsm/functions/core_logs.sh | 2 +- lgsm/functions/core_messages.sh | 2 +- lgsm/functions/core_steamcmd.sh | 4 +- lgsm/functions/core_trap.sh | 2 +- 13 files changed, 252 insertions(+), 263 deletions(-) diff --git a/lgsm/functions/check_logs.sh b/lgsm/functions/check_logs.sh index 2087ac9157..fa3df92d10 100644 --- a/lgsm/functions/check_logs.sh +++ b/lgsm/functions/check_logs.sh @@ -5,7 +5,7 @@ # Website: https://linuxgsm.com # Description: Checks if log files exist. -moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_check_logs() { fn_print_dots "Checking for log files" diff --git a/lgsm/functions/check_root.sh b/lgsm/functions/check_root.sh index 26475601a8..dab0331487 100644 --- a/lgsm/functions/check_root.sh +++ b/lgsm/functions/check_root.sh @@ -5,7 +5,7 @@ # Website: https://linuxgsm.com # Description: Checks if the user tried to run the script as root. -moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" if [ "$(whoami)" == "root" ] && [ ! -f /.dockerenv ]; then if [ "${commandname}" != "INSTALL" ]; then diff --git a/lgsm/functions/command_update_linuxgsm.sh b/lgsm/functions/command_update_linuxgsm.sh index 3c4e6d0809..569bc7cdb9 100644 --- a/lgsm/functions/command_update_linuxgsm.sh +++ b/lgsm/functions/command_update_linuxgsm.sh @@ -3,11 +3,11 @@ # Author: Daniel Gibbs # Contributors: http://linuxgsm.com/contrib # Website: https://linuxgsm.com -# Description: Deletes the modules dir to allow re-downloading of modules from GitHub. +# Description: Deletes the functions dir to allow re-downloading of functions from GitHub. commandname="UPDATE-LGSM" commandaction="Updating LinuxGSM" -moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_firstcommand_set check.sh @@ -180,49 +180,49 @@ if [ -f "${datadir}/${distroid}-${distroversioncsv}.csv" ]; then fi fi # Check and update modules. -if [ -n "${modulesdir}" ]; then - if [ -d "${modulesdir}" ]; then +if [ -n "${functionsdir}" ]; then + if [ -d "${functionsdir}" ]; then ( - cd "${modulesdir}" || exit - for modulefile in *; do + 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 ${modulefile}...\c" - github_file_url_dir="lgsm/modules" + 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}/${modulefile}" 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}/${modulefile}" 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 - fn_script_log_error "Checking ${remotereponame} module ${modulefile}" - echo -en "removing module ${modulefile}...\c" - if ! rm -f "${modulefile:?}"; then + 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 ${modulefile}" + fn_script_log_fatal "Removing module ${functionfile}" core_exit.sh else fn_print_ok_eol_nl - fn_script_log_pass "Removing module ${modulefile}" + fn_script_log_pass "Removing module ${functionfile}" fi else # compare file if [ "${remotereponame}" == "GitHub" ]; then - module_file_diff=$(diff "${modulesdir}/${modulefile}" <(curl --connect-timeout 10 -s "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${modulefile}")) + function_file_diff=$(diff "${functionsdir}/${functionfile}" <(curl --connect-timeout 10 -s "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${functionfile}")) else - module_file_diff=$(diff "${modulesdir}/${modulefile}" <(curl --connect-timeout 10 -s "https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/${github_file_url_dir}/${modulefile}")) + 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 [ "${module_file_diff}" != "" ]; then + if [ "${function_file_diff}" != "" ]; then fn_print_update_eol_nl - fn_script_log_update "Checking ${remotereponame} module ${modulefile}" - rm -rf "${modulesdir:?}/${modulefile}" - fn_update_module + 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 ${modulefile}" + fn_script_log_pass "Checking ${remotereponame} module ${functionfile}" fi fi done @@ -230,7 +230,7 @@ if [ -n "${modulesdir}" ]; then fi fi -fn_print_ok_nl "Updating modules" -fn_script_log_pass "Updating modules" +fn_print_ok_nl "Updating functions" +fn_script_log_pass "Updating functions" core_exit.sh diff --git a/lgsm/functions/core_dl.sh b/lgsm/functions/core_dl.sh index 405e9dc6b5..53a60cc1ad 100644 --- a/lgsm/functions/core_dl.sh +++ b/lgsm/functions/core_dl.sh @@ -17,7 +17,7 @@ # 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" -moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_dl_steamcmd() { fn_print_start_nl "${remotelocation}" @@ -453,13 +453,11 @@ fn_fetch_file() { fi } -# GitHub file download modules. +# GitHub file download functions. # Used to simplify downloading specific files from GitHub. -# github_file_url_dir: the directory of the file in the GitHub: lgsm/modules -# github_file_url_name: the filename of the file to download from GitHub: core_messages.sh -# github_file_url_dir: the directory of the file in the GitHub: lgsm/modules -# github_file_url_name: the filename of the file to download from GitHub: core_messages.sh +# github_fileurl_dir: the directory of the file in the GitHub: lgsm/functions +# github_fileurl_name: the filename of the file to download from GitHub: core_messages.sh # githuburl: the full GitHub url # remote_fileurl: The URL of the file: http://example.com/dl/File.tar.bz2 @@ -472,58 +470,58 @@ fn_fetch_file() { # Fetches files from the Git repo. fn_fetch_file_github() { - github_file_url_dir="${1}" - github_file_url_name="${2}" + github_fileurl_dir="${1}" + github_fileurl_name="${2}" # For legacy versions - code can be removed at a future date if [ "${legacymode}" == "1" ]; then - remote_fileurl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" - remote_fileurl_backup="https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" + 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}" == "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}" + 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 - remote_fileurl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" - remote_fileurl_backup="https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" + 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}" fi remote_fileurl_name="GitHub" remote_fileurl_backup_name="Bitbucket" local_filedir="${3}" - local_filename="${github_file_url_name}" + local_filename="${github_fileurl_name}" chmodx="${4:-0}" run="${5:-0}" forcedl="${6:-0}" hash="${7:-0}" - # Passes vars to the file download module. + # Passes vars to the file download function. 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() { - github_file_url_dir="${1}" - github_file_url_name="${2}" - 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}" + github_fileurl_dir="${1}" + github_fileurl_name="${2}" + 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 - remote_fileurl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" - remote_fileurl_backup="https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" + 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}" fi remote_fileurl_name="GitHub" remote_fileurl_backup_name="Bitbucket" - fn_check_file "${remote_fileurl}" "${remote_fileurl_backup}" "${remote_fileurl_name}" "${remote_fileurl_backup_name}" "${github_file_url_name}" + fn_check_file "${remote_fileurl}" "${remote_fileurl_backup}" "${remote_fileurl_name}" "${remote_fileurl_backup_name}" "${github_fileurl_name}" } # Fetches config files from the Git repo. fn_fetch_config() { - github_file_url_dir="${1}" - github_file_url_name="${2}" + 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}" == "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}" + 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 - remote_fileurl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" - remote_fileurl_backup="https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" + 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}" fi remote_fileurl_name="GitHub" remote_fileurl_backup_name="Bitbucket" @@ -533,55 +531,55 @@ fn_fetch_config() { run="norun" forcedl="noforce" hash="nohash" - # Passes vars to the file download module. + # Passes vars to the file download function. fn_fetch_file "${remote_fileurl}" "${remote_fileurl_backup}" "${remote_fileurl_name}" "${remote_fileurl_backup_name}" "${local_filedir}" "${local_filename}" "${chmodx}" "${run}" "${forcedl}" "${hash}" } # Fetches modules from the Git repo during first download. -fn_fetch_module() { - github_file_url_dir="lgsm/modules" - github_file_url_name="${modulefile}" +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}" == "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}" + 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 - remote_fileurl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" - remote_fileurl_backup="https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" + 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}" fi remote_fileurl_name="GitHub" remote_fileurl_backup_name="Bitbucket" - local_filedir="${modulesdir}" - local_filename="${github_file_url_name}" + local_filedir="${functionsdir}" + local_filename="${github_fileurl_name}" chmodx="chmodx" run="run" forcedl="noforce" hash="nohash" - # Passes vars to the file download module. + # Passes vars to the file download function. fn_fetch_file "${remote_fileurl}" "${remote_fileurl_backup}" "${remote_fileurl_name}" "${remote_fileurl_backup_name}" "${local_filedir}" "${local_filename}" "${chmodx}" "${run}" "${forcedl}" "${hash}" } # Fetches modules from the Git repo during update-lgsm. -fn_update_module() { - github_file_url_dir="lgsm/modules" - github_file_url_name="${modulefile}" +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}" == "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}" + 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 - remote_fileurl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" - remote_fileurl_backup="https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" + 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}" fi remote_fileurl_name="GitHub" remote_fileurl_backup_name="Bitbucket" - local_filedir="${modulesdir}" - local_filename="${github_file_url_name}" + local_filedir="${functionsdir}" + local_filename="${github_fileurl_name}" chmodx="chmodx" run="norun" forcedl="noforce" hash="nohash" - # Passes vars to the file download module. + # Passes vars to the file download function. fn_fetch_file "${remote_fileurl}" "${remote_fileurl_backup}" "${remote_fileurl_name}" "${remote_fileurl_backup_name}" "${local_filedir}" "${local_filename}" "${chmodx}" "${run}" "${forcedl}" "${hash}" } @@ -620,7 +618,7 @@ fn_dl_latest_release_github() { fn_print_fail_nl "Cannot get version from GitHub API for ${githubreleaseuser}/${githubreleaserepo}" fn_script_log_fatal "Cannot get version from GitHub API for ${githubreleaseuser}/${githubreleaserepo}" else - # Fetch file from the remote location from the existing module to the ${tmpdir} for now. + # Fetch file from the remote location from the existing function to the ${tmpdir} for now. fn_fetch_file "${githubreleasedownloadlink}" "" "${githubreleasefilename}" "" "${githubreleasedownloadpath}" "${githubreleasefilename}" fi fi diff --git a/lgsm/functions/core_exit.sh b/lgsm/functions/core_exit.sh index a8686c2a88..95d9d8cae0 100644 --- a/lgsm/functions/core_exit.sh +++ b/lgsm/functions/core_exit.sh @@ -5,14 +5,14 @@ # Website: https://linuxgsm.com # Description: Handles exiting of LinuxGSM by running and reporting an exit code. -moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_exit_dev_debug() { if [ -f "${rootdir}/.dev-debug" ]; then echo -e "" - echo -e "${moduleselfname} exiting with code: ${exitcode}" + echo -e "${functionselfname} exiting with code: ${exitcode}" if [ -f "${rootdir}/dev-debug.log" ]; then - grep "modulefile=" "${rootdir}/dev-debug.log" | sed 's/modulefile=//g' > "${rootdir}/dev-debug-module-order.log" + grep "functionfile=" "${rootdir}/dev-debug.log" | sed 's/functionfile=//g' > "${rootdir}/dev-debug-function-order.log" fi fi } @@ -29,13 +29,13 @@ elif [ "${exitcode}" != "0" ]; then # List LinuxGSM version in logs fn_script_log_info "LinuxGSM version: ${version}" if [ "${exitcode}" == "1" ]; then - fn_script_log_fatal "${moduleselfname} exiting with code: ${exitcode}" + fn_script_log_fatal "${functionselfname} exiting with code: ${exitcode}" elif [ "${exitcode}" == "2" ]; then - fn_script_log_error "${moduleselfname} exiting with code: ${exitcode}" + fn_script_log_error "${functionselfname} exiting with code: ${exitcode}" elif [ "${exitcode}" == "3" ]; then - fn_script_log_warn "${moduleselfname} exiting with code: ${exitcode}" + fn_script_log_warn "${functionselfname} exiting with code: ${exitcode}" else - fn_script_log_warn "${moduleselfname} exiting with code: ${exitcode}" + fn_script_log_warn "${functionselfname} exiting with code: ${exitcode}" fi fn_exit_dev_debug # remove trap. @@ -44,7 +44,7 @@ elif [ "${exitcode}" != "0" ]; then elif [ "${exitcode}" ] && [ "${exitcode}" == "0" ]; then # List LinuxGSM version in logs fn_script_log_info "LinuxGSM version: ${version}" - fn_script_log_pass "${moduleselfname} exiting with code: ${exitcode}" + fn_script_log_pass "${functionselfname} exiting with code: ${exitcode}" fn_exit_dev_debug # remove trap. trap - INT @@ -53,7 +53,7 @@ else # List LinuxGSM version in logs fn_script_log_info "LinuxGSM version: ${version}" fn_print_error "No exit code set" - fn_script_log_pass "${moduleselfname} exiting with code: NOT SET" + fn_script_log_pass "${functionselfname} exiting with code: NOT SET" fn_exit_dev_debug # remove trap. trap - INT diff --git a/lgsm/functions/core_functions.sh b/lgsm/functions/core_functions.sh index cc054c129e..b301b7e465 100644 --- a/lgsm/functions/core_functions.sh +++ b/lgsm/functions/core_functions.sh @@ -6,7 +6,7 @@ # Description: Defines all functions to allow download and execution of functions using fn_fetch_function. # This function is called first before any other function. Without this file other functions will not load. -module_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" modulesversion="v23.2.3" @@ -41,653 +41,653 @@ core_legacy.sh() { core_exit.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_module + fn_fetch_function } core_getopt.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_module + fn_fetch_function } core_trap.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_module + fn_fetch_function } core_steamcmd.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_module + fn_fetch_function } core_github.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_module + fn_fetch_function } # Commands command_backup.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_module + fn_fetch_function } command_console.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_module + fn_fetch_function } command_debug.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_module + fn_fetch_function } command_details.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_module + fn_fetch_function } -command_sponsor.sh() { +command_donate.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_module + fn_fetch_function } command_postdetails.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_module + fn_fetch_function } command_test_alert.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_module + fn_fetch_function } command_monitor.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_module + fn_fetch_function } command_start.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_module + fn_fetch_function } command_stop.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_module + fn_fetch_function } command_validate.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_module + fn_fetch_function } command_install.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_module + fn_fetch_function } command_install_resources_mta.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_module + fn_fetch_function } install_squad_license.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_module + fn_fetch_function } command_mods_install.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_module + fn_fetch_function } command_mods_update.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_module + fn_fetch_function } command_mods_remove.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_module + fn_fetch_function } command_fastdl.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_module + fn_fetch_function } command_ts3_server_pass.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_module + fn_fetch_function } command_restart.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_module + fn_fetch_function } command_skeleton.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_module + fn_fetch_function } command_wipe.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_module + fn_fetch_function } command_send.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_module + fn_fetch_function } # Checks check.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_module + fn_fetch_function } check_config.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_module + fn_fetch_function } check_deps.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_module + fn_fetch_function } check_executable.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_module + fn_fetch_function } check_glibc.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_module + fn_fetch_function } check_ip.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_module + fn_fetch_function } check_last_update.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_module + fn_fetch_function } check_logs.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_module + fn_fetch_function } check_permissions.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_module + fn_fetch_function } check_root.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_module + fn_fetch_function } check_status.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_module + fn_fetch_function } check_steamcmd.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_module + fn_fetch_function } check_system_dir.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_module + fn_fetch_function } check_system_requirements.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_module + fn_fetch_function } check_tmuxception.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_module + fn_fetch_function } check_version.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_module + fn_fetch_function } # Compress compress_unreal2_maps.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_module + fn_fetch_function } compress_ut99_maps.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_module + fn_fetch_function } # Mods mods_list.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_module + fn_fetch_function } mods_core.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_module + fn_fetch_function } # Dev command_dev_clear_functions.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_module + fn_fetch_function } command_dev_debug.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_module + fn_fetch_function } command_dev_detect_deps.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_module + fn_fetch_function } command_dev_detect_glibc.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_module + fn_fetch_function } command_dev_detect_ldd.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_module + fn_fetch_function } command_dev_query_raw.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_module + fn_fetch_function } # Fix fix.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_module + fn_fetch_function } fix_ark.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_module + fn_fetch_function } fix_av.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_module + fn_fetch_function } fix_arma3.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_module + fn_fetch_function } fix_armar.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_module + fn_fetch_function } fix_bt.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_module + fn_fetch_function } fix_bo.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_module + fn_fetch_function } fix_cmw.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_module + fn_fetch_function } fix_csgo.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_module + fn_fetch_function } fix_dst.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_module + fn_fetch_function } fix_hw.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_module + fn_fetch_function } fix_ins.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_module + fn_fetch_function } fix_kf.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_module + fn_fetch_function } fix_kf2.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_module + fn_fetch_function } fix_lo.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_module + fn_fetch_function } fix_mcb.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_module + fn_fetch_function } fix_mta.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_module + fn_fetch_function } fix_nmrih.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_module + fn_fetch_function } fix_onset.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_module + fn_fetch_function } fix_ro.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_module + fn_fetch_function } fix_rust.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_module + fn_fetch_function } fix_rw.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_module + fn_fetch_function } fix_sfc.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_module + fn_fetch_function } fix_st.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_module + fn_fetch_function } fix_steamcmd.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_module + fn_fetch_function } fix_terraria.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_module + fn_fetch_function } fix_tf2.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_module + fn_fetch_function } fix_ut3.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_module + fn_fetch_function } fix_rust.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_module + fn_fetch_function } fix_samp.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_module + fn_fetch_function } fix_sdtd.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_module + fn_fetch_function } fix_sof2.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_module + fn_fetch_function } fix_squad.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_module + fn_fetch_function } fix_ts3.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_module + fn_fetch_function } fix_ut2k4.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_module + fn_fetch_function } fix_ut.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_module + fn_fetch_function } fix_unt.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_module + fn_fetch_function } fix_vh.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_module + fn_fetch_function } fix_wurm.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_module + fn_fetch_function } fix_zmr.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_module + fn_fetch_function } # Info info_distro.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_module + fn_fetch_function } info_game.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_module + fn_fetch_function } info_messages.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_module + fn_fetch_function } info_stats.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_module + fn_fetch_function } # Alert alert.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_module + fn_fetch_function } alert_discord.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_module + fn_fetch_function } alert_email.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_module + fn_fetch_function } alert_ifttt.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_module + fn_fetch_function } alert_mailgun.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_module + fn_fetch_function } alert_pushbullet.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_module + fn_fetch_function } alert_pushover.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_module + fn_fetch_function } alert_gotify.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_module + fn_fetch_function } alert_telegram.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_module + fn_fetch_function } alert_rocketchat.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_module + fn_fetch_function } alert_slack.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_module + fn_fetch_function } # Logs core_logs.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_module + fn_fetch_function } # Query query_gamedig.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_module + fn_fetch_function } # Update command_update_functions.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_module + fn_fetch_function } command_update_linuxgsm.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_module + fn_fetch_function } command_update.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_module + fn_fetch_function } command_check_update.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_module + fn_fetch_function } update_ts3.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_module + fn_fetch_function } update_minecraft.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_module + fn_fetch_function } update_minecraft_bedrock.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_module + fn_fetch_function } update_papermc.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_module + fn_fetch_function } update_mta.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_module + fn_fetch_function } update_factorio.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_module + fn_fetch_function } update_jediknight2.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_module + fn_fetch_function } update_steamcmd.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_module + fn_fetch_function } update_vintagestory.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_module + fn_fetch_function } update_ut99.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_module + fn_fetch_function } fn_update_functions.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_module + fn_fetch_function } # @@ -701,96 +701,96 @@ fn_autoinstall() { install_complete.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_module + fn_fetch_function } install_config.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_module + fn_fetch_function } install_factorio_save.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_module + fn_fetch_function } install_dst_token.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_module + fn_fetch_function } install_eula.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_module + fn_fetch_function } install_gsquery.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_module + fn_fetch_function } install_gslt.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_module + fn_fetch_function } install_header.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_module + fn_fetch_function } install_logs.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_module + fn_fetch_function } install_retry.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_module + fn_fetch_function } install_server_dir.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_module + fn_fetch_function } install_server_files.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_module + fn_fetch_function } install_stats.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_module + fn_fetch_function } install_steamcmd.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_module + fn_fetch_function } install_ts3.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_module + fn_fetch_function } install_ts3db.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_module + fn_fetch_function } install_ut2k4.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_module + fn_fetch_function } install_dl_ut2k4.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_module + fn_fetch_function } install_ut2k4_key.sh() { functionfile="${FUNCNAME[0]}" - fn_fetch_module + fn_fetch_function } # Calls code required for legacy servers diff --git a/lgsm/functions/core_getopt.sh b/lgsm/functions/core_getopt.sh index 222ad0cf88..808fe2e2af 100644 --- a/lgsm/functions/core_getopt.sh +++ b/lgsm/functions/core_getopt.sh @@ -5,7 +5,7 @@ # Website: https://linuxgsm.com # Description: getopt arguments. -moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" ### Define all commands here. ## User commands | Trigger commands | Description @@ -18,11 +18,11 @@ 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-modules" "command_update_linuxgsm.sh" "Check and apply any LinuxGSM updates.") +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_sponso=("s;sponsor" "command_sponsor.sh" "Donation options.") +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.") @@ -54,7 +54,7 @@ cmd_dev_detect_deps=("dd;detect-deps" "command_dev_detect_deps.sh" "Detect requi cmd_dev_detect_glibc=("dg;detect-glibc" "command_dev_detect_glibc.sh" "Detect required glibc.") cmd_dev_detect_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_modules=("cf;clear-modules" "command_dev_clear_modules.sh" "Delete the contents of the modules dir.") +cmd_dev_clear_functions=("cf;clear-functions" "command_dev_clear_functions.sh" "Delete the contents of the functions dir.") ### Set specific opt here. @@ -145,11 +145,11 @@ currentopt+=("${cmd_install[@]}" "${cmd_auto_install[@]}") ## Developer commands. 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_modules[@]}") + currentopt+=("${cmd_dev_detect_deps[@]}" "${cmd_dev_detect_glibc[@]}" "${cmd_dev_detect_ldd[@]}" "${cmd_dev_query_raw[@]}" "${cmd_dev_clear_functions[@]}") fi -## Sponsor. -currentopt+=("${cmd_sponsor[@]}") +## Donate. +currentopt+=("${cmd_donate[@]}") ### Build list of available commands. optcommands=() diff --git a/lgsm/functions/core_github.sh b/lgsm/functions/core_github.sh index 228fe1078d..0462e65bfa 100644 --- a/lgsm/functions/core_github.sh +++ b/lgsm/functions/core_github.sh @@ -1,11 +1,11 @@ #!/bin/bash -# LinuxGSM core_github.sh module +# LinuxGSM core_github.sh function # Author: Daniel Gibbs # Contributors: http://linuxgsm.com/contrib # Website: https://linuxgsm.com -# Description: core module file for updates via github +# Description: core function file for updates via github -moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" github_api="https://api.github.com" diff --git a/lgsm/functions/core_legacy.sh b/lgsm/functions/core_legacy.sh index 2ed942abd1..f9aa514551 100644 --- a/lgsm/functions/core_legacy.sh +++ b/lgsm/functions/core_legacy.sh @@ -5,7 +5,7 @@ # Website: https://linuxgsm.com # Description: Code for backwards compatability with older versions of LinuxGSM. -moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +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) @@ -78,15 +78,6 @@ if [ -z "${wsstartmap}" ]; then fi fi -# Added as part of migrating functions dir to modules dir. -# Will remove functions dir if files in modules dir older than 14 days -functionsdir="${lgsmdir}/modules" -if [ -d "${lgsmdir}/functions" ]; then - if [ "$(find "${lgsmdir}/modules"/ -type f -mtime +"14" | wc -l)" -ne "0" ]; then - rm -rf "${lgsmdir:?}/functions" - fi -fi - fn_parms() { fn_reload_startparameters parms="${startparameters}" diff --git a/lgsm/functions/core_logs.sh b/lgsm/functions/core_logs.sh index 8057f30f74..1f0e275400 100644 --- a/lgsm/functions/core_logs.sh +++ b/lgsm/functions/core_logs.sh @@ -5,7 +5,7 @@ # Website: https://linuxgsm.com # Description: Acts as a log rotator, removing old logs. -moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" # Check if logfile variable and file exist, create logfile if it doesn't exist. if [ "${consolelog}" ]; then diff --git a/lgsm/functions/core_messages.sh b/lgsm/functions/core_messages.sh index 6d3ca9a25a..5362dd3d30 100644 --- a/lgsm/functions/core_messages.sh +++ b/lgsm/functions/core_messages.sh @@ -5,7 +5,7 @@ # Website: https://linuxgsm.com # Description: Defines on-screen messages such as [ OK ] and how script logs look. -moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +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. diff --git a/lgsm/functions/core_steamcmd.sh b/lgsm/functions/core_steamcmd.sh index 78c30f60ae..119748fb71 100644 --- a/lgsm/functions/core_steamcmd.sh +++ b/lgsm/functions/core_steamcmd.sh @@ -3,9 +3,9 @@ # Author: Daniel Gibbs # Contributors: http://linuxgsm.com/contrib # Website: https://linuxgsm.com -# Description: Core modules for SteamCMD +# Description: Core functions for SteamCMD -moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_install_steamcmd() { if [ "${shortname}" == "ark" ] && [ "${installsteamcmd}" == "1" ]; then diff --git a/lgsm/functions/core_trap.sh b/lgsm/functions/core_trap.sh index ea6fce8692..ae2b794706 100644 --- a/lgsm/functions/core_trap.sh +++ b/lgsm/functions/core_trap.sh @@ -5,7 +5,7 @@ # Website: https://linuxgsm.com # Description: Handles CTRL-C trap to give an exit code. -moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_exit_trap() { if [ -z "${exitcode}" ]; then From 03365ca5a747844335635623a94c6002388562a7 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Fri, 19 May 2023 18:58:48 +0100 Subject: [PATCH 056/181] feat: serverlist validate (#4207) * server list validate * dir * dir * dir * cr * add missing pc2 * pc2 * fix branch * exit code * repo * branch * fix csv * letter * tidy * codacy * exit code --- .github/workflows/details-check.yml | 10 +++++----- .github/workflows/serverlist-validate.sh | 22 ++++++++++++++++++++++ .github/workflows/serverlist-validate.yml | 13 +++++++++++++ .github/workflows/version-check.yml | 13 +------------ 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-12.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 | 5 ++++- lgsm/data/ubuntu-22.04.csv | 1 + 25 files changed, 64 insertions(+), 19 deletions(-) create mode 100755 .github/workflows/serverlist-validate.sh create mode 100644 .github/workflows/serverlist-validate.yml diff --git a/.github/workflows/details-check.yml b/.github/workflows/details-check.yml index 0d1327682d..b268bd03d9 100644 --- a/.github/workflows/details-check.yml +++ b/.github/workflows/details-check.yml @@ -35,13 +35,13 @@ jobs: run: sudo apt-get install libxml2-utils jq - name: Download linuxgsm.sh - run: wget https://raw.githubusercontent.com/GameServerManagers/LinuxGSM/feature/info_game-refactor/linuxgsm.sh; chmod +x linuxgsm.sh + run: wget https://raw.githubusercontent.com/GameServerManagers/LinuxGSM/${GITHUB_REF#refs/heads/}/linuxgsm.sh; chmod +x linuxgsm.sh - name: Grab server - run: LGSM_GITHUBBRANCH="feature/info_game-refactor" ./linuxgsm.sh ${{ matrix.shortname }}server + run: LGSM_GITHUBBRANCH="${GITHUB_REF#refs/heads/}" ./linuxgsm.sh ${{ matrix.shortname }}server - name: Enable developer mode - run: LGSM_GITHUBBRANCH="feature/info_game-refactor" ./${{ matrix.shortname }}server developer + run: LGSM_GITHUBBRANCH="${GITHUB_REF#refs/heads/}" ./${{ matrix.shortname }}server developer - id: sets-servercfgname name: Generate servercfgname @@ -68,7 +68,7 @@ jobs: run: grep "startparameters" lgsm/config-default/config-lgsm/${{ matrix.shortname }}server/_default.cfg - name: Detect details - run: LGSM_GITHUBBRANCH="feature/info_game-refactor" ./${{ matrix.shortname }}server detect-details + run: LGSM_GITHUBBRANCH="${GITHUB_REF#refs/heads/}" ./${{ matrix.shortname }}server detect-details - name: Query Raw - run: LGSM_GITHUBBRANCH="feature/info_game-refactor" ./${{ matrix.shortname }}server query-raw + run: LGSM_GITHUBBRANCH="${GITHUB_REF#refs/heads/}" ./${{ matrix.shortname }}server query-raw diff --git a/.github/workflows/serverlist-validate.sh b/.github/workflows/serverlist-validate.sh new file mode 100755 index 0000000000..b43e803e0d --- /dev/null +++ b/.github/workflows/serverlist-validate.sh @@ -0,0 +1,22 @@ +#!/bin/bash +echo "Checking that all the game servers are listed in all csv files" +echo "this check will ensure serverlist.csv has the same number of lines (-2 lines) as the other csv files" +# count the number of lines in the serverlist.csv +cd "lgsm/data" || exit +serverlistcount="$(wc -l < serverlist.csv)" +echo "serverlistcount: $serverlistcount" +# get list of all csv files starting with ubunutu debian centos +csvlist="$(ls -1 | grep -E '^(ubuntu|debian|centos|rhel|almalinux|rocky).*\.csv$')" +# loop though each csv file and make sure the number of lines is the same as the serverlistcount +for csv in $csvlist; do + csvcount="$(wc -l < "${csv}")" + csvcount=$((csvcount-2)) + if [ "$csvcount" -ne "$serverlistcount" ]; then + echo "ERROR: $csv ($csvcount) does not match serverlist.csv ($serverlistcount)" + exitcode=1 + else + echo "OK: $csv ($csvcount) and serverlist.csv ($serverlistcount) match" + fi +done + +exit ${exitcode} diff --git a/.github/workflows/serverlist-validate.yml b/.github/workflows/serverlist-validate.yml new file mode 100644 index 0000000000..e12c0e95ce --- /dev/null +++ b/.github/workflows/serverlist-validate.yml @@ -0,0 +1,13 @@ +name: Server list Validation +on: + workflow_dispatch: + push: + +jobs: + serverlist-validate: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: compare versions + run: chmod +x .github/workflows/serverlist-validate.sh; .github/workflows/serverlist-validate.sh diff --git a/.github/workflows/version-check.yml b/.github/workflows/version-check.yml index b2aac2f870..a12b344209 100644 --- a/.github/workflows/version-check.yml +++ b/.github/workflows/version-check.yml @@ -1,26 +1,15 @@ -# This is a basic workflow to help you get started with Actions - name: Version Check -# Controls when the action will run. Triggers the workflow on push or pull request -# events but only for the master branch 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: - # The type of runner that the job will run on + version-Check: runs-on: ubuntu-latest - - # 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 - # 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/lgsm/data/almalinux-8.csv b/lgsm/data/almalinux-8.csv index 8d4b452164..eb72d965e1 100644 --- a/lgsm/data/almalinux-8.csv +++ b/lgsm/data/almalinux-8.csv @@ -78,6 +78,7 @@ ns2c,speex.i686,tbb.i686 onset,mariadb-connector-c opfor pc +pc2 pmc,java-17-openjdk pstbs,GConf2 pvkii diff --git a/lgsm/data/almalinux-9.csv b/lgsm/data/almalinux-9.csv index 8d4b452164..eb72d965e1 100644 --- a/lgsm/data/almalinux-9.csv +++ b/lgsm/data/almalinux-9.csv @@ -78,6 +78,7 @@ ns2c,speex.i686,tbb.i686 onset,mariadb-connector-c opfor pc +pc2 pmc,java-17-openjdk pstbs,GConf2 pvkii diff --git a/lgsm/data/centos-7.csv b/lgsm/data/centos-7.csv index 0769c4ef8f..cd537127e6 100644 --- a/lgsm/data/centos-7.csv +++ b/lgsm/data/centos-7.csv @@ -78,6 +78,7 @@ ns2c,speex.i686,tbb.i686 onset,mariadb-connector-c opfor pc +pc2 pmc,java-11-openjdk pstbs,GConf2 pvkii diff --git a/lgsm/data/centos-8.csv b/lgsm/data/centos-8.csv index 8d4b452164..eb72d965e1 100644 --- a/lgsm/data/centos-8.csv +++ b/lgsm/data/centos-8.csv @@ -78,6 +78,7 @@ ns2c,speex.i686,tbb.i686 onset,mariadb-connector-c opfor pc +pc2 pmc,java-17-openjdk pstbs,GConf2 pvkii diff --git a/lgsm/data/centos-9.csv b/lgsm/data/centos-9.csv index 8d4b452164..eb72d965e1 100644 --- a/lgsm/data/centos-9.csv +++ b/lgsm/data/centos-9.csv @@ -78,6 +78,7 @@ ns2c,speex.i686,tbb.i686 onset,mariadb-connector-c opfor pc +pc2 pmc,java-17-openjdk pstbs,GConf2 pvkii diff --git a/lgsm/data/debian-10.csv b/lgsm/data/debian-10.csv index 7058cc97ee..eca6122293 100644 --- a/lgsm/data/debian-10.csv +++ b/lgsm/data/debian-10.csv @@ -78,6 +78,7 @@ ns2c,speex:i386,libtbb2 onset,libmariadb-dev opfor pc +pc2 pmc,openjdk-11-jre pstbs,libgconf-2-4 pvkii diff --git a/lgsm/data/debian-11.csv b/lgsm/data/debian-11.csv index ff8c8ae761..0eecc40fd1 100644 --- a/lgsm/data/debian-11.csv +++ b/lgsm/data/debian-11.csv @@ -78,6 +78,7 @@ ns2c,speex:i386,libtbb2 onset,libmariadb-dev opfor pc +pc2 pmc,openjdk-17-jre pstbs,libgconf-2-4 pvkii diff --git a/lgsm/data/debian-12.csv b/lgsm/data/debian-12.csv index 3f3e0aed1e..2bd92c32df 100644 --- a/lgsm/data/debian-12.csv +++ b/lgsm/data/debian-12.csv @@ -78,6 +78,7 @@ ns2c,speex:i386,libtbb12 onset,libmariadb-dev opfor pc +pc2 pmc,openjdk-17-jre pstbs,libgconf-2-4 pvkii diff --git a/lgsm/data/debian-9.csv b/lgsm/data/debian-9.csv index 507896a6ad..8a4fd6df43 100644 --- a/lgsm/data/debian-9.csv +++ b/lgsm/data/debian-9.csv @@ -78,6 +78,7 @@ ns2c,speex:i386,libtbb2 onset,libmariadb-dev opfor pc +pc2 pmc,openjdk-8-jre pstbs,libgconf-2-4 pvkii diff --git a/lgsm/data/rhel-7.csv b/lgsm/data/rhel-7.csv index c0b3f78043..dbf578bb9a 100644 --- a/lgsm/data/rhel-7.csv +++ b/lgsm/data/rhel-7.csv @@ -78,6 +78,7 @@ ns2c,speex.i686,tbb.i686 onset,mariadb-connector-c opfor pc +pc2 pmc,java-11-openjdk pstbs,GConf2 pvkii diff --git a/lgsm/data/rhel-8.csv b/lgsm/data/rhel-8.csv index 8d4b452164..eb72d965e1 100644 --- a/lgsm/data/rhel-8.csv +++ b/lgsm/data/rhel-8.csv @@ -78,6 +78,7 @@ ns2c,speex.i686,tbb.i686 onset,mariadb-connector-c opfor pc +pc2 pmc,java-17-openjdk pstbs,GConf2 pvkii diff --git a/lgsm/data/rhel-9.csv b/lgsm/data/rhel-9.csv index 8d4b452164..eb72d965e1 100644 --- a/lgsm/data/rhel-9.csv +++ b/lgsm/data/rhel-9.csv @@ -78,6 +78,7 @@ ns2c,speex.i686,tbb.i686 onset,mariadb-connector-c opfor pc +pc2 pmc,java-17-openjdk pstbs,GConf2 pvkii diff --git a/lgsm/data/rocky-8.csv b/lgsm/data/rocky-8.csv index 8d4b452164..eb72d965e1 100644 --- a/lgsm/data/rocky-8.csv +++ b/lgsm/data/rocky-8.csv @@ -78,6 +78,7 @@ ns2c,speex.i686,tbb.i686 onset,mariadb-connector-c opfor pc +pc2 pmc,java-17-openjdk pstbs,GConf2 pvkii diff --git a/lgsm/data/rocky-9.csv b/lgsm/data/rocky-9.csv index 8d4b452164..eb72d965e1 100644 --- a/lgsm/data/rocky-9.csv +++ b/lgsm/data/rocky-9.csv @@ -78,6 +78,7 @@ ns2c,speex.i686,tbb.i686 onset,mariadb-connector-c opfor pc +pc2 pmc,java-17-openjdk pstbs,GConf2 pvkii diff --git a/lgsm/data/serverlist.csv b/lgsm/data/serverlist.csv index 2bce540865..60d0dc8934 100644 --- a/lgsm/data/serverlist.csv +++ b/lgsm/data/serverlist.csv @@ -128,4 +128,3 @@ 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 2b152ffef6..387a862d9e 100644 --- a/lgsm/data/ubuntu-16.04.csv +++ b/lgsm/data/ubuntu-16.04.csv @@ -78,6 +78,7 @@ ns2c,speex:i386,libtbb2 onset,libmariadb-dev opfor pc +pc2 pmc,openjdk-8-jre pstbs,libgconf-2-4 pvkii diff --git a/lgsm/data/ubuntu-18.04.csv b/lgsm/data/ubuntu-18.04.csv index 7058cc97ee..eca6122293 100644 --- a/lgsm/data/ubuntu-18.04.csv +++ b/lgsm/data/ubuntu-18.04.csv @@ -78,6 +78,7 @@ ns2c,speex:i386,libtbb2 onset,libmariadb-dev opfor pc +pc2 pmc,openjdk-11-jre pstbs,libgconf-2-4 pvkii diff --git a/lgsm/data/ubuntu-20.04.csv b/lgsm/data/ubuntu-20.04.csv index 764812a71c..a07d23a0b7 100644 --- a/lgsm/data/ubuntu-20.04.csv +++ b/lgsm/data/ubuntu-20.04.csv @@ -78,6 +78,7 @@ ns2c,speex:i386,libtbb2 onset,libmariadb-dev opfor pc +pc2 pmc,openjdk-17-jre pstbs,libgconf-2-4 pvkii diff --git a/lgsm/data/ubuntu-21.04.csv b/lgsm/data/ubuntu-21.04.csv index ff8c8ae761..0eecc40fd1 100644 --- a/lgsm/data/ubuntu-21.04.csv +++ b/lgsm/data/ubuntu-21.04.csv @@ -78,6 +78,7 @@ ns2c,speex:i386,libtbb2 onset,libmariadb-dev opfor pc +pc2 pmc,openjdk-17-jre pstbs,libgconf-2-4 pvkii diff --git a/lgsm/data/ubuntu-21.10.csv b/lgsm/data/ubuntu-21.10.csv index ca9576ca03..e1504baca4 100644 --- a/lgsm/data/ubuntu-21.10.csv +++ b/lgsm/data/ubuntu-21.10.csv @@ -16,10 +16,11 @@ bfv,libncurses5:i386,libstdc++5:i386 bmdm,libncurses5:i386 bo bs -bt,libicu-dev +bt,libicu-dev,dos2unix btl 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 @@ -76,6 +78,7 @@ ns2c,speex:i386,libtbb2 onset,libmariadb-dev opfor pc +pc2 pmc,openjdk-17-jre pstbs,libgconf-2-4 pvkii diff --git a/lgsm/data/ubuntu-22.04.csv b/lgsm/data/ubuntu-22.04.csv index 50886ad29a..06190f47e1 100644 --- a/lgsm/data/ubuntu-22.04.csv +++ b/lgsm/data/ubuntu-22.04.csv @@ -78,6 +78,7 @@ ns2c,speex:i386,libtbb2 onset,libmariadb-dev opfor pc +pc2 pmc,openjdk-17-jre pstbs,libgconf-2-4 pvkii From 1ca0b54e2ac012ef828017438ec52cf63467bdc3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 24 May 2023 22:52:32 +0100 Subject: [PATCH 057/181] build(deps): bump JasonEtco/is-sponsor-label-action from 1 to 2 (#4209) Bumps [JasonEtco/is-sponsor-label-action](https://github.com/JasonEtco/is-sponsor-label-action) from 1 to 2. - [Release notes](https://github.com/JasonEtco/is-sponsor-label-action/releases) - [Commits](https://github.com/JasonEtco/is-sponsor-label-action/compare/v1...v2) --- updated-dependencies: - dependency-name: JasonEtco/is-sponsor-label-action 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/label-sponsors.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/label-sponsors.yml b/.github/workflows/label-sponsors.yml index 8cf880da97..c16f66ff63 100644 --- a/.github/workflows/label-sponsors.yml +++ b/.github/workflows/label-sponsors.yml @@ -9,6 +9,6 @@ jobs: name: is-sponsor-label runs-on: ubuntu-latest steps: - - uses: JasonEtco/is-sponsor-label-action@v1 + - uses: JasonEtco/is-sponsor-label-action@v2 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From b149b5a7ebc8a9a2807b795cb9d355fc6311a59a Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Thu, 25 May 2023 12:30:50 +0100 Subject: [PATCH 058/181] feat(new server): HYPERCHARGE: Unboxed (#4163) --- .../config-lgsm/hcuserver/_default.cfg | 190 ++++++++++++++++++ lgsm/data/serverlist.csv | 1 + lgsm/functions/info_messages.sh | 2 + lgsm/modules/info_game.sh | 13 ++ lgsm/modules/info_messages.sh | 8 + 5 files changed, 214 insertions(+) create mode 100644 lgsm/config-default/config-lgsm/hcuserver/_default.cfg diff --git a/lgsm/config-default/config-lgsm/hcuserver/_default.cfg b/lgsm/config-default/config-lgsm/hcuserver/_default.cfg new file mode 100644 index 0000000000..7fa7fd3b04 --- /dev/null +++ b/lgsm/config-default/config-lgsm/hcuserver/_default.cfg @@ -0,0 +1,190 @@ +################################## +######## 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 +ip="0.0.0.0" +port="7777" +queryport="27015" +defaultmap="KidsBedroom" +maxplayers="8" +servername="LinuxGSM" + +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="${defaultmap}?Difficulty=1?Game=DM?MapList=KidsBedroom,Playground,Garden,Hallway_Simple,Bathroom,Hallway_Hard,Attic_Daytime,Shed,ToyPalace,Kitchen,Garage?MaxPlayers=${maxplayers}?WeaponTypes=7?TimeLimit=600?ScoreLimit=30?Teamplay -ServerName='${servername}' -Port=${port} -QueryPort=${queryport} -NOCONSOLE -unattended" + +## Server Parameters for Plague mode +#startparameters="${defaultmap}?Game=PL?MapList=KidsBedroom,Garden,Hallway_Simple,Attic_Daytime,Garage,Shed,Kitchen,Hallway_Hard,ToyPalace,Bathroom?MaxPlayers=${maxplayers}?WeaponTypes=7?TimeLimit=600 -ServerName='${servername}' -Port=${port} -QueryPort=${queryport} -NOCONSOLE -unattended" + +## Server Parameters for Co-op mode +#startparameters="${defaultmap}?Difficulty=1?Game=WV?MapList=KidsBedroom?MaxPlayers=4 -ServerName='${servername}' -Port=${port} -QueryPort=${queryport} -NOCONSOLE -unattended" + + +#### 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="" + +# 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="1045940"s +steamcmdforcewindows="no" +# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch +branch="" +betapassword="" +# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server +steammaster="false" + +## Stop Mode | https://docs.linuxgsm.com/features/stop-mode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: GoldSrc +# 10: Avorion +# 11: end +stopmode="2" + +## Query mode +# 1: session only +# 2: gamedig (gsquery fallback) +# 3: gamedig +# 4: gsquery +# 5: tcp +querymode="1" +querytype="" + +## Console type +consoleverbose="no" +consoleinteract="no" + +## Game Server Details +# Do not edit +gamename="HYPERCHARGE: Unboxed" +engine="unreal4" +glibc="2.17" + +#### Directories #### +# Edit with care + +## Game Server Directories +systemdir="${serverfiles}/Unboxed" +executabledir="${systemdir}/Binaries/Linux" +executable="./UnboxedServer-Linux-Shipping" +servercfgdir="${systemdir}/Saved/Config/LinuxServer" +servercfg="GameUserSettings.ini" +servercfgdefault="GameUserSettings.ini" +servercfgfullpath="${servercfgdir}/${servercfg}" + +## Backup Directory +backupdir="${lgsmdir}/backup" + +## Logging Directories +logdir="${rootdir}/log" +gamelogdir="${systemdir}/Saved/Logs" +lgsmlogdir="${logdir}/script" +consolelogdir="${logdir}/console" +lgsmlog="${lgsmlogdir}/${selfname}-script.log" +consolelog="${consolelogdir}/${selfname}-console.log" +alertlog="${lgsmlogdir}/${selfname}-alert.log" +postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" + +## Logs Naming +lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" +consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" diff --git a/lgsm/data/serverlist.csv b/lgsm/data/serverlist.csv index 60d0dc8934..e462e32e6b 100644 --- a/lgsm/data/serverlist.csv +++ b/lgsm/data/serverlist.csv @@ -46,6 +46,7 @@ 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 +hcu,hcuserver,HYPERCHARGE: Unboxed,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 diff --git a/lgsm/functions/info_messages.sh b/lgsm/functions/info_messages.sh index 5478987f1c..3766049c60 100644 --- a/lgsm/functions/info_messages.sh +++ b/lgsm/functions/info_messages.sh @@ -1719,6 +1719,8 @@ fn_info_message_select_engine() { fn_info_message_etl elif [ "${shortname}" == "fctr" ]; then fn_info_message_fctr + elif [ "${shortname}" == "hcu" ]; then + fn_info_message_hcu elif [ "${shortname}" == "hw" ]; then fn_info_message_hw elif [ "${shortname}" == "ins" ]; then diff --git a/lgsm/modules/info_game.sh b/lgsm/modules/info_game.sh index be0286a5c2..3b5081ad6e 100644 --- a/lgsm/modules/info_game.sh +++ b/lgsm/modules/info_game.sh @@ -442,6 +442,19 @@ fn_info_game_dst() { tickrate="${tickrate:-"0"}" } +# Config Type: parameters +# Parameters: true +# Comment: ; or # +# Example: SessionName=SERVERNAME +# Filetype: ini +fn_info_game_hcu() { + defaultmap="${defaultmap:-"NOT SET"}" + maxplayers="${maxplayers:-"0"}" + port="${port:-"0"}" + queryport="${queryport:-"0"}" + servername="${servername:-"NOT SET"}" +} + # Config Type: ini # Parameters: true # Comment: ; or # diff --git a/lgsm/modules/info_messages.sh b/lgsm/modules/info_messages.sh index cc2463af1e..c226852933 100644 --- a/lgsm/modules/info_messages.sh +++ b/lgsm/modules/info_messages.sh @@ -1024,6 +1024,14 @@ fn_info_message_goldsrc() { } | column -s $'\t' -t } +fn_ingo_message_hcu(){ + { + fn_port "header" + fn_port "Game" port udp + fn_port "Query" queryport tcp + } | column -s $'\t' -t +} + fn_info_message_hw() { { fn_port "header" From 099d94017acb633a4cf52560a212c3490a214240 Mon Sep 17 00:00:00 2001 From: Christian Date: Thu, 25 May 2023 22:36:03 +0200 Subject: [PATCH 059/181] feature(newserver): Operation: Harsh Doorstop (#4112) * feat(newserver): Operation: Harsh Doorstop --------- Co-authored-by: Daniel Gibbs --- .../config-lgsm/inssserver/_default.cfg | 2 +- .../config-lgsm/ohdserver/_default.cfg | 191 ++++++++++++++++++ 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-12.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 | 1 + 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/modules/info_game.sh | 66 +++--- lgsm/modules/info_messages.sh | 11 + lgsm/modules/install_config.sh | 7 + 26 files changed, 293 insertions(+), 25 deletions(-) create mode 100644 lgsm/config-default/config-lgsm/ohdserver/_default.cfg diff --git a/lgsm/config-default/config-lgsm/inssserver/_default.cfg b/lgsm/config-default/config-lgsm/inssserver/_default.cfg index 5317f6be94..eb26d92117 100644 --- a/lgsm/config-default/config-lgsm/inssserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/inssserver/_default.cfg @@ -20,7 +20,7 @@ defaultscenario="Scenario_Crossing_Push_Security" maxplayers="28" ## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters -## Parameter Docs | https://sandstorm-support.newworldinteractive.com/hc/en-us/articles/360049211072-Server-Admin-Guide +## Parameter Docs | https://mod.io/g/insurgencysandstorm/r/server-admin-guide startparameters="${defaultmap}?Scenario=${defaultscenario}?MaxPlayers=${maxplayers} -Port=${port} -QueryPort=${queryport} -hostname='${servername}' -Rcon -RconPassword=${rconpassword} -RconListenPort=${rconport} -log" #### LinuxGSM Settings #### diff --git a/lgsm/config-default/config-lgsm/ohdserver/_default.cfg b/lgsm/config-default/config-lgsm/ohdserver/_default.cfg new file mode 100644 index 0000000000..4e855eb819 --- /dev/null +++ b/lgsm/config-default/config-lgsm/ohdserver/_default.cfg @@ -0,0 +1,191 @@ +################################## +######## 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 +ip="0.0.0.0" +port="7777" +queryport="27005" +servername="LinuxGSM Server" +serverpassword="" +# Maps: risala, khafji_p, lamdong, montecassino, argonne +defaultmap="AAS-TestMap" +maxplayers="16" + +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="${defaultmap}?MaxPlayers=${maxplayers}?Password=${serverpassword} -Port=${port} -QueryPort=${queryport} -SteamServerName='${servername}' -log" + +#### 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="950900" +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="Operation: Harsh Doorstop" +engine="unreal4" +glibc="2.17" + +#### Directories #### +# Edit with care + +## Game Server Directories +systemdir="${serverfiles}/HarshDoorstop" +executabledir="${systemdir}/Binaries/Linux" +executable="./HarshDoorstopServer-Linux-Shipping" +servercfgdir="${systemdir}/Saved/Config/LinuxServer" +servercfg="Game.ini" +servercfgdefault="Game.ini" +servercfgfullpath="${servercfgdir}/${servercfg}" + +## Backup Directory +backupdir="${lgsmdir}/backup" + +## Logging Directories +logdir="${rootdir}/log" +gamelogdir="${systemdir}/Saved/Logs" +lgsmlogdir="${logdir}/script" +consolelogdir="${logdir}/console" +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 +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 eb72d965e1..58882431c9 100644 --- a/lgsm/data/almalinux-8.csv +++ b/lgsm/data/almalinux-8.csv @@ -48,6 +48,7 @@ ets2 fctr fof gmod,ncurses-libs.i686 +hcu hl2dm hldm hldms @@ -75,6 +76,7 @@ nmrih,ncurses-libs.i686 ns ns2,speex,tbb ns2c,speex.i686,tbb.i686 +ohd onset,mariadb-connector-c opfor pc diff --git a/lgsm/data/almalinux-9.csv b/lgsm/data/almalinux-9.csv index eb72d965e1..58882431c9 100644 --- a/lgsm/data/almalinux-9.csv +++ b/lgsm/data/almalinux-9.csv @@ -48,6 +48,7 @@ ets2 fctr fof gmod,ncurses-libs.i686 +hcu hl2dm hldm hldms @@ -75,6 +76,7 @@ nmrih,ncurses-libs.i686 ns ns2,speex,tbb ns2c,speex.i686,tbb.i686 +ohd onset,mariadb-connector-c opfor pc diff --git a/lgsm/data/centos-7.csv b/lgsm/data/centos-7.csv index cd537127e6..1f8357148a 100644 --- a/lgsm/data/centos-7.csv +++ b/lgsm/data/centos-7.csv @@ -48,6 +48,7 @@ ets2 fctr fof gmod,ncurses-libs.i686 +hcu hl2dm hldm hldms @@ -75,6 +76,7 @@ nmrih,ncurses-libs.i686 ns ns2,speex,tbb ns2c,speex.i686,tbb.i686 +ohd onset,mariadb-connector-c opfor pc diff --git a/lgsm/data/centos-8.csv b/lgsm/data/centos-8.csv index eb72d965e1..58882431c9 100644 --- a/lgsm/data/centos-8.csv +++ b/lgsm/data/centos-8.csv @@ -48,6 +48,7 @@ ets2 fctr fof gmod,ncurses-libs.i686 +hcu hl2dm hldm hldms @@ -75,6 +76,7 @@ nmrih,ncurses-libs.i686 ns ns2,speex,tbb ns2c,speex.i686,tbb.i686 +ohd onset,mariadb-connector-c opfor pc diff --git a/lgsm/data/centos-9.csv b/lgsm/data/centos-9.csv index eb72d965e1..58882431c9 100644 --- a/lgsm/data/centos-9.csv +++ b/lgsm/data/centos-9.csv @@ -48,6 +48,7 @@ ets2 fctr fof gmod,ncurses-libs.i686 +hcu hl2dm hldm hldms @@ -75,6 +76,7 @@ nmrih,ncurses-libs.i686 ns ns2,speex,tbb ns2c,speex.i686,tbb.i686 +ohd onset,mariadb-connector-c opfor pc diff --git a/lgsm/data/debian-10.csv b/lgsm/data/debian-10.csv index eca6122293..228a03624d 100644 --- a/lgsm/data/debian-10.csv +++ b/lgsm/data/debian-10.csv @@ -48,6 +48,7 @@ ets2 fctr fof gmod,libtinfo5:i386 +hcu hl2dm hldm hldms @@ -75,6 +76,7 @@ nmrih,libtinfo5:i386 ns ns2,speex,libtbb2 ns2c,speex:i386,libtbb2 +ohd onset,libmariadb-dev opfor pc diff --git a/lgsm/data/debian-11.csv b/lgsm/data/debian-11.csv index 0eecc40fd1..1944a7c230 100644 --- a/lgsm/data/debian-11.csv +++ b/lgsm/data/debian-11.csv @@ -48,6 +48,7 @@ ets2 fctr fof gmod,libtinfo5:i386 +hcu hl2dm hldm hldms @@ -75,6 +76,7 @@ nmrih,libtinfo5:i386 ns ns2,speex,libtbb2 ns2c,speex:i386,libtbb2 +ohd onset,libmariadb-dev opfor pc diff --git a/lgsm/data/debian-12.csv b/lgsm/data/debian-12.csv index 2bd92c32df..5c6169cd36 100644 --- a/lgsm/data/debian-12.csv +++ b/lgsm/data/debian-12.csv @@ -48,6 +48,7 @@ ets2 fctr fof gmod,libtinfo5:i386 +hcu hl2dm hldm hldms @@ -75,6 +76,7 @@ nmrih,libtinfo5:i386 ns ns2,speex,libtbb12 ns2c,speex:i386,libtbb12 +ohd onset,libmariadb-dev opfor pc diff --git a/lgsm/data/debian-9.csv b/lgsm/data/debian-9.csv index 8a4fd6df43..eaaed82c0d 100644 --- a/lgsm/data/debian-9.csv +++ b/lgsm/data/debian-9.csv @@ -48,6 +48,7 @@ ets2 fctr fof gmod,libtinfo5:i386 +hcu hl2dm hldm hldms @@ -75,6 +76,7 @@ nmrih,libtinfo5:i386 ns ns2,speex,libtbb2 ns2c,speex:i386,libtbb2 +ohd onset,libmariadb-dev opfor pc diff --git a/lgsm/data/rhel-7.csv b/lgsm/data/rhel-7.csv index dbf578bb9a..14729d7317 100644 --- a/lgsm/data/rhel-7.csv +++ b/lgsm/data/rhel-7.csv @@ -48,6 +48,7 @@ ets2 fctr fof gmod,ncurses-libs.i686 +hcu hl2dm hldm hldms @@ -75,6 +76,7 @@ nmrih,ncurses-libs.i686 ns ns2,speex,tbb ns2c,speex.i686,tbb.i686 +ohd onset,mariadb-connector-c opfor pc diff --git a/lgsm/data/rhel-8.csv b/lgsm/data/rhel-8.csv index eb72d965e1..58882431c9 100644 --- a/lgsm/data/rhel-8.csv +++ b/lgsm/data/rhel-8.csv @@ -48,6 +48,7 @@ ets2 fctr fof gmod,ncurses-libs.i686 +hcu hl2dm hldm hldms @@ -75,6 +76,7 @@ nmrih,ncurses-libs.i686 ns ns2,speex,tbb ns2c,speex.i686,tbb.i686 +ohd onset,mariadb-connector-c opfor pc diff --git a/lgsm/data/rhel-9.csv b/lgsm/data/rhel-9.csv index eb72d965e1..58882431c9 100644 --- a/lgsm/data/rhel-9.csv +++ b/lgsm/data/rhel-9.csv @@ -48,6 +48,7 @@ ets2 fctr fof gmod,ncurses-libs.i686 +hcu hl2dm hldm hldms @@ -75,6 +76,7 @@ nmrih,ncurses-libs.i686 ns ns2,speex,tbb ns2c,speex.i686,tbb.i686 +ohd onset,mariadb-connector-c opfor pc diff --git a/lgsm/data/rocky-8.csv b/lgsm/data/rocky-8.csv index eb72d965e1..58882431c9 100644 --- a/lgsm/data/rocky-8.csv +++ b/lgsm/data/rocky-8.csv @@ -48,6 +48,7 @@ ets2 fctr fof gmod,ncurses-libs.i686 +hcu hl2dm hldm hldms @@ -75,6 +76,7 @@ nmrih,ncurses-libs.i686 ns ns2,speex,tbb ns2c,speex.i686,tbb.i686 +ohd onset,mariadb-connector-c opfor pc diff --git a/lgsm/data/rocky-9.csv b/lgsm/data/rocky-9.csv index eb72d965e1..58882431c9 100644 --- a/lgsm/data/rocky-9.csv +++ b/lgsm/data/rocky-9.csv @@ -48,6 +48,7 @@ ets2 fctr fof gmod,ncurses-libs.i686 +hcu hl2dm hldm hldms @@ -75,6 +76,7 @@ nmrih,ncurses-libs.i686 ns ns2,speex,tbb ns2c,speex.i686,tbb.i686 +ohd onset,mariadb-connector-c opfor pc diff --git a/lgsm/data/serverlist.csv b/lgsm/data/serverlist.csv index e462e32e6b..b442460dc4 100644 --- a/lgsm/data/serverlist.csv +++ b/lgsm/data/serverlist.csv @@ -74,6 +74,7 @@ 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 +ohd,ohdserver,Operation: Harsh Doorstop,ubuntu-22.04 onset,onsetserver,Onset,ubuntu-20.04 opfor,opforserver,Opposing Force,ubuntu-22.04 pc,pcserver,Project Cars,ubuntu-22.04 diff --git a/lgsm/data/ubuntu-16.04.csv b/lgsm/data/ubuntu-16.04.csv index 387a862d9e..4c20ca0a77 100644 --- a/lgsm/data/ubuntu-16.04.csv +++ b/lgsm/data/ubuntu-16.04.csv @@ -48,6 +48,7 @@ ets2 fctr fof gmod,libtinfo5:i386 +hcu hl2dm hldm hldms @@ -75,6 +76,7 @@ nmrih,libtinfo5:i386 ns ns2,speex,libtbb2 ns2c,speex:i386,libtbb2 +ohd onset,libmariadb-dev opfor pc diff --git a/lgsm/data/ubuntu-18.04.csv b/lgsm/data/ubuntu-18.04.csv index eca6122293..228a03624d 100644 --- a/lgsm/data/ubuntu-18.04.csv +++ b/lgsm/data/ubuntu-18.04.csv @@ -48,6 +48,7 @@ ets2 fctr fof gmod,libtinfo5:i386 +hcu hl2dm hldm hldms @@ -75,6 +76,7 @@ nmrih,libtinfo5:i386 ns ns2,speex,libtbb2 ns2c,speex:i386,libtbb2 +ohd onset,libmariadb-dev opfor pc diff --git a/lgsm/data/ubuntu-20.04.csv b/lgsm/data/ubuntu-20.04.csv index a07d23a0b7..ce7c8dee45 100644 --- a/lgsm/data/ubuntu-20.04.csv +++ b/lgsm/data/ubuntu-20.04.csv @@ -48,6 +48,7 @@ ets2 fctr fof gmod,libtinfo5:i386 +hcu hl2dm hldm hldms @@ -75,6 +76,7 @@ nmrih,libtinfo5:i386 ns ns2,speex,libtbb2 ns2c,speex:i386,libtbb2 +ohd onset,libmariadb-dev opfor pc diff --git a/lgsm/data/ubuntu-21.04.csv b/lgsm/data/ubuntu-21.04.csv index 0eecc40fd1..1944a7c230 100644 --- a/lgsm/data/ubuntu-21.04.csv +++ b/lgsm/data/ubuntu-21.04.csv @@ -48,6 +48,7 @@ ets2 fctr fof gmod,libtinfo5:i386 +hcu hl2dm hldm hldms @@ -75,6 +76,7 @@ nmrih,libtinfo5:i386 ns ns2,speex,libtbb2 ns2c,speex:i386,libtbb2 +ohd onset,libmariadb-dev opfor pc diff --git a/lgsm/data/ubuntu-21.10.csv b/lgsm/data/ubuntu-21.10.csv index e1504baca4..0358b85458 100644 --- a/lgsm/data/ubuntu-21.10.csv +++ b/lgsm/data/ubuntu-21.10.csv @@ -48,6 +48,7 @@ ets2 fctr fof gmod,libtinfo5:i386 +hcu hl2dm hldm hldms @@ -75,6 +76,7 @@ nmrih,libtinfo5:i386 ns ns2,speex,libtbb2 ns2c,speex:i386,libtbb2 +ohd onset,libmariadb-dev opfor pc diff --git a/lgsm/data/ubuntu-22.04.csv b/lgsm/data/ubuntu-22.04.csv index 06190f47e1..88bffb66e9 100644 --- a/lgsm/data/ubuntu-22.04.csv +++ b/lgsm/data/ubuntu-22.04.csv @@ -48,6 +48,7 @@ ets2 fctr fof gmod,libtinfo5:i386 +hcu hl2dm hldm hldms @@ -75,6 +76,7 @@ nmrih,libtinfo5:i386 ns ns2,speex,libtbb2 ns2c,speex:i386,libtbb2 +ohd onset,libmariadb-dev opfor pc diff --git a/lgsm/modules/info_game.sh b/lgsm/modules/info_game.sh index 3b5081ad6e..6e9d87f0dc 100644 --- a/lgsm/modules/info_game.sh +++ b/lgsm/modules/info_game.sh @@ -1339,13 +1339,13 @@ fn_info_game_mc() { configip="${configip:-"0.0.0.0"}" gamemode="${gamemode:-"NOT SET"}" maxplayers="${maxplayers:-"0"}" - port="${port:-"NOT SET"}" + port="${port:-"0"}" queryenabled="${queryenabled:-"NOT SET"}" if [ -z "${queryport}" ]; then queryport="${port}" fi rconpassword="${rconpassword:-"NOT SET"}" - rconport="${rconport:-"NOT SET"}" + rconport="${rconport:-"0"}" servername="${servername:-"NOT SET"}" worldname="${worldname:-"NOT SET"}" } @@ -1451,6 +1451,22 @@ fn_info_game_nec() { serverpassword="${serverpassword:-"NOT SET"}" } +# Config Type: ini +# Parameters: true +# Comment: ; or # +# Example: ServerName=SERVERNAME +# Filetype: ini +fn_info_game_ohd(){ + if [ -f "${servercfgfullpath}" ]; then + fn_info_game_ini rconenabled "bEnabled" + fn_info_game_ini rconport "ListenPort" + fn_info_game_ini rconpassword "Password" + fi + rconenabled="${rconenabled:-"false"}" + rconport="${rconport:-"0"}" + rconpassword="${rconpassword:-"NOT SET"}" +} + # Config Type: json # Parameters: false # Comment: // or /* */ @@ -1733,20 +1749,20 @@ fn_info_game_rw() { configip=$(grep "server_ip" "${servercfgfullpath}" | grep -v "database_mysql_server_ip" | sed -e 's/^[ \t]*//g' -e '/^--/d' -e 's/server_ip//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') # Not set - servername=${servername:-"NOT SET"} - serverpassword=${serverpassword:-"NOT SET"} - rconpassword=${rconpassword:-"NOT SET"} - rconport=${rconport:-"NOT SET"} - maxplayers=${maxplayers:-"0"} - port=${port:-"0"} - port2=${port2:-"0"} - port3=${port3:-"0"} - port4=${port4:-"0"} - queryport=${queryport:-"0"} - httpqueryport=${httpport:-"0"} - gamemode=${gamemode:-"NOT SET"} - worldname=${worldname:-"NOT SET"} - configip=${configip:-"0.0.0.0"} + servername="${servername:-"NOT SET"}" + serverpassword="${serverpassword:-"NOT SET"}" + rconpassword="${rconpassword:-"NOT SET"}" + rconport="${rconport:-"0"}" + maxplayers="${maxplayers:-"0"}" + port="${port:-"0"}" + port2="${port2:-"0"}" + port3="${port3:-"0"}" + port4="${port4:-"0"}" + queryport="${queryport:-"0"}" + httpqueryport="${httpport:-"0"}" + gamemode="${gamemode:-"NOT SET"}" + worldname="${worldname:-"NOT SET"}" + configip="${configip:-"0.0.0.0"}" fi } @@ -1766,17 +1782,17 @@ fn_info_game_samp() { servername=$(grep "hostname" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/hostname//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') rconpassword=$(grep "rcon_password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/^rcon_password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') port=$(grep "port" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') - queryport=${port} - rconport=${port} + queryport="${port}" + rconport="${port}" maxplayers=$(grep "maxplayers" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') # Not set - servername=${servername:-"NOT SET"} - rconpassword=${rconpassword:-"NOT SET"} - port=${port:-"7777"} - queryport=${port:-"7777"} - rconport=${rconport:-"7777"} - maxplayers=${maxplayers:-"12"} + servername="${servername:-"NOT SET"}" + rconpassword="${rconpassword:-"NOT SET"}" + port="${port:-"7777"}" + queryport="${port:-"7777"}" + rconport="${rconport:-"7777"}" + maxplayers="${maxplayers:-"12"}" fi } @@ -2267,6 +2283,8 @@ elif [ "${shortname}" == "mta" ]; then fn_info_game_mta elif [ "${shortname}" == "nec" ]; then fn_info_game_nec +elif [ "${shortname}" == "ohd" ]; then + fn_info_game_ohd elif [ "${shortname}" == "onset" ]; then fn_info_game_onset elif [ "${shortname}" == "pc" ]; then diff --git a/lgsm/modules/info_messages.sh b/lgsm/modules/info_messages.sh index c226852933..b4cc656526 100644 --- a/lgsm/modules/info_messages.sh +++ b/lgsm/modules/info_messages.sh @@ -1193,6 +1193,15 @@ fn_info_message_nec() { } | column -s $'\t' -t } +fn_info_message_ohd() { + { + fn_port "header" + fn_port "Game" port udp + fn_port "Query" queryport udp + fn_port "RCON" rconport tcp + } | column -s $'\t' -t +} + fn_info_message_onset() { { fn_port "header" @@ -1754,6 +1763,8 @@ fn_info_message_select_engine() { fn_info_message_mta elif [ "${shortname}" == "nec" ]; then fn_info_message_nec + elif [ "${shortname}" == "ohd" ]; then + fn_info_message_ohd elif [ "${shortname}" == "onset" ]; then fn_info_message_onset elif [ "${shortname}" == "pc" ]; then diff --git a/lgsm/modules/install_config.sh b/lgsm/modules/install_config.sh index b395390204..9cdb319a97 100644 --- a/lgsm/modules/install_config.sh +++ b/lgsm/modules/install_config.sh @@ -505,6 +505,13 @@ elif [ "${shortname}" == "hldms" ]; then fn_default_config_remote fn_set_config_vars fn_list_config_locations +elif [ "${shortname}" == "ohd" ]; then + gamedirname="OperationHarshDoorstop" + array_configs+=(Game.ini) + 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) From 87751181101633fe534cd6d7833c62046ade4aaa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kai=20o=28=28=CF=89=20=29=29o?= Date: Fri, 26 May 2023 20:36:28 +0100 Subject: [PATCH 060/181] python version change for rhel-9 & centos-9 (#4213) * python version change for rhel-9 & centos-9 - python36 is no longer available in the repo list for rhel-9 & centos-9 - not possible to use "dnf install python36" or "yum install python36", manually compiling from source or using pyenv is only way - switching from python36 to python3 in lgsm data files works for latest rhel-9 (redhat9) dev build * python36 to python3 for rocky-9 * python36 to python3 for almalinux-9 --- lgsm/data/almalinux-9.csv | 2 +- lgsm/data/centos-9.csv | 2 +- lgsm/data/rhel-9.csv | 2 +- lgsm/data/rocky-9.csv | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lgsm/data/almalinux-9.csv b/lgsm/data/almalinux-9.csv index 58882431c9..bef471c6cf 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++,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,python3,tar,tmux,unzip,util-linux,wget,xz steamcmd,glibc.i686,libstdc++.i686 ac ahl diff --git a/lgsm/data/centos-9.csv b/lgsm/data/centos-9.csv index 58882431c9..bef471c6cf 100644 --- a/lgsm/data/centos-9.csv +++ b/lgsm/data/centos-9.csv @@ -1,4 +1,4 @@ -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 +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 diff --git a/lgsm/data/rhel-9.csv b/lgsm/data/rhel-9.csv index 58882431c9..bef471c6cf 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++,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,python3,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 58882431c9..bef471c6cf 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++,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,python3,tar,tmux,unzip,util-linux,wget,xz steamcmd,glibc.i686,libstdc++.i686 ac ahl From 561206ccb4d3c2135503e53fa72c511fd8340b7c Mon Sep 17 00:00:00 2001 From: Christian Date: Fri, 26 May 2023 23:57:26 +0200 Subject: [PATCH 061/181] feat(newserver): Craftopia (#3739) * feat(newserver): Craftopia * exitcode 0 --------- Co-authored-by: Daniel Gibbs --- .../config-lgsm/ctserver/_default.cfg | 182 ++++++++++++++++++ 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-12.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 | 2 + lgsm/data/ubuntu-22.04.csv | 3 +- lgsm/modules/command_details.sh | 1 + lgsm/modules/info_game.sh | 114 ++++++----- lgsm/modules/info_messages.sh | 19 +- lgsm/modules/install_config.sh | 7 + 26 files changed, 301 insertions(+), 46 deletions(-) create mode 100644 lgsm/config-default/config-lgsm/ctserver/_default.cfg diff --git a/lgsm/config-default/config-lgsm/ctserver/_default.cfg b/lgsm/config-default/config-lgsm/ctserver/_default.cfg new file mode 100644 index 0000000000..9bef1f2ecc --- /dev/null +++ b/lgsm/config-default/config-lgsm/ctserver/_default.cfg @@ -0,0 +1,182 @@ +################################## +######## 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="-batchmode -showlogs" + +#### 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="1670340" +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="5" + +## Query mode +# 1: session only +# 2: gamedig (gsquery fallback) +# 3: gamedig +# 4: gsquery +# 5: tcp +querymode="1" +querytype="" + +## Console type +consoleverbose="no" +consoleinteract="yes" + +## Game Server Details +# Do not edit +gamename="Craftopia" +engine="unity3d" +glibc="2.17" + +#### Directories #### +# Edit with care + +## Game Server Directories +systemdir="${serverfiles}" +executabledir="${serverfiles}" +executable="./Craftopia.x86_64" +servercfgdir="${systemdir}" +servercfg="ServerSetting.ini" +servercfgdefault="ServerSetting.ini" +servercfgfullpath="${servercfgdir}/${servercfg}" + +## Backup Directory +backupdir="${lgsmdir}/backup" + +## Logging Directories +logdir="${rootdir}/log" +#gamelogdir="${serverfiles}" +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 58882431c9..1f8abc8e13 100644 --- a/lgsm/data/almalinux-8.csv +++ b/lgsm/data/almalinux-8.csv @@ -32,6 +32,7 @@ cs cscz csgo css,ncurses-libs.i686 +ct dab dayz dmc diff --git a/lgsm/data/almalinux-9.csv b/lgsm/data/almalinux-9.csv index bef471c6cf..fb760c4f0e 100644 --- a/lgsm/data/almalinux-9.csv +++ b/lgsm/data/almalinux-9.csv @@ -32,6 +32,7 @@ cs cscz csgo css,ncurses-libs.i686 +ct dab dayz dmc diff --git a/lgsm/data/centos-7.csv b/lgsm/data/centos-7.csv index 1f8357148a..7db6b259c2 100644 --- a/lgsm/data/centos-7.csv +++ b/lgsm/data/centos-7.csv @@ -32,6 +32,7 @@ cs cscz csgo css,ncurses-libs.i686 +ct dab dayz dmc diff --git a/lgsm/data/centos-8.csv b/lgsm/data/centos-8.csv index 58882431c9..1f8abc8e13 100644 --- a/lgsm/data/centos-8.csv +++ b/lgsm/data/centos-8.csv @@ -32,6 +32,7 @@ cs cscz csgo css,ncurses-libs.i686 +ct dab dayz dmc diff --git a/lgsm/data/centos-9.csv b/lgsm/data/centos-9.csv index bef471c6cf..fb760c4f0e 100644 --- a/lgsm/data/centos-9.csv +++ b/lgsm/data/centos-9.csv @@ -32,6 +32,7 @@ cs cscz csgo css,ncurses-libs.i686 +ct dab dayz dmc diff --git a/lgsm/data/debian-10.csv b/lgsm/data/debian-10.csv index 228a03624d..0009af180e 100644 --- a/lgsm/data/debian-10.csv +++ b/lgsm/data/debian-10.csv @@ -32,6 +32,7 @@ cs cscz csgo css,libtinfo5:i386 +ct dab dayz dmc diff --git a/lgsm/data/debian-11.csv b/lgsm/data/debian-11.csv index 1944a7c230..2ea69fdbb4 100644 --- a/lgsm/data/debian-11.csv +++ b/lgsm/data/debian-11.csv @@ -32,6 +32,7 @@ cs cscz csgo css,libtinfo5:i386 +ct dab dayz dmc diff --git a/lgsm/data/debian-12.csv b/lgsm/data/debian-12.csv index 5c6169cd36..072b28bc50 100644 --- a/lgsm/data/debian-12.csv +++ b/lgsm/data/debian-12.csv @@ -32,6 +32,7 @@ cs cscz csgo css,libtinfo5:i386 +ct dab dayz dmc diff --git a/lgsm/data/debian-9.csv b/lgsm/data/debian-9.csv index eaaed82c0d..6905917059 100644 --- a/lgsm/data/debian-9.csv +++ b/lgsm/data/debian-9.csv @@ -32,6 +32,7 @@ cs cscz csgo css,libtinfo5:i386 +ct dab dayz dmc diff --git a/lgsm/data/rhel-7.csv b/lgsm/data/rhel-7.csv index 14729d7317..5d25cd304c 100644 --- a/lgsm/data/rhel-7.csv +++ b/lgsm/data/rhel-7.csv @@ -32,6 +32,7 @@ cs cscz csgo css,ncurses-libs.i686 +ct dab dayz dmc diff --git a/lgsm/data/rhel-8.csv b/lgsm/data/rhel-8.csv index 58882431c9..1f8abc8e13 100644 --- a/lgsm/data/rhel-8.csv +++ b/lgsm/data/rhel-8.csv @@ -32,6 +32,7 @@ cs cscz csgo css,ncurses-libs.i686 +ct dab dayz dmc diff --git a/lgsm/data/rhel-9.csv b/lgsm/data/rhel-9.csv index bef471c6cf..fb760c4f0e 100644 --- a/lgsm/data/rhel-9.csv +++ b/lgsm/data/rhel-9.csv @@ -32,6 +32,7 @@ cs cscz csgo css,ncurses-libs.i686 +ct dab dayz dmc diff --git a/lgsm/data/rocky-8.csv b/lgsm/data/rocky-8.csv index 58882431c9..1f8abc8e13 100644 --- a/lgsm/data/rocky-8.csv +++ b/lgsm/data/rocky-8.csv @@ -32,6 +32,7 @@ cs cscz csgo css,ncurses-libs.i686 +ct dab dayz dmc diff --git a/lgsm/data/rocky-9.csv b/lgsm/data/rocky-9.csv index bef471c6cf..fb760c4f0e 100644 --- a/lgsm/data/rocky-9.csv +++ b/lgsm/data/rocky-9.csv @@ -32,6 +32,7 @@ cs cscz csgo css,ncurses-libs.i686 +ct dab dayz dmc diff --git a/lgsm/data/serverlist.csv b/lgsm/data/serverlist.csv index b442460dc4..8b2b5c705d 100644 --- a/lgsm/data/serverlist.csv +++ b/lgsm/data/serverlist.csv @@ -30,6 +30,7 @@ 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 +ct,ctserver,Craftopia,ubuntu-22.04 dab,dabserver,Double Action: Boogaloo,ubuntu-22.04 dayz,dayzserver,DayZ,ubuntu-22.04 dmc,dmcserver,Deathmatch Classic,ubuntu-22.04 diff --git a/lgsm/data/ubuntu-16.04.csv b/lgsm/data/ubuntu-16.04.csv index 4c20ca0a77..cac4c9659a 100644 --- a/lgsm/data/ubuntu-16.04.csv +++ b/lgsm/data/ubuntu-16.04.csv @@ -32,6 +32,7 @@ cs cscz csgo css,libtinfo5:i386 +ct dab dayz dmc diff --git a/lgsm/data/ubuntu-18.04.csv b/lgsm/data/ubuntu-18.04.csv index 228a03624d..0009af180e 100644 --- a/lgsm/data/ubuntu-18.04.csv +++ b/lgsm/data/ubuntu-18.04.csv @@ -32,6 +32,7 @@ cs cscz csgo css,libtinfo5:i386 +ct dab dayz dmc diff --git a/lgsm/data/ubuntu-20.04.csv b/lgsm/data/ubuntu-20.04.csv index ce7c8dee45..29028c16c9 100644 --- a/lgsm/data/ubuntu-20.04.csv +++ b/lgsm/data/ubuntu-20.04.csv @@ -32,6 +32,7 @@ cs cscz csgo css,libtinfo5:i386 +ct dab dayz dmc diff --git a/lgsm/data/ubuntu-21.04.csv b/lgsm/data/ubuntu-21.04.csv index 1944a7c230..2ea69fdbb4 100644 --- a/lgsm/data/ubuntu-21.04.csv +++ b/lgsm/data/ubuntu-21.04.csv @@ -32,6 +32,7 @@ cs cscz csgo css,libtinfo5:i386 +ct dab dayz dmc diff --git a/lgsm/data/ubuntu-21.10.csv b/lgsm/data/ubuntu-21.10.csv index 0358b85458..367dc67f42 100644 --- a/lgsm/data/ubuntu-21.10.csv +++ b/lgsm/data/ubuntu-21.10.csv @@ -19,6 +19,7 @@ bs bt,libicu-dev,dos2unix btl cc +cd ck,xvfb cd cmw @@ -32,6 +33,7 @@ cs cscz csgo css,libtinfo5:i386 +ct dab dayz dmc diff --git a/lgsm/data/ubuntu-22.04.csv b/lgsm/data/ubuntu-22.04.csv index 88bffb66e9..370fea8fb1 100644 --- a/lgsm/data/ubuntu-22.04.csv +++ b/lgsm/data/ubuntu-22.04.csv @@ -19,8 +19,8 @@ bs bt,libicu-dev,dos2unix btl cc -ck,xvfb cd +ck,xvfb cmw cod,libstdc++5:i386 cod2,libstdc++5:i386 @@ -32,6 +32,7 @@ cs cscz csgo css,libtinfo5:i386 +ct dab dayz dmc diff --git a/lgsm/modules/command_details.sh b/lgsm/modules/command_details.sh index 2c8e3a6585..d180b3b183 100644 --- a/lgsm/modules/command_details.sh +++ b/lgsm/modules/command_details.sh @@ -38,4 +38,5 @@ fn_info_message_ports fn_info_message_select_engine fn_info_message_statusbottom +exitcode=0 core_exit.sh diff --git a/lgsm/modules/info_game.sh b/lgsm/modules/info_game.sh index 6e9d87f0dc..c7a233c03a 100644 --- a/lgsm/modules/info_game.sh +++ b/lgsm/modules/info_game.sh @@ -906,6 +906,32 @@ fn_info_game_bf1942() { serverpassword="${serverpassword:-"NOT SET"}" } +# Config Type: ini +# Parameters: true +# Comment: ; or # +# Example: ServerName=SERVERNAME +# Filetype: ini +fn_info_game_ct(){ + if [ -f "${servercfgfullpath}" ]; then + fn_info_game_ini "configip" "bindAddress" + fn_info_game_ini "gamemode" "gameMode" + fn_info_game_ini "maxplayers" "maxPlayerNumber" + fn_info_game_ini "port" "port" + fn_info_game_ini "saveinterval" "autoSaveSec" + fn_info_game_ini "servername" "name" + fn_info_game_ini "serverpassword" "serverPassword" + fn_info_game_ini "serverpasswordenabled" "usePassword" + fi + configip="${configip:-"0.0.0.0"}" + gamemode="${gamemode:-"NOT SET"}" + maxplayers="${maxplayers:-"0"}" + port="${port:-"0"}" + saveinterval="${saveinterval:-"0"}" + servername="${servername:-"NOT SET"}" + serverpassword="${serverpassword:-"NOT SET"}" + serverpasswordenabled="${serverpasswordenabled:-"NOT SET"}" +} + # Config Type: con # Parameters: true # Comment: # or // @@ -1554,11 +1580,11 @@ fn_info_game_prism3d() { 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"} + maxplayers="${maxplayers:-"0"}" + port="${port:-"27015"}" + queryport="${queryport:-"27016"}" + servername="${servername:-"NOT SET"}" + serverpassword="${serverpassword:-"NOT SET"}" fi } @@ -1683,38 +1709,38 @@ fn_info_game_rtcw() { fn_info_game_quakec "serverpassword" "g_password" fn_info_game_quakec "maxplayers" "sv_maxclients" fi - rconpassword=${rconpassword:-"NOT SET"} - servername=${servername:-"NOT SET"} - serverpassword=${serverpassword:-"NOT SET"} - maxplayers=${maxplayers:-"0"} - port=${port:-"0"} - queryport=${port:-"0"} - defaultmap=${defaultmap:-"NOT SET"} + rconpassword="${rconpassword:-"NOT SET"}" + servername="${servername:-"NOT SET"}" + serverpassword="${serverpassword:-"NOT SET"}" + maxplayers="${maxplayers:-"0"}" + port="${port:-"0"}" + queryport="${port:-"0"}" + defaultmap="${defaultmap:-"NOT SET"}" } # Config Type: Parameters (mostly) fn_info_game_rust() { # Parameters - servername=${servername:-"NOT SET"} - port=${port:-"0"} - queryport=${queryport:-"0"} - appport=${appport:-"0"} - rconport=${rconport:-"0"} - gamemode=${gamemode:-"NOT SET"} - maxplayers=${maxplayers:-"0"} - rconpassword=${rconpassword:-"NOT SET"} - rconweb=${rconweb:-"NOT SET"} - tickrate=${tickrate:-"0"} - saveinterval=${saveinterval:-"0"} - serverlevel=${serverlevel:-"NOT SET"} - customlevelurl=${customlevelurl:-"NOT SET"} - worldsize=${worldsize:-"0"} + servername="${servername:-"NOT SET"}" + port="${port:-"0"}" + queryport="${queryport:-"0"}" + appport="${appport:-"0"}" + rconport="${rconport:-"0"}" + gamemode="${gamemode:-"NOT SET"}" + maxplayers="${maxplayers:-"0"}" + rconpassword="${rconpassword:-"NOT SET"}" + rconweb="${rconweb:-"NOT SET"}" + tickrate="${tickrate:-"0"}" + saveinterval="${saveinterval:-"0"}" + serverlevel="${serverlevel:-"NOT SET"}" + customlevelurl="${customlevelurl:-"NOT SET"}" + worldsize="${worldsize:-"0"}" if [ -n "${seed}" ]; then - seed=${seed:-"0"} + seed="${seed:-"0"}" elif [ -f "${datadir}/${selfname}-seed.txt" ]; then seed=$(cat "${datadir}/${selfname}-seed.txt") fi - salt=${salt:-"0"} + salt="${salt:-"0"}" } fn_info_game_rw() { @@ -2037,11 +2063,11 @@ fn_info_game_tw() { fn_info_game_quakec "maxplayers" "sv_max_clients" fi queryport="${port}" - servername=${servername:-"NOT SET"} - serverpassword=${serverpassword:-"NOT SET"} - rconpassword=${rconpassword:-"NOT SET"} - port=${port:-"0"} - maxplayers=${maxplayers:-"0"} + servername="${servername:-"NOT SET"}" + serverpassword="${serverpassword:-"NOT SET"}" + rconpassword="${rconpassword:-"NOT SET"}" + port="${port:-"0"}" + maxplayers="${maxplayers:-"0"}" } # Config Type: Parameters @@ -2161,10 +2187,10 @@ fn_info_game_wmc() { fi # Not set - servername=${servername:-"NOT SET"} - queryport=${queryport:-"25577"} - maxplayers=${maxplayers:-"0"} - configip=${configip:-"0.0.0.0"} + servername="${servername:-"NOT SET"}" + queryport="${queryport:-"25577"}" + maxplayers="${maxplayers:-"0"}" + configip="${configip:-"0.0.0.0"}" fi } @@ -2191,12 +2217,12 @@ fn_info_game_wurm() { configip=$(grep "IP" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/IP//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') # Not set - port=${port:-"3724"} - queryport=${queryport:-"27017"} - servername=${servername:-"NOT SET"} - serverpassword=${serverpassword:-"NOT SET"} - adminpassword=${adminpassword:-"NOT SET"} - maxplayers=${maxplayers:-"0"} + port="${port:-"3724"}" + queryport="${queryport:-"27017"}" + servername="${servername:-"NOT SET"}" + serverpassword="${serverpassword:-"NOT SET"}" + adminpassword="${adminpassword:-"NOT SET"}" + maxplayers="${maxplayers:-"0"}" fi } @@ -2241,6 +2267,8 @@ elif [ "${shortname}" == "codwaw" ]; then fn_info_game_codwaw elif [ "${shortname}" == "col" ]; then fn_info_game_col +elif [ "${shortname}" == "ct" ]; then + fn_info_game_ct elif [ "${shortname}" == "dayz" ]; then fn_info_game_dayz elif [ "${shortname}" == "dodr" ]; then diff --git a/lgsm/modules/info_messages.sh b/lgsm/modules/info_messages.sh index b4cc656526..a360f62021 100644 --- a/lgsm/modules/info_messages.sh +++ b/lgsm/modules/info_messages.sh @@ -285,6 +285,11 @@ fn_info_message_gameserver() { echo -e "${lightblue}Display IP:\t${default}${displayip}:${port}" fi + # Server password enabled (Craftopia) + if [ -n "${serverpasswordenabled}" ]; then + echo -e "${lightblue}Server password enabled:\t${default}${serverpasswordenabled}" + fi + # Server password if [ -n "${serverpassword}" ]; then echo -e "${lightblue}Server password:\t${default}${serverpassword}" @@ -664,7 +669,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" "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" "ct" "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" @@ -964,7 +969,15 @@ fn_info_message_csgo() { } | column -s $'\t' -t } -fn_info_message_dayz() { +fn_info_message_ct(){ + fn_info_message_password_strip + { + fn_port "header" + fn_port "Game" port udp + } | column -s $'\t' -t +} + +fn_info_message_dayz(){ { fn_port "header" fn_port "Game" port udp @@ -1719,6 +1732,8 @@ fn_info_message_select_engine() { fn_info_message_codwaw elif [ "${shortname}" == "col" ]; then fn_info_message_col + elif [ "${shortname}" == "ct" ]; then + fn_info_message_ct elif [ "${shortname}" == "dayz" ]; then fn_info_message_dayz elif [ "${shortname}" == "dodr" ]; then diff --git a/lgsm/modules/install_config.sh b/lgsm/modules/install_config.sh index 9cdb319a97..b0ff4a7858 100644 --- a/lgsm/modules/install_config.sh +++ b/lgsm/modules/install_config.sh @@ -381,6 +381,13 @@ elif [ "${shortname}" == "css" ]; then fn_default_config_remote fn_set_config_vars fn_list_config_locations +elif [ "${shortname}" == "ct" ]; then + gamedirname="Craftopia" + array_configs+=( ServerSetting.ini ) + fn_fetch_default_config + fn_default_config_remote + fn_set_config_vars + fn_list_config_locations elif [ "${shortname}" == "dayz" ]; then gamedirname="DayZ" fn_check_cfgdir From ae4cc3b699730ea3250b3493298460eaf63ed9c6 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Fri, 26 May 2023 23:33:14 +0100 Subject: [PATCH 062/181] fix(ck): Add libxi6 package to debian distros This commit adds the libxi6 package to the Debian and Ubuntu distribution files. The libxi6 package is required for some games that use X11 input extension library. This change will ensure that LGSM users can install and run these games on their systems without encountering any issues. --- lgsm/data/debian-10.csv | 2 +- lgsm/data/debian-11.csv | 2 +- lgsm/data/debian-12.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 0009af180e..7425cf3612 100644 --- a/lgsm/data/debian-10.csv +++ b/lgsm/data/debian-10.csv @@ -20,7 +20,7 @@ bt,libicu-dev,dos2unix btl cc cd -ck,xvfb +ck,xvfb,libxi6 cmw cod,libstdc++5:i386 cod2,libstdc++5:i386 diff --git a/lgsm/data/debian-11.csv b/lgsm/data/debian-11.csv index 2ea69fdbb4..5aa309c300 100644 --- a/lgsm/data/debian-11.csv +++ b/lgsm/data/debian-11.csv @@ -20,7 +20,7 @@ bt,libicu-dev,dos2unix btl cc cd -ck,xvfb +ck,xvfb,libxi6 cmw cod,libstdc++5:i386 cod2,libstdc++5:i386 diff --git a/lgsm/data/debian-12.csv b/lgsm/data/debian-12.csv index 072b28bc50..d34887dd62 100644 --- a/lgsm/data/debian-12.csv +++ b/lgsm/data/debian-12.csv @@ -20,7 +20,7 @@ bt,libicu-dev,dos2unix btl cc cd -ck,xvfb +ck,xvfb,libxi6 cmw cod,libstdc++5:i386 cod2,libstdc++5:i386 diff --git a/lgsm/data/ubuntu-16.04.csv b/lgsm/data/ubuntu-16.04.csv index cac4c9659a..7b883615ce 100644 --- a/lgsm/data/ubuntu-16.04.csv +++ b/lgsm/data/ubuntu-16.04.csv @@ -20,7 +20,7 @@ bt,libicu-dev,dos2unix btl cc cd -ck,xvfb +ck,xvfb,libxi6 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 0009af180e..7425cf3612 100644 --- a/lgsm/data/ubuntu-18.04.csv +++ b/lgsm/data/ubuntu-18.04.csv @@ -20,7 +20,7 @@ bt,libicu-dev,dos2unix btl cc cd -ck,xvfb +ck,xvfb,libxi6 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 29028c16c9..93b29f108d 100644 --- a/lgsm/data/ubuntu-20.04.csv +++ b/lgsm/data/ubuntu-20.04.csv @@ -20,7 +20,7 @@ bt,libicu-dev,dos2unix btl cc cd -ck,xvfb +ck,xvfb,libxi6 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 2ea69fdbb4..5aa309c300 100644 --- a/lgsm/data/ubuntu-21.04.csv +++ b/lgsm/data/ubuntu-21.04.csv @@ -20,7 +20,7 @@ bt,libicu-dev,dos2unix btl cc cd -ck,xvfb +ck,xvfb,libxi6 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 367dc67f42..af451ca248 100644 --- a/lgsm/data/ubuntu-21.10.csv +++ b/lgsm/data/ubuntu-21.10.csv @@ -20,7 +20,7 @@ bt,libicu-dev,dos2unix btl cc cd -ck,xvfb +ck,xvfb,libxi6 cd cmw cod,libstdc++5:i386 diff --git a/lgsm/data/ubuntu-22.04.csv b/lgsm/data/ubuntu-22.04.csv index 370fea8fb1..1f1cd1c4b6 100644 --- a/lgsm/data/ubuntu-22.04.csv +++ b/lgsm/data/ubuntu-22.04.csv @@ -20,7 +20,7 @@ bt,libicu-dev,dos2unix btl cc cd -ck,xvfb +ck,xvfb,libxi6 cmw cod,libstdc++5:i386 cod2,libstdc++5:i386 From fd55a294a17b430fa93821e788b298aa0f391dd1 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Fri, 26 May 2023 23:40:10 +0100 Subject: [PATCH 063/181] feat: Add Ubuntu 23.04 support Added support for Ubuntu 23.04 by creating a new CSV file with package dependencies for each game server. Also, fixed a minor typo in the info_game.sh script where "most liky" was corrected to "most likely". --- lgsm/data/ubuntu-23.04.csv | 135 +++++++++++++++++++++++++++++++++++++ lgsm/modules/info_game.sh | 2 +- 2 files changed, 136 insertions(+), 1 deletion(-) create mode 100644 lgsm/data/ubuntu-23.04.csv diff --git a/lgsm/data/ubuntu-23.04.csv b/lgsm/data/ubuntu-23.04.csv new file mode 100644 index 0000000000..1f1cd1c4b6 --- /dev/null +++ b/lgsm/data/ubuntu-23.04.csv @@ -0,0 +1,135 @@ +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 +ahl2 +ark +arma3 +armar,libcurl4 +ats +av +bb +bb2,libcurl4-gnutls-dev:i386 +bd +bf1942,libncurses5:i386,libtinfo5:i386 +bfv,libncurses5:i386,libstdc++5:i386 +bmdm,libncurses5:i386 +bo +bs +bt,libicu-dev,dos2unix +btl +cc +cd +ck,xvfb,libxi6 +cmw +cod,libstdc++5:i386 +cod2,libstdc++5:i386 +cod4 +coduo,libstdc++5:i386 +codwaw +col +cs +cscz +csgo +css,libtinfo5:i386 +ct +dab +dayz +dmc +dod +dodr +dods +doi +dst,libcurl4-gnutls-dev:i386 +dys +eco,libgdiplus +em +etl +ets2 +fctr +fof +gmod,libtinfo5:i386 +hcu +hl2dm +hldm +hldms +hw,lib32z1 +ins +inss +ios +jc2 +jc3 +jk2 +kf +kf2 +l4d +l4d2 +lo +mc,openjdk-17-jre +mcb +mh +mohaa,libstdc++5:i386 +mom +mta,libncursesw5,libxml2-utils +nd +nec +nmrih,libtinfo5:i386 +ns +ns2,speex,libtbb2 +ns2c,speex:i386,libtbb2 +ohd +onset,libmariadb-dev +opfor +pc +pc2 +pmc,openjdk-17-jre +pstbs,libgconf-2-4 +pvkii +pvr,libc++1 +pz,openjdk-17-jre,rng-tools5 +q2 +q3 +ql +qw +ricochet +ro +rtcw +rust,lib32z1 +rw,openjdk-17-jre +samp +sb +sbots +scpsl,mono-complete +scpslsm,mono-complete +sdtd,telnet,expect,libxml2-utils +sf +sfc,libtinfo5:i386 +sof2 +sol +squad +st +stn +sven,libssl1.1:i386,zlib1g:i386 +terraria +tf2,libcurl4-gnutls-dev:i386 +tfc +ti +ts +ts3 +tu +tw +unt +ut +ut2k4 +ut3 +ut99 +vh,libc6-dev +vints,mono-complete +vpmc,openjdk-17-jre +vs +wet +wf +wmc,openjdk-17-jre +wurm,xvfb +zmr,libtinfo5:i386 +zps,libtinfo5:i386 diff --git a/lgsm/modules/info_game.sh b/lgsm/modules/info_game.sh index c7a233c03a..5f9b4aaf72 100644 --- a/lgsm/modules/info_game.sh +++ b/lgsm/modules/info_game.sh @@ -2443,7 +2443,7 @@ if [ -z "${displaymasterserver}" ]; then if [ "$(command -v jq 2> /dev/null)" ]; then if [ -n "${ip}" ] && [ -n "${port}" ]; then if [ "${steammaster}" == "true" ] || [ "${commandname}" == "DEV-QUERY-RAW" ]; then - # Query external IP first as most liky to succeed. + # Query external IP first as most likely to succeed. 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}" 'if .response.servers != null then .response.servers[] | select((.gameport == ($port|tonumber) or .gameport == ($queryport|tonumber))) | .addr else empty end' | wc -l 2> /dev/null)" if [ "${masterserver}" == "0" ]; then # Loop though server IP addresses if external IP fails. From a20d72cede689845788faa8ae3423b0a88cfa81a Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sat, 27 May 2023 21:38:29 +0100 Subject: [PATCH 064/181] minor fixes --- .../config-lgsm/ns2cserver/_default.cfg | 2 +- .../config-lgsm/ns2server/_default.cfg | 2 +- lgsm/data/debian-9.csv | 2 +- lgsm/functions/core_modules copy.sh | 816 ------------------ lgsm/modules/info_messages.sh | 6 +- 5 files changed, 7 insertions(+), 821 deletions(-) delete mode 100644 lgsm/functions/core_modules copy.sh diff --git a/lgsm/config-default/config-lgsm/ns2cserver/_default.cfg b/lgsm/config-default/config-lgsm/ns2cserver/_default.cfg index 908ce97277..c1a6251b3a 100644 --- a/lgsm/config-default/config-lgsm/ns2cserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/ns2cserver/_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} -webinterface -webdomain ${ip} -webuser ${httpuser} -webpassword \"${httppassword}\" -webport ${httpport} -map ${defaultmap} -limit ${maxplayers} -config_path \"${servercfgdir}\" -modstorage \"${modstoragedir}\" -mods \"${mods}\"" +startparameters="-name \"${servername}\" -port ${port} -webadmin -webdomain ${ip} -webuser ${httpuser} -webpassword \"${httppassword}\" -webport ${httpport} -map ${defaultmap} -limit ${maxplayers} -config_path \"${servercfgdir}\" -modstorage \"${modstoragedir}\" -mods \"${mods}\"" #### LinuxGSM Settings #### diff --git a/lgsm/config-default/config-lgsm/ns2server/_default.cfg b/lgsm/config-default/config-lgsm/ns2server/_default.cfg index 5a6e8e5c72..e41efe7d26 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} -webinterface -webdomain ${ip} -webuser ${httpuser} -webpassword \"${httppassword}\" -webport ${httpport} -map ${defaultmap} -limit ${maxplayers} -config_path \"${servercfgdir}\" -logdir \"${gamelogdir}\" -modstorage \"${modstoragedir}\" -mods2 \"${mods}\"" +startparameters="-name \"${servername}\" -port ${port} -webadmin -webdomain ${ip} -webuser ${httpuser} -webpassword \"${httppassword}\" -webport ${httpport} -map ${defaultmap} -limit ${maxplayers} -config_path \"${servercfgdir}\" -logdir \"${gamelogdir}\" -modstorage \"${modstoragedir}\" -mods2 \"${mods}\"" #### LinuxGSM Settings #### diff --git a/lgsm/data/debian-9.csv b/lgsm/data/debian-9.csv index 6905917059..17c6d7d8b9 100644 --- a/lgsm/data/debian-9.csv +++ b/lgsm/data/debian-9.csv @@ -20,7 +20,7 @@ bt,libicu-dev,dos2unix btl cc cd -ck,xvfb +ck,xvfb,libxi6 cmw cod,libstdc++5:i386 cod2,libstdc++5:i386 diff --git a/lgsm/functions/core_modules copy.sh b/lgsm/functions/core_modules copy.sh deleted file mode 100644 index 8eb843b5a5..0000000000 --- a/lgsm/functions/core_modules copy.sh +++ /dev/null @@ -1,816 +0,0 @@ -#!/bin/bash -# LinuxGSM core_modules.sh module -# Author: Daniel Gibbs -# Contributors: http://linuxgsm.com/contrib -# Website: https://linuxgsm.com -# Description: Defines all modules to allow download and execution of modules using fn_fetch_module. -# This module is called first before any other module. Without this file other modules will not load. - -moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" - -modulesversion="v23.2.0" - -# Core - -core_dl.sh() { - modulefile="${FUNCNAME[0]}" - if [ "$(type fn_fetch_core_dl 2> /dev/null)" ]; then - fn_fetch_core_dl "lgsm/modules" "core_dl.sh" "${modulesdir}" "chmodx" "run" "noforcedl" "nohash" - else - fn_bootstrap_fetch_file_github "lgsm/modules" "core_dl.sh" "${modulesdir}" "chmodx" "run" "noforcedl" "nohash" - fi -} - -core_messages.sh() { - modulefile="${FUNCNAME[0]}" - if [ "$(type fn_fetch_core_dl 2> /dev/null)" ]; then - fn_fetch_core_dl "lgsm/modules" "core_messages.sh" "${modulesdir}" "chmodx" "run" "noforcedl" "nohash" - else - fn_bootstrap_fetch_file_github "lgsm/modules" "core_messages.sh" "${modulesdir}" "chmodx" "run" "noforcedl" "nohash" - fi -} - -core_legacy.sh() { - modulefile="${FUNCNAME[0]}" - if [ "$(type fn_fetch_core_dl 2> /dev/null)" ]; then - fn_fetch_core_dl "lgsm/modules" "core_legacy.sh" "${modulesdir}" "chmodx" "run" "noforcedl" "nohash" - else - fn_bootstrap_fetch_file_github "lgsm/modules" "core_legacy.sh" "${modulesdir}" "chmodx" "run" "noforcedl" "nohash" - fi -} - -core_exit.sh() { - modulefile="${FUNCNAME[0]}" - fn_fetch_module -} - -core_getopt.sh() { - modulefile="${FUNCNAME[0]}" - fn_fetch_module -} - -core_trap.sh() { - modulefile="${FUNCNAME[0]}" - fn_fetch_module -} - -core_steamcmd.sh() { - modulefile="${FUNCNAME[0]}" - fn_fetch_module -} - -core_github.sh() { - modulefile="${FUNCNAME[0]}" - fn_fetch_module -} - -# Commands - -command_backup.sh() { - modulefile="${FUNCNAME[0]}" - fn_fetch_module -} - -command_console.sh() { - modulefile="${FUNCNAME[0]}" - fn_fetch_module -} - -command_debug.sh() { - modulefile="${FUNCNAME[0]}" - fn_fetch_module -} - -command_details.sh() { - modulefile="${FUNCNAME[0]}" - fn_fetch_module -} - -command_sponsor.sh() { - modulefile="${FUNCNAME[0]}" - fn_fetch_module -} - -command_postdetails.sh() { - modulefile="${FUNCNAME[0]}" - fn_fetch_module -} - -command_test_alert.sh() { - modulefile="${FUNCNAME[0]}" - fn_fetch_module -} - -command_monitor.sh() { - modulefile="${FUNCNAME[0]}" - fn_fetch_module -} - -command_start.sh() { - modulefile="${FUNCNAME[0]}" - fn_fetch_module -} - -command_stop.sh() { - modulefile="${FUNCNAME[0]}" - fn_fetch_module -} - -command_validate.sh() { - modulefile="${FUNCNAME[0]}" - fn_fetch_module -} - -command_install.sh() { - modulefile="${FUNCNAME[0]}" - fn_fetch_module -} - -command_install_resources_mta.sh() { - modulefile="${FUNCNAME[0]}" - fn_fetch_module -} - -install_squad_license.sh() { - modulefile="${FUNCNAME[0]}" - fn_fetch_module -} - -command_mods_install.sh() { - modulefile="${FUNCNAME[0]}" - fn_fetch_module -} - -command_mods_update.sh() { - modulefile="${FUNCNAME[0]}" - fn_fetch_module -} - -command_mods_remove.sh() { - modulefile="${FUNCNAME[0]}" - fn_fetch_module -} - -command_fastdl.sh() { - modulefile="${FUNCNAME[0]}" - fn_fetch_module -} - -command_ts3_server_pass.sh() { - modulefile="${FUNCNAME[0]}" - fn_fetch_module -} - -command_restart.sh() { - modulefile="${FUNCNAME[0]}" - fn_fetch_module -} - -command_skeleton.sh() { - modulefile="${FUNCNAME[0]}" - fn_fetch_module -} - -command_wipe.sh() { - modulefile="${FUNCNAME[0]}" - fn_fetch_module -} - -command_send.sh() { - modulefile="${FUNCNAME[0]}" - fn_fetch_module -} - -# Checks - -check.sh() { - modulefile="${FUNCNAME[0]}" - fn_fetch_module -} - -check_config.sh() { - modulefile="${FUNCNAME[0]}" - fn_fetch_module -} - -check_deps.sh() { - modulefile="${FUNCNAME[0]}" - fn_fetch_module -} - -check_executable.sh() { - modulefile="${FUNCNAME[0]}" - fn_fetch_module -} - -check_glibc.sh() { - modulefile="${FUNCNAME[0]}" - fn_fetch_module -} - -check_ip.sh() { - modulefile="${FUNCNAME[0]}" - fn_fetch_module -} - -check_last_update.sh() { - modulefile="${FUNCNAME[0]}" - fn_fetch_module -} - -check_logs.sh() { - modulefile="${FUNCNAME[0]}" - fn_fetch_module -} - -check_permissions.sh() { - modulefile="${FUNCNAME[0]}" - fn_fetch_module -} - -check_root.sh() { - modulefile="${FUNCNAME[0]}" - fn_fetch_module -} - -check_status.sh() { - modulefile="${FUNCNAME[0]}" - fn_fetch_module -} - -check_steamcmd.sh() { - modulefile="${FUNCNAME[0]}" - fn_fetch_module -} - -check_system_dir.sh() { - modulefile="${FUNCNAME[0]}" - fn_fetch_module -} - -check_system_requirements.sh() { - modulefile="${FUNCNAME[0]}" - fn_fetch_module -} - -check_tmuxception.sh() { - modulefile="${FUNCNAME[0]}" - fn_fetch_module -} - -check_version.sh() { - modulefile="${FUNCNAME[0]}" - fn_fetch_module -} - -# Compress - -compress_unreal2_maps.sh() { - modulefile="${FUNCNAME[0]}" - fn_fetch_module -} - -compress_ut99_maps.sh() { - modulefile="${FUNCNAME[0]}" - fn_fetch_module -} - -# Mods - -mods_list.sh() { - modulefile="${FUNCNAME[0]}" - fn_fetch_module -} - -mods_core.sh() { - modulefile="${FUNCNAME[0]}" - fn_fetch_module -} - -# Dev - -command_dev_clear_modules.sh() { - modulefile="${FUNCNAME[0]}" - fn_fetch_module -} - -command_dev_debug.sh() { - modulefile="${FUNCNAME[0]}" - fn_fetch_module -} - -command_dev_detect_deps.sh() { - modulefile="${FUNCNAME[0]}" - fn_fetch_module -} - -command_dev_detect_glibc.sh() { - modulefile="${FUNCNAME[0]}" - fn_fetch_module -} - -command_dev_detect_ldd.sh() { - modulefile="${FUNCNAME[0]}" - fn_fetch_module -} - -command_dev_query_raw.sh() { - modulefile="${FUNCNAME[0]}" - fn_fetch_module -} - -# Fix - -fix.sh() { - modulefile="${FUNCNAME[0]}" - fn_fetch_module -} - -fix_ark.sh() { - modulefile="${FUNCNAME[0]}" - fn_fetch_module -} - -fix_av.sh() { - modulefile="${FUNCNAME[0]}" - fn_fetch_module -} - -fix_arma3.sh() { - modulefile="${FUNCNAME[0]}" - fn_fetch_module -} - -fix_armar.sh() { - modulefile="${FUNCNAME[0]}" - fn_fetch_module -} - -fix_bt.sh() { - modulefile="${FUNCNAME[0]}" - fn_fetch_module -} - -fix_bo.sh() { - modulefile="${FUNCNAME[0]}" - fn_fetch_module -} - -fix_cmw.sh() { - modulefile="${FUNCNAME[0]}" - fn_fetch_module -} - -fix_csgo.sh() { - modulefile="${FUNCNAME[0]}" - fn_fetch_module -} - -fix_dst.sh() { - modulefile="${FUNCNAME[0]}" - fn_fetch_module -} - -fix_hw.sh() { - modulefile="${FUNCNAME[0]}" - fn_fetch_module -} - -fix_ins.sh() { - modulefile="${FUNCNAME[0]}" - fn_fetch_module -} - -fix_kf.sh() { - modulefile="${FUNCNAME[0]}" - fn_fetch_module -} - -fix_kf2.sh() { - modulefile="${FUNCNAME[0]}" - fn_fetch_module -} - -fix_lo.sh() { - modulefile="${FUNCNAME[0]}" - fn_fetch_module -} - -fix_mcb.sh() { - modulefile="${FUNCNAME[0]}" - fn_fetch_module -} - -fix_mta.sh() { - modulefile="${FUNCNAME[0]}" - fn_fetch_module -} - -fix_nmrih.sh() { - modulefile="${FUNCNAME[0]}" - fn_fetch_module -} - -fix_onset.sh() { - modulefile="${FUNCNAME[0]}" - fn_fetch_module -} - -fix_ro.sh() { - modulefile="${FUNCNAME[0]}" - fn_fetch_module -} - -fix_rust.sh() { - modulefile="${FUNCNAME[0]}" - fn_fetch_module -} - -fix_rw.sh() { - modulefile="${FUNCNAME[0]}" - fn_fetch_module -} - -fix_sfc.sh() { - modulefile="${FUNCNAME[0]}" - fn_fetch_module -} - -fix_st.sh() { - modulefile="${FUNCNAME[0]}" - fn_fetch_module -} - -fix_steamcmd.sh() { - modulefile="${FUNCNAME[0]}" - fn_fetch_module -} - -fix_terraria.sh() { - modulefile="${FUNCNAME[0]}" - fn_fetch_module -} - -fix_tf2.sh() { - modulefile="${FUNCNAME[0]}" - fn_fetch_module -} - -fix_ut3.sh() { - modulefile="${FUNCNAME[0]}" - fn_fetch_module -} - -fix_rust.sh() { - modulefile="${FUNCNAME[0]}" - fn_fetch_module -} - -fix_samp.sh() { - modulefile="${FUNCNAME[0]}" - fn_fetch_module -} - -fix_sdtd.sh() { - modulefile="${FUNCNAME[0]}" - fn_fetch_module -} - -fix_sof2.sh() { - modulefile="${FUNCNAME[0]}" - fn_fetch_module -} - -fix_squad.sh() { - modulefile="${FUNCNAME[0]}" - fn_fetch_module -} - -fix_ts3.sh() { - modulefile="${FUNCNAME[0]}" - fn_fetch_module -} - -fix_ut2k4.sh() { - modulefile="${FUNCNAME[0]}" - fn_fetch_module -} - -fix_ut.sh() { - modulefile="${FUNCNAME[0]}" - fn_fetch_module -} - -fix_unt.sh() { - modulefile="${FUNCNAME[0]}" - fn_fetch_module -} - -fix_vh.sh() { - modulefile="${FUNCNAME[0]}" - fn_fetch_module -} - -fix_wurm.sh() { - modulefile="${FUNCNAME[0]}" - fn_fetch_module -} - -fix_zmr.sh() { - modulefile="${FUNCNAME[0]}" - fn_fetch_module -} - -# Info - -info_distro.sh() { - modulefile="${FUNCNAME[0]}" - fn_fetch_module -} - -info_game.sh() { - modulefile="${FUNCNAME[0]}" - fn_fetch_module -} - -info_messages.sh() { - modulefile="${FUNCNAME[0]}" - fn_fetch_module -} - -info_stats.sh() { - modulefile="${FUNCNAME[0]}" - fn_fetch_module -} - -# Alert - -alert.sh() { - modulefile="${FUNCNAME[0]}" - fn_fetch_module -} - -alert_discord.sh() { - modulefile="${FUNCNAME[0]}" - fn_fetch_module -} - -alert_email.sh() { - modulefile="${FUNCNAME[0]}" - fn_fetch_module -} - -alert_ifttt.sh() { - modulefile="${FUNCNAME[0]}" - fn_fetch_module -} - -alert_mailgun.sh() { - modulefile="${FUNCNAME[0]}" - fn_fetch_module -} - -alert_pushbullet.sh() { - modulefile="${FUNCNAME[0]}" - fn_fetch_module -} - -alert_pushover.sh() { - modulefile="${FUNCNAME[0]}" - fn_fetch_module -} - -alert_gotify.sh() { - modulefile="${FUNCNAME[0]}" - fn_fetch_module -} - -alert_telegram.sh() { - modulefile="${FUNCNAME[0]}" - fn_fetch_module -} - -alert_rocketchat.sh() { - modulefile="${FUNCNAME[0]}" - fn_fetch_module -} - -alert_slack.sh() { - modulefile="${FUNCNAME[0]}" - fn_fetch_module -} -# Logs - -core_logs.sh() { - modulefile="${FUNCNAME[0]}" - fn_fetch_module -} - -# Query - -query_gamedig.sh() { - modulefile="${FUNCNAME[0]}" - fn_fetch_module -} - -# Update - -command_update_modules.sh() { - modulefile="${FUNCNAME[0]}" - fn_fetch_module -} - -command_update_linuxgsm.sh() { - modulefile="${FUNCNAME[0]}" - fn_fetch_module -} - -command_update.sh() { - modulefile="${FUNCNAME[0]}" - fn_fetch_module -} - -command_check_update.sh() { - modulefile="${FUNCNAME[0]}" - fn_fetch_module -} - -update_ts3.sh() { - modulefile="${FUNCNAME[0]}" - fn_fetch_module -} - -update_minecraft.sh() { - modulefile="${FUNCNAME[0]}" - fn_fetch_module -} - -update_minecraft_bedrock.sh() { - modulefile="${FUNCNAME[0]}" - fn_fetch_module -} - -update_papermc.sh() { - modulefile="${FUNCNAME[0]}" - fn_fetch_module -} - -update_mta.sh() { - modulefile="${FUNCNAME[0]}" - fn_fetch_module -} - -update_factorio.sh() { - modulefile="${FUNCNAME[0]}" - fn_fetch_module -} - -update_jediknight2.sh() { - modulefile="${FUNCNAME[0]}" - fn_fetch_module -} - -update_steamcmd.sh() { - modulefile="${FUNCNAME[0]}" - fn_fetch_module -} - -update_vintagestory.sh() { - modulefile="${FUNCNAME[0]}" - fn_fetch_module -} - -update_ut99.sh() { - modulefile="${FUNCNAME[0]}" - fn_fetch_module -} - -fn_update_modules.sh() { - modulefile="${FUNCNAME[0]}" - fn_fetch_module -} - -# -## Installer modules -# - -fn_autoinstall() { - autoinstall=1 - command_install.sh -} - -install_complete.sh() { - modulefile="${FUNCNAME[0]}" - fn_fetch_module -} - -install_config.sh() { - modulefile="${FUNCNAME[0]}" - fn_fetch_module -} - -install_factorio_save.sh() { - modulefile="${FUNCNAME[0]}" - fn_fetch_module -} - -install_dst_token.sh() { - modulefile="${FUNCNAME[0]}" - fn_fetch_module -} - -install_eula.sh() { - modulefile="${FUNCNAME[0]}" - fn_fetch_module -} - -install_gsquery.sh() { - modulefile="${FUNCNAME[0]}" - fn_fetch_module -} - -install_gslt.sh() { - modulefile="${FUNCNAME[0]}" - fn_fetch_module -} - -install_header.sh() { - modulefile="${FUNCNAME[0]}" - fn_fetch_module -} - -install_logs.sh() { - modulefile="${FUNCNAME[0]}" - fn_fetch_module -} - -install_retry.sh() { - modulefile="${FUNCNAME[0]}" - fn_fetch_module -} - -install_server_dir.sh() { - modulefile="${FUNCNAME[0]}" - fn_fetch_module -} -install_server_files.sh() { - modulefile="${FUNCNAME[0]}" - fn_fetch_module -} - -install_stats.sh() { - modulefile="${FUNCNAME[0]}" - fn_fetch_module -} - -install_steamcmd.sh() { - modulefile="${FUNCNAME[0]}" - fn_fetch_module -} - -install_ts3.sh() { - modulefile="${FUNCNAME[0]}" - fn_fetch_module -} - -install_ts3db.sh() { - modulefile="${FUNCNAME[0]}" - fn_fetch_module -} - -install_ut2k4.sh() { - modulefile="${FUNCNAME[0]}" - fn_fetch_module -} - -install_dl_ut2k4.sh() { - modulefile="${FUNCNAME[0]}" - fn_fetch_module -} - -install_ut2k4_key.sh() { - modulefile="${FUNCNAME[0]}" - fn_fetch_module -} - -# Calls code required for legacy servers -core_legacy.sh - -# Creates tmp dir if missing -if [ ! -d "${tmpdir}" ]; then - mkdir -p "${tmpdir}" -fi - -# Creates lock dir if missing -if [ ! -d "${lockdir}" ]; then - mkdir -p "${lockdir}" -fi - -# Calls on-screen messages (bootstrap) -core_messages.sh - -#Calls file downloader (bootstrap) -core_dl.sh - -# Calls the global Ctrl-C trap -core_trap.sh diff --git a/lgsm/modules/info_messages.sh b/lgsm/modules/info_messages.sh index a360f62021..13fe285354 100644 --- a/lgsm/modules/info_messages.sh +++ b/lgsm/modules/info_messages.sh @@ -680,7 +680,7 @@ fn_info_message_ports_edit() { fi done # engines/games that require editing the start parameters. - 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") + local ports_edit_array=("av" "ck" "col" "fctr" "goldsrc" "hcu" "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}" @@ -1037,7 +1037,7 @@ fn_info_message_goldsrc() { } | column -s $'\t' -t } -fn_ingo_message_hcu(){ +fn_info_message_hcu(){ { fn_port "header" fn_port "Game" port udp @@ -1746,6 +1746,8 @@ fn_info_message_select_engine() { fn_info_message_etl elif [ "${shortname}" == "fctr" ]; then fn_info_message_fctr + elif [ "${shortname}" == "hcu" ]; then + fn_info_message_hcu elif [ "${shortname}" == "hw" ]; then fn_info_message_hw elif [ "${shortname}" == "ins" ]; then From 5905cad50f8b48415fac1713a57ca929de9bec0b Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sat, 27 May 2023 22:53:40 +0100 Subject: [PATCH 065/181] config tidy up --- .../config-lgsm/acserver/_default.cfg | 2 -- .../config-lgsm/avserver/_default.cfg | 2 -- .../config-lgsm/boserver/_default.cfg | 1 - .../config-lgsm/dayzserver/_default.cfg | 4 ---- .../config-lgsm/hcuserver/_default.cfg | 15 ++++++++++++--- .../config-lgsm/necserver/_default.cfg | 1 + .../config-lgsm/rustserver/_default.cfg | 4 ++-- 7 files changed, 15 insertions(+), 14 deletions(-) diff --git a/lgsm/config-default/config-lgsm/acserver/_default.cfg b/lgsm/config-default/config-lgsm/acserver/_default.cfg index 8d572b695d..80595da512 100644 --- a/lgsm/config-default/config-lgsm/acserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/acserver/_default.cfg @@ -12,8 +12,6 @@ steamuser="username" steampass='password' -## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters - ## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters startparameters="-c ${servercfgfullpath}" diff --git a/lgsm/config-default/config-lgsm/avserver/_default.cfg b/lgsm/config-default/config-lgsm/avserver/_default.cfg index a77e347a87..e22333aacf 100644 --- a/lgsm/config-default/config-lgsm/avserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/avserver/_default.cfg @@ -8,8 +8,6 @@ #### Game Server Settings #### -## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters - ## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters startparameters="--galaxy-name ${selfname} --ip ${ip} --datapath ${avdatapath}" diff --git a/lgsm/config-default/config-lgsm/boserver/_default.cfg b/lgsm/config-default/config-lgsm/boserver/_default.cfg index 4f44086c2c..0cea5eb309 100644 --- a/lgsm/config-default/config-lgsm/boserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/boserver/_default.cfg @@ -12,7 +12,6 @@ # GSLT can be used for running a public server. # More info: https://docs.linuxgsm.com/steamcmd/gslt gslt="" -ip="" ## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters startparameters="-batchmode -nographics -dedicated -configfile=${servercfgfullpath}" diff --git a/lgsm/config-default/config-lgsm/dayzserver/_default.cfg b/lgsm/config-default/config-lgsm/dayzserver/_default.cfg index d6d63d2b16..57ee4fb4de 100644 --- a/lgsm/config-default/config-lgsm/dayzserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/dayzserver/_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="2302" diff --git a/lgsm/config-default/config-lgsm/hcuserver/_default.cfg b/lgsm/config-default/config-lgsm/hcuserver/_default.cfg index 7fa7fd3b04..7ab893f527 100644 --- a/lgsm/config-default/config-lgsm/hcuserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/hcuserver/_default.cfg @@ -9,11 +9,11 @@ #### Game Server Settings #### ## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters +defaultmap="KidsBedroom" ip="0.0.0.0" +maxplayers="8" port="7777" queryport="27015" -defaultmap="KidsBedroom" -maxplayers="8" servername="LinuxGSM" ## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters @@ -52,6 +52,11 @@ 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" @@ -119,7 +124,7 @@ sleeptime="0.5" ## SteamCMD Settings | https://docs.linuxgsm.com/steamcmd # Server appid -appid="1045940"s +appid="1045940" steamcmdforcewindows="no" # SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch branch="" @@ -188,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/necserver/_default.cfg b/lgsm/config-default/config-lgsm/necserver/_default.cfg index ceb42033e2..a64c8792c6 100644 --- a/lgsm/config-default/config-lgsm/necserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/necserver/_default.cfg @@ -7,6 +7,7 @@ # [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" diff --git a/lgsm/config-default/config-lgsm/rustserver/_default.cfg b/lgsm/config-default/config-lgsm/rustserver/_default.cfg index acda7f6e4b..6a679f1680 100644 --- a/lgsm/config-default/config-lgsm/rustserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/rustserver/_default.cfg @@ -12,8 +12,8 @@ ip="0.0.0.0" port="28015" rconport="28016" -appport=28082 -queryport=28017 +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" From 0d3402d3ab2218e42a3cca8226aafe766fdaad51 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sun, 28 May 2023 00:02:22 +0100 Subject: [PATCH 066/181] remove duplicate --- lgsm/data/ubuntu-21.10.csv | 1 - 1 file changed, 1 deletion(-) diff --git a/lgsm/data/ubuntu-21.10.csv b/lgsm/data/ubuntu-21.10.csv index af451ca248..5aa309c300 100644 --- a/lgsm/data/ubuntu-21.10.csv +++ b/lgsm/data/ubuntu-21.10.csv @@ -21,7 +21,6 @@ btl cc cd ck,xvfb,libxi6 -cd cmw cod,libstdc++5:i386 cod2,libstdc++5:i386 From e12353b21cf05218aabdc8dbd5e58b6518cc9ec3 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sun, 28 May 2023 14:07:29 +0100 Subject: [PATCH 067/181] Release v23.3.0 --- lgsm/functions/core_functions.sh | 2 +- lgsm/functions/core_modules.sh | 2 +- lgsm/modules/core_functions.sh | 2 +- lgsm/modules/core_modules.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 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/lgsm/functions/core_functions.sh b/lgsm/functions/core_functions.sh index b301b7e465..50c69522ea 100644 --- 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.2.3" +modulesversion="v23.3.0" # Core diff --git a/lgsm/functions/core_modules.sh b/lgsm/functions/core_modules.sh index 81a7a5ab60..fd98349bcb 100644 --- a/lgsm/functions/core_modules.sh +++ b/lgsm/functions/core_modules.sh @@ -8,7 +8,7 @@ moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" -modulesversion="v23.2.3" +modulesversion="v23.3.0" # Core diff --git a/lgsm/modules/core_functions.sh b/lgsm/modules/core_functions.sh index 57e6d96d88..c6f9264511 100644 --- a/lgsm/modules/core_functions.sh +++ b/lgsm/modules/core_functions.sh @@ -8,7 +8,7 @@ module_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" -modulesversion="v23.2.3" +modulesversion="v23.3.0" # Core diff --git a/lgsm/modules/core_modules.sh b/lgsm/modules/core_modules.sh index dd5334e5ad..a950e8c227 100644 --- a/lgsm/modules/core_modules.sh +++ b/lgsm/modules/core_modules.sh @@ -8,7 +8,7 @@ moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" -modulesversion="v23.2.3" +modulesversion="v23.3.0" # Core diff --git a/linuxgsm.sh b/linuxgsm.sh index 683b75710e..787fb3a35b 100755 --- a/linuxgsm.sh +++ b/linuxgsm.sh @@ -20,7 +20,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="v23.2.3" +version="v23.3.0" shortname="core" gameservername="core" commandname="CORE" diff --git a/tests/tests_fctrserver.sh b/tests/tests_fctrserver.sh index a8d1161f21..e3a5ab80ec 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.2.3" +version="v23.3.0" shortname="fctr" gameservername="fctrserver" commandname="CORE" diff --git a/tests/tests_jc2server.sh b/tests/tests_jc2server.sh index 041b4c6d88..29ed21ab20 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.2.3" +version="v23.3.0" shortname="jc2" gameservername="jc2server" commandname="CORE" diff --git a/tests/tests_mcserver.sh b/tests/tests_mcserver.sh index 009d976086..155275c303 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.2.3" +version="v23.3.0" shortname="mc" gameservername="mcserver" commandname="CORE" diff --git a/tests/tests_ts3server.sh b/tests/tests_ts3server.sh index 1db76c279d..82533f557b 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.2.3" +version="v23.3.0" shortname="ts3" gameservername="ts3server" commandname="CORE" From 1c78d4b06f0c2969b0d45c37167d8f74def1a4fe Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sun, 28 May 2023 15:11:16 +0100 Subject: [PATCH 068/181] fix(sdtd): resolve sdtd details not collecting note xmllint is now required to gather details for sdtd This commit updates the server details to include new fields such as Internet IP, Server IP, Telnet Enabled, Telnet Password and Telnet Port. It also updates the game info for 7 Days to Die to use different XML tags for retrieving values. --- lgsm/modules/command_dev_details.sh | 6 +++- lgsm/modules/info_game.sh | 47 +++++++++++++++-------------- lgsm/modules/info_messages.sh | 1 - 3 files changed, 29 insertions(+), 25 deletions(-) diff --git a/lgsm/modules/command_dev_details.sh b/lgsm/modules/command_dev_details.sh index 330d7e2cd9..28abb87b16 100644 --- a/lgsm/modules/command_dev_details.sh +++ b/lgsm/modules/command_dev_details.sh @@ -44,7 +44,7 @@ declare -A server_details=( ['HTTP Password']="${httppassword}" ['HTTP Port']="${httpport}" ['HTTP User']="${httpuser}" - ['ip']="${ip}" + ['Internet IP']="${extip}" ['LAN Port']="${lanport}" ['Master Port']="${masterport}" ['Master']="${master}" @@ -56,12 +56,16 @@ declare -A server_details=( ['RCON Password']="${rconpassword}" ['RCON Port']="${rconport}" ['Reserved Slots']="${reservedslots}" + ['Server IP']="${ip}" ['Server Password']="${serverpassword}" ['Servername']="${servername}" ['Shard']="${shard}" ['Sharding']="${sharding}" ['Steam Auth Port']="${steamauthport}" + ['Telnet Enabled']="${telnetenabled}" ['Telnet IP']="${telnetip}" + ['Telnet Password']="${telnetpassword}" + ['Telnet Port']="${telnetport}" ['Tickrate']="${tickrate}" ['World Name']="${worldname}" ['World Type']="${worldtype}" diff --git a/lgsm/modules/info_game.sh b/lgsm/modules/info_game.sh index 5f9b4aaf72..8b91629c05 100644 --- a/lgsm/modules/info_game.sh +++ b/lgsm/modules/info_game.sh @@ -1883,38 +1883,39 @@ fn_info_game_scpsl() { # Filetype: xml fn_info_game_sdtd() { if [ -f "${servercfgfullpath}" ]; then - fn_info_game_xml "gamemode" "ServerSettings/@GameMode" - fn_info_game_xml "maxplayers" "ServerSettings/@MaxPlayers" - fn_info_game_xml "servername" "ServerSettings/@ServerName" - fn_info_game_xml "serverpassword" "ServerSettings/@ServerPassword" - fn_info_game_xml "serverport" "ServerSettings/@ServerPort" - fn_info_game_xml "telnetenabled" "ServerSettings/@TelnetEnabled" - fn_info_game_xml "telnetpass" "ServerSettings/@TelnetPassword" - fn_info_game_xml "telnetport" "ServerSettings/@TelnetPort" - fn_info_game_xml "httpenabled" "ServerSettings/@ControlPanelEnabled" - fn_info_game_xml "httppassword" "ServerSettings/@ControlPanelPassword" - fn_info_game_xml "httpport" "ServerSettings/@ControlPanelPort" - fn_info_game_xml "worldname" "ServerSettings/@GameWorld" - + fn_info_game_xml "gamemode" "/ServerSettings/property[@name='GameMode']/@value" + fn_info_game_xml "httpenabled" "/ServerSettings/property[@name='ControlPanelEnabled']/@value" + fn_info_game_xml "httppassword" "/ServerSettings/property[@name='ControlPanelPassword']/@value" + fn_info_game_xml "httpport" "/ServerSettings/property[@name='ControlPanelPort']/@value" + fn_info_game_xml "maxplayers" "/ServerSettings/property[@name='ServerMaxPlayerCount']/@value" + fn_info_game_xml "servername" "/ServerSettings/property[@name='ServerName']/@value" + fn_info_game_xml "serverpassword" "/ServerSettings/property[@name='ServerPassword']/@value" + fn_info_game_xml "port" "/ServerSettings/property[@name='ServerPort']/@value" + fn_info_game_xml "telnetenabled" "/ServerSettings/property[@name='TelnetEnabled']/@value" + fn_info_game_xml "telnetpass" "/ServerSettings/property[@name='TelnetPassword']/@value" + fn_info_game_xml "telnetport" "/ServerSettings/property[@name='TelnetPort']/@value" + fn_info_game_xml "worldname" "/ServerSettings/property[@name='GameWorld']/@value" fi - servername="${servername:-"NOT SET"}" - serverpassword="${serverpassword:-"NOT SET"}" - port="${port:-"0"}" - queryport="${queryport:-"0"}" + gamemode="${gamemode:-"NOT SET"}" httpenabled="${httpenabled:-"NOT SET"}" - httpport="${httpport:-"0"}" httppassword="${httppassword:-"NOT SET"}" - telnetenabled="${telnetenabled:-"NOT SET"}" - telnetport="${telnetport:-"0"}" - telnetpass="${telnetpass:-"NOT SET"}" + httpport="${httpport:-"0"}" maxplayers="${maxplayers:-"0"}" - gamemode="${gamemode:-"NOT SET"}" - worldname="${worldname:-"NOT SET"}" + port="${port:-"0"}" + port3="$((port + 2))" + queryport="${port:-"0"}" + servername="${servername:-"NOT SET"}" + serverpassword="${serverpassword:-"NOT SET"}" + telnetenabled="${telnetenabled:-"NOT SET"}" # Telnet IP will be localhost if no password is set # check_ip will set the IP first. This will overwrite it. if [ -z "${telnetpass}" ]; then telnetip="127.0.0.1" fi + telnetpass="${telnetpass:-"NOT SET"}" + telnetport="${telnetport:-"0"}" + worldname="${worldname:-"NOT SET"}" + } # Config Type: Parameters (with an ini) diff --git a/lgsm/modules/info_messages.sh b/lgsm/modules/info_messages.sh index 13fe285354..520dfa58e8 100644 --- a/lgsm/modules/info_messages.sh +++ b/lgsm/modules/info_messages.sh @@ -1411,7 +1411,6 @@ fn_info_message_sdtd() { { echo -e "${lightblue}Web Interface enabled:\t${default}${httpenabled}" echo -e "${lightblue}Web Interface url:\t${default}http://${httpip}:${httpport}/index.html" - echo -e "${lightblue}Web Interface username:\t${default}${httpuser}" echo -e "${lightblue}Web Interface password:\t${default}${httppassword}" } | column -s $'\t' -t echo -e "" From 9e85791e3255ab9823ce5af92dde073fc6f61686 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sun, 28 May 2023 15:14:02 +0100 Subject: [PATCH 069/181] Release v23.3.1 --- lgsm/functions/core_functions.sh | 2 +- lgsm/functions/core_modules.sh | 2 +- lgsm/modules/core_functions.sh | 2 +- lgsm/modules/core_modules.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 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/lgsm/functions/core_functions.sh b/lgsm/functions/core_functions.sh index 50c69522ea..3c5777c70c 100644 --- 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.3.0" +modulesversion="v23.3.1" # Core diff --git a/lgsm/functions/core_modules.sh b/lgsm/functions/core_modules.sh index fd98349bcb..80e890d1a7 100644 --- a/lgsm/functions/core_modules.sh +++ b/lgsm/functions/core_modules.sh @@ -8,7 +8,7 @@ moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" -modulesversion="v23.3.0" +modulesversion="v23.3.1" # Core diff --git a/lgsm/modules/core_functions.sh b/lgsm/modules/core_functions.sh index c6f9264511..9731815476 100644 --- a/lgsm/modules/core_functions.sh +++ b/lgsm/modules/core_functions.sh @@ -8,7 +8,7 @@ module_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" -modulesversion="v23.3.0" +modulesversion="v23.3.1" # Core diff --git a/lgsm/modules/core_modules.sh b/lgsm/modules/core_modules.sh index a950e8c227..827e62888b 100644 --- a/lgsm/modules/core_modules.sh +++ b/lgsm/modules/core_modules.sh @@ -8,7 +8,7 @@ moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" -modulesversion="v23.3.0" +modulesversion="v23.3.1" # Core diff --git a/linuxgsm.sh b/linuxgsm.sh index 787fb3a35b..30531fa754 100755 --- a/linuxgsm.sh +++ b/linuxgsm.sh @@ -20,7 +20,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="v23.3.0" +version="v23.3.1" shortname="core" gameservername="core" commandname="CORE" diff --git a/tests/tests_fctrserver.sh b/tests/tests_fctrserver.sh index e3a5ab80ec..6ecaad71a4 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.3.0" +version="v23.3.1" shortname="fctr" gameservername="fctrserver" commandname="CORE" diff --git a/tests/tests_jc2server.sh b/tests/tests_jc2server.sh index 29ed21ab20..7eb3fe2b2c 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.3.0" +version="v23.3.1" shortname="jc2" gameservername="jc2server" commandname="CORE" diff --git a/tests/tests_mcserver.sh b/tests/tests_mcserver.sh index 155275c303..4275b1f676 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.3.0" +version="v23.3.1" shortname="mc" gameservername="mcserver" commandname="CORE" diff --git a/tests/tests_ts3server.sh b/tests/tests_ts3server.sh index 82533f557b..f7f1cfb8c6 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.3.0" +version="v23.3.1" shortname="ts3" gameservername="ts3server" commandname="CORE" From 56d222041f58743877540136b301408a52a5aa13 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sun, 28 May 2023 15:48:00 +0100 Subject: [PATCH 070/181] fix(sdtd): add port3 to master server query this will allow master server query to work for sdtd --- lgsm/modules/info_game.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lgsm/modules/info_game.sh b/lgsm/modules/info_game.sh index 8b91629c05..b90033d9c0 100644 --- a/lgsm/modules/info_game.sh +++ b/lgsm/modules/info_game.sh @@ -2444,12 +2444,12 @@ if [ -z "${displaymasterserver}" ]; then if [ "$(command -v jq 2> /dev/null)" ]; then if [ -n "${ip}" ] && [ -n "${port}" ]; then if [ "${steammaster}" == "true" ] || [ "${commandname}" == "DEV-QUERY-RAW" ]; then - # Query external IP first as most likely to succeed. - 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}" 'if .response.servers != null then .response.servers[] | select((.gameport == ($port|tonumber) or .gameport == ($queryport|tonumber))) | .addr else empty end' | wc -l 2> /dev/null)" + # Query external IP first as most liky to succeed. + 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}" --arg port3 "${port3}" 'if .response.servers != null then .response.servers[] | select((.gameport == ($port|tonumber) or .gameport == ($queryport|tonumber) or .gameport == ($port3|tonumber))) | .addr else empty end' | wc -l 2> /dev/null)" if [ "${masterserver}" == "0" ]; then # Loop though server IP addresses if external IP fails. 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}" 'if .response.servers != null then .response.servers[] | select((.gameport == ($port|tonumber) or .gameport == ($queryport|tonumber))) | .addr else empty end' | 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}" --arg port3 "${port3}" 'if .response.servers != null then .response.servers[] | select((.gameport == ($port|tonumber) or .gameport == ($queryport|tonumber) or .gameport == ($port3|tonumber))) | .addr else empty end' | wc -l 2> /dev/null)" done fi if [ "${masterserver}" == "0" ]; then From 778b004b7f2f7efbc2dc6a712b845858266729c3 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sun, 28 May 2023 16:00:55 +0100 Subject: [PATCH 071/181] change core_functions to older version v23.2.3 --- lgsm/functions/core_functions.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lgsm/functions/core_functions.sh b/lgsm/functions/core_functions.sh index 3c5777c70c..b301b7e465 100644 --- 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.3.1" +modulesversion="v23.2.3" # Core From bacb12441a7bc370dc7297ffe7a17666db4ad47e Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sun, 28 May 2023 22:55:26 +0100 Subject: [PATCH 072/181] docs: update Squad server license link The script now points to the updated wiki page for information on obtaining a server license. The old forum link has been replaced with the new one. --- lgsm/modules/install_squad_license.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lgsm/modules/install_squad_license.sh b/lgsm/modules/install_squad_license.sh index 58053e134a..75499f4a06 100644 --- a/lgsm/modules/install_squad_license.sh +++ b/lgsm/modules/install_squad_license.sh @@ -15,9 +15,9 @@ echo -e "Server license is an optional feature for ${gamename} server" fn_script_log_info "Server license is an optional feature for ${gamename} server" echo -e "Get more info and a server license here:" -echo -e "http://forums.joinsquad.com/topic/16519-server-licensing-general-info/" +echo -e "https://squad.fandom.com/wiki/Server_licensing" fn_script_log_info "Get more info and a server license here:" -fn_script_log_info "http://forums.joinsquad.com/topic/16519-server-licensing-general-info/" +fn_script_log_info "https://squad.fandom.com/wiki/Server_licensing" echo -e "" fn_sleep_time echo -e "The Squad server license can be changed by editing ${servercfgdir}/License.cfg." From d170895d44f42b5f46ef367175b29e44af8aead5 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Mon, 29 May 2023 00:03:59 +0100 Subject: [PATCH 073/181] feat(info_game): add default queryport and port3 values This commit adds default values of 123456789 for queryport and port3 if they are not set. This is to prevent the query from failing. Additionally, this commit unsets the ports if they are set to 123456789. --- lgsm/modules/info_game.sh | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/lgsm/modules/info_game.sh b/lgsm/modules/info_game.sh index b90033d9c0..f355e683dd 100644 --- a/lgsm/modules/info_game.sh +++ b/lgsm/modules/info_game.sh @@ -2441,6 +2441,14 @@ fi # Steam Master Server - checks if detected by master server. # Checked after config init, as the queryport is needed if [ -z "${displaymasterserver}" ]; then + # if queryport and port3 are not set then set them to 123456789 + # this is to prevent the query from failing. + if [ -z "${queryport}" ]; then + queryport="123456789" + fi + if [ -z "${port3}" ]; then + port3="123456789" + fi if [ "$(command -v jq 2> /dev/null)" ]; then if [ -n "${ip}" ] && [ -n "${port}" ]; then if [ "${steammaster}" == "true" ] || [ "${commandname}" == "DEV-QUERY-RAW" ]; then @@ -2460,4 +2468,11 @@ if [ -z "${displaymasterserver}" ]; then fi fi fi + # unset the ports if they are set to 123456789 + if [ "${port3}" == "123456789" ]; then + unset port3 + fi + if [ "${queryport}" == "123456789" ]; then + unset queryport + fi fi From 29ff74cba3bb67da32070705ba5420bd7cd8fcce Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sun, 28 May 2023 22:55:26 +0100 Subject: [PATCH 074/181] docs: update Squad server license link The script now points to the updated wiki page for information on obtaining a server license. The old forum link has been replaced with the new one. --- lgsm/modules/install_squad_license.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lgsm/modules/install_squad_license.sh b/lgsm/modules/install_squad_license.sh index 58053e134a..75499f4a06 100644 --- a/lgsm/modules/install_squad_license.sh +++ b/lgsm/modules/install_squad_license.sh @@ -15,9 +15,9 @@ echo -e "Server license is an optional feature for ${gamename} server" fn_script_log_info "Server license is an optional feature for ${gamename} server" echo -e "Get more info and a server license here:" -echo -e "http://forums.joinsquad.com/topic/16519-server-licensing-general-info/" +echo -e "https://squad.fandom.com/wiki/Server_licensing" fn_script_log_info "Get more info and a server license here:" -fn_script_log_info "http://forums.joinsquad.com/topic/16519-server-licensing-general-info/" +fn_script_log_info "https://squad.fandom.com/wiki/Server_licensing" echo -e "" fn_sleep_time echo -e "The Squad server license can be changed by editing ${servercfgdir}/License.cfg." From 7ddbbfd64ae768654ea4aaf9c68ab4bbd5b65a18 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Mon, 29 May 2023 00:05:18 +0100 Subject: [PATCH 075/181] feat: improve error message for unknown game server (#4218) The code changes modify the error message displayed when an unknown game server is entered. The new message now capitalizes the first letter of "unknown" and adds an exit status of 1 to terminate the script. --- linuxgsm.sh | 3 ++- tests/tests_fctrserver.sh | 2 +- tests/tests_jc2server.sh | 2 +- tests/tests_mcserver.sh | 2 +- tests/tests_ts3server.sh | 2 +- 5 files changed, 6 insertions(+), 5 deletions(-) diff --git a/linuxgsm.sh b/linuxgsm.sh index 30531fa754..1a5b21904e 100755 --- a/linuxgsm.sh +++ b/linuxgsm.sh @@ -369,7 +369,8 @@ if [ "${shortname}" == "core" ]; then if [ "${userinput}" == "${gameservername}" ] || [ "${userinput}" == "${gamename}" ] || [ "${userinput}" == "${shortname}" ]; then fn_install_file else - echo -e "[ FAIL ] unknown game server" + echo -e "[ FAIL ] Unknown game server" + exit 1 fi else fn_install_getopt diff --git a/tests/tests_fctrserver.sh b/tests/tests_fctrserver.sh index 6ecaad71a4..fb9cfd5c02 100644 --- a/tests/tests_fctrserver.sh +++ b/tests/tests_fctrserver.sh @@ -369,7 +369,7 @@ if [ "${shortname}" == "core" ]; then if [ "${userinput}" == "${gameservername}" ] || [ "${userinput}" == "${gamename}" ] || [ "${userinput}" == "${shortname}" ]; then fn_install_file else - echo -e "[ FAIL ] unknown game server" + echo -e "[ FAIL ] Unknown game server" fi else fn_install_getopt diff --git a/tests/tests_jc2server.sh b/tests/tests_jc2server.sh index 7eb3fe2b2c..999e191fb9 100644 --- a/tests/tests_jc2server.sh +++ b/tests/tests_jc2server.sh @@ -370,7 +370,7 @@ if [ "${shortname}" == "core" ]; then if [ "${userinput}" == "${gameservername}" ] || [ "${userinput}" == "${gamename}" ] || [ "${userinput}" == "${shortname}" ]; then fn_install_file else - echo -e "[ FAIL ] unknown game server" + echo -e "[ FAIL ] Unknown game server" fi else fn_install_getopt diff --git a/tests/tests_mcserver.sh b/tests/tests_mcserver.sh index 4275b1f676..75656e14ac 100644 --- a/tests/tests_mcserver.sh +++ b/tests/tests_mcserver.sh @@ -370,7 +370,7 @@ if [ "${shortname}" == "core" ]; then if [ "${userinput}" == "${gameservername}" ] || [ "${userinput}" == "${gamename}" ] || [ "${userinput}" == "${shortname}" ]; then fn_install_file else - echo -e "[ FAIL ] unknown game server" + echo -e "[ FAIL ] Unknown game server" fi else fn_install_getopt diff --git a/tests/tests_ts3server.sh b/tests/tests_ts3server.sh index f7f1cfb8c6..e3093f3b59 100644 --- a/tests/tests_ts3server.sh +++ b/tests/tests_ts3server.sh @@ -370,7 +370,7 @@ if [ "${shortname}" == "core" ]; then if [ "${userinput}" == "${gameservername}" ] || [ "${userinput}" == "${gamename}" ] || [ "${userinput}" == "${shortname}" ]; then fn_install_file else - echo -e "[ FAIL ] unknown game server" + echo -e "[ FAIL ] Unknown game server" fi else fn_install_getopt From cff22244852e0f9731367803c450a4b92b126acd Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Mon, 29 May 2023 00:08:52 +0100 Subject: [PATCH 076/181] fix(info_game): fix RCON port and password details for Squad This commit adds the RCON port and password to the info_game function for Squad. The values are retrieved from the Rcon.cfg file if it exists in the server configuration directory. --- lgsm/modules/info_game.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lgsm/modules/info_game.sh b/lgsm/modules/info_game.sh index f355e683dd..c3e1a37b3d 100644 --- a/lgsm/modules/info_game.sh +++ b/lgsm/modules/info_game.sh @@ -2019,8 +2019,8 @@ fn_info_game_squad() { fn_info_game_keyvalue_pairs "maxplayers" "MaxPlayers" fi if [ -f "${servercfgdir}/Rcon.cfg" ]; then - fn_info_game_keyvalue_pairs "rconport" "Port" - fn_info_game_keyvalue_pairs "rconpassword" "Password" + fn_info_game_keyvalue_pairs "rconport" "Port" "${servercfgdir}/Rcon.cfg" + fn_info_game_keyvalue_pairs "rconpassword" "Password" "${servercfgdir}/Rcon.cfg" fi maxplayers="${maxplayers:-"0"}" port="${port:-"0"}" From 19dc1fbf34b39ae449357550c80decc75355c60d Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Mon, 29 May 2023 01:02:04 +0100 Subject: [PATCH 077/181] fix: Update function name and arguments in info_game.sh The fn_info_config_ini function was renamed to fn_info_game_ini for consistency with other functions. The function arguments were also updated to match the new naming convention. --- lgsm/modules/info_game.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lgsm/modules/info_game.sh b/lgsm/modules/info_game.sh index c3e1a37b3d..4039d9b74d 100644 --- a/lgsm/modules/info_game.sh +++ b/lgsm/modules/info_game.sh @@ -1954,11 +1954,11 @@ fn_info_game_sof2() { # Filetype: ini fn_info_game_sol() { if [ -f "${servercfgfullpath}" ]; then - fn_info_config_ini "adminpassword" "Admin_Password" - fn_info_config_ini "maxplayers" "Max_Players" - fn_info_config_ini "port" "Port" - fn_info_config_ini "servername" "Server_Name" - fn_info_config_ini "serverpassword" "Game_Password" + fn_info_game_ini "adminpassword" "Admin_Password" + fn_info_game_ini "maxplayers" "Max_Players" + fn_info_game_ini "port" "Port" + fn_info_game_ini "servername" "Server_Name" + fn_info_game_ini "serverpassword" "Game_Password" fi adminpassword="${adminpassword:-"NOT SET"}" maxplayers="${maxplayers:-"0"}" From ba7c795b513bc8b2a99ef18f18a1d8ff24b2681a Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Mon, 29 May 2023 01:18:23 +0100 Subject: [PATCH 078/181] fix: repair Starbound details This commit updates the info_game.sh file by changing the servercfgfullpath variable to servercfgparse in line 96. It also modifies the fn_info_game_sb function to check if the server config file exists before parsing it, and changes the JSON keys in lines 1828-1836 from camelCase to dot notation. --- lgsm/modules/info_game.sh | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/lgsm/modules/info_game.sh b/lgsm/modules/info_game.sh index 4039d9b74d..d2714ec3ef 100644 --- a/lgsm/modules/info_game.sh +++ b/lgsm/modules/info_game.sh @@ -93,7 +93,7 @@ fn_info_game_json() { else servercfgparse="${servercfgfullpath}" fi - eval "${1}=\"$(jq -r "${2}" "${servercfgfullpath}")\"" + eval "${1}=\"$(jq -r "${2}" "${servercfgparse}")\"" configtype="json" } @@ -1826,15 +1826,15 @@ fn_info_game_samp() { # Parameters: false # Comment: // or /* */ fn_info_game_sb() { - if [ ! -f "${servercfgfullpath}" ]; then - fn_info_game_json "maxplayers" "maxPlayers" - fn_info_game_json "port" "gameServerPort" - fn_info_game_json "queryenabled" "runQueryServer" - fn_info_game_json "queryport" "queryServerPort" - fn_info_game_json "rconenabled" "runRconServer" - fn_info_game_json "rconpassword" "rconServerPassword" - fn_info_game_json "rconport" "rconServerPort" - fn_info_game_json "servername" "serverName" + if [ -f "${servercfgfullpath}" ]; then + fn_info_game_json "maxplayers" ".maxPlayers" + fn_info_game_json "port" ".gameServerPort" + fn_info_game_json "queryenabled" ".runQueryServer" + fn_info_game_json "queryport" ".queryServerPort" + fn_info_game_json "rconenabled" ".runRconServer" + fn_info_game_json "rconpassword" ".rconServerPassword" + fn_info_game_json "rconport" ".rconServerPort" + fn_info_game_json "servername" ".serverName" fi maxplayers="${maxplayers:-"0"}" port="${port:-"0"}" From 58c173db61cf9a113202f8b3c49e5f248fd3f314 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Mon, 29 May 2023 19:48:16 +0100 Subject: [PATCH 079/181] Release v23.3.2 --- lgsm/modules/core_functions.sh | 2 +- lgsm/modules/core_modules.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, 7 insertions(+), 7 deletions(-) diff --git a/lgsm/modules/core_functions.sh b/lgsm/modules/core_functions.sh index 9731815476..ff0fe50def 100644 --- a/lgsm/modules/core_functions.sh +++ b/lgsm/modules/core_functions.sh @@ -8,7 +8,7 @@ module_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" -modulesversion="v23.3.1" +modulesversion="v23.3.2" # Core diff --git a/lgsm/modules/core_modules.sh b/lgsm/modules/core_modules.sh index 827e62888b..71a3180c07 100644 --- a/lgsm/modules/core_modules.sh +++ b/lgsm/modules/core_modules.sh @@ -8,7 +8,7 @@ moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" -modulesversion="v23.3.1" +modulesversion="v23.3.2" # Core diff --git a/linuxgsm.sh b/linuxgsm.sh index 1a5b21904e..4e3d27e159 100755 --- a/linuxgsm.sh +++ b/linuxgsm.sh @@ -20,7 +20,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="v23.3.1" +version="v23.3.2" shortname="core" gameservername="core" commandname="CORE" diff --git a/tests/tests_fctrserver.sh b/tests/tests_fctrserver.sh index fb9cfd5c02..f135c98eb8 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.3.1" +version="v23.3.2" shortname="fctr" gameservername="fctrserver" commandname="CORE" diff --git a/tests/tests_jc2server.sh b/tests/tests_jc2server.sh index 999e191fb9..2f0204f7b0 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.3.1" +version="v23.3.2" shortname="jc2" gameservername="jc2server" commandname="CORE" diff --git a/tests/tests_mcserver.sh b/tests/tests_mcserver.sh index 75656e14ac..38b39e62d9 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.3.1" +version="v23.3.2" shortname="mc" gameservername="mcserver" commandname="CORE" diff --git a/tests/tests_ts3server.sh b/tests/tests_ts3server.sh index e3093f3b59..d3e73133db 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.3.1" +version="v23.3.2" shortname="ts3" gameservername="ts3server" commandname="CORE" From d76e65eadf78bf539dcce73d00162fce1f609b78 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Mon, 29 May 2023 21:24:00 +0100 Subject: [PATCH 080/181] chore: add details to details check --- .github/workflows/details-check.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/details-check.yml b/.github/workflows/details-check.yml index b268bd03d9..7b04f20368 100644 --- a/.github/workflows/details-check.yml +++ b/.github/workflows/details-check.yml @@ -67,6 +67,9 @@ jobs: - name: Display parameters run: grep "startparameters" lgsm/config-default/config-lgsm/${{ matrix.shortname }}server/_default.cfg + - name: Details + run: LGSM_GITHUBBRANCH="${GITHUB_REF#refs/heads/}" ./${{ matrix.shortname }}server details + - name: Detect details run: LGSM_GITHUBBRANCH="${GITHUB_REF#refs/heads/}" ./${{ matrix.shortname }}server detect-details From 2e00adc109380625d929fc84f9c8d26ab039e0fa Mon Sep 17 00:00:00 2001 From: Brandon Frohs Date: Fri, 9 Jun 2023 11:35:34 -0400 Subject: [PATCH 081/181] fix(mcb): update version check to account for a colon (#4227) * update version check to account for a colon --------- Co-authored-by: Daniel Gibbs --- lgsm/functions/update_minecraft_bedrock.sh | 2 +- lgsm/modules/update_minecraft_bedrock.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lgsm/functions/update_minecraft_bedrock.sh b/lgsm/functions/update_minecraft_bedrock.sh index aec9401268..c17088171a 100644 --- a/lgsm/functions/update_minecraft_bedrock.sh +++ b/lgsm/functions/update_minecraft_bedrock.sh @@ -34,7 +34,7 @@ fn_update_localbuild() { # Gets local build info. fn_print_dots "Checking local build: ${remotelocation}" # 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') + localbuild=$(grep Version "${consolelogdir}"/* 2> /dev/null | tail -1 | sed 's/.*Version: //' | tr -d '\000-\011\013-\037') if [ -z "${localbuild}" ]; then fn_print_error "Checking local build: ${remotelocation}: missing local build info" fn_script_log_error "Missing local build info" diff --git a/lgsm/modules/update_minecraft_bedrock.sh b/lgsm/modules/update_minecraft_bedrock.sh index 075286096e..3c3885a9d9 100644 --- a/lgsm/modules/update_minecraft_bedrock.sh +++ b/lgsm/modules/update_minecraft_bedrock.sh @@ -34,7 +34,7 @@ fn_update_localbuild() { # Gets local build info. fn_print_dots "Checking local build: ${remotelocation}" # 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') + localbuild=$(grep Version "${consolelogdir}"/* 2> /dev/null | tail -1 | sed 's/.*Version: //' | tr -d '\000-\011\013-\037') if [ -z "${localbuild}" ]; then fn_print_error "Checking local build: ${remotelocation}: missing local build info" fn_script_log_error "Missing local build info" From 71be098ec08e8c63e4f36b6a683e93ed054b405c Mon Sep 17 00:00:00 2001 From: Bibo164 <14028796+Bibo164@users.noreply.github.com> Date: Fri, 9 Jun 2023 17:36:23 +0200 Subject: [PATCH 082/181] fix(pmc): Removed hardcoded project name in update update_papermc.sh (#4225) * fix: Removed hardcoded project name in update update_papermc.sh Script was unable to fetch the proper builds for WaterfallMC due to it checking PaperMC instead. Replaced the hardcoded .../paper/... project name with the already existing ${paperproject} to fix the issue --------- Co-authored-by: Daniel Gibbs --- lgsm/modules/update_papermc.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lgsm/modules/update_papermc.sh b/lgsm/modules/update_papermc.sh index b7bdee8fd5..b70a2d69db 100644 --- a/lgsm/modules/update_papermc.sh +++ b/lgsm/modules/update_papermc.sh @@ -51,7 +51,7 @@ fn_update_remotebuild() { fi fi # Get list of paper builds for specific Minecraft: Java Edition version. - remotebuildresponsemcversion=$(curl -s "${apiurl}/paper/versions/${remotebuildmcversion}") + remotebuildresponsemcversion=$(curl -s "${apiurl}/${paperproject}/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. From 9e347fe9fae88349fb7c0b500d709103847376c7 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Fri, 9 Jun 2023 16:38:29 +0100 Subject: [PATCH 083/181] Release v23.3.3 This commit updates the version of the core to v23.3.3. Additionally, it removes updates the .gitignore file. --- .gitignore | 3 +-- 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(+), 7 deletions(-) diff --git a/.gitignore b/.gitignore index 8bb6a5b32c..e5c465ce23 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,2 @@ -*.db -.idea +.vscode/settings.json /node_modules diff --git a/linuxgsm.sh b/linuxgsm.sh index 4e3d27e159..d8a28d604f 100755 --- a/linuxgsm.sh +++ b/linuxgsm.sh @@ -20,7 +20,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="v23.3.2" +version="v23.3.3" shortname="core" gameservername="core" commandname="CORE" diff --git a/tests/tests_fctrserver.sh b/tests/tests_fctrserver.sh index f135c98eb8..3c97fffaf3 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.3.2" +version="v23.3.3" shortname="fctr" gameservername="fctrserver" commandname="CORE" diff --git a/tests/tests_jc2server.sh b/tests/tests_jc2server.sh index 2f0204f7b0..9604ddb062 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.3.2" +version="v23.3.3" shortname="jc2" gameservername="jc2server" commandname="CORE" diff --git a/tests/tests_mcserver.sh b/tests/tests_mcserver.sh index 38b39e62d9..ff2a01b129 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.3.2" +version="v23.3.3" shortname="mc" gameservername="mcserver" commandname="CORE" diff --git a/tests/tests_ts3server.sh b/tests/tests_ts3server.sh index d3e73133db..bf0bf9fb76 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.3.2" +version="v23.3.3" shortname="ts3" gameservername="ts3server" commandname="CORE" From 44931f7995b90ad3cc3507a9762eb89ad90980d9 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Fri, 9 Jun 2023 16:58:39 +0100 Subject: [PATCH 084/181] feat: swap details-check steps to fail faster if the branch disappears the check will fail straight away rather then spend 1m download dependency's --- .github/workflows/details-check.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/details-check.yml b/.github/workflows/details-check.yml index 7b04f20368..d36a07ef0e 100644 --- a/.github/workflows/details-check.yml +++ b/.github/workflows/details-check.yml @@ -31,12 +31,12 @@ jobs: matrix: ${{ fromJSON(needs.create-matrix.outputs.matrix) }} steps: - - name: Install dependencies - run: sudo apt-get install libxml2-utils jq - - name: Download linuxgsm.sh run: wget https://raw.githubusercontent.com/GameServerManagers/LinuxGSM/${GITHUB_REF#refs/heads/}/linuxgsm.sh; chmod +x linuxgsm.sh + - name: Install dependencies + run: sudo apt-get install libxml2-utils jq + - name: Grab server run: LGSM_GITHUBBRANCH="${GITHUB_REF#refs/heads/}" ./linuxgsm.sh ${{ matrix.shortname }}server From 75b47bb2b92a83130f9892630f72985bb34dfad1 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Fri, 9 Jun 2023 17:02:15 +0100 Subject: [PATCH 085/181] Release v23.3.3 --- lgsm/modules/core_functions.sh | 2 +- lgsm/modules/core_modules.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lgsm/modules/core_functions.sh b/lgsm/modules/core_functions.sh index ff0fe50def..446db1f86e 100644 --- a/lgsm/modules/core_functions.sh +++ b/lgsm/modules/core_functions.sh @@ -8,7 +8,7 @@ module_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" -modulesversion="v23.3.2" +modulesversion="v23.3.3" # Core diff --git a/lgsm/modules/core_modules.sh b/lgsm/modules/core_modules.sh index 71a3180c07..35a919422b 100644 --- a/lgsm/modules/core_modules.sh +++ b/lgsm/modules/core_modules.sh @@ -8,7 +8,7 @@ moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" -modulesversion="v23.3.2" +modulesversion="v23.3.3" # Core From e79800567c92474af70f0deb26544dedc5647a3a Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Fri, 9 Jun 2023 17:02:15 +0100 Subject: [PATCH 086/181] Release v23.3.3 --- lgsm/modules/core_functions.sh | 2 +- lgsm/modules/core_modules.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lgsm/modules/core_functions.sh b/lgsm/modules/core_functions.sh index ff0fe50def..446db1f86e 100644 --- a/lgsm/modules/core_functions.sh +++ b/lgsm/modules/core_functions.sh @@ -8,7 +8,7 @@ module_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" -modulesversion="v23.3.2" +modulesversion="v23.3.3" # Core diff --git a/lgsm/modules/core_modules.sh b/lgsm/modules/core_modules.sh index 71a3180c07..35a919422b 100644 --- a/lgsm/modules/core_modules.sh +++ b/lgsm/modules/core_modules.sh @@ -8,7 +8,7 @@ moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" -modulesversion="v23.3.2" +modulesversion="v23.3.3" # Core From fa24b0837082c644d56f4331fc51e1e2a1efc676 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Fri, 9 Jun 2023 17:10:50 +0100 Subject: [PATCH 087/181] feat: Add concurrency to details-check workflow This commit adds a new feature to the details-check workflow by including concurrency. The group is set to the branch name and cancel-in-progress is enabled. --- .github/workflows/details-check.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/details-check.yml b/.github/workflows/details-check.yml index d36a07ef0e..19376a15d5 100644 --- a/.github/workflows/details-check.yml +++ b/.github/workflows/details-check.yml @@ -4,6 +4,10 @@ on: workflow_dispatch: push: +concurrency: + group: ${{ github.ref_name }} + cancel-in-progress: true + jobs: create-matrix: runs-on: ubuntu-latest From 2cebdfea66a8ef43050104c1e18bbebf365ba41d Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sun, 11 Jun 2023 16:24:04 +0100 Subject: [PATCH 088/181] feat: add header to serverlist.csv (#4231) * feat: add header to serverlist.csv added header to serverlistto help ansible and other tools better work with the csv file * feat: update serverlist menu The script now skips the first line of the serverlist file when generating the list for 'list' and 'install' commands. This ensures that the header is not included in the output. * fix: check details * fix serverlist validate test --- .github/workflows/detals-check-generate-matrix.sh | 2 +- .github/workflows/serverlist-validate.sh | 2 +- lgsm/data/serverlist.csv | 1 + linuxgsm.sh | 4 ++-- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/detals-check-generate-matrix.sh b/.github/workflows/detals-check-generate-matrix.sh index 66f2bd0724..14cbb6ee73 100755 --- a/.github/workflows/detals-check-generate-matrix.sh +++ b/.github/workflows/detals-check-generate-matrix.sh @@ -18,7 +18,7 @@ while read -r line; do echo -n "\"shortname\":" >> "shortnamearray.json" echo -n "\"${shortname}\"" >> "shortnamearray.json" echo -n "}," >> "shortnamearray.json" -done < serverlist.csv +done < <(tail -n +2 serverlist.csv) sed -i '$ s/.$//' "shortnamearray.json" echo -n "]" >> "shortnamearray.json" echo -n "}" >> "shortnamearray.json" diff --git a/.github/workflows/serverlist-validate.sh b/.github/workflows/serverlist-validate.sh index b43e803e0d..50b2da7127 100755 --- a/.github/workflows/serverlist-validate.sh +++ b/.github/workflows/serverlist-validate.sh @@ -3,7 +3,7 @@ echo "Checking that all the game servers are listed in all csv files" echo "this check will ensure serverlist.csv has the same number of lines (-2 lines) as the other csv files" # count the number of lines in the serverlist.csv cd "lgsm/data" || exit -serverlistcount="$(wc -l < serverlist.csv)" +serverlistcount="$(tail -n +2 serverlist.csv | wc -l)" echo "serverlistcount: $serverlistcount" # get list of all csv files starting with ubunutu debian centos csvlist="$(ls -1 | grep -E '^(ubuntu|debian|centos|rhel|almalinux|rocky).*\.csv$')" diff --git a/lgsm/data/serverlist.csv b/lgsm/data/serverlist.csv index 8b2b5c705d..7888c7983e 100644 --- a/lgsm/data/serverlist.csv +++ b/lgsm/data/serverlist.csv @@ -1,3 +1,4 @@ +shortname,gameservername,gamename,os ac,acserver,Assetto Corsa,ubuntu-22.04 ahl,ahlserver,Action Half-Life,ubuntu-22.04 ahl2,ahl2server,Action: Source,ubuntu-22.04 diff --git a/linuxgsm.sh b/linuxgsm.sh index d8a28d604f..b5786e70d2 100755 --- a/linuxgsm.sh +++ b/linuxgsm.sh @@ -347,11 +347,11 @@ if [ "${shortname}" == "core" ]; then if [ "${userinput}" == "list" ] || [ "${userinput}" == "l" ]; then { - tail -n +1 "${serverlist}" | awk -F "," '{print $2 "\t" $3}' + tail -n +2 "${serverlist}" | awk -F "," '{print $2 "\t" $3}' } | 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 +2 "${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 604ff78942bff7c99c9bda28f92cafc37ead1dbc Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Wed, 14 Jun 2023 21:49:41 +0100 Subject: [PATCH 089/181] feat: Update details-check.yml to use main branch for Game-Server-Configs The code changes update the details-check.yml file to use the main branch instead of the rename branch for Game-Server-Configs. This ensures that the correct config file is downloaded for game servers. --- .github/workflows/details-check.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/details-check.yml b/.github/workflows/details-check.yml index 7b04f20368..eaaea86e94 100644 --- a/.github/workflows/details-check.yml +++ b/.github/workflows/details-check.yml @@ -54,7 +54,7 @@ jobs: if [ -z "${{ steps.sets-servercfgname.outputs.servercfgname }}" ]; then echo "This game server has no config file." else - curl -f -o config "https://raw.githubusercontent.com/GameServerManagers/Game-Server-Configs/rename/${{ matrix.shortname }}/${{ steps.sets-servercfgname.outputs.servercfgname }}" + curl -f -o config "https://raw.githubusercontent.com/GameServerManagers/Game-Server-Configs/main/${{ matrix.shortname }}/${{ steps.sets-servercfgname.outputs.servercfgname }}" fi - name: Display config run: | From e95d77f38af08dfe980428f264ae1a079433d7e3 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Wed, 14 Jun 2023 23:54:31 +0100 Subject: [PATCH 090/181] chore: update GitHub workflow names and add more descriptive names This commit updates the name of several GitHub workflows to use proper capitalization and adds more descriptive names. The changes include: - Add to project workflow: updated name from "Add game server requests to project" to "Add to Project" - Details check workflow: updated name from "Details Check" to "Check LinuxGSM game server config and parameter variables" - Git sync workflow: updated name from "Github to Bitbucket sync" to "Sync GitHub repo with backup Bitbucket repo" - Issue labeler workflow: updated name from "Issue Labeler" to "Automatically label issues based on configuration file" - Lock threads workflow: updated name from "Lock Threads" to "Automatically lock inactive threads after one week" - Potential duplicates workflow: updated name from "Potential Duplicates" to "Detect potential duplicate issues and apply a label" - Server list validation workflow: updated name from "Server list Validation" to Validate LinuxGSM serverlist.json format - Trigger docker build workflow: added more descriptive names for each job - Update copyright years in license file workflow: removed unnecessary dashes at the beginning, added a more concise description - Version check workflow: added a more concise description --- .github/workflows/add-to-project.yml | 6 ++--- .github/workflows/details-check.yml | 9 ++++--- .github/workflows/git-sync.yml | 9 ++++--- .github/workflows/label-sponsors.yml | 14 ---------- .github/workflows/labeler.yml | 26 ++++++++++++------- .github/workflows/lock.yml | 14 +++++----- .github/workflows/potential-duplicates.yml | 19 ++++---------- .github/workflows/serverlist-validate.yml | 7 ++--- .github/workflows/trigger-docker-build.yml | 9 ++++--- ...update-copyright-years-in-license-file.yml | 8 +++--- .github/workflows/version-check.yml | 9 ++++--- 11 files changed, 58 insertions(+), 72 deletions(-) delete mode 100644 .github/workflows/label-sponsors.yml diff --git a/.github/workflows/add-to-project.yml b/.github/workflows/add-to-project.yml index 1a20ef1900..e429645bfe 100644 --- a/.github/workflows/add-to-project.yml +++ b/.github/workflows/add-to-project.yml @@ -1,4 +1,4 @@ -name: Add to project +name: Add to Project on: issues: types: @@ -7,10 +7,10 @@ on: jobs: add-to-project: - name: Add game server requests to project runs-on: ubuntu-latest steps: - - uses: actions/add-to-project@v0.5.0 + - name: Add to Project + uses: actions/add-to-project@v0.5.0 with: project-url: https://github.com/orgs/GameServerManagers/projects/11 github-token: ${{ secrets.ADD_TO_PROJECT_PAT }} diff --git a/.github/workflows/details-check.yml b/.github/workflows/details-check.yml index eaaea86e94..609b90a52a 100644 --- a/.github/workflows/details-check.yml +++ b/.github/workflows/details-check.yml @@ -1,5 +1,5 @@ -name: Details Check # This action will check that LinuxGSM is picking up game server config and parameter variables. +name: Details Check on: workflow_dispatch: push: @@ -16,7 +16,8 @@ jobs: - name: Generate matrix with generate-matrix.sh run: chmod +x .github/workflows/detals-check-generate-matrix.sh; .github/workflows/detals-check-generate-matrix.sh - - id: set-matrix + - name: Set Matrix + id: set-matrix run: | shortnamearray=$(cat shortnamearray.json) echo "${shortnamearray}" @@ -43,8 +44,8 @@ jobs: - name: Enable developer mode run: LGSM_GITHUBBRANCH="${GITHUB_REF#refs/heads/}" ./${{ matrix.shortname }}server developer - - id: sets-servercfgname - name: Generate servercfgname + - name: Generate servercfgname + id: sets-servercfgname run: | servercfg=$(sed -n "/^\/ { s/.*= *\"\?\([^\"']*\)\"\?/\1/p;q }" lgsm/config-lgsm/${{ matrix.shortname }}server/_default.cfg) echo "servercfgname=$servercfg" >> "$GITHUB_OUTPUT" diff --git a/.github/workflows/git-sync.yml b/.github/workflows/git-sync.yml index e013ae32dd..42ddd42e56 100644 --- a/.github/workflows/git-sync.yml +++ b/.github/workflows/git-sync.yml @@ -1,4 +1,4 @@ -name: Github to Bitbucket sync +name: Github to Bitbucket Sync # This action will sync the github repo with a backup bitbucket repo. # This will allow LinuxGSM to use Bitbucket as and alternative download if github fails. on: @@ -6,16 +6,17 @@ on: branches: - master - develop + jobs: - GitHub-to-Bitbucket: + gitHub-to-bitbucket: runs-on: ubuntu-latest steps: - - name: webfactory/ssh-agent@v0.8.0 + - name: SSH Agent uses: webfactory/ssh-agent@v0.8.0 with: ssh-private-key: ${{ secrets.BITBUCKET_SECRET }} - - name: wei/git-sync@v3.0.0 + - name: Git Sync uses: wei/git-sync@v3.0.0 with: ssh_private_key: ${{ secrets.BITBUCKET_SECRET }} diff --git a/.github/workflows/label-sponsors.yml b/.github/workflows/label-sponsors.yml deleted file mode 100644 index c16f66ff63..0000000000 --- a/.github/workflows/label-sponsors.yml +++ /dev/null @@ -1,14 +0,0 @@ -name: Label sponsors -on: - pull_request: - types: [opened] - issues: - types: [opened] -jobs: - build: - name: is-sponsor-label - runs-on: ubuntu-latest - steps: - - uses: JasonEtco/is-sponsor-label-action@v2 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/labeler.yml b/.github/workflows/labeler.yml index ebf260f6f9..f046308316 100644 --- a/.github/workflows/labeler.yml +++ b/.github/workflows/labeler.yml @@ -1,24 +1,30 @@ -name: "Issue Labeler" +name: Issue Labeler on: issues: - types: [opened, edited] - pull_request: - types: [opened, edited] + types: + - opened + - edited permissions: + issues: write 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 + issue-labeler: runs-on: ubuntu-latest steps: - - uses: github/issue-labeler@v3.1 + - name: Issue Labeler + uses: github/issue-labeler@v3.1 with: repo-token: "${{ secrets.GITHUB_TOKEN }}" configuration-path: .github/labeler.yml - not-before: enable-versioned-regex: 0 include-title: 1 + + is-sponsor-label: + runs-on: ubuntu-latest + steps: + - name: Is Sponsor Label + uses: JasonEtco/is-sponsor-label-action@v2 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/lock.yml b/.github/workflows/lock.yml index 774f84364a..4883914f8f 100644 --- a/.github/workflows/lock.yml +++ b/.github/workflows/lock.yml @@ -1,20 +1,18 @@ -name: "Lock Threads" - +name: Lock Threads on: schedule: - - cron: "0 0 * * *" + - cron: "0 0 * * 1" permissions: - contents: read + issues: write + pull-requests: write 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@v4 + - name: Lock Threads + uses: dessant/lock-threads@v4 with: github-token: ${{ secrets.GITHUB_TOKEN }} issue-comment: > diff --git a/.github/workflows/potential-duplicates.yml b/.github/workflows/potential-duplicates.yml index f1e7836742..3c7f4334c4 100644 --- a/.github/workflows/potential-duplicates.yml +++ b/.github/workflows/potential-duplicates.yml @@ -1,30 +1,21 @@ name: Potential Duplicates on: issues: - types: [opened] + types: + - opened jobs: - run: + potential-duplicates: runs-on: ubuntu-latest steps: - - uses: wow-actions/potential-duplicates@v1 + - name: Potential Duplicates + uses: wow-actions/potential-duplicates@v1 with: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - # 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: "" - # Exclude keywords in title before detecting. exclude: "" - # Label to set, when potential duplicates are detected. label: potential-duplicate - # 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.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' - # Comment to post when potential duplicates are detected. comment: > Potential duplicates: {{#issues}} - [#{{ number }}] {{ title }} ({{ accuracy }}%) diff --git a/.github/workflows/serverlist-validate.yml b/.github/workflows/serverlist-validate.yml index e12c0e95ce..39f37e1df1 100644 --- a/.github/workflows/serverlist-validate.yml +++ b/.github/workflows/serverlist-validate.yml @@ -1,4 +1,4 @@ -name: Server list Validation +name: Server List Validation on: workflow_dispatch: push: @@ -7,7 +7,8 @@ jobs: serverlist-validate: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - name: Checkout + uses: actions/checkout@v3 - - name: compare versions + - name: Compare Versions run: chmod +x .github/workflows/serverlist-validate.sh; .github/workflows/serverlist-validate.sh diff --git a/.github/workflows/trigger-docker-build.yml b/.github/workflows/trigger-docker-build.yml index dec3dd462b..76d4275a64 100644 --- a/.github/workflows/trigger-docker-build.yml +++ b/.github/workflows/trigger-docker-build.yml @@ -3,12 +3,13 @@ on: release: types: - published + jobs: trigger_build_docker-linuxgsm: - name: Trigger Build docker-linuxgsm runs-on: ubuntu-latest steps: - - uses: convictional/trigger-workflow-and-wait@v1.6.5 + - name: Trigger Workflow and Wait (linuxgsm) + uses: convictional/trigger-workflow-and-wait@v1.6.5 with: owner: GameServerManagers repo: docker-linuxgsm @@ -16,10 +17,10 @@ jobs: 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.6.5 + - name: Trigger Workflow and Wait (gameserver) + uses: convictional/trigger-workflow-and-wait@v1.6.5 with: owner: GameServerManagers repo: docker-gameserver diff --git a/.github/workflows/update-copyright-years-in-license-file.yml b/.github/workflows/update-copyright-years-in-license-file.yml index 162a279442..d90ba4a5de 100644 --- a/.github/workflows/update-copyright-years-in-license-file.yml +++ b/.github/workflows/update-copyright-years-in-license-file.yml @@ -1,6 +1,4 @@ ---- name: Update copyright year(s) in license file - on: workflow_dispatch: schedule: @@ -10,10 +8,12 @@ jobs: update-license-year: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - name: Checkout + uses: actions/checkout@v3 with: fetch-depth: 0 - - uses: FantasticFiasco/action-update-license-year@v3 + - name: Action Update License Year + uses: FantasticFiasco/action-update-license-year@v3 with: token: ${{ secrets.GITHUB_TOKEN }} path: LICENSE.md diff --git a/.github/workflows/version-check.yml b/.github/workflows/version-check.yml index a12b344209..cb51d4b2f0 100644 --- a/.github/workflows/version-check.yml +++ b/.github/workflows/version-check.yml @@ -1,6 +1,6 @@ name: Version Check - -on: push +on: + push: permissions: contents: read @@ -9,7 +9,8 @@ jobs: version-Check: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - name: Checkout + uses: actions/checkout@v3 - - name: compare versions + - name: Version Check run: chmod +x .github/workflows/version-check.sh; .github/workflows/version-check.sh From 105350fbe320ecf2155e1500a0df2daded1f6711 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Wed, 14 Jun 2023 23:55:41 +0100 Subject: [PATCH 091/181] feat: Add temporary fix for Satisfactory upgrade (#4243) This commit adds a temporary fix for upgrading Satisfactory from Update 7 to Update 8. A symlink is created between UnrealServer-Linux-Shipping and UE4Server-Linux-Shipping until the update is released. --- lgsm/modules/check_executable.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lgsm/modules/check_executable.sh b/lgsm/modules/check_executable.sh index 40721fbf4b..6c8feab2a0 100644 --- a/lgsm/modules/check_executable.sh +++ b/lgsm/modules/check_executable.sh @@ -7,6 +7,13 @@ moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +# #4241 temporary fix for Satisfactory for upgrade betweern Update 7 & Update 8 - remove this once update 8 is released +if [ "${shortname}" == "sf" ]; then + if [ ! -f "${serverfiles}/Engine/Binaries/Linux/UE4Server-Linux-Shipping" ]; then + ln -s "${serverfiles}/Engine/Binaries/Linux/UnrealServer-Linux-Shipping" "${serverfiles}/Engine/Binaries/Linux/UE4Server-Linux-Shipping" + fi +fi + # Check if executable exists execname=$(basename "${executable}") if [ ! -f "${executabledir}/${execname}" ]; then From 5915545f93cf3319141632d6cf03ec657928dae7 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Wed, 14 Jun 2023 23:56:55 +0100 Subject: [PATCH 092/181] feat: improve server configuration parsing (#4242) This commit improves the way server configurations are parsed by using xmllint to extract values from XML files. The eval function is also used to assign the extracted value to a variable. --- lgsm/modules/info_game.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lgsm/modules/info_game.sh b/lgsm/modules/info_game.sh index d2714ec3ef..f0dd73d18c 100644 --- a/lgsm/modules/info_game.sh +++ b/lgsm/modules/info_game.sh @@ -131,7 +131,7 @@ fn_info_game_xml() { else servercfgparse="${servercfgfullpath}" fi - eval "${1}"="$(xmllint --xpath "string(${2})" "${servercfgparse}")" + eval "${1}=\"$(xmllint --xpath "string(${2})" "${servercfgparse}")\"" configtype="xml" } From 28adc88f130d3e1373d6ca304148cfced19cf27d Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Thu, 15 Jun 2023 21:56:40 +0100 Subject: [PATCH 093/181] Release v23.3.4 --- lgsm/modules/core_functions.sh | 2 +- lgsm/modules/core_modules.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, 7 insertions(+), 7 deletions(-) diff --git a/lgsm/modules/core_functions.sh b/lgsm/modules/core_functions.sh index 446db1f86e..44e1623040 100644 --- a/lgsm/modules/core_functions.sh +++ b/lgsm/modules/core_functions.sh @@ -8,7 +8,7 @@ module_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" -modulesversion="v23.3.3" +modulesversion="v23.3.4" # Core diff --git a/lgsm/modules/core_modules.sh b/lgsm/modules/core_modules.sh index 35a919422b..afa9cad83b 100644 --- a/lgsm/modules/core_modules.sh +++ b/lgsm/modules/core_modules.sh @@ -8,7 +8,7 @@ moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" -modulesversion="v23.3.3" +modulesversion="v23.3.4" # Core diff --git a/linuxgsm.sh b/linuxgsm.sh index d8a28d604f..b8739f00df 100755 --- a/linuxgsm.sh +++ b/linuxgsm.sh @@ -20,7 +20,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="v23.3.3" +version="v23.3.4" shortname="core" gameservername="core" commandname="CORE" diff --git a/tests/tests_fctrserver.sh b/tests/tests_fctrserver.sh index 3c97fffaf3..e0af4f4150 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.3.3" +version="v23.3.4" shortname="fctr" gameservername="fctrserver" commandname="CORE" diff --git a/tests/tests_jc2server.sh b/tests/tests_jc2server.sh index 9604ddb062..45ebdcc699 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.3.3" +version="v23.3.4" shortname="jc2" gameservername="jc2server" commandname="CORE" diff --git a/tests/tests_mcserver.sh b/tests/tests_mcserver.sh index ff2a01b129..6388bda633 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.3.3" +version="v23.3.4" shortname="mc" gameservername="mcserver" commandname="CORE" diff --git a/tests/tests_ts3server.sh b/tests/tests_ts3server.sh index bf0bf9fb76..3483239635 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.3.3" +version="v23.3.4" shortname="ts3" gameservername="ts3server" commandname="CORE" From d9d6b6ebd3de669ce8431924ba53af0e19663e97 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Mon, 19 Jun 2023 17:52:15 +0100 Subject: [PATCH 094/181] fix(bt): add missing libxml2-utils The commit adds the libxml2-utils package to several CSV files. This change is necessary for the proper functioning of some scripts that depend on this package. --- 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-12.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/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/data/ubuntu-23.04.csv | 2 +- 21 files changed, 21 insertions(+), 21 deletions(-) diff --git a/lgsm/data/almalinux-8.csv b/lgsm/data/almalinux-8.csv index 1f8abc8e13..f5d55c6a1d 100644 --- a/lgsm/data/almalinux-8.csv +++ b/lgsm/data/almalinux-8.csv @@ -16,7 +16,7 @@ bfv,compat-libstdc++-33.i686,glibc.i686 bmdm,ncurses-libs.i686 bo bs -bt,libicu,dos2unix +bt,libicu,dos2unix,libxml2 btl cc cd diff --git a/lgsm/data/almalinux-9.csv b/lgsm/data/almalinux-9.csv index fb760c4f0e..45f3b666dc 100644 --- a/lgsm/data/almalinux-9.csv +++ b/lgsm/data/almalinux-9.csv @@ -16,7 +16,7 @@ bfv,compat-libstdc++-33.i686,glibc.i686 bmdm,ncurses-libs.i686 bo bs -bt,libicu,dos2unix +bt,libicu,dos2unix,libxml2 btl cc cd diff --git a/lgsm/data/centos-7.csv b/lgsm/data/centos-7.csv index 7db6b259c2..0bc480d60d 100644 --- a/lgsm/data/centos-7.csv +++ b/lgsm/data/centos-7.csv @@ -16,7 +16,7 @@ bfv,compat-libstdc++-33.i686,glibc.i686 bmdm,ncurses-libs.i686 bo bs -bt,libicu,dos2unix +bt,libicu,dos2unix,libxml2 btl cc cd diff --git a/lgsm/data/centos-8.csv b/lgsm/data/centos-8.csv index 1f8abc8e13..f5d55c6a1d 100644 --- a/lgsm/data/centos-8.csv +++ b/lgsm/data/centos-8.csv @@ -16,7 +16,7 @@ bfv,compat-libstdc++-33.i686,glibc.i686 bmdm,ncurses-libs.i686 bo bs -bt,libicu,dos2unix +bt,libicu,dos2unix,libxml2 btl cc cd diff --git a/lgsm/data/centos-9.csv b/lgsm/data/centos-9.csv index fb760c4f0e..45f3b666dc 100644 --- a/lgsm/data/centos-9.csv +++ b/lgsm/data/centos-9.csv @@ -16,7 +16,7 @@ bfv,compat-libstdc++-33.i686,glibc.i686 bmdm,ncurses-libs.i686 bo bs -bt,libicu,dos2unix +bt,libicu,dos2unix,libxml2 btl cc cd diff --git a/lgsm/data/debian-10.csv b/lgsm/data/debian-10.csv index 7425cf3612..d403e1b9a8 100644 --- a/lgsm/data/debian-10.csv +++ b/lgsm/data/debian-10.csv @@ -16,7 +16,7 @@ bfv,libncurses5:i386,libstdc++5:i386 bmdm,libncurses5:i386 bo bs -bt,libicu-dev,dos2unix +bt,libicu-dev,dos2unix,libxml2-utils btl cc cd diff --git a/lgsm/data/debian-11.csv b/lgsm/data/debian-11.csv index 5aa309c300..cc4333dd41 100644 --- a/lgsm/data/debian-11.csv +++ b/lgsm/data/debian-11.csv @@ -16,7 +16,7 @@ bfv,libncurses5:i386,libstdc++5:i386 bmdm,libncurses5:i386 bo bs -bt,libicu-dev,dos2unix +bt,libicu-dev,dos2unix,libxml2-utils btl cc cd diff --git a/lgsm/data/debian-12.csv b/lgsm/data/debian-12.csv index d34887dd62..402421e13e 100644 --- a/lgsm/data/debian-12.csv +++ b/lgsm/data/debian-12.csv @@ -16,7 +16,7 @@ bfv,libncurses5:i386,libstdc++5:i386 bmdm,libncurses5:i386 bo bs -bt,libicu-dev,dos2unix +bt,libicu-dev,dos2unix,libxml2-utils btl cc cd diff --git a/lgsm/data/debian-9.csv b/lgsm/data/debian-9.csv index 17c6d7d8b9..cc0cc910b6 100644 --- a/lgsm/data/debian-9.csv +++ b/lgsm/data/debian-9.csv @@ -16,7 +16,7 @@ bfv,libncurses5:i386,libstdc++5:i386 bmdm,libncurses5:i386 bo bs -bt,libicu-dev,dos2unix +bt,libicu-dev,dos2unix,libxml2-utils btl cc cd diff --git a/lgsm/data/rhel-7.csv b/lgsm/data/rhel-7.csv index 5d25cd304c..8c2382f60e 100644 --- a/lgsm/data/rhel-7.csv +++ b/lgsm/data/rhel-7.csv @@ -16,7 +16,7 @@ bfv,compat-libstdc++-33.i686,glibc.i686 bmdm,ncurses-libs.i686 bo bs -bt,libicu,dos2unix +bt,libicu,dos2unix,libxml2 btl cc cd diff --git a/lgsm/data/rhel-8.csv b/lgsm/data/rhel-8.csv index 1f8abc8e13..f5d55c6a1d 100644 --- a/lgsm/data/rhel-8.csv +++ b/lgsm/data/rhel-8.csv @@ -16,7 +16,7 @@ bfv,compat-libstdc++-33.i686,glibc.i686 bmdm,ncurses-libs.i686 bo bs -bt,libicu,dos2unix +bt,libicu,dos2unix,libxml2 btl cc cd diff --git a/lgsm/data/rhel-9.csv b/lgsm/data/rhel-9.csv index fb760c4f0e..45f3b666dc 100644 --- a/lgsm/data/rhel-9.csv +++ b/lgsm/data/rhel-9.csv @@ -16,7 +16,7 @@ bfv,compat-libstdc++-33.i686,glibc.i686 bmdm,ncurses-libs.i686 bo bs -bt,libicu,dos2unix +bt,libicu,dos2unix,libxml2 btl cc cd diff --git a/lgsm/data/rocky-8.csv b/lgsm/data/rocky-8.csv index 1f8abc8e13..f5d55c6a1d 100644 --- a/lgsm/data/rocky-8.csv +++ b/lgsm/data/rocky-8.csv @@ -16,7 +16,7 @@ bfv,compat-libstdc++-33.i686,glibc.i686 bmdm,ncurses-libs.i686 bo bs -bt,libicu,dos2unix +bt,libicu,dos2unix,libxml2 btl cc cd diff --git a/lgsm/data/rocky-9.csv b/lgsm/data/rocky-9.csv index fb760c4f0e..45f3b666dc 100644 --- a/lgsm/data/rocky-9.csv +++ b/lgsm/data/rocky-9.csv @@ -16,7 +16,7 @@ bfv,compat-libstdc++-33.i686,glibc.i686 bmdm,ncurses-libs.i686 bo bs -bt,libicu,dos2unix +bt,libicu,dos2unix,libxml2 btl cc cd diff --git a/lgsm/data/ubuntu-16.04.csv b/lgsm/data/ubuntu-16.04.csv index 7b883615ce..85fe0c9f2b 100644 --- a/lgsm/data/ubuntu-16.04.csv +++ b/lgsm/data/ubuntu-16.04.csv @@ -16,7 +16,7 @@ bfv,libncurses5:i386,libstdc++5:i386 bmdm,libncurses5:i386 bo bs -bt,libicu-dev,dos2unix +bt,libicu-dev,dos2unix,libxml2-utils btl cc cd diff --git a/lgsm/data/ubuntu-18.04.csv b/lgsm/data/ubuntu-18.04.csv index 7425cf3612..d403e1b9a8 100644 --- a/lgsm/data/ubuntu-18.04.csv +++ b/lgsm/data/ubuntu-18.04.csv @@ -16,7 +16,7 @@ bfv,libncurses5:i386,libstdc++5:i386 bmdm,libncurses5:i386 bo bs -bt,libicu-dev,dos2unix +bt,libicu-dev,dos2unix,libxml2-utils btl cc cd diff --git a/lgsm/data/ubuntu-20.04.csv b/lgsm/data/ubuntu-20.04.csv index 93b29f108d..9ee9e2df69 100644 --- a/lgsm/data/ubuntu-20.04.csv +++ b/lgsm/data/ubuntu-20.04.csv @@ -16,7 +16,7 @@ bfv,libncurses5:i386,libstdc++5:i386 bmdm,libncurses5:i386 bo bs -bt,libicu-dev,dos2unix +bt,libicu-dev,dos2unix,libxml2-utils btl cc cd diff --git a/lgsm/data/ubuntu-21.04.csv b/lgsm/data/ubuntu-21.04.csv index 5aa309c300..cc4333dd41 100644 --- a/lgsm/data/ubuntu-21.04.csv +++ b/lgsm/data/ubuntu-21.04.csv @@ -16,7 +16,7 @@ bfv,libncurses5:i386,libstdc++5:i386 bmdm,libncurses5:i386 bo bs -bt,libicu-dev,dos2unix +bt,libicu-dev,dos2unix,libxml2-utils btl cc cd diff --git a/lgsm/data/ubuntu-21.10.csv b/lgsm/data/ubuntu-21.10.csv index 5aa309c300..cc4333dd41 100644 --- a/lgsm/data/ubuntu-21.10.csv +++ b/lgsm/data/ubuntu-21.10.csv @@ -16,7 +16,7 @@ bfv,libncurses5:i386,libstdc++5:i386 bmdm,libncurses5:i386 bo bs -bt,libicu-dev,dos2unix +bt,libicu-dev,dos2unix,libxml2-utils btl cc cd diff --git a/lgsm/data/ubuntu-22.04.csv b/lgsm/data/ubuntu-22.04.csv index 1f1cd1c4b6..5aa3fe941f 100644 --- a/lgsm/data/ubuntu-22.04.csv +++ b/lgsm/data/ubuntu-22.04.csv @@ -16,7 +16,7 @@ bfv,libncurses5:i386,libstdc++5:i386 bmdm,libncurses5:i386 bo bs -bt,libicu-dev,dos2unix +bt,libicu-dev,dos2unix,libxml2-utils btl cc cd diff --git a/lgsm/data/ubuntu-23.04.csv b/lgsm/data/ubuntu-23.04.csv index 1f1cd1c4b6..5aa3fe941f 100644 --- a/lgsm/data/ubuntu-23.04.csv +++ b/lgsm/data/ubuntu-23.04.csv @@ -16,7 +16,7 @@ bfv,libncurses5:i386,libstdc++5:i386 bmdm,libncurses5:i386 bo bs -bt,libicu-dev,dos2unix +bt,libicu-dev,dos2unix,libxml2-utils btl cc cd From 7d958ea222345419ad9eba2e492067bead3e4db3 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Fri, 30 Jun 2023 00:52:27 +0100 Subject: [PATCH 095/181] fix(st): update st settings to get it working again --- .../config-lgsm/stserver/_default.cfg | 16 +++------- 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-12.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/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/data/ubuntu-23.04.csv | 2 +- lgsm/modules/info_game.sh | 31 +++++++++---------- lgsm/modules/info_messages.sh | 13 ++------ lgsm/modules/install_config.sh | 9 +----- 25 files changed, 45 insertions(+), 66 deletions(-) diff --git a/lgsm/config-default/config-lgsm/stserver/_default.cfg b/lgsm/config-default/config-lgsm/stserver/_default.cfg index b304fa3900..c06d22a8db 100644 --- a/lgsm/config-default/config-lgsm/stserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/stserver/_default.cfg @@ -9,18 +9,12 @@ #### Game Server Settings #### ## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters -ip="0.0.0.0" -maxplayers="10" -port="27500" -queryport="27015" -saveinterval="300" -servername="LinuxGSM" worldname="moon_save" worldtype="Moon" ## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters # Edit with care -startparameters="-LOADLATEST ${worldname} ${worldtype} -settings ServerName ${servername} StartLocalHost true ServerVisible true ServerMaxPlayers ${maxplayers} GamePort ${port} UpdatePort ${queryport} UPNPEnabled true AutoSave true SaveInterval ${saveinterval}" +startparameters="-LOADLATEST ${worldname} ${worldtype}" #### LinuxGSM Settings #### @@ -148,18 +142,18 @@ stopmode="3" # 3: gamedig # 4: gsquery # 5: tcp -querymode="2" -querytype="protocol-valve" +querymode="1" +querytype="" ## Console type consoleverbose="yes" -consoleinteract="vo" +consoleinteract="yes" ## Game Server Details # Do not edit gamename="Stationeers" engine="unity3d" -glibc="2.15" +glibc="2.34" #### Directories #### # Edit with care diff --git a/lgsm/data/almalinux-8.csv b/lgsm/data/almalinux-8.csv index f5d55c6a1d..ee8301e536 100644 --- a/lgsm/data/almalinux-8.csv +++ b/lgsm/data/almalinux-8.csv @@ -107,7 +107,7 @@ sfc,ncurses-libs.i686 sof2 sol squad -st +st,libxml2 stn sven terraria diff --git a/lgsm/data/almalinux-9.csv b/lgsm/data/almalinux-9.csv index 45f3b666dc..c7d86c6e34 100644 --- a/lgsm/data/almalinux-9.csv +++ b/lgsm/data/almalinux-9.csv @@ -107,7 +107,7 @@ sfc,ncurses-libs.i686 sof2 sol squad -st +st,libxml2 stn sven terraria diff --git a/lgsm/data/centos-7.csv b/lgsm/data/centos-7.csv index 0bc480d60d..2bd1ea57a2 100644 --- a/lgsm/data/centos-7.csv +++ b/lgsm/data/centos-7.csv @@ -107,7 +107,7 @@ sfc,ncurses-libs.i686 sof2 sol squad -st +st,libxml2 stn sven terraria diff --git a/lgsm/data/centos-8.csv b/lgsm/data/centos-8.csv index f5d55c6a1d..ee8301e536 100644 --- a/lgsm/data/centos-8.csv +++ b/lgsm/data/centos-8.csv @@ -107,7 +107,7 @@ sfc,ncurses-libs.i686 sof2 sol squad -st +st,libxml2 stn sven terraria diff --git a/lgsm/data/centos-9.csv b/lgsm/data/centos-9.csv index 45f3b666dc..c7d86c6e34 100644 --- a/lgsm/data/centos-9.csv +++ b/lgsm/data/centos-9.csv @@ -107,7 +107,7 @@ sfc,ncurses-libs.i686 sof2 sol squad -st +st,libxml2 stn sven terraria diff --git a/lgsm/data/debian-10.csv b/lgsm/data/debian-10.csv index d403e1b9a8..646df8b2b8 100644 --- a/lgsm/data/debian-10.csv +++ b/lgsm/data/debian-10.csv @@ -107,7 +107,7 @@ sfc,libtinfo5:i386 sof2 sol squad -st +st,libxml2-utils stn sven,libssl1.1:i386,zlib1g:i386 terraria diff --git a/lgsm/data/debian-11.csv b/lgsm/data/debian-11.csv index cc4333dd41..8f31ec9c4f 100644 --- a/lgsm/data/debian-11.csv +++ b/lgsm/data/debian-11.csv @@ -107,7 +107,7 @@ sfc,libtinfo5:i386 sof2 sol squad -st +st,libxml2-utils stn sven,libssl1.1:i386,zlib1g:i386 terraria diff --git a/lgsm/data/debian-12.csv b/lgsm/data/debian-12.csv index 402421e13e..51b565a006 100644 --- a/lgsm/data/debian-12.csv +++ b/lgsm/data/debian-12.csv @@ -107,7 +107,7 @@ sfc,libtinfo5:i386 sof2 sol squad -st +st,libxml2-utils stn sven,libssl3:i386,zlib1g:i386 terraria diff --git a/lgsm/data/debian-9.csv b/lgsm/data/debian-9.csv index cc0cc910b6..8ff958dddb 100644 --- a/lgsm/data/debian-9.csv +++ b/lgsm/data/debian-9.csv @@ -107,7 +107,7 @@ sfc,libtinfo5:i386 sof2 sol squad -st +st,libxml2-utils stn sven,libssl1.1:i386,zlib1g:i386 terraria diff --git a/lgsm/data/rhel-7.csv b/lgsm/data/rhel-7.csv index 8c2382f60e..196651a2fe 100644 --- a/lgsm/data/rhel-7.csv +++ b/lgsm/data/rhel-7.csv @@ -107,7 +107,7 @@ sfc,ncurses-libs.i686 sof2 sol squad -st +st,libxml2 stn sven terraria diff --git a/lgsm/data/rhel-8.csv b/lgsm/data/rhel-8.csv index f5d55c6a1d..ee8301e536 100644 --- a/lgsm/data/rhel-8.csv +++ b/lgsm/data/rhel-8.csv @@ -107,7 +107,7 @@ sfc,ncurses-libs.i686 sof2 sol squad -st +st,libxml2 stn sven terraria diff --git a/lgsm/data/rhel-9.csv b/lgsm/data/rhel-9.csv index 45f3b666dc..c7d86c6e34 100644 --- a/lgsm/data/rhel-9.csv +++ b/lgsm/data/rhel-9.csv @@ -107,7 +107,7 @@ sfc,ncurses-libs.i686 sof2 sol squad -st +st,libxml2 stn sven terraria diff --git a/lgsm/data/rocky-8.csv b/lgsm/data/rocky-8.csv index f5d55c6a1d..ee8301e536 100644 --- a/lgsm/data/rocky-8.csv +++ b/lgsm/data/rocky-8.csv @@ -107,7 +107,7 @@ sfc,ncurses-libs.i686 sof2 sol squad -st +st,libxml2 stn sven terraria diff --git a/lgsm/data/rocky-9.csv b/lgsm/data/rocky-9.csv index 45f3b666dc..c7d86c6e34 100644 --- a/lgsm/data/rocky-9.csv +++ b/lgsm/data/rocky-9.csv @@ -107,7 +107,7 @@ sfc,ncurses-libs.i686 sof2 sol squad -st +st,libxml2 stn sven terraria diff --git a/lgsm/data/ubuntu-16.04.csv b/lgsm/data/ubuntu-16.04.csv index 85fe0c9f2b..3e860cd1f7 100644 --- a/lgsm/data/ubuntu-16.04.csv +++ b/lgsm/data/ubuntu-16.04.csv @@ -107,7 +107,7 @@ sfc,libtinfo5:i386 sof2 sol squad -st +st,libxml2-utils stn sven,libssl1.1:i386,zlib1g:i386 terraria diff --git a/lgsm/data/ubuntu-18.04.csv b/lgsm/data/ubuntu-18.04.csv index d403e1b9a8..646df8b2b8 100644 --- a/lgsm/data/ubuntu-18.04.csv +++ b/lgsm/data/ubuntu-18.04.csv @@ -107,7 +107,7 @@ sfc,libtinfo5:i386 sof2 sol squad -st +st,libxml2-utils stn sven,libssl1.1:i386,zlib1g:i386 terraria diff --git a/lgsm/data/ubuntu-20.04.csv b/lgsm/data/ubuntu-20.04.csv index 9ee9e2df69..bb026e94af 100644 --- a/lgsm/data/ubuntu-20.04.csv +++ b/lgsm/data/ubuntu-20.04.csv @@ -107,7 +107,7 @@ sfc,libtinfo5:i386 sof2 sol squad -st +st,libxml2-utils stn sven,libssl1.1:i386,zlib1g:i386 terraria diff --git a/lgsm/data/ubuntu-21.04.csv b/lgsm/data/ubuntu-21.04.csv index cc4333dd41..8f31ec9c4f 100644 --- a/lgsm/data/ubuntu-21.04.csv +++ b/lgsm/data/ubuntu-21.04.csv @@ -107,7 +107,7 @@ sfc,libtinfo5:i386 sof2 sol squad -st +st,libxml2-utils stn sven,libssl1.1:i386,zlib1g:i386 terraria diff --git a/lgsm/data/ubuntu-21.10.csv b/lgsm/data/ubuntu-21.10.csv index cc4333dd41..8f31ec9c4f 100644 --- a/lgsm/data/ubuntu-21.10.csv +++ b/lgsm/data/ubuntu-21.10.csv @@ -107,7 +107,7 @@ sfc,libtinfo5:i386 sof2 sol squad -st +st,libxml2-utils stn sven,libssl1.1:i386,zlib1g:i386 terraria diff --git a/lgsm/data/ubuntu-22.04.csv b/lgsm/data/ubuntu-22.04.csv index 5aa3fe941f..ba801e5077 100644 --- a/lgsm/data/ubuntu-22.04.csv +++ b/lgsm/data/ubuntu-22.04.csv @@ -107,7 +107,7 @@ sfc,libtinfo5:i386 sof2 sol squad -st +st,libxml2-utils stn sven,libssl1.1:i386,zlib1g:i386 terraria diff --git a/lgsm/data/ubuntu-23.04.csv b/lgsm/data/ubuntu-23.04.csv index 5aa3fe941f..ba801e5077 100644 --- a/lgsm/data/ubuntu-23.04.csv +++ b/lgsm/data/ubuntu-23.04.csv @@ -107,7 +107,7 @@ sfc,libtinfo5:i386 sof2 sol squad -st +st,libxml2-utils stn sven,libssl1.1:i386,zlib1g:i386 terraria diff --git a/lgsm/modules/info_game.sh b/lgsm/modules/info_game.sh index f0dd73d18c..6374b14e33 100644 --- a/lgsm/modules/info_game.sh +++ b/lgsm/modules/info_game.sh @@ -613,30 +613,29 @@ fn_info_game_pz() { worldname="${worldname:-"NOT SET"}" } -# Config Type: ini -# Parameters: true -# Comment: ; or # -# Example: SERVERNAME=SERVERNAME -# Filetype: ini +# Config Type: xml +# Comment: +# Example: SERVERNAME +# Filetype: xml fn_info_game_st() { if [ -f "${servercfgfullpath}" ]; then - fn_info_game_ini "maxplayers" "MAXPLAYER" - fn_info_game_ini "rconpassword" "RCONPASSWORD" - fn_info_game_ini "servername" "SERVERNAME" - fn_info_game_ini "serverpassword" "PASSWORD" + fn_info_game_xml "adminpassword" "/SettingData/AdminPassword" + fn_info_game_xml "maxplayers" "/SettingData/ServerMaxPlayers" + fn_info_game_xml "port" "/SettingData/GamePort" + fn_info_game_xml "queryport" "/SettingData/UpdatePort" + fn_info_game_xml "saveinterval" "/SettingData/SaveInterval" + fn_info_game_xml "servername" "/SettingData/ServerName" + fn_info_game_xml "serverpassword" "/SettingData/ServerPassword" fi - clearinterval="${clearinterval:-"0"}" - httpport="${port:-"0"}" + adminpassword="${adminpassword:-"NOT SET"}" maxplayers="${maxplayers:-"0"}" port="${port:-"0"}" queryport="${queryport:-"0"}" - rconpassword="${rconpassword:-"NOT SET"}" saveinterval="${saveinterval:-"0"}" servername="${servername:-"NOT SET"}" serverpassword="${serverpassword:-"NOT SET"}" worldname="${worldname:-"NOT SET"}" worldtype="${worldtype:-"NOT SET"}" - } # Config Type: ini @@ -911,7 +910,7 @@ fn_info_game_bf1942() { # Comment: ; or # # Example: ServerName=SERVERNAME # Filetype: ini -fn_info_game_ct(){ +fn_info_game_ct() { if [ -f "${servercfgfullpath}" ]; then fn_info_game_ini "configip" "bindAddress" fn_info_game_ini "gamemode" "gameMode" @@ -1240,7 +1239,7 @@ fn_info_game_hw() { port="${port:-"0"}" queryport="${queryport:-"0"}" maxplayers="${maxplayers:-"0"}" - # #4189 option setting can be blank + # #4189 option setting can be blank # defaultmap="${defaultmap:-"NOT SET"}" creativemode="${creativemode:-"NOT SET"}" } @@ -1482,7 +1481,7 @@ fn_info_game_nec() { # Comment: ; or # # Example: ServerName=SERVERNAME # Filetype: ini -fn_info_game_ohd(){ +fn_info_game_ohd() { if [ -f "${servercfgfullpath}" ]; then fn_info_game_ini rconenabled "bEnabled" fn_info_game_ini rconport "ListenPort" diff --git a/lgsm/modules/info_messages.sh b/lgsm/modules/info_messages.sh index 520dfa58e8..8d356f9592 100644 --- a/lgsm/modules/info_messages.sh +++ b/lgsm/modules/info_messages.sh @@ -969,7 +969,7 @@ fn_info_message_csgo() { } | column -s $'\t' -t } -fn_info_message_ct(){ +fn_info_message_ct() { fn_info_message_password_strip { fn_port "header" @@ -977,7 +977,7 @@ fn_info_message_ct(){ } | column -s $'\t' -t } -fn_info_message_dayz(){ +fn_info_message_dayz() { { fn_port "header" fn_port "Game" port udp @@ -1037,7 +1037,7 @@ fn_info_message_goldsrc() { } | column -s $'\t' -t } -fn_info_message_hcu(){ +fn_info_message_hcu() { { fn_port "header" fn_port "Game" port udp @@ -1504,13 +1504,6 @@ fn_info_message_st() { fn_port "header" fn_port "Game" port udp fn_port "Query" queryport udp - fn_port "Web Interface" httpport tcp - } | column -s $'\t' -t - echo -e "" - echo -e "${lightgreen}${gamename} Web Interface${default}" - fn_messages_separator - { - echo -e "${lightblue}Web Interface url:\t${default}http://${httpip}:${httpport}" } | column -s $'\t' -t } diff --git a/lgsm/modules/install_config.sh b/lgsm/modules/install_config.sh index b0ff4a7858..b39ed298c7 100644 --- a/lgsm/modules/install_config.sh +++ b/lgsm/modules/install_config.sh @@ -383,7 +383,7 @@ elif [ "${shortname}" == "css" ]; then fn_list_config_locations elif [ "${shortname}" == "ct" ]; then gamedirname="Craftopia" - array_configs+=( ServerSetting.ini ) + array_configs+=(ServerSetting.ini) fn_fetch_default_config fn_default_config_remote fn_set_config_vars @@ -791,13 +791,6 @@ elif [ "${shortname}" == "sb" ]; then fn_default_config_remote fn_set_config_vars fn_list_config_locations -elif [ "${shortname}" == "st" ]; then - gamedirname="Stationeers" - 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) From f37f220a67af81fdb6eab5af8339124fc05c720f Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Fri, 30 Jun 2023 01:14:06 +0100 Subject: [PATCH 096/181] fix(etl): re add queryport --- lgsm/modules/info_game.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/lgsm/modules/info_game.sh b/lgsm/modules/info_game.sh index 6374b14e33..dfddd52df1 100644 --- a/lgsm/modules/info_game.sh +++ b/lgsm/modules/info_game.sh @@ -1193,6 +1193,7 @@ fn_info_game_etl() { configip="${configip:-"0.0.0.0"}" maxplayers="${maxplayers:-"0"}" port="${port:-"0"}" + queryport="${port}" rconpassword="${rconpassword:-"NOT SET"}" servername="${servername:-"NOT SET"}" serverpassword="${serverpassword:-"NOT SET"}" From 14c5a14945a2f640b69db21a8302c2cdf706362c Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Fri, 30 Jun 2023 01:15:37 +0100 Subject: [PATCH 097/181] fix(core_getopt): fix typo in command name The commit fixes a typo in the command name "cmd_sponso" to "cmd_sponsor" in the core_getopt.sh file. This change ensures that the correct command is used for donation options. --- lgsm/modules/core_getopt.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lgsm/modules/core_getopt.sh b/lgsm/modules/core_getopt.sh index c758409c58..b191b3ebcb 100644 --- a/lgsm/modules/core_getopt.sh +++ b/lgsm/modules/core_getopt.sh @@ -22,7 +22,7 @@ cmd_update_linuxgsm=("ul;update-lgsm;uf;update-modules" "command_update_linuxgsm 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_sponso=("s;sponsor" "command_sponsor.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.") From 7b115fe07a90048fc8117b44401a31ce7ec1b4bf Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Fri, 30 Jun 2023 14:25:41 +0100 Subject: [PATCH 098/181] fix(sol): update query mode The query mode has been changed from "4" (gsquery) to "5" (tcp) in the solserver configuration file. Additionally, the query type has been cleared. This ensures that the server uses TCP for querying and removes any specific query type. --- lgsm/config-default/config-lgsm/solserver/_default.cfg | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lgsm/config-default/config-lgsm/solserver/_default.cfg b/lgsm/config-default/config-lgsm/solserver/_default.cfg index 6db45dc530..e6d641b63e 100644 --- a/lgsm/config-default/config-lgsm/solserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/solserver/_default.cfg @@ -141,8 +141,8 @@ stopmode="2" # 3: gamedig # 4: gsquery # 5: tcp -querymode="4" -querytype="soldat" +querymode="5" +querytype="" ## Console type consoleverbose="yes" From 532e9059603fc9796b099858792a92991973fc51 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Fri, 30 Jun 2023 14:37:36 +0100 Subject: [PATCH 099/181] fix(ut3): update querymode and querytype in UT3 server config The commit updates the `querymode` to "1" and removes the value for `querytype` in the UT3 server configuration file. This change ensures that the correct query mode is used for server queries. --- lgsm/config-default/config-lgsm/ut3server/_default.cfg | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lgsm/config-default/config-lgsm/ut3server/_default.cfg b/lgsm/config-default/config-lgsm/ut3server/_default.cfg index 87b99bdb83..62d4833edf 100644 --- a/lgsm/config-default/config-lgsm/ut3server/_default.cfg +++ b/lgsm/config-default/config-lgsm/ut3server/_default.cfg @@ -144,8 +144,8 @@ stopmode="2" # 3: gamedig # 4: gsquery # 5: tcp -querymode="2" -querytype="ut3" +querymode="1" +querytype="" ## Console type consoleverbose="yes" From be0cc9369790e6f94e4858fa07905af22efb538c Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Fri, 30 Jun 2023 18:25:30 +0100 Subject: [PATCH 100/181] fix(bt): update querymode and querytype in btserver config The `querymode` and `querytype` values in the btserver configuration file have been updated. The new values are `1` for `querymode` and an empty string for `querytype`. This change ensures that the correct query mode is used for server queries. --- lgsm/config-default/config-lgsm/btserver/_default.cfg | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lgsm/config-default/config-lgsm/btserver/_default.cfg b/lgsm/config-default/config-lgsm/btserver/_default.cfg index 1fda28f37a..37c257154d 100644 --- a/lgsm/config-default/config-lgsm/btserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/btserver/_default.cfg @@ -137,8 +137,8 @@ stopmode="7" # 3: gamedig # 4: gsquery # 5: tcp -querymode="2" -querytype="protocol-valve" +querymode="1" +querytype="" ## Console type consoleverbose="yes" From 9a0df53b974702447ee339e9e7d453f92c09fce1 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sat, 1 Jul 2023 21:25:00 +0100 Subject: [PATCH 101/181] fix: update serverlist.csv - Updated the operating system version for Action: Source server from ubuntu-22.04 to ubuntu-20.04 - Updated the operating system version for Arma Reforger server from ubuntu-22.04 to ubuntu-20.04 --- lgsm/data/serverlist.csv | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lgsm/data/serverlist.csv b/lgsm/data/serverlist.csv index 8b2b5c705d..a1f12395f4 100644 --- a/lgsm/data/serverlist.csv +++ b/lgsm/data/serverlist.csv @@ -1,6 +1,6 @@ ac,acserver,Assetto Corsa,ubuntu-22.04 ahl,ahlserver,Action Half-Life,ubuntu-22.04 -ahl2,ahl2server,Action: Source,ubuntu-22.04 +ahl2,ahl2server,Action: Source,ubuntu-20.04 ark,arkserver,ARK: Survival Evolved,ubuntu-22.04 arma3,arma3server,ARMA 3,ubuntu-22.04 armar,armarserver,Arma Reforger,ubuntu-20.04 From f2779d1b2d3e762203c8b8d8444f932fc565a117 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sat, 1 Jul 2023 23:03:56 +0100 Subject: [PATCH 102/181] feat(docker): create ENV for directory changes in docker adds ability to update some variables using ENV variables in docker. a --- linuxgsm.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/linuxgsm.sh b/linuxgsm.sh index b8739f00df..2b28004373 100755 --- a/linuxgsm.sh +++ b/linuxgsm.sh @@ -28,17 +28,17 @@ rootdir=$(dirname "$(readlink -f "${BASH_SOURCE[0]}")") selfname=$(basename "$(readlink -f "${BASH_SOURCE[0]}")") sessionname=$(echo "${selfname}" | cut -f1 -d".") lgsmdir="${rootdir}/lgsm" -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" lgsmlogdir="${logdir}/lgsm" steamcmddir="${HOME}/.steam/steamcmd" -serverfiles="${rootdir}/serverfiles" +[ -n "${LGSM_SERVERFILES}" ] && serverfiles="${LGSM_SERVERFILES}" || serverfiles="${rootdir}/serverfiles" modulesdir="${lgsmdir}/modules" tmpdir="${lgsmdir}/tmp" datadir="${lgsmdir}/data" lockdir="${lgsmdir}/lock" serverlist="${datadir}/serverlist.csv" serverlistmenu="${datadir}/serverlistmenu.csv" -configdir="${lgsmdir}/config-lgsm" +[ -n "${LGSM_CONFIG}" ] && configdir="${LGSM_CONFIG}" || configdir="${lgsmdir}/config-lgsm" configdirserver="${configdir}/${gameservername}" configdirdefault="${lgsmdir}/config-default" userinput="${1}" From 2ff6b682391faec69876c961f1fc1d2338a5ca39 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sun, 2 Jul 2023 00:39:40 +0100 Subject: [PATCH 103/181] refactor(docker): simplify root user check The code changes remove the unnecessary check for the presence of a Docker environment in multiple scripts. Instead, they now only check if the current user is not root. This simplifies the logic and improves readability. - Simplify root user check in `check.sh`, `check_deps.sh`, `check_permissions.sh`, `check_root.sh`, `command_install.sh`, `core_exit.sh`, and `linuxgsm.sh` - Remove redundant checks for Docker environment - Improve code readability --- lgsm/modules/check.sh | 4 ++-- lgsm/modules/check_deps.sh | 2 +- lgsm/modules/check_permissions.sh | 4 ++-- lgsm/modules/check_root.sh | 2 +- lgsm/modules/command_install.sh | 2 +- lgsm/modules/core_exit.sh | 2 +- linuxgsm.sh | 2 +- 7 files changed, 9 insertions(+), 9 deletions(-) diff --git a/lgsm/modules/check.sh b/lgsm/modules/check.sh index 10fa080c66..1b8796e474 100644 --- a/lgsm/modules/check.sh +++ b/lgsm/modules/check.sh @@ -21,7 +21,7 @@ fi check_tmuxception.sh -if [ "$(whoami)" != "root" ] || [ -f /.dockerenv ]; then +if [ "$(whoami)" != "root" ]; 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" ] || [ -f /.dockerenv ]; then +if [ "$(whoami)" != "root" ]; then allowed_commands_array=(DEBUG START INSTALL) for allowed_command in "${allowed_commands_array[@]}"; do if [ "${allowed_command}" == "${commandname}" ]; then diff --git a/lgsm/modules/check_deps.sh b/lgsm/modules/check_deps.sh index 1db5c96c3d..560490b978 100644 --- a/lgsm/modules/check_deps.sh +++ b/lgsm/modules/check_deps.sh @@ -301,7 +301,7 @@ fn_deps_detector() { } if [ "${commandname}" == "INSTALL" ]; then - if [ "$(whoami)" == "root" ] && [ ! -f /.dockerenv ]; then + if [ "$(whoami)" == "root" ]; then echo -e "" echo -e "${lightyellow}Checking Dependencies as root${default}" echo -e "=================================" diff --git a/lgsm/modules/check_permissions.sh b/lgsm/modules/check_permissions.sh index bb3e6764f1..d582e5f24a 100644 --- a/lgsm/modules/check_permissions.sh +++ b/lgsm/modules/check_permissions.sh @@ -223,8 +223,8 @@ fn_sys_perm_error_process() { fi } -## Run permisions checks when not root or docker. -if [ "$(whoami)" != "root" ] && [ ! -f /.dockerenv ]; then +## Run permisions checks when not root. +if [ "$(whoami)" != "root" ]; then fn_check_ownership fn_check_permissions if [ "${commandname}" == "START" ]; then diff --git a/lgsm/modules/check_root.sh b/lgsm/modules/check_root.sh index 26475601a8..063a2b0d30 100644 --- a/lgsm/modules/check_root.sh +++ b/lgsm/modules/check_root.sh @@ -7,7 +7,7 @@ moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" -if [ "$(whoami)" == "root" ] && [ ! -f /.dockerenv ]; then +if [ "$(whoami)" == "root" ]; then if [ "${commandname}" != "INSTALL" ]; then fn_print_fail_nl "Do NOT run this script as root!" if [ -d "${lgsmlogdir}" ]; then diff --git a/lgsm/modules/command_install.sh b/lgsm/modules/command_install.sh index 32f846fac0..e8cba75608 100644 --- a/lgsm/modules/command_install.sh +++ b/lgsm/modules/command_install.sh @@ -11,7 +11,7 @@ moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_firstcommand_set check.sh -if [ "$(whoami)" == "root" ] && [ ! -f /.dockerenv ]; then +if [ "$(whoami)" == "root" ]; then check_deps.sh else install_header.sh diff --git a/lgsm/modules/core_exit.sh b/lgsm/modules/core_exit.sh index a8686c2a88..d43f0555aa 100644 --- a/lgsm/modules/core_exit.sh +++ b/lgsm/modules/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" ] && [ ! -f /.dockerenv ]; then +if [ "$(whoami)" == "root" ]; 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/linuxgsm.sh b/linuxgsm.sh index 2b28004373..7713c3adc6 100755 --- a/linuxgsm.sh +++ b/linuxgsm.sh @@ -321,7 +321,7 @@ fn_install_file() { } # Prevent LinuxGSM from running as root. Except if doing a dependency install. -if [ "$(whoami)" == "root" ] && [ ! -f /.dockerenv ]; then +if [ "$(whoami)" == "root" ]; 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!" From 257c0069773323c9c511dc3ad2c5336f1814fa7b Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sun, 2 Jul 2023 00:53:22 +0100 Subject: [PATCH 104/181] Release v23.3.5 --- lgsm/modules/core_functions.sh | 2 +- lgsm/modules/core_modules.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, 7 insertions(+), 7 deletions(-) diff --git a/lgsm/modules/core_functions.sh b/lgsm/modules/core_functions.sh index 44e1623040..ac5d847f79 100644 --- a/lgsm/modules/core_functions.sh +++ b/lgsm/modules/core_functions.sh @@ -8,7 +8,7 @@ module_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" -modulesversion="v23.3.4" +modulesversion="v23.3.5" # Core diff --git a/lgsm/modules/core_modules.sh b/lgsm/modules/core_modules.sh index afa9cad83b..7c8c1096c6 100644 --- a/lgsm/modules/core_modules.sh +++ b/lgsm/modules/core_modules.sh @@ -8,7 +8,7 @@ moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" -modulesversion="v23.3.4" +modulesversion="v23.3.5" # Core diff --git a/linuxgsm.sh b/linuxgsm.sh index 7713c3adc6..72b96dbc7c 100755 --- a/linuxgsm.sh +++ b/linuxgsm.sh @@ -20,7 +20,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="v23.3.4" +version="v23.3.5" shortname="core" gameservername="core" commandname="CORE" diff --git a/tests/tests_fctrserver.sh b/tests/tests_fctrserver.sh index e0af4f4150..29c449b269 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.3.4" +version="v23.3.5" shortname="fctr" gameservername="fctrserver" commandname="CORE" diff --git a/tests/tests_jc2server.sh b/tests/tests_jc2server.sh index 45ebdcc699..064185bc02 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.3.4" +version="v23.3.5" shortname="jc2" gameservername="jc2server" commandname="CORE" diff --git a/tests/tests_mcserver.sh b/tests/tests_mcserver.sh index 6388bda633..c1e775f060 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.3.4" +version="v23.3.5" shortname="mc" gameservername="mcserver" commandname="CORE" diff --git a/tests/tests_ts3server.sh b/tests/tests_ts3server.sh index 3483239635..652ee8f8d6 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.3.4" +version="v23.3.5" shortname="ts3" gameservername="ts3server" commandname="CORE" From fd8c83ee32b9dd59fbf81273ec9b1055c982d8fe Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sun, 2 Jul 2023 01:03:00 +0100 Subject: [PATCH 105/181] feat(docker): add trigger for building Docker LinuxGSM and GameServer Added triggers to the workflow file `trigger-docker-build.yml` to build Docker images for LinuxGSM and GameServer. The trigger for GameServer is dependent on the completion of the LinuxGSM build. --- .github/workflows/trigger-docker-build.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/trigger-docker-build.yml b/.github/workflows/trigger-docker-build.yml index 76d4275a64..61ec91d397 100644 --- a/.github/workflows/trigger-docker-build.yml +++ b/.github/workflows/trigger-docker-build.yml @@ -6,6 +6,7 @@ on: jobs: trigger_build_docker-linuxgsm: + name: Trigger Build Docker LinuxGSM runs-on: ubuntu-latest steps: - name: Trigger Workflow and Wait (linuxgsm) @@ -17,6 +18,8 @@ jobs: workflow_file_name: docker-publish.yml trigger_build_docker-gameserver: + name: Trigger Build Docker GameServer + needs: trigger_build_docker-linuxgsm runs-on: ubuntu-latest steps: - name: Trigger Workflow and Wait (gameserver) From 76badc21ed6311acecd503e7c7c8a2d60c6cff2d Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sun, 2 Jul 2023 01:03:00 +0100 Subject: [PATCH 106/181] feat(docker): add trigger for building Docker LinuxGSM and GameServer Added triggers to the workflow file `trigger-docker-build.yml` to build Docker images for LinuxGSM and GameServer. The trigger for GameServer is dependent on the completion of the LinuxGSM build. --- .github/workflows/trigger-docker-build.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/trigger-docker-build.yml b/.github/workflows/trigger-docker-build.yml index 76d4275a64..61ec91d397 100644 --- a/.github/workflows/trigger-docker-build.yml +++ b/.github/workflows/trigger-docker-build.yml @@ -6,6 +6,7 @@ on: jobs: trigger_build_docker-linuxgsm: + name: Trigger Build Docker LinuxGSM runs-on: ubuntu-latest steps: - name: Trigger Workflow and Wait (linuxgsm) @@ -17,6 +18,8 @@ jobs: workflow_file_name: docker-publish.yml trigger_build_docker-gameserver: + name: Trigger Build Docker GameServer + needs: trigger_build_docker-linuxgsm runs-on: ubuntu-latest steps: - name: Trigger Workflow and Wait (gameserver) From a9a074407080c414c3f4444bc86f7b0c217b6e6b Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Mon, 3 Jul 2023 16:01:03 +0100 Subject: [PATCH 107/181] fix: update server configurations and game versions - Set `consoleverbose` to "yes" in BTL Server configuration - Remove redundant line in KF Server configuration - Remove redundant line in RO Server configuration - Update VH Server executable path and remove redundant line - Update BTL Server game version to Ubuntu 20.04 in serverlist.csv --- lgsm/config-default/config-lgsm/bfvserver/_default.cfg | 2 +- lgsm/config-default/config-lgsm/btlserver/_default.cfg | 2 +- lgsm/config-default/config-lgsm/kfserver/_default.cfg | 1 - lgsm/config-default/config-lgsm/roserver/_default.cfg | 1 - lgsm/config-default/config-lgsm/vhserver/_default.cfg | 1 - lgsm/data/serverlist.csv | 2 +- 6 files changed, 3 insertions(+), 6 deletions(-) diff --git a/lgsm/config-default/config-lgsm/bfvserver/_default.cfg b/lgsm/config-default/config-lgsm/bfvserver/_default.cfg index 27d7cd504d..1b3b70c58f 100644 --- a/lgsm/config-default/config-lgsm/bfvserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/bfvserver/_default.cfg @@ -132,7 +132,7 @@ querytype="" ## Console type consoleverbose="yes" -consoleinteract="no" +consoleinteract="yes" ## Game Server Details # Do not edit diff --git a/lgsm/config-default/config-lgsm/btlserver/_default.cfg b/lgsm/config-default/config-lgsm/btlserver/_default.cfg index b1b738fe25..867beba4bb 100644 --- a/lgsm/config-default/config-lgsm/btlserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/btlserver/_default.cfg @@ -146,7 +146,7 @@ querymode="2" querytype="protocol-valve" ## Console type -consoleverbose="no" +consoleverbose="yes" consoleinteract="no" ## Game Server Details diff --git a/lgsm/config-default/config-lgsm/kfserver/_default.cfg b/lgsm/config-default/config-lgsm/kfserver/_default.cfg index 71b1a178b8..f03d7da05a 100644 --- a/lgsm/config-default/config-lgsm/kfserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/kfserver/_default.cfg @@ -166,7 +166,6 @@ glibc="2.4" # Edit with care ## Game Server Directories -serverfiles="${rootdir}/serverfiles" systemdir="${serverfiles}/System" executabledir="${systemdir}" executable="./ucc-bin" diff --git a/lgsm/config-default/config-lgsm/roserver/_default.cfg b/lgsm/config-default/config-lgsm/roserver/_default.cfg index 9ff217a8b0..9ee90f5d41 100644 --- a/lgsm/config-default/config-lgsm/roserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/roserver/_default.cfg @@ -162,7 +162,6 @@ glibc="2.4" # Edit with care ## Game Server Directories -serverfiles="${rootdir}/serverfiles" systemdir="${serverfiles}/system" executabledir="${systemdir}" executable="./ucc-bin" diff --git a/lgsm/config-default/config-lgsm/vhserver/_default.cfg b/lgsm/config-default/config-lgsm/vhserver/_default.cfg index 8fe7cd4dc5..93aaa83e66 100644 --- a/lgsm/config-default/config-lgsm/vhserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/vhserver/_default.cfg @@ -174,7 +174,6 @@ glibc="2.15" systemdir="${serverfiles}" executabledir="${serverfiles}" executable="./valheim_server.x86_64" -serverfiles="${rootdir}/serverfiles" ## Backup Directory backupdir="${lgsmdir}/backup" diff --git a/lgsm/data/serverlist.csv b/lgsm/data/serverlist.csv index a1f12395f4..fded141d41 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 -btl,btlserver,BATTALION: Legacy,ubuntu-22.04 +btl,btlserver,BATTALION: Legacy,ubuntu-20.04 cc,ccserver,Codename CURE,ubuntu-22.04 cd,cdserver,Crafting Dead,ubuntu-22.04 ck,ckserver,Core Keeper,ubuntu-22.04 From 9d699ee36d782bfc450c0e6ccd1cc17a318e6ec9 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Mon, 3 Jul 2023 20:47:00 +0100 Subject: [PATCH 108/181] refactor: improve lockfile checking and add backup and debug mode checks The code changes refactor the `fn_monitor_check_lockfile` function to include additional checks for backup and debug modes. The new functions `fn_monitor_check_backup` and `fn_monitor_check_debug` are added to handle these checks. Additionally, the `fn_monitor_check_install` function is introduced to check if an installation is currently running. The existing check for active updates in the `fn_monitor_check_update` function is also improved. These changes enhance the monitoring functionality by providing more comprehensive checks for different scenarios, ensuring that the monitor does not run when certain conditions are met. --- lgsm/functions/core_steamcmd.sh | 6 +++- lgsm/modules/command_monitor.sh | 60 +++++++++++++++++++++++++++------ 2 files changed, 55 insertions(+), 11 deletions(-) diff --git a/lgsm/functions/core_steamcmd.sh b/lgsm/functions/core_steamcmd.sh index 119748fb71..77dd12d5ee 100644 --- a/lgsm/functions/core_steamcmd.sh +++ b/lgsm/functions/core_steamcmd.sh @@ -32,10 +32,14 @@ fn_check_steamcmd_user() { # Anonymous user is set if steamuser is missing. if [ -z "${steamuser}" ]; then if [ -d "${lgsmlogdir}" ]; then - fn_script_log_info "Using anonymous Steam login" + fn_script_log_info "Login to SteamCMD as: anonymous" fi steamuser="anonymous" steampass='' + else + if [ -d "${lgsmlogdir}" ]; then + fn_script_log_info "Login to SteamCMD as: ${steamuser}" + fi fi } diff --git a/lgsm/modules/command_monitor.sh b/lgsm/modules/command_monitor.sh index f2db9ca2d5..7899a5c344 100644 --- a/lgsm/modules/command_monitor.sh +++ b/lgsm/modules/command_monitor.sh @@ -12,11 +12,14 @@ moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_firstcommand_set fn_monitor_check_lockfile() { - # Monitor does not run it lockfile is not found. + # Monitor does not run if lockfile is not found. if [ ! -f "${lockdir}/${selfname}.lock" ]; then fn_print_dots "Checking lockfile: " fn_print_checking_eol fn_script_log_info "Checking lockfile: CHECKING" + fn_monitor_check_update + fn_monitor_check_backup + fn_monitor_check_debug fn_print_error "Checking lockfile: No lockfile found: " fn_print_error_eol_nl fn_script_log_error "Checking lockfile: No lockfile found: ERROR" @@ -32,19 +35,55 @@ fn_monitor_check_lockfile() { fi } -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: " +fn_monitor_check_backup() { + # Monitor will check if backup is running. + if [ "$(pgrep "${selfname} backup" | wc -l)" != "0" ] || [ "$(pgrep "${selfname} b" | wc -l)" != "0" ]; then + fn_print_info_nl "Checking lockfile: LinuxGSM is currently running a backup: " + fn_print_info_eol + fn_script_log_info "Checking lockfile: LinuxGSM is currently running a backup" + core_exit.sh + fi +} + +fn_monitor_check_debug() { + # Monitor will check if backup is running. + if [ "$(pgrep -fc "${selfname} backup")" != "0" ] || [ "$(pgrep -fc "${selfname} b")" != "0" ]; then + fn_print_info_nl "Checking lockfile: LinuxGSM is currently in debug mode: " + fn_print_info_eol + fn_script_log_pass "Checking lockfile: LinuxGSM is currently in debug mode" + core_exit.sh + fi +} + +fn_monitor_check_install() { + # Monitor will check if update is running. + if [ "$(pgrep -fc "${selfname} install")" != "0" ] || [ "$(pgrep -fc "${selfname} i")" != "0" ] || [ "$(pgrep -fc "${selfname} auto-install")" != "0" ] || [ "$(pgrep -fc "${selfname} ai")" != "0" ]; then + fn_print_dots "Checking for installer: " fn_print_checking_eol - fn_script_log_info "Checking active updates: CHECKING" - fn_print_error_nl "Checking active updates: SteamCMD is currently checking for updates: " - fn_print_error_eol - fn_script_log_error "Checking active updates: SteamCMD is currently checking for updates: ERROR" + fn_script_log_info "Checking for installer: CHECKING" + fn_print_info_nl "Checking for installer: LinuxGSM is currently installing: " + fn_print_info_eol + fn_script_log_pass "Checking for installer: LinuxGSM is currently installing" core_exit.sh fi } +fn_monitor_check_update() { + # Monitor will check if an update is running. + if [ "$(pgrep -fc "${selfname} update")" != "0" ] || [ "$(pgrep -fc "${selfname} u")" != "0" ] || [ "$(pgrep -fc "${selfname} validate")" != "0" ] || [ "$(pgrep -fc "${selfname} v")" != "0" ]; then + # Specific check for docker. Will ignore the command watch -n 1800 ./csgoserver update + if [ "$(pgrep -fc "n*${selfname} update")" != "0" ]; then + fn_print_dots "Checking active updates: " + fn_print_checking_eol + fn_script_log_info "Checking active updates: CHECKING" + fn_print_info_nl "Checking active updates: SteamCMD is currently checking for updates: " + fn_print_info_eol + fn_script_log_pass "Checking active updates: SteamCMD is currently checking for updates" + core_exit.sh + fi + fi +} + fn_monitor_check_session() { fn_print_dots "Checking session: " fn_print_checking_eol @@ -223,13 +262,14 @@ fn_monitor_loop() { } monitorflag=1 +# Dont do any monitoring or checks if installer is running. +fn_monitor_check_install check.sh core_logs.sh info_game.sh # query pre-checks fn_monitor_check_lockfile -fn_monitor_check_update fn_monitor_check_session # Monitor will not continue if session only check. if [ "${querymode}" != "1" ]; then From 6716839c8bb5e43d999c50488bf996bf67f73896 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Mon, 3 Jul 2023 21:42:59 +0100 Subject: [PATCH 109/181] feat: add steamcmd checking to monitor --- lgsm/functions/check.sh | 10 +++++----- lgsm/modules/command_monitor.sh | 9 +++------ 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/lgsm/functions/check.sh b/lgsm/functions/check.sh index 0f1e123687..e19853424c 100644 --- a/lgsm/functions/check.sh +++ b/lgsm/functions/check.sh @@ -31,7 +31,7 @@ if [ "${commandname}" != "INSTALL" ] && [ "${commandname}" != "UPDATE-LGSM" ] && check_system_dir.sh fi -allowed_commands_array=(START DEBUG) +allowed_commands_array=(DEBUG START) for allowed_command in "${allowed_commands_array[@]}"; do if [ "${allowed_command}" == "${commandname}" ]; then check_executable.sh @@ -47,7 +47,7 @@ if [ "$(whoami)" != "root" ] || [ -f /.dockerenv ]; then done fi -allowed_commands_array=(BACKUP CONSOLE DEBUG DETAILS MAP-COMPRESSOR FASTDL MODS-INSTALL MODS-REMOVE MODS-UPDATE MONITOR POST-DETAILS RESTART START STOP TEST-ALERT CHANGE-PASSWORD UPDATE UPDATE-LGSM VALIDATE WIPE) +allowed_commands_array=(BACKUP CHANGE-PASSWORD CONSOLE DEBUG DETAILS FASTDL MAP-COMPRESSOR MODS-INSTALL MODS-REMOVE MODS-UPDATE MONITOR POST-DETAILS RESTART START STOP TEST-ALERT UPDATE UPDATE-LGSM VALIDATE WIPE) for allowed_command in "${allowed_commands_array[@]}"; do if [ "${allowed_command}" == "${commandname}" ]; then check_logs.sh @@ -68,7 +68,7 @@ for allowed_command in "${allowed_commands_array[@]}"; do fi done -allowed_commands_array=(DEBUG DETAILS DEV-QUERY-RAW MONITOR POST_DETAILS START STOP POST-DETAILS) +allowed_commands_array=(DEBUG DETAILS DEV-QUERY-RAW MONITOR POST-DETAILS START STOP) for allowed_command in "${allowed_commands_array[@]}"; do if [ "${allowed_command}" == "${commandname}" ]; then if [ -z "${installflag}" ]; then @@ -77,7 +77,7 @@ for allowed_command in "${allowed_commands_array[@]}"; do fi done -allowed_commands_array=(DEBUG START UPDATE VALIDATE CHECK-UPDATE) +allowed_commands_array=(CHECK-UPDATE DEBUG MONITOR START UPDATE VALIDATE) for allowed_command in "${allowed_commands_array[@]}"; do if [ "${allowed_command}" == "${commandname}" ]; then if [ "${appid}" ]; then @@ -86,7 +86,7 @@ for allowed_command in "${allowed_commands_array[@]}"; do fi done -allowed_commands_array=(CHANGE-PASSWORD DETAILS MONITOR START STOP UPDATE VALIDATE POST-DETAILS) +allowed_commands_array=(CHANGE-PASSWORD DETAILS MONITOR POST-DETAILS START STOP UPDATE VALIDATE) for allowed_command in "${allowed_commands_array[@]}"; do if [ "${allowed_command}" == "${commandname}" ]; then check_status.sh diff --git a/lgsm/modules/command_monitor.sh b/lgsm/modules/command_monitor.sh index 7899a5c344..bdb7a933bc 100644 --- a/lgsm/modules/command_monitor.sh +++ b/lgsm/modules/command_monitor.sh @@ -72,13 +72,10 @@ fn_monitor_check_update() { # Monitor will check if an update is running. if [ "$(pgrep -fc "${selfname} update")" != "0" ] || [ "$(pgrep -fc "${selfname} u")" != "0" ] || [ "$(pgrep -fc "${selfname} validate")" != "0" ] || [ "$(pgrep -fc "${selfname} v")" != "0" ]; then # Specific check for docker. Will ignore the command watch -n 1800 ./csgoserver update - if [ "$(pgrep -fc "n*${selfname} update")" != "0" ]; then - fn_print_dots "Checking active updates: " - fn_print_checking_eol - fn_script_log_info "Checking active updates: CHECKING" - fn_print_info_nl "Checking active updates: SteamCMD is currently checking for updates: " + if [ "$(pgrep -fc "n*${selfname} update")" == "0" ]; then + fn_print_info_nl "Checking lockfile: LinuxGSM is currently checking for updates: " fn_print_info_eol - fn_script_log_pass "Checking active updates: SteamCMD is currently checking for updates" + fn_script_log_pass "Checking lockfile: LinuxGSM is currently checking for updates" core_exit.sh fi fi From f43a84623a985781bb8640e6b92484d899cb2e50 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Tue, 4 Jul 2023 09:50:27 +0100 Subject: [PATCH 110/181] refactor: improve monitor check update function The `fn_monitor_check_update` function has been refactored to improve readability and efficiency. Specifically, a specific check for docker has been added to ignore the command "watch -n 1800 ./csgoserver update". Additionally, the logic for updating the `monitorps` variable has been simplified. --- lgsm/modules/command_monitor.sh | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/lgsm/modules/command_monitor.sh b/lgsm/modules/command_monitor.sh index bdb7a933bc..97f86d9961 100644 --- a/lgsm/modules/command_monitor.sh +++ b/lgsm/modules/command_monitor.sh @@ -69,13 +69,18 @@ fn_monitor_check_install() { } fn_monitor_check_update() { + # Specific check for docker. Will ignore the command watch -n 1800 ./csgoserver update + monitorps=0 + if [ "$(pgrep -fc "n*${selfname} update")" != "0" ]; then + monitorps="$((monitorps - 1))" + fi # Monitor will check if an update is running. if [ "$(pgrep -fc "${selfname} update")" != "0" ] || [ "$(pgrep -fc "${selfname} u")" != "0" ] || [ "$(pgrep -fc "${selfname} validate")" != "0" ] || [ "$(pgrep -fc "${selfname} v")" != "0" ]; then - # Specific check for docker. Will ignore the command watch -n 1800 ./csgoserver update - if [ "$(pgrep -fc "n*${selfname} update")" == "0" ]; then - fn_print_info_nl "Checking lockfile: LinuxGSM is currently checking for updates: " + monitorps="$((monitorps + 2))" + if [ "${monitorps}" != "0" ]; then + fn_print_info_nl "Checking lockfile: LinuxGSM is currently updating: " fn_print_info_eol - fn_script_log_pass "Checking lockfile: LinuxGSM is currently checking for updates" + fn_script_log_pass "Checking lockfile: LinuxGSM is currently updating" core_exit.sh fi fi From 9cd5abdbf5fbe1e4a43a6d8d36e912a3892865cc Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Tue, 4 Jul 2023 17:01:54 +0100 Subject: [PATCH 111/181] refactor(mr): update querymode and querytype in _default.cfg The commit updates the querymode to "1" and removes the value for querytype in the _default.cfg file. This change refactors the configuration related to querying game servers. Mordhau query port no longer starts with the server. Disabling querying --- lgsm/config-default/config-lgsm/mhserver/_default.cfg | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lgsm/config-default/config-lgsm/mhserver/_default.cfg b/lgsm/config-default/config-lgsm/mhserver/_default.cfg index 1011e87681..04fa3e060a 100644 --- a/lgsm/config-default/config-lgsm/mhserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/mhserver/_default.cfg @@ -145,8 +145,8 @@ stopmode="2" # 3: gamedig # 4: gsquery # 5: tcp -querymode="2" -querytype="protocol-valve" +querymode="1" +querytype="" ## Console type consoleverbose="yes" From 21f91009de91f62f5b57d8c957b6dcb451c1cf2f Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Tue, 4 Jul 2023 21:33:24 +0100 Subject: [PATCH 112/181] refactor(mohaa): update querymode and querytype in mohaaserver config The querymode and querytype values in the mohaaserver config have been updated. The new values are querymode="1" and an empty string for querytype. This change refactors the configuration to use a different method for querying game server information. --- lgsm/config-default/config-lgsm/mohaaserver/_default.cfg | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lgsm/config-default/config-lgsm/mohaaserver/_default.cfg b/lgsm/config-default/config-lgsm/mohaaserver/_default.cfg index 0077221f4f..ad4717e9f4 100644 --- a/lgsm/config-default/config-lgsm/mohaaserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/mohaaserver/_default.cfg @@ -129,8 +129,8 @@ stopmode="3" # 3: gamedig # 4: gsquery # 5: tcp -querymode="2" -querytype="protocol-quake3" +querymode="1" +querytype="" ## Console type consoleverbose="yes" From a6d24cdc77191d6a3548064271c9f378566b4c4a Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Tue, 4 Jul 2023 21:42:44 +0100 Subject: [PATCH 113/181] refactor(jc3): update querymode and querytype in jc3server config The `querymode` has been changed from "2" to "1" and the `querytype` has been cleared in the jc3server configuration file. This change refactors the way server queries are handled. --- lgsm/config-default/config-lgsm/jc3server/_default.cfg | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lgsm/config-default/config-lgsm/jc3server/_default.cfg b/lgsm/config-default/config-lgsm/jc3server/_default.cfg index fd049f80d6..98ff2a09f9 100644 --- a/lgsm/config-default/config-lgsm/jc3server/_default.cfg +++ b/lgsm/config-default/config-lgsm/jc3server/_default.cfg @@ -137,8 +137,8 @@ stopmode="2" # 3: gamedig # 4: gsquery # 5: tcp -querymode="2" -querytype="protocol-valve" +querymode="1" +querytype="" ## Console type consoleverbose="yes" From 6726772bb161d3d62f6ac0e375f0d98cf9012000 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Wed, 5 Jul 2023 11:18:33 +0100 Subject: [PATCH 114/181] refactor: update log directory configuration The log directory configuration has been updated for multiple game servers. The LGSM_LOGDIR environment variable is now checked and used if available, otherwise the default root directory is used. This change ensures that the correct log directories are set for each server. --- .../config-lgsm/acserver/_default.cfg | 2 +- .../config-lgsm/ahl2server/_default.cfg | 2 +- .../config-lgsm/ahlserver/_default.cfg | 2 +- .../config-lgsm/arkserver/_default.cfg | 2 +- .../config-lgsm/arma3server/_default.cfg | 2 +- .../config-lgsm/armarserver/_default.cfg | 2 +- .../config-lgsm/atsserver/_default.cfg | 2 +- .../config-lgsm/avserver/_default.cfg | 2 +- .../config-lgsm/bb2server/_default.cfg | 2 +- .../config-lgsm/bbserver/_default.cfg | 2 +- .../config-lgsm/bdserver/_default.cfg | 2 +- .../config-lgsm/bf1942server/_default.cfg | 2 +- .../config-lgsm/bfvserver/_default.cfg | 2 +- .../config-lgsm/bmdmserver/_default.cfg | 2 +- .../config-lgsm/boserver/_default.cfg | 2 +- .../config-lgsm/bsserver/_default.cfg | 2 +- .../config-lgsm/btlserver/_default.cfg | 2 +- .../config-lgsm/btserver/_default.cfg | 2 +- .../config-lgsm/ccserver/_default.cfg | 2 +- .../config-lgsm/cdserver/_default.cfg | 2 +- .../config-lgsm/ckserver/_default.cfg | 2 +- .../config-lgsm/cmwserver/_default.cfg | 2 +- .../config-lgsm/cod2server/_default.cfg | 2 +- .../config-lgsm/cod4server/_default.cfg | 2 +- .../config-lgsm/codserver/_default.cfg | 2 +- .../config-lgsm/coduoserver/_default.cfg | 2 +- .../config-lgsm/codwawserver/_default.cfg | 2 +- .../config-lgsm/colserver/_default.cfg | 2 +- .../config-lgsm/csczserver/_default.cfg | 2 +- .../config-lgsm/csgoserver/_default.cfg | 2 +- .../config-lgsm/csserver/_default.cfg | 2 +- .../config-lgsm/cssserver/_default.cfg | 2 +- .../config-lgsm/ctserver/_default.cfg | 2 +- .../config-lgsm/dabserver/_default.cfg | 2 +- .../config-lgsm/dayzserver/_default.cfg | 2 +- .../config-lgsm/dmcserver/_default.cfg | 2 +- .../config-lgsm/dodrserver/_default.cfg | 2 +- .../config-lgsm/dodserver/_default.cfg | 2 +- .../config-lgsm/dodsserver/_default.cfg | 2 +- .../config-lgsm/doiserver/_default.cfg | 2 +- .../config-lgsm/dstserver/_default.cfg | 2 +- .../config-lgsm/dysserver/_default.cfg | 2 +- .../config-lgsm/ecoserver/_default.cfg | 2 +- .../config-lgsm/emserver/_default.cfg | 2 +- .../config-lgsm/etlserver/_default.cfg | 2 +- .../config-lgsm/ets2server/_default.cfg | 2 +- .../config-lgsm/fctrserver/_default.cfg | 2 +- .../config-lgsm/fofserver/_default.cfg | 2 +- .../config-lgsm/gmodserver/_default.cfg | 2 +- .../config-lgsm/hcuserver/_default.cfg | 2 +- .../config-lgsm/hl2dmserver/_default.cfg | 2 +- .../config-lgsm/hldmserver/_default.cfg | 2 +- .../config-lgsm/hldmsserver/_default.cfg | 2 +- .../config-lgsm/hwserver/_default.cfg | 2 +- .../config-lgsm/insserver/_default.cfg | 2 +- .../config-lgsm/inssserver/_default.cfg | 2 +- .../config-lgsm/iosserver/_default.cfg | 2 +- .../config-lgsm/jc2server/_default.cfg | 2 +- .../config-lgsm/jc3server/_default.cfg | 2 +- .../config-lgsm/jk2server/_default.cfg | 2 +- .../config-lgsm/kf2server/_default.cfg | 2 +- .../config-lgsm/kfserver/_default.cfg | 2 +- .../config-lgsm/l4d2server/_default.cfg | 2 +- .../config-lgsm/l4dserver/_default.cfg | 2 +- .../config-lgsm/loserver/_default.cfg | 2 +- .../config-lgsm/mcbserver/_default.cfg | 2 +- .../config-lgsm/mcserver/_default.cfg | 2 +- .../config-lgsm/mhserver/_default.cfg | 2 +- .../config-lgsm/mohaaserver/_default.cfg | 2 +- .../config-lgsm/momserver/_default.cfg | 2 +- .../config-lgsm/mtaserver/_default.cfg | 2 +- .../config-lgsm/ndserver/_default.cfg | 2 +- .../config-lgsm/necserver/_default.cfg | 2 +- .../config-lgsm/nmrihserver/_default.cfg | 2 +- .../config-lgsm/ns2cserver/_default.cfg | 2 +- .../config-lgsm/ns2server/_default.cfg | 2 +- .../config-lgsm/nsserver/_default.cfg | 2 +- .../config-lgsm/ohdserver/_default.cfg | 2 +- .../config-lgsm/onsetserver/_default.cfg | 2 +- .../config-lgsm/opforserver/_default.cfg | 2 +- .../config-lgsm/pc2server/_default.cfg | 2 +- .../config-lgsm/pcserver/_default.cfg | 2 +- .../config-lgsm/pmcserver/_default.cfg | 2 +- .../config-lgsm/pstbsserver/_default.cfg | 2 +- .../config-lgsm/pvkiiserver/_default.cfg | 2 +- .../config-lgsm/pvrserver/_default.cfg | 2 +- .../config-lgsm/pzserver/_default.cfg | 2 +- .../config-lgsm/q2server/_default.cfg | 2 +- .../config-lgsm/q3server/_default.cfg | 2 +- .../config-lgsm/qlserver/_default.cfg | 2 +- .../config-lgsm/qwserver/_default.cfg | 2 +- .../config-lgsm/ricochetserver/_default.cfg | 2 +- .../config-lgsm/roserver/_default.cfg | 2 +- .../config-lgsm/rtcwserver/_default.cfg | 2 +- .../config-lgsm/rustserver/_default.cfg | 2 +- .../config-lgsm/rwserver/_default.cfg | 2 +- .../config-lgsm/sampserver/_default.cfg | 2 +- .../config-lgsm/sbotsserver/_default.cfg | 2 +- .../config-lgsm/sbserver/_default.cfg | 2 +- .../config-lgsm/scpslserver/_default.cfg | 2 +- .../config-lgsm/scpslsmserver/_default.cfg | 2 +- .../config-lgsm/sdtdserver/_default.cfg | 2 +- .../config-lgsm/sfcserver/_default.cfg | 2 +- .../config-lgsm/sfserver/_default.cfg | 2 +- .../config-lgsm/sof2server/_default.cfg | 2 +- .../config-lgsm/solserver/_default.cfg | 2 +- .../config-lgsm/squadserver/_default.cfg | 2 +- .../config-lgsm/stnserver/_default.cfg | 2 +- .../config-lgsm/stserver/_default.cfg | 2 +- .../config-lgsm/svenserver/_default.cfg | 2 +- .../config-lgsm/terrariaserver/_default.cfg | 2 +- .../config-lgsm/tf2server/_default.cfg | 2 +- .../config-lgsm/tfcserver/_default.cfg | 2 +- .../config-lgsm/tiserver/_default.cfg | 2 +- .../config-lgsm/ts3server/_default.cfg | 2 +- .../config-lgsm/tsserver/_default.cfg | 2 +- .../config-lgsm/tuserver/_default.cfg | 2 +- .../config-lgsm/twserver/_default.cfg | 2 +- .../config-lgsm/untserver/_default.cfg | 2 +- .../config-lgsm/ut2k4server/_default.cfg | 2 +- .../config-lgsm/ut3server/_default.cfg | 2 +- .../config-lgsm/ut99server/_default.cfg | 2 +- .../config-lgsm/utserver/_default.cfg | 2 +- .../config-lgsm/vhserver/_default.cfg | 2 +- .../config-lgsm/vintsserver/_default.cfg | 2 +- .../config-lgsm/vpmcserver/_default.cfg | 2 +- .../config-lgsm/vsserver/_default.cfg | 2 +- .../config-lgsm/wetserver/_default.cfg | 2 +- .../config-lgsm/wfserver/_default.cfg | 2 +- .../config-lgsm/wmcserver/_default.cfg | 2 +- .../config-lgsm/wurmserver/_default.cfg | 2 +- .../config-lgsm/zmrserver/_default.cfg | 2 +- .../config-lgsm/zpsserver/_default.cfg | 2 +- lgsm/functions/core_legacy.sh | 2 +- lgsm/modules/core_legacy.sh | 2 +- lgsm/modules/info_game.sh | 74 +++++++++---------- tests/tests_fctrserver.sh | 2 +- tests/tests_jc2server.sh | 2 +- tests/tests_mcserver.sh | 2 +- tests/tests_ts3server.sh | 2 +- 140 files changed, 176 insertions(+), 176 deletions(-) diff --git a/lgsm/config-default/config-lgsm/acserver/_default.cfg b/lgsm/config-default/config-lgsm/acserver/_default.cfg index 80595da512..3dbc9cbeb4 100644 --- a/lgsm/config-default/config-lgsm/acserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/acserver/_default.cfg @@ -170,7 +170,7 @@ servercfgfullpath="${servercfgdir}/${servercfg}" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${systemdir}/logs" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" diff --git a/lgsm/config-default/config-lgsm/ahl2server/_default.cfg b/lgsm/config-default/config-lgsm/ahl2server/_default.cfg index 3283f54e8a..91bfdd25c4 100644 --- a/lgsm/config-default/config-lgsm/ahl2server/_default.cfg +++ b/lgsm/config-default/config-lgsm/ahl2server/_default.cfg @@ -178,7 +178,7 @@ servercfgfullpath="${servercfgdir}/${servercfg}" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${systemdir}/logs" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" diff --git a/lgsm/config-default/config-lgsm/ahlserver/_default.cfg b/lgsm/config-default/config-lgsm/ahlserver/_default.cfg index 9d4c0ed4b4..78a3059f96 100644 --- a/lgsm/config-default/config-lgsm/ahlserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/ahlserver/_default.cfg @@ -174,7 +174,7 @@ servercfgfullpath="${servercfgdir}/${servercfg}" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${systemdir}/logs" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" diff --git a/lgsm/config-default/config-lgsm/arkserver/_default.cfg b/lgsm/config-default/config-lgsm/arkserver/_default.cfg index cc3de9082b..f391bb9b56 100644 --- a/lgsm/config-default/config-lgsm/arkserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/arkserver/_default.cfg @@ -176,7 +176,7 @@ servercfgfullpath="${servercfgdir}/${servercfg}" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${systemdir}/Saved/Logs" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" diff --git a/lgsm/config-default/config-lgsm/arma3server/_default.cfg b/lgsm/config-default/config-lgsm/arma3server/_default.cfg index c92e843fd7..60662bed2b 100644 --- a/lgsm/config-default/config-lgsm/arma3server/_default.cfg +++ b/lgsm/config-default/config-lgsm/arma3server/_default.cfg @@ -193,7 +193,7 @@ networkcfgfullpath="${networkcfgdir}/${networkcfg}" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" lgsmlog="${lgsmlogdir}/${selfname}-script.log" diff --git a/lgsm/config-default/config-lgsm/armarserver/_default.cfg b/lgsm/config-default/config-lgsm/armarserver/_default.cfg index 3cee2f43f6..faf64c559a 100644 --- a/lgsm/config-default/config-lgsm/armarserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/armarserver/_default.cfg @@ -174,7 +174,7 @@ servercfgfullpath="${servercfgdir}/${servercfg}" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" lgsmlog="${lgsmlogdir}/${selfname}-script.log" diff --git a/lgsm/config-default/config-lgsm/atsserver/_default.cfg b/lgsm/config-default/config-lgsm/atsserver/_default.cfg index a77e230ce3..3274e757e2 100644 --- a/lgsm/config-default/config-lgsm/atsserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/atsserver/_default.cfg @@ -166,7 +166,7 @@ servercfgfullpath="${servercfgdir}/${servercfg}" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" lgsmlog="${lgsmlogdir}/${selfname}-script.log" diff --git a/lgsm/config-default/config-lgsm/avserver/_default.cfg b/lgsm/config-default/config-lgsm/avserver/_default.cfg index e22333aacf..991b13c022 100644 --- a/lgsm/config-default/config-lgsm/avserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/avserver/_default.cfg @@ -168,7 +168,7 @@ servercfgfullpath="${servercfgdir}/${servercfg}" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${systemdir}/ServerLogs" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" diff --git a/lgsm/config-default/config-lgsm/bb2server/_default.cfg b/lgsm/config-default/config-lgsm/bb2server/_default.cfg index 6557890a1e..396893061b 100644 --- a/lgsm/config-default/config-lgsm/bb2server/_default.cfg +++ b/lgsm/config-default/config-lgsm/bb2server/_default.cfg @@ -179,7 +179,7 @@ servercfgfullpath="${servercfgdir}/${servercfg}" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${systemdir}/logs" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" diff --git a/lgsm/config-default/config-lgsm/bbserver/_default.cfg b/lgsm/config-default/config-lgsm/bbserver/_default.cfg index ad283e5aa4..32621c7be5 100644 --- a/lgsm/config-default/config-lgsm/bbserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/bbserver/_default.cfg @@ -174,7 +174,7 @@ servercfgfullpath="${servercfgdir}/${servercfg}" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${systemdir}/logs" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" diff --git a/lgsm/config-default/config-lgsm/bdserver/_default.cfg b/lgsm/config-default/config-lgsm/bdserver/_default.cfg index 07d5465d02..23bf711968 100644 --- a/lgsm/config-default/config-lgsm/bdserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/bdserver/_default.cfg @@ -173,7 +173,7 @@ servercfgfullpath="${servercfgdir}/${servercfg}" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${systemdir}/logs" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" diff --git a/lgsm/config-default/config-lgsm/bf1942server/_default.cfg b/lgsm/config-default/config-lgsm/bf1942server/_default.cfg index 4d2651a9ac..8cbcd35a1e 100644 --- a/lgsm/config-default/config-lgsm/bf1942server/_default.cfg +++ b/lgsm/config-default/config-lgsm/bf1942server/_default.cfg @@ -156,7 +156,7 @@ servercfgfullpath="${servercfgdir}/${servercfg}" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${serverfiles}/Logs" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" diff --git a/lgsm/config-default/config-lgsm/bfvserver/_default.cfg b/lgsm/config-default/config-lgsm/bfvserver/_default.cfg index 1b3b70c58f..2c56721068 100644 --- a/lgsm/config-default/config-lgsm/bfvserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/bfvserver/_default.cfg @@ -156,7 +156,7 @@ servercfgfullpath="${servercfgdir}/${servercfg}" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${serverfiles}/mods/bfvietnam/logs" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" diff --git a/lgsm/config-default/config-lgsm/bmdmserver/_default.cfg b/lgsm/config-default/config-lgsm/bmdmserver/_default.cfg index 5d13c758c7..659e1abd79 100644 --- a/lgsm/config-default/config-lgsm/bmdmserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/bmdmserver/_default.cfg @@ -179,7 +179,7 @@ servercfgfullpath="${servercfgdir}/${servercfg}" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${systemdir}/logs" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" diff --git a/lgsm/config-default/config-lgsm/boserver/_default.cfg b/lgsm/config-default/config-lgsm/boserver/_default.cfg index 0cea5eb309..a56292a3a1 100644 --- a/lgsm/config-default/config-lgsm/boserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/boserver/_default.cfg @@ -171,7 +171,7 @@ servercfgfullpath="${servercfgdir}/${servercfg}" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${systemdir}/logs" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" diff --git a/lgsm/config-default/config-lgsm/bsserver/_default.cfg b/lgsm/config-default/config-lgsm/bsserver/_default.cfg index 45f931aa40..503cde7b52 100644 --- a/lgsm/config-default/config-lgsm/bsserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/bsserver/_default.cfg @@ -183,7 +183,7 @@ servercfgfullpath="${servercfgdir}/${servercfg}" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${systemdir}/logs" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" diff --git a/lgsm/config-default/config-lgsm/btlserver/_default.cfg b/lgsm/config-default/config-lgsm/btlserver/_default.cfg index 867beba4bb..f1e7449729 100644 --- a/lgsm/config-default/config-lgsm/btlserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/btlserver/_default.cfg @@ -171,7 +171,7 @@ servercfgfullpath="${servercfgdir}/${servercfg}" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${systemdir}/Saved/Logs" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" diff --git a/lgsm/config-default/config-lgsm/btserver/_default.cfg b/lgsm/config-default/config-lgsm/btserver/_default.cfg index 37c257154d..8c32ee2d4d 100644 --- a/lgsm/config-default/config-lgsm/btserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/btserver/_default.cfg @@ -166,7 +166,7 @@ servercfgfullpath="${servercfgdir}/${servercfg}" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${systemdir}/ServerLogs" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" diff --git a/lgsm/config-default/config-lgsm/ccserver/_default.cfg b/lgsm/config-default/config-lgsm/ccserver/_default.cfg index 5a80c2ca52..3aaa47dca6 100644 --- a/lgsm/config-default/config-lgsm/ccserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/ccserver/_default.cfg @@ -174,7 +174,7 @@ servercfgfullpath="${servercfgdir}/${servercfg}" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${systemdir}/logs" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" diff --git a/lgsm/config-default/config-lgsm/cdserver/_default.cfg b/lgsm/config-default/config-lgsm/cdserver/_default.cfg index bf490c78a8..419eb5e3d3 100644 --- a/lgsm/config-default/config-lgsm/cdserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/cdserver/_default.cfg @@ -166,7 +166,7 @@ servercfgfullpath="${servercfgdir}/${servercfg}" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${systemdir}/logs" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" diff --git a/lgsm/config-default/config-lgsm/ckserver/_default.cfg b/lgsm/config-default/config-lgsm/ckserver/_default.cfg index 3659bae6c1..ed81e41132 100644 --- a/lgsm/config-default/config-lgsm/ckserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/ckserver/_default.cfg @@ -170,7 +170,7 @@ servercfgfullpath="${servercfgdir}/${servercfg}" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${serverfiles}/logs" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" diff --git a/lgsm/config-default/config-lgsm/cmwserver/_default.cfg b/lgsm/config-default/config-lgsm/cmwserver/_default.cfg index 964185444b..a03f04dd22 100644 --- a/lgsm/config-default/config-lgsm/cmwserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/cmwserver/_default.cfg @@ -172,7 +172,7 @@ servercfgfullpath="${servercfgdir}/${servercfg}" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${systemdir}/Saved/Logs" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" diff --git a/lgsm/config-default/config-lgsm/cod2server/_default.cfg b/lgsm/config-default/config-lgsm/cod2server/_default.cfg index 64990c12e6..e27276e2f7 100644 --- a/lgsm/config-default/config-lgsm/cod2server/_default.cfg +++ b/lgsm/config-default/config-lgsm/cod2server/_default.cfg @@ -159,7 +159,7 @@ servercfgfullpath="${servercfgdir}/${servercfg}" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${serverfiles}/Logs" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" diff --git a/lgsm/config-default/config-lgsm/cod4server/_default.cfg b/lgsm/config-default/config-lgsm/cod4server/_default.cfg index f73a2a1e3d..fb46bcec65 100644 --- a/lgsm/config-default/config-lgsm/cod4server/_default.cfg +++ b/lgsm/config-default/config-lgsm/cod4server/_default.cfg @@ -159,7 +159,7 @@ servercfgfullpath="${servercfgdir}/${servercfg}" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${serverfiles}/Logs" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" diff --git a/lgsm/config-default/config-lgsm/codserver/_default.cfg b/lgsm/config-default/config-lgsm/codserver/_default.cfg index 4650e35adb..89631a67d6 100644 --- a/lgsm/config-default/config-lgsm/codserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/codserver/_default.cfg @@ -159,7 +159,7 @@ servercfgfullpath="${servercfgdir}/${servercfg}" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${serverfiles}/Logs" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" diff --git a/lgsm/config-default/config-lgsm/coduoserver/_default.cfg b/lgsm/config-default/config-lgsm/coduoserver/_default.cfg index 47304668f9..2c26a36bb4 100644 --- a/lgsm/config-default/config-lgsm/coduoserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/coduoserver/_default.cfg @@ -159,7 +159,7 @@ servercfgfullpath="${servercfgdir}/${servercfg}" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${serverfiles}/Logs" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" diff --git a/lgsm/config-default/config-lgsm/codwawserver/_default.cfg b/lgsm/config-default/config-lgsm/codwawserver/_default.cfg index bd0ed995a6..2943f832d2 100644 --- a/lgsm/config-default/config-lgsm/codwawserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/codwawserver/_default.cfg @@ -159,7 +159,7 @@ servercfgfullpath="${servercfgdir}/${servercfg}" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${serverfiles}/Logs" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" diff --git a/lgsm/config-default/config-lgsm/colserver/_default.cfg b/lgsm/config-default/config-lgsm/colserver/_default.cfg index a1cffc5c98..14a0c93b2b 100644 --- a/lgsm/config-default/config-lgsm/colserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/colserver/_default.cfg @@ -167,7 +167,7 @@ servercfgfullpath="${servercfgdir}/${servercfg}" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${serverfiles}/gamedata/logs/server/" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" diff --git a/lgsm/config-default/config-lgsm/csczserver/_default.cfg b/lgsm/config-default/config-lgsm/csczserver/_default.cfg index 7104cf096d..c8996acd79 100644 --- a/lgsm/config-default/config-lgsm/csczserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/csczserver/_default.cfg @@ -174,7 +174,7 @@ servercfgfullpath="${servercfgdir}/${servercfg}" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${systemdir}/logs" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" diff --git a/lgsm/config-default/config-lgsm/csgoserver/_default.cfg b/lgsm/config-default/config-lgsm/csgoserver/_default.cfg index dd83b4996d..e030a98961 100644 --- a/lgsm/config-default/config-lgsm/csgoserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/csgoserver/_default.cfg @@ -210,7 +210,7 @@ servercfgfullpath="${servercfgdir}/${servercfg}" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${systemdir}/logs" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" diff --git a/lgsm/config-default/config-lgsm/csserver/_default.cfg b/lgsm/config-default/config-lgsm/csserver/_default.cfg index a1f47e9740..d81af84dc7 100644 --- a/lgsm/config-default/config-lgsm/csserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/csserver/_default.cfg @@ -174,7 +174,7 @@ servercfgfullpath="${servercfgdir}/${servercfg}" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${systemdir}/logs" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" diff --git a/lgsm/config-default/config-lgsm/cssserver/_default.cfg b/lgsm/config-default/config-lgsm/cssserver/_default.cfg index b84ed1d3c2..018842405a 100644 --- a/lgsm/config-default/config-lgsm/cssserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/cssserver/_default.cfg @@ -179,7 +179,7 @@ servercfgfullpath="${servercfgdir}/${servercfg}" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${systemdir}/logs" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" diff --git a/lgsm/config-default/config-lgsm/ctserver/_default.cfg b/lgsm/config-default/config-lgsm/ctserver/_default.cfg index 9bef1f2ecc..205c4e8c22 100644 --- a/lgsm/config-default/config-lgsm/ctserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/ctserver/_default.cfg @@ -166,7 +166,7 @@ servercfgfullpath="${servercfgdir}/${servercfg}" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" #gamelogdir="${serverfiles}" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" diff --git a/lgsm/config-default/config-lgsm/dabserver/_default.cfg b/lgsm/config-default/config-lgsm/dabserver/_default.cfg index 450c2e7e0c..002ed20331 100644 --- a/lgsm/config-default/config-lgsm/dabserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/dabserver/_default.cfg @@ -174,7 +174,7 @@ servercfgfullpath="${servercfgdir}/${servercfg}" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${systemdir}/logs" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" diff --git a/lgsm/config-default/config-lgsm/dayzserver/_default.cfg b/lgsm/config-default/config-lgsm/dayzserver/_default.cfg index 57ee4fb4de..8ec58f0695 100644 --- a/lgsm/config-default/config-lgsm/dayzserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/dayzserver/_default.cfg @@ -185,7 +185,7 @@ servercfgfullpath="${servercfgdir}/${servercfg}" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" lgsmlog="${lgsmlogdir}/${selfname}-script.log" diff --git a/lgsm/config-default/config-lgsm/dmcserver/_default.cfg b/lgsm/config-default/config-lgsm/dmcserver/_default.cfg index 8e734fe963..5ea5c1352c 100644 --- a/lgsm/config-default/config-lgsm/dmcserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/dmcserver/_default.cfg @@ -174,7 +174,7 @@ servercfgfullpath="${servercfgdir}/${servercfg}" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${systemdir}/logs" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" diff --git a/lgsm/config-default/config-lgsm/dodrserver/_default.cfg b/lgsm/config-default/config-lgsm/dodrserver/_default.cfg index b176fc6373..cae228a0c7 100644 --- a/lgsm/config-default/config-lgsm/dodrserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/dodrserver/_default.cfg @@ -172,7 +172,7 @@ servercfgfullpath="${servercfgdir}/${servercfg}" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${systemdir}/Saved/Logs" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" diff --git a/lgsm/config-default/config-lgsm/dodserver/_default.cfg b/lgsm/config-default/config-lgsm/dodserver/_default.cfg index 45e6b84499..7bd86724b3 100644 --- a/lgsm/config-default/config-lgsm/dodserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/dodserver/_default.cfg @@ -174,7 +174,7 @@ servercfgfullpath="${servercfgdir}/${servercfg}" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${systemdir}/logs" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" diff --git a/lgsm/config-default/config-lgsm/dodsserver/_default.cfg b/lgsm/config-default/config-lgsm/dodsserver/_default.cfg index 83be0acb89..af4a32dc22 100644 --- a/lgsm/config-default/config-lgsm/dodsserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/dodsserver/_default.cfg @@ -174,7 +174,7 @@ servercfgfullpath="${servercfgdir}/${servercfg}" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${systemdir}/logs" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" diff --git a/lgsm/config-default/config-lgsm/doiserver/_default.cfg b/lgsm/config-default/config-lgsm/doiserver/_default.cfg index 2a1ce62bc9..1c99abaa7e 100644 --- a/lgsm/config-default/config-lgsm/doiserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/doiserver/_default.cfg @@ -175,7 +175,7 @@ servercfgfullpath="${servercfgdir}/${servercfg}" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${systemdir}/logs" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" diff --git a/lgsm/config-default/config-lgsm/dstserver/_default.cfg b/lgsm/config-default/config-lgsm/dstserver/_default.cfg index b5b2f50c9f..7063274603 100644 --- a/lgsm/config-default/config-lgsm/dstserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/dstserver/_default.cfg @@ -181,7 +181,7 @@ servercfgfullpath="${servercfgdir}/${servercfg}" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${systemdir}/logs" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" diff --git a/lgsm/config-default/config-lgsm/dysserver/_default.cfg b/lgsm/config-default/config-lgsm/dysserver/_default.cfg index f567dab6e5..96d12d6770 100644 --- a/lgsm/config-default/config-lgsm/dysserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/dysserver/_default.cfg @@ -179,7 +179,7 @@ servercfgfullpath="${servercfgdir}/${servercfg}" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${systemdir}/logs" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" diff --git a/lgsm/config-default/config-lgsm/ecoserver/_default.cfg b/lgsm/config-default/config-lgsm/ecoserver/_default.cfg index 174ef357c2..475edb4baf 100644 --- a/lgsm/config-default/config-lgsm/ecoserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/ecoserver/_default.cfg @@ -166,7 +166,7 @@ servercfgfullpath="${servercfgdir}/${servercfg}" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${logdir}/server" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" diff --git a/lgsm/config-default/config-lgsm/emserver/_default.cfg b/lgsm/config-default/config-lgsm/emserver/_default.cfg index 8181f7f1ed..8f935152fc 100644 --- a/lgsm/config-default/config-lgsm/emserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/emserver/_default.cfg @@ -179,7 +179,7 @@ servercfgfullpath="${servercfgdir}/${servercfg}" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${systemdir}/logs" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" diff --git a/lgsm/config-default/config-lgsm/etlserver/_default.cfg b/lgsm/config-default/config-lgsm/etlserver/_default.cfg index e36ab3581a..c0c97cd2a3 100644 --- a/lgsm/config-default/config-lgsm/etlserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/etlserver/_default.cfg @@ -153,7 +153,7 @@ servercfgfullpath="${servercfgdir}/${servercfg}" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${serverfiles}/Logs" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" diff --git a/lgsm/config-default/config-lgsm/ets2server/_default.cfg b/lgsm/config-default/config-lgsm/ets2server/_default.cfg index 4edca5194a..a18d6ca79e 100644 --- a/lgsm/config-default/config-lgsm/ets2server/_default.cfg +++ b/lgsm/config-default/config-lgsm/ets2server/_default.cfg @@ -166,7 +166,7 @@ servercfgfullpath="${servercfgdir}/${servercfg}" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" lgsmlog="${lgsmlogdir}/${selfname}-script.log" diff --git a/lgsm/config-default/config-lgsm/fctrserver/_default.cfg b/lgsm/config-default/config-lgsm/fctrserver/_default.cfg index c58ee27893..9fe1b36ce7 100644 --- a/lgsm/config-default/config-lgsm/fctrserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/fctrserver/_default.cfg @@ -164,7 +164,7 @@ servercfgfullpath="${servercfgdir}/${servercfg}" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${serverfiles}" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" diff --git a/lgsm/config-default/config-lgsm/fofserver/_default.cfg b/lgsm/config-default/config-lgsm/fofserver/_default.cfg index 623900384c..f85822d30b 100644 --- a/lgsm/config-default/config-lgsm/fofserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/fofserver/_default.cfg @@ -174,7 +174,7 @@ servercfgfullpath="${servercfgdir}/${servercfg}" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${systemdir}/logs" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" diff --git a/lgsm/config-default/config-lgsm/gmodserver/_default.cfg b/lgsm/config-default/config-lgsm/gmodserver/_default.cfg index aad52e8024..31a6ceedf4 100644 --- a/lgsm/config-default/config-lgsm/gmodserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/gmodserver/_default.cfg @@ -187,7 +187,7 @@ servercfgfullpath="${servercfgdir}/${servercfg}" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${systemdir}/logs" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" diff --git a/lgsm/config-default/config-lgsm/hcuserver/_default.cfg b/lgsm/config-default/config-lgsm/hcuserver/_default.cfg index 7ab893f527..b53af15d38 100644 --- a/lgsm/config-default/config-lgsm/hcuserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/hcuserver/_default.cfg @@ -181,7 +181,7 @@ servercfgfullpath="${servercfgdir}/${servercfg}" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${systemdir}/Saved/Logs" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" diff --git a/lgsm/config-default/config-lgsm/hl2dmserver/_default.cfg b/lgsm/config-default/config-lgsm/hl2dmserver/_default.cfg index 4763fc4237..74a75fc218 100644 --- a/lgsm/config-default/config-lgsm/hl2dmserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/hl2dmserver/_default.cfg @@ -174,7 +174,7 @@ servercfgfullpath="${servercfgdir}/${servercfg}" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${systemdir}/logs" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" diff --git a/lgsm/config-default/config-lgsm/hldmserver/_default.cfg b/lgsm/config-default/config-lgsm/hldmserver/_default.cfg index f8d3887aea..c94297f1fd 100644 --- a/lgsm/config-default/config-lgsm/hldmserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/hldmserver/_default.cfg @@ -173,7 +173,7 @@ servercfgfullpath="${servercfgdir}/${servercfg}" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${systemdir}/logs" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" diff --git a/lgsm/config-default/config-lgsm/hldmsserver/_default.cfg b/lgsm/config-default/config-lgsm/hldmsserver/_default.cfg index 2e4f061e40..32d5fe7910 100644 --- a/lgsm/config-default/config-lgsm/hldmsserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/hldmsserver/_default.cfg @@ -174,7 +174,7 @@ servercfgfullpath="${servercfgdir}/${servercfg}" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${systemdir}/logs" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" diff --git a/lgsm/config-default/config-lgsm/hwserver/_default.cfg b/lgsm/config-default/config-lgsm/hwserver/_default.cfg index fddcfebfa5..3bf524f168 100644 --- a/lgsm/config-default/config-lgsm/hwserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/hwserver/_default.cfg @@ -180,7 +180,7 @@ executable="./Hurtworld.x86_64" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${logdir}/server" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" diff --git a/lgsm/config-default/config-lgsm/insserver/_default.cfg b/lgsm/config-default/config-lgsm/insserver/_default.cfg index d6d65d863b..8b6b599f34 100644 --- a/lgsm/config-default/config-lgsm/insserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/insserver/_default.cfg @@ -180,7 +180,7 @@ servercfgfullpath="${servercfgdir}/${servercfg}" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${systemdir}/logs" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" diff --git a/lgsm/config-default/config-lgsm/inssserver/_default.cfg b/lgsm/config-default/config-lgsm/inssserver/_default.cfg index eb26d92117..b08460b29a 100644 --- a/lgsm/config-default/config-lgsm/inssserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/inssserver/_default.cfg @@ -177,7 +177,7 @@ servercfgdefault="Game.ini" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${systemdir}/Saved/Logs" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" diff --git a/lgsm/config-default/config-lgsm/iosserver/_default.cfg b/lgsm/config-default/config-lgsm/iosserver/_default.cfg index d587e37192..48c5511c7e 100644 --- a/lgsm/config-default/config-lgsm/iosserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/iosserver/_default.cfg @@ -174,7 +174,7 @@ servercfgfullpath="${servercfgdir}/${servercfg}" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${systemdir}/logs" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" diff --git a/lgsm/config-default/config-lgsm/jc2server/_default.cfg b/lgsm/config-default/config-lgsm/jc2server/_default.cfg index 6c36a7f69f..0610507d6b 100644 --- a/lgsm/config-default/config-lgsm/jc2server/_default.cfg +++ b/lgsm/config-default/config-lgsm/jc2server/_default.cfg @@ -166,7 +166,7 @@ servercfgfullpath="${servercfgdir}/${servercfg}" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" #gamelogdir="" # No server logs available lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" diff --git a/lgsm/config-default/config-lgsm/jc3server/_default.cfg b/lgsm/config-default/config-lgsm/jc3server/_default.cfg index 98ff2a09f9..c2cac1cfee 100644 --- a/lgsm/config-default/config-lgsm/jc3server/_default.cfg +++ b/lgsm/config-default/config-lgsm/jc3server/_default.cfg @@ -166,7 +166,7 @@ servercfgfullpath="${servercfgdir}/${servercfg}" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" lgsmlog="${lgsmlogdir}/${selfname}-script.log" diff --git a/lgsm/config-default/config-lgsm/jk2server/_default.cfg b/lgsm/config-default/config-lgsm/jk2server/_default.cfg index 0675729e48..5b7f6b8933 100644 --- a/lgsm/config-default/config-lgsm/jk2server/_default.cfg +++ b/lgsm/config-default/config-lgsm/jk2server/_default.cfg @@ -175,7 +175,7 @@ servercfgfullpath="${servercfgdir}/${servercfg}" backupdir="${lgsmdir}/backups" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${systemdir}/logs" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" diff --git a/lgsm/config-default/config-lgsm/kf2server/_default.cfg b/lgsm/config-default/config-lgsm/kf2server/_default.cfg index a52dcfb1d5..6d71d63514 100644 --- a/lgsm/config-default/config-lgsm/kf2server/_default.cfg +++ b/lgsm/config-default/config-lgsm/kf2server/_default.cfg @@ -172,7 +172,7 @@ servercfgfullpath="${servercfgdir}/${servercfg}" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${systemdir}/Saved/Logs" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" diff --git a/lgsm/config-default/config-lgsm/kfserver/_default.cfg b/lgsm/config-default/config-lgsm/kfserver/_default.cfg index f03d7da05a..362dfa54fa 100644 --- a/lgsm/config-default/config-lgsm/kfserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/kfserver/_default.cfg @@ -179,7 +179,7 @@ compressedmapsdir="${rootdir}/Maps-Compressed" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${logdir}/server" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" diff --git a/lgsm/config-default/config-lgsm/l4d2server/_default.cfg b/lgsm/config-default/config-lgsm/l4d2server/_default.cfg index 3ef547c22a..4a04cac2ce 100644 --- a/lgsm/config-default/config-lgsm/l4d2server/_default.cfg +++ b/lgsm/config-default/config-lgsm/l4d2server/_default.cfg @@ -173,7 +173,7 @@ servercfgfullpath="${servercfgdir}/${servercfg}" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${systemdir}/logs" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" diff --git a/lgsm/config-default/config-lgsm/l4dserver/_default.cfg b/lgsm/config-default/config-lgsm/l4dserver/_default.cfg index c0cbd2452b..9447b28236 100644 --- a/lgsm/config-default/config-lgsm/l4dserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/l4dserver/_default.cfg @@ -173,7 +173,7 @@ servercfgfullpath="${servercfgdir}/${servercfg}" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${systemdir}/logs" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" diff --git a/lgsm/config-default/config-lgsm/loserver/_default.cfg b/lgsm/config-default/config-lgsm/loserver/_default.cfg index d4056faf94..7df8a8f3d2 100644 --- a/lgsm/config-default/config-lgsm/loserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/loserver/_default.cfg @@ -177,7 +177,7 @@ servercfgfullpath="${servercfgdir}/${servercfg}" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${systemdir}/Saved/Logs" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" diff --git a/lgsm/config-default/config-lgsm/mcbserver/_default.cfg b/lgsm/config-default/config-lgsm/mcbserver/_default.cfg index f8fddf0c0d..8ffc45667e 100644 --- a/lgsm/config-default/config-lgsm/mcbserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/mcbserver/_default.cfg @@ -159,7 +159,7 @@ servercfgfullpath="${servercfgdir}/${servercfg}" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${systemdir}" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" diff --git a/lgsm/config-default/config-lgsm/mcserver/_default.cfg b/lgsm/config-default/config-lgsm/mcserver/_default.cfg index c12265f9ff..269e96f8b3 100644 --- a/lgsm/config-default/config-lgsm/mcserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/mcserver/_default.cfg @@ -166,7 +166,7 @@ servercfgfullpath="${servercfgdir}/${servercfg}" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${systemdir}/logs" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" diff --git a/lgsm/config-default/config-lgsm/mhserver/_default.cfg b/lgsm/config-default/config-lgsm/mhserver/_default.cfg index 04fa3e060a..8a9b2331ec 100644 --- a/lgsm/config-default/config-lgsm/mhserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/mhserver/_default.cfg @@ -174,7 +174,7 @@ servercfgfullpath="${servercfgdir}/${servercfg}" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${systemdir}/Saved/Logs" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" diff --git a/lgsm/config-default/config-lgsm/mohaaserver/_default.cfg b/lgsm/config-default/config-lgsm/mohaaserver/_default.cfg index ad4717e9f4..490767e4ad 100644 --- a/lgsm/config-default/config-lgsm/mohaaserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/mohaaserver/_default.cfg @@ -158,7 +158,7 @@ servercfgfullpath="${servercfgdir}/${servercfg}" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${serverfiles}/Logs" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" diff --git a/lgsm/config-default/config-lgsm/momserver/_default.cfg b/lgsm/config-default/config-lgsm/momserver/_default.cfg index 05787a4bd2..3219ae662f 100644 --- a/lgsm/config-default/config-lgsm/momserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/momserver/_default.cfg @@ -171,7 +171,7 @@ servercfgfullpath="${servercfgdir}/${servercfg}" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${serverfiles}/Game/Saved/Logs" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" diff --git a/lgsm/config-default/config-lgsm/mtaserver/_default.cfg b/lgsm/config-default/config-lgsm/mtaserver/_default.cfg index c001c7bf1d..5ab7c32832 100644 --- a/lgsm/config-default/config-lgsm/mtaserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/mtaserver/_default.cfg @@ -158,7 +158,7 @@ servercfgfullpath="${servercfgdir}/${servercfg}" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${serverfiles}/mods/deathmatch/logs" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" diff --git a/lgsm/config-default/config-lgsm/ndserver/_default.cfg b/lgsm/config-default/config-lgsm/ndserver/_default.cfg index 935659c83e..30ee62109f 100644 --- a/lgsm/config-default/config-lgsm/ndserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/ndserver/_default.cfg @@ -174,7 +174,7 @@ servercfgfullpath="${servercfgdir}/${servercfg}" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${systemdir}/logs" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" diff --git a/lgsm/config-default/config-lgsm/necserver/_default.cfg b/lgsm/config-default/config-lgsm/necserver/_default.cfg index a64c8792c6..30290acb56 100644 --- a/lgsm/config-default/config-lgsm/necserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/necserver/_default.cfg @@ -169,7 +169,7 @@ servercfgfullpath="${servercfgdir}/${servercfg}" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${systemdir}/logs" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" diff --git a/lgsm/config-default/config-lgsm/nmrihserver/_default.cfg b/lgsm/config-default/config-lgsm/nmrihserver/_default.cfg index 241e535f46..d3dfa30d3e 100644 --- a/lgsm/config-default/config-lgsm/nmrihserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/nmrihserver/_default.cfg @@ -179,7 +179,7 @@ servercfgfullpath="${servercfgdir}/${servercfg}" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${systemdir}/logs" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" diff --git a/lgsm/config-default/config-lgsm/ns2cserver/_default.cfg b/lgsm/config-default/config-lgsm/ns2cserver/_default.cfg index c1a6251b3a..ce44d932d0 100644 --- a/lgsm/config-default/config-lgsm/ns2cserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/ns2cserver/_default.cfg @@ -179,7 +179,7 @@ modstoragedir="${servercfgdir}/Workshop" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${systemdir}/logs" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" diff --git a/lgsm/config-default/config-lgsm/ns2server/_default.cfg b/lgsm/config-default/config-lgsm/ns2server/_default.cfg index e41efe7d26..fdb0252f15 100644 --- a/lgsm/config-default/config-lgsm/ns2server/_default.cfg +++ b/lgsm/config-default/config-lgsm/ns2server/_default.cfg @@ -179,7 +179,7 @@ modstoragedir="${servercfgdir}/Workshop" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${systemdir}/logs" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" diff --git a/lgsm/config-default/config-lgsm/nsserver/_default.cfg b/lgsm/config-default/config-lgsm/nsserver/_default.cfg index 5a63b2edff..44faa5b953 100644 --- a/lgsm/config-default/config-lgsm/nsserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/nsserver/_default.cfg @@ -174,7 +174,7 @@ servercfgfullpath="${servercfgdir}/${servercfg}" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${systemdir}/logs" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" diff --git a/lgsm/config-default/config-lgsm/ohdserver/_default.cfg b/lgsm/config-default/config-lgsm/ohdserver/_default.cfg index 4e855eb819..651ad4f4cc 100644 --- a/lgsm/config-default/config-lgsm/ohdserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/ohdserver/_default.cfg @@ -176,7 +176,7 @@ servercfgfullpath="${servercfgdir}/${servercfg}" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${systemdir}/Saved/Logs" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" diff --git a/lgsm/config-default/config-lgsm/onsetserver/_default.cfg b/lgsm/config-default/config-lgsm/onsetserver/_default.cfg index 2c270bfc5e..ffbcabdc33 100644 --- a/lgsm/config-default/config-lgsm/onsetserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/onsetserver/_default.cfg @@ -166,7 +166,7 @@ servercfgfullpath="${servercfgdir}/${servercfg}" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${systemdir}/logs" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" diff --git a/lgsm/config-default/config-lgsm/opforserver/_default.cfg b/lgsm/config-default/config-lgsm/opforserver/_default.cfg index 691c69b3a6..c04666dfde 100644 --- a/lgsm/config-default/config-lgsm/opforserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/opforserver/_default.cfg @@ -174,7 +174,7 @@ servercfgfullpath="${servercfgdir}/${servercfg}" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${systemdir}/logs" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" diff --git a/lgsm/config-default/config-lgsm/pc2server/_default.cfg b/lgsm/config-default/config-lgsm/pc2server/_default.cfg index 0bf55aa53d..37efdd8245 100644 --- a/lgsm/config-default/config-lgsm/pc2server/_default.cfg +++ b/lgsm/config-default/config-lgsm/pc2server/_default.cfg @@ -170,7 +170,7 @@ servercfgfullpath="${servercfgdir}/${servercfg}" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${systemdir}/logs" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" diff --git a/lgsm/config-default/config-lgsm/pcserver/_default.cfg b/lgsm/config-default/config-lgsm/pcserver/_default.cfg index 53d9fc2103..e70ce6d261 100644 --- a/lgsm/config-default/config-lgsm/pcserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/pcserver/_default.cfg @@ -166,7 +166,7 @@ servercfgfullpath="${servercfgdir}/${servercfg}" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${systemdir}/logs" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" diff --git a/lgsm/config-default/config-lgsm/pmcserver/_default.cfg b/lgsm/config-default/config-lgsm/pmcserver/_default.cfg index e8f69161ef..984ebb4708 100644 --- a/lgsm/config-default/config-lgsm/pmcserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/pmcserver/_default.cfg @@ -164,7 +164,7 @@ servercfgfullpath="${servercfgdir}/${servercfg}" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${systemdir}/logs" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" diff --git a/lgsm/config-default/config-lgsm/pstbsserver/_default.cfg b/lgsm/config-default/config-lgsm/pstbsserver/_default.cfg index 426574aa6a..513f9e089b 100644 --- a/lgsm/config-default/config-lgsm/pstbsserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/pstbsserver/_default.cfg @@ -175,7 +175,7 @@ servercfgfullpath="${servercfgdir}/${servercfg}" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${systemdir}/Saved/Logs" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" diff --git a/lgsm/config-default/config-lgsm/pvkiiserver/_default.cfg b/lgsm/config-default/config-lgsm/pvkiiserver/_default.cfg index 6cb271de05..e3e96a8ff7 100644 --- a/lgsm/config-default/config-lgsm/pvkiiserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/pvkiiserver/_default.cfg @@ -174,7 +174,7 @@ servercfgfullpath="${servercfgdir}/${servercfg}" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${systemdir}/logs" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" diff --git a/lgsm/config-default/config-lgsm/pvrserver/_default.cfg b/lgsm/config-default/config-lgsm/pvrserver/_default.cfg index 8d27cf08c6..53f0bdd03a 100644 --- a/lgsm/config-default/config-lgsm/pvrserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/pvrserver/_default.cfg @@ -173,7 +173,7 @@ servercfgfullpath="${servercfgdir}/${servercfg}" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${systemdir}/Saved/Logs" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" diff --git a/lgsm/config-default/config-lgsm/pzserver/_default.cfg b/lgsm/config-default/config-lgsm/pzserver/_default.cfg index 55c3f587b7..b103eb772a 100644 --- a/lgsm/config-default/config-lgsm/pzserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/pzserver/_default.cfg @@ -171,7 +171,7 @@ servercfgfullpath="${servercfgdir}/${servercfg}" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${HOME}/Zomboid/Logs" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" diff --git a/lgsm/config-default/config-lgsm/q2server/_default.cfg b/lgsm/config-default/config-lgsm/q2server/_default.cfg index 526e27854c..aa07f21b72 100644 --- a/lgsm/config-default/config-lgsm/q2server/_default.cfg +++ b/lgsm/config-default/config-lgsm/q2server/_default.cfg @@ -158,7 +158,7 @@ servercfgfullpath="${servercfgdir}/${servercfg}" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${serverfiles}/Logs" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" diff --git a/lgsm/config-default/config-lgsm/q3server/_default.cfg b/lgsm/config-default/config-lgsm/q3server/_default.cfg index d8fda33d76..eacb870494 100644 --- a/lgsm/config-default/config-lgsm/q3server/_default.cfg +++ b/lgsm/config-default/config-lgsm/q3server/_default.cfg @@ -158,7 +158,7 @@ servercfgfullpath="${servercfgdir}/${servercfg}" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${serverfiles}/Logs" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" diff --git a/lgsm/config-default/config-lgsm/qlserver/_default.cfg b/lgsm/config-default/config-lgsm/qlserver/_default.cfg index 5b1444ed96..f6b5342e0d 100644 --- a/lgsm/config-default/config-lgsm/qlserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/qlserver/_default.cfg @@ -166,7 +166,7 @@ servercfgfullpath="${servercfgdir}/${servercfg}" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${logdir}/server" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" diff --git a/lgsm/config-default/config-lgsm/qwserver/_default.cfg b/lgsm/config-default/config-lgsm/qwserver/_default.cfg index 1e9482c8cc..5f62888795 100644 --- a/lgsm/config-default/config-lgsm/qwserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/qwserver/_default.cfg @@ -157,7 +157,7 @@ servercfgfullpath="${servercfgdir}/${servercfg}" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${systemdir}/logs" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" diff --git a/lgsm/config-default/config-lgsm/ricochetserver/_default.cfg b/lgsm/config-default/config-lgsm/ricochetserver/_default.cfg index 231ab423aa..b1bb3e7943 100644 --- a/lgsm/config-default/config-lgsm/ricochetserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/ricochetserver/_default.cfg @@ -174,7 +174,7 @@ servercfgfullpath="${servercfgdir}/${servercfg}" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${systemdir}/logs" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" diff --git a/lgsm/config-default/config-lgsm/roserver/_default.cfg b/lgsm/config-default/config-lgsm/roserver/_default.cfg index 9ee90f5d41..8e4fe21a6e 100644 --- a/lgsm/config-default/config-lgsm/roserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/roserver/_default.cfg @@ -175,7 +175,7 @@ compressedmapsdir="${rootdir}/Maps-Compressed" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${logdir}/server" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" diff --git a/lgsm/config-default/config-lgsm/rtcwserver/_default.cfg b/lgsm/config-default/config-lgsm/rtcwserver/_default.cfg index 3c134592a1..d99061bdb3 100644 --- a/lgsm/config-default/config-lgsm/rtcwserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/rtcwserver/_default.cfg @@ -158,7 +158,7 @@ servercfgfullpath="${servercfgdir}/${servercfg}" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${serverfiles}/Logs" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" diff --git a/lgsm/config-default/config-lgsm/rustserver/_default.cfg b/lgsm/config-default/config-lgsm/rustserver/_default.cfg index 6a679f1680..c405516199 100644 --- a/lgsm/config-default/config-lgsm/rustserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/rustserver/_default.cfg @@ -186,7 +186,7 @@ servercfgfullpath="${servercfgdir}/${servercfg}" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${logdir}/server" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" diff --git a/lgsm/config-default/config-lgsm/rwserver/_default.cfg b/lgsm/config-default/config-lgsm/rwserver/_default.cfg index a31449a05e..3f526c110f 100644 --- a/lgsm/config-default/config-lgsm/rwserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/rwserver/_default.cfg @@ -170,7 +170,7 @@ servercfgfullpath="${servercfgdir}/${servercfg}" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${systemdir}/logs" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" diff --git a/lgsm/config-default/config-lgsm/sampserver/_default.cfg b/lgsm/config-default/config-lgsm/sampserver/_default.cfg index eecc9cce2c..709c9922c4 100644 --- a/lgsm/config-default/config-lgsm/sampserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/sampserver/_default.cfg @@ -157,7 +157,7 @@ servercfgfullpath="${servercfgdir}/${servercfg}" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${serverfiles}/samp03" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" diff --git a/lgsm/config-default/config-lgsm/sbotsserver/_default.cfg b/lgsm/config-default/config-lgsm/sbotsserver/_default.cfg index f48afd3f05..50c2a4e76a 100644 --- a/lgsm/config-default/config-lgsm/sbotsserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/sbotsserver/_default.cfg @@ -172,7 +172,7 @@ servercfgfullpath="${servercfgdir}/${servercfg}" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${serverfiles}/Logs" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" diff --git a/lgsm/config-default/config-lgsm/sbserver/_default.cfg b/lgsm/config-default/config-lgsm/sbserver/_default.cfg index 521500591f..733267b4b5 100644 --- a/lgsm/config-default/config-lgsm/sbserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/sbserver/_default.cfg @@ -173,7 +173,7 @@ servercfgfullpath="${servercfgdir}/${servercfg}" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${serverfiles}/storage" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" diff --git a/lgsm/config-default/config-lgsm/scpslserver/_default.cfg b/lgsm/config-default/config-lgsm/scpslserver/_default.cfg index 3409fe9943..100de02a89 100644 --- a/lgsm/config-default/config-lgsm/scpslserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/scpslserver/_default.cfg @@ -171,7 +171,7 @@ servercfgfullpath="${servercfgdir}/${servercfg}" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${HOME}/.config/SCP Secret Laboratory/LocalAdminLogs/${port}" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" diff --git a/lgsm/config-default/config-lgsm/scpslsmserver/_default.cfg b/lgsm/config-default/config-lgsm/scpslsmserver/_default.cfg index 73d0605c69..1e041e93bf 100644 --- a/lgsm/config-default/config-lgsm/scpslsmserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/scpslsmserver/_default.cfg @@ -171,7 +171,7 @@ servercfgfullpath="${servercfgdir}/${servercfg}" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${HOME}/.config/SCP Secret Laboratory/LocalAdminLogs/${port}" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" diff --git a/lgsm/config-default/config-lgsm/sdtdserver/_default.cfg b/lgsm/config-default/config-lgsm/sdtdserver/_default.cfg index 270e8f84ee..7775f16abd 100644 --- a/lgsm/config-default/config-lgsm/sdtdserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/sdtdserver/_default.cfg @@ -170,7 +170,7 @@ servercfgfullpath="${servercfgdir}/${servercfg}" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${logdir}/server" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" diff --git a/lgsm/config-default/config-lgsm/sfcserver/_default.cfg b/lgsm/config-default/config-lgsm/sfcserver/_default.cfg index 579790be76..f642619932 100644 --- a/lgsm/config-default/config-lgsm/sfcserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/sfcserver/_default.cfg @@ -174,7 +174,7 @@ servercfgfullpath="${servercfgdir}/${servercfg}" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${systemdir}/logs" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" diff --git a/lgsm/config-default/config-lgsm/sfserver/_default.cfg b/lgsm/config-default/config-lgsm/sfserver/_default.cfg index dfe3857c05..bc25dccfa5 100644 --- a/lgsm/config-default/config-lgsm/sfserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/sfserver/_default.cfg @@ -172,7 +172,7 @@ servercfgfullpath="${servercfgdir}/${servercfg}" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${systemdir}/Saved/Logs" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" diff --git a/lgsm/config-default/config-lgsm/sof2server/_default.cfg b/lgsm/config-default/config-lgsm/sof2server/_default.cfg index a0f878e45b..282c8166dc 100644 --- a/lgsm/config-default/config-lgsm/sof2server/_default.cfg +++ b/lgsm/config-default/config-lgsm/sof2server/_default.cfg @@ -158,7 +158,7 @@ servercfgfullpath="${servercfgdir}/${servercfg}" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${serverfiles}/Logs" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" diff --git a/lgsm/config-default/config-lgsm/solserver/_default.cfg b/lgsm/config-default/config-lgsm/solserver/_default.cfg index e6d641b63e..aa8d02d5a3 100644 --- a/lgsm/config-default/config-lgsm/solserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/solserver/_default.cfg @@ -170,7 +170,7 @@ servercfgfullpath="${servercfgdir}/${servercfg}" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${serverfiles}/logs" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" diff --git a/lgsm/config-default/config-lgsm/squadserver/_default.cfg b/lgsm/config-default/config-lgsm/squadserver/_default.cfg index 79240e2bf3..432b5a4023 100644 --- a/lgsm/config-default/config-lgsm/squadserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/squadserver/_default.cfg @@ -171,7 +171,7 @@ servercfgfullpath="${servercfgdir}/${servercfg}" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${systemdir}/Saved/Logs" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" diff --git a/lgsm/config-default/config-lgsm/stnserver/_default.cfg b/lgsm/config-default/config-lgsm/stnserver/_default.cfg index d26cef1279..463e808ed8 100644 --- a/lgsm/config-default/config-lgsm/stnserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/stnserver/_default.cfg @@ -170,7 +170,7 @@ servercfgfullpath="${servercfgdir}/${servercfg}" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${serverfiles}" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" diff --git a/lgsm/config-default/config-lgsm/stserver/_default.cfg b/lgsm/config-default/config-lgsm/stserver/_default.cfg index c06d22a8db..eef67827fa 100644 --- a/lgsm/config-default/config-lgsm/stserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/stserver/_default.cfg @@ -171,7 +171,7 @@ servercfgfullpath="${servercfgdir}/${servercfg}" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${HOME}/.config/unity3d/Rocketwerkz/Stationeers" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" diff --git a/lgsm/config-default/config-lgsm/svenserver/_default.cfg b/lgsm/config-default/config-lgsm/svenserver/_default.cfg index ec164b90b3..309e73d046 100644 --- a/lgsm/config-default/config-lgsm/svenserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/svenserver/_default.cfg @@ -173,7 +173,7 @@ servercfgfullpath="${servercfgdir}/${servercfg}" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${systemdir}/logs" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" diff --git a/lgsm/config-default/config-lgsm/terrariaserver/_default.cfg b/lgsm/config-default/config-lgsm/terrariaserver/_default.cfg index a286b0571b..ea0d549be8 100644 --- a/lgsm/config-default/config-lgsm/terrariaserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/terrariaserver/_default.cfg @@ -173,7 +173,7 @@ servercfgfullpath="${servercfgdir}/${servercfg}" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" #gamelogdir="" # No server logs available lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" diff --git a/lgsm/config-default/config-lgsm/tf2server/_default.cfg b/lgsm/config-default/config-lgsm/tf2server/_default.cfg index 824b6e7e3e..851e803864 100644 --- a/lgsm/config-default/config-lgsm/tf2server/_default.cfg +++ b/lgsm/config-default/config-lgsm/tf2server/_default.cfg @@ -179,7 +179,7 @@ servercfgfullpath="${servercfgdir}/${servercfg}" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${systemdir}/logs" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" diff --git a/lgsm/config-default/config-lgsm/tfcserver/_default.cfg b/lgsm/config-default/config-lgsm/tfcserver/_default.cfg index 968350fd84..c0c09ec66a 100644 --- a/lgsm/config-default/config-lgsm/tfcserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/tfcserver/_default.cfg @@ -174,7 +174,7 @@ servercfgfullpath="${servercfgdir}/${servercfg}" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${systemdir}/logs" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" diff --git a/lgsm/config-default/config-lgsm/tiserver/_default.cfg b/lgsm/config-default/config-lgsm/tiserver/_default.cfg index 652c9430e4..f7a3b69445 100644 --- a/lgsm/config-default/config-lgsm/tiserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/tiserver/_default.cfg @@ -176,7 +176,7 @@ servercfgfullpath="${servercfgdir}/${servercfg}" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${systemdir}/Saved/Logs" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" diff --git a/lgsm/config-default/config-lgsm/ts3server/_default.cfg b/lgsm/config-default/config-lgsm/ts3server/_default.cfg index 963920a6c9..8dff8f7f82 100644 --- a/lgsm/config-default/config-lgsm/ts3server/_default.cfg +++ b/lgsm/config-default/config-lgsm/ts3server/_default.cfg @@ -157,7 +157,7 @@ servercfgfullpath="${servercfgdir}/${servercfg}" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${serverfiles}/logs" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" diff --git a/lgsm/config-default/config-lgsm/tsserver/_default.cfg b/lgsm/config-default/config-lgsm/tsserver/_default.cfg index 1b4ac5bfc3..8eb00e73ad 100644 --- a/lgsm/config-default/config-lgsm/tsserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/tsserver/_default.cfg @@ -174,7 +174,7 @@ servercfgfullpath="${servercfgdir}/${servercfg}" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${systemdir}/logs" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" diff --git a/lgsm/config-default/config-lgsm/tuserver/_default.cfg b/lgsm/config-default/config-lgsm/tuserver/_default.cfg index 8163100627..f627408181 100644 --- a/lgsm/config-default/config-lgsm/tuserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/tuserver/_default.cfg @@ -176,7 +176,7 @@ servercfgfullpath="${servercfgdir}/${servercfg}" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${systemdir}/Saved/Logs" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" diff --git a/lgsm/config-default/config-lgsm/twserver/_default.cfg b/lgsm/config-default/config-lgsm/twserver/_default.cfg index 8c4b326831..13edffe2f5 100644 --- a/lgsm/config-default/config-lgsm/twserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/twserver/_default.cfg @@ -173,7 +173,7 @@ servercfgfullpath="${servercfgdir}/${servercfg}" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${logdir}/server" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" diff --git a/lgsm/config-default/config-lgsm/untserver/_default.cfg b/lgsm/config-default/config-lgsm/untserver/_default.cfg index c3c5b7e140..a7de22b4d8 100644 --- a/lgsm/config-default/config-lgsm/untserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/untserver/_default.cfg @@ -177,7 +177,7 @@ servercfgfullpath="${servercfgdir}/${servercfg}" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${logdir}/server" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" diff --git a/lgsm/config-default/config-lgsm/ut2k4server/_default.cfg b/lgsm/config-default/config-lgsm/ut2k4server/_default.cfg index 0df674dc60..5b0fc6a2bb 100644 --- a/lgsm/config-default/config-lgsm/ut2k4server/_default.cfg +++ b/lgsm/config-default/config-lgsm/ut2k4server/_default.cfg @@ -158,7 +158,7 @@ compressedmapsdir="${rootdir}/Maps-Compressed" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${logdir}/server" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" diff --git a/lgsm/config-default/config-lgsm/ut3server/_default.cfg b/lgsm/config-default/config-lgsm/ut3server/_default.cfg index 62d4833edf..b52bcbfb06 100644 --- a/lgsm/config-default/config-lgsm/ut3server/_default.cfg +++ b/lgsm/config-default/config-lgsm/ut3server/_default.cfg @@ -173,7 +173,7 @@ servercfgfullpath="${servercfgdir}/${servercfg}" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${logdir}/server" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" diff --git a/lgsm/config-default/config-lgsm/ut99server/_default.cfg b/lgsm/config-default/config-lgsm/ut99server/_default.cfg index dede896871..21db8e024b 100644 --- a/lgsm/config-default/config-lgsm/ut99server/_default.cfg +++ b/lgsm/config-default/config-lgsm/ut99server/_default.cfg @@ -158,7 +158,7 @@ compressedmapsdir="${rootdir}/Maps-Compressed" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${serverfiles}/Logs" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" diff --git a/lgsm/config-default/config-lgsm/utserver/_default.cfg b/lgsm/config-default/config-lgsm/utserver/_default.cfg index 3925988405..82b47bf9aa 100644 --- a/lgsm/config-default/config-lgsm/utserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/utserver/_default.cfg @@ -161,7 +161,7 @@ servercfgfullpath="${servercfgdir}/${servercfg}" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${serverfiles}/Logs" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" diff --git a/lgsm/config-default/config-lgsm/vhserver/_default.cfg b/lgsm/config-default/config-lgsm/vhserver/_default.cfg index 93aaa83e66..5fd29f6a7c 100644 --- a/lgsm/config-default/config-lgsm/vhserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/vhserver/_default.cfg @@ -179,7 +179,7 @@ executable="./valheim_server.x86_64" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${systemdir}/Saved/Logs" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" diff --git a/lgsm/config-default/config-lgsm/vintsserver/_default.cfg b/lgsm/config-default/config-lgsm/vintsserver/_default.cfg index a207ecdb7e..b6bd768310 100644 --- a/lgsm/config-default/config-lgsm/vintsserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/vintsserver/_default.cfg @@ -161,7 +161,7 @@ servercfgfullpath="${servercfgdir}/${servercfg}" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${servercfgdir}/Logs" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" diff --git a/lgsm/config-default/config-lgsm/vpmcserver/_default.cfg b/lgsm/config-default/config-lgsm/vpmcserver/_default.cfg index 20b587f323..8a47f056e2 100644 --- a/lgsm/config-default/config-lgsm/vpmcserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/vpmcserver/_default.cfg @@ -165,7 +165,7 @@ servercfgfullpath="${servercfgdir}/${servercfg}" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${systemdir}/logs" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" diff --git a/lgsm/config-default/config-lgsm/vsserver/_default.cfg b/lgsm/config-default/config-lgsm/vsserver/_default.cfg index 94510c334a..e99f063e8a 100644 --- a/lgsm/config-default/config-lgsm/vsserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/vsserver/_default.cfg @@ -174,7 +174,7 @@ servercfgfullpath="${servercfgdir}/${servercfg}" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${systemdir}/logs" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" diff --git a/lgsm/config-default/config-lgsm/wetserver/_default.cfg b/lgsm/config-default/config-lgsm/wetserver/_default.cfg index 994abb5c00..045afb9e0e 100644 --- a/lgsm/config-default/config-lgsm/wetserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/wetserver/_default.cfg @@ -153,7 +153,7 @@ servercfgfullpath="${servercfgdir}/${servercfg}" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${serverfiles}/Logs" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" diff --git a/lgsm/config-default/config-lgsm/wfserver/_default.cfg b/lgsm/config-default/config-lgsm/wfserver/_default.cfg index fc53e641c0..5924cd8af1 100644 --- a/lgsm/config-default/config-lgsm/wfserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/wfserver/_default.cfg @@ -172,7 +172,7 @@ servercfgfullpath="${servercfgdir}/${servercfg}" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${serverfiles}/Logs" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" diff --git a/lgsm/config-default/config-lgsm/wmcserver/_default.cfg b/lgsm/config-default/config-lgsm/wmcserver/_default.cfg index cdf56e71e2..007e5542d2 100644 --- a/lgsm/config-default/config-lgsm/wmcserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/wmcserver/_default.cfg @@ -164,7 +164,7 @@ servercfgfullpath="${servercfgdir}/${servercfg}" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${systemdir}/logs" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" diff --git a/lgsm/config-default/config-lgsm/wurmserver/_default.cfg b/lgsm/config-default/config-lgsm/wurmserver/_default.cfg index 3743e899f5..754fc5922e 100644 --- a/lgsm/config-default/config-lgsm/wurmserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/wurmserver/_default.cfg @@ -169,7 +169,7 @@ source "${servercfgfullpath}" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${serverfiles}/Logs" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" diff --git a/lgsm/config-default/config-lgsm/zmrserver/_default.cfg b/lgsm/config-default/config-lgsm/zmrserver/_default.cfg index c2621b48a4..ad5619dae0 100644 --- a/lgsm/config-default/config-lgsm/zmrserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/zmrserver/_default.cfg @@ -174,7 +174,7 @@ servercfgfullpath="${servercfgdir}/${servercfg}" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${systemdir}/logs" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" diff --git a/lgsm/config-default/config-lgsm/zpsserver/_default.cfg b/lgsm/config-default/config-lgsm/zpsserver/_default.cfg index 777403dfd8..33ad128cbb 100644 --- a/lgsm/config-default/config-lgsm/zpsserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/zpsserver/_default.cfg @@ -179,7 +179,7 @@ servercfgfullpath="${servercfgdir}/${servercfg}" backupdir="${lgsmdir}/backup" ## Logging Directories -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" gamelogdir="${systemdir}/logs" lgsmlogdir="${logdir}/script" consolelogdir="${logdir}/console" diff --git a/lgsm/functions/core_legacy.sh b/lgsm/functions/core_legacy.sh index f9aa514551..1cb77258b8 100644 --- a/lgsm/functions/core_legacy.sh +++ b/lgsm/functions/core_legacy.sh @@ -20,7 +20,7 @@ if [ -z "${serverfiles}" ]; then fi if [ -z "${logdir}" ]; then - logdir="${rootdir}/log" + [ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" fi if [ -z "${lgsmlogdir}" ]; then diff --git a/lgsm/modules/core_legacy.sh b/lgsm/modules/core_legacy.sh index e9e5c9206d..173c893d26 100644 --- a/lgsm/modules/core_legacy.sh +++ b/lgsm/modules/core_legacy.sh @@ -44,7 +44,7 @@ if [ -z "${serverfiles}" ]; then fi if [ -z "${logdir}" ]; then - logdir="${rootdir}/log" + [ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" fi if [ -z "${lgsmlogdir}" ]; then diff --git a/lgsm/modules/info_game.sh b/lgsm/modules/info_game.sh index dfddd52df1..5c948d47c1 100644 --- a/lgsm/modules/info_game.sh +++ b/lgsm/modules/info_game.sh @@ -891,11 +891,11 @@ fn_info_game_armar() { # Filetype: con fn_info_game_bf1942() { if [ -f "${servercfgfullpath}" ]; then - fn_info_game_con "configip" "game.serverIp" - fn_info_game_con "maxplayers" "game.serverMaxPlayers" - fn_info_game_con "port" "game.serverPort" - fn_info_game_con "servername" "game.serverName" - fn_info_game_con "serverpassword" "game.serverPassword" + fn_info_game_keyvalue_pairs "configip" "game.serverIp" + fn_info_game_keyvalue_pairs "maxplayers" "game.serverMaxPlayers" + fn_info_game_keyvalue_pairs "port" "game.serverPort" + fn_info_game_keyvalue_pairs "servername" "game.serverName" + fn_info_game_keyvalue_pairs "serverpassword" "game.serverPassword" fi configip="${configip:-"0.0.0.0"}" maxplayers="${maxplayers:-"0"}" @@ -905,32 +905,6 @@ fn_info_game_bf1942() { serverpassword="${serverpassword:-"NOT SET"}" } -# Config Type: ini -# Parameters: true -# Comment: ; or # -# Example: ServerName=SERVERNAME -# Filetype: ini -fn_info_game_ct() { - if [ -f "${servercfgfullpath}" ]; then - fn_info_game_ini "configip" "bindAddress" - fn_info_game_ini "gamemode" "gameMode" - fn_info_game_ini "maxplayers" "maxPlayerNumber" - fn_info_game_ini "port" "port" - fn_info_game_ini "saveinterval" "autoSaveSec" - fn_info_game_ini "servername" "name" - fn_info_game_ini "serverpassword" "serverPassword" - fn_info_game_ini "serverpasswordenabled" "usePassword" - fi - configip="${configip:-"0.0.0.0"}" - gamemode="${gamemode:-"NOT SET"}" - maxplayers="${maxplayers:-"0"}" - port="${port:-"0"}" - saveinterval="${saveinterval:-"0"}" - servername="${servername:-"NOT SET"}" - serverpassword="${serverpassword:-"NOT SET"}" - serverpasswordenabled="${serverpasswordenabled:-"NOT SET"}" -} - # Config Type: con # Parameters: true # Comment: # or // @@ -938,11 +912,11 @@ fn_info_game_ct() { # Filetype: con fn_info_game_bfv() { if [ -f "${servercfgfullpath}" ]; then - fn_info_game_con "configip" "game.serverIp" - fn_info_game_con "maxplayers" "game.serverMaxPlayers" - fn_info_game_con "port" "game.serverPort" - fn_info_game_con "servername" "game.serverName" - fn_info_game_con "serverpassword" "game.serverPassword" + fn_info_game_keyvalue_pairs "configip" "game.serverIp" + fn_info_game_keyvalue_pairs "maxplayers" "game.serverMaxPlayers" + fn_info_game_keyvalue_pairs "port" "game.serverPort" + fn_info_game_keyvalue_pairs "servername" "game.serverName" + fn_info_game_keyvalue_pairs "serverpassword" "game.serverPassword" fi configip="${configip:-"0.0.0.0"}" maxplayers="${maxplayers:-"0"}" @@ -1129,6 +1103,32 @@ fn_info_game_col() { steamport="${steamport:-"0"}" } +# Config Type: ini +# Parameters: true +# Comment: ; or # +# Example: ServerName=SERVERNAME +# Filetype: ini +fn_info_game_ct() { + if [ -f "${servercfgfullpath}" ]; then + fn_info_game_ini "configip" "bindAddress" + fn_info_game_ini "gamemode" "gameMode" + fn_info_game_ini "maxplayers" "maxPlayerNumber" + fn_info_game_ini "port" "port" + fn_info_game_ini "saveinterval" "autoSaveSec" + fn_info_game_ini "servername" "name" + fn_info_game_ini "serverpassword" "serverPassword" + fn_info_game_ini "serverpasswordenabled" "usePassword" + fi + configip="${configip:-"0.0.0.0"}" + gamemode="${gamemode:-"NOT SET"}" + maxplayers="${maxplayers:-"0"}" + port="${port:-"0"}" + saveinterval="${saveinterval:-"0"}" + servername="${servername:-"NOT SET"}" + serverpassword="${serverpassword:-"NOT SET"}" + serverpasswordenabled="${serverpasswordenabled:-"NOT SET"}" +} + # Config Type: SQF # Parameters: true # Comment: // or /* */ @@ -1964,7 +1964,7 @@ fn_info_game_sol() { maxplayers="${maxplayers:-"0"}" port="${port:-"0"}" filesport="$((port + 10))" - queryport="${port}" + queryport="${filesport}" servername="${servername:-"NOT SET"}" serverpassword="${serverpassword:-"NOT SET"}" } diff --git a/tests/tests_fctrserver.sh b/tests/tests_fctrserver.sh index 29c449b269..10d5999e3b 100644 --- a/tests/tests_fctrserver.sh +++ b/tests/tests_fctrserver.sh @@ -28,7 +28,7 @@ rootdir=$(dirname "$(readlink -f "${BASH_SOURCE[0]}")") selfname=$(basename "$(readlink -f "${BASH_SOURCE[0]}")") sessionname=$(echo "${selfname}" | cut -f1 -d".") lgsmdir="${rootdir}/lgsm" -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" lgsmlogdir="${logdir}/lgsm" steamcmddir="${HOME}/.steam/steamcmd" serverfiles="${rootdir}/serverfiles" diff --git a/tests/tests_jc2server.sh b/tests/tests_jc2server.sh index 064185bc02..cbd366f309 100644 --- a/tests/tests_jc2server.sh +++ b/tests/tests_jc2server.sh @@ -28,7 +28,7 @@ rootdir=$(dirname "$(readlink -f "${BASH_SOURCE[0]}")") selfname=$(basename "$(readlink -f "${BASH_SOURCE[0]}")") sessionname=$(echo "${selfname}" | cut -f1 -d".") lgsmdir="${rootdir}/lgsm" -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" lgsmlogdir="${logdir}/lgsm" steamcmddir="${HOME}/.steam/steamcmd" serverfiles="${rootdir}/serverfiles" diff --git a/tests/tests_mcserver.sh b/tests/tests_mcserver.sh index c1e775f060..5b5070787a 100644 --- a/tests/tests_mcserver.sh +++ b/tests/tests_mcserver.sh @@ -28,7 +28,7 @@ rootdir=$(dirname "$(readlink -f "${BASH_SOURCE[0]}")") selfname=$(basename "$(readlink -f "${BASH_SOURCE[0]}")") sessionname=$(echo "${selfname}" | cut -f1 -d".") lgsmdir="${rootdir}/lgsm" -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" lgsmlogdir="${logdir}/lgsm" steamcmddir="${HOME}/.steam/steamcmd" serverfiles="${rootdir}/serverfiles" diff --git a/tests/tests_ts3server.sh b/tests/tests_ts3server.sh index 652ee8f8d6..10484899f9 100644 --- a/tests/tests_ts3server.sh +++ b/tests/tests_ts3server.sh @@ -28,7 +28,7 @@ rootdir=$(dirname "$(readlink -f "${BASH_SOURCE[0]}")") selfname=$(basename "$(readlink -f "${BASH_SOURCE[0]}")") sessionname=$(echo "${selfname}" | cut -f1 -d".") lgsmdir="${rootdir}/lgsm" -logdir="${rootdir}/log" +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" lgsmlogdir="${logdir}/lgsm" steamcmddir="${HOME}/.steam/steamcmd" serverfiles="${rootdir}/serverfiles" From 5cb6c9e3a10c2cb73cb478e067ac09b6af8149c4 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Wed, 5 Jul 2023 16:52:39 +0100 Subject: [PATCH 115/181] Release v23.3.6 --- lgsm/modules/core_functions.sh | 2 +- lgsm/modules/core_modules.sh | 2 +- linuxgsm.sh | 2 +- tests/tests_fctrserver.sh | 4 ++-- tests/tests_jc2server.sh | 4 ++-- tests/tests_mcserver.sh | 4 ++-- tests/tests_ts3server.sh | 4 ++-- 7 files changed, 11 insertions(+), 11 deletions(-) diff --git a/lgsm/modules/core_functions.sh b/lgsm/modules/core_functions.sh index ac5d847f79..e4b34b41d8 100644 --- a/lgsm/modules/core_functions.sh +++ b/lgsm/modules/core_functions.sh @@ -8,7 +8,7 @@ module_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" -modulesversion="v23.3.5" +modulesversion="v23.3.6" # Core diff --git a/lgsm/modules/core_modules.sh b/lgsm/modules/core_modules.sh index 7c8c1096c6..c1baab40e2 100644 --- a/lgsm/modules/core_modules.sh +++ b/lgsm/modules/core_modules.sh @@ -8,7 +8,7 @@ moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" -modulesversion="v23.3.5" +modulesversion="v23.3.6" # Core diff --git a/linuxgsm.sh b/linuxgsm.sh index 72b96dbc7c..5746dfe8c0 100755 --- a/linuxgsm.sh +++ b/linuxgsm.sh @@ -20,7 +20,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="v23.3.5" +version="v23.3.6" shortname="core" gameservername="core" commandname="CORE" diff --git a/tests/tests_fctrserver.sh b/tests/tests_fctrserver.sh index 10d5999e3b..b06e8c6463 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.3.5" +version="v23.3.6" shortname="fctr" gameservername="fctrserver" commandname="CORE" @@ -28,7 +28,7 @@ rootdir=$(dirname "$(readlink -f "${BASH_SOURCE[0]}")") selfname=$(basename "$(readlink -f "${BASH_SOURCE[0]}")") sessionname=$(echo "${selfname}" | cut -f1 -d".") lgsmdir="${rootdir}/lgsm" -[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" +logdir="${rootdir}/log" lgsmlogdir="${logdir}/lgsm" steamcmddir="${HOME}/.steam/steamcmd" serverfiles="${rootdir}/serverfiles" diff --git a/tests/tests_jc2server.sh b/tests/tests_jc2server.sh index cbd366f309..30051114ca 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.3.5" +version="v23.3.6" shortname="jc2" gameservername="jc2server" commandname="CORE" @@ -28,7 +28,7 @@ rootdir=$(dirname "$(readlink -f "${BASH_SOURCE[0]}")") selfname=$(basename "$(readlink -f "${BASH_SOURCE[0]}")") sessionname=$(echo "${selfname}" | cut -f1 -d".") lgsmdir="${rootdir}/lgsm" -[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" +logdir="${rootdir}/log" lgsmlogdir="${logdir}/lgsm" steamcmddir="${HOME}/.steam/steamcmd" serverfiles="${rootdir}/serverfiles" diff --git a/tests/tests_mcserver.sh b/tests/tests_mcserver.sh index 5b5070787a..587a8a9b1e 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.3.5" +version="v23.3.6" shortname="mc" gameservername="mcserver" commandname="CORE" @@ -28,7 +28,7 @@ rootdir=$(dirname "$(readlink -f "${BASH_SOURCE[0]}")") selfname=$(basename "$(readlink -f "${BASH_SOURCE[0]}")") sessionname=$(echo "${selfname}" | cut -f1 -d".") lgsmdir="${rootdir}/lgsm" -[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" +logdir="${rootdir}/log" lgsmlogdir="${logdir}/lgsm" steamcmddir="${HOME}/.steam/steamcmd" serverfiles="${rootdir}/serverfiles" diff --git a/tests/tests_ts3server.sh b/tests/tests_ts3server.sh index 10484899f9..45647cda7b 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.3.5" +version="v23.3.6" shortname="ts3" gameservername="ts3server" commandname="CORE" @@ -28,7 +28,7 @@ rootdir=$(dirname "$(readlink -f "${BASH_SOURCE[0]}")") selfname=$(basename "$(readlink -f "${BASH_SOURCE[0]}")") sessionname=$(echo "${selfname}" | cut -f1 -d".") lgsmdir="${rootdir}/lgsm" -[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" +logdir="${rootdir}/log" lgsmlogdir="${logdir}/lgsm" steamcmddir="${HOME}/.steam/steamcmd" serverfiles="${rootdir}/serverfiles" From 7f4111d167d10bae9643a03b1af9794a8b655c30 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Mon, 10 Jul 2023 10:13:59 +0100 Subject: [PATCH 116/181] fix(mta): update xml parsing The `fn_info_game_mta` function in the `info_game.sh` file has been refactored to update the parameters passed to the `fn_info_game_xml` function. The parameter names have been changed from "port" to "serverport", "httpport" to "httpport", "servername" to "servername", "maxplayers" to "maxplayers", and "ase" to "ase". This change improves code readability and consistency. --- lgsm/modules/info_game.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lgsm/modules/info_game.sh b/lgsm/modules/info_game.sh index 5c948d47c1..39d433d9d5 100644 --- a/lgsm/modules/info_game.sh +++ b/lgsm/modules/info_game.sh @@ -1441,11 +1441,11 @@ fn_info_game_mom() { # Filetype: conf fn_info_game_mta() { if [ -f "${servercfgfullpath}" ]; then - fn_info_game_xml "port" "/config/@port" - fn_info_game_xml "httpport" "/config/@httpport" - fn_info_game_xml "servername" "/config/@servername" - fn_info_game_xml "maxplayers" "/config/@maxplayers" - fn_info_game_xml "ase" "/config/@ase" + fn_info_game_xml "port" "/config/serverport" + fn_info_game_xml "httpport" "/config/httpport" + fn_info_game_xml "servername" "/config/servername" + fn_info_game_xml "maxplayers" "/config/maxplayers" + fn_info_game_xml "ase" "/config/ase" fi if [ "${ase}" == "1" ]; then ase="Enabled" From 953efca700f1c53a58862ff445a99eff6a3172f5 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Mon, 10 Jul 2023 13:35:06 +0100 Subject: [PATCH 117/181] fix: add missing Query port information to GoldSrc info message This commit adds the functionality to display the Query port information in the GoldSrc info message. The Query port is now shown alongside the Game and Client ports. --- lgsm/modules/info_messages.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/lgsm/modules/info_messages.sh b/lgsm/modules/info_messages.sh index 8d356f9592..23559993ea 100644 --- a/lgsm/modules/info_messages.sh +++ b/lgsm/modules/info_messages.sh @@ -1033,6 +1033,7 @@ fn_info_message_goldsrc() { { fn_port "header" fn_port "Game" port udp + fn_port "Query" queryport tcp fn_port "Client" clientport udp } | column -s $'\t' -t } From c13a7d003f022a23e709135d82525294b2ebd396 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Mon, 10 Jul 2023 16:42:16 +0100 Subject: [PATCH 118/181] fix(monitor): improve logging messages - Refactored the `fn_monitor_check_lockfile`, `fn_monitor_check_backup`, and `fn_monitor_check_install` functions in the `command_monitor.sh` file. - Updated the logging messages to provide more concise and informative output. - Replaced `fn_print_info_nl` with `fn_print_info` for consistency. - Removed unnecessary line breaks in the logging messages. --- lgsm/modules/command_monitor.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lgsm/modules/command_monitor.sh b/lgsm/modules/command_monitor.sh index 97f86d9961..5edd7298e9 100644 --- a/lgsm/modules/command_monitor.sh +++ b/lgsm/modules/command_monitor.sh @@ -38,7 +38,7 @@ fn_monitor_check_lockfile() { fn_monitor_check_backup() { # Monitor will check if backup is running. if [ "$(pgrep "${selfname} backup" | wc -l)" != "0" ] || [ "$(pgrep "${selfname} b" | wc -l)" != "0" ]; then - fn_print_info_nl "Checking lockfile: LinuxGSM is currently running a backup: " + fn_print_info "Checking lockfile: LinuxGSM is currently running a backup: " fn_print_info_eol fn_script_log_info "Checking lockfile: LinuxGSM is currently running a backup" core_exit.sh @@ -48,7 +48,7 @@ fn_monitor_check_backup() { fn_monitor_check_debug() { # Monitor will check if backup is running. if [ "$(pgrep -fc "${selfname} backup")" != "0" ] || [ "$(pgrep -fc "${selfname} b")" != "0" ]; then - fn_print_info_nl "Checking lockfile: LinuxGSM is currently in debug mode: " + fn_print_info "Checking lockfile: LinuxGSM is currently in debug mode: " fn_print_info_eol fn_script_log_pass "Checking lockfile: LinuxGSM is currently in debug mode" core_exit.sh @@ -61,7 +61,7 @@ fn_monitor_check_install() { fn_print_dots "Checking for installer: " fn_print_checking_eol fn_script_log_info "Checking for installer: CHECKING" - fn_print_info_nl "Checking for installer: LinuxGSM is currently installing: " + fn_print_info "Checking for installer: LinuxGSM is currently installing: " fn_print_info_eol fn_script_log_pass "Checking for installer: LinuxGSM is currently installing" core_exit.sh From ce9f864f248e5a46497bcef93aae6e9f61db2f5a Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Tue, 11 Jul 2023 17:27:34 +0100 Subject: [PATCH 119/181] feat(rw): migrate rising world to unity engine (#4261) * refactor: update default executable name for Rising World server The default executable name for the Rising World server has been updated from "server.jar" to "RisingWorldServer.x64". This change ensures that the correct executable is used when launching the game server. * refactor(rw): no longer java The code in `info_messages.sh` has been refactored to simplify the port command for multiple game servers. This change improves readability and maintainability. * refactor: simplify info_game_rw function The info_game_rw function has been refactored to remove redundant code and improve readability. The configuration values are now retrieved using the fn_info_game_keyvalue_pairs function, which reduces duplication and improves maintainability. Additionally, the default values for configip, gamemode, maxplayers, port, queryport, rconport, seed, servername, and worldname have been set to appropriate fallback values if they are not found in the server configuration file. * refactor: remove unnecessary game ports and query HTTP port The code changes in this commit refactor the `info_messages.sh` file by removing unnecessary game ports and the query HTTP port. This simplifies the code and improves readability. * refactor: update queryport calculation in info_game.sh The code change updates the calculation of the queryport variable in the info_game.sh script. Instead of assigning it the same value as port, it now subtracts 1 from the port value. This ensures that queryport is set correctly for further use in the script. * feat: add branch configuration option for rwserver This commit adds a new configuration option `branch` to the `_default.cfg` file in the `rwserver` directory. The default value is set to "unity". This allows users to specify a specific branch for SteamCMD when installing or updating the server. * refactor: update default game server configuration The default game server configuration file has been updated to reflect the following changes: - Removed the predefined parameter `javaram` - Updated the value of `consoleinteract` to "yes" - Updated the values of `engine` and `glibc` These changes ensure that the default configuration is more up-to-date and aligned with the desired behavior for a Rising World game server. * refactor: remove unnecessary code for game+1, game+2, and game+3 The code changes in this commit involve removing unnecessary code related to the variables port2, port3, and port4. These variables were used to display information about additional games (game+1, game+2, and game+3) in the output. However, since these variables are not being used elsewhere in the script, they have been removed along with the corresponding echo statements. This refactor simplifies the code by eliminating redundant logic. --- .../config-lgsm/rwserver/_default.cfg | 14 ++-- lgsm/modules/command_dev_query_raw.sh | 19 ------ lgsm/modules/info_game.sh | 64 ++++++------------- lgsm/modules/info_messages.sh | 9 +-- 4 files changed, 25 insertions(+), 81 deletions(-) diff --git a/lgsm/config-default/config-lgsm/rwserver/_default.cfg b/lgsm/config-default/config-lgsm/rwserver/_default.cfg index 3f526c110f..74288a4f8a 100644 --- a/lgsm/config-default/config-lgsm/rwserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/rwserver/_default.cfg @@ -8,9 +8,6 @@ #### Game Server Settings #### -## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters -javaram="2048" # -Xmx$2048M - ## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters startparameters="" @@ -115,7 +112,7 @@ sleeptime="0.5" appid="339010" steamcmdforcewindows="no" # SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch -branch="" +branch="unity" betapassword="" # Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server steammaster="false" @@ -145,13 +142,13 @@ querytype="protocol-valve" ## Console type consoleverbose="yes" -consoleinteract="no" +consoleinteract="yes" ## Game Server Details # Do not edit gamename="Rising World" -engine="risingworld" -glibc="null" +engine="unity3d" +glibc="2.17" #### Directories #### # Edit with care @@ -159,8 +156,7 @@ glibc="null" ## Game Server Directories systemdir="${serverfiles}" executabledir="${serverfiles}" -preexecutable="java -Xmx${javaram}M -jar" -executable="./server.jar" +executable="./RisingWorldServer.x64" servercfgdir="${systemdir}" servercfg="server.properties" servercfgdefault="server.properties" diff --git a/lgsm/modules/command_dev_query_raw.sh b/lgsm/modules/command_dev_query_raw.sh index a2cfa1f687..25b174e6b1 100644 --- a/lgsm/modules/command_dev_query_raw.sh +++ b/lgsm/modules/command_dev_query_raw.sh @@ -32,25 +32,6 @@ echo -e "==================================================================" else echo -e "Game:" fi - if [ "${shortname}" == "rw" ]; then - if [ -v port2 ]; then - echo -e "Game+1: \t${port2} \t$(ss -tupl | grep -c "${port}") \t$(ss -tupl | grep "${port2}" | grep tcp | awk '{ print $2 }') \t$(ss -tupl | grep "${port2}" | grep udp | awk '{ print $2 }')" - else - echo -e "Game+1:" - fi - - if [ -v port3 ]; then - echo -e "Game+2: \t${port3} \t$(ss -tupl | grep -c "${port}") \t$(ss -tupl | grep "${port3}" | grep tcp | awk '{ print $2 }') \t$(ss -tupl | grep "${port3}" | grep udp | awk '{ print $2 }')" - else - echo -e "Game+2:" - fi - - if [ -v port4 ]; then - echo -e "Game+3: \t${port4} \t$(ss -tupl | grep -c "${port}") \t$(ss -tupl | grep "${port4}" | grep tcp | awk '{ print $2 }') \t$(ss -tupl | grep "${port4}" | grep udp | awk '{ print $2 }')" - else - echo -e "Game+3:" - fi - fi if [ "${shortname}" == "pvr" ]; then if [ -v port401 ]; then echo -e "Game+400: \t${port401} \t$(ss -tupl | grep -c "${port401}") \t$(ss -tupl | grep "${port401}" | grep tcp | awk '{ print $2 }') \t$(ss -tupl | grep "${port401}" | grep udp | awk '{ print $2 }')" diff --git a/lgsm/modules/info_game.sh b/lgsm/modules/info_game.sh index 39d433d9d5..aa6b223beb 100644 --- a/lgsm/modules/info_game.sh +++ b/lgsm/modules/info_game.sh @@ -1744,52 +1744,26 @@ fn_info_game_rust() { } fn_info_game_rw() { - # Config - if [ ! -f "${servercfgfullpath}" ]; then - servername="${unavailable}" - serverpassword="${unavailable}" - rconpassword="${unavailable}" - rconport="${zero}" - maxplayers="${zero}" - port="${zero}" - port2="${zero}" - port3="${zero}" - port4="${zero}" - queryport="${zero}" - gamemode="${unavailable}" - worldname="${unavailable}" - else - servername=$(grep "server_name" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/server_name//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - serverpassword=$(grep "server_password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/server_password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - rconpassword=$(grep "rcon_password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/rcon_password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - rconport=$(grep "rcon_port" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') - maxplayers=$(grep "settings_max_players" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') - port=$(grep "server_port" "${servercfgfullpath}" | grep -v "database_mysql_server_port" | grep -v "#" | tr -cd '[:digit:]') - port2=$((port + 1)) - port3=$((port + 2)) - port4=$((port + 3)) - queryport="${port}" - httpqueryport=$((port - 1)) - gamemode=$(grep "settings_default_gamemode=" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/settings_default_gamemode//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - worldname=$(grep "server_world_name" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/server_world_name//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - configip=$(grep "server_ip" "${servercfgfullpath}" | grep -v "database_mysql_server_ip" | sed -e 's/^[ \t]*//g' -e '/^--/d' -e 's/server_ip//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - - # Not set - servername="${servername:-"NOT SET"}" - serverpassword="${serverpassword:-"NOT SET"}" - rconpassword="${rconpassword:-"NOT SET"}" - rconport="${rconport:-"0"}" - maxplayers="${maxplayers:-"0"}" - port="${port:-"0"}" - port2="${port2:-"0"}" - port3="${port3:-"0"}" - port4="${port4:-"0"}" - queryport="${queryport:-"0"}" - httpqueryport="${httpport:-"0"}" - gamemode="${gamemode:-"NOT SET"}" - worldname="${worldname:-"NOT SET"}" - configip="${configip:-"0.0.0.0"}" + if [ -f "${servercfgfullpath}" ]; then + fn_info_game_keyvalue_pairs "configip" "Server_IP" + fn_info_game_keyvalue_pairs "gamemode" "World_GameMode" + fn_info_game_keyvalue_pairs "maxplayers" "Server_MaxPlayers" + fn_info_game_keyvalue_pairs "port" "Server_Port" + fn_info_game_keyvalue_pairs "rconport" "RCON_Port" + fn_info_game_keyvalue_pairs "seed" "World_Seed" + fn_info_game_keyvalue_pairs "servername" "Server_Name" + fn_info_game_keyvalue_pairs "worldname" "World_Name" fi + configip="${configip:-"0.0.0.0"}" + gamemode="${gamemode:-"NOT SET"}" + maxplayers="${maxplayers:-"0"}" + port="${port:-"0"}" + queryport="$((port - 1))" + rconport="${rconport:-"0"}" + seed="${seed:-"0"}" + servername="${servername:-"NOT SET"}" + worldname="${worldname:-"NOT SET"}" + } # Config Type: custom diff --git a/lgsm/modules/info_messages.sh b/lgsm/modules/info_messages.sh index 23559993ea..948787e4b6 100644 --- a/lgsm/modules/info_messages.sh +++ b/lgsm/modules/info_messages.sh @@ -698,7 +698,7 @@ fn_info_message_ports() { portcommand="ss -tuplwn | grep AvorionServer" elif [ "${shortname}" == "bf1942" ]; then portcommand="ss -tuplwn | grep bf1942_lnxded" - elif [ "${shortname}" == "mc" ] || [ "${shortname}" == "nec" ] || [ "${shortname}" == "pmc" ] || [ "${shortname}" == "rw" ] || [ "${shortname}" == "vpmc" ] || [ "${shortname}" == "wmc" ]; then + elif [ "${shortname}" == "mc" ] || [ "${shortname}" == "nec" ] || [ "${shortname}" == "pmc" ] || [ "${shortname}" == "vpmc" ] || [ "${shortname}" == "wmc" ]; then portcommand="ss -tuplwn | grep java" elif [ "${shortname}" == "terraria" ]; then portcommand="ss -tuplwn | grep Main" @@ -1352,14 +1352,7 @@ fn_info_message_rw() { { fn_port "header" fn_port "Game" port udp - fn_port "Game+1" port2 udp - fn_port "Game+2" port3 udp - fn_port "Game+3" port4 udp - fn_port "Game+1" port2 tcp - fn_port "Game+2" port3 tcp - fn_port "Game+3" port4 tcp fn_port "Query" queryport tcp - fn_port "Query HTTP" httpqueryport tcp fn_port "RCON" rconport tcp } | column -s $'\t' -t } From d34bc29db6e17cdd295b084edcf51a9536ef30d4 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Wed, 12 Jul 2023 12:17:31 +0100 Subject: [PATCH 120/181] feat: game server config migration (#4262) * refactor: simplify game directory names in install_config.sh The commit simplifies the game directory names in the install_config.sh file. It replaces specific game directory names with a generic variable, shortname, to improve code readability and maintainability. * fix: handle invalid directory paths The code now checks if the server files or system directory exist before proceeding. If either directory does not exist, an error message is printed and the script exits. --- lgsm/modules/check_system_dir.sh | 16 +++-- lgsm/modules/install_config.sh | 117 +------------------------------ 2 files changed, 12 insertions(+), 121 deletions(-) diff --git a/lgsm/modules/check_system_dir.sh b/lgsm/modules/check_system_dir.sh index 9f0f5f0920..162037861f 100644 --- a/lgsm/modules/check_system_dir.sh +++ b/lgsm/modules/check_system_dir.sh @@ -7,16 +7,18 @@ moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" -if [ "${commandname}" != "VALIDATE" ]; then - checkdir="${serverfiles}" -else - checkdir="${systemdir}" +if [ ! -d "${serverfiles}" ]; then + fn_print_fail_nl "Cannot access ${serverfiles}: No such directory" + if [ -d "${lgsmlogdir}" ]; then + fn_script_log_fatal "Cannot access ${serverfiles}: No such directory." + fi + core_exit.sh fi -if [ ! -d "${checkdir}" ]; then - fn_print_fail_nl "Cannot access ${checkdir}: No such directory" +if [ ! -d "${systemdir}" ]; then + fn_print_fail_nl "Cannot access ${systemdir}: No such directory" if [ -d "${lgsmlogdir}" ]; then - fn_script_log_fatal "Cannot access ${checkdir}: No such directory." + fn_script_log_fatal "Cannot access ${systemdir}: No such directory." fi core_exit.sh fi diff --git a/lgsm/modules/install_config.sh b/lgsm/modules/install_config.sh index b39ed298c7..e868e9bf71 100644 --- a/lgsm/modules/install_config.sh +++ b/lgsm/modules/install_config.sh @@ -24,9 +24,9 @@ fn_fetch_default_config() { echo -e "default configs from https://github.com/GameServerManagers/Game-Server-Configs" fn_sleep_time mkdir -p "${lgsmdir}/config-default/config-game" - githuburl="https://raw.githubusercontent.com/GameServerManagers/Game-Server-Configs/master" + githuburl="https://raw.githubusercontent.com/GameServerManagers/Game-Server-Configs/main" for config in "${array_configs[@]}"; do - fn_fetch_file "${githuburl}/${gamedirname}/${config}" "${remote_fileurl_backup}" "GitHub" "Bitbucket" "${lgsmdir}/config-default/config-game" "${config}" "nochmodx" "norun" "forcedl" "nohash" + fn_fetch_file "${githuburl}/${shortname}/${config}" "${remote_fileurl_backup}" "GitHub" "Bitbucket" "${lgsmdir}/config-default/config-game" "${config}" "nochmodx" "norun" "forcedl" "nohash" done } @@ -162,32 +162,27 @@ fn_list_config_locations() { } if [ "${shortname}" == "sdtd" ]; then - gamedirname="7DaysToDie" fn_default_config_local fn_list_config_locations elif [ "${shortname}" == "ac" ]; then - gamedirname="AssettoCorsa" 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) 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) fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "ark" ]; then - gamedirname="ARKSurvivalEvolved" fn_check_cfgdir array_configs+=(GameUserSettings.ini) fn_fetch_default_config @@ -195,7 +190,6 @@ elif [ "${shortname}" == "ark" ]; then fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "arma3" ]; then - gamedirname="Arma3" fn_check_cfgdir array_configs+=(server.cfg network.cfg) fn_fetch_default_config @@ -203,7 +197,6 @@ elif [ "${shortname}" == "arma3" ]; then 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 @@ -211,7 +204,6 @@ elif [ "${shortname}" == "armar" ]; then 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 @@ -219,21 +211,18 @@ elif [ "${shortname}" == "ats" ]; then fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "bo" ]; then - gamedirname="BallisticOverkill" array_configs+=(config.txt) fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "bd" ]; then - gamedirname="BaseDefense" array_configs+=(server.cfg) fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "bt" ]; then - gamedirname="Barotrauma" fn_check_cfgdir array_configs+=(serversettings.xml) fn_fetch_default_config @@ -241,7 +230,6 @@ elif [ "${shortname}" == "bt" ]; then fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "btl" ]; then - gamedirname="BattalionLegacy" fn_check_cfgdir array_configs+=(DefaultGame.ini) fn_fetch_default_config @@ -249,147 +237,126 @@ elif [ "${shortname}" == "btl" ]; then fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "bf1942" ]; then - gamedirname="Battlefield1942" 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) 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) 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) 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) 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) 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) fn_fetch_default_config 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) 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) 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) 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) 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) 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) 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) 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) 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) 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) 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) fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "ct" ]; then - gamedirname="Craftopia" array_configs+=(ServerSetting.ini) fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "dayz" ]; then - gamedirname="DayZ" fn_check_cfgdir array_configs+=(server.cfg) fn_fetch_default_config @@ -397,41 +364,35 @@ elif [ "${shortname}" == "dayz" ]; then fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "dod" ]; then - gamedirname="DayOfDefeat" 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) fn_fetch_default_config fn_default_config_remote fn_list_config_locations elif [ "${shortname}" == "dods" ]; then - gamedirname="DayOfDefeatSource" 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) 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) fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "dst" ]; then - gamedirname="DontStarveTogether" fn_check_cfgdir array_configs+=(cluster.ini server.ini) fn_fetch_default_config @@ -439,21 +400,18 @@ elif [ "${shortname}" == "dst" ]; then fn_set_dst_config_vars fn_list_config_locations elif [ "${shortname}" == "dab" ]; then - gamedirname="DoubleActionBoogaloo" 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) 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) fn_fetch_default_config fn_default_config_remote @@ -463,14 +421,12 @@ elif [ "${shortname}" == "em" ]; then fn_default_config_local fn_list_config_locations elif [ "${shortname}" == "etl" ]; then - gamedirname="ETLegacy" array_configs+=(server.cfg) fn_fetch_default_config 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 @@ -478,133 +434,114 @@ elif [ "${shortname}" == "ets2" ]; then fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "fctr" ]; then - gamedirname="Factorio" 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) 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) 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) 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) fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "ohd" ]; then - gamedirname="OperationHarshDoorstop" array_configs+=(Game.ini) 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) 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) 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) 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) 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) 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) 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) 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) 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) fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "mc" ] || [ "${shortname}" == "pmc" ]; then - gamedirname="Minecraft" 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) 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) fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "mh" ]; then - gamedirname="Mordhau" fn_check_cfgdir array_configs+=(Game.ini) fn_fetch_default_config @@ -612,56 +549,48 @@ elif [ "${shortname}" == "mh" ]; then fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "ns" ]; then - gamedirname="NaturalSelection" 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) 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) fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "mta" ]; then - gamedirname="MultiTheftAuto" fn_check_cfgdir array_configs+=(acl.xml mtaserver.conf vehiclecolors.conf) fn_fetch_default_config fn_default_config_remote fn_list_config_locations elif [ "${shotname}" == "mom" ]; then - gamedirname="MemoriesofMars" array_configs+=(DedicatedServerConfig.cfg) fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "pvr" ]; then - gamedirname="PavlovVR" fn_check_cfgdir 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) fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "pz" ]; then - gamedirname="ProjectZomboid" fn_check_cfgdir array_configs+=(server.ini) fn_fetch_default_config @@ -669,7 +598,6 @@ elif [ "${shortname}" == "pz" ]; then 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 @@ -677,184 +605,157 @@ elif [ "${shortname}" == "nec" ]; then fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "pc" ]; then - gamedirname="ProjectCars" array_configs+=(server.cfg) fn_fetch_default_config 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) 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) 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) 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) fn_fetch_default_config fn_default_config_remote fn_set_config_vars elif [ "${shortname}" == "qw" ]; then - gamedirname="QuakeWorld" 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) 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) fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "rust" ]; then - gamedirname="Rust" fn_check_cfgdir array_configs+=(server.cfg) fn_fetch_default_config fn_default_config_remote fn_list_config_locations elif [ "${shortname}" == "scpsl" ] || [ "${shortname}" == "scpslsm" ]; then - gamedirname="SCPSecretLaboratory" 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) 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) 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) 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) 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) 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) 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) 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) 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) 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) 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 Engine.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) 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) 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) 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) fn_fetch_default_config fn_default_config_remote fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "tu" ]; then - gamedirname="TowerUnite" fn_check_cfgdir array_configs+=(TowerServer.ini) fn_fetch_default_config @@ -862,83 +763,71 @@ elif [ "${shortname}" == "tu" ]; then fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "ut" ]; then - gamedirname="UnrealTournament" 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) 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) 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) 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) 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) 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) 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) 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) fn_fetch_default_config fn_default_config_remote fn_set_config_vars elif [ "${shortname}" == "wurm" ]; then - gamedirname="WurmUnlimited" 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) 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) fn_fetch_default_config fn_default_config_remote From db692b2610fc7bbffcf7f9884885025fcff0968a Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Wed, 12 Jul 2023 14:03:50 +0100 Subject: [PATCH 121/181] fix(ti): Update config using evrima branch (#4263) * refactor: simplify start parameters in tiserver config The start parameters in the tiserver config file have been simplified to only include the default map and port. The unnecessary queryport and eaclaunch parameters have been removed. * refactor: update default configuration and game info handling - Set `steammaster` to false in the default configuration file. - Refactor the game info script to handle changes in the game's ini file structure: - Update the key for `queueenabled` to `bQueueEnabled`. - Update the key for `rconenabled` to `bRconEnabled`. - Add support for retrieving `rconpassword`, `serverpassword`, and `serverpasswordenabled`. - Modify the message formatting in the info messages script to display queue, RCON, and query ports correctly. --- .../config-lgsm/tiserver/_default.cfg | 15 +++++---------- lgsm/modules/info_game.sh | 10 ++++++++-- lgsm/modules/info_messages.sh | 3 ++- 3 files changed, 15 insertions(+), 13 deletions(-) diff --git a/lgsm/config-default/config-lgsm/tiserver/_default.cfg b/lgsm/config-default/config-lgsm/tiserver/_default.cfg index f7a3b69445..6e04a4d324 100644 --- a/lgsm/config-default/config-lgsm/tiserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/tiserver/_default.cfg @@ -11,15 +11,10 @@ ## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters ip="0.0.0.0" port="7777" -queryport="27015" -# Possible maps, see: https://isle.fandom.com/wiki/The_Isle_Server_Settings_and_Configuration#Optional_Maps -map="" - -# EAC start parameters -eaclaunch="-ini:Engine:[EpicOnlineServices]:DedicatedServerClientId=xyza7891gk5PRo3J7G9puCJGFJjmEguW -ini:Engine:[EpicOnlineServices]:DedicatedServerClientSecret=pKWl6t5i9NJK8gTpVlAxzENZ65P8hYzodV8Dqe5Rlc8" +defaultmap="/Game/TheIsle/Maps/Game/Isla_Spiro/Isla_Spiro" ## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters -startparameters="${map} -MultiHome=${ip} -Port=${port} -QueryPort=${queryport} -log ${eaclaunch}" +startparameters="${defaultmap} -Port=${port} -log" #### LinuxGSM Settings #### @@ -125,7 +120,7 @@ steamcmdforcewindows="no" branch="evrima" betapassword="" # Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server -steammaster="true" +steammaster="false" ## Stop Mode | https://docs.linuxgsm.com/features/stop-mode # 1: tmux kill @@ -147,8 +142,8 @@ stopmode="2" # 3: gamedig # 4: gsquery # 5: tcp -querymode="2" -querytype="protocol-valve" +querymode="1" +querytype="" ## Console type consoleverbose="yes" diff --git a/lgsm/modules/info_game.sh b/lgsm/modules/info_game.sh index aa6b223beb..fea995d273 100644 --- a/lgsm/modules/info_game.sh +++ b/lgsm/modules/info_game.sh @@ -666,18 +666,24 @@ fn_info_game_stn() { fn_info_game_ti() { if [ -f "${servercfgfullpath}" ]; then fn_info_game_ini "maxplayers" "MaxPlayerCount" - fn_info_game_ini "queueenabled" "QueueEnabled" + fn_info_game_ini "queueenabled" "bQueueEnabled" fn_info_game_ini "queueport" "QueuePort" - fn_info_game_ini "rconenabled" "RconEnabled" + fn_info_game_ini "rconenabled" "bRconEnabled" + fn_info_game_ini "rconpassword" "RconPassword" fn_info_game_ini "rconport" "RconPort" fn_info_game_ini "servername" "ServerName" + fn_info_game_ini "serverpassword" "ServerPassword" + fn_info_game_ini "serverpasswordenabled" "bServerPassword" fi maxplayers="${maxplayers:-"0"}" queueenabled="${queueenabled:-"NOT SET"}" queueport="${queueport:-"0"}" rconenabled="${rconenabled:-"NOT SET"}" + rconpassword="${rconpassword:-"NOT SET"}" rconport="${rconport:-"0"}" servername="${servername:-"NOT SET"}" + serverpassword="${serverpassword:-"NOT SET"}" + serverpasswordenabled="${serverpasswordenabled:-"NOT SET"}" } # Config Type: ini diff --git a/lgsm/modules/info_messages.sh b/lgsm/modules/info_messages.sh index 948787e4b6..302f54a38c 100644 --- a/lgsm/modules/info_messages.sh +++ b/lgsm/modules/info_messages.sh @@ -1505,7 +1505,8 @@ fn_info_message_ti() { { fn_port "header" fn_port "Game" port udp - fn_port "Query" queryport udp + fn_port "Queue" queueport tcp + fn_port "RCON" rconport tcp } | column -s $'\t' -t } From bbc5a98b4802ebe2c5ac94cfb3855631643c03bd Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Wed, 12 Jul 2023 14:04:34 +0100 Subject: [PATCH 122/181] feat: download appmanifest files for goldsrc games (#4260) * add appmanifest files to data * refactor: improve appmanifest check and force update logic The code changes refactor the `fn_appmanifest_check` function in the `core_steamcmd.sh` file. The improvements include: - Checking if `BytesDownloaded` and `BytesToDownload` match, and forcing an update if they don't. - Checking if `BytesStaged` and `BytesToStage` match, and forcing an update if they don't. - For GoldSrc engine, checking if `SharedDepots` exists in the appmanifest file, and forcing an update if it doesn't. - Fetching missing appmanifest files from GitHub for specific game shortnames. These changes enhance the reliability of the appmanifest check process and ensure that updates are forced when necessary. * a * refactor: improve removal of appinfo.vdf file The code has been refactored to improve the removal of the appinfo.vdf file. The find command now redirects error output to /dev/null for a cleaner execution. * a * fn_check_steamcmd_appmanifest is now a full check * a * a * feat: add support for fetching appmanifest files This commit adds support for fetching appmanifest files from the GitHub repository. The code now fetches the appropriate appmanifest files based on the game's shortname and updates them in the serverfiles/steamapps directory. This change ensures that the correct appmanifest files are used, fixing an issue related to updating certain games. * more appmanifest files * feat: add appmanifest_10.acf for Counter-Strike Added the appmanifest_10.acf file for Counter-Strike to resolve an issue with missing SharedDepots. This commit fetches the necessary files from GitHub and forces an update to correct the issue. --- lgsm/data/appmanifest/ahl/appmanifest_10.acf | 36 ++++++ lgsm/data/appmanifest/ahl/appmanifest_70.acf | 41 +++++++ lgsm/data/appmanifest/ahl/appmanifest_90.acf | 49 ++++++++ lgsm/data/appmanifest/bb/appmanifest_10.acf | 36 ++++++ lgsm/data/appmanifest/bb/appmanifest_70.acf | 41 +++++++ lgsm/data/appmanifest/bb/appmanifest_90.acf | 49 ++++++++ lgsm/data/appmanifest/cscz/appmanifest_10.acf | 36 ++++++ lgsm/data/appmanifest/cscz/appmanifest_70.acf | 41 +++++++ lgsm/data/appmanifest/cscz/appmanifest_80.acf | 36 ++++++ lgsm/data/appmanifest/cscz/appmanifest_90.acf | 50 +++++++++ lgsm/data/appmanifest/css/appmanifest_10.acf | 36 ++++++ lgsm/data/appmanifest/css/appmanifest_70.acf | 41 +++++++ lgsm/data/appmanifest/css/appmanifest_90.acf | 49 ++++++++ lgsm/data/appmanifest/dmc/appmanifest_10.acf | 36 ++++++ lgsm/data/appmanifest/dmc/appmanifest_40.acf | 36 ++++++ lgsm/data/appmanifest/dmc/appmanifest_70.acf | 41 +++++++ lgsm/data/appmanifest/dmc/appmanifest_90.acf | 50 +++++++++ lgsm/data/appmanifest/dod/appmanifest_10.acf | 36 ++++++ lgsm/data/appmanifest/dod/appmanifest_30.acf | 36 ++++++ lgsm/data/appmanifest/dod/appmanifest_70.acf | 41 +++++++ lgsm/data/appmanifest/dod/appmanifest_90.acf | 50 +++++++++ lgsm/data/appmanifest/hldm/appmanifest_10.acf | 36 ++++++ lgsm/data/appmanifest/hldm/appmanifest_70.acf | 41 +++++++ lgsm/data/appmanifest/hldm/appmanifest_90.acf | 47 ++++++++ lgsm/data/appmanifest/ns/appmanifest_10.acf | 36 ++++++ lgsm/data/appmanifest/ns/appmanifest_70.acf | 41 +++++++ lgsm/data/appmanifest/ns/appmanifest_90.acf | 49 ++++++++ .../data/appmanifest/opfor/appmanifest_10.acf | 36 ++++++ .../data/appmanifest/opfor/appmanifest_50.acf | 36 ++++++ .../data/appmanifest/opfor/appmanifest_70.acf | 41 +++++++ .../data/appmanifest/opfor/appmanifest_90.acf | 50 +++++++++ .../appmanifest/ricochet/appmanifest_10.acf | 36 ++++++ .../appmanifest/ricochet/appmanifest_60.acf | 36 ++++++ .../appmanifest/ricochet/appmanifest_70.acf | 41 +++++++ .../appmanifest/ricochet/appmanifest_90.acf | 50 +++++++++ lgsm/data/appmanifest/tfc/appmanifest_10.acf | 36 ++++++ lgsm/data/appmanifest/tfc/appmanifest_20.acf | 36 ++++++ lgsm/data/appmanifest/tfc/appmanifest_70.acf | 41 +++++++ lgsm/data/appmanifest/tfc/appmanifest_90.acf | 50 +++++++++ lgsm/data/appmanifest/ts/appmanifest_10.acf | 36 ++++++ lgsm/data/appmanifest/ts/appmanifest_70.acf | 41 +++++++ lgsm/data/appmanifest/ts/appmanifest_90.acf | 49 ++++++++ lgsm/data/appmanifest/vs/appmanifest_10.acf | 36 ++++++ lgsm/data/appmanifest/vs/appmanifest_70.acf | 41 +++++++ lgsm/data/appmanifest/vs/appmanifest_90.acf | 49 ++++++++ lgsm/modules/core_steamcmd.sh | 105 ++++++++++++++++-- lgsm/modules/install_server_files.sh | 1 + 47 files changed, 1957 insertions(+), 7 deletions(-) create mode 100644 lgsm/data/appmanifest/ahl/appmanifest_10.acf create mode 100644 lgsm/data/appmanifest/ahl/appmanifest_70.acf create mode 100644 lgsm/data/appmanifest/ahl/appmanifest_90.acf create mode 100644 lgsm/data/appmanifest/bb/appmanifest_10.acf create mode 100644 lgsm/data/appmanifest/bb/appmanifest_70.acf create mode 100644 lgsm/data/appmanifest/bb/appmanifest_90.acf create mode 100644 lgsm/data/appmanifest/cscz/appmanifest_10.acf create mode 100644 lgsm/data/appmanifest/cscz/appmanifest_70.acf create mode 100644 lgsm/data/appmanifest/cscz/appmanifest_80.acf create mode 100644 lgsm/data/appmanifest/cscz/appmanifest_90.acf create mode 100644 lgsm/data/appmanifest/css/appmanifest_10.acf create mode 100644 lgsm/data/appmanifest/css/appmanifest_70.acf create mode 100644 lgsm/data/appmanifest/css/appmanifest_90.acf create mode 100644 lgsm/data/appmanifest/dmc/appmanifest_10.acf create mode 100644 lgsm/data/appmanifest/dmc/appmanifest_40.acf create mode 100644 lgsm/data/appmanifest/dmc/appmanifest_70.acf create mode 100644 lgsm/data/appmanifest/dmc/appmanifest_90.acf create mode 100644 lgsm/data/appmanifest/dod/appmanifest_10.acf create mode 100644 lgsm/data/appmanifest/dod/appmanifest_30.acf create mode 100644 lgsm/data/appmanifest/dod/appmanifest_70.acf create mode 100644 lgsm/data/appmanifest/dod/appmanifest_90.acf create mode 100644 lgsm/data/appmanifest/hldm/appmanifest_10.acf create mode 100644 lgsm/data/appmanifest/hldm/appmanifest_70.acf create mode 100644 lgsm/data/appmanifest/hldm/appmanifest_90.acf create mode 100644 lgsm/data/appmanifest/ns/appmanifest_10.acf create mode 100644 lgsm/data/appmanifest/ns/appmanifest_70.acf create mode 100644 lgsm/data/appmanifest/ns/appmanifest_90.acf create mode 100644 lgsm/data/appmanifest/opfor/appmanifest_10.acf create mode 100644 lgsm/data/appmanifest/opfor/appmanifest_50.acf create mode 100644 lgsm/data/appmanifest/opfor/appmanifest_70.acf create mode 100644 lgsm/data/appmanifest/opfor/appmanifest_90.acf create mode 100644 lgsm/data/appmanifest/ricochet/appmanifest_10.acf create mode 100644 lgsm/data/appmanifest/ricochet/appmanifest_60.acf create mode 100644 lgsm/data/appmanifest/ricochet/appmanifest_70.acf create mode 100644 lgsm/data/appmanifest/ricochet/appmanifest_90.acf create mode 100644 lgsm/data/appmanifest/tfc/appmanifest_10.acf create mode 100644 lgsm/data/appmanifest/tfc/appmanifest_20.acf create mode 100644 lgsm/data/appmanifest/tfc/appmanifest_70.acf create mode 100644 lgsm/data/appmanifest/tfc/appmanifest_90.acf create mode 100644 lgsm/data/appmanifest/ts/appmanifest_10.acf create mode 100644 lgsm/data/appmanifest/ts/appmanifest_70.acf create mode 100644 lgsm/data/appmanifest/ts/appmanifest_90.acf create mode 100644 lgsm/data/appmanifest/vs/appmanifest_10.acf create mode 100644 lgsm/data/appmanifest/vs/appmanifest_70.acf create mode 100644 lgsm/data/appmanifest/vs/appmanifest_90.acf diff --git a/lgsm/data/appmanifest/ahl/appmanifest_10.acf b/lgsm/data/appmanifest/ahl/appmanifest_10.acf new file mode 100644 index 0000000000..0c9023856a --- /dev/null +++ b/lgsm/data/appmanifest/ahl/appmanifest_10.acf @@ -0,0 +1,36 @@ +"AppState" +{ + "appid" "10" + "Universe" "1" + "name" "Counter-Strike" + "StateFlags" "68" + "installdir" "Half-Life" + "LastUpdated" "1688984402" + "SizeOnDisk" "0" + "StagingSize" "0" + "buildid" "0" + "LastOwner" "0" + "UpdateResult" "0" + "BytesToDownload" "0" + "BytesDownloaded" "0" + "BytesToStage" "0" + "BytesStaged" "0" + "TargetBuildID" "0" + "AutoUpdateBehavior" "0" + "AllowOtherDownloadsWhileRunning" "0" + "ScheduledAutoUpdate" "0" + "InstalledDepots" + { + "11" + { + "manifest" "4720911300072406946" + "size" "292616113" + } + } + "UserConfig" + { + } + "MountedConfig" + { + } +} diff --git a/lgsm/data/appmanifest/ahl/appmanifest_70.acf b/lgsm/data/appmanifest/ahl/appmanifest_70.acf new file mode 100644 index 0000000000..9eb708ddd5 --- /dev/null +++ b/lgsm/data/appmanifest/ahl/appmanifest_70.acf @@ -0,0 +1,41 @@ +"AppState" +{ + "appid" "70" + "Universe" "1" + "name" "Half-Life" + "StateFlags" "68" + "installdir" "Half-Life" + "LastUpdated" "1688984404" + "SizeOnDisk" "0" + "StagingSize" "0" + "buildid" "0" + "LastOwner" "0" + "UpdateResult" "0" + "BytesToDownload" "0" + "BytesDownloaded" "0" + "BytesToStage" "0" + "BytesStaged" "0" + "TargetBuildID" "0" + "AutoUpdateBehavior" "0" + "AllowOtherDownloadsWhileRunning" "0" + "ScheduledAutoUpdate" "0" + "InstalledDepots" + { + "1" + { + "manifest" "5928322771446233610" + "size" "429833890" + } + "71" + { + "manifest" "9183617604528345869" + "size" "15302314" + } + } + "UserConfig" + { + } + "MountedConfig" + { + } +} diff --git a/lgsm/data/appmanifest/ahl/appmanifest_90.acf b/lgsm/data/appmanifest/ahl/appmanifest_90.acf new file mode 100644 index 0000000000..421982e7da --- /dev/null +++ b/lgsm/data/appmanifest/ahl/appmanifest_90.acf @@ -0,0 +1,49 @@ +"AppState" +{ + "appid" "90" + "Universe" "1" + "name" "Half-Life Dedicated Server" + "StateFlags" "4" + "installdir" "Half-Life" + "LastUpdated" "1688984267" + "SizeOnDisk" "0" + "StagingSize" "0" + "buildid" "0" + "LastOwner" "76561200949853436" + "UpdateResult" "0" + "BytesToDownload" "0" + "BytesDownloaded" "0" + "BytesToStage" "0" + "BytesStaged" "0" + "TargetBuildID" "0" + "AutoUpdateBehavior" "0" + "AllowOtherDownloadsWhileRunning" "0" + "ScheduledAutoUpdate" "0" + "InstalledDepots" + { + "4" + { + "manifest" "8690279432129063737" + "size" "25737094" + } + "1006" + { + "manifest" "6912453647411644579" + "size" "72573740" + } + } + "SharedDepots" + { + "1" "70" + "11" "10" + "71" "70" + } + "UserConfig" + { + "mod" "cstrike" + } + "MountedConfig" + { + "mod" "cstrike" + } +} diff --git a/lgsm/data/appmanifest/bb/appmanifest_10.acf b/lgsm/data/appmanifest/bb/appmanifest_10.acf new file mode 100644 index 0000000000..604394744e --- /dev/null +++ b/lgsm/data/appmanifest/bb/appmanifest_10.acf @@ -0,0 +1,36 @@ +"AppState" +{ + "appid" "10" + "Universe" "1" + "name" "Counter-Strike" + "StateFlags" "68" + "installdir" "Half-Life" + "LastUpdated" "1688984405" + "SizeOnDisk" "03" + "StagingSize" "0" + "buildid" "0" + "LastOwner" "0" + "UpdateResult" "0" + "BytesToDownload" "0" + "BytesDownloaded" "0" + "BytesToStage" "0" + "BytesStaged" "0" + "TargetBuildID" "0" + "AutoUpdateBehavior" "0" + "AllowOtherDownloadsWhileRunning" "0" + "ScheduledAutoUpdate" "0" + "InstalledDepots" + { + "11" + { + "manifest" "4720911300072406946" + "size" "292616113" + } + } + "UserConfig" + { + } + "MountedConfig" + { + } +} diff --git a/lgsm/data/appmanifest/bb/appmanifest_70.acf b/lgsm/data/appmanifest/bb/appmanifest_70.acf new file mode 100644 index 0000000000..36f34d2ce9 --- /dev/null +++ b/lgsm/data/appmanifest/bb/appmanifest_70.acf @@ -0,0 +1,41 @@ +"AppState" +{ + "appid" "70" + "Universe" "1" + "name" "Half-Life" + "StateFlags" "68" + "installdir" "Half-Life" + "LastUpdated" "1688984407" + "SizeOnDisk" "0" + "StagingSize" "0" + "buildid" "0" + "LastOwner" "0" + "UpdateResult" "0" + "BytesToDownload" "0" + "BytesDownloaded" "0" + "BytesToStage" "0" + "BytesStaged" "0" + "TargetBuildID" "0" + "AutoUpdateBehavior" "0" + "AllowOtherDownloadsWhileRunning" "0" + "ScheduledAutoUpdate" "0" + "InstalledDepots" + { + "1" + { + "manifest" "5928322771446233610" + "size" "429833890" + } + "71" + { + "manifest" "9183617604528345869" + "size" "15302314" + } + } + "UserConfig" + { + } + "MountedConfig" + { + } +} diff --git a/lgsm/data/appmanifest/bb/appmanifest_90.acf b/lgsm/data/appmanifest/bb/appmanifest_90.acf new file mode 100644 index 0000000000..c56dda551e --- /dev/null +++ b/lgsm/data/appmanifest/bb/appmanifest_90.acf @@ -0,0 +1,49 @@ +"AppState" +{ + "appid" "90" + "Universe" "1" + "name" "Half-Life Dedicated Server" + "StateFlags" "4" + "installdir" "Half-Life" + "LastUpdated" "1688984269" + "SizeOnDisk" "0" + "StagingSize" "0" + "buildid" "0" + "LastOwner" "76561200402315446" + "UpdateResult" "0" + "BytesToDownload" "0" + "BytesDownloaded" "0" + "BytesToStage" "0" + "BytesStaged" "0" + "TargetBuildID" "0" + "AutoUpdateBehavior" "0" + "AllowOtherDownloadsWhileRunning" "0" + "ScheduledAutoUpdate" "0" + "InstalledDepots" + { + "4" + { + "manifest" "8690279432129063737" + "size" "25737094" + } + "1006" + { + "manifest" "6912453647411644579" + "size" "72573740" + } + } + "SharedDepots" + { + "1" "70" + "11" "10" + "71" "70" + } + "UserConfig" + { + "mod" "cstrike" + } + "MountedConfig" + { + "mod" "cstrike" + } +} diff --git a/lgsm/data/appmanifest/cscz/appmanifest_10.acf b/lgsm/data/appmanifest/cscz/appmanifest_10.acf new file mode 100644 index 0000000000..c5afe8bc00 --- /dev/null +++ b/lgsm/data/appmanifest/cscz/appmanifest_10.acf @@ -0,0 +1,36 @@ +"AppState" +{ + "appid" "10" + "Universe" "1" + "name" "Counter-Strike" + "StateFlags" "68" + "installdir" "Half-Life" + "LastUpdated" "1666731530" + "SizeOnDisk" "0" + "StagingSize" "0" + "buildid" "0" + "LastOwner" "0" + "UpdateResult" "0" + "BytesToDownload" "0" + "BytesDownloaded" "0" + "BytesToStage" "0" + "BytesStaged" "0" + "TargetBuildID" "0" + "AutoUpdateBehavior" "0" + "AllowOtherDownloadsWhileRunning" "0" + "ScheduledAutoUpdate" "0" + "InstalledDepots" + { + "11" + { + "manifest" "4720911300072406946" + "size" "292616113" + } + } + "UserConfig" + { + } + "MountedConfig" + { + } +} diff --git a/lgsm/data/appmanifest/cscz/appmanifest_70.acf b/lgsm/data/appmanifest/cscz/appmanifest_70.acf new file mode 100644 index 0000000000..a4157d7e0f --- /dev/null +++ b/lgsm/data/appmanifest/cscz/appmanifest_70.acf @@ -0,0 +1,41 @@ +"AppState" +{ + "appid" "70" + "Universe" "1" + "name" "Half-Life" + "StateFlags" "68" + "installdir" "Half-Life" + "LastUpdated" "1666731530" + "SizeOnDisk" "0" + "StagingSize" "0" + "buildid" "0" + "LastOwner" "0" + "UpdateResult" "0" + "BytesToDownload" "0" + "BytesDownloaded" "0" + "BytesToStage" "0" + "BytesStaged" "0" + "TargetBuildID" "0" + "AutoUpdateBehavior" "0" + "AllowOtherDownloadsWhileRunning" "0" + "ScheduledAutoUpdate" "0" + "InstalledDepots" + { + "1" + { + "manifest" "5928322771446233610" + "size" "429833890" + } + "71" + { + "manifest" "9183617604528345869" + "size" "15302314" + } + } + "UserConfig" + { + } + "MountedConfig" + { + } +} diff --git a/lgsm/data/appmanifest/cscz/appmanifest_80.acf b/lgsm/data/appmanifest/cscz/appmanifest_80.acf new file mode 100644 index 0000000000..ec35c446d1 --- /dev/null +++ b/lgsm/data/appmanifest/cscz/appmanifest_80.acf @@ -0,0 +1,36 @@ +"AppState" +{ + "appid" "80" + "Universe" "1" + "name" "Counter-Strike: Condition Zero" + "StateFlags" "68" + "installdir" "Half-Life" + "LastUpdated" "1666731530" + "SizeOnDisk" "0" + "StagingSize" "0" + "buildid" "0" + "LastOwner" "0" + "UpdateResult" "0" + "BytesToDownload" "0" + "BytesDownloaded" "0" + "BytesToStage" "0" + "BytesStaged" "0" + "TargetBuildID" "0" + "AutoUpdateBehavior" "0" + "AllowOtherDownloadsWhileRunning" "0" + "ScheduledAutoUpdate" "0" + "InstalledDepots" + { + "81" + { + "manifest" "3601230779843470737" + "size" "415387682" + } + } + "UserConfig" + { + } + "MountedConfig" + { + } +} diff --git a/lgsm/data/appmanifest/cscz/appmanifest_90.acf b/lgsm/data/appmanifest/cscz/appmanifest_90.acf new file mode 100644 index 0000000000..184a92b960 --- /dev/null +++ b/lgsm/data/appmanifest/cscz/appmanifest_90.acf @@ -0,0 +1,50 @@ +"AppState" +{ + "appid" "90" + "Universe" "1" + "name" "Half-Life Dedicated Server" + "StateFlags" "4" + "installdir" "Half-Life" + "LastUpdated" "1666731360" + "SizeOnDisk" "0" + "StagingSize" "0" + "buildid" "0" + "LastOwner" "76561201630089482" + "UpdateResult" "0" + "BytesToDownload" "0" + "BytesDownloaded" "0" + "BytesToStage" "0" + "BytesStaged" "0" + "TargetBuildID" "0" + "AutoUpdateBehavior" "0" + "AllowOtherDownloadsWhileRunning" "0" + "ScheduledAutoUpdate" "0" + "InstalledDepots" + { + "4" + { + "manifest" "8690279432129063737" + "size" "25737094" + } + "1006" + { + "manifest" "6912453647411644579" + "size" "72573740" + } + } + "SharedDepots" + { + "1" "70" + "11" "10" + "71" "70" + "81" "80" + } + "UserConfig" + { + "mod" "czero" + } + "MountedConfig" + { + "mod" "czero" + } +} diff --git a/lgsm/data/appmanifest/css/appmanifest_10.acf b/lgsm/data/appmanifest/css/appmanifest_10.acf new file mode 100644 index 0000000000..0c9b528dcb --- /dev/null +++ b/lgsm/data/appmanifest/css/appmanifest_10.acf @@ -0,0 +1,36 @@ +"AppState" +{ + "appid" "10" + "Universe" "1" + "name" "Counter-Strike" + "StateFlags" "68" + "installdir" "Half-Life" + "LastUpdated" "1688984302" + "SizeOnDisk" "0" + "StagingSize" "0" + "buildid" "0" + "LastOwner" "0" + "UpdateResult" "0" + "BytesToDownload" "0" + "BytesDownloaded" "0" + "BytesToStage" "0" + "BytesStaged" "0" + "TargetBuildID" "0" + "AutoUpdateBehavior" "0" + "AllowOtherDownloadsWhileRunning" "0" + "ScheduledAutoUpdate" "0" + "InstalledDepots" + { + "11" + { + "manifest" "4720911300072406946" + "size" "292616113" + } + } + "UserConfig" + { + } + "MountedConfig" + { + } +} diff --git a/lgsm/data/appmanifest/css/appmanifest_70.acf b/lgsm/data/appmanifest/css/appmanifest_70.acf new file mode 100644 index 0000000000..0a417f8db6 --- /dev/null +++ b/lgsm/data/appmanifest/css/appmanifest_70.acf @@ -0,0 +1,41 @@ +"AppState" +{ + "appid" "70" + "Universe" "1" + "name" "Half-Life" + "StateFlags" "68" + "installdir" "Half-Life" + "LastUpdated" "1688984304" + "SizeOnDisk" "0" + "StagingSize" "0" + "buildid" "0" + "LastOwner" "0" + "UpdateResult" "0" + "BytesToDownload" "0" + "BytesDownloaded" "0" + "BytesToStage" "0" + "BytesStaged" "0" + "TargetBuildID" "0" + "AutoUpdateBehavior" "0" + "AllowOtherDownloadsWhileRunning" "0" + "ScheduledAutoUpdate" "0" + "InstalledDepots" + { + "1" + { + "manifest" "5928322771446233610" + "size" "429833890" + } + "71" + { + "manifest" "9183617604528345869" + "size" "15302314" + } + } + "UserConfig" + { + } + "MountedConfig" + { + } +} diff --git a/lgsm/data/appmanifest/css/appmanifest_90.acf b/lgsm/data/appmanifest/css/appmanifest_90.acf new file mode 100644 index 0000000000..3710f9794e --- /dev/null +++ b/lgsm/data/appmanifest/css/appmanifest_90.acf @@ -0,0 +1,49 @@ +"AppState" +{ + "appid" "90" + "Universe" "1" + "name" "Half-Life Dedicated Server" + "StateFlags" "4" + "installdir" "Half-Life" + "LastUpdated" "1688984230" + "SizeOnDisk" "0" + "StagingSize" "0" + "buildid" "0" + "LastOwner" "76561201379539094" + "UpdateResult" "0" + "BytesToDownload" "0" + "BytesDownloaded" "0" + "BytesToStage" "0" + "BytesStaged" 0" + "TargetBuildID" "0" + "AutoUpdateBehavior" "0" + "AllowOtherDownloadsWhileRunning" "0" + "ScheduledAutoUpdate" "0" + "InstalledDepots" + { + "4" + { + "manifest" "8690279432129063737" + "size" "25737094" + } + "1006" + { + "manifest" "6912453647411644579" + "size" "72573740" + } + } + "SharedDepots" + { + "1" "70" + "11" "10" + "71" "70" + } + "UserConfig" + { + "mod" "cstrike" + } + "MountedConfig" + { + "mod" "cstrike" + } +} diff --git a/lgsm/data/appmanifest/dmc/appmanifest_10.acf b/lgsm/data/appmanifest/dmc/appmanifest_10.acf new file mode 100644 index 0000000000..2ce041bb63 --- /dev/null +++ b/lgsm/data/appmanifest/dmc/appmanifest_10.acf @@ -0,0 +1,36 @@ +"AppState" +{ + "appid" "10" + "Universe" "1" + "name" "Counter-Strike" + "StateFlags" "68" + "installdir" "Half-Life" + "LastUpdated" "1688984403" + "SizeOnDisk" "0" + "StagingSize" "0" + "buildid" "0" + "LastOwner" "0" + "UpdateResult" "0" + "BytesToDownload" "0" + "BytesDownloaded" "0" + "BytesToStage" "0" + "BytesStaged" "0" + "TargetBuildID" "0" + "AutoUpdateBehavior" "0" + "AllowOtherDownloadsWhileRunning" "0" + "ScheduledAutoUpdate" "0" + "InstalledDepots" + { + "11" + { + "manifest" "4720911300072406946" + "size" "292616113" + } + } + "UserConfig" + { + } + "MountedConfig" + { + } +} diff --git a/lgsm/data/appmanifest/dmc/appmanifest_40.acf b/lgsm/data/appmanifest/dmc/appmanifest_40.acf new file mode 100644 index 0000000000..11cf69421b --- /dev/null +++ b/lgsm/data/appmanifest/dmc/appmanifest_40.acf @@ -0,0 +1,36 @@ +"AppState" +{ + "appid" "40" + "Universe" "1" + "name" "Deathmatch Classic" + "StateFlags" "68" + "installdir" "Half-Life" + "LastUpdated" "1688984402" + "SizeOnDisk" "0" + "StagingSize" "0" + "buildid" "0" + "LastOwner" "0" + "UpdateResult" "0" + "BytesToDownload" "0" + "BytesDownloaded" "0" + "BytesToStage" "0" + "BytesStaged" "0" + "TargetBuildID" "0" + "AutoUpdateBehavior" "0" + "AllowOtherDownloadsWhileRunning" "0" + "ScheduledAutoUpdate" "0" + "InstalledDepots" + { + "41" + { + "manifest" "2010889186716175170" + "size" "48239254" + } + } + "UserConfig" + { + } + "MountedConfig" + { + } +} diff --git a/lgsm/data/appmanifest/dmc/appmanifest_70.acf b/lgsm/data/appmanifest/dmc/appmanifest_70.acf new file mode 100644 index 0000000000..1b33e8442b --- /dev/null +++ b/lgsm/data/appmanifest/dmc/appmanifest_70.acf @@ -0,0 +1,41 @@ +"AppState" +{ + "appid" "70" + "Universe" "1" + "name" "Half-Life" + "StateFlags" "68" + "installdir" "Half-Life" + "LastUpdated" "1688984405" + "SizeOnDisk" "0" + "StagingSize" "0" + "buildid" "0" + "LastOwner" "0" + "UpdateResult" "0" + "BytesToDownload" "0" + "BytesDownloaded" "0" + "BytesToStage" "0" + "BytesStaged" "0" + "TargetBuildID" "0" + "AutoUpdateBehavior" "0" + "AllowOtherDownloadsWhileRunning" "0" + "ScheduledAutoUpdate" "0" + "InstalledDepots" + { + "1" + { + "manifest" "5928322771446233610" + "size" "429833890" + } + "71" + { + "manifest" "9183617604528345869" + "size" "15302314" + } + } + "UserConfig" + { + } + "MountedConfig" + { + } +} diff --git a/lgsm/data/appmanifest/dmc/appmanifest_90.acf b/lgsm/data/appmanifest/dmc/appmanifest_90.acf new file mode 100644 index 0000000000..3fe759c2db --- /dev/null +++ b/lgsm/data/appmanifest/dmc/appmanifest_90.acf @@ -0,0 +1,50 @@ +"AppState" +{ + "appid" "90" + "Universe" "1" + "name" "Half-Life Dedicated Server" + "StateFlags" "4" + "installdir" "Half-Life" + "LastUpdated" "1688984269" + "SizeOnDisk" "0" + "StagingSize" "0" + "buildid" "0" + "LastOwner" "76561201891266584" + "UpdateResult" "0" + "BytesToDownload" "0" + "BytesDownloaded" "0" + "BytesToStage" "0" + "BytesStaged" "0" + "TargetBuildID" "0" + "AutoUpdateBehavior" "0" + "AllowOtherDownloadsWhileRunning" "0" + "ScheduledAutoUpdate" "0" + "InstalledDepots" + { + "4" + { + "manifest" "8690279432129063737" + "size" "25737094" + } + "1006" + { + "manifest" "6912453647411644579" + "size" "72573740" + } + } + "SharedDepots" + { + "1" "70" + "11" "10" + "71" "70" + "41" "40" + } + "UserConfig" + { + "mod" "dmc" + } + "MountedConfig" + { + "mod" "dmc" + } +} diff --git a/lgsm/data/appmanifest/dod/appmanifest_10.acf b/lgsm/data/appmanifest/dod/appmanifest_10.acf new file mode 100644 index 0000000000..afe7cb85a4 --- /dev/null +++ b/lgsm/data/appmanifest/dod/appmanifest_10.acf @@ -0,0 +1,36 @@ +"AppState" +{ + "appid" "10" + "Universe" "1" + "name" "Counter-Strike" + "StateFlags" "68" + "installdir" "Half-Life" + "LastUpdated" "1688988451" + "SizeOnDisk" "0" + "StagingSize" "0" + "buildid" "0" + "LastOwner" "0" + "UpdateResult" "0" + "BytesToDownload" "0" + "BytesDownloaded" "0" + "BytesToStage" "0" + "BytesStaged" "0" + "TargetBuildID" "0" + "AutoUpdateBehavior" "0" + "AllowOtherDownloadsWhileRunning" "0" + "ScheduledAutoUpdate" "0" + "InstalledDepots" + { + "11" + { + "manifest" "4720911300072406946" + "size" "292616113" + } + } + "UserConfig" + { + } + "MountedConfig" + { + } +} diff --git a/lgsm/data/appmanifest/dod/appmanifest_30.acf b/lgsm/data/appmanifest/dod/appmanifest_30.acf new file mode 100644 index 0000000000..c4acdb3bde --- /dev/null +++ b/lgsm/data/appmanifest/dod/appmanifest_30.acf @@ -0,0 +1,36 @@ +"AppState" +{ + "appid" "30" + "Universe" "1" + "name" "Day of Defeat" + "StateFlags" "68" + "installdir" "Half-Life" + "LastUpdated" "1688988451" + "SizeOnDisk" "0" + "StagingSize" "0" + "buildid" "0" + "LastOwner" "0" + "UpdateResult" "0" + "BytesToDownload" "0" + "BytesDownloaded" "0" + "BytesToStage" "0" + "BytesStaged" "0" + "TargetBuildID" "0" + "AutoUpdateBehavior" "0" + "AllowOtherDownloadsWhileRunning" "0" + "ScheduledAutoUpdate" "0" + "InstalledDepots" + { + "31" + { + "manifest" "3826716661969602728" + "size" "391387184" + } + } + "UserConfig" + { + } + "MountedConfig" + { + } +} diff --git a/lgsm/data/appmanifest/dod/appmanifest_70.acf b/lgsm/data/appmanifest/dod/appmanifest_70.acf new file mode 100644 index 0000000000..fb91ddb35c --- /dev/null +++ b/lgsm/data/appmanifest/dod/appmanifest_70.acf @@ -0,0 +1,41 @@ +"AppState" +{ + "appid" "70" + "Universe" "1" + "name" "Half-Life" + "StateFlags" "68" + "installdir" "Half-Life" + "LastUpdated" "1688988452" + "SizeOnDisk" "0" + "StagingSize" "0" + "buildid" "0" + "LastOwner" "0" + "UpdateResult" "0" + "BytesToDownload" "0" + "BytesDownloaded" "0" + "BytesToStage" "0" + "BytesStaged" "0" + "TargetBuildID" "0" + "AutoUpdateBehavior" "0" + "AllowOtherDownloadsWhileRunning" "0" + "ScheduledAutoUpdate" "0" + "InstalledDepots" + { + "1" + { + "manifest" "5928322771446233610" + "size" "429833890" + } + "71" + { + "manifest" "9183617604528345869" + "size" "15302314" + } + } + "UserConfig" + { + } + "MountedConfig" + { + } +} diff --git a/lgsm/data/appmanifest/dod/appmanifest_90.acf b/lgsm/data/appmanifest/dod/appmanifest_90.acf new file mode 100644 index 0000000000..c57a3f67fe --- /dev/null +++ b/lgsm/data/appmanifest/dod/appmanifest_90.acf @@ -0,0 +1,50 @@ +"AppState" +{ + "appid" "90" + "Universe" "1" + "name" "Half-Life Dedicated Server" + "StateFlags" "4" + "installdir" "Half-Life" + "LastUpdated" "1688988429" + "SizeOnDisk" "0" + "StagingSize" "0" + "buildid" "0" + "LastOwner" "76561201442771088" + "UpdateResult" "0" + "BytesToDownload" "0" + "BytesDownloaded" "0" + "BytesToStage" "0" + "BytesStaged" "0" + "TargetBuildID" "0" + "AutoUpdateBehavior" "0" + "AllowOtherDownloadsWhileRunning" "0" + "ScheduledAutoUpdate" "0" + "InstalledDepots" + { + "4" + { + "manifest" "8690279432129063737" + "size" "25737094" + } + "1006" + { + "manifest" "6912453647411644579" + "size" "72573740" + } + } + "SharedDepots" + { + "1" "70" + "11" "10" + "71" "70" + "31" "30" + } + "UserConfig" + { + "mod" "dod" + } + "MountedConfig" + { + "mod" "dod" + } +} diff --git a/lgsm/data/appmanifest/hldm/appmanifest_10.acf b/lgsm/data/appmanifest/hldm/appmanifest_10.acf new file mode 100644 index 0000000000..de7355ea08 --- /dev/null +++ b/lgsm/data/appmanifest/hldm/appmanifest_10.acf @@ -0,0 +1,36 @@ +"AppState" +{ + "appid" "10" + "Universe" "1" + "name" "Counter-Strike" + "StateFlags" "68" + "installdir" "Half-Life" + "LastUpdated" "1688984411" + "SizeOnDisk" "0" + "StagingSize" "0" + "buildid" "0" + "LastOwner" "0" + "UpdateResult" "0" + "BytesToDownload" "0" + "BytesDownloaded" "0" + "BytesToStage" "0" + "BytesStaged" "0" + "TargetBuildID" "0" + "AutoUpdateBehavior" "0" + "AllowOtherDownloadsWhileRunning" "0" + "ScheduledAutoUpdate" "0" + "InstalledDepots" + { + "11" + { + "manifest" "4720911300072406946" + "size" "292616113" + } + } + "UserConfig" + { + } + "MountedConfig" + { + } +} diff --git a/lgsm/data/appmanifest/hldm/appmanifest_70.acf b/lgsm/data/appmanifest/hldm/appmanifest_70.acf new file mode 100644 index 0000000000..0f4b4157fc --- /dev/null +++ b/lgsm/data/appmanifest/hldm/appmanifest_70.acf @@ -0,0 +1,41 @@ +"AppState" +{ + "appid" "70" + "Universe" "1" + "name" "Half-Life" + "StateFlags" "68" + "installdir" "Half-Life" + "LastUpdated" "1688984413" + "SizeOnDisk" "0" + "StagingSize" "0" + "buildid" "0" + "LastOwner" "0" + "UpdateResult" "0" + "BytesToDownload" "0" + "BytesDownloaded" "0" + "BytesToStage" "0" + "BytesStaged" "0" + "TargetBuildID" "0" + "AutoUpdateBehavior" "0" + "AllowOtherDownloadsWhileRunning" "0" + "ScheduledAutoUpdate" "0" + "InstalledDepots" + { + "1" + { + "manifest" "5928322771446233610" + "size" "429833890" + } + "71" + { + "manifest" "9183617604528345869" + "size" "15302314" + } + } + "UserConfig" + { + } + "MountedConfig" + { + } +} diff --git a/lgsm/data/appmanifest/hldm/appmanifest_90.acf b/lgsm/data/appmanifest/hldm/appmanifest_90.acf new file mode 100644 index 0000000000..d9bfbaa7e9 --- /dev/null +++ b/lgsm/data/appmanifest/hldm/appmanifest_90.acf @@ -0,0 +1,47 @@ +"AppState" +{ + "appid" "90" + "Universe" "1" + "name" "Half-Life Dedicated Server" + "StateFlags" "4" + "installdir" "Half-Life" + "LastUpdated" "1688984301" + "SizeOnDisk" "0" + "StagingSize" "0" + "buildid" "0" + "LastOwner" "76561199593999446" + "UpdateResult" "0" + "BytesToDownload" "0" + "BytesDownloaded" "0" + "BytesToStage" "0" + "BytesStaged" "0" + "TargetBuildID" "0" + "AutoUpdateBehavior" "0" + "AllowOtherDownloadsWhileRunning" "0" + "ScheduledAutoUpdate" "0" + "InstalledDepots" + { + "4" + { + "manifest" "8690279432129063737" + "size" "25737094" + } + "1006" + { + "manifest" "6912453647411644579" + "size" "72573740" + } + } + "SharedDepots" + { + "1" "70" + "11" "10" + "71" "70" + } + "UserConfig" + { + } + "MountedConfig" + { + } +} diff --git a/lgsm/data/appmanifest/ns/appmanifest_10.acf b/lgsm/data/appmanifest/ns/appmanifest_10.acf new file mode 100644 index 0000000000..edffb84fa0 --- /dev/null +++ b/lgsm/data/appmanifest/ns/appmanifest_10.acf @@ -0,0 +1,36 @@ +"AppState" +{ + "appid" "10" + "Universe" "1" + "name" "Counter-Strike" + "StateFlags" "68" + "installdir" "Half-Life" + "LastUpdated" "1688984412" + "SizeOnDisk" "0" + "StagingSize" "0" + "buildid" "0" + "LastOwner" "0" + "UpdateResult" "0" + "BytesToDownload" "0" + "BytesDownloaded" "0" + "BytesToStage" "0" + "BytesStaged" "0" + "TargetBuildID" "0" + "AutoUpdateBehavior" "0" + "AllowOtherDownloadsWhileRunning" "0" + "ScheduledAutoUpdate" "0" + "InstalledDepots" + { + "11" + { + "manifest" "4720911300072406946" + "size" "292616113" + } + } + "UserConfig" + { + } + "MountedConfig" + { + } +} diff --git a/lgsm/data/appmanifest/ns/appmanifest_70.acf b/lgsm/data/appmanifest/ns/appmanifest_70.acf new file mode 100644 index 0000000000..f1866815d2 --- /dev/null +++ b/lgsm/data/appmanifest/ns/appmanifest_70.acf @@ -0,0 +1,41 @@ +"AppState" +{ + "appid" "70" + "Universe" "1" + "name" "Half-Life" + "StateFlags" "68" + "installdir" "Half-Life" + "LastUpdated" "1688984414" + "SizeOnDisk" "0" + "StagingSize" "0" + "buildid" "0" + "LastOwner" "0" + "UpdateResult" "0" + "BytesToDownload" "0" + "BytesDownloaded" "0" + "BytesToStage" "0" + "BytesStaged" "0" + "TargetBuildID" "0" + "AutoUpdateBehavior" "0" + "AllowOtherDownloadsWhileRunning" "0" + "ScheduledAutoUpdate" "0" + "InstalledDepots" + { + "1" + { + "manifest" "5928322771446233610" + "size" "429833890" + } + "71" + { + "manifest" "9183617604528345869" + "size" "15302314" + } + } + "UserConfig" + { + } + "MountedConfig" + { + } +} diff --git a/lgsm/data/appmanifest/ns/appmanifest_90.acf b/lgsm/data/appmanifest/ns/appmanifest_90.acf new file mode 100644 index 0000000000..f709c9b5ea --- /dev/null +++ b/lgsm/data/appmanifest/ns/appmanifest_90.acf @@ -0,0 +1,49 @@ +"AppState" +{ + "appid" "90" + "Universe" "1" + "name" "Half-Life Dedicated Server" + "StateFlags" "4" + "installdir" "Half-Life" + "LastUpdated" "1688984290" + "SizeOnDisk" "0" + "StagingSize" "0" + "buildid" "0" + "LastOwner" "76561199772965246" + "UpdateResult" "0" + "BytesToDownload" "0" + "BytesDownloaded" "0" + "BytesToStage" "0" + "BytesStaged" "0" + "TargetBuildID" "0" + "AutoUpdateBehavior" "0" + "AllowOtherDownloadsWhileRunning" "0" + "ScheduledAutoUpdate" "0" + "InstalledDepots" + { + "4" + { + "manifest" "8690279432129063737" + "size" "25737094" + } + "1006" + { + "manifest" "6912453647411644579" + "size" "72573740" + } + } + "SharedDepots" + { + "1" "70" + "11" "10" + "71" "70" + } + "UserConfig" + { + "mod" "cstrike" + } + "MountedConfig" + { + "mod" "cstrike" + } +} diff --git a/lgsm/data/appmanifest/opfor/appmanifest_10.acf b/lgsm/data/appmanifest/opfor/appmanifest_10.acf new file mode 100644 index 0000000000..8a3a4fbf41 --- /dev/null +++ b/lgsm/data/appmanifest/opfor/appmanifest_10.acf @@ -0,0 +1,36 @@ +"AppState" +{ + "appid" "10" + "Universe" "1" + "name" "Counter-Strike" + "StateFlags" "68" + "installdir" "Half-Life" + "LastUpdated" "1688984434" + "SizeOnDisk" "0" + "StagingSize" "0" + "buildid" "0" + "LastOwner" "0" + "UpdateResult" "0" + "BytesToDownload" "0" + "BytesDownloaded" "0" + "BytesToStage" "0" + "BytesStaged" "0" + "TargetBuildID" "0" + "AutoUpdateBehavior" "0" + "AllowOtherDownloadsWhileRunning" "0" + "ScheduledAutoUpdate" "0" + "InstalledDepots" + { + "11" + { + "manifest" "4720911300072406946" + "size" "292616113" + } + } + "UserConfig" + { + } + "MountedConfig" + { + } +} diff --git a/lgsm/data/appmanifest/opfor/appmanifest_50.acf b/lgsm/data/appmanifest/opfor/appmanifest_50.acf new file mode 100644 index 0000000000..83b939a0c6 --- /dev/null +++ b/lgsm/data/appmanifest/opfor/appmanifest_50.acf @@ -0,0 +1,36 @@ +"AppState" +{ + "appid" "50" + "Universe" "1" + "name" "Half-Life: Opposing Force" + "StateFlags" "68" + "installdir" "Half-Life" + "LastUpdated" "1688984434" + "SizeOnDisk" "0" + "StagingSize" "0" + "buildid" "0" + "LastOwner" "0" + "UpdateResult" "0" + "BytesToDownload" "0" + "BytesDownloaded" "0" + "BytesToStage" "0" + "BytesStaged" "0" + "TargetBuildID" "0" + "AutoUpdateBehavior" "0" + "AllowOtherDownloadsWhileRunning" "0" + "ScheduledAutoUpdate" "0" + "InstalledDepots" + { + "51" + { + "manifest" "789184054796507140" + "size" "286265390" + } + } + "UserConfig" + { + } + "MountedConfig" + { + } +} diff --git a/lgsm/data/appmanifest/opfor/appmanifest_70.acf b/lgsm/data/appmanifest/opfor/appmanifest_70.acf new file mode 100644 index 0000000000..da3db240ef --- /dev/null +++ b/lgsm/data/appmanifest/opfor/appmanifest_70.acf @@ -0,0 +1,41 @@ +"AppState" +{ + "appid" "70" + "Universe" "1" + "name" "Half-Life" + "StateFlags" "68" + "installdir" "Half-Life" + "LastUpdated" "1688984437" + "SizeOnDisk" "0" + "StagingSize" "0" + "buildid" "0" + "LastOwner" "0" + "UpdateResult" "0" + "BytesToDownload" "0" + "BytesDownloaded" "0" + "BytesToStage" "0" + "BytesStaged" "0" + "TargetBuildID" "0" + "AutoUpdateBehavior" "0" + "AllowOtherDownloadsWhileRunning" "0" + "ScheduledAutoUpdate" "0" + "InstalledDepots" + { + "1" + { + "manifest" "5928322771446233610" + "size" "429833890" + } + "71" + { + "manifest" "9183617604528345869" + "size" "15302314" + } + } + "UserConfig" + { + } + "MountedConfig" + { + } +} diff --git a/lgsm/data/appmanifest/opfor/appmanifest_90.acf b/lgsm/data/appmanifest/opfor/appmanifest_90.acf new file mode 100644 index 0000000000..1ae893bee1 --- /dev/null +++ b/lgsm/data/appmanifest/opfor/appmanifest_90.acf @@ -0,0 +1,50 @@ +"AppState" +{ + "appid" "90" + "Universe" "1" + "name" "Half-Life Dedicated Server" + "StateFlags" "4" + "installdir" "Half-Life" + "LastUpdated" "1688984298" + "SizeOnDisk" "0" + "StagingSize" "0" + "buildid" "0" + "LastOwner" "76561198622612838" + "UpdateResult" "0" + "BytesToDownload" "0" + "BytesDownloaded" "0" + "BytesToStage" "0" + "BytesStaged" "0" + "TargetBuildID" "0" + "AutoUpdateBehavior" "0" + "AllowOtherDownloadsWhileRunning" "0" + "ScheduledAutoUpdate" "0" + "InstalledDepots" + { + "4" + { + "manifest" "8690279432129063737" + "size" "25737094" + } + "1006" + { + "manifest" "6912453647411644579" + "size" "72573740" + } + } + "SharedDepots" + { + "1" "70" + "11" "10" + "71" "70" + "51" "50" + } + "UserConfig" + { + "mod" "gearbox" + } + "MountedConfig" + { + "mod" "gearbox" + } +} diff --git a/lgsm/data/appmanifest/ricochet/appmanifest_10.acf b/lgsm/data/appmanifest/ricochet/appmanifest_10.acf new file mode 100644 index 0000000000..8eb50b265c --- /dev/null +++ b/lgsm/data/appmanifest/ricochet/appmanifest_10.acf @@ -0,0 +1,36 @@ +"AppState" +{ + "appid" "10" + "Universe" "1" + "name" "appid_10" + "StateFlags" "68" + "installdir" "Half-Life" + "LastUpdated" "1688999004" + "SizeOnDisk" "0" + "StagingSize" "0" + "buildid" "0" + "LastOwner" "0" + "UpdateResult" "0" + "BytesToDownload" "0" + "BytesDownloaded" "0" + "BytesToStage" "0" + "BytesStaged" "0" + "TargetBuildID" "0" + "AutoUpdateBehavior" "0" + "AllowOtherDownloadsWhileRunning" "0" + "ScheduledAutoUpdate" "0" + "InstalledDepots" + { + "11" + { + "manifest" "4720911300072406946" + "size" "292616113" + } + } + "UserConfig" + { + } + "MountedConfig" + { + } +} diff --git a/lgsm/data/appmanifest/ricochet/appmanifest_60.acf b/lgsm/data/appmanifest/ricochet/appmanifest_60.acf new file mode 100644 index 0000000000..9fcb75c05f --- /dev/null +++ b/lgsm/data/appmanifest/ricochet/appmanifest_60.acf @@ -0,0 +1,36 @@ +"AppState" +{ + "appid" "60" + "Universe" "1" + "name" "appid_60" + "StateFlags" "68" + "installdir" "Half-Life" + "LastUpdated" "1688999004" + "SizeOnDisk" "0" + "StagingSize" "0" + "buildid" "0" + "LastOwner" "0" + "UpdateResult" "0" + "BytesToDownload" "0" + "BytesDownloaded" "0" + "BytesToStage" "0" + "BytesStaged" "0" + "TargetBuildID" "0" + "AutoUpdateBehavior" "0" + "AllowOtherDownloadsWhileRunning" "0" + "ScheduledAutoUpdate" "0" + "InstalledDepots" + { + "61" + { + "manifest" "4560730344969588055" + "size" "17605146" + } + } + "UserConfig" + { + } + "MountedConfig" + { + } +} diff --git a/lgsm/data/appmanifest/ricochet/appmanifest_70.acf b/lgsm/data/appmanifest/ricochet/appmanifest_70.acf new file mode 100644 index 0000000000..a9173d9952 --- /dev/null +++ b/lgsm/data/appmanifest/ricochet/appmanifest_70.acf @@ -0,0 +1,41 @@ +"AppState" +{ + "appid" "70" + "Universe" "1" + "name" "appid_70" + "StateFlags" "68" + "installdir" "Half-Life" + "LastUpdated" "1688999004" + "SizeOnDisk" "0" + "StagingSize" "0" + "buildid" "0" + "LastOwner" "0" + "UpdateResult" "0" + "BytesToDownload" "0" + "BytesDownloaded" "0" + "BytesToStage" "0" + "BytesStaged" "0" + "TargetBuildID" "0" + "AutoUpdateBehavior" "0" + "AllowOtherDownloadsWhileRunning" "0" + "ScheduledAutoUpdate" "0" + "InstalledDepots" + { + "1" + { + "manifest" "5928322771446233610" + "size" "429833890" + } + "71" + { + "manifest" "9183617604528345869" + "size" "15302314" + } + } + "UserConfig" + { + } + "MountedConfig" + { + } +} diff --git a/lgsm/data/appmanifest/ricochet/appmanifest_90.acf b/lgsm/data/appmanifest/ricochet/appmanifest_90.acf new file mode 100644 index 0000000000..cb48442e50 --- /dev/null +++ b/lgsm/data/appmanifest/ricochet/appmanifest_90.acf @@ -0,0 +1,50 @@ +"AppState" +{ + "appid" "90" + "Universe" "1" + "name" "Half-Life Dedicated Server" + "StateFlags" "4" + "installdir" "Half-Life" + "LastUpdated" "1688999004" + "SizeOnDisk" "0" + "StagingSize" "0" + "buildid" "0" + "LastOwner" "76561198882404437" + "UpdateResult" "0" + "BytesToDownload" "0" + "BytesDownloaded" "0" + "BytesToStage" "0" + "BytesStaged" "0" + "TargetBuildID" "0" + "AutoUpdateBehavior" "0" + "AllowOtherDownloadsWhileRunning" "0" + "ScheduledAutoUpdate" "0" + "InstalledDepots" + { + "4" + { + "manifest" "8690279432129063737" + "size" "25737094" + } + "1006" + { + "manifest" "6912453647411644579" + "size" "72573740" + } + } + "SharedDepots" + { + "1" "70" + "11" "10" + "71" "70" + "61" "60" + } + "UserConfig" + { + "mod" "ricochet" + } + "MountedConfig" + { + "mod" "ricochet" + } +} diff --git a/lgsm/data/appmanifest/tfc/appmanifest_10.acf b/lgsm/data/appmanifest/tfc/appmanifest_10.acf new file mode 100644 index 0000000000..71c7c40ffb --- /dev/null +++ b/lgsm/data/appmanifest/tfc/appmanifest_10.acf @@ -0,0 +1,36 @@ +"AppState" +{ + "appid" "10" + "Universe" "1" + "name" "Counter-Strike" + "StateFlags" "68" + "installdir" "Half-Life" + "LastUpdated" "1688998186" + "SizeOnDisk" "0" + "StagingSize" "0" + "buildid" "0" + "LastOwner" "0" + "UpdateResult" "0" + "BytesToDownload" "0" + "BytesDownloaded" "0" + "BytesToStage" "0" + "BytesStaged" "0" + "TargetBuildID" "0" + "AutoUpdateBehavior" "0" + "AllowOtherDownloadsWhileRunning" "0" + "ScheduledAutoUpdate" "0" + "InstalledDepots" + { + "11" + { + "manifest" "4720911300072406946" + "size" "292616113" + } + } + "UserConfig" + { + } + "MountedConfig" + { + } +} diff --git a/lgsm/data/appmanifest/tfc/appmanifest_20.acf b/lgsm/data/appmanifest/tfc/appmanifest_20.acf new file mode 100644 index 0000000000..07594e9340 --- /dev/null +++ b/lgsm/data/appmanifest/tfc/appmanifest_20.acf @@ -0,0 +1,36 @@ +"AppState" +{ + "appid" "20" + "Universe" "1" + "name" "Team Fortress Classic" + "StateFlags" "68" + "installdir" "Half-Life" + "LastUpdated" "1688998186" + "SizeOnDisk" "0" + "StagingSize" "0" + "buildid" "0" + "LastOwner" "0" + "UpdateResult" "0" + "BytesToDownload" "0" + "BytesDownloaded" "0" + "BytesToStage" "0" + "BytesStaged" "0" + "TargetBuildID" "0" + "AutoUpdateBehavior" "0" + "AllowOtherDownloadsWhileRunning" "0" + "ScheduledAutoUpdate" "0" + "InstalledDepots" + { + "21" + { + "manifest" "7841127166138118042" + "size" "124989202" + } + } + "UserConfig" + { + } + "MountedConfig" + { + } +} diff --git a/lgsm/data/appmanifest/tfc/appmanifest_70.acf b/lgsm/data/appmanifest/tfc/appmanifest_70.acf new file mode 100644 index 0000000000..0ed30ae603 --- /dev/null +++ b/lgsm/data/appmanifest/tfc/appmanifest_70.acf @@ -0,0 +1,41 @@ +"AppState" +{ + "appid" "70" + "Universe" "1" + "name" "Half-Life" + "StateFlags" "68" + "installdir" "Half-Life" + "LastUpdated" "1688998186" + "SizeOnDisk" "0" + "StagingSize" "0" + "buildid" "0" + "LastOwner" "0" + "UpdateResult" "0" + "BytesToDownload" "0" + "BytesDownloaded" "0" + "BytesToStage" "0" + "BytesStaged" "0" + "TargetBuildID" "0" + "AutoUpdateBehavior" "0" + "AllowOtherDownloadsWhileRunning" "0" + "ScheduledAutoUpdate" "0" + "InstalledDepots" + { + "1" + { + "manifest" "5928322771446233610" + "size" "429833890" + } + "71" + { + "manifest" "9183617604528345869" + "size" "15302314" + } + } + "UserConfig" + { + } + "MountedConfig" + { + } +} diff --git a/lgsm/data/appmanifest/tfc/appmanifest_90.acf b/lgsm/data/appmanifest/tfc/appmanifest_90.acf new file mode 100644 index 0000000000..0bb518bd51 --- /dev/null +++ b/lgsm/data/appmanifest/tfc/appmanifest_90.acf @@ -0,0 +1,50 @@ +"AppState" +{ + "appid" "90" + "Universe" "1" + "name" "Half-Life Dedicated Server" + "StateFlags" "4" + "installdir" "Half-Life" + "LastUpdated" "1688998186" + "SizeOnDisk" "0" + "StagingSize" "0" + "buildid" "0" + "LastOwner" "76561201883029803" + "UpdateResult" "0" + "BytesToDownload" "0" + "BytesDownloaded" "0" + "BytesToStage" "0" + "BytesStaged" "0" + "TargetBuildID" "0" + "AutoUpdateBehavior" "0" + "AllowOtherDownloadsWhileRunning" "0" + "ScheduledAutoUpdate" "0" + "InstalledDepots" + { + "4" + { + "manifest" "8690279432129063737" + "size" "25737094" + } + "1006" + { + "manifest" "6912453647411644579" + "size" "72573740" + } + } + "SharedDepots" + { + "1" "70" + "11" "10" + "71" "70" + "21" "20" + } + "UserConfig" + { + "mod" "tfc" + } + "MountedConfig" + { + "mod" "tfc" + } +} diff --git a/lgsm/data/appmanifest/ts/appmanifest_10.acf b/lgsm/data/appmanifest/ts/appmanifest_10.acf new file mode 100644 index 0000000000..e04a2f26fc --- /dev/null +++ b/lgsm/data/appmanifest/ts/appmanifest_10.acf @@ -0,0 +1,36 @@ +"AppState" +{ + "appid" "10" + "Universe" "1" + "name" "Counter-Strike" + "StateFlags" "68" + "installdir" "Half-Life" + "LastUpdated" "1688983936" + "SizeOnDisk" "0" + "StagingSize" "0" + "buildid" "0" + "LastOwner" "0" + "UpdateResult" "0" + "BytesToDownload" "0" + "BytesDownloaded" "0" + "BytesToStage" "0" + "BytesStaged" "0" + "TargetBuildID" "0" + "AutoUpdateBehavior" "0" + "AllowOtherDownloadsWhileRunning" "0" + "ScheduledAutoUpdate" "0" + "InstalledDepots" + { + "11" + { + "manifest" "4720911300072406946" + "size" "292616113" + } + } + "UserConfig" + { + } + "MountedConfig" + { + } +} diff --git a/lgsm/data/appmanifest/ts/appmanifest_70.acf b/lgsm/data/appmanifest/ts/appmanifest_70.acf new file mode 100644 index 0000000000..d7d0228e2d --- /dev/null +++ b/lgsm/data/appmanifest/ts/appmanifest_70.acf @@ -0,0 +1,41 @@ +"AppState" +{ + "appid" "70" + "Universe" "1" + "name" "Half-Life" + "StateFlags" "68" + "installdir" "Half-Life" + "LastUpdated" "1688983937" + "SizeOnDisk" "0" + "StagingSize" "0" + "buildid" "0" + "LastOwner" "0" + "UpdateResult" "0" + "BytesToDownload" "0" + "BytesDownloaded" "0" + "BytesToStage" "0" + "BytesStaged" "0" + "TargetBuildID" "0" + "AutoUpdateBehavior" "0" + "AllowOtherDownloadsWhileRunning" "0" + "ScheduledAutoUpdate" "0" + "InstalledDepots" + { + "1" + { + "manifest" "5928322771446233610" + "size" "429833890" + } + "71" + { + "manifest" "9183617604528345869" + "size" "15302314" + } + } + "UserConfig" + { + } + "MountedConfig" + { + } +} diff --git a/lgsm/data/appmanifest/ts/appmanifest_90.acf b/lgsm/data/appmanifest/ts/appmanifest_90.acf new file mode 100644 index 0000000000..b560cb4be1 --- /dev/null +++ b/lgsm/data/appmanifest/ts/appmanifest_90.acf @@ -0,0 +1,49 @@ +"AppState" +{ + "appid" "90" + "Universe" "1" + "name" "Half-Life Dedicated Server" + "StateFlags" "4" + "installdir" "Half-Life" + "LastUpdated" "1688983870" + "SizeOnDisk" "0" + "StagingSize" "0" + "buildid" "0" + "LastOwner" "76561202249148738" + "UpdateResult" "0" + "BytesToDownload" "0" + "BytesDownloaded" "0" + "BytesToStage" "0" + "BytesStaged" "0" + "TargetBuildID" "0" + "AutoUpdateBehavior" "0" + "AllowOtherDownloadsWhileRunning" "0" + "ScheduledAutoUpdate" "0" + "InstalledDepots" + { + "4" + { + "manifest" "8690279432129063737" + "size" "25737094" + } + "1006" + { + "manifest" "6912453647411644579" + "size" "72573740" + } + } + "SharedDepots" + { + "1" "70" + "11" "10" + "71" "70" + } + "UserConfig" + { + "mod" "cstrike" + } + "MountedConfig" + { + "mod" "cstrike" + } +} diff --git a/lgsm/data/appmanifest/vs/appmanifest_10.acf b/lgsm/data/appmanifest/vs/appmanifest_10.acf new file mode 100644 index 0000000000..71c7c40ffb --- /dev/null +++ b/lgsm/data/appmanifest/vs/appmanifest_10.acf @@ -0,0 +1,36 @@ +"AppState" +{ + "appid" "10" + "Universe" "1" + "name" "Counter-Strike" + "StateFlags" "68" + "installdir" "Half-Life" + "LastUpdated" "1688998186" + "SizeOnDisk" "0" + "StagingSize" "0" + "buildid" "0" + "LastOwner" "0" + "UpdateResult" "0" + "BytesToDownload" "0" + "BytesDownloaded" "0" + "BytesToStage" "0" + "BytesStaged" "0" + "TargetBuildID" "0" + "AutoUpdateBehavior" "0" + "AllowOtherDownloadsWhileRunning" "0" + "ScheduledAutoUpdate" "0" + "InstalledDepots" + { + "11" + { + "manifest" "4720911300072406946" + "size" "292616113" + } + } + "UserConfig" + { + } + "MountedConfig" + { + } +} diff --git a/lgsm/data/appmanifest/vs/appmanifest_70.acf b/lgsm/data/appmanifest/vs/appmanifest_70.acf new file mode 100644 index 0000000000..a470329f1b --- /dev/null +++ b/lgsm/data/appmanifest/vs/appmanifest_70.acf @@ -0,0 +1,41 @@ +"AppState" +{ + "appid" "70" + "Universe" "1" + "name" "Half-Life" + "StateFlags" "68" + "installdir" "Half-Life" + "LastUpdated" "1688983882" + "SizeOnDisk" "0" + "StagingSize" "0" + "buildid" "0" + "LastOwner" "0" + "UpdateResult" "0" + "BytesToDownload" "0" + "BytesDownloaded" "0" + "BytesToStage" "0" + "BytesStaged" "0" + "TargetBuildID" "0" + "AutoUpdateBehavior" "0" + "AllowOtherDownloadsWhileRunning" "0" + "ScheduledAutoUpdate" "0" + "InstalledDepots" + { + "1" + { + "manifest" "5928322771446233610" + "size" "429833890" + } + "71" + { + "manifest" "9183617604528345869" + "size" "15302314" + } + } + "UserConfig" + { + } + "MountedConfig" + { + } +} diff --git a/lgsm/data/appmanifest/vs/appmanifest_90.acf b/lgsm/data/appmanifest/vs/appmanifest_90.acf new file mode 100644 index 0000000000..ae333872f0 --- /dev/null +++ b/lgsm/data/appmanifest/vs/appmanifest_90.acf @@ -0,0 +1,49 @@ +"AppState" +{ + "appid" "90" + "Universe" "1" + "name" "Half-Life Dedicated Server" + "StateFlags" "4" + "installdir" "Half-Life" + "LastUpdated" "1688983843" + "SizeOnDisk" "0" + "StagingSize" "0" + "buildid" "0" + "LastOwner" "76561200857512115" + "UpdateResult" "0" + "BytesToDownload" "0" + "BytesDownloaded" "0" + "BytesToStage" "0" + "BytesStaged" "0" + "TargetBuildID" "0" + "AutoUpdateBehavior" "0" + "AllowOtherDownloadsWhileRunning" "0" + "ScheduledAutoUpdate" "0" + "InstalledDepots" + { + "4" + { + "manifest" "8690279432129063737" + "size" "25737094" + } + "1006" + { + "manifest" "6912453647411644579" + "size" "72573740" + } + } + "SharedDepots" + { + "1" "70" + "11" "10" + "71" "70" + } + "UserConfig" + { + "mod" "cstrike" + } + "MountedConfig" + { + "mod" "cstrike" + } +} diff --git a/lgsm/modules/core_steamcmd.sh b/lgsm/modules/core_steamcmd.sh index 78c30f60ae..02074620df 100644 --- a/lgsm/modules/core_steamcmd.sh +++ b/lgsm/modules/core_steamcmd.sh @@ -147,7 +147,7 @@ fn_check_steamcmd_exec() { fn_update_steamcmd_localbuild() { # Gets local build info. fn_print_dots "Checking local build: ${remotelocation}" - fn_appmanifest_check + fn_check_steamcmd_appmanifest # Uses appmanifest to find local build. localbuild=$(grep buildid "${appmanifestfile}" | tr '[:blank:]"' ' ' | tr -s ' ' | cut -d\ -f3) @@ -174,8 +174,8 @@ 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 - find "${HOME}" -type f -name "appinfo.vdf" -exec rm -f {} \; + if [ "$(find "${HOME}" -type f -name "appinfo.vdf" 2> /dev/null | wc -l)" -ne "0" ]; then + find "${HOME}" -type f -name "appinfo.vdf" -exec rm -f {} \; 2> /dev/null fi # password for branch not needed to check the buildid @@ -281,14 +281,13 @@ fn_update_steamcmd_compare() { } fn_appmanifest_info() { - appmanifestfile=$(find -L "${serverfiles}" -type f -name "appmanifest_${appid}.acf") - appmanifestfilewc=$(find -L "${serverfiles}" -type f -name "appmanifest_${appid}.acf" | wc -l) + appmanifestfile=$(find -L "${serverfiles}/steamapps" -type f -name "appmanifest_${appid}.acf") + appmanifestfilewc=$(find -L "${serverfiles}/steamapps" -type f -name "appmanifest_${appid}.acf" | wc -l) } -fn_appmanifest_check() { +fn_check_steamcmd_appmanifest() { fn_appmanifest_info # Multiple or no matching appmanifest files may sometimes be present. - # This error is corrected if required. if [ "${appmanifestfilewc}" -ge "2" ]; then fn_print_error "Multiple appmanifest_${appid}.acf files found" fn_script_log_error "Multiple appmanifest_${appid}.acf files found" @@ -327,4 +326,96 @@ fn_appmanifest_check() { core_exit.sh fi fi + + # Checking for half completed updates. + bytesdownloaded=$(grep BytesDownloaded "${appmanifestfile}" | tr -cd '[:digit:]') + bytestodownload=$(grep BytesToDownload "${appmanifestfile}" | tr -cd '[:digit:]') + if [ "${bytesdownloaded}" != "${bytestodownload}" ]; then + fn_print_error_nl "BytesDownloaded and BytesToDownload do not match" + fn_script_log_error "BytesDownloaded and BytesToDownload do not match" + fn_print_info_nl "Forcing update to correct issue" + fn_script_log_info "Forcing update to correct issue" + fn_dl_steamcmd + fi + + bytesstaged=$(grep BytesStaged "${appmanifestfile}" | tr -cd '[:digit:]') + bytestostage=$(grep BytesToStage "${appmanifestfile}" | tr -cd '[:digit:]') + if [ "${bytesstaged}" != "${bytestostage}" ]; then + fn_print_error_nl "BytesStaged and BytesToStage do not match" + fn_script_log_error "BytesStaged and BytesToStage do not match" + fn_print_info_nl "Forcing update to correct issue" + fn_script_log_info "Forcing update to correct issue" + fn_dl_steamcmd + fi + + # if engine is GoldSrc check SharedDepots exists in appmanifest_90.acf + if [ "${engine}" == "goldsrc" ]; then + shareddepotsexists=$(grep -c SharedDepots "${serverfiles}/steamapps/appmanifest_90.acf") + if [ ! -f "${serverfiles}/steamapps/appmanifest_90.acf" ] || [ "${shareddepotsexists}" == "0" ]; then + fn_print_error_nl "SharedDepots missing from appmanifest_${appid}.acf" + fn_script_log_error "SharedDepots missing from appmanifest_${appid}.acf" + fn_print_info_nl "Forcing update to correct issue" + fn_script_log_info "Forcing update to correct issue" + if [ "${shortname}" == "ahl" ]; then + fn_fetch_file_github "lgsm/data/appmanifest/${shortname}" "appmanifest_90.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash" + fn_fetch_file_github "lgsm/data/appmanifest/${shortname}" "appmanifest_10.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash" + fn_fetch_file_github "lgsm/data/appmanifest/${shortname}" "appmanifest_70.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash" + elif [ "${shortname}" == "bb" ]; then + fn_fetch_file_github "lgsm/data/appmanifest/${shortname}" "appmanifest_90.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash" + fn_fetch_file_github "lgsm/data/appmanifest/${shortname}" "appmanifest_10.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash" + fn_fetch_file_github "lgsm/data/appmanifest/${shortname}" "appmanifest_70.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash" + elif [ "${shortname}" == "cscz" ]; then + fn_fetch_file_github "lgsm/data/appmanifest/${shortname}" "appmanifest_90.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash" + fn_fetch_file_github "lgsm/data/appmanifest/${shortname}" "appmanifest_10.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash" + fn_fetch_file_github "lgsm/data/appmanifest/${shortname}" "appmanifest_70.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash" + fn_fetch_file_github "lgsm/data/appmanifest/${shortname}" "appmanifest_80.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash" + elif [ "${shortname}" == "css" ]; then + fn_fetch_file_github "lgsm/data/appmanifest/${shortname}" "appmanifest_90.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash" + fn_fetch_file_github "lgsm/data/appmanifest/${shortname}" "appmanifest_10.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash" + fn_fetch_file_github "lgsm/data/appmanifest/${shortname}" "appmanifest_70.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash" + elif [ "${shortname}" == "dmc" ]; then + fn_fetch_file_github "lgsm/data/appmanifest/${shortname}" "appmanifest_90.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash" + fn_fetch_file_github "lgsm/data/appmanifest/${shortname}" "appmanifest_10.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash" + fn_fetch_file_github "lgsm/data/appmanifest/${shortname}" "appmanifest_40.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash" + fn_fetch_file_github "lgsm/data/appmanifest/${shortname}" "appmanifest_70.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash" + elif [ "${shortname}" == "dod" ]; then + fn_fetch_file_github "lgsm/data/appmanifest/${shortname}" "appmanifest_90.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash" + fn_fetch_file_github "lgsm/data/appmanifest/${shortname}" "appmanifest_10.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash" + fn_fetch_file_github "lgsm/data/appmanifest/${shortname}" "appmanifest_30.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash" + fn_fetch_file_github "lgsm/data/appmanifest/${shortname}" "appmanifest_70.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash" + elif [ "${shortname}" == "hldm" ]; then + fn_fetch_file_github "lgsm/data/appmanifest/${shortname}" "appmanifest_90.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash" + fn_fetch_file_github "lgsm/data/appmanifest/${shortname}" "appmanifest_10.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash" + fn_fetch_file_github "lgsm/data/appmanifest/${shortname}" "appmanifest_70.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash" + elif [ "${shortname}" == "ns" ]; then + fn_fetch_file_github "lgsm/data/appmanifest/${shortname}" "appmanifest_90.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash" + fn_fetch_file_github "lgsm/data/appmanifest/${shortname}" "appmanifest_10.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash" + fn_fetch_file_github "lgsm/data/appmanifest/${shortname}" "appmanifest_70.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash" + elif [ "${shortname}" == "opfor" ]; then + fn_fetch_file_github "lgsm/data/appmanifest/${shortname}" "appmanifest_90.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash" + fn_fetch_file_github "lgsm/data/appmanifest/${shortname}" "appmanifest_10.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash" + fn_fetch_file_github "lgsm/data/appmanifest/${shortname}" "appmanifest_50.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash" + fn_fetch_file_github "lgsm/data/appmanifest/${shortname}" "appmanifest_70.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash" + elif [ "${shortname}" == "ricochet" ]; then + fn_fetch_file_github "lgsm/data/appmanifest/${shortname}" "appmanifest_90.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash" + fn_fetch_file_github "lgsm/data/appmanifest/${shortname}" "appmanifest_10.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash" + fn_fetch_file_github "lgsm/data/appmanifest/${shortname}" "appmanifest_60.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash" + fn_fetch_file_github "lgsm/data/appmanifest/${shortname}" "appmanifest_70.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash" + elif [ "${shortname}" == "tfc" ]; then + fn_fetch_file_github "lgsm/data/appmanifest/${shortname}" "appmanifest_90.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash" + fn_fetch_file_github "lgsm/data/appmanifest/${shortname}" "appmanifest_10.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash" + fn_fetch_file_github "lgsm/data/appmanifest/${shortname}" "appmanifest_20.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash" + fn_fetch_file_github "lgsm/data/appmanifest/${shortname}" "appmanifest_70.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash" + elif [ "${shortname}" == "ts" ]; then + fn_fetch_file_github "lgsm/data/appmanifest/${shortname}" "appmanifest_90.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash" + fn_fetch_file_github "lgsm/data/appmanifest/${shortname}" "appmanifest_10.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash" + fn_fetch_file_github "lgsm/data/appmanifest/${shortname}" "appmanifest_70.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash" + elif [ "${shortname}" == "vs" ]; then + fn_fetch_file_github "lgsm/data/appmanifest/${shortname}" "appmanifest_90.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash" + fn_fetch_file_github "lgsm/data/appmanifest/${shortname}" "appmanifest_10.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash" + fn_fetch_file_github "lgsm/data/appmanifest/${shortname}" "appmanifest_70.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash" + fi + fn_dl_steamcmd + fi + fi } diff --git a/lgsm/modules/install_server_files.sh b/lgsm/modules/install_server_files.sh index 717030df4d..6db904992f 100644 --- a/lgsm/modules/install_server_files.sh +++ b/lgsm/modules/install_server_files.sh @@ -214,6 +214,7 @@ if [ "${appid}" ]; then remotelocation="SteamCMD" forceupdate=1 update_steamcmd.sh + fn_check_steamcmd_appmanifest fi if [ "${shortname}" == "ts3" ]; then From c3d51d2d235d792a095cdf46d98d6162f2742b5b Mon Sep 17 00:00:00 2001 From: Marcin Jakubowski Date: Wed, 12 Jul 2023 15:05:21 +0200 Subject: [PATCH 123/181] fix(armar): adapts game info to the new specification of server config (#4240) * fix(armar): adapts game info to the new specification of server config * fix(armar): back to legacy a2s settings --- lgsm/functions/info_game.sh | 8 ++++---- lgsm/modules/info_game.sh | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/lgsm/functions/info_game.sh b/lgsm/functions/info_game.sh index 8c9ca310a8..2cba64c4a1 100644 --- a/lgsm/functions/info_game.sh +++ b/lgsm/functions/info_game.sh @@ -102,11 +102,11 @@ fn_info_game_armar() { servername="${unavailable}" serverpassword="${unavailable}" else - adminpassword=$(jq -r '.adminPassword' "${servercfgfullpath}") + adminpassword=$(jq -r '.game.passwordAdmin' "${servercfgfullpath}") battleeyeport=1376 - configip=$(jq -r '.gameHostBindAddress' "${servercfgfullpath}") - maxplayers=$(jq -r '.game.playerCountLimit' "${servercfgfullpath}") - port=$(jq -r '.gameHostBindPort' "${servercfgfullpath}") + configip=$(jq -r '.bindAddress' "${servercfgfullpath}") + maxplayers=$(jq -r '.game.maxPlayers' "${servercfgfullpath}") + port=$(jq -r '.bindPort' "${servercfgfullpath}") queryport=$(jq -r '.steamQueryPort' "${servercfgfullpath}") servername=$(jq -r '.game.name' "${servercfgfullpath}") serverpassword=$(jq -r '.game.password' "${servercfgfullpath}") diff --git a/lgsm/modules/info_game.sh b/lgsm/modules/info_game.sh index fea995d273..0231abd9a8 100644 --- a/lgsm/modules/info_game.sh +++ b/lgsm/modules/info_game.sh @@ -872,10 +872,10 @@ fn_info_game_ut2k4() { # Filetype: json fn_info_game_armar() { if [ -f "${servercfgfullpath}" ]; then - fn_info_game_json "adminpassword" ".adminPassword" - fn_info_game_json "configip" ".gameHostBindAddress" - fn_info_game_json "maxplayers" ".game.playerCountLimit" - fn_info_game_json "port" ".gameHostBindPort" + fn_info_game_json "adminpassword" ".game.passwordAdmin" + fn_info_game_json "configip" ".bindAddress" + fn_info_game_json "maxplayers" ".game.maxPlayers" + fn_info_game_json "port" ".bindPort" fn_info_game_json "queryport" ".steamQueryPort" fn_info_game_json "servername" ".game.name" fn_info_game_json "serverpassword" ".game.password" From ba7500901e511fd098b9157d8d107a0f4da0e701 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 12 Jul 2023 14:07:57 +0100 Subject: [PATCH 124/181] build(deps): bump github/issue-labeler from 3.1 to 3.2 (#4258) Bumps [github/issue-labeler](https://github.com/github/issue-labeler) from 3.1 to 3.2. - [Release notes](https://github.com/github/issue-labeler/releases) - [Commits](https://github.com/github/issue-labeler/compare/v3.1...v3.2) --- 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 f046308316..44beca03da 100644 --- a/.github/workflows/labeler.yml +++ b/.github/workflows/labeler.yml @@ -14,7 +14,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Issue Labeler - uses: github/issue-labeler@v3.1 + uses: github/issue-labeler@v3.2 with: repo-token: "${{ secrets.GITHUB_TOKEN }}" configuration-path: .github/labeler.yml From 1149efd57f2775ba40080ab89eb06bddf0d0f8c2 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Wed, 12 Jul 2023 15:17:19 +0100 Subject: [PATCH 125/181] fix(wet): correct queryport assignment --- lgsm/modules/info_game.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lgsm/modules/info_game.sh b/lgsm/modules/info_game.sh index 0231abd9a8..183110e639 100644 --- a/lgsm/modules/info_game.sh +++ b/lgsm/modules/info_game.sh @@ -2123,7 +2123,7 @@ fn_info_game_wet() { configip="${configip:-"0.0.0.0"}" maxplayers="${maxplayers:-"0"}" port="${port:-"0"}" - queryport="${queryport:-"0"}" + queryport="${port}" rconpassword="${rconpassword:-"NOT SET"}" servername="${servername:-"NOT SET"}" serverpassword="${serverpassword:-"NOT SET"}" From 9be4a094978e14ee4c77818c69a136c9f7c39d6a Mon Sep 17 00:00:00 2001 From: Marcin Jakubowski Date: Thu, 20 Jul 2023 21:46:12 +0200 Subject: [PATCH 126/181] fix(armar): fix parsing new a2s config (#4268) --- lgsm/functions/info_game.sh | 6 +++--- lgsm/modules/info_game.sh | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lgsm/functions/info_game.sh b/lgsm/functions/info_game.sh index 2cba64c4a1..b8f94c18a6 100644 --- a/lgsm/functions/info_game.sh +++ b/lgsm/functions/info_game.sh @@ -97,8 +97,8 @@ fn_info_game_armar() { if [ ! -f "${servercfgfullpath}" ]; then adminpassword="${unavailable}" maxplayers="${zero}" - port=${port:-"0"} - queryport= + port="${zero}" + queryport="${zero}" servername="${unavailable}" serverpassword="${unavailable}" else @@ -107,7 +107,7 @@ fn_info_game_armar() { configip=$(jq -r '.bindAddress' "${servercfgfullpath}") maxplayers=$(jq -r '.game.maxPlayers' "${servercfgfullpath}") port=$(jq -r '.bindPort' "${servercfgfullpath}") - queryport=$(jq -r '.steamQueryPort' "${servercfgfullpath}") + queryport=$(jq -r '.a2s.port' "${servercfgfullpath}") servername=$(jq -r '.game.name' "${servercfgfullpath}") serverpassword=$(jq -r '.game.password' "${servercfgfullpath}") diff --git a/lgsm/modules/info_game.sh b/lgsm/modules/info_game.sh index 183110e639..d52810e375 100644 --- a/lgsm/modules/info_game.sh +++ b/lgsm/modules/info_game.sh @@ -876,7 +876,7 @@ fn_info_game_armar() { fn_info_game_json "configip" ".bindAddress" fn_info_game_json "maxplayers" ".game.maxPlayers" fn_info_game_json "port" ".bindPort" - fn_info_game_json "queryport" ".steamQueryPort" + fn_info_game_json "queryport" ".a2s.port" fn_info_game_json "servername" ".game.name" fn_info_game_json "serverpassword" ".game.password" fi From ab09a324102e475d01c7e869b3b7494b291eac54 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Thu, 20 Jul 2023 21:13:33 +0100 Subject: [PATCH 127/181] fix: rework wurm server (#4266) * feat: copy missing directories Copy the Creative and Adventure directories if they are missing in the server files. This ensures that the necessary directories are present for proper functioning of the server. * refactor: update default configuration for Wurm server - Updated the default configuration file for Wurm server. - Added predefined parameters for game mode, home kingdom, admin password, epic settings, home server, login server, max players, server name, IP address, and ports. - Modified start parameters to include the new predefined parameters. - Removed unnecessary lines related to glibc version and sourcing the server config file. - Updated backup directory path. * feat: add rmiport and rmiregport to startparameters This commit adds the `rmiport` and `rmiregport` parameters to the `startparameters` configuration in the Wurm server default config file. These parameters are used for remote method invocation (RMI) port configuration. * feat: update Wurm server configuration and information - Updated the default configuration file for the Wurm server. - Added a new parameter for server-to-server communication. - Modified the game information script to display the RMI and RMI Registry ports. This commit improves the configuration and information retrieval for the Wurm server. * refactor: update startparameters in wurmserver config The startparameters variable in the wurmserver config file has been updated to remove unnecessary single quotes around the gamemode parameter. This change improves consistency and readability of the code. * refactor: update startparameters in wurmserver config The startparameters variable in the wurmserver config file has been updated to include additional parameters for the game server. This change ensures that the server starts with the correct settings and configurations. * refactor: remove unnecessary start parameter The commit removes the 'start' parameter from the server's start parameters in the default configuration file. This change simplifies the configuration by removing an unnecessary parameter. * refactor: update default value for adminpassword in fn_info_game_wurm The default value for the adminpassword variable in the fn_info_game_wurm function has been updated to "NOT SET" instead of "0". This change ensures that the admin password is properly initialized when not explicitly set. * feat: add link to Wurm Unlimited server administration documentation Added a link to the Wurm Unlimited server administration documentation in the default configuration file for LGSM's Wurm server. This will provide users with easy access to information on managing their game servers. * refactor: remove unnecessary configs in wurmserver config The commit removes unused lines in the wurmserver configuration file. The removed lines include servercfgdir, servercfg, servercfgdefault, and servercfgfullpath. These lines are no longer needed and have been removed to clean up the code. --- .../config-lgsm/wurmserver/_default.cfg | 51 ++++++++++++++++--- lgsm/modules/fix_wurm.sh | 21 ++++---- lgsm/modules/info_game.sh | 47 +++++++---------- lgsm/modules/info_messages.sh | 2 + 4 files changed, 75 insertions(+), 46 deletions(-) diff --git a/lgsm/config-default/config-lgsm/wurmserver/_default.cfg b/lgsm/config-default/config-lgsm/wurmserver/_default.cfg index 754fc5922e..f648abe054 100644 --- a/lgsm/config-default/config-lgsm/wurmserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/wurmserver/_default.cfg @@ -8,9 +8,52 @@ #### Game Server Settings #### +## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters +# https://www.wurmpedia.com/index.php/Server_administration_(Wurm_Unlimited) + +# Game mode (Creative|Adventure) +gamemode="Creative" + +# The kingdom the server belongs to. +# If you're using the Adventure base, use 1, 2, or 3. +# If you're using Creative, use 4. +# Kingdom numbers: +# 0 - No kingdom +# 1 - Jen-Kellon +# 2 - Mol-Rehan +# 3 - Horde of the Summoned +# 4 - Freedom +homekingdom="4" + +# Unlocks the admin commands from within the game, that can be used to change +# the gameplay settings of the server, such as skill gain rate and field growth time. +adminpassword="ADMINPASSWORD" + +# If true the server will follow the rules from the Epic servers in Wurm Online. +# For instance it will use the skill curve. +epicsettings="false" + +# If the server is a home server (belongs to a single kingdom). +homeserver="true" + +# Defaults to true, should only be set to false if the server is intended to be +# connected with another server that is going to act as a loginserver. +loginserver="true" + +# Used for server to server communication. +rmiport="7221" +rmiregport="7220" + +maxplayers="200" +servername="LinuxGSM" +serverpassword="" +ip="0.0.0.0" +port="3724" +queryport="27016" + ## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters # Parameters are edited in the game server config file. -startparameters="ADMINPWD=\"$ADMINPWD\" EPICSETTINGS=\"$EPICSETTINGS\" EXTERNALPORT=\"$EXTERNALPORT\" HOMESERVER=\"$HOMESERVER\" HOMEKINGDOM=\"$HOMEKINGDOM\" LOGINSERVER=\"$LOGINSERVER\" MAXPLAYERS=\"$MAXPLAYERS\" QUERYPORT=\"$QUERYPORT\" SERVERNAME=\"$SERVERNAME\" SERVERPASSWORD=\"$SERVERPASSWORD\" START=\"$START\" IP=\"$IP\"" +startparameters="start=${gamemode} adminpwd='${adminpassword}' epicsettings='${epicsettings}' externalport='${port}' homeserver='${homeserver}' homekingdom='${homekingdom}' loginserver='${loginserver}' maxplayers='${maxplayers}' queryport='${queryport}' rmiport='${rmiport}' rmiregport='${rmiregport}' servername='${servername}' serverpassword='${serverpassword}' ip='${ip}'" #### LinuxGSM Settings #### @@ -157,13 +200,7 @@ glibc="2.14" ## Game Server Directories systemdir="${serverfiles}" executabledir="${systemdir}" -preexecutable="xvfb-run" executable="./WurmServerLauncher" -servercfgdir="${systemdir}" -servercfg="${selfname}.cfg" -servercfgdefault="server.cfg" -servercfgfullpath="${servercfgdir}/${servercfg}" -source "${servercfgfullpath}" ## Backup Directory backupdir="${lgsmdir}/backup" diff --git a/lgsm/modules/fix_wurm.sh b/lgsm/modules/fix_wurm.sh index 1536df2e7e..73eaac93e6 100644 --- a/lgsm/modules/fix_wurm.sh +++ b/lgsm/modules/fix_wurm.sh @@ -10,14 +10,15 @@ moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" # First run requires start with no parms. # After first run new dirs are created. if [ ! -d "${serverfiles}/Creative" ]; then - parmsbypass=1 - fixbypass=1 - exitbypass=1 - command_start.sh - fn_firstcommand_reset - sleep 10 - exitbypass=1 - command_stop.sh - fn_firstcommand_reset - unset parmsbypass + fixname="Copy Creative directory" + fn_fix_msg_start + cp -R "${serverfiles}/dist/Creative" "${serverfiles}/Creative" + fn_fix_msg_end +fi + +if [ ! -d "${serverfiles}/Adventure" ]; then + fixname="Copy Adventure directory" + fn_fix_msg_start + cp -R "${serverfiles}/dist/Adventure" "${serverfiles}/Adventure" + fn_fix_msg_end fi diff --git a/lgsm/modules/info_game.sh b/lgsm/modules/info_game.sh index d52810e375..d5e6712059 100644 --- a/lgsm/modules/info_game.sh +++ b/lgsm/modules/info_game.sh @@ -2175,36 +2175,25 @@ fn_info_game_wmc() { fi } -# Config Type: custom (key-value) -# Comment: # -# Example: SERVERNAME=SERVERNAME +# Config Type: parameters +# Parameters: true +# Comment: +# Example: hostname='SERVERNAME' +# Filetype: parameters fn_info_game_wurm() { - # Config - if [ ! -f "${servercfgfullpath}" ]; then - port="${zero}" - queryport="${zero}" - rconpassword="${unavailable}" - servername="${unavailable}" - serverpassword="${unavailable}" - adminpassword="${unavailable}" - maxplayers="${zero}" - else - port=$(grep "EXTERNALPORT=" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') - queryport=$(grep "QUERYPORT=" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') - servername=$(grep "SERVERNAME=" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/SERVERNAME//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - serverpassword=$(grep "SERVERPASSWORD=" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/SERVERPASSWORD//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - adminpassword=$(grep "ADMINPWD=" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/ADMINPWD//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - maxplayers=$(grep "MAXPLAYERS=" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') - configip=$(grep "IP" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/IP//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - - # Not set - port="${port:-"3724"}" - queryport="${queryport:-"27017"}" - servername="${servername:-"NOT SET"}" - serverpassword="${serverpassword:-"NOT SET"}" - adminpassword="${adminpassword:-"NOT SET"}" - maxplayers="${maxplayers:-"0"}" - fi + gamemode="${gamemode:-"NOT SET"}" + homekingdom="${homekingdom:-"0"}" + adminpassword="${adminpassword:-"NOT SET"}" + epicsettings="${epicsettings:-"NOT SET"}" + homeserver="${homeserver:-"NOT SET"}" + loginserver="${loginserver:-"NOT SET"}" + rmiport="${rmiport:-"0"}" + rmiregport="${rmiregport:-"0"}" + maxplayers="${maxplayers:-"0"}" + servername="${servername:-"NOT SET"}" + # serverpassword="${serverpassword:-"NOT SET"}" + port="${port:-"0"}" + queryport="${queryport:-"0"}" } unavailable="${red}UNAVAILABLE${default}" diff --git a/lgsm/modules/info_messages.sh b/lgsm/modules/info_messages.sh index 302f54a38c..8c601a6544 100644 --- a/lgsm/modules/info_messages.sh +++ b/lgsm/modules/info_messages.sh @@ -1666,6 +1666,8 @@ fn_info_message_wurm() { fn_port "header" fn_port "Game" port tcp fn_port "Query" queryport udp + fn_port "RMI" rmiport tcp + fn_port "RMI Registry" rmiregport tcp } | column -s $'\t' -t } From e9f2453e48d803ebcf8d3c0a10dfa1902252c09a Mon Sep 17 00:00:00 2001 From: ChaCha <15073640+cclecle@users.noreply.github.com> Date: Thu, 20 Jul 2023 22:54:05 +0100 Subject: [PATCH 128/181] Fix(tmux): better tmux session handling for multiple instance on same server / user session (#3767) * fix(tmux): force tmux to create a new trmux server instance for each game instance to avoid sharing same pid. * refactor: improve tmux command consistency and add session name flag This commit refactors the code to improve consistency in the usage of the `tmux` command. It adds the `-L` flag followed by the session name to all `tmux` commands. This ensures that all commands are executed within the correct session. Additionally, it updates the `check_status.sh`, `command_console.sh`, `command_send.sh`, `command_start.sh`, `command_stop.sh`, and `info_distro.sh` files to include this change. The changes ensure that all relevant commands are executed within the specified session, improving code readability and maintainability. --------- Co-authored-by: cclecle Co-authored-by: Daniel Gibbs --- lgsm/functions/check_status.sh | 2 +- lgsm/functions/command_console.sh | 2 +- lgsm/functions/command_send.sh | 2 +- lgsm/functions/command_start.sh | 10 +++++----- lgsm/functions/command_stop.sh | 12 ++++++------ lgsm/functions/info_distro.sh | 2 +- lgsm/modules/check_status.sh | 2 +- lgsm/modules/command_console.sh | 2 +- lgsm/modules/command_send.sh | 2 +- lgsm/modules/command_start.sh | 14 +++++++------- lgsm/modules/command_stop.sh | 12 ++++++------ lgsm/modules/info_distro.sh | 2 +- 12 files changed, 32 insertions(+), 32 deletions(-) diff --git a/lgsm/functions/check_status.sh b/lgsm/functions/check_status.sh index 28ec38eb25..a454b4eff2 100644 --- 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 -L "${sessionname}" list-sessions -F "#{session_name}" 2>/dev/null | grep -Ecx "^${sessionname}") diff --git a/lgsm/functions/command_console.sh b/lgsm/functions/command_console.sh index 5b84789e66..4f09776b8d 100644 --- a/lgsm/functions/command_console.sh +++ b/lgsm/functions/command_console.sh @@ -42,7 +42,7 @@ check_status.sh if [ "${status}" != "0" ]; then fn_print_ok_nl "Accessing console" fn_script_log_pass "Console accessed" - tmux attach-session -t "${sessionname}" + tmux -L "${sessionname}" attach-session -t "${sessionname}" fn_print_ok_nl "Closing console" fn_script_log_pass "Console closed" else diff --git a/lgsm/functions/command_send.sh b/lgsm/functions/command_send.sh index c143276f62..d652125717 100644 --- a/lgsm/functions/command_send.sh +++ b/lgsm/functions/command_send.sh @@ -26,7 +26,7 @@ if [ "${status}" != "0" ]; then fi echo "" fn_print_dots "Sending command to console: \"${commandtosend}\"" - tmux send-keys -t "${servicename}" "${commandtosend}" ENTER + tmux -L "${sessionname}" send-keys -t "${servicename}" "${commandtosend}" ENTER fn_print_ok_nl "Sending command to console: \"${commandtosend}\"" fn_script_log_pass "Command \"${commandtosend}\" sent to console" else diff --git a/lgsm/functions/command_start.sh b/lgsm/functions/command_start.sh index 04c6b4e645..699bc82220 100644 --- a/lgsm/functions/command_start.sh +++ b/lgsm/functions/command_start.sh @@ -37,7 +37,7 @@ fn_start_teamspeak3() { # Used to allow update to detect JK2MV server version. fn_start_jk2() { fn_start_tmux - tmux send -t "${sessionname}" version ENTER > /dev/null 2>&1 + tmux -L "${sessionname}" send -t "${sessionname}" version ENTER > /dev/null 2>&1 } fn_start_tmux() { @@ -80,7 +80,7 @@ fn_start_tmux() { cd "${executabledir}" || exit fi - tmux new-session -d -x "${sessionwidth}" -y "${sessionheight}" -s "${sessionname}" "${preexecutable} ${executable} ${startparameters}" 2> "${lgsmlogdir}/.${selfname}-tmux-error.tmp" + tmux -L "${sessionname}" new-session -d -x "${sessionwidth}" -y "${sessionheight}" -s "${sessionname}" "${preexecutable} ${executable} ${startparameters}" 2> "${lgsmlogdir}/.${selfname}-tmux-error.tmp" # Create logfile. touch "${consolelog}" @@ -94,9 +94,9 @@ fn_start_tmux() { echo -e "tmux version: master (user compiled)" >> "${consolelog}" if [ "${consolelogging}" == "on" ] || [ -z "${consolelogging}" ]; then if [ "$logtimestamp" == "on" ]; then - tmux pipe-pane -o -t "${sessionname}" "exec bash -c \"cat | $addtimestamp\" >> '${consolelog}'" + tmux -L "${sessionname}" pipe-pane -o -t "${sessionname}" "exec bash -c \"cat | $addtimestamp\" >> '${consolelog}'" else - tmux pipe-pane -o -t "${sessionname}" "exec cat >> '${consolelog}'" + tmux -L "${sessionname}" pipe-pane -o -t "${sessionname}" "exec cat >> '${consolelog}'" fi fi @@ -143,7 +143,7 @@ fn_start_tmux() { echo -e "" echo -e "Command" echo -e "=================================" - echo -e "tmux new-session -d -s \"${sessionname}\" \"${preexecutable} ${executable} ${startparameters}\"" | tee -a "${lgsmlog}" + echo -e "tmux -L \"${sessionname}\" new-session -d -s \"${sessionname}\" \"${preexecutable} ${executable} ${startparameters}\"" | tee -a "${lgsmlog}" echo -e "" echo -e "Error" echo -e "=================================" diff --git a/lgsm/functions/command_stop.sh b/lgsm/functions/command_stop.sh index d18ef7c23a..d2e88fcea2 100644 --- a/lgsm/functions/command_stop.sh +++ b/lgsm/functions/command_stop.sh @@ -15,7 +15,7 @@ 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 -L "${sessionname}" 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 @@ -43,7 +43,7 @@ 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 + tmux -L "${sessionname}" send -t "${sessionname}" ENTER "${1}" ENTER > /dev/null 2>&1 # Waits up to ${seconds} seconds giving the server time to shutdown gracefully. for ((seconds = 1; seconds <= ${2}; seconds++)); do check_status.sh @@ -71,7 +71,7 @@ fn_stop_graceful_goldsrc() { fn_print_dots "Graceful: sending \"quit\"" fn_script_log_info "Graceful: sending \"quit\"" # sends quit - tmux send -t "${sessionname}" quit ENTER > /dev/null 2>&1 + tmux -L "${sessionname}" send -t "${sessionname}" quit ENTER > /dev/null 2>&1 # Waits 3 seconds as goldsrc servers restart with the quit command. for seconds in {1..3}; do sleep 1 @@ -184,10 +184,10 @@ fn_stop_graceful_avorion() { fn_print_dots "Graceful: /save /stop" fn_script_log_info "Graceful: /save /stop" # Sends /save. - tmux send-keys -t "${sessionname}" /save ENTER > /dev/null 2>&1 + tmux -L "${sessionname}" send-keys -t "${sessionname}" /save ENTER > /dev/null 2>&1 sleep 5 # Sends /quit. - tmux send-keys -t "${sessionname}" /stop ENTER > /dev/null 2>&1 + tmux -L "${sessionname}" send-keys -t "${sessionname}" /stop ENTER > /dev/null 2>&1 # Waits up to 30 seconds giving the server time to shutdown gracefuly. for seconds in {1..30}; do check_status.sh @@ -240,7 +240,7 @@ fn_stop_tmux() { fn_print_dots "${servername}" fn_script_log_info "tmux kill-session: ${sessionname}: ${servername}" # Kill tmux session. - tmux kill-session -t "${sessionname}" > /dev/null 2>&1 + tmux -L "${sessionname}" kill-session -t "${sessionname}" > /dev/null 2>&1 sleep 0.5 check_status.sh if [ "${status}" == "0" ]; then diff --git a/lgsm/functions/info_distro.sh b/lgsm/functions/info_distro.sh index f29e621d50..8c2a67adfd 100644 --- a/lgsm/functions/info_distro.sh +++ b/lgsm/functions/info_distro.sh @@ -10,7 +10,7 @@ functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" ### Game Server pid if [ "${status}" == "1" ]; then - gameserverpid="$(tmux list-sessions -F "#{session_name} #{pane_pid}" | grep "^${sessionname} " | awk '{print $NF}')" + gameserverpid="$(tmux -L "${sessionname}" list-sessions -F "#{session_name} #{pane_pid}" | grep "^${sessionname} " | awk '{print $NF}')" if [ "${engine}" == "source" ]; then srcdslinuxpid="$(ps -ef | grep -v grep | grep "${gameserverpid}" | grep srcds_linux | awk '{print $2}')" elif [ "${engine}" == "goldsrc" ]; then diff --git a/lgsm/modules/check_status.sh b/lgsm/modules/check_status.sh index 2ebfb30550..6edd4151bf 100644 --- a/lgsm/modules/check_status.sh +++ b/lgsm/modules/check_status.sh @@ -7,4 +7,4 @@ moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" -status=$(tmux list-sessions -F "#{session_name}" 2> /dev/null | grep -Ecx "^${sessionname}") +status=$(tmux -L "${sessionname}" list-sessions -F "#{session_name}" 2> /dev/null | grep -Ecx "^${sessionname}") diff --git a/lgsm/modules/command_console.sh b/lgsm/modules/command_console.sh index e95f2d0e59..95945dbe3b 100644 --- a/lgsm/modules/command_console.sh +++ b/lgsm/modules/command_console.sh @@ -42,7 +42,7 @@ check_status.sh if [ "${status}" != "0" ]; then fn_print_ok_nl "Accessing console" fn_script_log_pass "Console accessed" - tmux attach-session -t "${sessionname}" + tmux -L "${sessionname}" attach-session -t "${sessionname}" fn_print_ok_nl "Closing console" fn_script_log_pass "Console closed" else diff --git a/lgsm/modules/command_send.sh b/lgsm/modules/command_send.sh index 8ba8f8412d..9f7c20dbbd 100644 --- a/lgsm/modules/command_send.sh +++ b/lgsm/modules/command_send.sh @@ -26,7 +26,7 @@ if [ "${status}" != "0" ]; then fi echo "" fn_print_dots "Sending command to console: \"${commandtosend}\"" - tmux send-keys -t "${servicename}" "${commandtosend}" ENTER + tmux -L "${sessionname}" send-keys -t "${servicename}" "${commandtosend}" ENTER fn_print_ok_nl "Sending command to console: \"${commandtosend}\"" fn_script_log_pass "Command \"${commandtosend}\" sent to console" else diff --git a/lgsm/modules/command_start.sh b/lgsm/modules/command_start.sh index e5021cde24..b9f8fa51c6 100644 --- a/lgsm/modules/command_start.sh +++ b/lgsm/modules/command_start.sh @@ -37,7 +37,7 @@ fn_start_teamspeak3() { # Used to allow update to detect JK2MV server version. fn_start_jk2() { fn_start_tmux - tmux send -t "${sessionname}" version ENTER > /dev/null 2>&1 + tmux -L "${sessionname}" end -t "${sessionname}" version ENTER > /dev/null 2>&1 } fn_start_tmux() { @@ -80,7 +80,7 @@ fn_start_tmux() { cd "${executabledir}" || exit fi - tmux new-session -d -x "${sessionwidth}" -y "${sessionheight}" -s "${sessionname}" "${preexecutable} ${executable} ${startparameters}" 2> "${lgsmlogdir}/.${selfname}-tmux-error.tmp" + tmux -L "${sessionname}" new-session -d -x "${sessionwidth}" -y "${sessionheight}" -s "${sessionname}" "${preexecutable} ${executable} ${startparameters}" 2> "${lgsmlogdir}/.${selfname}-tmux-error.tmp" # Create logfile. touch "${consolelog}" @@ -94,9 +94,9 @@ fn_start_tmux() { echo -e "tmux version: master (user compiled)" >> "${consolelog}" if [ "${consolelogging}" == "on" ] || [ -z "${consolelogging}" ]; then if [ "$logtimestamp" == "on" ]; then - tmux pipe-pane -o -t "${sessionname}" "exec bash -c \"cat | $addtimestamp\" >> '${consolelog}'" + tmux -L "${sessionname}" pipe-pane -o -t "${sessionname}" "exec bash -c \"cat | $addtimestamp\" >> '${consolelog}'" else - tmux pipe-pane -o -t "${sessionname}" "exec cat >> '${consolelog}'" + tmux -L "${sessionname}" pipe-pane -o -t "${sessionname}" "exec cat >> '${consolelog}'" fi fi @@ -115,9 +115,9 @@ fn_start_tmux() { # Console logging enable or not set. elif [ "${consolelogging}" == "on" ] || [ -z "${consolelogging}" ]; then if [ "$logtimestamp" == "on" ]; then - tmux pipe-pane -o -t "${sessionname}" "exec bash -c \"cat | $addtimestamp\" >> '${consolelog}'" + tmux -L "${sessionname}" pipe-pane -o -t "${sessionname}" "exec bash -c \"cat | $addtimestamp\" >> '${consolelog}'" else - tmux pipe-pane -o -t "${sessionname}" "exec cat >> '${consolelog}'" + tmux -L "${sessionname}" pipe-pane -o -t "${sessionname}" "exec cat >> '${consolelog}'" fi fi else @@ -143,7 +143,7 @@ fn_start_tmux() { echo -e "" echo -e "Command" echo -e "=================================" - echo -e "tmux new-session -d -s \"${sessionname}\" \"${preexecutable} ${executable} ${startparameters}\"" | tee -a "${lgsmlog}" + echo -e "tmux -L \"${sessionname}\" new-session -d -s \"${sessionname}\" \"${preexecutable} ${executable} ${startparameters}\"" | tee -a "${lgsmlog}" echo -e "" echo -e "Error" echo -e "=================================" diff --git a/lgsm/modules/command_stop.sh b/lgsm/modules/command_stop.sh index 564f5ed4c3..a0cc180763 100644 --- a/lgsm/modules/command_stop.sh +++ b/lgsm/modules/command_stop.sh @@ -15,7 +15,7 @@ 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 -L "${sessionname}" 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 @@ -43,7 +43,7 @@ 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 + tmux -L "${sessionname}" send -t "${sessionname}" ENTER "${1}" ENTER > /dev/null 2>&1 # Waits up to ${seconds} seconds giving the server time to shutdown gracefully. for ((seconds = 1; seconds <= ${2}; seconds++)); do check_status.sh @@ -71,7 +71,7 @@ fn_stop_graceful_goldsrc() { fn_print_dots "Graceful: sending \"quit\"" fn_script_log_info "Graceful: sending \"quit\"" # sends quit - tmux send -t "${sessionname}" quit ENTER > /dev/null 2>&1 + tmux -L "${sessionname}" send -t "${sessionname}" quit ENTER > /dev/null 2>&1 # Waits 3 seconds as goldsrc servers restart with the quit command. for seconds in {1..3}; do sleep 1 @@ -184,10 +184,10 @@ fn_stop_graceful_avorion() { fn_print_dots "Graceful: /save /stop" fn_script_log_info "Graceful: /save /stop" # Sends /save. - tmux send-keys -t "${sessionname}" /save ENTER > /dev/null 2>&1 + tmux -L "${sessionname}" send-keys -t "${sessionname}" /save ENTER > /dev/null 2>&1 sleep 5 # Sends /quit. - tmux send-keys -t "${sessionname}" /stop ENTER > /dev/null 2>&1 + tmux -L "${sessionname}" send-keys -t "${sessionname}" /stop ENTER > /dev/null 2>&1 # Waits up to 30 seconds giving the server time to shutdown gracefuly. for seconds in {1..30}; do check_status.sh @@ -240,7 +240,7 @@ fn_stop_tmux() { fn_print_dots "${servername}" fn_script_log_info "tmux kill-session: ${sessionname}: ${servername}" # Kill tmux session. - tmux kill-session -t "${sessionname}" > /dev/null 2>&1 + tmux -L "${sessionname}" kill-session -t "${sessionname}" > /dev/null 2>&1 sleep 0.5 check_status.sh if [ "${status}" == "0" ]; then diff --git a/lgsm/modules/info_distro.sh b/lgsm/modules/info_distro.sh index 411a504587..8c29a4ca27 100644 --- a/lgsm/modules/info_distro.sh +++ b/lgsm/modules/info_distro.sh @@ -10,7 +10,7 @@ moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" ### Game Server pid if [ "${status}" == "1" ]; then - gameserverpid="$(tmux list-sessions -F "#{session_name} #{pane_pid}" | grep "^${sessionname} " | awk '{print $NF}')" + gameserverpid="$(tmux -L "${sessionname}" list-sessions -F "#{session_name} #{pane_pid}" | grep "^${sessionname} " | awk '{print $NF}')" if [ "${engine}" == "source" ]; then srcdslinuxpid="$(ps -ef | grep -v grep | grep "${gameserverpid}" | grep srcds_linux | awk '{print $2}')" elif [ "${engine}" == "goldsrc" ]; then From 1ea6ebb4ee1bb4c0441ea6fbd0056c9c288fa8e8 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Fri, 21 Jul 2023 00:32:54 +0100 Subject: [PATCH 129/181] refactor(av): update querymode in avserver config The querymode value in the avserver config file has been changed from 5 to 1. TCP query done on rcon port which may not be on --- lgsm/config-default/config-lgsm/avserver/_default.cfg | 2 +- lgsm/modules/info_game.sh | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/lgsm/config-default/config-lgsm/avserver/_default.cfg b/lgsm/config-default/config-lgsm/avserver/_default.cfg index 991b13c022..532740d574 100644 --- a/lgsm/config-default/config-lgsm/avserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/avserver/_default.cfg @@ -137,7 +137,7 @@ stopmode="10" # 3: gamedig # 4: gsquery # 5: tcp -querymode="5" +querymode="1" querytype="" ## Console type diff --git a/lgsm/modules/info_game.sh b/lgsm/modules/info_game.sh index d5e6712059..2bfdc10e71 100644 --- a/lgsm/modules/info_game.sh +++ b/lgsm/modules/info_game.sh @@ -323,9 +323,8 @@ fn_info_game_av() { rconenabled="${rconenabled:-"false"}" rconpassword="${rconpassword:-"NOT SET"}" rconport="${rconport:-"0"}" - # queryport is port + 3 - # this doesnt respond to any queries, using tcp query on rconport instead. - queryport="${rconport:-"0"}" + # queryport doesnt respond to any queries, using session only. + queryport=""$((port + 3))"" servername="${servername:-"NOT SET"}" serverpassword="${serverpassword:-"NOT SET"}" steamport="$((port + 21))" From 6815e3d3e1118a1a5a063512ac276369d950853f Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Fri, 21 Jul 2023 00:54:39 +0100 Subject: [PATCH 130/181] Release v23.4.0 --- lgsm/modules/core_functions.sh | 2 +- lgsm/modules/core_modules.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, 7 insertions(+), 7 deletions(-) diff --git a/lgsm/modules/core_functions.sh b/lgsm/modules/core_functions.sh index e4b34b41d8..3b42e1f8f1 100644 --- a/lgsm/modules/core_functions.sh +++ b/lgsm/modules/core_functions.sh @@ -8,7 +8,7 @@ module_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" -modulesversion="v23.3.6" +modulesversion="v23.4.0" # Core diff --git a/lgsm/modules/core_modules.sh b/lgsm/modules/core_modules.sh index c1baab40e2..b191e793a3 100644 --- a/lgsm/modules/core_modules.sh +++ b/lgsm/modules/core_modules.sh @@ -8,7 +8,7 @@ moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" -modulesversion="v23.3.6" +modulesversion="v23.4.0" # Core diff --git a/linuxgsm.sh b/linuxgsm.sh index 0383a59d3f..52d12faca2 100755 --- a/linuxgsm.sh +++ b/linuxgsm.sh @@ -20,7 +20,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="v23.3.6" +version="v23.4.0" shortname="core" gameservername="core" commandname="CORE" diff --git a/tests/tests_fctrserver.sh b/tests/tests_fctrserver.sh index b06e8c6463..4639206726 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.3.6" +version="v23.4.0" shortname="fctr" gameservername="fctrserver" commandname="CORE" diff --git a/tests/tests_jc2server.sh b/tests/tests_jc2server.sh index 30051114ca..72f3f1a221 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.3.6" +version="v23.4.0" shortname="jc2" gameservername="jc2server" commandname="CORE" diff --git a/tests/tests_mcserver.sh b/tests/tests_mcserver.sh index 587a8a9b1e..ab94c5dc9a 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.3.6" +version="v23.4.0" shortname="mc" gameservername="mcserver" commandname="CORE" diff --git a/tests/tests_ts3server.sh b/tests/tests_ts3server.sh index 45647cda7b..4121bd462d 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.3.6" +version="v23.4.0" shortname="ts3" gameservername="ts3server" commandname="CORE" From edcd2b7c8bd1369629bf3a062fad1e38ef97567a Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Fri, 21 Jul 2023 01:00:41 +0100 Subject: [PATCH 131/181] feat: add serverfiles directory creation step This commit adds a new step to the workflow that creates a "serverfiles" directory. This directory will be used for storing server-related files. --- .github/workflows/details-check.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/details-check.yml b/.github/workflows/details-check.yml index 9d5aabc56e..1ce9b373bb 100644 --- a/.github/workflows/details-check.yml +++ b/.github/workflows/details-check.yml @@ -42,6 +42,9 @@ jobs: - name: Install dependencies run: sudo apt-get install libxml2-utils jq + - name: Create serverfiles directory + run: mkdir -p serverfiles + - name: Grab server run: LGSM_GITHUBBRANCH="${GITHUB_REF#refs/heads/}" ./linuxgsm.sh ${{ matrix.shortname }}server From 6dd9709edba395d8373cab3327a9db793986d9a6 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Wed, 26 Jul 2023 21:21:35 +0100 Subject: [PATCH 132/181] fix: add new info about steamcmd failures This commit fixes an issue in the core_dl.sh script where disk write failures and missing update files were not being handled correctly. Now, when a disk write failure or missing update files occur during the download process, appropriate error messages are displayed and logged. --- lgsm/modules/core_dl.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lgsm/modules/core_dl.sh b/lgsm/modules/core_dl.sh index 405e9dc6b5..f854998907 100644 --- a/lgsm/modules/core_dl.sh +++ b/lgsm/modules/core_dl.sh @@ -119,6 +119,14 @@ fn_dl_steamcmd() { elif [ -n "$(grep "0x402" "${steamcmdlog}" | tail -1)" ] || [ -n "$(grep "0x602" "${steamcmdlog}" | tail -1)" ]; then 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" + # Disk write failure. + elif [ -n "$(grep "0x606" "${steamcmdlog}" | tail -1)" ] || [ -n "$(grep "0x602" "${steamcmdlog}" | tail -1)" ]; then + fn_print_error2_nl "${commandaction} ${selfname}: ${remotelocation}: Disk write failure" + fn_script_log_error "${commandaction} ${selfname}: ${remotelocation}: Disk write failure" + # Missing update files. + elif [ -n "$(grep "0x626" "${steamcmdlog}" | tail -1)" ] || [ -n "$(grep "0x626" "${steamcmdlog}" | tail -1)" ]; then + fn_print_error2_nl "${commandaction} ${selfname}: ${remotelocation}: Missing update files" + fn_script_log_error "${commandaction} ${selfname}: ${remotelocation}: Missing update files" else fn_print_error2_nl "${commandaction} ${selfname}: ${remotelocation}: Unknown error occured" echo -en "Please provide content log to LinuxGSM developers https://linuxgsm.com/steamcmd-error" From f68818d62b760affa9ce4c2515207b9c174305b1 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Wed, 26 Jul 2023 22:12:20 +0100 Subject: [PATCH 133/181] refactor: rename clear-modules command to cm;clear-modules The commit renames the clear-modules command to cm;clear-modules in the core_getopt.sh file. This change improves clarity and consistency in the codebase. --- lgsm/modules/core_getopt.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lgsm/modules/core_getopt.sh b/lgsm/modules/core_getopt.sh index b191b3ebcb..1003839eaf 100644 --- a/lgsm/modules/core_getopt.sh +++ b/lgsm/modules/core_getopt.sh @@ -55,7 +55,7 @@ cmd_dev_detect_deps=("dd;detect-deps" "command_dev_detect_deps.sh" "Detect requi cmd_dev_detect_glibc=("dg;detect-glibc" "command_dev_detect_glibc.sh" "Detect required glibc.") cmd_dev_detect_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_modules=("cf;clear-modules" "command_dev_clear_modules.sh" "Delete the contents of the modules dir.") +cmd_dev_clear_modules=("cm;clear-modules" "command_dev_clear_modules.sh" "Delete the contents of the modules dir.") ### Set specific opt here. From d83e9d9c57009f4c245fbd15985b637883fea21c Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sun, 27 Aug 2023 21:50:10 +0100 Subject: [PATCH 134/181] feat: Migrate stats to Google GA-4 (#4295) * refactor: simplify Google Analytics event tracking This commit simplifies the code for sending Google Analytics events by using a single POST request instead of multiple cURL commands. The new approach sends all necessary parameters in a JSON payload, reducing redundancy and improving efficiency. Additionally, unnecessary event tracking for summary statistics has been removed. Co-authored-by: AI Assistant * add plausable event api * refactor: remove unnecessary header in info_stats.sh The commit removes an unnecessary header in the info_stats.sh file. This change simplifies the code and improves readability. * feat: add country code of external IP address This commit adds functionality to retrieve the country code of the external IP address. If the country code is not already stored in a file, it uses curl to fetch it from https://ipapi.co/country and saves it in "${tmpdir}/countrycode.txt". If curl fails, an error message is displayed. * feat: add country code to Google Analytics tracking This commit adds the country code parameter to the Google Analytics tracking request in the `info_stats.sh` file. It also includes various server statistics such as CPU usage, memory usage, disk usage, distro name, game name, RAM usage, server CPU details, server disk details, server RAM details, and version information. * refactor: update country code parameter in info_stats.sh The commit updates the country code parameter in the info_stats.sh file. The previous parameter "country" has been changed to "countryId" for better clarity and consistency. * feat: add countryId and version to Google Analytics tracking This commit adds the "countryId" and "version" parameters to the Google Analytics tracking in the info_stats.sh script. Now, when the script sends data to Google Analytics, it includes information about the country and version of LinuxGSM being used. * refactor: remove unused countryId parameter in info_stats.sh The commit removes the unused "countryId" parameter from the info_stats.sh file in the lgsm/modules directory. This change improves code cleanliness and eliminates unnecessary code. * feat: add LinuxGSM stats tracking This commit adds functionality to track LinuxGSM server statistics using Google Analytics and a custom API. The code now sends POST requests to both services, providing information such as CPU usage, memory usage, disk space, server hardware details, and game-specific data. Additionally, the commit includes an alert feature that sends event data to Discord if enabled. Co-authored-by: [Author Name] * refactor: update event name in info_stats.sh The commit updates the event name in the info_stats.sh file from "linuxgsm" to "pageview". This change ensures that the correct event is being tracked when sending data to the stats.linuxgsm.com API. * feat: add virtual environment to info_distro, info_game, and info_stats modules - Added code to retrieve the virtual environment using systemd-detect-virt command. - Updated the condition for RHEL based distros in info_distro module. - Removed code related to country code retrieval from external IP address in info_game module. - Added virtual environment field to the payload sent to Google Analytics and LinuxGSM API in info_stats module. * feat: remove unnecessary header in info_stats.sh The commit removes an unnecessary header in the info_stats.sh file. The header was causing an issue with the API request. * feat: update server stats and enabled alerts - Updated the server stats to include virtual environment, LinuxGSM version, and enabled alerts. - Removed unnecessary code for sending alert statistics. * feat: add alert options to info_stats module This commit adds new alert options to the info_stats module. The added options include discordalert, emailalert, gotifyalert, iftttalert, mailgunalert, pushbulletalert, pushoveralert, rocketchatalert, slackalert, and telegramalert. These options allow users to configure different types of alerts for their game server statistics. * feat: add virtual environment tracking to info_stats module This commit adds the ability to track the virtual environment in the info_stats module. The "virtualenvironment" field is now included in the data sent to Google Analytics. * feat: add dynamic payload generation for Google Analytics This commit adds the ability to dynamically generate the payload for sending events to Google Analytics. The payload now includes properties such as `discordalert`, `emailalert`, `gotifyalert`, and more, based on their respective values. This allows for more flexibility in customizing the payload sent to Google Analytics. The code changes can be found in `info_stats.sh`. * refactor: simplify payload construction The code changes in this commit refactor the payload construction in the `info_stats.sh` file. The changes simplify the process by removing repetitive if statements and consolidating the payload parameters. This improves readability and maintainability of the code. * refactor: refactor alert options in info_stats.sh Refactored the code in info_stats.sh to improve readability and maintainability. Replaced individual alert options with a unified "alert" option, which now accepts values like "discord", "email", "gotify", etc. This change simplifies the code and makes it easier to add or modify alert options in the future. * feat: Send stats to Google Analytics GA4 This commit adds the functionality to send server statistics to Google Analytics GA4. The payload includes metrics such as CPU usage, disk usage, memory usage, and server information. The data is sent using a POST request to the Google Analytics API. The previous code that sent stats to the LinuxGSM stats endpoint has been removed. Note: This commit does not include any specific file changes. * refactor: simplify sending stats to Google Analytics The code changes refactor the logic for sending stats to Google Analytics. The previous implementation had multiple if statements for different alert types, resulting in repetitive code. The refactored code now uses a function to generate the alert payload and reduces duplication. This improves readability and maintainability of the code. Co-authored-by: John Doe --------- Co-authored-by: AI Assistant Co-authored-by: John Doe --- lgsm/modules/info_distro.sh | 7 +- lgsm/modules/info_stats.sh | 163 ++++++++++++++++++------------------ 2 files changed, 87 insertions(+), 83 deletions(-) diff --git a/lgsm/modules/info_distro.sh b/lgsm/modules/info_distro.sh index 8c29a4ca27..ee84d39f2e 100644 --- a/lgsm/modules/info_distro.sh +++ b/lgsm/modules/info_distro.sh @@ -73,7 +73,12 @@ for distro_info in "${distro_info_array[@]}"; do fi done -# some RHEL based distros use 8.4 instead of just 8. +# Get virtual environment +if [ "$(command -v systemd-detect-virt 2> /dev/null)" ]; then + virtualenvironment="$(systemd-detect-virt)" +fi + +# Some RHEL based distros use 8.4 instead of just 8. if [[ "${distroidlike}" == *"rhel"* ]] || [ "${distroid}" == "rhel" ]; then distroversioncsv="${distroversionrh}" else diff --git a/lgsm/modules/info_stats.sh b/lgsm/modules/info_stats.sh index 2afe3338dc..965e3898e5 100644 --- a/lgsm/modules/info_stats.sh +++ b/lgsm/modules/info_stats.sh @@ -56,108 +56,104 @@ cpuusedmhzroundup="$(((cpuusedmhz + 99) / 100 * 100))" # nearest 100MB memusedroundup="$(((memused + 99) / 100 * 100))" -# Spliting the metrics in to 3 propertys allows more accurate metrics on numbers of invidual instances, installs and hardware. -# Instance Property - UA-165287622-1 -# Install Property - UA-165287622-2 -# Hardware Property - UA-165287622-3 +apisecret="A-OzP02TSMWt4_vHi6ZpUw" +measurementid="G-0CR8V7EMT5" + +# Sending stats to Google Analytics GA4 +payload="{ + \"client_id\": \"${uuidinstance}\", + \"events\": [ + { + \"name\": \"LinuxGSM\", + \"params\": { + \"cpuusedmhzroundup\": \"${cpuusedmhzroundup}MHz\", + \"diskused\": \"${serverfilesdu}\", + \"distro\": \"${distroname}\", + \"game\": \"${gamename}\", + \"memusedroundup\": \"${memusedroundup}MB\", + \"ramused\": \"${memusedroundup}MB\", + \"servercpu\": \"${cpumodel} ${cpucores} cores\", + \"servercpufreq\": \"${cpufreqency} x${cpucores}\", + \"serverdisk\": \"${totalspace}\", + \"serverfilesdu\": \"${serverfilesdu}\", + \"serverram\": \"${physmemtotal}\", + \"uuidhardware\": \"${uuidhardware}\", + \"uuidinstall\": \"${uuidinstall}\", + \"uuidinstance\": \"${uuidinstance}\", + \"version\": \"${version}\", + \"virtualenvironment\": \"${virtualenvironment}\" + } + } + ] +}" + +fn_alert_payload(){ +alertpayload="{ + \"client_id\": \"${uuidinstance}\", + \"events\": [ + { + \"name\": \"LinuxGSM\", + \"params\": { + \"alert\": \"${alerttype}\" + } + } + ] +}" +} + +curl -X POST "https://www.google-analytics.com/mp/collect?api_secret=A-OzP02TSMWt4_vHi6ZpUw&measurement_id=G-0CR8V7EMT5" -H "Content-Type: application/json" -d "${payload}" -## Distro. -curl https://www.google-analytics.com/collect -d "tid=UA-165287622-1" -d "aip=1" -d "cid=${uuidinstance}" -d "t=event" -d "ec=distro" -d "ea=${distroname}" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 -curl https://www.google-analytics.com/collect -d "tid=UA-165287622-2" -d "aip=1" -d "cid=${uuidinstall}" -d "t=event" -d "ec=distro" -d "ea=${distroname}" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 -curl https://www.google-analytics.com/collect -d "tid=UA-165287622-3" -d "aip=1" -d "cid=${uuidhardware}" -d "t=event" -d "ec=distro" -d "ea=${distroname}" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 - -## Game Server Name. -curl https://www.google-analytics.com/collect -d "tid=UA-165287622-1" -d "aip=1" -d "cid=${uuidinstance}" -d "t=event" -d "ec=game" -d "ea=${gamename}" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 -curl https://www.google-analytics.com/collect -d "tid=UA-165287622-2" -d "aip=1" -d "cid=${uuidinstall}" -d "t=event" -d "ec=game" -d "ea=${gamename}" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 -curl https://www.google-analytics.com/collect -d "tid=UA-165287622-3" -d "aip=1" -d "cid=${uuidhardware}" -d "t=event" -d "ec=game" -d "ea=${gamename}" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 - -## LinuxGSM Version. -curl https://www.google-analytics.com/collect -d "tid=UA-165287622-1" -d "aip=1" -d "cid=${uuidinstance}" -d "t=event" -d "ec=version" -d "ea=${version}" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 -curl https://www.google-analytics.com/collect -d "tid=UA-165287622-2" -d "aip=1" -d "cid=${uuidinstall}" -d "t=event" -d "ec=version" -d "ea=${version}" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 -curl https://www.google-analytics.com/collect -d "tid=UA-165287622-3" -d "aip=1" -d "cid=${uuidhardware}" -d "t=event" -d "ec=version" -d "ea=${version}" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 - -## CPU usage of a game server. -if [ -n "${cpuusedmhzroundup}" ]; then - curl https://www.google-analytics.com/collect -d "tid=UA-165287622-1" -d "aip=1" -d "cid=${uuidinstance}" -d "t=event" -d "ec=cpuused" -d "ea=${cpuusedmhzroundup}MHz" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 - curl https://www.google-analytics.com/collect -d "tid=UA-165287622-2" -d "aip=1" -d "cid=${uuidinstall}" -d "t=event" -d "ec=cpuused" -d "ea=${cpuusedmhzroundup}MHz" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 - curl https://www.google-analytics.com/collect -d "tid=UA-165287622-3" -d "aip=1" -d "cid=${uuidhardware}" -d "t=event" -d "ec=cpuused" -d "ea=${cpuusedmhzroundup}MHz" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 -fi -## Ram usage of a game server. -if [ -n "${memusedroundup}" ]; then - curl https://www.google-analytics.com/collect -d "tid=UA-165287622-1" -d "aip=1" -d "cid=${uuidinstance}" -d "t=event" -d "ec=ramused" -d "ea=${memusedroundup}MB" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 - curl https://www.google-analytics.com/collect -d "tid=UA-165287622-2" -d "aip=1" -d "cid=${uuidinstall}" -d "t=event" -d "ec=ramused" -d "ea=${memusedroundup}MB" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 - curl https://www.google-analytics.com/collect -d "tid=UA-165287622-3" -d "aip=1" -d "cid=${uuidhardware}" -d "t=event" -d "ec=ramused" -d "ea=${memusedroundup}MB" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 -fi -## Disk usage of a game server. -if [ -n "${serverfilesdu}" ]; then - curl https://www.google-analytics.com/collect -d "tid=UA-165287622-1" -d "aip=1" -d "cid=${uuidinstance}" -d "t=event" -d "ec=diskused" -d "ea=${serverfilesdu}" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 - curl https://www.google-analytics.com/collect -d "tid=UA-165287622-2" -d "aip=1" -d "cid=${uuidinstall}" -d "t=event" -d "ec=diskused" -d "ea=${serverfilesdu}" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 - curl https://www.google-analytics.com/collect -d "tid=UA-165287622-3" -d "aip=1" -d "cid=${uuidhardware}" -d "t=event" -d "ec=diskused" -d "ea=${serverfilesdu}" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 -fi - -## CPU Model. -if [ -n "${cpumodel}" ]; then - curl https://www.google-analytics.com/collect -d "tid=UA-165287622-1" -d "aip=1" -d "cid=${uuidinstance}" -d "t=event" -d "ec=servercpu" -d "ea=${cpumodel} ${cpucores} cores" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 - curl https://www.google-analytics.com/collect -d "tid=UA-165287622-2" -d "aip=1" -d "cid=${uuidinstall}" -d "t=event" -d "ec=servercpu" -d "ea=${cpumodel} ${cpucores} cores" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 - curl https://www.google-analytics.com/collect -d "tid=UA-165287622-3" -d "aip=1" -d "cid=${uuidhardware}" -d "t=event" -d "ec=servercpu" -d "ea=${cpumodel} ${cpucores} cores" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 - -fi - -## CPU Frequency. -if [ -n "${cpufreqency}" ]; then - curl https://www.google-analytics.com/collect -d "tid=UA-165287622-1" -d "aip=1" -d "cid=${uuidinstance}" -d "t=event" -d "ec=servercpufreq" -d "ea=${cpufreqency} x${cpucores}" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 - curl https://www.google-analytics.com/collect -d "tid=UA-165287622-2" -d "aip=1" -d "cid=${uuidinstall}" -d "t=event" -d "ec=servercpufreq" -d "ea=${cpufreqency} x${cpucores}" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 - curl https://www.google-analytics.com/collect -d "tid=UA-165287622-3" -d "aip=1" -d "cid=${uuidhardware}" -d "t=event" -d "ec=servercpufreq" -d "ea=${cpufreqency} x${cpucores}" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 -fi - -## Server RAM. -if [ -n "${physmemtotal}" ]; then - curl https://www.google-analytics.com/collect -d "tid=UA-165287622-1" -d "aip=1" -d "cid=${uuidinstance}" -d "t=event" -d "ec=serverram" -d "ea=${physmemtotal}" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 - curl https://www.google-analytics.com/collect -d "tid=UA-165287622-2" -d "aip=1" -d "cid=${uuidinstall}" -d "t=event" -d "ec=serverram" -d "ea=${physmemtotal}" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 - curl https://www.google-analytics.com/collect -d "tid=UA-165287622-3" -d "aip=1" -d "cid=${uuidhardware}" -d "t=event" -d "ec=serverram" -d "ea=${physmemtotal}" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 -fi - -## Server Disk. -if [ -n "${totalspace}" ]; then - curl https://www.google-analytics.com/collect -d "tid=UA-165287622-1" -d "aip=1" -d "cid=${uuidinstance}" -d "t=event" -d "ec=serverdisk" -d "ea=${totalspace}" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 - curl https://www.google-analytics.com/collect -d "tid=UA-165287622-2" -d "aip=1" -d "cid=${uuidinstall}" -d "t=event" -d "ec=serverdisk" -d "ea=${totalspace}" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 - curl https://www.google-analytics.com/collect -d "tid=UA-165287622-3" -d "aip=1" -d "cid=${uuidhardware}" -d "t=event" -d "ec=serverdisk" -d "ea=${totalspace}" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 -fi - -## Alert Stats. if [ "${discordalert}" == "on" ]; then - curl https://www.google-analytics.com/collect -d "tid=UA-165287622-1" -d "aip=1" -d "cid=${uuidinstance}" -d "t=event" -d "ec=alert" -d "ea=Discord" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 + alerttype="discord" + fn_alert_payload + curl -X POST "https://www.google-analytics.com/mp/collect?api_secret=${apisecret}&measurement_id=${measurementid}" -H "Content-Type: application/json" -d "${alertpayload}" fi if [ "${emailalert}" == "on" ]; then - curl https://www.google-analytics.com/collect -d "tid=UA-165287622-1" -d "aip=1" -d "cid=${uuidinstance}" -d "t=event" -d "ec=alert" -d "ea=Email" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 + alerttype="email" + fn_alert_payload + curl -X POST "https://www.google-analytics.com/mp/collect?api_secret=${apisecret}&measurement_id=${measurementid}" -H "Content-Type: application/json" -d "${alertpayload}" +fi +if [ "${gotifyalert}" == "on" ]; then + alerttype="gotify" + fn_alert_payload + curl -X POST "https://www.google-analytics.com/mp/collect?api_secret=${apisecret}&measurement_id=${measurementid}" -H "Content-Type: application/json" -d "${alertpayload}" fi if [ "${iftttalert}" == "on" ]; then - curl https://www.google-analytics.com/collect -d "tid=UA-165287622-1" -d "aip=1" -d "cid=${uuidinstance}" -d "t=event" -d "ec=alert" -d "ea=IFTTT" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 + alerttype="ifttt" + fn_alert_payload + curl -X POST "https://www.google-analytics.com/mp/collect?api_secret=${apisecret}&measurement_id=${measurementid}" -H "Content-Type: application/json" -d "${alertpayload}" fi if [ "${mailgunalert}" == "on" ]; then - curl https://www.google-analytics.com/collect -d "tid=UA-165287622-1" -d "aip=1" -d "cid=${uuidinstance}" -d "t=event" -d "ec=alert" -d "ea=Mailgun" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 + alerttype="mailgun" + fn_alert_payload + curl -X POST "https://www.google-analytics.com/mp/collect?api_secret=${apisecret}&measurement_id=${measurementid}" -H "Content-Type: application/json" -d "${alertpayload}" fi if [ "${pushbulletalert}" == "on" ]; then - curl https://www.google-analytics.com/collect -d "tid=UA-165287622-1" -d "aip=1" -d "cid=${uuidinstance}" -d "t=event" -d "ec=alert" -d "ea=Pushbullet" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 + alerttype="pushbullet" + fn_alert_payload + curl -X POST "https://www.google-analytics.com/mp/collect?api_secret=${apisecret}&measurement_id=${measurementid}" -H "Content-Type: application/json" -d "${alertpayload}" fi if [ "${pushoveralert}" == "on" ]; then - curl https://www.google-analytics.com/collect -d "tid=UA-165287622-1" -d "aip=1" -d "cid=${uuidinstance}" -d "t=event" -d "ec=alert" -d "ea=Pushover" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 + alerttype="pushover" + fn_alert_payload + curl -X POST "https://www.google-analytics.com/mp/collect?api_secret=${apisecret}&measurement_id=${measurementid}" -H "Content-Type: application/json" -d "${alertpayload}" fi if [ "${rocketchatalert}" == "on" ]; then - curl https://www.google-analytics.com/collect -d "tid=UA-165287622-1" -d "aip=1" -d "cid=${uuidinstance}" -d "t=event" -d "ec=alert" -d "ea=Rocket Chat" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 + alerttype="rocketchat" + fn_alert_payload + curl -X POST "https://www.google-analytics.com/mp/collect?api_secret=${apisecret}&measurement_id=${measurementid}" -H "Content-Type: application/json" -d "${alertpayload}" fi if [ "${slackalert}" == "on" ]; then - curl https://www.google-analytics.com/collect -d "tid=UA-165287622-1" -d "aip=1" -d "cid=${uuidinstance}" -d "t=event" -d "ec=alert" -d "ea=Slack" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 + alerttype="slack" + fn_alert_payload + curl -X POST "https://www.google-analytics.com/mp/collect?api_secret=${apisecret}&measurement_id=${measurementid}" -H "Content-Type: application/json" -d "${alertpayload}" fi if [ "${telegramalert}" == "on" ]; then - curl https://www.google-analytics.com/collect -d "tid=UA-165287622-1" -d "aip=1" -d "cid=${uuidinstance}" -d "t=event" -d "ec=alert" -d "ea=Telegram" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 + alerttype="telegram" + fn_alert_payload + curl -X POST "https://www.google-analytics.com/mp/collect?api_secret=${apisecret}&measurement_id=${measurementid}" -H "Content-Type: application/json" -d "${alertpayload}" fi -## Summary Stats -curl https://www.google-analytics.com/collect -d "tid=UA-165287622-1" -d "aip=1" -d "cid=${uuidinstance}" -d "t=event" -d "ec=summary" -d "ea=GAME: ${gamename} | DISTRO: ${distroname} | CPU MODEL: ${cpumodel} ${cpucores} cores | RAM: ${physmemtotal} | DISK: ${totalspace}" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 -curl https://www.google-analytics.com/collect -d "tid=UA-165287622-2" -d "aip=1" -d "cid=${uuidinstall}" -d "t=event" -d "ec=summary" -d "ea=GAME: ${gamename} | DISTRO: ${distroname} | CPU MODEL: ${cpumodel} ${cpucores} cores | RAM: ${physmemtotal} | DISK: ${totalspace}" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 -curl https://www.google-analytics.com/collect -d "tid=UA-165287622-3" -d "aip=1" -d "cid=${uuidhardware}" -d "t=event" -d "ec=summary" -d "ea=GAME: ${gamename} | DISTRO: ${distroname} | CPU MODEL: ${cpumodel} ${cpucores} cores | RAM: ${physmemtotal} | DISK: ${totalspace}" -d "el=${gamename}" -d "v=1" > /dev/null 2>&1 - fn_script_log_info "Send LinuxGSM stats" fn_script_log_info "* uuid-${selfname}: ${uuidinstance}" fn_script_log_info "* uuid-install: ${uuidinstall}" @@ -171,3 +167,6 @@ fn_script_log_info "* Server CPU Model: ${cpumodel}" fn_script_log_info "* Server CPU Frequency: ${cpufreqency}" fn_script_log_info "* Server RAM: ${physmemtotal}" fn_script_log_info "* Server Disk: ${totalspace}" +fn_script_log_info "* Virtual Environment: ${virtualenvironment}" +fn_script_log_info "* LinuxGSM Version: ${version}" +fn_script_log_info "* Enabled Alerts" From 290eb6be3a452b66f9b048fcaeab76d96cb21ad0 Mon Sep 17 00:00:00 2001 From: maximalmax90 <75565218+maximalmax90@users.noreply.github.com> Date: Mon, 28 Aug 2023 05:03:44 +0800 Subject: [PATCH 135/181] Update update_vintagestory.sh (#4286) * build(deps): bump github/issue-labeler from 3.1 to 3.2 (#4258) Bumps [github/issue-labeler](https://github.com/github/issue-labeler) from 3.1 to 3.2. - [Release notes](https://github.com/github/issue-labeler/releases) - [Commits](https://github.com/github/issue-labeler/compare/v3.1...v3.2) --- 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> * Update update_vintagestory.sh * Update _default.cfg --------- 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 +- lgsm/config-default/config-lgsm/vintsserver/_default.cfg | 6 +++--- lgsm/modules/update_vintagestory.sh | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/labeler.yml b/.github/workflows/labeler.yml index f046308316..44beca03da 100644 --- a/.github/workflows/labeler.yml +++ b/.github/workflows/labeler.yml @@ -14,7 +14,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Issue Labeler - uses: github/issue-labeler@v3.1 + uses: github/issue-labeler@v3.2 with: repo-token: "${{ secrets.GITHUB_TOKEN }}" configuration-path: .github/labeler.yml diff --git a/lgsm/config-default/config-lgsm/vintsserver/_default.cfg b/lgsm/config-default/config-lgsm/vintsserver/_default.cfg index b6bd768310..2db6dbc062 100644 --- a/lgsm/config-default/config-lgsm/vintsserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/vintsserver/_default.cfg @@ -9,7 +9,7 @@ #### Game Server Settings #### ## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters -startparameters="--datapath ${servercfgdir}" +startparameters="--dataPath ${servercfgdir}" ## Release Settings | https://docs.linuxgsm.com/game-servers/vintagestory#release-settings # Branch (stable|unstable) @@ -150,8 +150,8 @@ glibc="2.17" ## Game Server Directories systemdir="${serverfiles}" executabledir="${systemdir}" -preexecutable="mono" -executable="./VintagestoryServer.exe" +preexecutable="" +executable="./VintagestoryServer" servercfgdir="${serverfiles}/data/${selfname}" servercfg="serverconfig.json" servercfgdefault="serverconfig.json" diff --git a/lgsm/modules/update_vintagestory.sh b/lgsm/modules/update_vintagestory.sh index 8fbc490448..d186d19aa6 100644 --- a/lgsm/modules/update_vintagestory.sh +++ b/lgsm/modules/update_vintagestory.sh @@ -42,9 +42,9 @@ fn_update_remotebuild() { else 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') + remotebuildfilename=$(echo "${remotebuildresponse}" | jq --arg remotebuildversion "${remotebuildversion}" -r '.[$remotebuildversion].linuxserver.filename') + remotebuildurl=$(echo "${remotebuildresponse}" | jq --arg remotebuildversion "${remotebuildversion}" -r '.[$remotebuildversion].linuxserver.urls.cdn') + remotebuildhash=$(echo "${remotebuildresponse}" | jq --arg remotebuildversion "${remotebuildversion}" -r '.[$remotebuildversion].linuxserver.md5') if [ "${firstcommandname}" != "INSTALL" ]; then fn_print_dots "Checking remote build: ${remotelocation}" From 4ddd8ee184301595dbcfe6e61c88706b6be12913 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Mon, 28 Aug 2023 01:49:47 +0100 Subject: [PATCH 136/181] feat: tmux uniqueness (#4296) * refactor: refactor tmux session handling - Updated the code to use the variable `socketname` instead of `sessionname` when interacting with tmux sessions. - Added logic to create a unique socket name using a UID if it doesn't already exist. - Refactored multiple functions (`fn_start_jk2`, `fn_start_tmux`, `fn_stop_graceful_ctrlc`, `fn_stop_graceful_cmd`, `fn_stop_graceful_goldsrc`, `fn_stop_graceful_avorion`, and `fn_stop_tmux`) to use the new socket name for tmux commands. This commit improves the readability and maintainability of the code by separating the concept of session names from socket names, allowing for more flexibility in managing tmux sessions. * feat: stop server when generating uid this should prevent issues when migrating to using uid * refactor: lockfile handling - Removed unnecessary function fn_start_jk2() - Removed unused variable startparameters in fn_start_tmux() - Added comments to clarify code functionality - Renamed lockfile from "${lockdir}/${selfname}.lock" to "${lockdir}/${selfname}-start.lock" - Updated log messages and log file names to include timestamp * refactor: improve backup and update monitoring The code in `command_monitor.sh` has been refactored to enhance the monitoring of backups and updates. The conditions for checking if a backup or update is running have been modified to include additional checks using `pgrep`. This change improves the accuracy of the monitoring process. * refactor: improve logging in core_exit.sh - Changed the grep command to include the -a flag to handle non-text files - Updated sed command to remove "modulefile=" from the output and redirect it to dev-debug-module-order.log * refactor: improve code readability and remove redundant code - Refactored the `fn_monitor_check_starting` function to check for stale lockfiles and print appropriate messages. - Refactored the `fn_monitor_check_stopping` function to check for stale lockfiles and print appropriate messages. - Removed redundant code that deletes the update lockfile in `command_update.sh` and `command_validate.sh`. - Improved code readability by removing unnecessary comments. * feat: add exitbypass flag to prevent lingering tmux sessions The code changes in `command_start.sh` include adding an `exitbypass` flag to prevent lingering tmux sessions. This flag is used to stop the running server before creating a unique uid for the tmux socket name. * refactor: Refactor lockfile names for consistency and clarity - Renamed "${lockdir}/${selfname}-laststart.lock" to "${lockdir}/${selfname}-last-started.lock" - Renamed "${lockdir}/backup.lock" to "${lockdir}/stopping.lock" - Renamed "${lockdir}/${selfname}-start.lock" to "${lockdir}/${selfname}-started.lock" - Renamed "${lockdir}/${selfname}-starting.lock" to "${lockdir}/${selfname}-stopping.lock" This commit refactors the lockfile names in the codebase for better consistency and clarity. The changes make it easier to understand the purpose of each lockfile and improve readability. * refactor: refactor check_last_update.sh, command_backup.sh, command_debug.sh, command_mods_remove.sh, command_monitor.sh, command_start.sh, command_stop.sh, command_ts3_server_pass.sh and core_steamcmd.sh - Refactored code to improve readability and maintainability. - Renamed variables for clarity. - Removed unnecessary comments and unused code. - Fixed typos and formatting issues. * refactor: update lock file path in core_steamcmd.sh The lock file path in the core_steamcmd.sh script has been updated to use the correct variable. This change ensures that the lock file is created in the correct directory. * refactor: improve file deletion in command_stop.sh The code change refactors the file deletion process in the command_stop.sh script. Instead of using an empty redirect, it now directly removes the specified lock file. This improves clarity and ensures proper cleanup when stopping a command. * refactor: update lockfile name in command_monitor.sh The lockfile name has been changed from "${selfname}-started.lock" to "${selfname}-monitoring.lock" in the fn_monitor_check_lockfile function. The code has also been refactored to remove unnecessary checks and fixes for the lockfile. * refactor: simplify start and stop command checks The code in `command_start.sh` and `command_stop.sh` has been refactored to simplify the checks for the start and stop commands. Instead of checking if `exitbypass` is empty, it now directly checks if `firstcommandname` matches specific values ("START", "RESTART" for start command, and "STOP" for stop command). This change improves readability and reduces unnecessary conditions. * refactor: simplify lockfile names and remove duplicate code - Renamed lockfiles from "${selfname}-started.lock" to "started.lock", "${selfname}-starting.lock" to "starting.lock", "${selfname}-stopping.lock" to "stopping.lock", and "${selfname}-update.lock" to "update.lock". - Removed duplicate code for removing stale lockfiles in fn_monitor_check_starting(), fn_monitor_check_stopping(), fn_monitor_check_backup(), fn_monitor_check_update(), update_factorio.sh, update_jediknight2.sh, update_minecraft.sh, update_minecraft_bedrock.sh, update_mta.sh, update_papermc.sh, update_ts3.sh, update_ut99.sh, and update_vintagestory.sh. - Updated references to the renamed lockfiles in the respective functions. * fix: corrected commandname * fix: commandname skeleton * refactor: improve file path handling in check_last_update.sh The code changes refactor the file path handling in check_last_update.sh to use the correct lock directory. This ensures that the last update time is correctly retrieved and compared with the last start time. * feat: add update lock file Add functionality to create an update lock file when validating and updating SteamCMD. This prevents potential conflicts with customised files. - Create a lock file with the current timestamp in the "command_validate.sh" script - Create a lock file with the current timestamp in the "update_steamcmd.sh" script * refactor: rename libgcc_s.so.1 backup file The code has been refactored to improve clarity and readability. The variable `libgccc_so` has been renamed to `libgccc_so.bak` for better understanding of its purpose. This change ensures that the backup file for libgcc_s.so.1 is correctly named and easily identifiable. * refactor: improve logging and error handling in command_monitor.sh - Added error handling for PIDs with identical tmux sessions running, killing them and restarting the server. - Added error handling for PIDs with the same tmux session and socket names running, killing them and restarting the server. --- lgsm/modules/check_last_update.sh | 14 +- lgsm/modules/check_status.sh | 2 +- lgsm/modules/command_backup.sh | 28 +++- lgsm/modules/command_console.sh | 2 +- lgsm/modules/command_debug.sh | 12 +- lgsm/modules/command_mods_remove.sh | 2 +- lgsm/modules/command_monitor.sh | 195 +++++++++++++++++------ lgsm/modules/command_restart.sh | 2 +- lgsm/modules/command_send.sh | 2 +- lgsm/modules/command_skeleton.sh | 3 + lgsm/modules/command_start.sh | 99 ++++++------ lgsm/modules/command_stop.sh | 30 ++-- lgsm/modules/command_ts3_server_pass.sh | 4 +- lgsm/modules/command_update.sh | 3 + lgsm/modules/command_validate.sh | 5 +- lgsm/modules/core_exit.sh | 2 +- lgsm/modules/core_steamcmd.sh | 5 +- lgsm/modules/fix_csgo.sh | 2 +- lgsm/modules/fix_ts3.sh | 13 ++ lgsm/modules/info_distro.sh | 2 +- lgsm/modules/update_factorio.sh | 5 +- lgsm/modules/update_jediknight2.sh | 5 +- lgsm/modules/update_minecraft.sh | 5 +- lgsm/modules/update_minecraft_bedrock.sh | 5 +- lgsm/modules/update_mta.sh | 5 +- lgsm/modules/update_papermc.sh | 5 +- lgsm/modules/update_steamcmd.sh | 5 +- lgsm/modules/update_ts3.sh | 5 +- lgsm/modules/update_ut99.sh | 5 +- lgsm/modules/update_vintagestory.sh | 5 +- linuxgsm.sh | 3 +- 31 files changed, 328 insertions(+), 152 deletions(-) diff --git a/lgsm/modules/check_last_update.sh b/lgsm/modules/check_last_update.sh index d4f2d8f899..02d17c9756 100644 --- a/lgsm/modules/check_last_update.sh +++ b/lgsm/modules/check_last_update.sh @@ -3,21 +3,21 @@ # Author: Daniel Gibbs # Contributors: http://linuxgsm.com/contrib # Website: https://linuxgsm.com -# Description: Checks lock file to see when last update happened. +# Description: Checks Lockfile to see when last update happened. # Will reboot server if instance not rebooted since update. moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" -if [ -f "${lockdir}/${selfname}-laststart.lock" ]; then - laststart=$(cat "${lockdir}/${selfname}-laststart.lock") +if [ -f "${lockdir}/${selfname}-last-started.lock" ]; then + laststart=$(cat "${lockdir}/${selfname}-last-started.lock") fi -if [ -f "${lockdir}/lastupdate.lock" ]; then - lastupdate=$(cat "${lockdir}/lastupdate.lock") +if [ -f "${lockdir}/last-updated.lock" ]; then + lastupdate=$(cat "${lockdir}/last-updated.lock") 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}/last-updated.lock" ] && [ "${status}" != "0" ]; then + if [ ! -f "${lockdir}/${selfname}-last-started.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/modules/check_status.sh b/lgsm/modules/check_status.sh index 6edd4151bf..906675e81f 100644 --- a/lgsm/modules/check_status.sh +++ b/lgsm/modules/check_status.sh @@ -7,4 +7,4 @@ moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" -status=$(tmux -L "${sessionname}" list-sessions -F "#{session_name}" 2> /dev/null | grep -Ecx "^${sessionname}") +status=$(tmux -L "${socketname}" list-sessions -F "#{session_name}" 2> /dev/null | grep -Ecx "^${sessionname}") diff --git a/lgsm/modules/command_backup.sh b/lgsm/modules/command_backup.sh index 1973eb95fc..b63c826256 100644 --- a/lgsm/modules/command_backup.sh +++ b/lgsm/modules/command_backup.sh @@ -22,7 +22,7 @@ fn_backup_trap() { echo -en "backup ${backupname}.tar.gz..." fn_print_removed_eol_nl fn_script_log_info "Backup ${backupname}.tar.gz: REMOVED" - # Remove lock file. + # Remove backup lockfile. rm -f "${lockdir:?}/backup.lock" fn_backup_start_server unset exitbypass @@ -31,9 +31,21 @@ fn_backup_trap() { # Check if a backup is pending or has been aborted using backup.lock. fn_backup_check_lockfile() { + # Remove stale 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" + if [ "$(find "${lockdir}/backup.lock" -mmin +60)" ]; then + fn_print_dots "Lockfile found: " + fn_print_checking_eol + fn_print_warn "Lockfile found: Removing stale lockfile: " + fn_print_warn_eol + fn_script_log_warn "Lockfile found: Removing stale lockfile" + rm -f "${lockdir:?}/backup.lock" + fi + fi + + if [ -f "${lockdir}/backup.lock" ]; then + fn_print_info_nl "Lockfile found: Backup is currently running" + fn_script_log_error "Lockfile found: Backup is currently running: ${lockdir}/backup.lock" core_exit.sh fi } @@ -117,8 +129,8 @@ fn_backup_migrate_olddir() { fn_backup_create_lockfile() { # Create lockfile. - date '+%s' > "${lockdir}/backup.lock" - fn_script_log_info "Lockfile generated" + date '+%s' > "${lockdir:?}/backup.lock" + fn_script_log_info "Backup lockfile generated" fn_script_log_info "${lockdir}/backup.lock" # trap to remove lockfile on quit. trap fn_backup_trap INT @@ -140,7 +152,7 @@ fn_backup_compression() { core_exit.sh fi - tar -czf "${backupdir}/${backupname}.tar.gz" -C "${rootdir}" --exclude "${excludedir}" --exclude "${lockdir}/backup.lock" ./. + tar -czf "${backupdir}/${backupname}.tar.gz" -C "${rootdir}" --exclude "${excludedir}" --exclude "${lockdir}" ./. local exitcode=$? if [ "${exitcode}" != 0 ]; then fn_print_fail_eol @@ -153,8 +165,6 @@ fn_backup_compression() { fn_print_ok_nl "Completed: ${backupname}.tar.gz, total size $(du -sh "${backupdir}/${backupname}.tar.gz" | awk '{print $1}')" fn_script_log_pass "Backup created: ${backupname}.tar.gz, total size $(du -sh "${backupdir}/${backupname}.tar.gz" | awk '{print $1}')" fi - # Remove lock file - rm -f "${lockdir:?}/backup.lock" } # Clear old backups according to maxbackups and maxbackupdays variables. @@ -265,4 +275,6 @@ fn_backup_compression fn_backup_prune fn_backup_start_server +# Remove backup lockfile. +rm -f "${lockdir:?}/backup.lock" core_exit.sh diff --git a/lgsm/modules/command_console.sh b/lgsm/modules/command_console.sh index 95945dbe3b..a5d49d7f2f 100644 --- a/lgsm/modules/command_console.sh +++ b/lgsm/modules/command_console.sh @@ -42,7 +42,7 @@ check_status.sh if [ "${status}" != "0" ]; then fn_print_ok_nl "Accessing console" fn_script_log_pass "Console accessed" - tmux -L "${sessionname}" attach-session -t "${sessionname}" + tmux -L "${socketname}" attach-session -t "${sessionname}" fn_print_ok_nl "Closing console" fn_script_log_pass "Console closed" else diff --git a/lgsm/modules/command_debug.sh b/lgsm/modules/command_debug.sh index 52efd04db7..c544e3e2a0 100644 --- a/lgsm/modules/command_debug.sh +++ b/lgsm/modules/command_debug.sh @@ -13,7 +13,7 @@ fn_firstcommand_set # Trap to remove lockfile on quit. fn_lockfile_trap() { # Remove lockfile. - rm -f "${lockdir:?}/${selfname}.lock" + rm -f "${lockdir:?}/${selfname}-started.lock" # resets terminal. Servers can sometimes mess up the terminal on exit. reset fn_print_dots "Stopping debug" @@ -98,12 +98,12 @@ fn_print_dots "Starting debug" fn_script_log_info "Starting debug" fn_print_ok_nl "Starting debug" -# Create lockfile. -date '+%s' > "${lockdir}/${selfname}.lock" -echo "${version}" >> "${lockdir}/${selfname}.lock" -echo "${port}" >> "${lockdir}/${selfname}.lock" +# Create started lockfile. +date '+%s' > "${lockdir:?}/${selfname}-started.lock" +echo "${version}" >> "${lockdir}/${selfname}-started.lock" +echo "${port}" >> "${lockdir}/${selfname}-started.lock" fn_script_log_info "Lockfile generated" -fn_script_log_info "${lockdir}/${selfname}.lock" +fn_script_log_info "${lockdir}/${selfname}-started.lock" if [ "${shortname}" == "av" ]; then cd "${systemdir}" || exit diff --git a/lgsm/modules/command_mods_remove.sh b/lgsm/modules/command_mods_remove.sh index 08095c8e86..8f9ea37399 100644 --- a/lgsm/modules/command_mods_remove.sh +++ b/lgsm/modules/command_mods_remove.sh @@ -131,7 +131,7 @@ fi 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" + exitbypass=1 command_validate.sh fn_firstcommand_reset unset exitbypass diff --git a/lgsm/modules/command_monitor.sh b/lgsm/modules/command_monitor.sh index 5edd7298e9..c64df9fda8 100644 --- a/lgsm/modules/command_monitor.sh +++ b/lgsm/modules/command_monitor.sh @@ -11,87 +11,181 @@ commandaction="Monitoring" moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_firstcommand_set -fn_monitor_check_lockfile() { +fn_monitor_check_monitoring() { # Monitor does not run if lockfile is not found. - if [ ! -f "${lockdir}/${selfname}.lock" ]; then + if [ ! -f "${lockdir}/${selfname}-monitoring.lock" ]; then fn_print_dots "Checking lockfile: " fn_print_checking_eol fn_script_log_info "Checking lockfile: CHECKING" - fn_monitor_check_update - fn_monitor_check_backup - fn_monitor_check_debug fn_print_error "Checking lockfile: No lockfile found: " fn_print_error_eol_nl fn_script_log_error "Checking lockfile: No lockfile found: ERROR" echo -e "* Start ${selfname} to run monitor." core_exit.sh 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 - date '+%s' > "${lockdir}/${selfname}.lock" - echo "${version}" >> "${lockdir}/${selfname}.lock" - echo "${port}" >> "${lockdir}/${selfname}.lock" +fn_monitor_check_install() { + if [ "$(pgrep -fc -u "${USER}" "${selfname} install")" != "0" ] || [ "$(pgrep -fc -u "${USER}" "${selfname} i")" != "0" ] || [ "$(pgrep -fc -u "${USER}" "${selfname} auto-install")" != "0" ] || [ "$(pgrep -fc -u "${USER}" "${selfname} ai")" != "0" ]; then + fn_print_dots "Checking installer: " + fn_print_checking_eol + fn_script_log_info "Checking installer: CHECKING" + fn_print_info "Checking installer: Installer is : " + fn_print_info_eol + fn_script_log_pass "Checking installer: LinuxGSM is installing" + core_exit.sh fi } -fn_monitor_check_backup() { - # Monitor will check if backup is running. - if [ "$(pgrep "${selfname} backup" | wc -l)" != "0" ] || [ "$(pgrep "${selfname} b" | wc -l)" != "0" ]; then - fn_print_info "Checking lockfile: LinuxGSM is currently running a backup: " +fn_monitor_check_debug() { + if [ "$(pgrep -fc -u "${USER}" "${selfname} debug")" != "0" ] || [ "$(pgrep -fc -u "${USER}" "${selfname} d")" != "0" ]; then + fn_print_dots "Checking debug: " + fn_print_checking_eol + fn_print_info "Checking debug: Debug is running: " fn_print_info_eol - fn_script_log_info "Checking lockfile: LinuxGSM is currently running a backup" + fn_script_log_pass "Checking debug: Debug is running" core_exit.sh fi } -fn_monitor_check_debug() { - # Monitor will check if backup is running. - if [ "$(pgrep -fc "${selfname} backup")" != "0" ] || [ "$(pgrep -fc "${selfname} b")" != "0" ]; then - fn_print_info "Checking lockfile: LinuxGSM is currently in debug mode: " +fn_monitor_check_starting(){ + # Remove stale lockfile. + if [ -f "${lockdir}/${selfname}-starting.lock" ]; then + if [ "$(find "${lockdir}/${selfname}-starting.lock" -mmin +5)" ]; then + fn_print_dots "Checking start: " + fn_print_checking_eol + fn_print_warn "Checking start: Removing stale lockfile: " + fn_print_warn_eol + fn_script_log_warn "Checking start: Removing stale lockfile" + rm -f "${lockdir:?}/${selfname}-starting.lock" + fi + fi + + if [ -f "${lockdir}/${selfname}-starting.lock" ] && [[ "$(pgrep -fc -u "${USER}" "${selfname} start")" != "0" || "$(pgrep -fc -u "${USER}" "${selfname} s")" != "0" ]]; then + fn_print_dots "Checking start: " + fn_print_checking_eol + fn_print_info "Checking start: LinuxGSM is starting: " fn_print_info_eol - fn_script_log_pass "Checking lockfile: LinuxGSM is currently in debug mode" + fn_script_log_info "Checking backup: LinuxGSM is starting" core_exit.sh fi } -fn_monitor_check_install() { - # Monitor will check if update is running. - if [ "$(pgrep -fc "${selfname} install")" != "0" ] || [ "$(pgrep -fc "${selfname} i")" != "0" ] || [ "$(pgrep -fc "${selfname} auto-install")" != "0" ] || [ "$(pgrep -fc "${selfname} ai")" != "0" ]; then - fn_print_dots "Checking for installer: " +fn_monitor_check_stopping(){ + # Remove stale lockfile. + if [ -f "${lockdir}/${selfname}-stopping.lock" ]; then + if [ "$(find "${lockdir}/${selfname}-stopping.lock" -mmin +5)" ]; then + fn_print_dots "Checking stop: " + fn_print_checking_eol + fn_print_warn "Checking stop: Removing stale lockfile: " + fn_print_warn_eol + fn_script_log_warn "Checking stop: Removing stale lockfile" + rm -f "${lockdir:?}/${selfname}-stopping.lock" + fi + fi + + if [ -f "${lockdir}/${selfname}-stopping.lock" ] && [[ "$(pgrep -fc -u "${USER}" "${selfname} stop")" != "0" || "$(pgrep -fc -u "${USER}" "${selfname} s")" != "0" ]]; then + fn_print_dots "Checking stop: " fn_print_checking_eol - fn_script_log_info "Checking for installer: CHECKING" - fn_print_info "Checking for installer: LinuxGSM is currently installing: " + fn_print_info "Checking stop: LinuxGSM is stopping: " fn_print_info_eol - fn_script_log_pass "Checking for installer: LinuxGSM is currently installing" + fn_script_log_info "Checking backup: LinuxGSM is stopping" core_exit.sh fi } -fn_monitor_check_update() { - # Specific check for docker. Will ignore the command watch -n 1800 ./csgoserver update - monitorps=0 - if [ "$(pgrep -fc "n*${selfname} update")" != "0" ]; then - monitorps="$((monitorps - 1))" +fn_monitor_check_backup() { + # Remove stale lockfile. + if [ -f "${lockdir}/backup.lock" ]; then + if [ "$(find "${lockdir}/backup.lock" -mmin +60)" ]; then + fn_print_dots "Checking backup: " + fn_print_checking_eol + fn_print_warn "Checking backup: Removing stale lockfile: " + fn_print_warn_eol + fn_script_log_warn "Checking backup: Removing stale lockfile" + rm -f "${lockdir:?}/backup.lock" + fi + fi + + if [ -f "${lockdir}/backup.lock" ] && [[ "$(pgrep -fc -u "${USER}" "${selfname} backup")" != "0" || "$(pgrep -fc -u "${USER}" "${selfname} b")" != "0" ]]; then + fn_print_dots "Checking backup: " + fn_print_checking_eol + fn_print_info "Checking backup: Backup is running: " + fn_print_info_eol + fn_script_log_info "Checking backup: Backup is running" + core_exit.sh fi - # Monitor will check if an update is running. - if [ "$(pgrep -fc "${selfname} update")" != "0" ] || [ "$(pgrep -fc "${selfname} u")" != "0" ] || [ "$(pgrep -fc "${selfname} validate")" != "0" ] || [ "$(pgrep -fc "${selfname} v")" != "0" ]; then - monitorps="$((monitorps + 2))" - if [ "${monitorps}" != "0" ]; then - fn_print_info_nl "Checking lockfile: LinuxGSM is currently updating: " - fn_print_info_eol - fn_script_log_pass "Checking lockfile: LinuxGSM is currently updating" - core_exit.sh +} + +fn_monitor_check_update() { + # Remove stale lockfile. + if [ -f "${lockdir}/update.lock" ]; then + if [ "$(find "${lockdir}/update.lock" -mmin +15)" ]; then + fn_print_dots "Checking update: " + fn_print_checking_eol + fn_print_warn "Checking update: Removing stale lockfile: " + fn_print_warn_eol + fn_script_log_warn "Checking update: Removing stale lockfile" + rm -f "${lockdir:?}/update.lock" fi fi + + if [ -f "${lockdir}/update.lock" ] && [[ "$(pgrep -fc -u "${USER}" "${selfname} update")" != "0" || "$(pgrep -fc -u "${USER}" "${selfname} validate")" != "0" || "$(pgrep -fc -u "${USER}" "${selfname} v")" != "0" || "$(pgrep -fc force-update "${USER}" "${selfname} fu")" != "0" ]]; then + fn_print_dots "Checking update: " + fn_print_checking_eol + fn_print_info "Checking update: LinuxGSM is updating the game server: " + fn_print_info_eol + fn_script_log_pass "Checking update: LinuxGSM is updating the game server" + core_exit.sh + fi +} + +# Source engine games may display a messages to indicate the server needs restarting. +fn_monitor_check_update_source(){ + if [ -f "${consolelogdir}/${selfname}-console.log" ] && [ "${engine}" == "source" ]; then + if grep -q "Your server needs to be restarted in order to receive the latest update." "${consolelogdir}/${selfname}-console.log"; then + fn_print_dots "Checking update: " + fn_print_checking_eol + fn_script_log_info "Checking update: CHECKING" + fn_print_ok "Checking update: " + fn_print_ok_eol_nl + fn_script_log_info "Checking update: Monitor is restarting ${selfname} to apply update" + alert="restart" + alert.sh + command_restart.sh + core_exit.sh + fi + fi } fn_monitor_check_session() { fn_print_dots "Checking session: " fn_print_checking_eol fn_script_log_info "Checking session: CHECKING" - # uses status var from check_status.sh - if [ "${status}" != "0" ]; then + # Tmux session width and height needs to be reviewed as may no longer be required. + sessionwidth="80" + sessionheight="23" + # Check for PIDS with identical tmux sessions running. + if [ "$(pgrep -fc "tmux -L ${socketname} new-session -d -x ${sessionwidth} -y ${sessionheight} -s ${sessionname}")" -ge "2" ]; then + fn_print_error "Checking session: " + fn_print_error_eol_nl + fn_script_log_error "Checking session: ERROR" + fn_script_log_error "Checking session: There are PIDS with identical tmux sessions running" + fn_script_log_error "Checking session: Killing all tmux sessions with the socketname name ${socketname} and session name ${sessionname}" + pkill -f "tmux -L ${socketname} new-session -d -x ${sessionwidth} -y ${sessionheight} -s ${sessionname}" + command_restart.sh + core_exit.sh + # Check for tmux pids with the same tmux session and socket names. This will reduce issues with migration to release v23.5.0. #4296 + elif [ "$(pgrep -fc -u "${USER}" "tmux -L ${sessionname} new-session -d -x ${sessionwidth} -y ${sessionheight} -s ${sessionname}")" != "0" ]; then + fn_print_error "Checking session: " + fn_print_error_eol_nl + fn_script_log_error "Checking session: ERROR" + fn_script_log_error "Checking session: PIDS with the same tmux session and socket names are running" + fn_script_log_error "Checking session: Killing session with the socketname name ${sessionname} and session name ${sessionname}" + pkill -f "tmux -L ${sessionname} new-session -d -x ${sessionwidth} -y ${sessionheight} -s ${sessionname}" + command_restart.sh + core_exit.sh + elif [ "${status}" != "0" ]; then fn_print_ok "Checking session: " fn_print_ok_eol_nl fn_script_log_pass "Checking session: OK" @@ -107,8 +201,8 @@ fn_monitor_check_session() { fi } +# Monitor will check queryport is set before continuing. fn_monitor_check_queryport() { - # Monitor will check queryport is set before continuing. if [ -z "${queryport}" ] || [ "${queryport}" == "0" ]; then fn_print_dots "Checking port: " fn_print_checking_eol @@ -133,7 +227,7 @@ fn_query_gsquery() { } fn_query_tcp() { - bash -c 'exec 3<> /dev/tcp/'${queryip}'/'${queryport}'' > /dev/null 2>&1 + bash -c "exec 3<> /dev/tcp/'${queryip}'/'${queryport}'" > /dev/null 2>&1 querystatus="$?" } @@ -147,12 +241,12 @@ fn_monitor_query() { 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 + if [ "$(head -n 1 "${lockdir}/${selfname}-started.lock")" -gt "$(date "+%s" -d "${querydelay} mins ago")" ]; then fn_print_ok "Querying port: ${querymethod}: ${ip}:${queryport} : ${totalseconds}/${queryattempt}: " fn_print_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 "Server started: $(date -d "@$(head -n 1 "${lockdir}/${selfname}-started.lock")")" fn_script_log_info "Current time: $(date)" monitorpass=1 core_exit.sh @@ -271,8 +365,15 @@ core_logs.sh info_game.sh # query pre-checks -fn_monitor_check_lockfile +fn_monitor_check_update_source +fn_monitor_check_update +fn_monitor_check_backup +fn_monitor_check_debug +fn_monitor_check_monitoring +fn_monitor_check_starting +fn_monitor_check_stopping fn_monitor_check_session + # Monitor will not continue if session only check. if [ "${querymode}" != "1" ]; then fn_monitor_check_queryport diff --git a/lgsm/modules/command_restart.sh b/lgsm/modules/command_restart.sh index b7bb1f3e3c..ed60a55550 100644 --- a/lgsm/modules/command_restart.sh +++ b/lgsm/modules/command_restart.sh @@ -5,7 +5,7 @@ # Website: https://linuxgsm.com # Description: Restarts the server. -commandname="MODS-INSTALL" +commandname="RESTART" commandaction="Restarting" moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_firstcommand_set diff --git a/lgsm/modules/command_send.sh b/lgsm/modules/command_send.sh index 9f7c20dbbd..e3dafd6930 100644 --- a/lgsm/modules/command_send.sh +++ b/lgsm/modules/command_send.sh @@ -26,7 +26,7 @@ if [ "${status}" != "0" ]; then fi echo "" fn_print_dots "Sending command to console: \"${commandtosend}\"" - tmux -L "${sessionname}" send-keys -t "${servicename}" "${commandtosend}" ENTER + tmux -L "${socketname}" send-keys -t "${servicename}" "${commandtosend}" ENTER fn_print_ok_nl "Sending command to console: \"${commandtosend}\"" fn_script_log_pass "Command \"${commandtosend}\" sent to console" else diff --git a/lgsm/modules/command_skeleton.sh b/lgsm/modules/command_skeleton.sh index 01a7f4e7ee..9e7c19a6aa 100644 --- a/lgsm/modules/command_skeleton.sh +++ b/lgsm/modules/command_skeleton.sh @@ -5,7 +5,10 @@ # Website: https://linuxgsm.com # Description: Creates an copy of a game servers directorys. +commandname="SKELETON" +commandaction="Skeleton" moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +fn_firstcommand_set fn_print_dots "Creating skeleton directory" check.sh diff --git a/lgsm/modules/command_start.sh b/lgsm/modules/command_start.sh index b9f8fa51c6..1302d0d99e 100644 --- a/lgsm/modules/command_start.sh +++ b/lgsm/modules/command_start.sh @@ -11,39 +11,14 @@ moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" addtimestamp="gawk '{ print strftime(\\\"[$logtimestampformat]\\\"), \\\$0 }'" fn_firstcommand_set -fn_start_teamspeak3() { - if [ ! -f "${servercfgfullpath}" ]; then - fn_print_warn_nl "${servercfgfullpath} is missing" - fn_script_log_warn "${servercfgfullpath} is missing" - echo " * Creating blank ${servercfg}" - fn_script_log_info "Creating blank ${servercfg}" - fn_sleep_time - echo " * ${servercfg} can remain blank by default." - fn_script_log_info "${servercfgfullpath} can remain blank by default." - fn_sleep_time - echo " * ${servercfg} is located in ${servercfgfullpath}." - fn_script_log_info "${servercfg} is located in ${servercfgfullpath}." - sleep 5 - touch "${servercfgfullpath}" - fi - # Accept license. - if [ ! -f "${executabledir}/.ts3server_license_accepted" ]; then - install_eula.sh - fi - fn_start_tmux -} - # This will allow the Jedi Knight 2 version to be printed in console on start. # Used to allow update to detect JK2MV server version. fn_start_jk2() { fn_start_tmux - tmux -L "${sessionname}" end -t "${sessionname}" version ENTER > /dev/null 2>&1 + tmux -L "${socketname}" end -t "${sessionname}" version ENTER > /dev/null 2>&1 } fn_start_tmux() { - if [ "${parmsbypass}" ]; then - startparameters="" - fi # check for tmux size variables. if [[ "${servercfgtmuxwidth}" =~ ^[0-9]+$ ]]; then sessionwidth="${servercfgtmuxwidth}" @@ -68,35 +43,41 @@ fn_start_tmux() { mv "${consolelog}" "${consolelogdate}" fi - # Create lockfile - date '+%s' > "${lockdir}/${selfname}.lock" - echo "${version}" >> "${lockdir}/${selfname}.lock" - echo "${port}" >> "${lockdir}/${selfname}.lock" + # Create a starting lockfile that only exists while the start command is running. + date '+%s' > "${lockdir:?}/${selfname}-starting.lock" + fn_reload_startparameters + # Create uid to ensure unique tmux socket name. + if [ ! -f "${datadir}/${selfname}.uid" ]; then + # stop running server (if running) to prevent lingering tmux sessions. + exitbypass=1 + command_stop.sh + uid=$(date '+%s' | sha1sum | head -c 8) + echo "${uid}" > "${datadir}/${selfname}.uid" + socketname="${sessionname}-$(cat "${datadir}/${selfname}.uid")" + fi + if [ "${shortname}" == "av" ]; then cd "${systemdir}" || exit else cd "${executabledir}" || exit fi - tmux -L "${sessionname}" new-session -d -x "${sessionwidth}" -y "${sessionheight}" -s "${sessionname}" "${preexecutable} ${executable} ${startparameters}" 2> "${lgsmlogdir}/.${selfname}-tmux-error.tmp" + tmux -L "${socketname}" new-session -d -x "${sessionwidth}" -y "${sessionheight}" -s "${sessionname}" "${preexecutable} ${executable} ${startparameters}" 2> "${lgsmlogdir}/.${selfname}-tmux-error.tmp" # Create logfile. touch "${consolelog}" - # Create last start lock file - date +%s > "${lockdir}/${selfname}-laststart.lock" - # tmux compiled from source will return "master", therefore ignore it. 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 [ "$logtimestamp" == "on" ]; then - tmux -L "${sessionname}" pipe-pane -o -t "${sessionname}" "exec bash -c \"cat | $addtimestamp\" >> '${consolelog}'" + if [ "${logtimestamp}" == "on" ]; then + tmux -L "${socketname}" pipe-pane -o -t "${sessionname}" "exec bash -c \"cat | $addtimestamp\" >> '${consolelog}'" else - tmux -L "${sessionname}" pipe-pane -o -t "${sessionname}" "exec cat >> '${consolelog}'" + tmux -L "${socketname}" pipe-pane -o -t "${sessionname}" "exec cat >> '${consolelog}'" fi fi @@ -114,10 +95,10 @@ fn_start_tmux() { Currently installed: $(tmux -V)" > "${consolelog}" # Console logging enable or not set. elif [ "${consolelogging}" == "on" ] || [ -z "${consolelogging}" ]; then - if [ "$logtimestamp" == "on" ]; then - tmux -L "${sessionname}" pipe-pane -o -t "${sessionname}" "exec bash -c \"cat | $addtimestamp\" >> '${consolelog}'" + if [ "${logtimestamp}" == "on" ]; then + tmux -L "${socketname}" pipe-pane -o -t "${sessionname}" "exec bash -c \"cat | $addtimestamp\" >> '${consolelog}'" else - tmux -L "${sessionname}" pipe-pane -o -t "${sessionname}" "exec cat >> '${consolelog}'" + tmux -L "${socketname}" pipe-pane -o -t "${sessionname}" "exec cat >> '${consolelog}'" fi fi else @@ -127,7 +108,7 @@ fn_start_tmux() { # Console logging disabled. if [ "${consolelogging}" == "off" ]; then - echo -e "Console logging disabled by user" >> "${consolelog}" + echo -e "Console logging disabled in settings" >> "${consolelog}" fn_script_log_info "Console logging disabled by user" fi fn_sleep_time @@ -176,8 +157,20 @@ fn_start_tmux() { fi fi fi + # Remove starting lockfile when command ends. + rm -f "${lockdir:?}/${selfname}-starting.lock" core_exit.sh else + # Create start lockfile that exists only when the server is running. + date '+%s' > "${lockdir:?}/${selfname}-started.lock" + echo "${version}" >> "${lockdir}/${selfname}-started.lock" + echo "${port}" >> "${lockdir}/${selfname}-started.lock" + fn_print_ok "${servername}" + fn_script_log_pass "Started ${servername}" + + # Create last started Lockfile. + date +%s > "${lockdir}/${selfname}-last-started.lock" + fn_print_ok "${servername}" fn_script_log_pass "Started ${servername}" fi @@ -187,23 +180,28 @@ fn_start_tmux() { check.sh -# Is the server already started. -# $status comes from check_status.sh, which is run by check.sh for this command +# If user ran the start command monitor will become enabled. +if [ "${firstcommandname}" == "START" ]||[ "${firstcommandname}" == "RESTART" ]; then + date '+%s' > "${lockdir:?}/${selfname}-monitoring.lock" +fi + +# If the server already started dont start again. if [ "${status}" != "0" ]; then fn_print_dots "${servername}" fn_print_info_nl "${servername} is already running" fn_script_log_error "${servername} is already running" if [ -z "${exitbypass}" ]; then + # Remove starting lockfile when command ends. + rm -f "${lockdir:?}/${selfname}-starting.lock" core_exit.sh fi fi -if [ -z "${fixbypass}" ]; then - fix.sh -fi + +fix.sh info_game.sh core_logs.sh -# Will check for updates is updateonstart is yes. +# Will check for updates if updateonstart is yes. if [ "${updateonstart}" == "yes" ] || [ "${updateonstart}" == "1" ] || [ "${updateonstart}" == "on" ]; then exitbypass=1 unset updateonstart @@ -212,13 +210,12 @@ if [ "${updateonstart}" == "yes" ] || [ "${updateonstart}" == "1" ] || [ "${upda fi fn_print_dots "${servername}" - -if [ "${shortname}" == "ts3" ]; then - fn_start_teamspeak3 -elif [ "${shortname}" == "jk2" ]; then +if [ "${shortname}" == "jk2" ]; then fn_start_jk2 else fn_start_tmux fi +# Remove starting lockfile when command ends. +rm -f "${lockdir:?}/${selfname}-starting.lock" core_exit.sh diff --git a/lgsm/modules/command_stop.sh b/lgsm/modules/command_stop.sh index a0cc180763..dc716216f9 100644 --- a/lgsm/modules/command_stop.sh +++ b/lgsm/modules/command_stop.sh @@ -15,7 +15,7 @@ fn_stop_graceful_ctrlc() { fn_print_dots "Graceful: CTRL+c" fn_script_log_info "Graceful: CTRL+c" # Sends quit. - tmux -L "${sessionname}" send-keys -t "${sessionname}" C-c > /dev/null 2>&1 + tmux -L "${socketname}" send-keys -t "${sessionname}" C-c > /dev/null 2>&1 # Waits up to 30 seconds giving the server time to shutdown gracefuly. for seconds in {1..30}; do check_status.sh @@ -43,7 +43,7 @@ fn_stop_graceful_cmd() { fn_print_dots "Graceful: sending \"${1}\"" fn_script_log_info "Graceful: sending \"${1}\"" # Sends specific stop command. - tmux -L "${sessionname}" send -t "${sessionname}" ENTER "${1}" ENTER > /dev/null 2>&1 + tmux -L "${socketname}" send -t "${sessionname}" ENTER "${1}" ENTER > /dev/null 2>&1 # Waits up to ${seconds} seconds giving the server time to shutdown gracefully. for ((seconds = 1; seconds <= ${2}; seconds++)); do check_status.sh @@ -71,7 +71,7 @@ fn_stop_graceful_goldsrc() { fn_print_dots "Graceful: sending \"quit\"" fn_script_log_info "Graceful: sending \"quit\"" # sends quit - tmux -L "${sessionname}" send -t "${sessionname}" quit ENTER > /dev/null 2>&1 + tmux -L "${socketname}" send -t "${sessionname}" quit ENTER > /dev/null 2>&1 # Waits 3 seconds as goldsrc servers restart with the quit command. for seconds in {1..3}; do sleep 1 @@ -184,10 +184,10 @@ fn_stop_graceful_avorion() { fn_print_dots "Graceful: /save /stop" fn_script_log_info "Graceful: /save /stop" # Sends /save. - tmux -L "${sessionname}" send-keys -t "${sessionname}" /save ENTER > /dev/null 2>&1 + tmux -L "${socketname}" send-keys -t "${sessionname}" /save ENTER > /dev/null 2>&1 sleep 5 # Sends /quit. - tmux -L "${sessionname}" send-keys -t "${sessionname}" /stop ENTER > /dev/null 2>&1 + tmux -L "${socketname}" send-keys -t "${sessionname}" /stop ENTER > /dev/null 2>&1 # Waits up to 30 seconds giving the server time to shutdown gracefuly. for seconds in {1..30}; do check_status.sh @@ -240,7 +240,7 @@ fn_stop_tmux() { fn_print_dots "${servername}" fn_script_log_info "tmux kill-session: ${sessionname}: ${servername}" # Kill tmux session. - tmux -L "${sessionname}" kill-session -t "${sessionname}" > /dev/null 2>&1 + tmux -L "${socketname}" kill-session -t "${sessionname}" > /dev/null 2>&1 sleep 0.5 check_status.sh if [ "${status}" == "0" ]; then @@ -269,15 +269,27 @@ fn_stop_pre_check() { } check.sh + +# Create a stopping lockfile that only exists while the stop command is running. +date '+%s' > "${lockdir:?}/${selfname}-stopping.lock" + fn_print_dots "${servername}" info_game.sh fn_stop_pre_check -# Remove lockfile. -if [ -f "${lockdir}/${selfname}.lock" ]; then - rm -f "${lockdir:?}/${selfname}.lock" + +# Remove started lockfile. +rm -f "${lockdir:?}/${selfname}-started.lock" + +# If user ran the stop command monitor will become disabled. +if [ "${firstcommandname}" == "STOP" ];then + rm -f "${lockdir:?}/${selfname}-monitoring.lock" fi + +# Remove stopping lockfile. +rm -f "${lockdir:?}/${selfname}-stopping.lock" + if [ -z "${exitbypass}" ]; then core_exit.sh fi diff --git a/lgsm/modules/command_ts3_server_pass.sh b/lgsm/modules/command_ts3_server_pass.sh index 4814ab1421..0223a877c7 100644 --- a/lgsm/modules/command_ts3_server_pass.sh +++ b/lgsm/modules/command_ts3_server_pass.sh @@ -28,7 +28,7 @@ fn_serveradmin_password_prompt() { fn_serveradmin_password_set() { # Start server in "new password mode". ts3serverpass="1" - exitbypass="1" + exitbypass=1 command_start.sh fn_firstcommand_reset fn_print_ok_nl "New password applied" @@ -40,7 +40,7 @@ check.sh fn_serveradmin_password_prompt if [ "${status}" != "0" ]; then # Stop any running server. - exitbypass="1" + exitbypass=1 command_stop.sh fn_firstcommand_reset fn_serveradmin_password_set diff --git a/lgsm/modules/command_update.sh b/lgsm/modules/command_update.sh index 5993609c0e..62221d5e6f 100644 --- a/lgsm/modules/command_update.sh +++ b/lgsm/modules/command_update.sh @@ -37,4 +37,7 @@ else update_steamcmd.sh fi +# remove update lockfile. +rm -f "${lockdir:?}/update.lock" + core_exit.sh diff --git a/lgsm/modules/command_validate.sh b/lgsm/modules/command_validate.sh index 23ee92a268..f4a6250f33 100644 --- a/lgsm/modules/command_validate.sh +++ b/lgsm/modules/command_validate.sh @@ -23,7 +23,7 @@ fn_validate() { fi done fn_print_warn_nl "Validate might overwrite some customised files" - + date '+%s' > "${lockdir:?}/update.lock" fn_dl_steamcmd } @@ -46,4 +46,7 @@ else fn_validate fi +# remove update lockfile +rm -f "${lockdir:?}/update.lock" + core_exit.sh diff --git a/lgsm/modules/core_exit.sh b/lgsm/modules/core_exit.sh index d43f0555aa..a66744b19f 100644 --- a/lgsm/modules/core_exit.sh +++ b/lgsm/modules/core_exit.sh @@ -12,7 +12,7 @@ fn_exit_dev_debug() { echo -e "" echo -e "${moduleselfname} exiting with code: ${exitcode}" if [ -f "${rootdir}/dev-debug.log" ]; then - grep "modulefile=" "${rootdir}/dev-debug.log" | sed 's/modulefile=//g' > "${rootdir}/dev-debug-module-order.log" + grep -a "modulefile=" "${rootdir}/dev-debug.log" | sed 's/modulefile=//g' > "${rootdir}/dev-debug-module-order.log" fi fi } diff --git a/lgsm/modules/core_steamcmd.sh b/lgsm/modules/core_steamcmd.sh index 02074620df..54de61b7c5 100644 --- a/lgsm/modules/core_steamcmd.sh +++ b/lgsm/modules/core_steamcmd.sh @@ -204,7 +204,10 @@ fn_update_steamcmd_remotebuild() { fn_update_steamcmd_compare() { fn_print_dots "Checking for update: ${remotelocation}" + # Update has been found or force update. if [ "${localbuild}" != "${remotebuildversion}" ] || [ "${forceupdate}" == "1" ]; then + # Create update lockfile. + date '+%s' > "${lockdir:?}/update.lock" fn_print_ok_nl "Checking for update: ${remotelocation}" echo -en "\n" echo -e "Update available" @@ -248,7 +251,7 @@ fn_update_steamcmd_compare() { fn_firstcommand_reset fi unset exitbypass - date +%s > "${lockdir}/lastupdate.lock" + date +%s > "${lockdir:?}/last-updated.lock" alert="update" elif [ "${commandname}" == "CHECK-UPDATE" ]; then alert="check-update" diff --git a/lgsm/modules/fix_csgo.sh b/lgsm/modules/fix_csgo.sh index eb8cc95606..01b02c4e02 100644 --- a/lgsm/modules/fix_csgo.sh +++ b/lgsm/modules/fix_csgo.sh @@ -37,6 +37,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" + mv "${libgccc_so}" "${libgccc_so}.bak" fn_fix_msg_end fi diff --git a/lgsm/modules/fix_ts3.sh b/lgsm/modules/fix_ts3.sh index 9eb728f484..3d0a6760fd 100644 --- a/lgsm/modules/fix_ts3.sh +++ b/lgsm/modules/fix_ts3.sh @@ -7,6 +7,19 @@ moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +# Creates a blank ts3server.ini if it does not exist. +if [ ! -f "${servercfgfullpath}" ]; then + fixname="create blank ${servercfg}" + fn_fix_msg_start + touch "${servercfgfullpath}" + fn_fix_msg_end +fi + +# Accept license. +if [ ! -f "${executabledir}/.ts3server_license_accepted" ]; then + install_eula.sh +fi + # Fixes: makes libmariadb2 available #1924. if [ ! -f "${serverfiles}/libmariadb.so.2" ]; then fixname="libmariadb.so.2" diff --git a/lgsm/modules/info_distro.sh b/lgsm/modules/info_distro.sh index ee84d39f2e..b375f8c020 100644 --- a/lgsm/modules/info_distro.sh +++ b/lgsm/modules/info_distro.sh @@ -10,7 +10,7 @@ moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" ### Game Server pid if [ "${status}" == "1" ]; then - gameserverpid="$(tmux -L "${sessionname}" list-sessions -F "#{session_name} #{pane_pid}" | grep "^${sessionname} " | awk '{print $NF}')" + gameserverpid="$(tmux -L "${socketname}" list-sessions -F "#{session_name} #{pane_pid}" | grep "^${sessionname} " | awk '{print $NF}')" if [ "${engine}" == "source" ]; then srcdslinuxpid="$(ps -ef | grep -v grep | grep "${gameserverpid}" | grep srcds_linux | awk '{print $2}')" elif [ "${engine}" == "goldsrc" ]; then diff --git a/lgsm/modules/update_factorio.sh b/lgsm/modules/update_factorio.sh index 2af9916aa4..f7fb06c7df 100644 --- a/lgsm/modules/update_factorio.sh +++ b/lgsm/modules/update_factorio.sh @@ -64,7 +64,10 @@ fn_update_remotebuild() { fn_update_compare() { fn_print_dots "Checking for update: ${remotelocation}" + # Update has been found or force update. if [ "${localbuild}" != "${remotebuildversion}" ] || [ "${forceupdate}" == "1" ]; then + # Create update lockfile. + date '+%s' > "${lockdir:?}/update.lock" fn_print_ok_nl "Checking for update: ${remotelocation}" echo -en "\n" echo -e "Update available" @@ -117,7 +120,7 @@ fn_update_compare() { fn_firstcommand_reset fi unset exitbypass - date +%s > "${lockdir}/lastupdate.lock" + date +%s > "${lockdir}/last-updated.lock" alert="update" elif [ "${commandname}" == "CHECK-UPDATE" ]; then alert="check-update" diff --git a/lgsm/modules/update_jediknight2.sh b/lgsm/modules/update_jediknight2.sh index d455a27223..e67b0c02b8 100644 --- a/lgsm/modules/update_jediknight2.sh +++ b/lgsm/modules/update_jediknight2.sh @@ -61,7 +61,10 @@ fn_update_remotebuild() { fn_update_compare() { fn_print_dots "Checking for update: ${remotelocation}" + # Update has been found or force update. if [ "${localbuild}" != "${remotebuildversion}" ] || [ "${forceupdate}" == "1" ]; then + # Create update lockfile. + date '+%s' > "${lockdir:?}/update.lock" fn_print_ok_nl "Checking for update: ${remotelocation}" echo -en "\n" echo -e "Update available" @@ -114,7 +117,7 @@ fn_update_compare() { fn_firstcommand_reset fi unset exitbypass - date +%s > "${lockdir}/lastupdate.lock" + date +%s > "${lockdir}/last-updated.lock" alert="update" elif [ "${commandname}" == "CHECK-UPDATE" ]; then alert="check-update" diff --git a/lgsm/modules/update_minecraft.sh b/lgsm/modules/update_minecraft.sh index e764e846ec..cfdf7e057e 100644 --- a/lgsm/modules/update_minecraft.sh +++ b/lgsm/modules/update_minecraft.sh @@ -75,7 +75,10 @@ fn_update_remotebuild() { fn_update_compare() { fn_print_dots "Checking for update: ${remotelocation}" + # Update has been found or force update. if [ "${localbuild}" != "${remotebuildversion}" ] || [ "${forceupdate}" == "1" ]; then + # Create update lockfile. + date '+%s' > "${lockdir:?}/update.lock" fn_print_ok_nl "Checking for update: ${remotelocation}" echo -en "\n" echo -e "Update available" @@ -128,7 +131,7 @@ fn_update_compare() { fn_firstcommand_reset fi unset exitbypass - date +%s > "${lockdir}/lastupdate.lock" + date +%s > "${lockdir}/last-updated.lock" alert="update" elif [ "${commandname}" == "CHECK-UPDATE" ]; then alert="check-update" diff --git a/lgsm/modules/update_minecraft_bedrock.sh b/lgsm/modules/update_minecraft_bedrock.sh index 3c3885a9d9..92bffca31a 100644 --- a/lgsm/modules/update_minecraft_bedrock.sh +++ b/lgsm/modules/update_minecraft_bedrock.sh @@ -80,7 +80,10 @@ fn_update_remotebuild() { fn_update_compare() { fn_print_dots "Checking for update: ${remotelocation}" + # Update has been found or force update. if [ "${localbuild}" != "${remotebuildversion}" ] || [ "${forceupdate}" == "1" ]; then + # Create update lockfile. + date '+%s' > "${lockdir:?}/update.lock" fn_print_ok_nl "Checking for update: ${remotelocation}" echo -en "\n" echo -e "Update available" @@ -133,7 +136,7 @@ fn_update_compare() { fn_firstcommand_reset fi unset exitbypass - date +%s > "${lockdir}/lastupdate.lock" + date +%s > "${lockdir}/last-updated.lock" alert="update" elif [ "${commandname}" == "CHECK-UPDATE" ]; then alert="check-update" diff --git a/lgsm/modules/update_mta.sh b/lgsm/modules/update_mta.sh index 16b8278c70..eab77c7488 100644 --- a/lgsm/modules/update_mta.sh +++ b/lgsm/modules/update_mta.sh @@ -59,7 +59,10 @@ fn_update_remotebuild() { fn_update_compare() { fn_print_dots "Checking for update: ${remotelocation}" + # Update has been found or force update. if [ "${localbuild}" != "${remotebuildversion}" ] || [ "${forceupdate}" == "1" ]; then + # Create update lockfile. + date '+%s' > "${lockdir:?}/update.lock" if [ "${forceupdate}" == "1" ]; then # forceupdate bypasses checks, useful for small build changes mtaupdatestatus="forced" @@ -118,7 +121,7 @@ fn_update_compare() { fn_firstcommand_reset fi unset exitbypass - date +%s > "${lockdir}/lastupdate.lock" + date +%s > "${lockdir}/last-updated.lock" alert="update" elif [ "${commandname}" == "CHECK-UPDATE" ]; then alert="check-update" diff --git a/lgsm/modules/update_papermc.sh b/lgsm/modules/update_papermc.sh index b70a2d69db..2438c2d863 100644 --- a/lgsm/modules/update_papermc.sh +++ b/lgsm/modules/update_papermc.sh @@ -85,7 +85,10 @@ fn_update_remotebuild() { fn_update_compare() { fn_print_dots "Checking for update: ${remotelocation}" + # Update has been found or force update. if [ "${localbuild}" != "${remotebuildversion}" ] || [ "${forceupdate}" == "1" ]; then + # Create update lockfile. + date '+%s' > "${lockdir:?}/update.lock" fn_print_ok_nl "Checking for update: ${remotelocation}" echo -en "\n" echo -e "Update available" @@ -138,7 +141,7 @@ fn_update_compare() { fn_firstcommand_reset fi unset exitbypass - date +%s > "${lockdir}/lastupdate.lock" + date +%s > "${lockdir}/last-updated.lock" alert="update" elif [ "${commandname}" == "CHECK-UPDATE" ]; then alert="check-update" diff --git a/lgsm/modules/update_steamcmd.sh b/lgsm/modules/update_steamcmd.sh index 401da43a8e..20a85ab935 100644 --- a/lgsm/modules/update_steamcmd.sh +++ b/lgsm/modules/update_steamcmd.sh @@ -23,14 +23,15 @@ if [ "${forceupdate}" == "1" ]; then exitbypass=1 command_stop.sh fn_firstcommand_reset + date '+%s' > "${lockdir:?}/update.lock" fn_dl_steamcmd - date +%s > "${lockdir}/lastupdate.lock" + date +%s > "${lockdir}/last-updated.lock" exitbypass=1 command_start.sh fn_firstcommand_reset else fn_dl_steamcmd - date +%s > "${lockdir}/lastupdate.lock" + date +%s > "${lockdir}/last-updated.lock" fi else fn_update_steamcmd_localbuild diff --git a/lgsm/modules/update_ts3.sh b/lgsm/modules/update_ts3.sh index 30dc9e5135..b031d2b348 100644 --- a/lgsm/modules/update_ts3.sh +++ b/lgsm/modules/update_ts3.sh @@ -68,7 +68,10 @@ fn_update_remotebuild() { fn_update_compare() { fn_print_dots "Checking for update: ${remotelocation}" + # Update has been found or force update. if [ "${localbuild}" != "${remotebuildversion}" ] || [ "${forceupdate}" == "1" ]; then + # Create update lockfile. + date '+%s' > "${lockdir:?}/update.lock" fn_print_ok_nl "Checking for update: ${remotelocation}" echo -en "\n" echo -e "Update available" @@ -121,7 +124,7 @@ fn_update_compare() { fn_firstcommand_reset fi unset exitbypass - date +%s > "${lockdir}/lastupdate.lock" + date +%s > "${lockdir}/last-updated.lock" alert="update" elif [ "${commandname}" == "CHECK-UPDATE" ]; then alert="check-update" diff --git a/lgsm/modules/update_ut99.sh b/lgsm/modules/update_ut99.sh index 909286196a..1ff84a0600 100644 --- a/lgsm/modules/update_ut99.sh +++ b/lgsm/modules/update_ut99.sh @@ -62,7 +62,10 @@ fn_update_remotebuild() { fn_update_compare() { fn_print_dots "Checking for update: ${remotelocation}" + # Update has been found or force update. if [ "${localbuild}" != "${remotebuildversion}" ] || [ "${forceupdate}" == "1" ]; then + # Create update lockfile. + date '+%s' > "${lockdir:?}/update.lock" fn_print_ok_nl "Checking for update: ${remotelocation}" echo -en "\n" echo -e "Update available" @@ -115,7 +118,7 @@ fn_update_compare() { fn_firstcommand_reset fi unset exitbypass - date +%s > "${lockdir}/lastupdate.lock" + date +%s > "${lockdir}/last-updated.lock" alert="update" elif [ "${commandname}" == "CHECK-UPDATE" ]; then alert="check-update" diff --git a/lgsm/modules/update_vintagestory.sh b/lgsm/modules/update_vintagestory.sh index d186d19aa6..21e2d0e63a 100644 --- a/lgsm/modules/update_vintagestory.sh +++ b/lgsm/modules/update_vintagestory.sh @@ -69,7 +69,10 @@ fn_update_remotebuild() { fn_update_compare() { fn_print_dots "Checking for update: ${remotelocation}" + # Update has been found or force update. if [ "${localbuild}" != "${remotebuildversion}" ] || [ "${forceupdate}" == "1" ]; then + # Create update lockfile. + date '+%s' > "${lockdir:?}/update.lock" fn_print_ok_nl "Checking for update: ${remotelocation}" echo -en "\n" echo -e "Update available" @@ -122,7 +125,7 @@ fn_update_compare() { fn_firstcommand_reset fi unset exitbypass - date +%s > "${lockdir}/lastupdate.lock" + date +%s > "${lockdir}/last-updated.lock" alert="update" elif [ "${commandname}" == "CHECK-UPDATE" ]; then alert="check-update" diff --git a/linuxgsm.sh b/linuxgsm.sh index 52d12faca2..331a618221 100755 --- a/linuxgsm.sh +++ b/linuxgsm.sh @@ -26,7 +26,6 @@ gameservername="core" commandname="CORE" rootdir=$(dirname "$(readlink -f "${BASH_SOURCE[0]}")") selfname=$(basename "$(readlink -f "${BASH_SOURCE[0]}")") -sessionname=$(echo "${selfname}" | cut -f1 -d".") lgsmdir="${rootdir}/lgsm" [ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" lgsmlogdir="${logdir}/lgsm" @@ -36,6 +35,8 @@ modulesdir="${lgsmdir}/modules" tmpdir="${lgsmdir}/tmp" datadir="${lgsmdir}/data" lockdir="${lgsmdir}/lock" +sessionname="${selfname}" +[ -f "${datadir}/${selfname}.uid" ] && socketname="${sessionname}-$(cat "${datadir}/${selfname}.uid")" || socketname="${sessionname}" serverlist="${datadir}/serverlist.csv" serverlistmenu="${datadir}/serverlistmenu.csv" [ -n "${LGSM_CONFIG}" ] && configdir="${LGSM_CONFIG}" || configdir="${lgsmdir}/config-lgsm" From 2d6092186c51aef573d9a608e65d2da0a406ae7f Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Mon, 28 Aug 2023 22:21:18 +0100 Subject: [PATCH 137/181] fix(steamcmd): resolve steamcmd goldsource download issues (#4297) * add appmanifest files to data * refactor: improve appmanifest check and force update logic The code changes refactor the `fn_appmanifest_check` function in the `core_steamcmd.sh` file. The improvements include: - Checking if `BytesDownloaded` and `BytesToDownload` match, and forcing an update if they don't. - Checking if `BytesStaged` and `BytesToStage` match, and forcing an update if they don't. - For GoldSrc engine, checking if `SharedDepots` exists in the appmanifest file, and forcing an update if it doesn't. - Fetching missing appmanifest files from GitHub for specific game shortnames. These changes enhance the reliability of the appmanifest check process and ensure that updates are forced when necessary. * refactor: improve removal of appinfo.vdf file The code has been refactored to improve the removal of the appinfo.vdf file. The find command now redirects error output to /dev/null for a cleaner execution. * fn_check_steamcmd_appmanifest is now a full check * feat: add support for fetching appmanifest files This commit adds support for fetching appmanifest files from the GitHub repository. The code now fetches the appropriate appmanifest files based on the game's shortname and updates them in the serverfiles/steamapps directory. This change ensures that the correct appmanifest files are used, fixing an issue related to updating certain games. * more appmanifest files * feat: add appmanifest_10.acf for Counter-Strike Added the appmanifest_10.acf file for Counter-Strike to resolve an issue with missing SharedDepots. This commit fetches the necessary files from GitHub and forces an update to correct the issue. * fix: fix missing SharedDepots in appmanifest_90.acf The code changes fix a bug where the SharedDepots entry was missing from the appmanifest_90.acf file. The commit updates the error messages and logs to reflect the correct filename. Additionally, it forces an update to resolve the issue. --- lgsm/modules/core_steamcmd.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lgsm/modules/core_steamcmd.sh b/lgsm/modules/core_steamcmd.sh index 54de61b7c5..6d96a9e6c6 100644 --- a/lgsm/modules/core_steamcmd.sh +++ b/lgsm/modules/core_steamcmd.sh @@ -355,8 +355,8 @@ fn_check_steamcmd_appmanifest() { if [ "${engine}" == "goldsrc" ]; then shareddepotsexists=$(grep -c SharedDepots "${serverfiles}/steamapps/appmanifest_90.acf") if [ ! -f "${serverfiles}/steamapps/appmanifest_90.acf" ] || [ "${shareddepotsexists}" == "0" ]; then - fn_print_error_nl "SharedDepots missing from appmanifest_${appid}.acf" - fn_script_log_error "SharedDepots missing from appmanifest_${appid}.acf" + fn_print_error_nl "SharedDepots missing from appmanifest_90.acf" + fn_script_log_error "SharedDepots missing from appmanifest_90.acf" fn_print_info_nl "Forcing update to correct issue" fn_script_log_info "Forcing update to correct issue" if [ "${shortname}" == "ahl" ]; then From 6b9393f949af1f9d4bb8e69b7b175e8251fe799c Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Wed, 30 Aug 2023 22:58:02 +0100 Subject: [PATCH 138/181] fix: improve sed command in fn_info_game_valve_keyvalues (#4300) The sed command in the fn_info_game_valve_keyvalues function has been modified to improve its functionality. The change ensures that only the value between double quotes is captured, even if there are additional spaces before or after the value. This enhances the accuracy of extracting values from server configuration files. --- lgsm/modules/info_game.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lgsm/modules/info_game.sh b/lgsm/modules/info_game.sh index 2bfdc10e71..5eea7dfba5 100644 --- a/lgsm/modules/info_game.sh +++ b/lgsm/modules/info_game.sh @@ -157,7 +157,7 @@ fn_info_game_valve_keyvalues() { else servercfgparse="${servercfgfullpath}" fi - eval "${1}=\"$(sed -n '/^\<'"${2}"'\>/ { s/.* *"\?\([^"]*\)"\?/\1/p;q }' "${servercfgparse}" | tr -d '\r')\"" + eval "${1}=\"$(sed -n '/^\<'"${2}"'\>/ { s/.* *"\([^"]*\)".*/\1/p;q }' "${servercfgparse}" | tr -d '\r')\"" configtype="valve_keyvalues" } From 7b374249eae27f0de7a2b564e0663e1d062c4f28 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Fri, 1 Sep 2023 22:08:26 +0100 Subject: [PATCH 139/181] feat: change extip to public ip (#4301) also change ark parms for epic to use publicip --- .../config-lgsm/arkserver/_default.cfg | 2 +- .../config-lgsm/btlserver/_default.cfg | 2 +- lgsm/modules/command_debug.sh | 6 ++--- lgsm/modules/command_dev_details.sh | 2 +- lgsm/modules/info_game.sh | 22 +++++++++---------- lgsm/modules/info_messages.sh | 10 ++++----- 6 files changed, 22 insertions(+), 22 deletions(-) diff --git a/lgsm/config-default/config-lgsm/arkserver/_default.cfg b/lgsm/config-default/config-lgsm/arkserver/_default.cfg index f391bb9b56..e3fb9654e5 100644 --- a/lgsm/config-default/config-lgsm/arkserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/arkserver/_default.cfg @@ -19,7 +19,7 @@ altsavedirectoryname="${defaultmap}" maxplayers="70" ## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters -startparameters="${defaultmap}?AltSaveDirectoryName=${altsavedirectoryname}?listen?MultiHome=${ip}?MaxPlayers=${maxplayers}?QueryPort=${queryport}?RCONPort=${rconport}?Port=${port} -automanagedmods -crossplay -PublicIPForEpic=${ip}" +startparameters="${defaultmap}?AltSaveDirectoryName=${altsavedirectoryname}?listen?MultiHome=${ip}?MaxPlayers=${maxplayers}?QueryPort=${queryport}?RCONPort=${rconport}?Port=${port} -automanagedmods -crossplay -PublicIPForEpic=${publicip}" #### LinuxGSM Settings #### diff --git a/lgsm/config-default/config-lgsm/btlserver/_default.cfg b/lgsm/config-default/config-lgsm/btlserver/_default.cfg index f1e7449729..e26ca7e77b 100644 --- a/lgsm/config-default/config-lgsm/btlserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/btlserver/_default.cfg @@ -14,7 +14,7 @@ port="7777" queryport="7780" ## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters -startparameters="/Game/Maps/Final_Maps/Derailed?Game=/Script/ShooterGame.WartideGameMode?listen -log -broadcastip=\"${extip}\" -PORT=${port} -QueryPort=${queryport} -defgameini=\"${servercfgfullpath}\"" +startparameters="/Game/Maps/Final_Maps/Derailed?Game=/Script/ShooterGame.WartideGameMode?listen -log -broadcastip=\"${publicip}\" -PORT=${port} -QueryPort=${queryport} -defgameini=\"${servercfgfullpath}\"" #### LinuxGSM Settings #### diff --git a/lgsm/modules/command_debug.sh b/lgsm/modules/command_debug.sh index c544e3e2a0..41722e5074 100644 --- a/lgsm/modules/command_debug.sh +++ b/lgsm/modules/command_debug.sh @@ -58,9 +58,9 @@ fi echo -e "${lightblue}Game Server IP:\t${default}${ip}:${port}" # External server IP. -if [ "${extip}" ]; then - if [ "${ip}" != "${extip}" ]; then - echo -e "${lightblue}Internet IP:\t${default}${extip}:${port}" +if [ "${publicip}" ]; then + if [ "${ip}" != "${publicip}" ]; then + echo -e "${lightblue}Internet IP:\t${default}${publicip}:${port}" fi fi diff --git a/lgsm/modules/command_dev_details.sh b/lgsm/modules/command_dev_details.sh index 28abb87b16..b954181210 100644 --- a/lgsm/modules/command_dev_details.sh +++ b/lgsm/modules/command_dev_details.sh @@ -44,7 +44,7 @@ declare -A server_details=( ['HTTP Password']="${httppassword}" ['HTTP Port']="${httpport}" ['HTTP User']="${httpuser}" - ['Internet IP']="${extip}" + ['Internet IP']="${publicip}" ['LAN Port']="${lanport}" ['Master Port']="${masterport}" ['Master']="${master}" diff --git a/lgsm/modules/info_game.sh b/lgsm/modules/info_game.sh index 5eea7dfba5..641f5eeb15 100644 --- a/lgsm/modules/info_game.sh +++ b/lgsm/modules/info_game.sh @@ -2378,30 +2378,30 @@ fi # External IP address # 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" +if [ -f "${tmpdir}/publicip.txt" ]; then + if [ "$(find "${tmpdir}/publicip.txt" -mmin +1440)" ]; then + rm -f "${tmpdir:?}/publicip.txt" fi fi -if [ ! -f "${tmpdir}/extip.txt" ]; then - extip="$(curl --connect-timeout 10 -s https://api.ipify.org 2> /dev/null)" +if [ ! -f "${tmpdir}/publicip.txt" ]; then + publicip="$(curl --connect-timeout 10 -s https://api.ipify.org 2> /dev/null)" exitcode=$? - # if curl passes add extip to externalip.txt + # if curl passes add publicip to externalip.txt if [ "${exitcode}" == "0" ]; then - echo "${extip}" > "${tmpdir}/extip.txt" + echo "${publicip}" > "${tmpdir}/publicip.txt" else echo "Unable to get external IP address" fi else - extip="$(cat "${tmpdir}/extip.txt")" + publicip="$(cat "${tmpdir}/publicip.txt")" fi # Alert IP address if [ "${displayip}" ]; then alertip="${displayip}" -elif [ "${extip}" ]; then - alertip="${extip}" +elif [ "${publicip}" ]; then + alertip="${publicip}" else alertip="${ip}" fi @@ -2421,7 +2421,7 @@ if [ -z "${displaymasterserver}" ]; then if [ -n "${ip}" ] && [ -n "${port}" ]; then if [ "${steammaster}" == "true" ] || [ "${commandname}" == "DEV-QUERY-RAW" ]; then # Query external IP first as most liky to succeed. - 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}" --arg port3 "${port3}" 'if .response.servers != null then .response.servers[] | select((.gameport == ($port|tonumber) or .gameport == ($queryport|tonumber) or .gameport == ($port3|tonumber))) | .addr else empty end' | wc -l 2> /dev/null)" + masterserver="$(curl --connect-timeout 10 -m 3 -s "https://api.steampowered.com/ISteamApps/GetServersAtAddress/v0001?addr=${publicip}&format=json" | jq --arg port "${port}" --arg queryport "${queryport}" --arg port3 "${port3}" 'if .response.servers != null then .response.servers[] | select((.gameport == ($port|tonumber) or .gameport == ($queryport|tonumber) or .gameport == ($port3|tonumber))) | .addr else empty end' | wc -l 2> /dev/null)" if [ "${masterserver}" == "0" ]; then # Loop though server IP addresses if external IP fails. for queryip in "${queryips[@]}"; do diff --git a/lgsm/modules/info_messages.sh b/lgsm/modules/info_messages.sh index 8c601a6544..22319cdbd8 100644 --- a/lgsm/modules/info_messages.sh +++ b/lgsm/modules/info_messages.sh @@ -166,8 +166,8 @@ fn_info_message_server_resource() { echo -e "${lightblue}Link Speed:\t${default}${netlink}" fi echo -e "${lightblue}IP:\t${default}${ip}" - if [ "${ip}" != "${extip}" ]; then - echo -e "${lightblue}Internet IP:\t${default}${extip}" + if [ "${ip}" != "${publicip}" ]; then + echo -e "${lightblue}Internet IP:\t${default}${publicip}" fi } | column -s $'\t' -t } @@ -274,9 +274,9 @@ fn_info_message_gameserver() { echo -e "${lightblue}Server IP:\t${default}${ip}:${port}" # Internet ip - if [ -n "${extip}" ]; then - if [ "${ip}" != "${extip}" ]; then - echo -e "${lightblue}Internet IP:\t${default}${extip}:${port}" + if [ -n "${publicip}" ]; then + if [ "${ip}" != "${publicip}" ]; then + echo -e "${lightblue}Internet IP:\t${default}${publicip}:${port}" fi fi From b481ff1989afa38024500c6cf0db19aa56199c9d Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Fri, 1 Sep 2023 23:12:35 +0100 Subject: [PATCH 140/181] fix: resolve edge case where RHEL servers might have dpkg installed (#4302) For reasons unknown you can install dpkg in RHEL so instead this now looks for apt, yum or dnf --- lgsm/modules/check_deps.sh | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/lgsm/modules/check_deps.sh b/lgsm/modules/check_deps.sh index 560490b978..23edd69c6a 100644 --- a/lgsm/modules/check_deps.sh +++ b/lgsm/modules/check_deps.sh @@ -93,16 +93,16 @@ fn_deps_email() { array_deps_required+=(exim4) elif [ -d /etc/sendmail ]; then 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 + elif [ "$(command -v yum 2> /dev/null)" ] || [ "$(command -v dnf 2> /dev/null)" ]; then array_deps_required+=(mailx postfix) + elif [ "$(command -v apt 2> /dev/null)" ]; then + array_deps_required+=(mailutils 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 + if [ "$(command -v yum 2> /dev/null)" ] || [ "$(command -v dnf 2> /dev/null)" ]; then array_deps_required+=(mailx postfix) + elif [ "$(command -v apt 2> /dev/null)" ]; then + array_deps_required+=(mailutils postfix) fi fi fi @@ -144,7 +144,7 @@ fn_install_missing_deps() { fi # Add sudo dpkg --add-architecture i386 if using i386 packages. - if [ "$(command -v dpkg-query 2> /dev/null)" ]; then + if [ "$(command -v apt 2> /dev/null)" ]; then if printf '%s\n' "${array_deps_required[@]}" | grep -q -P 'i386'; then i386installcommand="sudo dpkg --add-architecture i386; " fi @@ -161,7 +161,7 @@ fn_install_missing_deps() { echo -en "...\r" sleep 1 echo -en " \r" - if [ "$(command -v dpkg-query 2> /dev/null)" ]; then + if [ "$(command -v apt 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 @@ -181,7 +181,7 @@ 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 apt 2> /dev/null)" ]; then echo -e "${i386installcommand}sudo apt update; sudo apt install ${array_deps_missing[*]}" elif [ "$(command -v dnf 2> /dev/null)" ]; then echo -e "sudo dnf install ${array_deps_missing[*]}" @@ -254,7 +254,7 @@ fn_deps_detector() { depstatus=1 monostatus=1 fi - elif [ "$(command -v dpkg-query 2> /dev/null)" ]; then + elif [ "$(command -v apt 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 From a5dbb4ad470d2fc22bacf6f9ab353f5fc0f8ea90 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Fri, 1 Sep 2023 23:38:51 +0100 Subject: [PATCH 141/181] fix: add socketname to core_legacy.sh --- lgsm/modules/core_legacy.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lgsm/modules/core_legacy.sh b/lgsm/modules/core_legacy.sh index 173c893d26..7a7e554ed2 100644 --- a/lgsm/modules/core_legacy.sh +++ b/lgsm/modules/core_legacy.sh @@ -15,6 +15,10 @@ for legacy_version in "${legacy_versions_array[@]}"; do fi done +if [ -z "${socketname}" ]; then + socketname="${sessionname}" +fi + if [ -n "${webadminuser}" ]; then httpuser="${webadminuser}" fi From aaff7c9bdb693fff9cd45c98afc8a1f4013ff47d Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sat, 2 Sep 2023 01:05:06 +0100 Subject: [PATCH 142/181] fix: Steam log symlink points to correct location This commit adds the functionality to create a symbolic link for Steam logs if it is missing. The symlink is created in the specified log directory. --- lgsm/modules/check_logs.sh | 5 +++++ lgsm/modules/install_logs.sh | 8 ++++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/lgsm/modules/check_logs.sh b/lgsm/modules/check_logs.sh index 2087ac9157..036eea5e44 100644 --- a/lgsm/modules/check_logs.sh +++ b/lgsm/modules/check_logs.sh @@ -24,3 +24,8 @@ fi if [ "${gamelogdir}" ] && [ -d "${gamelogdir}" ] && [ ! -d "${logdir}/server" ]; then fn_check_logs fi + +# Create Steam log symlink if missing +if [ ! -d "${logdir}/steam" ] && [ -n "${appid}" ]; then + fn_check_logs +fi diff --git a/lgsm/modules/install_logs.sh b/lgsm/modules/install_logs.sh index 31a4085063..cd26addd3c 100644 --- a/lgsm/modules/install_logs.sh +++ b/lgsm/modules/install_logs.sh @@ -86,10 +86,10 @@ if [ "${gamelogdir}" ]; then fi # If server uses SteamCMD create a symbolic link to the Steam logs. -if [ -d "${rootdir}/Steam/logs" ]; then - if [ ! -L "${logdir}/steamcmd" ]; then - echo -en "creating symlink to steam log dir: ${logdir}/steamcmd -> ${rootdir}/Steam/logs..." - if ! ln -nfs "${rootdir}/Steam/logs" "${logdir}/steamcmd"; then +if [ -d "${HOME}/.steam/steam/logs" ]; then + if [ ! -L "${logdir}/steam" ]; then + echo -en "creating symlink to steam log dir: ${logdir}/steam -> ${HOME}/.steam/steam/logs..." + if ! ln -nfs "${HOME}/.steam/steam/logs" "${logdir}/steam"; then fn_print_fail_eol_nl core_exit.sh else From 49be44db239c38db008ebff61e13e8e41644c84f Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sun, 3 Sep 2023 21:13:21 +0100 Subject: [PATCH 143/181] feat: add mono support for Ubuntu 22.04 and Debian 12 This commit adds support for Ubuntu 22.04 and Debian 12 in the check_deps.sh script. It includes the necessary commands to install dependencies for Mono repository on these versions of the operating systems. --- lgsm/modules/check_deps.sh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/lgsm/modules/check_deps.sh b/lgsm/modules/check_deps.sh index 23edd69c6a..41334205e1 100644 --- a/lgsm/modules/check_deps.sh +++ b/lgsm/modules/check_deps.sh @@ -19,7 +19,9 @@ fn_install_mono_repo() { sleep 1 echo -en " \r" if [ "${distroid}" == "ubuntu" ]; then - if [ "${distroversion}" == "20.04" ]; then + if [ "${distroversion}" == "22.04" ]; then + cmd="sudo apt install gnupg ca-certificates;sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF;echo 'deb https://download.mono-project.com/repo/ubuntu stable-jammy main' | sudo tee /etc/apt/sources.list.d/mono-official-stable.list;sudo apt update" + elif [ "${distroversion}" == "20.04" ]; then cmd="sudo apt install gnupg ca-certificates;sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF;echo 'deb https://download.mono-project.com/repo/ubuntu stable-focal main' | sudo tee /etc/apt/sources.list.d/mono-official-stable.list;sudo apt update" elif [ "${distroversion}" == "18.04" ]; then cmd="sudo apt install gnupg ca-certificates;sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF;echo 'deb https://download.mono-project.com/repo/ubuntu stable-bionic main' | sudo tee /etc/apt/sources.list.d/mono-official-stable.list;sudo apt update" @@ -29,7 +31,11 @@ fn_install_mono_repo() { monoautoinstall="1" fi elif [ "${distroid}" == "debian" ]; then - if [ "${distroversion}" == "10" ]; then + if [ "${distroversion}" == "12" ]; then + cmd="sudo apt install apt-transport-https dirmngr gnupg ca-certificates;sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF;echo 'deb https://download.mono-project.com/repo/debian stable-bookworm main' | sudo tee /etc/apt/sources.list.d/mono-official-stable.list;sudo apt update" + elif [ "${distroversion}" == "11" ]; then + cmd="sudo apt install apt-transport-https dirmngr gnupg ca-certificates;sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF;echo 'deb https://download.mono-project.com/repo/debian stable-bullseye main' | sudo tee /etc/apt/sources.list.d/mono-official-stable.list;sudo apt update" + elif [ "${distroversion}" == "10" ]; then cmd="sudo apt install apt-transport-https dirmngr gnupg ca-certificates;sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF;echo 'deb https://download.mono-project.com/repo/debian stable-buster main' | sudo tee /etc/apt/sources.list.d/mono-official-stable.list;sudo apt update" elif [ "${distroversion}" == "9" ]; then cmd="sudo apt install apt-transport-https dirmngr gnupg ca-certificates;sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF;echo 'deb https://download.mono-project.com/repo/debian stable-stretch main' | sudo tee /etc/apt/sources.list.d/mono-official-stable.list;sudo apt update" From 5f0f12a9b20e3f0fc8df86faac5318be7bacb19a Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Mon, 4 Sep 2023 21:24:27 +0100 Subject: [PATCH 144/181] feat(vint): migrate to dotnet from mono (#4304) * adde dotnet repo * feat: update package dependencies for Ubuntu 16.04, 18.04, and 20.04 - Updated the package dependency for "vints" from "mono-complete" to "aspnetcore-runtime-7.0" in the Ubuntu 16.04, 18.04, and 20.04 CSV files. - Also updated the package dependency for "vpmc" from "openjdk-8-jre" to "openjdk-11-jre" in the Ubuntu 18.04 and 20.04 CSV files. This commit ensures that the correct package dependencies are specified for these Ubuntu versions, improving compatibility and functionality of the codebase. * refactor: update dependency check for ASP.NET Core runtime The code has been refactored to update the dependency check for the ASP.NET Core runtime. The condition that checks for the presence of "dotnet-runtime-7.0" has been changed to "aspnetcore-runtime-7.0". This ensures that the correct dependency is being checked and improves accuracy in determining if the required runtime is installed. * fix: fix conditional statement in check_deps.sh The commit fixes a bug in the conditional statement of the check_deps.sh script. Previously, it incorrectly checked if dotnetversion was empty instead of checking if it was not empty. This caused an incorrect value to be assigned to depstatus and dotnetinstalled variables. The bug has been fixed by correcting the conditional statement. * refactor: simplify install_config.sh This commit simplifies the `install_config.sh` file by removing unnecessary code for the "vints" configuration. The configuration is now generated on first run, and the list of config locations is still provided. * refactor: improve error handling and display in core_exit.sh and install_config.sh - In core_exit.sh, added a check to set exit code to 4 if it is not already set. - In install_config.sh, improved the display of missing config file by highlighting the file path. These changes aim to enhance the error handling and provide clearer information to users. * feat: add exitcode handling to command_install.sh The commit adds a check for the exitcode variable in command_install.sh. If it is empty, it sets it to 0. This change ensures proper handling of the exitcode in the script. * refactor: improve installation process The code changes in this commit refactor the installation process. The `command_install.sh` file has been modified to remove unnecessary code. Additionally, the `install_complete.sh` file has been updated to provide more informative messages based on the exit code. This improves the overall clarity and user experience during installation. Co-authored-by: AI Assistant * refactor: remove redundant code in install_config.sh The commit removes a redundant function call in the install_config.sh file. The "fn_list_config_locations" function is no longer needed for the "vints" configuration. * a * refactor: improve logging in command_stop.sh - Changed `fn_script_log_error` to `fn_script_log_info` for consistency - Removed unnecessary empty line * refactor: dont try to stop a server that is already stopped * refactor: remove redundant code and improve socket name generation The commit refactors the code in `command_start.sh` and `linuxgsm.sh` to remove redundant code related to generating a unique tmux socket name. The code now creates a uid file if it doesn't exist, stops the running server, generates a uid using the current timestamp, and updates the socketname accordingly. This change improves the efficiency and reliability of socket name generation. * refactor: remove unnecessary command_stop.sh call The code change removes the unnecessary call to `command_stop.sh` in the `linuxgsm.sh` file. This improves efficiency and prevents lingering tmux sessions. * refactor: remove duplicate code for creating unique tmux socket name The code changes in `command_start.sh` and `linuxgsm.sh` refactor the creation of a unique tmux socket name. The duplicate code in `linuxgsm.sh` has been removed, resulting in cleaner and more efficient code. * refactor: improve socketname assignment The code change refactors the socketname assignment in the linuxgsm.sh script. Instead of directly assigning it to "${sessionname}-$(cat "${datadir}/${selfname}.uid")", it now checks if the file "${datadir}/${selfname}.uid" exists before assigning the value. This improves error handling and prevents potential issues when the file doesn't exist. --- 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-12.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/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 | 135 ----------------------- lgsm/data/ubuntu-21.10.csv | 135 ----------------------- lgsm/data/ubuntu-22.04.csv | 2 +- lgsm/data/ubuntu-23.04.csv | 2 +- lgsm/modules/check_deps.sh | 47 ++++++-- lgsm/modules/command_dev_detect_glibc.sh | 2 +- lgsm/modules/command_install.sh | 1 + lgsm/modules/command_start.sh | 11 +- lgsm/modules/command_stop.sh | 15 ++- lgsm/modules/core_dl.sh | 2 +- lgsm/modules/core_exit.sh | 2 + lgsm/modules/info_distro.sh | 4 + lgsm/modules/install_complete.sh | 16 ++- lgsm/modules/install_config.sh | 9 +- linuxgsm.sh | 3 +- 32 files changed, 99 insertions(+), 321 deletions(-) delete mode 100644 lgsm/data/ubuntu-21.04.csv delete mode 100644 lgsm/data/ubuntu-21.10.csv diff --git a/lgsm/data/almalinux-8.csv b/lgsm/data/almalinux-8.csv index ee8301e536..78ee5945d2 100644 --- a/lgsm/data/almalinux-8.csv +++ b/lgsm/data/almalinux-8.csv @@ -124,7 +124,7 @@ ut2k4 ut3 ut99 vh,glibc-devel -vints,mono-complete +vints,aspnetcore-runtime-7.0 vpmc,java-17-openjdk vs wet diff --git a/lgsm/data/almalinux-9.csv b/lgsm/data/almalinux-9.csv index c7d86c6e34..b341b72821 100644 --- a/lgsm/data/almalinux-9.csv +++ b/lgsm/data/almalinux-9.csv @@ -124,7 +124,7 @@ ut2k4 ut3 ut99 vh,glibc-devel -vints,mono-complete +vints,aspnetcore-runtime-7.0 vpmc,java-17-openjdk vs wet diff --git a/lgsm/data/centos-7.csv b/lgsm/data/centos-7.csv index 2bd1ea57a2..616e61c328 100644 --- a/lgsm/data/centos-7.csv +++ b/lgsm/data/centos-7.csv @@ -124,7 +124,7 @@ ut2k4 ut3 ut99 vh,glibc-devel -vints,mono-complete +vints,aspnetcore-runtime-7.0 vpmc,java-11-openjdk vs wet diff --git a/lgsm/data/centos-8.csv b/lgsm/data/centos-8.csv index ee8301e536..78ee5945d2 100644 --- a/lgsm/data/centos-8.csv +++ b/lgsm/data/centos-8.csv @@ -124,7 +124,7 @@ ut2k4 ut3 ut99 vh,glibc-devel -vints,mono-complete +vints,aspnetcore-runtime-7.0 vpmc,java-17-openjdk vs wet diff --git a/lgsm/data/centos-9.csv b/lgsm/data/centos-9.csv index c7d86c6e34..b341b72821 100644 --- a/lgsm/data/centos-9.csv +++ b/lgsm/data/centos-9.csv @@ -124,7 +124,7 @@ ut2k4 ut3 ut99 vh,glibc-devel -vints,mono-complete +vints,aspnetcore-runtime-7.0 vpmc,java-17-openjdk vs wet diff --git a/lgsm/data/debian-10.csv b/lgsm/data/debian-10.csv index 646df8b2b8..fd29e6da32 100644 --- a/lgsm/data/debian-10.csv +++ b/lgsm/data/debian-10.csv @@ -124,7 +124,7 @@ ut2k4 ut3 ut99 vh,libc6-dev -vints,mono-complete +vints,aspnetcore-runtime-7.0 vpmc,openjdk-11-jre vs wet diff --git a/lgsm/data/debian-11.csv b/lgsm/data/debian-11.csv index 8f31ec9c4f..6f34e2832e 100644 --- a/lgsm/data/debian-11.csv +++ b/lgsm/data/debian-11.csv @@ -124,7 +124,7 @@ ut2k4 ut3 ut99 vh,libc6-dev -vints,mono-complete +vints,aspnetcore-runtime-7.0 vpmc,openjdk-11-jre vs wet diff --git a/lgsm/data/debian-12.csv b/lgsm/data/debian-12.csv index 51b565a006..3738c4749e 100644 --- a/lgsm/data/debian-12.csv +++ b/lgsm/data/debian-12.csv @@ -124,7 +124,7 @@ ut2k4 ut3 ut99 vh,libc6-dev -vints,mono-complete +vints,aspnetcore-runtime-7.0 vpmc,openjdk-17-jre vs wet diff --git a/lgsm/data/debian-9.csv b/lgsm/data/debian-9.csv index 8ff958dddb..794a54afe1 100644 --- a/lgsm/data/debian-9.csv +++ b/lgsm/data/debian-9.csv @@ -124,7 +124,7 @@ ut2k4 ut3 ut99 vh,libc6-dev -vints,mono-complete +vints,aspnetcore-runtime-7.0 vpmc,openjdk-8-jre vs wet diff --git a/lgsm/data/rhel-7.csv b/lgsm/data/rhel-7.csv index 196651a2fe..1b0b8c1bd7 100644 --- a/lgsm/data/rhel-7.csv +++ b/lgsm/data/rhel-7.csv @@ -124,7 +124,7 @@ ut2k4 ut3 ut99 vh,glibc-devel -vints,mono-complete +vints,aspnetcore-runtime-7.0 vpmc,java-11-openjdk vs wet diff --git a/lgsm/data/rhel-8.csv b/lgsm/data/rhel-8.csv index ee8301e536..78ee5945d2 100644 --- a/lgsm/data/rhel-8.csv +++ b/lgsm/data/rhel-8.csv @@ -124,7 +124,7 @@ ut2k4 ut3 ut99 vh,glibc-devel -vints,mono-complete +vints,aspnetcore-runtime-7.0 vpmc,java-17-openjdk vs wet diff --git a/lgsm/data/rhel-9.csv b/lgsm/data/rhel-9.csv index c7d86c6e34..b341b72821 100644 --- a/lgsm/data/rhel-9.csv +++ b/lgsm/data/rhel-9.csv @@ -124,7 +124,7 @@ ut2k4 ut3 ut99 vh,glibc-devel -vints,mono-complete +vints,aspnetcore-runtime-7.0 vpmc,java-17-openjdk vs wet diff --git a/lgsm/data/rocky-8.csv b/lgsm/data/rocky-8.csv index ee8301e536..78ee5945d2 100644 --- a/lgsm/data/rocky-8.csv +++ b/lgsm/data/rocky-8.csv @@ -124,7 +124,7 @@ ut2k4 ut3 ut99 vh,glibc-devel -vints,mono-complete +vints,aspnetcore-runtime-7.0 vpmc,java-17-openjdk vs wet diff --git a/lgsm/data/rocky-9.csv b/lgsm/data/rocky-9.csv index c7d86c6e34..b341b72821 100644 --- a/lgsm/data/rocky-9.csv +++ b/lgsm/data/rocky-9.csv @@ -124,7 +124,7 @@ ut2k4 ut3 ut99 vh,glibc-devel -vints,mono-complete +vints,aspnetcore-runtime-7.0 vpmc,java-17-openjdk vs wet diff --git a/lgsm/data/ubuntu-16.04.csv b/lgsm/data/ubuntu-16.04.csv index 3e860cd1f7..0fac4905f1 100644 --- a/lgsm/data/ubuntu-16.04.csv +++ b/lgsm/data/ubuntu-16.04.csv @@ -124,7 +124,7 @@ ut2k4 ut3 ut99 vh,libc6-dev -vints,mono-complete +vints,aspnetcore-runtime-7.0 vpmc,openjdk-8-jre vs wet diff --git a/lgsm/data/ubuntu-18.04.csv b/lgsm/data/ubuntu-18.04.csv index 646df8b2b8..fd29e6da32 100644 --- a/lgsm/data/ubuntu-18.04.csv +++ b/lgsm/data/ubuntu-18.04.csv @@ -124,7 +124,7 @@ ut2k4 ut3 ut99 vh,libc6-dev -vints,mono-complete +vints,aspnetcore-runtime-7.0 vpmc,openjdk-11-jre vs wet diff --git a/lgsm/data/ubuntu-20.04.csv b/lgsm/data/ubuntu-20.04.csv index bb026e94af..a51acccd03 100644 --- a/lgsm/data/ubuntu-20.04.csv +++ b/lgsm/data/ubuntu-20.04.csv @@ -124,7 +124,7 @@ ut2k4 ut3 ut99 vh,libc6-dev -vints,mono-complete +vints,aspnetcore-runtime-7.0 vpmc,openjdk-11-jre vs wet diff --git a/lgsm/data/ubuntu-21.04.csv b/lgsm/data/ubuntu-21.04.csv deleted file mode 100644 index 8f31ec9c4f..0000000000 --- a/lgsm/data/ubuntu-21.04.csv +++ /dev/null @@ -1,135 +0,0 @@ -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 -ahl2 -ark -arma3 -armar,libcurl4 -ats -av -bb -bb2,libcurl4-gnutls-dev:i386 -bd -bf1942,libncurses5:i386,libtinfo5:i386 -bfv,libncurses5:i386,libstdc++5:i386 -bmdm,libncurses5:i386 -bo -bs -bt,libicu-dev,dos2unix,libxml2-utils -btl -cc -cd -ck,xvfb,libxi6 -cmw -cod,libstdc++5:i386 -cod2,libstdc++5:i386 -cod4 -coduo,libstdc++5:i386 -codwaw -col -cs -cscz -csgo -css,libtinfo5:i386 -ct -dab -dayz -dmc -dod -dodr -dods -doi -dst,libcurl4-gnutls-dev:i386 -dys -eco,libgdiplus -em -etl -ets2 -fctr -fof -gmod,libtinfo5:i386 -hcu -hl2dm -hldm -hldms -hw,lib32z1 -ins -inss -ios -jc2 -jc3 -jk2 -kf -kf2 -l4d -l4d2 -lo -mc,openjdk-17-jre -mcb -mh -mohaa,libstdc++5:i386 -mom -mta,libncursesw5,libxml2-utils -nd -nec -nmrih,libtinfo5:i386 -ns -ns2,speex,libtbb2 -ns2c,speex:i386,libtbb2 -ohd -onset,libmariadb-dev -opfor -pc -pc2 -pmc,openjdk-17-jre -pstbs,libgconf-2-4 -pvkii -pvr,libc++1 -pz,openjdk-17-jre,rng-tools -q2 -q3 -ql -qw -ricochet -ro -rtcw -rust,lib32z1 -rw,openjdk-17-jre -samp -sb -sbots -scpsl,mono-complete -scpslsm,mono-complete -sdtd,telnet,expect,libxml2-utils -sf -sfc,libtinfo5:i386 -sof2 -sol -squad -st,libxml2-utils -stn -sven,libssl1.1:i386,zlib1g:i386 -terraria -tf2,libcurl4-gnutls-dev:i386 -tfc -ti -ts -ts3 -tu -tw -unt -ut -ut2k4 -ut3 -ut99 -vh,libc6-dev -vints,mono-complete -vpmc,openjdk-11-jre -vs -wet -wf -wmc,openjdk-17-jre -wurm,xvfb -zmr,libtinfo5:i386 -zps,libtinfo5:i386 diff --git a/lgsm/data/ubuntu-21.10.csv b/lgsm/data/ubuntu-21.10.csv deleted file mode 100644 index 8f31ec9c4f..0000000000 --- a/lgsm/data/ubuntu-21.10.csv +++ /dev/null @@ -1,135 +0,0 @@ -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 -ahl2 -ark -arma3 -armar,libcurl4 -ats -av -bb -bb2,libcurl4-gnutls-dev:i386 -bd -bf1942,libncurses5:i386,libtinfo5:i386 -bfv,libncurses5:i386,libstdc++5:i386 -bmdm,libncurses5:i386 -bo -bs -bt,libicu-dev,dos2unix,libxml2-utils -btl -cc -cd -ck,xvfb,libxi6 -cmw -cod,libstdc++5:i386 -cod2,libstdc++5:i386 -cod4 -coduo,libstdc++5:i386 -codwaw -col -cs -cscz -csgo -css,libtinfo5:i386 -ct -dab -dayz -dmc -dod -dodr -dods -doi -dst,libcurl4-gnutls-dev:i386 -dys -eco,libgdiplus -em -etl -ets2 -fctr -fof -gmod,libtinfo5:i386 -hcu -hl2dm -hldm -hldms -hw,lib32z1 -ins -inss -ios -jc2 -jc3 -jk2 -kf -kf2 -l4d -l4d2 -lo -mc,openjdk-17-jre -mcb -mh -mohaa,libstdc++5:i386 -mom -mta,libncursesw5,libxml2-utils -nd -nec -nmrih,libtinfo5:i386 -ns -ns2,speex,libtbb2 -ns2c,speex:i386,libtbb2 -ohd -onset,libmariadb-dev -opfor -pc -pc2 -pmc,openjdk-17-jre -pstbs,libgconf-2-4 -pvkii -pvr,libc++1 -pz,openjdk-17-jre,rng-tools -q2 -q3 -ql -qw -ricochet -ro -rtcw -rust,lib32z1 -rw,openjdk-17-jre -samp -sb -sbots -scpsl,mono-complete -scpslsm,mono-complete -sdtd,telnet,expect,libxml2-utils -sf -sfc,libtinfo5:i386 -sof2 -sol -squad -st,libxml2-utils -stn -sven,libssl1.1:i386,zlib1g:i386 -terraria -tf2,libcurl4-gnutls-dev:i386 -tfc -ti -ts -ts3 -tu -tw -unt -ut -ut2k4 -ut3 -ut99 -vh,libc6-dev -vints,mono-complete -vpmc,openjdk-11-jre -vs -wet -wf -wmc,openjdk-17-jre -wurm,xvfb -zmr,libtinfo5:i386 -zps,libtinfo5:i386 diff --git a/lgsm/data/ubuntu-22.04.csv b/lgsm/data/ubuntu-22.04.csv index ba801e5077..7f417b4634 100644 --- a/lgsm/data/ubuntu-22.04.csv +++ b/lgsm/data/ubuntu-22.04.csv @@ -124,7 +124,7 @@ ut2k4 ut3 ut99 vh,libc6-dev -vints,mono-complete +vints,aspnetcore-runtime-7.0 vpmc,openjdk-17-jre vs wet diff --git a/lgsm/data/ubuntu-23.04.csv b/lgsm/data/ubuntu-23.04.csv index ba801e5077..7f417b4634 100644 --- a/lgsm/data/ubuntu-23.04.csv +++ b/lgsm/data/ubuntu-23.04.csv @@ -124,7 +124,7 @@ ut2k4 ut3 ut99 vh,libc6-dev -vints,mono-complete +vints,aspnetcore-runtime-7.0 vpmc,openjdk-17-jre vs wet diff --git a/lgsm/modules/check_deps.sh b/lgsm/modules/check_deps.sh index 41334205e1..2818ffc116 100644 --- a/lgsm/modules/check_deps.sh +++ b/lgsm/modules/check_deps.sh @@ -7,6 +7,19 @@ moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +fn_install_dotnet_repo() { + if [ "${distroid}" == "ubuntu" ]; then + # if package aspnetcore-runtime-7.0 is unavailable in ubuntu repos, add the microsoft repo. + if ! apt-cache show aspnetcore-runtime-7.0 > /dev/null 2>&1; then + fn_fetch_file "https://packages.microsoft.com/config/ubuntu/${distroversion}/packages-microsoft-prod.deb" "" "" "" "/tmp" "packages-microsoft-prod.deb" "" "" "" "" + sudo dpkg -i /tmp/packages-microsoft-prod.deb + fi + elif [ "${distroid}" == "debian" ]; then + fn_fetch_file "https://packages.microsoft.com/config/debian/${distroversion}/packages-microsoft-prod.deb" "" "" "" "/tmp" "packages-microsoft-prod.deb" "" "" "" "" + sudo dpkg -i /tmp/packages-microsoft-prod.deb + fi +} + fn_install_mono_repo() { if [ "${autodepinstall}" == "0" ]; then fn_print_information_nl "Automatically adding Mono repository." @@ -20,11 +33,11 @@ fn_install_mono_repo() { echo -en " \r" if [ "${distroid}" == "ubuntu" ]; then if [ "${distroversion}" == "22.04" ]; then - cmd="sudo apt install gnupg ca-certificates;sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF;echo 'deb https://download.mono-project.com/repo/ubuntu stable-jammy main' | sudo tee /etc/apt/sources.list.d/mono-official-stable.list;sudo apt update" + cmd="sudo apt-get install gnupg ca-certificates;sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF;echo 'deb https://download.mono-project.com/repo/ubuntu stable-jammy main' | sudo tee /etc/apt/sources.list.d/mono-official-stable.list;sudo apt update" elif [ "${distroversion}" == "20.04" ]; then - cmd="sudo apt install gnupg ca-certificates;sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF;echo 'deb https://download.mono-project.com/repo/ubuntu stable-focal main' | sudo tee /etc/apt/sources.list.d/mono-official-stable.list;sudo apt update" + cmd="sudo apt-get install gnupg ca-certificates;sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF;echo 'deb https://download.mono-project.com/repo/ubuntu stable-focal main' | sudo tee /etc/apt/sources.list.d/mono-official-stable.list;sudo apt update" elif [ "${distroversion}" == "18.04" ]; then - cmd="sudo apt install gnupg ca-certificates;sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF;echo 'deb https://download.mono-project.com/repo/ubuntu stable-bionic main' | sudo tee /etc/apt/sources.list.d/mono-official-stable.list;sudo apt update" + cmd="sudo apt-get install gnupg ca-certificates;sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF;echo 'deb https://download.mono-project.com/repo/ubuntu stable-bionic main' | sudo tee /etc/apt/sources.list.d/mono-official-stable.list;sudo apt update" elif [ "${distroversion}" == "16.04" ]; then cmd="sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF;sudo apt install apt-transport-https ca-certificates;echo 'deb https://download.mono-project.com/repo/ubuntu stable-xenial main' | sudo tee /etc/apt/sources.list.d/mono-official-stable.list;sudo apt update" else @@ -32,13 +45,13 @@ fn_install_mono_repo() { fi elif [ "${distroid}" == "debian" ]; then if [ "${distroversion}" == "12" ]; then - cmd="sudo apt install apt-transport-https dirmngr gnupg ca-certificates;sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF;echo 'deb https://download.mono-project.com/repo/debian stable-bookworm main' | sudo tee /etc/apt/sources.list.d/mono-official-stable.list;sudo apt update" + cmd="sudo apt-get install apt-transport-https dirmngr gnupg ca-certificates;sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF;echo 'deb https://download.mono-project.com/repo/debian stable-bookworm main' | sudo tee /etc/apt/sources.list.d/mono-official-stable.list;sudo apt update" elif [ "${distroversion}" == "11" ]; then - cmd="sudo apt install apt-transport-https dirmngr gnupg ca-certificates;sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF;echo 'deb https://download.mono-project.com/repo/debian stable-bullseye main' | sudo tee /etc/apt/sources.list.d/mono-official-stable.list;sudo apt update" + cmd="sudo apt-get install apt-transport-https dirmngr gnupg ca-certificates;sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF;echo 'deb https://download.mono-project.com/repo/debian stable-bullseye main' | sudo tee /etc/apt/sources.list.d/mono-official-stable.list;sudo apt update" elif [ "${distroversion}" == "10" ]; then - cmd="sudo apt install apt-transport-https dirmngr gnupg ca-certificates;sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF;echo 'deb https://download.mono-project.com/repo/debian stable-buster main' | sudo tee /etc/apt/sources.list.d/mono-official-stable.list;sudo apt update" + cmd="sudo apt-get install apt-transport-https dirmngr gnupg ca-certificates;sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF;echo 'deb https://download.mono-project.com/repo/debian stable-buster main' | sudo tee /etc/apt/sources.list.d/mono-official-stable.list;sudo apt update" elif [ "${distroversion}" == "9" ]; then - cmd="sudo apt install apt-transport-https dirmngr gnupg ca-certificates;sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF;echo 'deb https://download.mono-project.com/repo/debian stable-stretch main' | sudo tee /etc/apt/sources.list.d/mono-official-stable.list;sudo apt update" + cmd="sudo apt-get install apt-transport-https dirmngr gnupg ca-certificates;sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF;echo 'deb https://download.mono-project.com/repo/debian stable-stretch main' | sudo tee /etc/apt/sources.list.d/mono-official-stable.list;sudo apt update" else monoautoinstall="1" fi @@ -135,10 +148,14 @@ fn_install_missing_deps() { fi autodepinstall="$?" - if [ "${monostatus}" == "1" ]; then + if [ "${monoinstalled}" == "false" ]; then fn_install_mono_repo fi + if [ "${dotnetinstalled}" == "false" ]; then + fn_install_dotnet_repo + fi + if [ "${commandname}" == "INSTALL" ]; then if [ "${autodepinstall}" == "0" ]; then fn_print_information_nl "$(whoami) has sudo access." @@ -254,11 +271,21 @@ fn_deps_detector() { if [ -n "${monoversion}" ] && [ "${monoversion}" -ge "5" ]; then # Mono >= 5.0.0 already installed. depstatus=0 - monostatus=0 + monoinstalled=true else # Mono not installed or installed Mono < 5.0.0. depstatus=1 - monostatus=1 + monoinstalled=false + fi + # .NET Core: A .NET Core repo needs to be installed. + elif [ "${deptocheck}" == "aspnetcore-runtime-7.0" ]; then + # .NET is not installed. + if [ -n "${dotnetversion}" ]; then + depstatus=0 + dotnetinstalled=true + else + depstatus=1 + dotnetinstalled=false fi elif [ "$(command -v apt 2> /dev/null)" ]; then dpkg-query -W -f='${Status}' "${deptocheck}" 2> /dev/null | grep -q -P '^install ok installed' diff --git a/lgsm/modules/command_dev_detect_glibc.sh b/lgsm/modules/command_dev_detect_glibc.sh index 8ff87d7110..ca64ed7cc6 100644 --- a/lgsm/modules/command_dev_detect_glibc.sh +++ b/lgsm/modules/command_dev_detect_glibc.sh @@ -15,7 +15,7 @@ echo -e "=================================" echo -e "glibc Requirements Checker" echo -e "=================================" -if [ ! "$(command -v objdump)" ]; then +if [ ! "$(command -v objdump 2> /dev/null)" ]; then fn_print_failure_nl "objdump is missing" fn_script_log_fatal "objdump is missing" core_exit.sh diff --git a/lgsm/modules/command_install.sh b/lgsm/modules/command_install.sh index e8cba75608..b3edd67c8c 100644 --- a/lgsm/modules/command_install.sh +++ b/lgsm/modules/command_install.sh @@ -48,5 +48,6 @@ else fix.sh install_stats.sh install_complete.sh + fi core_exit.sh diff --git a/lgsm/modules/command_start.sh b/lgsm/modules/command_start.sh index 1302d0d99e..963815b1b5 100644 --- a/lgsm/modules/command_start.sh +++ b/lgsm/modules/command_start.sh @@ -50,9 +50,12 @@ fn_start_tmux() { # Create uid to ensure unique tmux socket name. if [ ! -f "${datadir}/${selfname}.uid" ]; then - # stop running server (if running) to prevent lingering tmux sessions. - exitbypass=1 - command_stop.sh + check_status.sh + if [ "${status}" != "0" ]; then + # stop running server (if running) to prevent lingering tmux sessions. + exitbypass=1 + command_stop.sh + fi uid=$(date '+%s' | sha1sum | head -c 8) echo "${uid}" > "${datadir}/${selfname}.uid" socketname="${sessionname}-$(cat "${datadir}/${selfname}.uid")" @@ -181,7 +184,7 @@ fn_start_tmux() { check.sh # If user ran the start command monitor will become enabled. -if [ "${firstcommandname}" == "START" ]||[ "${firstcommandname}" == "RESTART" ]; then +if [ "${firstcommandname}" == "START" ] || [ "${firstcommandname}" == "RESTART" ]; then date '+%s' > "${lockdir:?}/${selfname}-monitoring.lock" fi diff --git a/lgsm/modules/command_stop.sh b/lgsm/modules/command_stop.sh index dc716216f9..409e57b145 100644 --- a/lgsm/modules/command_stop.sh +++ b/lgsm/modules/command_stop.sh @@ -256,15 +256,15 @@ fn_stop_tmux() { fn_stop_pre_check() { if [ "${status}" == "0" ]; then fn_print_info_nl "${servername} is already stopped" - fn_script_log_error "${servername} is already stopped" + fn_script_log_info "${servername} is already stopped" else # Select graceful shutdown. fn_stop_graceful_select - fi - # Check status again, a kill tmux session if graceful shutdown failed. - check_status.sh - if [ "${status}" != "0" ]; then - fn_stop_tmux + # Check status again, a kill tmux session if graceful shutdown failed. + check_status.sh + if [ "${status}" != "0" ]; then + fn_stop_tmux + fi fi } @@ -282,11 +282,10 @@ fn_stop_pre_check rm -f "${lockdir:?}/${selfname}-started.lock" # If user ran the stop command monitor will become disabled. -if [ "${firstcommandname}" == "STOP" ];then +if [ "${firstcommandname}" == "STOP" ]; then rm -f "${lockdir:?}/${selfname}-monitoring.lock" fi - # Remove stopping lockfile. rm -f "${lockdir:?}/${selfname}-stopping.lock" diff --git a/lgsm/modules/core_dl.sh b/lgsm/modules/core_dl.sh index f854998907..2a6c7c400a 100644 --- a/lgsm/modules/core_dl.sh +++ b/lgsm/modules/core_dl.sh @@ -36,7 +36,7 @@ fn_dl_steamcmd() { # Unbuffer will allow the output of steamcmd not buffer allowing a smooth output. # unbuffer us part of the expect package. - if [ "$(command -v unbuffer)" ]; then + if [ "$(command -v unbuffer 2> /dev/null)" ]; then unbuffer="unbuffer" fi diff --git a/lgsm/modules/core_exit.sh b/lgsm/modules/core_exit.sh index a66744b19f..6947a3d4a8 100644 --- a/lgsm/modules/core_exit.sh +++ b/lgsm/modules/core_exit.sh @@ -35,7 +35,9 @@ elif [ "${exitcode}" != "0" ]; then elif [ "${exitcode}" == "3" ]; then fn_script_log_warn "${moduleselfname} exiting with code: ${exitcode}" else + # if exit code is not set assume error. fn_script_log_warn "${moduleselfname} exiting with code: ${exitcode}" + exitcode=4 fi fn_exit_dev_debug # remove trap. diff --git a/lgsm/modules/info_distro.sh b/lgsm/modules/info_distro.sh index b375f8c020..aacee2b8fb 100644 --- a/lgsm/modules/info_distro.sh +++ b/lgsm/modules/info_distro.sh @@ -127,6 +127,10 @@ if [ "$(command -v mono 2> /dev/null)" ]; then monoversion="$(mono --version 2>&1 | grep -Po '(?<=version )\d')" fi +if [ "$(command -v dotnet 2> /dev/null)" ]; then + dotnetversion="$(dotnet --list-runtimes | grep -E 'Microsoft\.NETCore\.App' | awk '{print $2}')" +fi + ## Uptime uptime="$(< /proc/uptime)" uptime=${uptime/[. ]*/} diff --git a/lgsm/modules/install_complete.sh b/lgsm/modules/install_complete.sh index 58189a4bec..013ba73345 100644 --- a/lgsm/modules/install_complete.sh +++ b/lgsm/modules/install_complete.sh @@ -9,7 +9,21 @@ moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" echo -e "" echo -e "=================================" -echo -e "Install Complete!" + +if [ "${exitcode}" == "1" ]; then + echo -e "Install Failed!" + fn_script_log_fatal "Install Failed!" +elif [ "${exitcode}" == "2" ]; then + echo -e "Install Completed with Errors!" + fn_script_log_error "Install Completed with Errors!" +elif [ "${exitcode}" == "3" ]; then + echo -e "Install Completed with Warnings!" + fn_script_log_warn "Install Completed with Warnings!" +elif [ -z "${exitcode}" ] || [ "${exitcode}" == "0" ]; then + echo -e "Install Complete!" + fn_script_log_pass "Install Complete!" +fi + fn_script_log_info "Install Complete!" echo -e "" echo -e "To start server type:" diff --git a/lgsm/modules/install_config.sh b/lgsm/modules/install_config.sh index e868e9bf71..9a49b821c2 100644 --- a/lgsm/modules/install_config.sh +++ b/lgsm/modules/install_config.sh @@ -154,7 +154,7 @@ fn_list_config_locations() { elif [ -d "${servercfgfullpath}" ]; then echo -e "Game Server Config Dir: ${servercfgfullpath}" else - echo -e "Config file: ${red}${servercfgfullpath} (${red}FILE MISSING${default})" + echo -e "Config file: ${red}${servercfgfullpath}${default} (${red}FILE MISSING${default})" fi fi echo -e "LinuxGSM Config: ${lgsmdir}/config-lgsm/${gameservername}" @@ -787,11 +787,8 @@ elif [ "${shortname}" == "unt" ]; then fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "vints" ]; then - array_configs+=(serverconfig.json) - fn_fetch_default_config - fn_default_config_remote - fn_set_config_vars - fn_list_config_locations + # Config is generated on first run + : elif [ "${shortname}" == "vs" ]; then array_configs+=(server.cfg) fn_fetch_default_config diff --git a/linuxgsm.sh b/linuxgsm.sh index 331a618221..d6b526e0ea 100755 --- a/linuxgsm.sh +++ b/linuxgsm.sh @@ -36,7 +36,7 @@ tmpdir="${lgsmdir}/tmp" datadir="${lgsmdir}/data" lockdir="${lgsmdir}/lock" sessionname="${selfname}" -[ -f "${datadir}/${selfname}.uid" ] && socketname="${sessionname}-$(cat "${datadir}/${selfname}.uid")" || socketname="${sessionname}" +[ -f "${datadir}/${selfname}.uid" ] && socketname="${sessionname}-$(cat "${datadir}/${selfname}.uid")" serverlist="${datadir}/serverlist.csv" serverlistmenu="${datadir}/serverlistmenu.csv" [ -n "${LGSM_CONFIG}" ] && configdir="${LGSM_CONFIG}" || configdir="${lgsmdir}/config-lgsm" @@ -413,6 +413,7 @@ else fi fi fi + # Load the IP details before the first config is loaded. check_ip.sh # Configs have to be loaded twice to allow start startparameters to pick up all vars From ac78fc1b8fccc8e5b1d012e5fc666a9cea8b3507 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Mon, 4 Sep 2023 22:10:41 +0100 Subject: [PATCH 145/181] fix(pz): correct start parameters (#4305) * refactor: remove unnecessary memory allocation in pzserver config The startparameters variable in the pzserver configuration file was modified to remove the unnecessary memory allocation parameter. This change simplifies the configuration and improves efficiency. * refactor: simplify startparameters in pzserver config The startparameters in the pzserver config file have been simplified to only include the server name. This change removes unnecessary parameters and improves readability. --- lgsm/config-default/config-lgsm/pzserver/_default.cfg | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lgsm/config-default/config-lgsm/pzserver/_default.cfg b/lgsm/config-default/config-lgsm/pzserver/_default.cfg index b103eb772a..b82f136edd 100644 --- a/lgsm/config-default/config-lgsm/pzserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/pzserver/_default.cfg @@ -10,11 +10,10 @@ ## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters ip="0.0.0.0" -javaram="8192" # -Xmx$8192M adminpassword="CHANGE_ME" ## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters -startparameters="--ip ${ip} -adminpassword \"${adminpassword}\" -servername ${selfname} -Xmx${javaram}M" +startparameters="-servername ${selfname}" #### LinuxGSM Settings #### From 8a9f34321d57b101d08b2f42c9549cd39812622a Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Mon, 4 Sep 2023 23:11:56 +0100 Subject: [PATCH 146/181] feat(inss): add optional gslt to start parameters --- lgsm/config-default/config-lgsm/inssserver/_default.cfg | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lgsm/config-default/config-lgsm/inssserver/_default.cfg b/lgsm/config-default/config-lgsm/inssserver/_default.cfg index b08460b29a..820058ada1 100644 --- a/lgsm/config-default/config-lgsm/inssserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/inssserver/_default.cfg @@ -19,9 +19,14 @@ defaultmap="Canyon" defaultscenario="Scenario_Crossing_Push_Security" maxplayers="28" +## Game Server Login Token (GSLT): Optional +# GSLT can be used 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 ## Parameter Docs | https://mod.io/g/insurgencysandstorm/r/server-admin-guide -startparameters="${defaultmap}?Scenario=${defaultscenario}?MaxPlayers=${maxplayers} -Port=${port} -QueryPort=${queryport} -hostname='${servername}' -Rcon -RconPassword=${rconpassword} -RconListenPort=${rconport} -log" +startparameters="${defaultmap}?Scenario=${defaultscenario}?MaxPlayers=${maxplayers} -Port=${port} -QueryPort=${queryport} -hostname='${servername}' -Rcon -RconPassword=${rconpassword} -RconListenPort=${rconport} -GSLTToken=${gslt} -log" #### LinuxGSM Settings #### From 65e3a93d0dfb12720079cc77061462e933a6f5d8 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Tue, 5 Sep 2023 00:01:07 +0100 Subject: [PATCH 147/181] fix(unt): config is auto generated --- lgsm/config-default/config-lgsm/untserver/_default.cfg | 6 ++++-- lgsm/modules/install_config.sh | 7 ++----- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/lgsm/config-default/config-lgsm/untserver/_default.cfg b/lgsm/config-default/config-lgsm/untserver/_default.cfg index a7de22b4d8..f5aa19e5b7 100644 --- a/lgsm/config-default/config-lgsm/untserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/untserver/_default.cfg @@ -13,14 +13,16 @@ ip="0.0.0.0" port="27015" maxplayers="20" defaultmap="PEI" - +servername="LinuxGSM" +perspective="first" # Values: first, third, vehicle, Both. +gamemode="normal" # Values: normal, easy, gold. ## 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="-nographics -batchmode -bind ${ip} -port ${port} -maxplayers ${maxplayers} -map ${defaultmap} -gslt ${gslt} +InternetServer/${selfname}" +startparameters="-nographics -batchmode -bind ${ip} -port ${port} -maxplayers ${maxplayers} -perspective ${perspective} -mode ${gamemode} -name ${servername} -map ${defaultmap} -gslt ${gslt} +InternetServer/${selfname}" #### LinuxGSM Settings #### diff --git a/lgsm/modules/install_config.sh b/lgsm/modules/install_config.sh index 9a49b821c2..9dc0841d5d 100644 --- a/lgsm/modules/install_config.sh +++ b/lgsm/modules/install_config.sh @@ -781,11 +781,8 @@ elif [ "${shortname}" == "ut99" ]; then fn_set_config_vars fn_list_config_locations elif [ "${shortname}" == "unt" ]; then - array_configs+=(Config.json) - fn_fetch_default_config - fn_default_config_remote - fn_set_config_vars - fn_list_config_locations + # Config is generated on first run + : elif [ "${shortname}" == "vints" ]; then # Config is generated on first run : From 82e5da4b1d59ac29d8e701846355e5977fbf3e12 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Wed, 6 Sep 2023 14:27:10 +0100 Subject: [PATCH 148/181] fix(info_game): refactor key value pairs parsing split out space and equals delimited --- lgsm/modules/info_game.sh | 82 +++++++++++++++++++++++++-------------- 1 file changed, 53 insertions(+), 29 deletions(-) diff --git a/lgsm/modules/info_game.sh b/lgsm/modules/info_game.sh index 641f5eeb15..dbce9e2030 100644 --- a/lgsm/modules/info_game.sh +++ b/lgsm/modules/info_game.sh @@ -34,10 +34,9 @@ fn_info_game_ini() { configtype="ini" } -# Config Type: custom +# Config Type: Key Value Pairs (Equals Delimited) # Comment: ; or # -# Note: this ini filter does not filter by section. Can cause issues with some games that have multiple sections with the same variable name. -fn_info_game_keyvalue_pairs() { +fn_info_game_keyvalue_pairs_equals() { # sed is used to process the file. # -n: Suppresses automatic printing of pattern space. # /^\<'"${2}"'\>/: Matches lines starting with the word provided as the second argument ($2), considering it as a whole word. @@ -60,6 +59,31 @@ fn_info_game_keyvalue_pairs() { configtype="keyvalue_pairs" } +# Config Type: Key Value Pairs (Space Delimited) +# Comment: ; or # +fn_info_game_keyvalue_pairs_space() { + # sed is used to process the file. + # -n: Suppresses automatic printing of pattern space. + # /^\<'"${2}"'\>/: Matches lines starting with the word provided as the second argument ($2), considering it as a whole word. + # { s/.* *"\?\([^"]*\)"\?/\1/p;q }: Command block executed for lines that match the pattern. + # - s/.* *"\?\([^"]*\)"\?/\1/: Matches and captures the value after an space ( ), possibly surrounded by optional double quotes. + # - .*: Matches any characters before the space. + # - = *"\?: Matches the space and any optional spaces before an optional double quote. + # - \([^"]*\): Captures any characters that are not double quotes. + # - "\?: Matches an optional double quote. + # - /1: Replaces the entire matched pattern with the captured value. + # - p: Prints the modified line. + # - q: Quits processing after modifying and printing the line. + + if [ -n "${3}" ]; then + servercfgparse="${3}" + else + servercfgparse="${servercfgfullpath}" + fi + eval "${1}=\"$(sed -n '/^\<'"${2}"'\>/ { s/.* *\"\?\([^"]*\)\"\?/\1/p;q }' "${servercfgparse}" | tr -d '\r')\"" + configtype="keyvalue_pairs" +} + # Config Type: QuakeC # Comment: // or /* */ fn_info_game_quakec() { @@ -896,11 +920,11 @@ fn_info_game_armar() { # Filetype: con fn_info_game_bf1942() { if [ -f "${servercfgfullpath}" ]; then - fn_info_game_keyvalue_pairs "configip" "game.serverIp" - fn_info_game_keyvalue_pairs "maxplayers" "game.serverMaxPlayers" - fn_info_game_keyvalue_pairs "port" "game.serverPort" - fn_info_game_keyvalue_pairs "servername" "game.serverName" - fn_info_game_keyvalue_pairs "serverpassword" "game.serverPassword" + fn_info_game_keyvalue_pairs_space "configip" "game.serverIP" + fn_info_game_keyvalue_pairs_space "maxplayers" "game.serverMaxPlayers" + fn_info_game_keyvalue_pairs_space "port" "game.serverPort" + fn_info_game_keyvalue_pairs_space "servername" "game.serverName" + fn_info_game_keyvalue_pairs_space "serverpassword" "game.serverPassword" fi configip="${configip:-"0.0.0.0"}" maxplayers="${maxplayers:-"0"}" @@ -917,11 +941,11 @@ fn_info_game_bf1942() { # Filetype: con fn_info_game_bfv() { if [ -f "${servercfgfullpath}" ]; then - fn_info_game_keyvalue_pairs "configip" "game.serverIp" - fn_info_game_keyvalue_pairs "maxplayers" "game.serverMaxPlayers" - fn_info_game_keyvalue_pairs "port" "game.serverPort" - fn_info_game_keyvalue_pairs "servername" "game.serverName" - fn_info_game_keyvalue_pairs "serverpassword" "game.serverPassword" + fn_info_game_keyvalue_pairs_space "configip" "game.serverIp" + fn_info_game_keyvalue_pairs_space "maxplayers" "game.serverMaxPlayers" + fn_info_game_keyvalue_pairs_space "port" "game.serverPort" + fn_info_game_keyvalue_pairs_space "servername" "game.serverName" + fn_info_game_keyvalue_pairs_space "serverpassword" "game.serverPassword" fi configip="${configip:-"0.0.0.0"}" maxplayers="${maxplayers:-"0"}" @@ -1750,14 +1774,14 @@ fn_info_game_rust() { fn_info_game_rw() { if [ -f "${servercfgfullpath}" ]; then - fn_info_game_keyvalue_pairs "configip" "Server_IP" - fn_info_game_keyvalue_pairs "gamemode" "World_GameMode" - fn_info_game_keyvalue_pairs "maxplayers" "Server_MaxPlayers" - fn_info_game_keyvalue_pairs "port" "Server_Port" - fn_info_game_keyvalue_pairs "rconport" "RCON_Port" - fn_info_game_keyvalue_pairs "seed" "World_Seed" - fn_info_game_keyvalue_pairs "servername" "Server_Name" - fn_info_game_keyvalue_pairs "worldname" "World_Name" + fn_info_game_keyvalue_pairs_equals "configip" "Server_IP" + fn_info_game_keyvalue_pairs_equals "gamemode" "World_GameMode" + fn_info_game_keyvalue_pairs_equals "maxplayers" "Server_MaxPlayers" + fn_info_game_keyvalue_pairs_equals "port" "Server_Port" + fn_info_game_keyvalue_pairs_equals "rconport" "RCON_Port" + fn_info_game_keyvalue_pairs_equals "seed" "World_Seed" + fn_info_game_keyvalue_pairs_equals "servername" "Server_Name" + fn_info_game_keyvalue_pairs_equals "worldname" "World_Name" fi configip="${configip:-"0.0.0.0"}" gamemode="${gamemode:-"NOT SET"}" @@ -1994,12 +2018,12 @@ fn_info_game_spark() { # Filetype: cfg fn_info_game_squad() { if [ -f "${servercfgfullpath}" ]; then - fn_info_game_keyvalue_pairs "servername" "ServerName" - fn_info_game_keyvalue_pairs "maxplayers" "MaxPlayers" + fn_info_game_keyvalue_pairs_equals "servername" "ServerName" + fn_info_game_keyvalue_pairs_equals "maxplayers" "MaxPlayers" fi if [ -f "${servercfgdir}/Rcon.cfg" ]; then - fn_info_game_keyvalue_pairs "rconport" "Port" "${servercfgdir}/Rcon.cfg" - fn_info_game_keyvalue_pairs "rconpassword" "Password" "${servercfgdir}/Rcon.cfg" + fn_info_game_keyvalue_pairs_equals "rconport" "Port" "${servercfgdir}/Rcon.cfg" + fn_info_game_keyvalue_pairs_equals "rconpassword" "Password" "${servercfgdir}/Rcon.cfg" fi maxplayers="${maxplayers:-"0"}" port="${port:-"0"}" @@ -2017,10 +2041,10 @@ fn_info_game_squad() { # Filetype: cfg fn_info_game_terraria() { if [ -f "${servercfgfullpath}" ]; then - fn_info_game_keyvalue_pairs "maxplayers" "maxplayers" - fn_info_game_keyvalue_pairs "port" "port" - fn_info_game_keyvalue_pairs "servername" "worldname" - fn_info_game_keyvalue_pairs "worldname" "world" + fn_info_game_keyvalue_pairs_equals "maxplayers" "maxplayers" + fn_info_game_keyvalue_pairs_equals "port" "port" + fn_info_game_keyvalue_pairs_equals "servername" "worldname" + fn_info_game_keyvalue_pairs_equals "worldname" "world" fi queryport="${port:-"0"}" servername="${servername:-"NOT SET"}" From a3c5a847e511bfe81f3072f3898d1fba9701ee6e Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Wed, 6 Sep 2023 15:20:07 +0100 Subject: [PATCH 149/181] fix(start): lock file created before check Even if check fails a lock file will be generated to allow monitor to run --- lgsm/modules/command_start.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lgsm/modules/command_start.sh b/lgsm/modules/command_start.sh index 963815b1b5..b2f46855d3 100644 --- a/lgsm/modules/command_start.sh +++ b/lgsm/modules/command_start.sh @@ -181,13 +181,13 @@ fn_start_tmux() { echo -en "\n" } -check.sh - # If user ran the start command monitor will become enabled. if [ "${firstcommandname}" == "START" ] || [ "${firstcommandname}" == "RESTART" ]; then date '+%s' > "${lockdir:?}/${selfname}-monitoring.lock" fi +check.sh + # If the server already started dont start again. if [ "${status}" != "0" ]; then fn_print_dots "${servername}" From 559365810774d433f6a60b214443eb3b6ec46f73 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Wed, 6 Sep 2023 15:41:39 +0100 Subject: [PATCH 150/181] fix(pvr): update executable details PVR server has changed the name if its executable --- lgsm/config-default/config-lgsm/pvrserver/_default.cfg | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lgsm/config-default/config-lgsm/pvrserver/_default.cfg b/lgsm/config-default/config-lgsm/pvrserver/_default.cfg index 53f0bdd03a..22ef42b6ac 100644 --- a/lgsm/config-default/config-lgsm/pvrserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/pvrserver/_default.cfg @@ -16,7 +16,7 @@ port="7777" defaultmap="datacenter" ## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters -startparameters="${defaultmap} -log -MultiHome=${ip} -Port=${port}" +startparameters="Pavlov ${defaultmap} -log -MultiHome=${ip} -Port=${port}" #### LinuxGSM Settings #### @@ -163,7 +163,7 @@ glibc="2.17" ## Game Server Directories systemdir="${serverfiles}/Pavlov" executabledir="${systemdir}/Binaries/Linux" -executable="./PavlovServer" +executable="./PavlovServer-Linux-Shipping" servercfgdir="${systemdir}/Saved/Config/LinuxServer" servercfg="Game.ini" servercfgdefault="Game.ini" From 89ec08c8f1f8a4be4f64a8decc28d56db043bb34 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Wed, 6 Sep 2023 16:40:34 +0100 Subject: [PATCH 151/181] fix(pvr): add fix for libc --- .../config-lgsm/pvrserver/_default.cfg | 4 +++- .../config-lgsm/untserver/_default.cfg | 1 + lgsm/modules/fix_ark.sh | 2 +- lgsm/modules/fix_arma3.sh | 2 +- lgsm/modules/fix_armar.sh | 2 +- lgsm/modules/fix_av.sh | 2 +- lgsm/modules/fix_bo.sh | 2 +- lgsm/modules/fix_bt.sh | 2 +- lgsm/modules/fix_cmw.sh | 2 +- lgsm/modules/fix_csgo.sh | 2 +- lgsm/modules/fix_dst.sh | 2 +- lgsm/modules/fix_hw.sh | 2 +- lgsm/modules/fix_ins.sh | 2 +- lgsm/modules/fix_kf.sh | 2 +- lgsm/modules/fix_kf2.sh | 2 +- lgsm/modules/fix_lo.sh | 2 +- lgsm/modules/fix_mcb.sh | 2 +- lgsm/modules/fix_mta.sh | 2 +- lgsm/modules/fix_pvr.sh | 14 ++++++++++++++ lgsm/modules/fix_ro.sh | 2 +- lgsm/modules/fix_rust.sh | 2 +- lgsm/modules/fix_rw.sh | 2 +- lgsm/modules/fix_samp.sh | 2 +- lgsm/modules/fix_sdtd.sh | 2 +- lgsm/modules/fix_sfc.sh | 2 +- lgsm/modules/fix_sof2.sh | 2 +- lgsm/modules/fix_squad.sh | 2 +- lgsm/modules/fix_st.sh | 2 +- lgsm/modules/fix_steamcmd.sh | 2 +- lgsm/modules/fix_terraria.sh | 2 +- lgsm/modules/fix_tf2.sh | 2 +- lgsm/modules/fix_ts3.sh | 2 +- lgsm/modules/fix_unt.sh | 2 +- lgsm/modules/fix_ut.sh | 2 +- lgsm/modules/fix_ut2k4.sh | 2 +- lgsm/modules/fix_ut3.sh | 2 +- lgsm/modules/fix_vh.sh | 2 +- lgsm/modules/fix_wurm.sh | 2 +- lgsm/modules/fix_zmr.sh | 2 +- 39 files changed, 54 insertions(+), 37 deletions(-) create mode 100644 lgsm/modules/fix_pvr.sh diff --git a/lgsm/config-default/config-lgsm/pvrserver/_default.cfg b/lgsm/config-default/config-lgsm/pvrserver/_default.cfg index 22ef42b6ac..0a0bf8b525 100644 --- a/lgsm/config-default/config-lgsm/pvrserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/pvrserver/_default.cfg @@ -14,9 +14,11 @@ port="7777" # Maps: bridge, datacenter, sand defaultmap="datacenter" +# Get an API key from https://pavlov-ms.vankrupt.com/servers/v1/key +apikey="" ## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters -startparameters="Pavlov ${defaultmap} -log -MultiHome=${ip} -Port=${port}" +startparameters="Pavlov ${defaultmap} -log -MultiHome=${ip} -Port=${port} ApiKey=${apikey}" #### LinuxGSM Settings #### diff --git a/lgsm/config-default/config-lgsm/untserver/_default.cfg b/lgsm/config-default/config-lgsm/untserver/_default.cfg index f5aa19e5b7..8fc651294c 100644 --- a/lgsm/config-default/config-lgsm/untserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/untserver/_default.cfg @@ -16,6 +16,7 @@ defaultmap="PEI" servername="LinuxGSM" perspective="first" # Values: first, third, vehicle, Both. gamemode="normal" # Values: normal, easy, gold. + ## Game Server Login Token (GSLT): Required # GSLT is required for running a public server. # More info: https://docs.linuxgsm.com/steamcmd/gslt diff --git a/lgsm/modules/fix_ark.sh b/lgsm/modules/fix_ark.sh index 7ca0e60f89..03e53380f0 100644 --- a/lgsm/modules/fix_ark.sh +++ b/lgsm/modules/fix_ark.sh @@ -3,7 +3,7 @@ # Author: Daniel Gibbs # Contributors: http://linuxgsm.com/contrib # Website: https://linuxgsm.com -# Description: Resolves various issues with ARK: Survival Evolved. +# Description: Resolves issues with ARK: Survival Evolved. moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" diff --git a/lgsm/modules/fix_arma3.sh b/lgsm/modules/fix_arma3.sh index d417383777..b415b81d62 100644 --- a/lgsm/modules/fix_arma3.sh +++ b/lgsm/modules/fix_arma3.sh @@ -3,7 +3,7 @@ # Author: Daniel Gibbs # Contributors: http://linuxgsm.com/contrib # Website: https://linuxgsm.com -# Description: Resolves an issue with ARMA3. +# Description: Resolves issues with ARMA3. moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" diff --git a/lgsm/modules/fix_armar.sh b/lgsm/modules/fix_armar.sh index 2a56daf418..6b68c2a630 100755 --- a/lgsm/modules/fix_armar.sh +++ b/lgsm/modules/fix_armar.sh @@ -3,7 +3,7 @@ # Author: Daniel Gibbs # Contributors: http://linuxgsm.com/contrib # Website: https://linuxgsm.com -# Description: Resolves an issue with Arma Reforger. +# Description: Resolves issues with Arma Reforger. module_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" diff --git a/lgsm/modules/fix_av.sh b/lgsm/modules/fix_av.sh index c8fcdcfc5f..fbb2599002 100644 --- a/lgsm/modules/fix_av.sh +++ b/lgsm/modules/fix_av.sh @@ -3,7 +3,7 @@ # Author: Daniel Gibbs # Contributors: http://linuxgsm.com/contrib # Website: https://linuxgsm.com -# Description: Resolves startup issue with Avorion +# Description: Resolves issues with Avorion. moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" diff --git a/lgsm/modules/fix_bo.sh b/lgsm/modules/fix_bo.sh index 3e09a880f8..24e76874ec 100644 --- a/lgsm/modules/fix_bo.sh +++ b/lgsm/modules/fix_bo.sh @@ -3,7 +3,7 @@ # Author: Daniel Gibbs # Contributors: http://linuxgsm.com/contrib # Website: https://linuxgsm.com -# Description: Resolves various issues with Ballistic Overkill. +# Description: Resolves issues with Ballistic Overkill. moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" diff --git a/lgsm/modules/fix_bt.sh b/lgsm/modules/fix_bt.sh index bb26155d8c..4d837a1ba9 100755 --- a/lgsm/modules/fix_bt.sh +++ b/lgsm/modules/fix_bt.sh @@ -3,7 +3,7 @@ # Author: Daniel Gibbs # Contributors: http://linuxgsm.com/contrib # Website: https://linuxgsm.com -# Description: Resolves an issue with Barotrauma. +# Description: Resolves issues with Barotrauma. module_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" diff --git a/lgsm/modules/fix_cmw.sh b/lgsm/modules/fix_cmw.sh index 2a98d9e53a..a57c6c8cb7 100644 --- a/lgsm/modules/fix_cmw.sh +++ b/lgsm/modules/fix_cmw.sh @@ -3,7 +3,7 @@ # Author: Daniel Gibbs # Contributors: http://linuxgsm.com/contrib # Website: https://linuxgsm.com -# Description: Resolves the issue of the not starting server on linux +# Description: Resolves issues with Chivalry: Medieval Warfare. moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" diff --git a/lgsm/modules/fix_csgo.sh b/lgsm/modules/fix_csgo.sh index 01b02c4e02..ea858ee3ca 100644 --- a/lgsm/modules/fix_csgo.sh +++ b/lgsm/modules/fix_csgo.sh @@ -3,7 +3,7 @@ # Author: Daniel Gibbs # Contributors: http://linuxgsm.com/contrib # Website: https://linuxgsm.com -# Description: Resolves various issues with CS:GO. +# Description: Resolves issues with Counter-Strike: Global Offensive. moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" diff --git a/lgsm/modules/fix_dst.sh b/lgsm/modules/fix_dst.sh index e1f07dcb65..ff963d3426 100644 --- a/lgsm/modules/fix_dst.sh +++ b/lgsm/modules/fix_dst.sh @@ -3,7 +3,7 @@ # Author: Daniel Gibbs # Contributors: http://linuxgsm.com/contrib # Website: https://linuxgsm.com -# Description: Resolves various issues with Don't Starve Together. +# Description: Resolves issues with Don't Starve Together. moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" diff --git a/lgsm/modules/fix_hw.sh b/lgsm/modules/fix_hw.sh index 6a92a5c047..0e70b7195d 100644 --- a/lgsm/modules/fix_hw.sh +++ b/lgsm/modules/fix_hw.sh @@ -3,7 +3,7 @@ # Author: Daniel Gibbs # Contributors: http://linuxgsm.com/contrib # Website: https://linuxgsm.com -# Description: Resolves various issues with Hurtworld. +# Description: Resolves issues with Hurtworld. moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" diff --git a/lgsm/modules/fix_ins.sh b/lgsm/modules/fix_ins.sh index 21bea123aa..cc79e36852 100644 --- a/lgsm/modules/fix_ins.sh +++ b/lgsm/modules/fix_ins.sh @@ -3,7 +3,7 @@ # Author: Daniel Gibbs # Contributors: http://linuxgsm.com/contrib # Website: https://linuxgsm.com -# Description: Resolves various issues with Insurgency. +# Description: Resolves issues with Insurgency. moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" diff --git a/lgsm/modules/fix_kf.sh b/lgsm/modules/fix_kf.sh index 3cfb8fd84a..fe8b574aac 100644 --- a/lgsm/modules/fix_kf.sh +++ b/lgsm/modules/fix_kf.sh @@ -3,7 +3,7 @@ # Author: Daniel Gibbs # Contributors: http://linuxgsm.com/contrib # Website: https://linuxgsm.com -# Description: Resolves various issues with Killing Floor. +# Description: Resolves issues with Killing Floor. moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" diff --git a/lgsm/modules/fix_kf2.sh b/lgsm/modules/fix_kf2.sh index 7be311b4fa..46850bd64e 100644 --- a/lgsm/modules/fix_kf2.sh +++ b/lgsm/modules/fix_kf2.sh @@ -3,7 +3,7 @@ # Author: Daniel Gibbs # Contributors: http://linuxgsm.com/contrib # Website: https://linuxgsm.com -# Description: Resolves various issues with Killing Floor 2. +# Description: Resolves issues with Killing Floor 2. moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" diff --git a/lgsm/modules/fix_lo.sh b/lgsm/modules/fix_lo.sh index a042488678..4c3758b01d 100644 --- a/lgsm/modules/fix_lo.sh +++ b/lgsm/modules/fix_lo.sh @@ -2,7 +2,7 @@ # LinuxGSM fix_lo.sh module # Author: Daniel Gibbs # Website: https://linuxgsm.com -# Description: Resolves installation issue with Last Oasis +# Description: Resolves various issues with Last Oasis. moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" diff --git a/lgsm/modules/fix_mcb.sh b/lgsm/modules/fix_mcb.sh index 828225e72e..1e95bb4a84 100644 --- a/lgsm/modules/fix_mcb.sh +++ b/lgsm/modules/fix_mcb.sh @@ -3,7 +3,7 @@ # Author: Daniel Gibbs # Contributors: http://linuxgsm.com/contrib # Website: https://linuxgsm.com -# Description: Resolves possible startup issue with Minecraft Bedrock. +# Description: Resolves various issues with Minecraft Bedrock. moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" diff --git a/lgsm/modules/fix_mta.sh b/lgsm/modules/fix_mta.sh index 21292d7f3b..65488f2a16 100644 --- a/lgsm/modules/fix_mta.sh +++ b/lgsm/modules/fix_mta.sh @@ -3,7 +3,7 @@ # Author: Daniel Gibbs # Contributors: http://linuxgsm.com/contrib # Website: https://linuxgsm.com -# Description: Installs the libmysqlclient for database functions on the server. +# Description: Resolves various issues with Multi Theft Auto. moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" diff --git a/lgsm/modules/fix_pvr.sh b/lgsm/modules/fix_pvr.sh new file mode 100644 index 0000000000..6d8727e33e --- /dev/null +++ b/lgsm/modules/fix_pvr.sh @@ -0,0 +1,14 @@ +#!/bin/bash +# LinuxGSM fix_pvr.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Resolves various issues with Pavlov VR. + +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +if [ ! -f "${serverfiles}/linux64/libc++.so" ] && [ -f "/usr/lib/x86_64-linux-gnu/libc++.so.1" ]; then + cp "/usr/lib/x86_64-linux-gnu/libc++.so.1" "${serverfiles}/linux64/libc++.so" +fi + +export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${serverfiles}:${serverfiles}/linux64" diff --git a/lgsm/modules/fix_ro.sh b/lgsm/modules/fix_ro.sh index f094c6b38f..6ae485dbe9 100644 --- a/lgsm/modules/fix_ro.sh +++ b/lgsm/modules/fix_ro.sh @@ -3,7 +3,7 @@ # Author: Daniel Gibbs # Contributors: http://linuxgsm.com/contrib # Website: https://linuxgsm.com -# Description: Resolves various issues with Red Orchestra. +# Description: Resolves issues with Red Orchestra. moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" diff --git a/lgsm/modules/fix_rust.sh b/lgsm/modules/fix_rust.sh index 0699a8f00b..6d4cebc01c 100644 --- a/lgsm/modules/fix_rust.sh +++ b/lgsm/modules/fix_rust.sh @@ -3,7 +3,7 @@ # Author: Daniel Gibbs # Contributors: http://linuxgsm.com/contrib # Website: https://linuxgsm.com -# Description: Resolves startup issue with Rust. +# Description: Resolves issues with Rust. moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" diff --git a/lgsm/modules/fix_rw.sh b/lgsm/modules/fix_rw.sh index 2cc631122c..17acf4defc 100644 --- a/lgsm/modules/fix_rw.sh +++ b/lgsm/modules/fix_rw.sh @@ -3,7 +3,7 @@ # Author: Daniel Gibbs # Contributors: http://linuxgsm.com/contrib # Website: https://linuxgsm.com -# Description: Resolves various issues with Rising World. +# Description: Resolves issues with Rising World. moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" diff --git a/lgsm/modules/fix_samp.sh b/lgsm/modules/fix_samp.sh index 146fc37af7..461d92aee7 100644 --- a/lgsm/modules/fix_samp.sh +++ b/lgsm/modules/fix_samp.sh @@ -3,7 +3,7 @@ # Author: Daniel Gibbs # Contributors: http://linuxgsm.com/contrib # Website: https://linuxgsm.com -# Description: Resolves issue that the default rcon password is not changed +# Description: Resolves issue that the default rcon password is not changed. moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" diff --git a/lgsm/modules/fix_sdtd.sh b/lgsm/modules/fix_sdtd.sh index e46f7db8cb..7988b0d679 100644 --- a/lgsm/modules/fix_sdtd.sh +++ b/lgsm/modules/fix_sdtd.sh @@ -3,7 +3,7 @@ # Author: Daniel Gibbs # Contributors: http://linuxgsm.com/contrib # Website: https://linuxgsm.com -# Description: Resolves various issues with 7 Days to Die. +# Description: Resolves issues with 7 Days to Die. moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" diff --git a/lgsm/modules/fix_sfc.sh b/lgsm/modules/fix_sfc.sh index 891b718034..308f74b247 100644 --- a/lgsm/modules/fix_sfc.sh +++ b/lgsm/modules/fix_sfc.sh @@ -3,7 +3,7 @@ # Author: Daniel Gibbs # Contributors: http://linuxgsm.com/contrib # Website: https://linuxgsm.com -# Description: Resolves various issues with Source Forts Classic. +# Description: Resolves issues with Source Forts Classic. moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" diff --git a/lgsm/modules/fix_sof2.sh b/lgsm/modules/fix_sof2.sh index 43d943cb18..4e5b136241 100644 --- a/lgsm/modules/fix_sof2.sh +++ b/lgsm/modules/fix_sof2.sh @@ -3,7 +3,7 @@ # Author: Daniel Gibbs # Contributors: http://linuxgsm.com/contrib # Website: https://linuxgsm.com -# Description: Resolves various issues with Soldier of Fortune 2. +# Description: Resolves issues with Soldier of Fortune 2. moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" diff --git a/lgsm/modules/fix_squad.sh b/lgsm/modules/fix_squad.sh index e7162d310a..2fec57f0e4 100644 --- a/lgsm/modules/fix_squad.sh +++ b/lgsm/modules/fix_squad.sh @@ -3,7 +3,7 @@ # Author: Daniel Gibbs # Contributors: http://linuxgsm.com/contrib # Website: https://linuxgsm.com -# Description: Resolves various issues with Squad. +# Description: Resolves issues with Squad. moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" diff --git a/lgsm/modules/fix_st.sh b/lgsm/modules/fix_st.sh index 44066bb379..4d100c6fcd 100644 --- a/lgsm/modules/fix_st.sh +++ b/lgsm/modules/fix_st.sh @@ -3,7 +3,7 @@ # Author: Daniel Gibbs # Contributors: http://linuxgsm.com/contrib # Website: https://linuxgsm.com -# Description: Resolves startup issue with Stationeers. +# Description: Resolves issues with Stationeers. moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" diff --git a/lgsm/modules/fix_steamcmd.sh b/lgsm/modules/fix_steamcmd.sh index 44980ab321..2a2076072f 100644 --- a/lgsm/modules/fix_steamcmd.sh +++ b/lgsm/modules/fix_steamcmd.sh @@ -3,7 +3,7 @@ # Author: Daniel Gibbs # Contributors: http://linuxgsm.com/contrib # Website: https://linuxgsm.com -# Description: Resolves various issues related to SteamCMD. +# Description: Resolves issues with SteamCMD. moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" diff --git a/lgsm/modules/fix_terraria.sh b/lgsm/modules/fix_terraria.sh index 7e5aa67e28..dc734b6fd3 100644 --- a/lgsm/modules/fix_terraria.sh +++ b/lgsm/modules/fix_terraria.sh @@ -3,7 +3,7 @@ # Author: Daniel Gibbs # Contributors: http://linuxgsm.com/contrib # Website: https://linuxgsm.com -# Description: Resolves an issue with Terraria. +# Description: Resolves issues with Terraria. moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" diff --git a/lgsm/modules/fix_tf2.sh b/lgsm/modules/fix_tf2.sh index 085542eed9..fe7de8278d 100644 --- a/lgsm/modules/fix_tf2.sh +++ b/lgsm/modules/fix_tf2.sh @@ -3,7 +3,7 @@ # Author: Daniel Gibbs # Contributors: http://linuxgsm.com/contrib # Website: https://linuxgsm.com -# Description: Resolves various issues with Team Fortress 2. +# Description: Resolves issues with Team Fortress 2. moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" diff --git a/lgsm/modules/fix_ts3.sh b/lgsm/modules/fix_ts3.sh index 3d0a6760fd..c655a43224 100644 --- a/lgsm/modules/fix_ts3.sh +++ b/lgsm/modules/fix_ts3.sh @@ -3,7 +3,7 @@ # Author: Daniel Gibbs # Contributors: http://linuxgsm.com/contrib # Website: https://linuxgsm.com -# Description: Resolves various issues with Teamspeak 3. +# Description: Resolves issues with Teamspeak 3. moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" diff --git a/lgsm/modules/fix_unt.sh b/lgsm/modules/fix_unt.sh index 77253bd856..9afdce3374 100644 --- a/lgsm/modules/fix_unt.sh +++ b/lgsm/modules/fix_unt.sh @@ -3,7 +3,7 @@ # Author: Daniel Gibbs # Contributors: http://linuxgsm.com/contrib # Website: https://linuxgsm.com -# Description: Resolves startup issue with Unturned. +# Description: Resolves issues with Unturned. moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" diff --git a/lgsm/modules/fix_ut.sh b/lgsm/modules/fix_ut.sh index aa958e86d7..ded65ddad9 100644 --- a/lgsm/modules/fix_ut.sh +++ b/lgsm/modules/fix_ut.sh @@ -3,7 +3,7 @@ # Author: Daniel Gibbs # Contributors: http://linuxgsm.com/contrib # Website: https://linuxgsm.com -# Description: Resolves various issues with Unreal Tournament. +# Description: Resolves issues with Unreal Tournament. moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" diff --git a/lgsm/modules/fix_ut2k4.sh b/lgsm/modules/fix_ut2k4.sh index 0a3b89b337..2f7fc0d4d8 100644 --- a/lgsm/modules/fix_ut2k4.sh +++ b/lgsm/modules/fix_ut2k4.sh @@ -3,7 +3,7 @@ # Author: Daniel Gibbs # Contributors: http://linuxgsm.com/contrib # Website: https://linuxgsm.com -# Description: Resolves various issues with Unreal Tournament 2004. +# Description: Resolves issues with Unreal Tournament 2004. moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" diff --git a/lgsm/modules/fix_ut3.sh b/lgsm/modules/fix_ut3.sh index 4958537f2e..97326c7868 100644 --- a/lgsm/modules/fix_ut3.sh +++ b/lgsm/modules/fix_ut3.sh @@ -3,7 +3,7 @@ # Author: Daniel Gibbs # Contributors: http://linuxgsm.com/contrib # Website: https://linuxgsm.com -# Description: Resolves various issues with Unreal Tournament 3. +# Description: Resolves issues with Unreal Tournament 3. moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" diff --git a/lgsm/modules/fix_vh.sh b/lgsm/modules/fix_vh.sh index 9849077470..831335c3c0 100644 --- a/lgsm/modules/fix_vh.sh +++ b/lgsm/modules/fix_vh.sh @@ -2,7 +2,7 @@ # LinuxGSM fix_rust.sh module # Author: Alasdair Haig # Website: https://linuxgsm.com -# Description: Resolves startup issue with Valheim +# Description: Resolves issues with Valheim, moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" diff --git a/lgsm/modules/fix_wurm.sh b/lgsm/modules/fix_wurm.sh index 73eaac93e6..b6f5762f55 100644 --- a/lgsm/modules/fix_wurm.sh +++ b/lgsm/modules/fix_wurm.sh @@ -3,7 +3,7 @@ # Author: Daniel Gibbs # Contributors: http://linuxgsm.com/contrib # Website: https://linuxgsm.com -# Description: Resolves various issues with Wurm Unlimited. +# Description: Resolves issues with Wurm Unlimited. moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" diff --git a/lgsm/modules/fix_zmr.sh b/lgsm/modules/fix_zmr.sh index 56f055fc31..a88d82f348 100644 --- a/lgsm/modules/fix_zmr.sh +++ b/lgsm/modules/fix_zmr.sh @@ -3,7 +3,7 @@ # Author: Daniel Gibbs # Contributors: http://linuxgsm.com/contrib # Website: https://linuxgsm.com -# Description: Resolves various issues with Zombie Master: Reborn. +# Description: Resolves issues with Zombie Master: Reborn. moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" From 3959fa4bf46d43998fa5e34332846ee1346949d1 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Wed, 6 Sep 2023 19:22:23 +0100 Subject: [PATCH 152/181] fix(pstbs): correct gamename --- lgsm/config-default/config-lgsm/pstbsserver/_default.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lgsm/config-default/config-lgsm/pstbsserver/_default.cfg b/lgsm/config-default/config-lgsm/pstbsserver/_default.cfg index 513f9e089b..d028fad57b 100644 --- a/lgsm/config-default/config-lgsm/pstbsserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/pstbsserver/_default.cfg @@ -155,7 +155,7 @@ consoleinteract="no" ## Game Server Details # Do not edit -gamename="pstbsserver" +gamename="Post Scriptum" engine="unreal4" glibc="2.17" From 20f5e8d5dcaa8cb0d80044fcd80ccf11678063c4 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Wed, 6 Sep 2023 19:27:05 +0100 Subject: [PATCH 153/181] feat(ps): Renamed pstbs to ps Post Scriptum changed is name removing "The Bloody Seventh" part. I have updated the naming of this game server. --- 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-12.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-22.04.csv | 2 +- lgsm/data/ubuntu-23.04.csv | 2 +- lgsm/modules/check_system_requirements.sh | 2 +- lgsm/modules/info_game.sh | 6 +++--- lgsm/modules/info_messages.sh | 6 +++--- 23 files changed, 27 insertions(+), 27 deletions(-) diff --git a/lgsm/data/almalinux-8.csv b/lgsm/data/almalinux-8.csv index 78ee5945d2..ac4b7c36f2 100644 --- a/lgsm/data/almalinux-8.csv +++ b/lgsm/data/almalinux-8.csv @@ -83,7 +83,7 @@ opfor pc pc2 pmc,java-17-openjdk -pstbs,GConf2 +ps,GConf2 pvkii pvr,libcxx pz,java-11-openjdk rng-tools diff --git a/lgsm/data/almalinux-9.csv b/lgsm/data/almalinux-9.csv index b341b72821..124322b62e 100644 --- a/lgsm/data/almalinux-9.csv +++ b/lgsm/data/almalinux-9.csv @@ -83,7 +83,7 @@ opfor pc pc2 pmc,java-17-openjdk -pstbs,GConf2 +ps,GConf2 pvkii pvr,libcxx pz,java-11-openjdk rng-tools diff --git a/lgsm/data/centos-7.csv b/lgsm/data/centos-7.csv index 616e61c328..4c256491d6 100644 --- a/lgsm/data/centos-7.csv +++ b/lgsm/data/centos-7.csv @@ -83,7 +83,7 @@ opfor pc pc2 pmc,java-11-openjdk -pstbs,GConf2 +ps,GConf2 pvkii pvr,libcxx pz,java-11-openjdk rng-tools diff --git a/lgsm/data/centos-8.csv b/lgsm/data/centos-8.csv index 78ee5945d2..ac4b7c36f2 100644 --- a/lgsm/data/centos-8.csv +++ b/lgsm/data/centos-8.csv @@ -83,7 +83,7 @@ opfor pc pc2 pmc,java-17-openjdk -pstbs,GConf2 +ps,GConf2 pvkii pvr,libcxx pz,java-11-openjdk rng-tools diff --git a/lgsm/data/centos-9.csv b/lgsm/data/centos-9.csv index b341b72821..124322b62e 100644 --- a/lgsm/data/centos-9.csv +++ b/lgsm/data/centos-9.csv @@ -83,7 +83,7 @@ opfor pc pc2 pmc,java-17-openjdk -pstbs,GConf2 +ps,GConf2 pvkii pvr,libcxx pz,java-11-openjdk rng-tools diff --git a/lgsm/data/debian-10.csv b/lgsm/data/debian-10.csv index fd29e6da32..d2602643f9 100644 --- a/lgsm/data/debian-10.csv +++ b/lgsm/data/debian-10.csv @@ -83,7 +83,7 @@ opfor pc pc2 pmc,openjdk-11-jre -pstbs,libgconf-2-4 +ps,libgconf-2-4 pvkii pvr,libc++1 pz,openjdk-11-jre,rng-tools diff --git a/lgsm/data/debian-11.csv b/lgsm/data/debian-11.csv index 6f34e2832e..16c6e6b811 100644 --- a/lgsm/data/debian-11.csv +++ b/lgsm/data/debian-11.csv @@ -83,7 +83,7 @@ opfor pc pc2 pmc,openjdk-17-jre -pstbs,libgconf-2-4 +ps,libgconf-2-4 pvkii pvr,libc++1 pz,openjdk-17-jre,rng-tools diff --git a/lgsm/data/debian-12.csv b/lgsm/data/debian-12.csv index 3738c4749e..04ff25b7af 100644 --- a/lgsm/data/debian-12.csv +++ b/lgsm/data/debian-12.csv @@ -83,7 +83,7 @@ opfor pc pc2 pmc,openjdk-17-jre -pstbs,libgconf-2-4 +ps,libgconf-2-4 pvkii pvr,libc++1 pz,openjdk-17-jre,rng-tools5 diff --git a/lgsm/data/debian-9.csv b/lgsm/data/debian-9.csv index 794a54afe1..e3143955f8 100644 --- a/lgsm/data/debian-9.csv +++ b/lgsm/data/debian-9.csv @@ -83,7 +83,7 @@ opfor pc pc2 pmc,openjdk-8-jre -pstbs,libgconf-2-4 +ps,libgconf-2-4 pvkii pvr,libc++1 pz,openjdk-8-jre,rng-tools diff --git a/lgsm/data/rhel-7.csv b/lgsm/data/rhel-7.csv index 1b0b8c1bd7..ac272c9171 100644 --- a/lgsm/data/rhel-7.csv +++ b/lgsm/data/rhel-7.csv @@ -83,7 +83,7 @@ opfor pc pc2 pmc,java-11-openjdk -pstbs,GConf2 +ps,GConf2 pvkii pvr,libcxx pz,java-11-openjdk rng-tools diff --git a/lgsm/data/rhel-8.csv b/lgsm/data/rhel-8.csv index 78ee5945d2..ac4b7c36f2 100644 --- a/lgsm/data/rhel-8.csv +++ b/lgsm/data/rhel-8.csv @@ -83,7 +83,7 @@ opfor pc pc2 pmc,java-17-openjdk -pstbs,GConf2 +ps,GConf2 pvkii pvr,libcxx pz,java-11-openjdk rng-tools diff --git a/lgsm/data/rhel-9.csv b/lgsm/data/rhel-9.csv index b341b72821..124322b62e 100644 --- a/lgsm/data/rhel-9.csv +++ b/lgsm/data/rhel-9.csv @@ -83,7 +83,7 @@ opfor pc pc2 pmc,java-17-openjdk -pstbs,GConf2 +ps,GConf2 pvkii pvr,libcxx pz,java-11-openjdk rng-tools diff --git a/lgsm/data/rocky-8.csv b/lgsm/data/rocky-8.csv index 78ee5945d2..ac4b7c36f2 100644 --- a/lgsm/data/rocky-8.csv +++ b/lgsm/data/rocky-8.csv @@ -83,7 +83,7 @@ opfor pc pc2 pmc,java-17-openjdk -pstbs,GConf2 +ps,GConf2 pvkii pvr,libcxx pz,java-11-openjdk rng-tools diff --git a/lgsm/data/rocky-9.csv b/lgsm/data/rocky-9.csv index b341b72821..124322b62e 100644 --- a/lgsm/data/rocky-9.csv +++ b/lgsm/data/rocky-9.csv @@ -83,7 +83,7 @@ opfor pc pc2 pmc,java-17-openjdk -pstbs,GConf2 +ps,GConf2 pvkii pvr,libcxx pz,java-11-openjdk rng-tools diff --git a/lgsm/data/serverlist.csv b/lgsm/data/serverlist.csv index 8c3d7cf616..7872048c7b 100644 --- a/lgsm/data/serverlist.csv +++ b/lgsm/data/serverlist.csv @@ -82,7 +82,7 @@ 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 +ps,psserver,Post Scriptum,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 diff --git a/lgsm/data/ubuntu-16.04.csv b/lgsm/data/ubuntu-16.04.csv index 0fac4905f1..51b2d929ac 100644 --- a/lgsm/data/ubuntu-16.04.csv +++ b/lgsm/data/ubuntu-16.04.csv @@ -83,7 +83,7 @@ opfor pc pc2 pmc,openjdk-8-jre -pstbs,libgconf-2-4 +ps,libgconf-2-4 pvkii pvr,libc++1 pz,openjdk-8-jre,rng-tools diff --git a/lgsm/data/ubuntu-18.04.csv b/lgsm/data/ubuntu-18.04.csv index fd29e6da32..d2602643f9 100644 --- a/lgsm/data/ubuntu-18.04.csv +++ b/lgsm/data/ubuntu-18.04.csv @@ -83,7 +83,7 @@ opfor pc pc2 pmc,openjdk-11-jre -pstbs,libgconf-2-4 +ps,libgconf-2-4 pvkii pvr,libc++1 pz,openjdk-11-jre,rng-tools diff --git a/lgsm/data/ubuntu-20.04.csv b/lgsm/data/ubuntu-20.04.csv index a51acccd03..8eadea652e 100644 --- a/lgsm/data/ubuntu-20.04.csv +++ b/lgsm/data/ubuntu-20.04.csv @@ -83,7 +83,7 @@ opfor pc pc2 pmc,openjdk-17-jre -pstbs,libgconf-2-4 +ps,libgconf-2-4 pvkii pvr,libc++1 pz,openjdk-17-jre,rng-tools diff --git a/lgsm/data/ubuntu-22.04.csv b/lgsm/data/ubuntu-22.04.csv index 7f417b4634..463a819aeb 100644 --- a/lgsm/data/ubuntu-22.04.csv +++ b/lgsm/data/ubuntu-22.04.csv @@ -83,7 +83,7 @@ opfor pc pc2 pmc,openjdk-17-jre -pstbs,libgconf-2-4 +ps,libgconf-2-4 pvkii pvr,libc++1 pz,openjdk-17-jre,rng-tools5 diff --git a/lgsm/data/ubuntu-23.04.csv b/lgsm/data/ubuntu-23.04.csv index 7f417b4634..463a819aeb 100644 --- a/lgsm/data/ubuntu-23.04.csv +++ b/lgsm/data/ubuntu-23.04.csv @@ -83,7 +83,7 @@ opfor pc pc2 pmc,openjdk-17-jre -pstbs,libgconf-2-4 +ps,libgconf-2-4 pvkii pvr,libc++1 pz,openjdk-17-jre,rng-tools5 diff --git a/lgsm/modules/check_system_requirements.sh b/lgsm/modules/check_system_requirements.sh index 114292f462..88fb9d15af 100644 --- a/lgsm/modules/check_system_requirements.sh +++ b/lgsm/modules/check_system_requirements.sh @@ -29,7 +29,7 @@ elif [ "${shortname}" == "rust" ]; then elif [ "${shortname}" == "mc" ] || [ "${shortname}" == "pmc" ] || [ "${shortname}" == "wmc" ]; then ramrequirementmb="1000" ramrequirementgb="1" -elif [ "${shortname}" == "pstbs" ]; then +elif [ "${shortname}" == "ps" ]; then ramrequirementmb="2000" ramrequirementgb="2" elif [ "${shortname}" == "ns2" ] || [ "${shortname}" == "ns2c" ]; then diff --git a/lgsm/modules/info_game.sh b/lgsm/modules/info_game.sh index dbce9e2030..5c0867029c 100644 --- a/lgsm/modules/info_game.sh +++ b/lgsm/modules/info_game.sh @@ -567,7 +567,7 @@ fn_info_game_mh() { # Comment: ; or # # Example: ServerName="SERVERNAME" # Filetype: cfg -fn_info_game_pstbs() { +fn_info_game_ps() { if [ -f "${servercfgfullpath}" ]; then fn_info_game_ini "servername" "ServerName" fn_info_game_ini "maxplayers" "MaxPlayers" @@ -2312,8 +2312,8 @@ 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}" == "ps" ]; then + fn_info_game_ps elif [ "${shortname}" == "pvr" ]; then fn_info_game_pvr elif [ "${shortname}" == "pz" ]; then diff --git a/lgsm/modules/info_messages.sh b/lgsm/modules/info_messages.sh index 22319cdbd8..6d8b849c53 100644 --- a/lgsm/modules/info_messages.sh +++ b/lgsm/modules/info_messages.sh @@ -1252,7 +1252,7 @@ fn_info_message_pc2() { } | column -s $'\t' -t } -fn_info_message_pstbs() { +fn_info_message_ps() { { fn_port "header" fn_port "Game" port udp @@ -1777,8 +1777,8 @@ fn_info_message_select_engine() { fn_info_message_pc elif [ "${shortname}" == "pc2" ]; then fn_info_message_pc2 - elif [ "${shortname}" == "pstbs" ]; then - fn_info_message_pstbs + elif [ "${shortname}" == "ps" ]; then + fn_info_message_ps elif [ "${shortname}" == "pvr" ]; then fn_info_message_pvr elif [ "${shortname}" == "pz" ]; then From 8cd16acfd07378791fdb79686c78d95e6d9232d0 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Wed, 6 Sep 2023 22:01:09 +0100 Subject: [PATCH 154/181] fix: make pgrep unique - Refactored the code to use `pgrep -fcx` instead of `pgrep -fc` for checking process counts. - Updated print statements to provide more informative messages. - Renamed some variables for clarity. - Added newlines after printing information. --- lgsm/modules/command_monitor.sh | 68 ++++++++++++++++----------------- 1 file changed, 34 insertions(+), 34 deletions(-) diff --git a/lgsm/modules/command_monitor.sh b/lgsm/modules/command_monitor.sh index c64df9fda8..3c929fb208 100644 --- a/lgsm/modules/command_monitor.sh +++ b/lgsm/modules/command_monitor.sh @@ -26,69 +26,69 @@ fn_monitor_check_monitoring() { } fn_monitor_check_install() { - if [ "$(pgrep -fc -u "${USER}" "${selfname} install")" != "0" ] || [ "$(pgrep -fc -u "${USER}" "${selfname} i")" != "0" ] || [ "$(pgrep -fc -u "${USER}" "${selfname} auto-install")" != "0" ] || [ "$(pgrep -fc -u "${USER}" "${selfname} ai")" != "0" ]; then + if [ "$(pgrep -fc -u "${USER}" "/bin/bash ./${selfname} install")" != "0" ] || [ "$(pgrep -fcx -u "${USER}" "/bin/bash ./${selfname} i")" != "0" ] || [ "$(pgrep -fcx -u "${USER}" "/bin/bash ./${selfname} auto-install")" != "0" ] || [ "$(pgrep -fcx -u "${USER}" "/bin/bash ./${selfname} ai")" != "0" ]; then fn_print_dots "Checking installer: " fn_print_checking_eol fn_script_log_info "Checking installer: CHECKING" - fn_print_info "Checking installer: Installer is : " - fn_print_info_eol + fn_print_info "Checking installer: LinuxGSM is installing: " + fn_print_info_eol_nl fn_script_log_pass "Checking installer: LinuxGSM is installing" core_exit.sh fi } fn_monitor_check_debug() { - if [ "$(pgrep -fc -u "${USER}" "${selfname} debug")" != "0" ] || [ "$(pgrep -fc -u "${USER}" "${selfname} d")" != "0" ]; then + if [ "$(pgrep -fcx -u "${USER}" "/bin/bash ./${selfname} debug")" != "0" ] || [ "$(pgrep -fcx -u "${USER}" "/bin/bash ./${selfname} d")" != "0" ]; then fn_print_dots "Checking debug: " fn_print_checking_eol fn_print_info "Checking debug: Debug is running: " - fn_print_info_eol + fn_print_info_eol_nl fn_script_log_pass "Checking debug: Debug is running" core_exit.sh fi } -fn_monitor_check_starting(){ +fn_monitor_check_starting() { # Remove stale lockfile. if [ -f "${lockdir}/${selfname}-starting.lock" ]; then if [ "$(find "${lockdir}/${selfname}-starting.lock" -mmin +5)" ]; then fn_print_dots "Checking start: " fn_print_checking_eol fn_print_warn "Checking start: Removing stale lockfile: " - fn_print_warn_eol + fn_print_warn_eol_nl fn_script_log_warn "Checking start: Removing stale lockfile" rm -f "${lockdir:?}/${selfname}-starting.lock" fi fi - if [ -f "${lockdir}/${selfname}-starting.lock" ] && [[ "$(pgrep -fc -u "${USER}" "${selfname} start")" != "0" || "$(pgrep -fc -u "${USER}" "${selfname} s")" != "0" ]]; then + if [ -f "${lockdir}/${selfname}-starting.lock" ] && [[ "$(pgrep -fcx -u "${USER}" "/bin/bash ./${selfname} start")" != "0" || "$(pgrep -fcx -u "${USER}" "/bin/bash ./${selfname} s")" != "0" ]]; then fn_print_dots "Checking start: " fn_print_checking_eol fn_print_info "Checking start: LinuxGSM is starting: " - fn_print_info_eol + fn_print_info_eol_nl fn_script_log_info "Checking backup: LinuxGSM is starting" core_exit.sh fi } -fn_monitor_check_stopping(){ +fn_monitor_check_stopping() { # Remove stale lockfile. if [ -f "${lockdir}/${selfname}-stopping.lock" ]; then if [ "$(find "${lockdir}/${selfname}-stopping.lock" -mmin +5)" ]; then fn_print_dots "Checking stop: " fn_print_checking_eol fn_print_warn "Checking stop: Removing stale lockfile: " - fn_print_warn_eol + fn_print_warn_eol_nl fn_script_log_warn "Checking stop: Removing stale lockfile" rm -f "${lockdir:?}/${selfname}-stopping.lock" fi fi - if [ -f "${lockdir}/${selfname}-stopping.lock" ] && [[ "$(pgrep -fc -u "${USER}" "${selfname} stop")" != "0" || "$(pgrep -fc -u "${USER}" "${selfname} s")" != "0" ]]; then + if [ -f "${lockdir}/${selfname}-stopping.lock" ] && [[ "$(pgrep -fcx -u "${USER}" "/bin/bash ./${selfname} stop")" != "0" || "$(pgrep -fcx -u "${USER}" "/bin/bash ./${selfname} s")" != "0" ]]; then fn_print_dots "Checking stop: " fn_print_checking_eol fn_print_info "Checking stop: LinuxGSM is stopping: " - fn_print_info_eol + fn_print_info_eol_nl fn_script_log_info "Checking backup: LinuxGSM is stopping" core_exit.sh fi @@ -107,11 +107,11 @@ fn_monitor_check_backup() { fi fi - if [ -f "${lockdir}/backup.lock" ] && [[ "$(pgrep -fc -u "${USER}" "${selfname} backup")" != "0" || "$(pgrep -fc -u "${USER}" "${selfname} b")" != "0" ]]; then + if [ -f "${lockdir}/backup.lock" ] && [[ "$(pgrep -fcx -u "${USER}" "/bin/bash ./${selfname} backup")" != "0" || "$(pgrep -fcx -u "${USER}" "/bin/bash ./${selfname} b")" != "0" ]]; then fn_print_dots "Checking backup: " fn_print_checking_eol fn_print_info "Checking backup: Backup is running: " - fn_print_info_eol + fn_print_info_eol_nl fn_script_log_info "Checking backup: Backup is running" core_exit.sh fi @@ -124,38 +124,38 @@ fn_monitor_check_update() { fn_print_dots "Checking update: " fn_print_checking_eol fn_print_warn "Checking update: Removing stale lockfile: " - fn_print_warn_eol + fn_print_warn_eol_nl fn_script_log_warn "Checking update: Removing stale lockfile" rm -f "${lockdir:?}/update.lock" fi fi - if [ -f "${lockdir}/update.lock" ] && [[ "$(pgrep -fc -u "${USER}" "${selfname} update")" != "0" || "$(pgrep -fc -u "${USER}" "${selfname} validate")" != "0" || "$(pgrep -fc -u "${USER}" "${selfname} v")" != "0" || "$(pgrep -fc force-update "${USER}" "${selfname} fu")" != "0" ]]; then + if [ -f "${lockdir}/update.lock" ] && [[ "$(pgrep -fcx -u "${USER}" "/bin/bash ./${selfname} update")" != "0" || "$(pgrep -fcx -u "${USER}" "/bin/bash ./${selfname} validate")" != "0" || "$(pgrep -fcx -u "${USER}" "/bin/bash ./${selfname} v")" != "0" || "$(pgrep -fc force-update "${USER}" "/bin/bash ./${selfname} fu")" != "0" ]]; then fn_print_dots "Checking update: " fn_print_checking_eol fn_print_info "Checking update: LinuxGSM is updating the game server: " - fn_print_info_eol + fn_print_info_eol_nl fn_script_log_pass "Checking update: LinuxGSM is updating the game server" core_exit.sh fi } # Source engine games may display a messages to indicate the server needs restarting. -fn_monitor_check_update_source(){ - if [ -f "${consolelogdir}/${selfname}-console.log" ] && [ "${engine}" == "source" ]; then - if grep -q "Your server needs to be restarted in order to receive the latest update." "${consolelogdir}/${selfname}-console.log"; then - fn_print_dots "Checking update: " - fn_print_checking_eol - fn_script_log_info "Checking update: CHECKING" - fn_print_ok "Checking update: " - fn_print_ok_eol_nl - fn_script_log_info "Checking update: Monitor is restarting ${selfname} to apply update" - alert="restart" - alert.sh - command_restart.sh - core_exit.sh - fi - fi +fn_monitor_check_update_source() { + if [ -f "${consolelogdir}/${selfname}-console.log" ] && [ "${engine}" == "source" ]; then + if grep -q "Your server needs to be restarted in order to receive the latest update." "${consolelogdir}/${selfname}-console.log"; then + fn_print_dots "Checking update: " + fn_print_checking_eol + fn_script_log_info "Checking update: CHECKING" + fn_print_ok "Checking update: " + fn_print_ok_eol_nl + fn_script_log_info "Checking update: Monitor is restarting ${selfname} to apply update" + alert="restart" + alert.sh + command_restart.sh + core_exit.sh + fi + fi } fn_monitor_check_session() { @@ -166,7 +166,7 @@ fn_monitor_check_session() { sessionwidth="80" sessionheight="23" # Check for PIDS with identical tmux sessions running. - if [ "$(pgrep -fc "tmux -L ${socketname} new-session -d -x ${sessionwidth} -y ${sessionheight} -s ${sessionname}")" -ge "2" ]; then + if [ "$(pgrep -fcx "tmux -L ${socketname} new-session -d -x ${sessionwidth} -y ${sessionheight} -s ${sessionname}")" -ge "2" ]; then fn_print_error "Checking session: " fn_print_error_eol_nl fn_script_log_error "Checking session: ERROR" From ca184e32e3e0ddffae40da6bbf48637ac9a39c2d Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Thu, 7 Sep 2023 21:23:31 +0100 Subject: [PATCH 155/181] fix(monitor): migration code --- lgsm/modules/command_monitor.sh | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/lgsm/modules/command_monitor.sh b/lgsm/modules/command_monitor.sh index 3c929fb208..192897bfd2 100644 --- a/lgsm/modules/command_monitor.sh +++ b/lgsm/modules/command_monitor.sh @@ -12,8 +12,12 @@ moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_firstcommand_set fn_monitor_check_monitoring() { - # Monitor does not run if lockfile is not found. - if [ ! -f "${lockdir}/${selfname}-monitoring.lock" ]; then + if [ -f "${lockdir}/${selfname}.lock" ]; then + # Part of migration to v23.5.0. #4296 + rm -f "${lockdir:?}/${selfname}.lock" + date '+%s' > "${lockdir:?}/${selfname}-monitoring.lock" + elif [ ! -f "${lockdir}/${selfname}-monitoring.lock" ]; then + # Monitor does not run if lockfile is not found. fn_print_dots "Checking lockfile: " fn_print_checking_eol fn_script_log_info "Checking lockfile: CHECKING" @@ -167,7 +171,7 @@ fn_monitor_check_session() { sessionheight="23" # Check for PIDS with identical tmux sessions running. if [ "$(pgrep -fcx "tmux -L ${socketname} new-session -d -x ${sessionwidth} -y ${sessionheight} -s ${sessionname}")" -ge "2" ]; then - fn_print_error "Checking session: " + fn_print_error "Checking session: There are PIDS with identical tmux sessions running: " fn_print_error_eol_nl fn_script_log_error "Checking session: ERROR" fn_script_log_error "Checking session: There are PIDS with identical tmux sessions running" @@ -177,7 +181,7 @@ fn_monitor_check_session() { core_exit.sh # Check for tmux pids with the same tmux session and socket names. This will reduce issues with migration to release v23.5.0. #4296 elif [ "$(pgrep -fc -u "${USER}" "tmux -L ${sessionname} new-session -d -x ${sessionwidth} -y ${sessionheight} -s ${sessionname}")" != "0" ]; then - fn_print_error "Checking session: " + fn_print_error "Checking session: PIDS with the same tmux session and socket names are running: " fn_print_error_eol_nl fn_script_log_error "Checking session: ERROR" fn_script_log_error "Checking session: PIDS with the same tmux session and socket names are running" From fe610f3ec96a17dce287129a34add47851ae04c8 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Thu, 7 Sep 2023 21:25:20 +0100 Subject: [PATCH 156/181] feat(inss): enable master server checking --- lgsm/config-default/config-lgsm/inssserver/_default.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lgsm/config-default/config-lgsm/inssserver/_default.cfg b/lgsm/config-default/config-lgsm/inssserver/_default.cfg index 820058ada1..076b61ecbb 100644 --- a/lgsm/config-default/config-lgsm/inssserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/inssserver/_default.cfg @@ -132,7 +132,7 @@ steamcmdforcewindows="no" branch="" betapassword="" # Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server -steammaster="false" +steammaster="true" ## Stop Mode | https://docs.linuxgsm.com/features/stop-mode # 1: tmux kill From 16c4493d1d63817ad12dd9f7741b80dca8e975a7 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Thu, 7 Sep 2023 22:43:59 +0100 Subject: [PATCH 157/181] fix(monitor): migration code --- lgsm/modules/alert.sh | 11 +++++++++++ lgsm/modules/command_monitor.sh | 13 ++++++++++--- 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/lgsm/modules/alert.sh b/lgsm/modules/alert.sh index c7ed897f92..03d672a661 100644 --- a/lgsm/modules/alert.sh +++ b/lgsm/modules/alert.sh @@ -72,6 +72,15 @@ fn_alert_check_update() { alertbody="${gamename} update available: ${remotebuildversion}" } +fn_alert_update_restart() { + fn_script_log_info "Sending alert: Restarted" + alertsubject="Alert - ${selfname} - Restarted" + alertemoji="🎮" + alertsound="1" + alerturl="not enabled" + alertbody="${gamename} received update: ${remotebuildversion} and required restarting" +} + fn_alert_permissions() { fn_script_log_info "Sending alert: Permissions error" alertsubject="Alert - ${selfname}: Permissions error" @@ -102,6 +111,8 @@ elif [ "${alert}" == "update" ]; then fn_alert_update elif [ "${alert}" == "check-update" ]; then fn_alert_check_update +elif [ "${alert}" == "update-restart" ]; then + fn_alert_update_restart elif [ "${alert}" == "config" ]; then fn_alert_config fi diff --git a/lgsm/modules/command_monitor.sh b/lgsm/modules/command_monitor.sh index 192897bfd2..b1d9b5f6db 100644 --- a/lgsm/modules/command_monitor.sh +++ b/lgsm/modules/command_monitor.sh @@ -154,7 +154,7 @@ fn_monitor_check_update_source() { fn_print_ok "Checking update: " fn_print_ok_eol_nl fn_script_log_info "Checking update: Monitor is restarting ${selfname} to apply update" - alert="restart" + alert="update-restart" alert.sh command_restart.sh core_exit.sh @@ -177,7 +177,6 @@ fn_monitor_check_session() { fn_script_log_error "Checking session: There are PIDS with identical tmux sessions running" fn_script_log_error "Checking session: Killing all tmux sessions with the socketname name ${socketname} and session name ${sessionname}" pkill -f "tmux -L ${socketname} new-session -d -x ${sessionwidth} -y ${sessionheight} -s ${sessionname}" - command_restart.sh core_exit.sh # Check for tmux pids with the same tmux session and socket names. This will reduce issues with migration to release v23.5.0. #4296 elif [ "$(pgrep -fc -u "${USER}" "tmux -L ${sessionname} new-session -d -x ${sessionwidth} -y ${sessionheight} -s ${sessionname}")" != "0" ]; then @@ -187,7 +186,15 @@ fn_monitor_check_session() { fn_script_log_error "Checking session: PIDS with the same tmux session and socket names are running" fn_script_log_error "Checking session: Killing session with the socketname name ${sessionname} and session name ${sessionname}" pkill -f "tmux -L ${sessionname} new-session -d -x ${sessionwidth} -y ${sessionheight} -s ${sessionname}" - command_restart.sh + core_exit.sh + # Check for tmux pids that are using the old type of tmux session. This will reduce issues with migration to release v23.5.0. #4296 + elif [ "$(pgrep -fc -u "${USER}" "tmux new-session -d -x ${sessionwidth} -y ${sessionheight} -s ${sessionname}")" != "0" ]; then + fn_print_error "Checking session: PIDS with old type tmux session are running: " + fn_print_error_eol_nl + fn_script_log_error "Checking session: ERROR" + fn_script_log_error "Checking session: PIDS with old type tmux session are running" + fn_script_log_error "Checking session: Killing session with the session name ${sessionname}" + pkill -f "tmux new-session -d -x ${sessionwidth} -y ${sessionheight} -s ${sessionname}" core_exit.sh elif [ "${status}" != "0" ]; then fn_print_ok "Checking session: " From 8f714822fecdbff9907482612eec7238be73a26d Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Thu, 7 Sep 2023 23:12:53 +0100 Subject: [PATCH 158/181] feat(ci): game server update checker (#4298) * refactor: shorten module update function names The commit renames the update functions for several game modules to shorter names. The new names are more concise and easier to remember, which should improve code readability and maintainability. * feat: Add Update Check workflow This commit adds a new GitHub Actions workflow that checks if LinuxGSM is picking up game server config and parameter variables. The workflow runs on push and manual triggers, with concurrency settings to cancel in-progress jobs. It downloads linuxgsm.sh, installs dependencies, grabs the server, enables developer mode, installs the server, and updates it. * feat: Add concurrency group names to workflows The `details-check.yml` and `update-check.yml` workflows now have a concurrency group name that includes the branch or tag name. This will allow for better management of concurrent workflow runs. * refactor: Update script names for Minecraft, Factorio, Jedi Knight 2 and Vintage Story This commit updates the script names for Minecraft, Factorio, Jedi Knight 2 and Vintage Story. The update includes changes to command_check_update.sh, command_update.sh, core_functions.sh and install_server_files.sh. The new script names are update_mc.sh (formerly update_minecraft.sh), update_fctr.sh (formerly update_factorio.sh), update_jk2.sh (formerly update_jediknight2.sh) and update_vints.sh (formerly update_vintagestory.sh). * feat: Add support for 32-bit architecture This commit adds support for 32-bit architecture by running the command "sudo dpkg --add-architecture i386" instead of installing libxml2-utils and jq. * feat: Add i386 architecture and install libstdc++6 This commit adds the installation of libstdc++6:i386 package to support 32-bit applications. It also includes adding the i386 architecture to dpkg. * feat: Update dependencies for LinuxGSM Changed the dependency from libstdc++6:i386 to libgcc-s1:i386 in the update-check.yml file. This change was made to ensure compatibility with newer versions of LinuxGSM. * feat: Add update and force-update server functionality This commit adds the ability to check for updates and force updates on a server. The update-check.yml file has been modified to include new jobs that run the LGSM_GITHUBBRANCH command with specific arguments. * feat: Add dependencies for server installation This commit adds the necessary dependencies to install a game server. The `update-check.yml` file has been updated to include the installation of `bsdmainutils`, `libsdl2-2.0-0:i386`, `libtinfo5:i386`, and `steamcmd`. * steamcmd only * steamcmd * test * test * refactor: improve random password generation in install_config.sh The code change refactors the random password generation in the `install_config.sh` file. Instead of using `tr -dc A-Za-z0-9_ < /dev/urandom | head -c 8 | xargs`, it now uses `tr -dc 'A-Za-z0-9_' < /dev/urandom 2>/dev/null | head -c 8 | xargs`. This change improves the reliability and security of generating random passwords. * refactor: remove redundant code and set default branch The commit refactors the code by removing redundant code that sets the branch to "public" if no custom branch is specified. This change simplifies the logic and improves readability. * test * fix: fix steamcmd build version retrieval The code changes in this commit fix an issue with retrieving the build version from SteamCMD. The previous implementation was not correctly capturing the buildid. This has been resolved by adding additional echo statements for debugging purposes. * test fix: remove unnecessary app_info_print command The commit removes the unnecessary `app_info_print` command from the code. This command was not needed to check the buildid. * fix: GitHub Actions test failure The code change fixes a failing GitHub Actions test by running SteamCMD twice. The first run is to update the app info, and the second run retrieves the build ID for the specified branch. * Add steam user and password secret for jk2 * refactor: update steamuser and steampass paths in jk2server config The code changes refactor the paths for `steamuser` and `steampass` in the configuration file of the `jk2server`. The previous paths were incorrect, so they have been updated to point to the correct location. * refactor: update steamuser and steampass insertion in LGSM configuration The code changes refactor the way steamuser and steampass are inserted into the LGSM configuration file. Instead of hardcoding the values, they are now dynamically inserted using environment variables. This improves flexibility and security when setting up the server. * refactor: simplify steamuser and steampass insertion in update-check.yml The code changes remove unnecessary sed commands and replace them with a single echo command to insert the values of STEAMCMD_USER and STEAMCMD_PASS into the common.cfg file. This simplifies the code and improves readability. * feat: update steamuser and steampass in common.cfg The commit updates the code to properly insert the `steamuser` and `steampass` values in the `common.cfg` file. The previous code was not correctly formatting the values, which caused issues with server installation. This change ensures that the values are properly formatted using double quotes for `steamuser` and single quotes for `steampass`. --- .github/workflows/details-check.yml | 2 +- .github/workflows/update-check.yml | 48 +++++++++++++++++++ lgsm/modules/command_check_update.sh | 12 ++--- lgsm/modules/command_update.sh | 12 ++--- lgsm/modules/core_functions.sh | 12 ++--- lgsm/modules/core_modules.sh | 12 ++--- lgsm/modules/core_steamcmd.sh | 12 +++-- lgsm/modules/install_config.sh | 2 +- lgsm/modules/install_server_files.sh | 14 +++--- .../{update_factorio.sh => update_fctr.sh} | 2 +- .../{update_jediknight2.sh => update_jk2.sh} | 0 .../{update_minecraft.sh => update_mc.sh} | 2 +- ...ate_minecraft_bedrock.sh => update_mcb.sh} | 2 +- .../{update_papermc.sh => update_pmc.sh} | 2 +- ...update_vintagestory.sh => update_vints.sh} | 2 +- 15 files changed, 93 insertions(+), 43 deletions(-) create mode 100644 .github/workflows/update-check.yml rename lgsm/modules/{update_factorio.sh => update_fctr.sh} (99%) rename lgsm/modules/{update_jediknight2.sh => update_jk2.sh} (100%) rename lgsm/modules/{update_minecraft.sh => update_mc.sh} (99%) rename lgsm/modules/{update_minecraft_bedrock.sh => update_mcb.sh} (99%) rename lgsm/modules/{update_papermc.sh => update_pmc.sh} (99%) rename lgsm/modules/{update_vintagestory.sh => update_vints.sh} (99%) diff --git a/.github/workflows/details-check.yml b/.github/workflows/details-check.yml index 1ce9b373bb..c2e60ddf63 100644 --- a/.github/workflows/details-check.yml +++ b/.github/workflows/details-check.yml @@ -5,7 +5,7 @@ on: push: concurrency: - group: ${{ github.ref_name }} + group: details-check-${{ github.ref_name }} cancel-in-progress: true jobs: diff --git a/.github/workflows/update-check.yml b/.github/workflows/update-check.yml new file mode 100644 index 0000000000..dfbc7dd580 --- /dev/null +++ b/.github/workflows/update-check.yml @@ -0,0 +1,48 @@ +name: Update Check +# This action will check that LinuxGSM is picking up game server config and parameter variables. +on: + workflow_dispatch: + push: + +concurrency: + group: update-check-${{ github.ref_name }} + cancel-in-progress: true + +jobs: + update-check: + continue-on-error: true + runs-on: ubuntu-latest + + strategy: + matrix: + shortname: [css, fctr, jk2, mc, mcb, mta, pmc, ts3, ut99, vints] + + steps: + - name: Download linuxgsm.sh + run: wget https://raw.githubusercontent.com/GameServerManagers/LinuxGSM/${GITHUB_REF#refs/heads/}/linuxgsm.sh; chmod +x linuxgsm.sh + + - name: Install dependencies + run: sudo dpkg --add-architecture i386; sudo apt-get update; + + - name: Grab server + run: LGSM_GITHUBBRANCH="${GITHUB_REF#refs/heads/}" ./linuxgsm.sh ${{ matrix.shortname }}server + + - name: Enable developer mode + run: LGSM_GITHUBBRANCH="${GITHUB_REF#refs/heads/}" ./${{ matrix.shortname }}server developer + + - name: Insert steamuser + if: matrix.shortname == 'jk2' + run: echo -e "steamuser=\"${{ secrets.STEAMCMD_USER }}\"\nsteampass='${{ secrets.STEAMCMD_PASS }}'" > lgsm/config-lgsm/${{ matrix.shortname }}server/common.cfg + + - name: Install server + run: LGSM_GITHUBBRANCH="${GITHUB_REF#refs/heads/}" ./${{ matrix.shortname }}server auto-install + + - name: Check Update server + run: LGSM_GITHUBBRANCH="${GITHUB_REF#refs/heads/}" ./${{ matrix.shortname }}server check-update + + - name: Update server + run: LGSM_GITHUBBRANCH="${GITHUB_REF#refs/heads/}" ./${{ matrix.shortname }}server update + + - name: Force Update server + if: matrix.shortname == 'css' + run: LGSM_GITHUBBRANCH="${GITHUB_REF#refs/heads/}" ./${{ matrix.shortname }}server force-update diff --git a/lgsm/modules/command_check_update.sh b/lgsm/modules/command_check_update.sh index c7780c3557..2e6855f7cb 100644 --- a/lgsm/modules/command_check_update.sh +++ b/lgsm/modules/command_check_update.sh @@ -17,19 +17,19 @@ core_logs.sh if [ "${shortname}" == "ts3" ]; then update_ts3.sh elif [ "${shortname}" == "mc" ]; then - update_minecraft.sh + update_mc.sh elif [ "${shortname}" == "mcb" ]; then - update_minecraft_bedrock.sh + update_mcb.sh elif [ "${shortname}" == "pmc" ] || [ "${shortname}" == "vpmc" ] || [ "${shortname}" == "wmc" ]; then - update_papermc.sh + update_pmc.sh elif [ "${shortname}" == "fctr" ]; then - update_factorio.sh + update_fctr.sh elif [ "${shortname}" == "mta" ]; then update_mta.sh elif [ "${shortname}" == "jk2" ]; then - update_jediknight2.sh + update_jk2.sh elif [ "${shortname}" == "vints" ]; then - update_vintagestory.sh + update_vints.sh elif [ "${shortname}" == "ut99" ]; then update_ut99.sh else diff --git a/lgsm/modules/command_update.sh b/lgsm/modules/command_update.sh index 62221d5e6f..e1fcec97fe 100644 --- a/lgsm/modules/command_update.sh +++ b/lgsm/modules/command_update.sh @@ -18,19 +18,19 @@ check_last_update.sh if [ "${shortname}" == "ts3" ]; then update_ts3.sh elif [ "${shortname}" == "mc" ]; then - update_minecraft.sh + update_mc.sh elif [ "${shortname}" == "mcb" ]; then - update_minecraft_bedrock.sh + update_mcb.sh elif [ "${shortname}" == "pmc" ] || [ "${shortname}" == "vpmc" ] || [ "${shortname}" == "wmc" ]; then - update_papermc.sh + update_pmc.sh elif [ "${shortname}" == "fctr" ]; then - update_factorio.sh + update_fctr.sh elif [ "${shortname}" == "mta" ]; then update_mta.sh elif [ "${shortname}" == "jk2" ]; then - update_jediknight2.sh + update_jk2.sh elif [ "${shortname}" == "vints" ]; then - update_vintagestory.sh + update_vints.sh elif [ "${shortname}" == "ut99" ]; then update_ut99.sh else diff --git a/lgsm/modules/core_functions.sh b/lgsm/modules/core_functions.sh index 3b42e1f8f1..356aa4d93e 100644 --- a/lgsm/modules/core_functions.sh +++ b/lgsm/modules/core_functions.sh @@ -640,17 +640,17 @@ update_ts3.sh() { fn_fetch_function } -update_minecraft.sh() { +update_mc.sh() { functionfile="${FUNCNAME[0]}" fn_fetch_function } -update_minecraft_bedrock.sh() { +update_mcb.sh() { functionfile="${FUNCNAME[0]}" fn_fetch_function } -update_papermc.sh() { +update_pmc.sh() { functionfile="${FUNCNAME[0]}" fn_fetch_function } @@ -660,12 +660,12 @@ update_mta.sh() { fn_fetch_function } -update_factorio.sh() { +update_fctr.sh() { functionfile="${FUNCNAME[0]}" fn_fetch_function } -update_jediknight2.sh() { +update_jk2.sh() { functionfile="${FUNCNAME[0]}" fn_fetch_function } @@ -675,7 +675,7 @@ update_steamcmd.sh() { fn_fetch_function } -update_vintagestory.sh() { +update_vints.sh() { functionfile="${FUNCNAME[0]}" fn_fetch_function } diff --git a/lgsm/modules/core_modules.sh b/lgsm/modules/core_modules.sh index b191e793a3..80b3463e3f 100644 --- a/lgsm/modules/core_modules.sh +++ b/lgsm/modules/core_modules.sh @@ -645,17 +645,17 @@ update_ts3.sh() { fn_fetch_module } -update_minecraft.sh() { +update_mc.sh() { modulefile="${FUNCNAME[0]}" fn_fetch_module } -update_minecraft_bedrock.sh() { +update_mcb.sh() { modulefile="${FUNCNAME[0]}" fn_fetch_module } -update_papermc.sh() { +update_pmc.sh() { modulefile="${FUNCNAME[0]}" fn_fetch_module } @@ -665,12 +665,12 @@ update_mta.sh() { fn_fetch_module } -update_factorio.sh() { +update_fctr.sh() { modulefile="${FUNCNAME[0]}" fn_fetch_module } -update_jediknight2.sh() { +update_jk2.sh() { modulefile="${FUNCNAME[0]}" fn_fetch_module } @@ -680,7 +680,7 @@ update_steamcmd.sh() { fn_fetch_module } -update_vintagestory.sh() { +update_vints.sh() { modulefile="${FUNCNAME[0]}" fn_fetch_module } diff --git a/lgsm/modules/core_steamcmd.sh b/lgsm/modules/core_steamcmd.sh index 6d96a9e6c6..83fc6f5c39 100644 --- a/lgsm/modules/core_steamcmd.sh +++ b/lgsm/modules/core_steamcmd.sh @@ -151,11 +151,6 @@ fn_update_steamcmd_localbuild() { # Uses appmanifest to find local build. localbuild=$(grep buildid "${appmanifestfile}" | tr '[:blank:]"' ' ' | tr -s ' ' | cut -d\ -f3) - # Set branch to public if no custom branch. - if [ -z "${branch}" ]; then - branch="public" - fi - # Checks if localbuild variable has been set. if [ -z "${localbuild}" ]; then fn_print_fail "Checking local build: ${remotelocation}: missing local build info" @@ -178,6 +173,13 @@ fn_update_steamcmd_remotebuild() { find "${HOME}" -type f -name "appinfo.vdf" -exec rm -f {} \; 2> /dev/null fi + # Set branch to public if no custom branch. + if [ -z "${branch}" ]; then + branch="public" + fi + + # added as was failing GitHub Actions test. Running SteamCMD twice seems to fix it. + ${steamcmdcommand} +login "${steamuser}" "${steampass}" +app_info_update 1 +quit 2> /dev/null # password for branch not needed to check the buildid 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:]') diff --git a/lgsm/modules/install_config.sh b/lgsm/modules/install_config.sh index 9dc0841d5d..54f819aafd 100644 --- a/lgsm/modules/install_config.sh +++ b/lgsm/modules/install_config.sh @@ -64,7 +64,7 @@ fn_default_config_local() { # PASSWORD to random password fn_set_config_vars() { if [ -f "${servercfgfullpath}" ]; then - random=$(tr -dc A-Za-z0-9_ < /dev/urandom | head -c 8 | xargs) + random=$(tr -dc 'A-Za-z0-9_' < /dev/urandom 2>/dev/null | head -c 8 | xargs) servername="LinuxGSM" rconpass="admin${random}" echo -e "changing hostname." diff --git a/lgsm/modules/install_server_files.sh b/lgsm/modules/install_server_files.sh index 6db904992f..70eb808b0d 100644 --- a/lgsm/modules/install_server_files.sh +++ b/lgsm/modules/install_server_files.sh @@ -221,23 +221,23 @@ if [ "${shortname}" == "ts3" ]; then update_ts3.sh elif [ "${shortname}" == "mc" ]; then install_eula.sh - update_minecraft.sh + update_mc.sh elif [ "${shortname}" == "mcb" ]; then - update_minecraft_bedrock.sh + update_mcb.sh elif [ "${shortname}" == "pmc" ]; then install_eula.sh - update_papermc.sh + update_pmc.sh elif [ "${shortname}" == "wmc" ] || [ "${shortname}" == "vpmc" ]; then - update_papermc.sh + update_pmc.sh elif [ "${shortname}" == "mta" ]; then update_mta.sh elif [ "${shortname}" == "fctr" ]; then - update_factorio.sh + update_fctr.sh install_factorio_save.sh elif [ "${shortname}" == "jk2" ]; then - update_jediknight2.sh + update_jk2.sh elif [ "${shortname}" == "vints" ]; then - update_vintagestory.sh + update_vints.sh elif [ "${shortname}" == "ut99" ]; then fn_install_server_files update_ut99.sh diff --git a/lgsm/modules/update_factorio.sh b/lgsm/modules/update_fctr.sh similarity index 99% rename from lgsm/modules/update_factorio.sh rename to lgsm/modules/update_fctr.sh index f7fb06c7df..4cbcdbefc8 100644 --- a/lgsm/modules/update_factorio.sh +++ b/lgsm/modules/update_fctr.sh @@ -1,5 +1,5 @@ #!/bin/bash -# LinuxGSM update_factorio.sh module +# LinuxGSM update_fctr.sh module # Author: Daniel Gibbs # Contributors: http://linuxgsm.com/contrib # Website: https://linuxgsm.com diff --git a/lgsm/modules/update_jediknight2.sh b/lgsm/modules/update_jk2.sh similarity index 100% rename from lgsm/modules/update_jediknight2.sh rename to lgsm/modules/update_jk2.sh diff --git a/lgsm/modules/update_minecraft.sh b/lgsm/modules/update_mc.sh similarity index 99% rename from lgsm/modules/update_minecraft.sh rename to lgsm/modules/update_mc.sh index cfdf7e057e..85e9035778 100644 --- a/lgsm/modules/update_minecraft.sh +++ b/lgsm/modules/update_mc.sh @@ -1,5 +1,5 @@ #!/bin/bash -# LinuxGSM update_minecraft.sh module +# LinuxGSM update_mc.sh module # Author: Daniel Gibbs # Contributors: http://linuxgsm.com/contrib # Website: https://linuxgsm.com diff --git a/lgsm/modules/update_minecraft_bedrock.sh b/lgsm/modules/update_mcb.sh similarity index 99% rename from lgsm/modules/update_minecraft_bedrock.sh rename to lgsm/modules/update_mcb.sh index 92bffca31a..b125a3c498 100644 --- a/lgsm/modules/update_minecraft_bedrock.sh +++ b/lgsm/modules/update_mcb.sh @@ -1,5 +1,5 @@ #!/bin/bash -# LinuxGSM update_minecraft_bedrock.sh module +# LinuxGSM update_mcb.sh module # Author: Daniel Gibbs # Contributors: http://linuxgsm.com/contrib # Website: https://linuxgsm.com diff --git a/lgsm/modules/update_papermc.sh b/lgsm/modules/update_pmc.sh similarity index 99% rename from lgsm/modules/update_papermc.sh rename to lgsm/modules/update_pmc.sh index 2438c2d863..5154bfeb94 100644 --- a/lgsm/modules/update_papermc.sh +++ b/lgsm/modules/update_pmc.sh @@ -1,5 +1,5 @@ #!/bin/bash -# LinuxGSM update_papermc.sh module +# LinuxGSM update_pmc.sh module # Author: Daniel Gibbs # Contributors: http://linuxgsm.com/contrib # Website: https://linuxgsm.com diff --git a/lgsm/modules/update_vintagestory.sh b/lgsm/modules/update_vints.sh similarity index 99% rename from lgsm/modules/update_vintagestory.sh rename to lgsm/modules/update_vints.sh index 21e2d0e63a..75755248c9 100644 --- a/lgsm/modules/update_vintagestory.sh +++ b/lgsm/modules/update_vints.sh @@ -1,5 +1,5 @@ #!/bin/bash -# LinuxGSM update_vintagestory.sh module +# LinuxGSM update_vints.sh module # Author: Daniel Gibbs # Contributors: http://linuxgsm.com/contrib # Website: https://linuxgsm.com From 22e812f75c334447679cf45fa7dab278ba6b403a Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Thu, 7 Sep 2023 23:39:43 +0100 Subject: [PATCH 159/181] fix(ts3): update now works in docker --- lgsm/modules/update_ts3.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lgsm/modules/update_ts3.sh b/lgsm/modules/update_ts3.sh index b031d2b348..40b299336e 100644 --- a/lgsm/modules/update_ts3.sh +++ b/lgsm/modules/update_ts3.sh @@ -18,7 +18,7 @@ fn_update_localbuild() { # Gets local build info. fn_print_dots "Checking local build: ${remotelocation}" # 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) + localbuild=$(grep -Eo "TeamSpeak 3 Server ((\.)?[0-9]{1,3}){1,3}\.[0-9]{1,3}" "$(find "${serverfiles}"/* -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 fn_print_error "Checking local build: ${remotelocation}: missing local build info" fn_script_log_error "Missing local build info" From 6921851da6ef6beae05de5987d3fa1f32bd270e5 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Fri, 8 Sep 2023 08:49:25 +0100 Subject: [PATCH 160/181] feat(pvr): add fix_pvr.sh module --- lgsm/modules/command_monitor.sh | 3 +++ lgsm/modules/core_modules.sh | 5 +++++ lgsm/modules/fix.sh | 2 +- 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/lgsm/modules/command_monitor.sh b/lgsm/modules/command_monitor.sh index b1d9b5f6db..5ce104a955 100644 --- a/lgsm/modules/command_monitor.sh +++ b/lgsm/modules/command_monitor.sh @@ -177,6 +177,7 @@ fn_monitor_check_session() { fn_script_log_error "Checking session: There are PIDS with identical tmux sessions running" fn_script_log_error "Checking session: Killing all tmux sessions with the socketname name ${socketname} and session name ${sessionname}" pkill -f "tmux -L ${socketname} new-session -d -x ${sessionwidth} -y ${sessionheight} -s ${sessionname}" + command_restart.sh core_exit.sh # Check for tmux pids with the same tmux session and socket names. This will reduce issues with migration to release v23.5.0. #4296 elif [ "$(pgrep -fc -u "${USER}" "tmux -L ${sessionname} new-session -d -x ${sessionwidth} -y ${sessionheight} -s ${sessionname}")" != "0" ]; then @@ -186,6 +187,7 @@ fn_monitor_check_session() { fn_script_log_error "Checking session: PIDS with the same tmux session and socket names are running" fn_script_log_error "Checking session: Killing session with the socketname name ${sessionname} and session name ${sessionname}" pkill -f "tmux -L ${sessionname} new-session -d -x ${sessionwidth} -y ${sessionheight} -s ${sessionname}" + command_restart.sh core_exit.sh # Check for tmux pids that are using the old type of tmux session. This will reduce issues with migration to release v23.5.0. #4296 elif [ "$(pgrep -fc -u "${USER}" "tmux new-session -d -x ${sessionwidth} -y ${sessionheight} -s ${sessionname}")" != "0" ]; then @@ -195,6 +197,7 @@ fn_monitor_check_session() { fn_script_log_error "Checking session: PIDS with old type tmux session are running" fn_script_log_error "Checking session: Killing session with the session name ${sessionname}" pkill -f "tmux new-session -d -x ${sessionwidth} -y ${sessionheight} -s ${sessionname}" + command_restart.sh core_exit.sh elif [ "${status}" != "0" ]; then fn_print_ok "Checking session: " diff --git a/lgsm/modules/core_modules.sh b/lgsm/modules/core_modules.sh index 80b3463e3f..4b004dbc13 100644 --- a/lgsm/modules/core_modules.sh +++ b/lgsm/modules/core_modules.sh @@ -421,6 +421,11 @@ fix_onset.sh() { fn_fetch_module } +fix_pvr.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + fix_ro.sh() { modulefile="${FUNCNAME[0]}" fn_fetch_module diff --git a/lgsm/modules/fix.sh b/lgsm/modules/fix.sh index 322091f5aa..a7f5f73786 100644 --- a/lgsm/modules/fix.sh +++ b/lgsm/modules/fix.sh @@ -52,7 +52,7 @@ fn_apply_fix() { 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_pre_start_fix=(arma3 armar ark av bt bo csgo cmw dst hw ins nmrih onset pvr 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 From 9326d48684f3c679ed0ee2ecd03e3a7cfca3e0d1 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Fri, 8 Sep 2023 23:45:59 +0100 Subject: [PATCH 161/181] fix(mta): change updater to use builds (#4310) https://github.com/multitheftauto/mtasa-blue/issues/3176 --- lgsm/modules/update_mc.sh | 1 + lgsm/modules/update_mcb.sh | 2 ++ lgsm/modules/update_mta.sh | 16 ++++++++++------ lgsm/modules/update_pmc.sh | 1 + lgsm/modules/update_vints.sh | 2 +- 5 files changed, 15 insertions(+), 7 deletions(-) diff --git a/lgsm/modules/update_mc.sh b/lgsm/modules/update_mc.sh index 85e9035778..d65ee75635 100644 --- a/lgsm/modules/update_mc.sh +++ b/lgsm/modules/update_mc.sh @@ -11,6 +11,7 @@ fn_update_dl() { # Download and extract files to serverfiles. fn_fetch_file "${remotebuildurl}" "" "" "" "${tmpdir}" "${remotebuildfilename}" "chmodx" "norun" "noforce" "nohash" cp -f "${tmpdir}/${remotebuildfilename}" "${serverfiles}/${executable#./}" + fn_clear_tmp } fn_update_localbuild() { diff --git a/lgsm/modules/update_mcb.sh b/lgsm/modules/update_mcb.sh index b125a3c498..ceb284b397 100644 --- a/lgsm/modules/update_mcb.sh +++ b/lgsm/modules/update_mcb.sh @@ -23,10 +23,12 @@ fn_update_dl() { echo -e "${extractcmd}" >> "${lgsmlog}" fi echo -e "${extractcmd}" + fn_clear_tmp core_exit.sh else fn_print_ok_eol_nl fn_script_log_pass "Extracting ${local_filename}" + fn_clear_tmp fi } diff --git a/lgsm/modules/update_mta.sh b/lgsm/modules/update_mta.sh index eab77c7488..fd728b22df 100644 --- a/lgsm/modules/update_mta.sh +++ b/lgsm/modules/update_mta.sh @@ -11,13 +11,17 @@ 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_clear_tmp } fn_update_localbuild() { # Gets local build info. fn_print_dots "Checking local build: ${remotelocation}" - # 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) + # Uses executable to get local build. + if [ -d "${executabledir}" ]; then + cd "${executabledir}" || exit + localbuild=$(${executable} -v 2> /dev/null) + fi if [ -z "${localbuild}" ]; then fn_print_error "Checking local build: ${remotelocation}: missing local build info" fn_script_log_error "Missing local build info" @@ -31,11 +35,11 @@ fn_update_localbuild() { fn_update_remotebuild() { # Get remote build info. - apiurl="https://api.github.com/repos/multitheftauto/mtasa-blue/releases/latest" + apiurl="https://linux.multitheftauto.com/revision/latest.txt" 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') + remotebuildfilename="multitheftauto_linux_x64.tar.gz" + remotebuildurl="http://linux.mtasa.com/dl/multitheftauto_linux_x64.tar.gz" + remotebuildversion=$(echo "${remotebuildresponse}") if [ "${firstcommandname}" != "INSTALL" ]; then fn_print_dots "Checking remote build: ${remotelocation}" # Checks if remotebuildversion variable has been set. diff --git a/lgsm/modules/update_pmc.sh b/lgsm/modules/update_pmc.sh index 5154bfeb94..56d36a09b0 100644 --- a/lgsm/modules/update_pmc.sh +++ b/lgsm/modules/update_pmc.sh @@ -12,6 +12,7 @@ fn_update_dl() { fn_fetch_file "${remotebuildurl}" "" "" "" "${tmpdir}" "${remotebuildfilename}" "chmodx" "norun" "force" "${remotebuildhash}" cp -f "${tmpdir}/${remotebuildfilename}" "${serverfiles}/${executable#./}" echo "${remotebuildversion}" > "${serverfiles}/build.txt" + fn_clear_tmp } fn_update_localbuild() { diff --git a/lgsm/modules/update_vints.sh b/lgsm/modules/update_vints.sh index 75755248c9..d545a9c839 100644 --- a/lgsm/modules/update_vints.sh +++ b/lgsm/modules/update_vints.sh @@ -20,7 +20,7 @@ fn_update_localbuild() { # Uses executable to get local build. if [ -d "${executabledir}" ]; then cd "${executabledir}" || exit - localbuild="$(${preexecutable} ${executable} --version | sed '/^[[:space:]]*$/d')" + localbuild="$(${preexecutable} ${executable} --version 2> /dev/null | sed '/^[[:space:]]*$/d')" fi if [ -z "${localbuild}" ]; then fn_print_error "Checking local build: ${remotelocation}: missing local build info" From 272b5008069736972a38c9b997d7eb6021465a20 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Fri, 8 Sep 2023 23:52:03 +0100 Subject: [PATCH 162/181] Update README.md --- README.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index f710ff66db..db89b85481 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@

LinuxGSM Codacy grade - GitHub Workflow Status + GitHub Workflow Status Discord SteamCMD MIT License @@ -11,7 +11,7 @@ ## Hassle-Free Dedicated Game Servers -Traditionally game servers are not easy to manage yourself. Admins often have to spend hours messing around trying to get their server working. LinuxGSM is a command-line tool designed to be as simple as possible, allowing admins to spend less time on management and more time gaming. +Traditionally game servers are not easy to manage yourself. Admins often have to spend hours messing around trying to get their servers working. LinuxGSM is a command-line tool designed to be as simple as possible, allowing admins to spend less time on management and more time gaming. ## Main features @@ -45,12 +45,12 @@ Documentation is found at [linuxgsm.com](https://linuxgsm.com) and [docs.linuxgs ## :question: Support -There are various ways to get support, check out the [support](https://linuxgsm.com/support/) page to the right support. +There are various ways to get support, check out the [support](https://linuxgsm.com/support/) page for the right support. ## :heart: Sponsor -If you would like to [sponsor](https://linuxgsm.com/sponsor) to the project there are several ways you can, via [GitHub Sponsors](https://github.com/sponsors/dgibbs64) and [PayPal](https://www.paypal.me/dgibbs64). I would like to thank everyone who sponsors me. Since 2012 LinuxGSM has been steadily growing with new servers, features and improvements added regularly. +If you would like to [sponsor](https://linuxgsm.com/sponsor) to the project there are several ways you can, via [GitHub Sponsors](https://github.com/sponsors/dgibbs64) and [PayPal](https://www.paypal.me/dgibbs64). I would like to thank everyone who sponsors me. Since 2012 LinuxGSM has been steadily growing with new servers, features, and improvements added regularly. -## Contributors +## 🧙‍♂️ Contributors -A big thank you goes to all the wonderful people who contribute ideas, code, docs and support to this project. +A big thank you goes to all the wonderful people who contribute ideas, code, docs, and support to this project. From a4a85cfd0a481678cbbddde6f65d70f6df9d7454 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sun, 10 Sep 2023 20:10:30 +0100 Subject: [PATCH 163/181] minor rewording --- lgsm/modules/command_install.sh | 1 - lgsm/modules/fix_vh.sh | 2 +- lgsm/modules/info_distro.sh | 2 +- 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/lgsm/modules/command_install.sh b/lgsm/modules/command_install.sh index b3edd67c8c..e8cba75608 100644 --- a/lgsm/modules/command_install.sh +++ b/lgsm/modules/command_install.sh @@ -48,6 +48,5 @@ else fix.sh install_stats.sh install_complete.sh - fi core_exit.sh diff --git a/lgsm/modules/fix_vh.sh b/lgsm/modules/fix_vh.sh index 831335c3c0..c642a1a57d 100644 --- a/lgsm/modules/fix_vh.sh +++ b/lgsm/modules/fix_vh.sh @@ -2,7 +2,7 @@ # LinuxGSM fix_rust.sh module # Author: Alasdair Haig # Website: https://linuxgsm.com -# Description: Resolves issues with Valheim, +# Description: Resolves issues with Valheim. moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" diff --git a/lgsm/modules/info_distro.sh b/lgsm/modules/info_distro.sh index aacee2b8fb..a5607ef45a 100644 --- a/lgsm/modules/info_distro.sh +++ b/lgsm/modules/info_distro.sh @@ -73,7 +73,7 @@ for distro_info in "${distro_info_array[@]}"; do fi done -# Get virtual environment +# Get virtual environment type. if [ "$(command -v systemd-detect-virt 2> /dev/null)" ]; then virtualenvironment="$(systemd-detect-virt)" fi From 178c2163476005147f1a65ca60dcf8f7748d6a69 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sun, 10 Sep 2023 20:11:29 +0100 Subject: [PATCH 164/181] Release v23.5.0 --- lgsm/modules/core_functions.sh | 2 +- lgsm/modules/core_modules.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, 7 insertions(+), 7 deletions(-) diff --git a/lgsm/modules/core_functions.sh b/lgsm/modules/core_functions.sh index 356aa4d93e..e70775c346 100644 --- a/lgsm/modules/core_functions.sh +++ b/lgsm/modules/core_functions.sh @@ -8,7 +8,7 @@ module_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" -modulesversion="v23.4.0" +modulesversion="v23.5.0" # Core diff --git a/lgsm/modules/core_modules.sh b/lgsm/modules/core_modules.sh index 4b004dbc13..29b2d39e32 100644 --- a/lgsm/modules/core_modules.sh +++ b/lgsm/modules/core_modules.sh @@ -8,7 +8,7 @@ moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" -modulesversion="v23.4.0" +modulesversion="v23.5.0" # Core diff --git a/linuxgsm.sh b/linuxgsm.sh index d6b526e0ea..5fce5d1c9b 100755 --- a/linuxgsm.sh +++ b/linuxgsm.sh @@ -20,7 +20,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="v23.4.0" +version="v23.5.0" shortname="core" gameservername="core" commandname="CORE" diff --git a/tests/tests_fctrserver.sh b/tests/tests_fctrserver.sh index 4639206726..50bb6b4b2c 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.4.0" +version="v23.5.0" shortname="fctr" gameservername="fctrserver" commandname="CORE" diff --git a/tests/tests_jc2server.sh b/tests/tests_jc2server.sh index 72f3f1a221..f7b674f3dd 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.4.0" +version="v23.5.0" shortname="jc2" gameservername="jc2server" commandname="CORE" diff --git a/tests/tests_mcserver.sh b/tests/tests_mcserver.sh index ab94c5dc9a..4f28fbb580 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.4.0" +version="v23.5.0" shortname="mc" gameservername="mcserver" commandname="CORE" diff --git a/tests/tests_ts3server.sh b/tests/tests_ts3server.sh index 4121bd462d..5a41bf2165 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.4.0" +version="v23.5.0" shortname="ts3" gameservername="ts3server" commandname="CORE" From 928de3b36f8df603afaee93dc4e3321812df7705 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 10 Sep 2023 20:17:10 +0100 Subject: [PATCH 165/181] build(deps): bump actions/checkout from 3 to 4 (#4306) Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4. - [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/v3...v4) --- 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/details-check.yml | 2 +- .github/workflows/serverlist-validate.yml | 2 +- .github/workflows/update-copyright-years-in-license-file.yml | 2 +- .github/workflows/version-check.yml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/details-check.yml b/.github/workflows/details-check.yml index c2e60ddf63..ca27ba5a3e 100644 --- a/.github/workflows/details-check.yml +++ b/.github/workflows/details-check.yml @@ -15,7 +15,7 @@ jobs: matrix: ${{ steps.set-matrix.outputs.matrix }} steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Generate matrix with generate-matrix.sh run: chmod +x .github/workflows/detals-check-generate-matrix.sh; .github/workflows/detals-check-generate-matrix.sh diff --git a/.github/workflows/serverlist-validate.yml b/.github/workflows/serverlist-validate.yml index 39f37e1df1..13f7376a1f 100644 --- a/.github/workflows/serverlist-validate.yml +++ b/.github/workflows/serverlist-validate.yml @@ -8,7 +8,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Compare Versions run: chmod +x .github/workflows/serverlist-validate.sh; .github/workflows/serverlist-validate.sh diff --git a/.github/workflows/update-copyright-years-in-license-file.yml b/.github/workflows/update-copyright-years-in-license-file.yml index d90ba4a5de..2d6d3eeeb2 100644 --- a/.github/workflows/update-copyright-years-in-license-file.yml +++ b/.github/workflows/update-copyright-years-in-license-file.yml @@ -9,7 +9,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: fetch-depth: 0 - name: Action Update License Year diff --git a/.github/workflows/version-check.yml b/.github/workflows/version-check.yml index cb51d4b2f0..a66eaca144 100644 --- a/.github/workflows/version-check.yml +++ b/.github/workflows/version-check.yml @@ -10,7 +10,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Version Check run: chmod +x .github/workflows/version-check.sh; .github/workflows/version-check.sh From 622e2869b16a4977ac3ea01767b5e98644168013 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sun, 10 Sep 2023 21:57:32 +0100 Subject: [PATCH 166/181] fix(tw): correct game info --- lgsm/modules/info_game.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lgsm/modules/info_game.sh b/lgsm/modules/info_game.sh index 5c0867029c..77251784ca 100644 --- a/lgsm/modules/info_game.sh +++ b/lgsm/modules/info_game.sh @@ -2060,11 +2060,11 @@ fn_info_game_terraria() { # Filetype: cfg fn_info_game_tw() { if [ -f "${servercfgfullpath}" ]; then - fn_info_game_quakec "servername" "sv_name" - fn_info_game_quakec "serverpassword" "password" - fn_info_game_quakec "rconpassword" "sv_rcon_password" - fn_info_game_quakec "port" "sv_port" - fn_info_game_quakec "maxplayers" "sv_max_clients" + fn_info_game_keyvalue_pairs_space "servername" "sv_name" + fn_info_game_keyvalue_pairs_space "serverpassword" "password" + fn_info_game_keyvalue_pairs_space "rconpassword" "sv_rcon_password" + fn_info_game_keyvalue_pairs_space "port" "sv_port" + fn_info_game_keyvalue_pairs_space "maxplayers" "sv_max_clients" fi queryport="${port}" servername="${servername:-"NOT SET"}" From a05c6a5c18b3e56aecd9deb816877e115b8bc764 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sun, 10 Sep 2023 21:58:02 +0100 Subject: [PATCH 167/181] fix(ps): move _default.cfg to new name --- .../config-lgsm/{pstbsserver => psserver}/_default.cfg | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename lgsm/config-default/config-lgsm/{pstbsserver => psserver}/_default.cfg (100%) diff --git a/lgsm/config-default/config-lgsm/pstbsserver/_default.cfg b/lgsm/config-default/config-lgsm/psserver/_default.cfg similarity index 100% rename from lgsm/config-default/config-lgsm/pstbsserver/_default.cfg rename to lgsm/config-default/config-lgsm/psserver/_default.cfg From db3c3844845ca07a0d1d62f5d5ed7349109d07d2 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sun, 10 Sep 2023 21:59:16 +0100 Subject: [PATCH 168/181] Release v23.5.1 --- lgsm/modules/core_functions.sh | 2 +- lgsm/modules/core_modules.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, 7 insertions(+), 7 deletions(-) diff --git a/lgsm/modules/core_functions.sh b/lgsm/modules/core_functions.sh index e70775c346..d77fb44d14 100644 --- a/lgsm/modules/core_functions.sh +++ b/lgsm/modules/core_functions.sh @@ -8,7 +8,7 @@ module_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" -modulesversion="v23.5.0" +modulesversion="v23.5.1" # Core diff --git a/lgsm/modules/core_modules.sh b/lgsm/modules/core_modules.sh index 29b2d39e32..55ba617b3d 100644 --- a/lgsm/modules/core_modules.sh +++ b/lgsm/modules/core_modules.sh @@ -8,7 +8,7 @@ moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" -modulesversion="v23.5.0" +modulesversion="v23.5.1" # Core diff --git a/linuxgsm.sh b/linuxgsm.sh index 5fce5d1c9b..30da385679 100755 --- a/linuxgsm.sh +++ b/linuxgsm.sh @@ -20,7 +20,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="v23.5.0" +version="v23.5.1" shortname="core" gameservername="core" commandname="CORE" diff --git a/tests/tests_fctrserver.sh b/tests/tests_fctrserver.sh index 50bb6b4b2c..d5b3490ac1 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.5.0" +version="v23.5.1" shortname="fctr" gameservername="fctrserver" commandname="CORE" diff --git a/tests/tests_jc2server.sh b/tests/tests_jc2server.sh index f7b674f3dd..c3b2523b12 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.5.0" +version="v23.5.1" shortname="jc2" gameservername="jc2server" commandname="CORE" diff --git a/tests/tests_mcserver.sh b/tests/tests_mcserver.sh index 4f28fbb580..6b7f0c87f4 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.5.0" +version="v23.5.1" shortname="mc" gameservername="mcserver" commandname="CORE" diff --git a/tests/tests_ts3server.sh b/tests/tests_ts3server.sh index 5a41bf2165..81ae653031 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.5.0" +version="v23.5.1" shortname="ts3" gameservername="ts3server" commandname="CORE" From 1892288a73220feb51b9e7b96afbfb199976c1a5 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Mon, 11 Sep 2023 21:42:04 +0100 Subject: [PATCH 169/181] feat: add uuid-runtime to Debian and Ubuntu CSV files This commit adds the `uuid-runtime` package to the Debian and Ubuntu CSV files. This package is required for stats. --- lgsm/data/debian-10.csv | 2 +- lgsm/data/debian-11.csv | 2 +- lgsm/data/debian-12.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-22.04.csv | 2 +- lgsm/data/ubuntu-23.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 d2602643f9..4b1c945182 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,distro-info,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,uuid-runtime,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 16c6e6b811..9ab997eaa1 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,distro-info,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,uuid-runtime,wget,xz-utils steamcmd,lib32gcc-s1,lib32stdc++6,libsdl2-2.0-0:i386,steamcmd ac ahl diff --git a/lgsm/data/debian-12.csv b/lgsm/data/debian-12.csv index 04ff25b7af..3a5c24fbf9 100644 --- a/lgsm/data/debian-12.csv +++ b/lgsm/data/debian-12.csv @@ -1,4 +1,4 @@ -all,bc,binutils,bsdmainutils,bzip2,ca-certificates,cpio,curl,distro-info,file,gzip,hostname,jq,lib32gcc-s1,lib32stdc++6,netcat-traditional,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-traditional,python3,tar,tmux,unzip,util-linux,uuid-runtime,wget,xz-utils steamcmd,lib32gcc-s1,lib32stdc++6,libsdl2-2.0-0:i386,steamcmd ac ahl diff --git a/lgsm/data/ubuntu-16.04.csv b/lgsm/data/ubuntu-16.04.csv index 51b2d929ac..fd1cd84601 100644 --- a/lgsm/data/ubuntu-16.04.csv +++ b/lgsm/data/ubuntu-16.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,file,gzip,hostname,jq,lib32gcc1,lib32stdc++6,netcat,python3,tar,tmux,unzip,util-linux,uuid-runtime,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 d2602643f9..4b1c945182 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,distro-info,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,uuid-runtime,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 8eadea652e..f50fb4c833 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,distro-info,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,uuid-runtime,wget,xz-utils steamcmd,lib32gcc1,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 463a819aeb..8526a176b3 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,distro-info,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,uuid-runtime,wget,xz-utils steamcmd,lib32gcc-s1,lib32stdc++6,libsdl2-2.0-0:i386,steamcmd ac ahl diff --git a/lgsm/data/ubuntu-23.04.csv b/lgsm/data/ubuntu-23.04.csv index 463a819aeb..8526a176b3 100644 --- a/lgsm/data/ubuntu-23.04.csv +++ b/lgsm/data/ubuntu-23.04.csv @@ -1,4 +1,4 @@ -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 +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,uuid-runtime,wget,xz-utils steamcmd,lib32gcc-s1,lib32stdc++6,libsdl2-2.0-0:i386,steamcmd ac ahl From e4e1d72330e006e635a0f9fdf93c71420d189b28 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Mon, 11 Sep 2023 22:42:26 +0100 Subject: [PATCH 170/181] feat(docker): update datadir variable assignment The code change updates the assignment of the `datadir` variable in the `linuxgsm.sh` script. The new assignment checks if the environment variable `LGSM_DATADIR` is set and uses its value, otherwise it falls back to using `${lgsmdir}/data`. --- linuxgsm.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/linuxgsm.sh b/linuxgsm.sh index 30da385679..1b6b6f35aa 100755 --- a/linuxgsm.sh +++ b/linuxgsm.sh @@ -33,7 +33,7 @@ steamcmddir="${HOME}/.steam/steamcmd" [ -n "${LGSM_SERVERFILES}" ] && serverfiles="${LGSM_SERVERFILES}" || serverfiles="${rootdir}/serverfiles" modulesdir="${lgsmdir}/modules" tmpdir="${lgsmdir}/tmp" -datadir="${lgsmdir}/data" +[ -n "${LGSM_DATADIR}" ] && datadir="${LGSM_DATADIR}" || datadir="${lgsmdir}/data" lockdir="${lgsmdir}/lock" sessionname="${selfname}" [ -f "${datadir}/${selfname}.uid" ] && socketname="${sessionname}-$(cat "${datadir}/${selfname}.uid")" From 1728fd943ca3560000243a7b39f7b1473fbed579 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Tue, 12 Sep 2023 21:42:42 +0100 Subject: [PATCH 171/181] Release v23.5.2 --- lgsm/modules/core_functions.sh | 2 +- lgsm/modules/core_modules.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, 7 insertions(+), 7 deletions(-) diff --git a/lgsm/modules/core_functions.sh b/lgsm/modules/core_functions.sh index d77fb44d14..525c45d871 100644 --- a/lgsm/modules/core_functions.sh +++ b/lgsm/modules/core_functions.sh @@ -8,7 +8,7 @@ module_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" -modulesversion="v23.5.1" +modulesversion="v23.5.2" # Core diff --git a/lgsm/modules/core_modules.sh b/lgsm/modules/core_modules.sh index 55ba617b3d..825a0a0ab0 100644 --- a/lgsm/modules/core_modules.sh +++ b/lgsm/modules/core_modules.sh @@ -8,7 +8,7 @@ moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" -modulesversion="v23.5.1" +modulesversion="v23.5.2" # Core diff --git a/linuxgsm.sh b/linuxgsm.sh index 1b6b6f35aa..a72f6ca932 100755 --- a/linuxgsm.sh +++ b/linuxgsm.sh @@ -20,7 +20,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="v23.5.1" +version="v23.5.2" shortname="core" gameservername="core" commandname="CORE" diff --git a/tests/tests_fctrserver.sh b/tests/tests_fctrserver.sh index d5b3490ac1..9b77dbed96 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.5.1" +version="v23.5.2" shortname="fctr" gameservername="fctrserver" commandname="CORE" diff --git a/tests/tests_jc2server.sh b/tests/tests_jc2server.sh index c3b2523b12..70e23aaf73 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.5.1" +version="v23.5.2" shortname="jc2" gameservername="jc2server" commandname="CORE" diff --git a/tests/tests_mcserver.sh b/tests/tests_mcserver.sh index 6b7f0c87f4..a49190e033 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.5.1" +version="v23.5.2" shortname="mc" gameservername="mcserver" commandname="CORE" diff --git a/tests/tests_ts3server.sh b/tests/tests_ts3server.sh index 81ae653031..f79fa5a5f2 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.5.1" +version="v23.5.2" shortname="ts3" gameservername="ts3server" commandname="CORE" From 4f2acdd12a439e832b9f5cca47a5c3a1f0388f75 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Tue, 19 Sep 2023 16:55:16 +0100 Subject: [PATCH 172/181] refactor: minor _default.cfg changes - Updated the IP and port settings for ckserver, colserver, fctrserver, hwserver, ohdserver, rustserver, and untserver. - Added a link to the documentation for predefined parameters in ckserver and hwserver. - Modified the startparameters value in colserver to include additional parameters. - Changed the branch value in fctrserver to "stable". - Updated the servername value in hwserver and ohdserver to "LinuxGSM". - Modified the defaultmap value in hwserver to "nullius". - Removed optional comments from hwerver regarding defaultmap and creativemode values. - Updated gamemode values in rusterver and untserer with their respective options. --- lgsm/config-default/config-lgsm/ckserver/_default.cfg | 1 + lgsm/config-default/config-lgsm/colserver/_default.cfg | 2 +- lgsm/config-default/config-lgsm/fctrserver/_default.cfg | 3 +-- lgsm/config-default/config-lgsm/hwserver/_default.cfg | 6 +++--- lgsm/config-default/config-lgsm/ohdserver/_default.cfg | 2 +- lgsm/config-default/config-lgsm/rustserver/_default.cfg | 6 +++--- lgsm/config-default/config-lgsm/untserver/_default.cfg | 4 ++-- 7 files changed, 12 insertions(+), 12 deletions(-) diff --git a/lgsm/config-default/config-lgsm/ckserver/_default.cfg b/lgsm/config-default/config-lgsm/ckserver/_default.cfg index ed81e41132..164fd85f90 100644 --- a/lgsm/config-default/config-lgsm/ckserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/ckserver/_default.cfg @@ -8,6 +8,7 @@ #### Game Server Settings #### +## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters ip="0.0.0.0" port="1234" diff --git a/lgsm/config-default/config-lgsm/colserver/_default.cfg b/lgsm/config-default/config-lgsm/colserver/_default.cfg index 14a0c93b2b..9a88956f73 100644 --- a/lgsm/config-default/config-lgsm/colserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/colserver/_default.cfg @@ -9,7 +9,7 @@ #### Game Server Settings #### ## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters -# Edit with care | https://colonysurvival.gamepedia.com/Dedicated_Server#Installation_.28Linux.29 +## https://colonysurvival.gamepedia.com/Dedicated_Server#Installation_.28Linux.29 startparameters="-batchmode -nographics +server.config ${servercfgfullpath}" #### LinuxGSM Settings #### diff --git a/lgsm/config-default/config-lgsm/fctrserver/_default.cfg b/lgsm/config-default/config-lgsm/fctrserver/_default.cfg index 9fe1b36ce7..d35c360500 100644 --- a/lgsm/config-default/config-lgsm/fctrserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/fctrserver/_default.cfg @@ -13,8 +13,7 @@ ip="0.0.0.0" port="34197" rconport="34198" rconpassword="CHANGE_ME" -# (stable|experimental) -branch="stable" +branch="stable" # values: stable, experimental ## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters startparameters="--bind ${ip} --start-server ${serverfiles}/save1.zip --server-settings ${servercfgfullpath} --port ${port} --rcon-port ${rconport} --rcon-password ${rconpassword}" diff --git a/lgsm/config-default/config-lgsm/hwserver/_default.cfg b/lgsm/config-default/config-lgsm/hwserver/_default.cfg index 3bf524f168..923865478d 100644 --- a/lgsm/config-default/config-lgsm/hwserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/hwserver/_default.cfg @@ -9,13 +9,13 @@ #### Game Server Settings #### ## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters -servername="LinuxGSM Server" +servername="LinuxGSM" ip="0.0.0.0" port="12871" queryport="12881" maxplayers="20" -defaultmap="" # Optional -creativemode="0" # Free Build: creativemode="1" +defaultmap="nullius" +creativemode="0" # values: Free Build = 1, Survival = 0 ## Add admins using STEAMID64 # Example : addadmin 012345678901234567; addadmin 987654321098765432 diff --git a/lgsm/config-default/config-lgsm/ohdserver/_default.cfg b/lgsm/config-default/config-lgsm/ohdserver/_default.cfg index 651ad4f4cc..afc11d09fe 100644 --- a/lgsm/config-default/config-lgsm/ohdserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/ohdserver/_default.cfg @@ -12,7 +12,7 @@ ip="0.0.0.0" port="7777" queryport="27005" -servername="LinuxGSM Server" +servername="LinuxGSM" serverpassword="" # Maps: risala, khafji_p, lamdong, montecassino, argonne defaultmap="AAS-TestMap" diff --git a/lgsm/config-default/config-lgsm/rustserver/_default.cfg b/lgsm/config-default/config-lgsm/rustserver/_default.cfg index c405516199..a07838143f 100644 --- a/lgsm/config-default/config-lgsm/rustserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/rustserver/_default.cfg @@ -15,10 +15,10 @@ 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. +rconweb="1" # values: Facepunch web panel, Rustadmin desktop and Rustadmin Online = 1, Rusty = 0. servername="Rust" -gamemode="vanilla" # Values: vanilla, softcore ( Doc: https://wiki.facepunch.com/rust/server-gamemodes ) -serverlevel="Procedural Map" # Values: Procedural Map, Barren, HapisIsland, SavasIsland +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. diff --git a/lgsm/config-default/config-lgsm/untserver/_default.cfg b/lgsm/config-default/config-lgsm/untserver/_default.cfg index 8fc651294c..fc17189676 100644 --- a/lgsm/config-default/config-lgsm/untserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/untserver/_default.cfg @@ -14,8 +14,8 @@ port="27015" maxplayers="20" defaultmap="PEI" servername="LinuxGSM" -perspective="first" # Values: first, third, vehicle, Both. -gamemode="normal" # Values: normal, easy, gold. +perspective="first" # values: first, third, vehicle, Both. +gamemode="normal" # values: normal, easy, gold. ## Game Server Login Token (GSLT): Required # GSLT is required for running a public server. From 5c33eb33c4a135fb0492918089bf930ca3c64938 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Tue, 19 Sep 2023 16:57:09 +0100 Subject: [PATCH 173/181] feat: add curl command to query Steam Master Server Add a curl command to query the Steam Master Server for server addresses. This allows retrieving server information using the GetServersAtAddress API endpoint provided by Steam. --- lgsm/modules/command_dev_query_raw.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lgsm/modules/command_dev_query_raw.sh b/lgsm/modules/command_dev_query_raw.sh index 25b174e6b1..1abd6cdf36 100644 --- a/lgsm/modules/command_dev_query_raw.sh +++ b/lgsm/modules/command_dev_query_raw.sh @@ -260,6 +260,8 @@ echo -e "" echo -e "${lightgreen}Steam Master Server Response${default}" echo -e "==================================================================" echo -e "" +echo -e "curl -m 3 -s https://api.steampowered.com/ISteamApps/GetServersAtAddress/v0001?addr=${publicip}" +echo -e "" echo -e "Response: ${displaymasterserver}" echo -e "" From 79dc5f7a1349eb7171885cd6463aa8c1de40eaad Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Tue, 19 Sep 2023 16:57:39 +0100 Subject: [PATCH 174/181] fix(steamcmd): hide steamcmd output --- lgsm/modules/core_steamcmd.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lgsm/modules/core_steamcmd.sh b/lgsm/modules/core_steamcmd.sh index 83fc6f5c39..6a7b25c111 100644 --- a/lgsm/modules/core_steamcmd.sh +++ b/lgsm/modules/core_steamcmd.sh @@ -179,7 +179,7 @@ fn_update_steamcmd_remotebuild() { fi # added as was failing GitHub Actions test. Running SteamCMD twice seems to fix it. - ${steamcmdcommand} +login "${steamuser}" "${steampass}" +app_info_update 1 +quit 2> /dev/null + ${steamcmdcommand} +login "${steamuser}" "${steampass}" +app_info_update 1 +quit > /dev/null 2>&1 # password for branch not needed to check the buildid 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:]') From 753eb2a99a68fb4561f544c9017315498626cdcd Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Mon, 25 Sep 2023 19:03:36 +0100 Subject: [PATCH 175/181] feat: moved last-updated.lock file moved last-updated.lock to ensure it doesn't force a reboot on monitor --- lgsm/modules/update_fctr.sh | 2 +- lgsm/modules/update_mc.sh | 2 +- lgsm/modules/update_mcb.sh | 2 +- lgsm/modules/update_pmc.sh | 2 +- lgsm/modules/update_ut99.sh | 2 +- lgsm/modules/update_vints.sh | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lgsm/modules/update_fctr.sh b/lgsm/modules/update_fctr.sh index 4cbcdbefc8..9b88fcd170 100644 --- a/lgsm/modules/update_fctr.sh +++ b/lgsm/modules/update_fctr.sh @@ -93,6 +93,7 @@ fn_update_compare() { fn_script_log_info "${localbuild} > ${remotebuildversion}" if [ "${commandname}" == "UPDATE" ]; then + date +%s > "${lockdir}/last-updated.lock" unset updateonstart check_status.sh # If server stopped. @@ -120,7 +121,6 @@ fn_update_compare() { fn_firstcommand_reset fi unset exitbypass - date +%s > "${lockdir}/last-updated.lock" alert="update" elif [ "${commandname}" == "CHECK-UPDATE" ]; then alert="check-update" diff --git a/lgsm/modules/update_mc.sh b/lgsm/modules/update_mc.sh index d65ee75635..2f7381da78 100644 --- a/lgsm/modules/update_mc.sh +++ b/lgsm/modules/update_mc.sh @@ -105,6 +105,7 @@ fn_update_compare() { fn_script_log_info "${localbuild} > ${remotebuildversion}" if [ "${commandname}" == "UPDATE" ]; then + date +%s > "${lockdir}/last-updated.lock" unset updateonstart check_status.sh # If server stopped. @@ -132,7 +133,6 @@ fn_update_compare() { fn_firstcommand_reset fi unset exitbypass - date +%s > "${lockdir}/last-updated.lock" alert="update" elif [ "${commandname}" == "CHECK-UPDATE" ]; then alert="check-update" diff --git a/lgsm/modules/update_mcb.sh b/lgsm/modules/update_mcb.sh index ceb284b397..f3a802e9e4 100644 --- a/lgsm/modules/update_mcb.sh +++ b/lgsm/modules/update_mcb.sh @@ -111,6 +111,7 @@ fn_update_compare() { fn_script_log_info "${localbuild} > ${remotebuildversion}" if [ "${commandname}" == "UPDATE" ]; then + date +%s > "${lockdir}/last-updated.lock" unset updateonstart check_status.sh # If server stopped. @@ -138,7 +139,6 @@ fn_update_compare() { fn_firstcommand_reset fi unset exitbypass - date +%s > "${lockdir}/last-updated.lock" alert="update" elif [ "${commandname}" == "CHECK-UPDATE" ]; then alert="check-update" diff --git a/lgsm/modules/update_pmc.sh b/lgsm/modules/update_pmc.sh index 56d36a09b0..2ad6b91abc 100644 --- a/lgsm/modules/update_pmc.sh +++ b/lgsm/modules/update_pmc.sh @@ -115,6 +115,7 @@ fn_update_compare() { fn_script_log_info "${localbuild} > ${remotebuildversion}" if [ "${commandname}" == "UPDATE" ]; then + date +%s > "${lockdir}/last-updated.lock" unset updateonstart check_status.sh # If server stopped. @@ -142,7 +143,6 @@ fn_update_compare() { fn_firstcommand_reset fi unset exitbypass - date +%s > "${lockdir}/last-updated.lock" alert="update" elif [ "${commandname}" == "CHECK-UPDATE" ]; then alert="check-update" diff --git a/lgsm/modules/update_ut99.sh b/lgsm/modules/update_ut99.sh index 1ff84a0600..c1dc1dade5 100644 --- a/lgsm/modules/update_ut99.sh +++ b/lgsm/modules/update_ut99.sh @@ -91,6 +91,7 @@ fn_update_compare() { fn_script_log_info "${localbuild} > ${remotebuildversion}" if [ "${commandname}" == "UPDATE" ]; then + date +%s > "${lockdir}/last-updated.lock" unset updateonstart check_status.sh # If server stopped. @@ -118,7 +119,6 @@ fn_update_compare() { fn_firstcommand_reset fi unset exitbypass - date +%s > "${lockdir}/last-updated.lock" alert="update" elif [ "${commandname}" == "CHECK-UPDATE" ]; then alert="check-update" diff --git a/lgsm/modules/update_vints.sh b/lgsm/modules/update_vints.sh index d545a9c839..47195b9b20 100644 --- a/lgsm/modules/update_vints.sh +++ b/lgsm/modules/update_vints.sh @@ -98,6 +98,7 @@ fn_update_compare() { fn_script_log_info "${localbuild} > ${remotebuildversion}" if [ "${commandname}" == "UPDATE" ]; then + date +%s > "${lockdir}/last-updated.lock" unset updateonstart check_status.sh # If server stopped. @@ -125,7 +126,6 @@ fn_update_compare() { fn_firstcommand_reset fi unset exitbypass - date +%s > "${lockdir}/last-updated.lock" alert="update" elif [ "${commandname}" == "CHECK-UPDATE" ]; then alert="check-update" From 4a02dfd382fba689e6a01fa78e33f35d278022ae Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Mon, 25 Sep 2023 20:30:40 +0100 Subject: [PATCH 176/181] fix: set $USER if missing $USER is not available in sh which is used by cron. --- lgsm/modules/core_modules.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lgsm/modules/core_modules.sh b/lgsm/modules/core_modules.sh index 825a0a0ab0..c860d3eae7 100644 --- a/lgsm/modules/core_modules.sh +++ b/lgsm/modules/core_modules.sh @@ -816,6 +816,11 @@ if [ ! -d "${lockdir}" ]; then mkdir -p "${lockdir}" fi +# if $USER id missing set to whoami +if [ -z "${USER}" ]; then + USER="$(whoami)" +fi + # Calls on-screen messages (bootstrap) core_messages.sh From 13c62431d01ae72eef060baabf631d27799329f4 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Tue, 26 Sep 2023 00:30:54 +0100 Subject: [PATCH 177/181] refactor: improve log file display in info_messages.sh The code change modifies the tail command in the fn_info_logs function to exclude lines containing "==>". This improves the display of log files by filtering out unnecessary information. --- lgsm/config-default/config-lgsm/pvrserver/_default.cfg | 1 - lgsm/modules/info_messages.sh | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/lgsm/config-default/config-lgsm/pvrserver/_default.cfg b/lgsm/config-default/config-lgsm/pvrserver/_default.cfg index 0a0bf8b525..5063868b0e 100644 --- a/lgsm/config-default/config-lgsm/pvrserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/pvrserver/_default.cfg @@ -11,7 +11,6 @@ ## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters ip="0.0.0.0" port="7777" - # Maps: bridge, datacenter, sand defaultmap="datacenter" # Get an API key from https://pavlov-ms.vankrupt.com/servers/v1/key diff --git a/lgsm/modules/info_messages.sh b/lgsm/modules/info_messages.sh index 6d8b849c53..a05da414f4 100644 --- a/lgsm/modules/info_messages.sh +++ b/lgsm/modules/info_messages.sh @@ -762,7 +762,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 -av "==>" | sed '/^$/d' | sed 's/\r//' | tail -25 fi echo -e "" fi From 2297d362a3754556975d87444df7c586074198fd Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Tue, 26 Sep 2023 00:35:22 +0100 Subject: [PATCH 178/181] feat: moved last-updated.lock file --- lgsm/modules/update_ts3.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lgsm/modules/update_ts3.sh b/lgsm/modules/update_ts3.sh index 40b299336e..bb137a0b30 100644 --- a/lgsm/modules/update_ts3.sh +++ b/lgsm/modules/update_ts3.sh @@ -97,6 +97,7 @@ fn_update_compare() { fn_script_log_info "${localbuild} > ${remotebuildversion}" if [ "${commandname}" == "UPDATE" ]; then + date +%s > "${lockdir}/last-updated.lock" unset updateonstart check_status.sh # If server stopped. @@ -124,7 +125,6 @@ fn_update_compare() { fn_firstcommand_reset fi unset exitbypass - date +%s > "${lockdir}/last-updated.lock" alert="update" elif [ "${commandname}" == "CHECK-UPDATE" ]; then alert="check-update" From 107d48ee01c18ceee12784d36e4772c38d4dbb41 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Tue, 26 Sep 2023 09:56:01 +0100 Subject: [PATCH 179/181] Release v23.5.3 --- lgsm/modules/core_functions.sh | 2 +- lgsm/modules/core_modules.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, 7 insertions(+), 7 deletions(-) diff --git a/lgsm/modules/core_functions.sh b/lgsm/modules/core_functions.sh index 525c45d871..c0195b2499 100644 --- a/lgsm/modules/core_functions.sh +++ b/lgsm/modules/core_functions.sh @@ -8,7 +8,7 @@ module_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" -modulesversion="v23.5.2" +modulesversion="v23.5.3" # Core diff --git a/lgsm/modules/core_modules.sh b/lgsm/modules/core_modules.sh index c860d3eae7..d03102ef51 100644 --- a/lgsm/modules/core_modules.sh +++ b/lgsm/modules/core_modules.sh @@ -8,7 +8,7 @@ moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" -modulesversion="v23.5.2" +modulesversion="v23.5.3" # Core diff --git a/linuxgsm.sh b/linuxgsm.sh index a72f6ca932..6da7de6641 100755 --- a/linuxgsm.sh +++ b/linuxgsm.sh @@ -20,7 +20,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="v23.5.2" +version="v23.5.3" shortname="core" gameservername="core" commandname="CORE" diff --git a/tests/tests_fctrserver.sh b/tests/tests_fctrserver.sh index 9b77dbed96..a63023dc8a 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.5.2" +version="v23.5.3" shortname="fctr" gameservername="fctrserver" commandname="CORE" diff --git a/tests/tests_jc2server.sh b/tests/tests_jc2server.sh index 70e23aaf73..b921de2749 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.5.2" +version="v23.5.3" shortname="jc2" gameservername="jc2server" commandname="CORE" diff --git a/tests/tests_mcserver.sh b/tests/tests_mcserver.sh index a49190e033..d173c7d680 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.5.2" +version="v23.5.3" shortname="mc" gameservername="mcserver" commandname="CORE" diff --git a/tests/tests_ts3server.sh b/tests/tests_ts3server.sh index f79fa5a5f2..7363a10254 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.5.2" +version="v23.5.3" shortname="ts3" gameservername="ts3server" commandname="CORE" From 099412730c923b55046c045c7a961354a1c9e604 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sun, 1 Oct 2023 23:20:55 +0100 Subject: [PATCH 180/181] feat(alerts): deprecate mailgun (#4324) mailgun is no longer free and stats suggest it is not used at all. Removing support --- .../config-lgsm/acserver/_default.cfg | 8 ----- .../config-lgsm/ahl2server/_default.cfg | 8 ----- .../config-lgsm/ahlserver/_default.cfg | 8 ----- .../config-lgsm/arkserver/_default.cfg | 8 ----- .../config-lgsm/arma3server/_default.cfg | 8 ----- .../config-lgsm/armarserver/_default.cfg | 8 ----- .../config-lgsm/atsserver/_default.cfg | 8 ----- .../config-lgsm/avserver/_default.cfg | 8 ----- .../config-lgsm/bb2server/_default.cfg | 8 ----- .../config-lgsm/bbserver/_default.cfg | 8 ----- .../config-lgsm/bdserver/_default.cfg | 8 ----- .../config-lgsm/bf1942server/_default.cfg | 8 ----- .../config-lgsm/bfvserver/_default.cfg | 8 ----- .../config-lgsm/bmdmserver/_default.cfg | 8 ----- .../config-lgsm/boserver/_default.cfg | 8 ----- .../config-lgsm/bsserver/_default.cfg | 8 ----- .../config-lgsm/btlserver/_default.cfg | 8 ----- .../config-lgsm/btserver/_default.cfg | 8 ----- .../config-lgsm/ccserver/_default.cfg | 8 ----- .../config-lgsm/cdserver/_default.cfg | 8 ----- .../config-lgsm/ckserver/_default.cfg | 8 ----- .../config-lgsm/cmwserver/_default.cfg | 8 ----- .../config-lgsm/cod2server/_default.cfg | 8 ----- .../config-lgsm/cod4server/_default.cfg | 8 ----- .../config-lgsm/codserver/_default.cfg | 8 ----- .../config-lgsm/coduoserver/_default.cfg | 8 ----- .../config-lgsm/codwawserver/_default.cfg | 8 ----- .../config-lgsm/colserver/_default.cfg | 8 ----- .../config-lgsm/csczserver/_default.cfg | 8 ----- .../config-lgsm/csgoserver/_default.cfg | 8 ----- .../config-lgsm/csserver/_default.cfg | 8 ----- .../config-lgsm/cssserver/_default.cfg | 8 ----- .../config-lgsm/ctserver/_default.cfg | 8 ----- .../config-lgsm/dabserver/_default.cfg | 8 ----- .../config-lgsm/dayzserver/_default.cfg | 8 ----- .../config-lgsm/dmcserver/_default.cfg | 8 ----- .../config-lgsm/dodrserver/_default.cfg | 8 ----- .../config-lgsm/dodserver/_default.cfg | 8 ----- .../config-lgsm/dodsserver/_default.cfg | 8 ----- .../config-lgsm/doiserver/_default.cfg | 8 ----- .../config-lgsm/dstserver/_default.cfg | 8 ----- .../config-lgsm/dysserver/_default.cfg | 8 ----- .../config-lgsm/ecoserver/_default.cfg | 8 ----- .../config-lgsm/emserver/_default.cfg | 8 ----- .../config-lgsm/etlserver/_default.cfg | 8 ----- .../config-lgsm/ets2server/_default.cfg | 8 ----- .../config-lgsm/fctrserver/_default.cfg | 8 ----- .../config-lgsm/fofserver/_default.cfg | 8 ----- .../config-lgsm/gmodserver/_default.cfg | 8 ----- .../config-lgsm/hcuserver/_default.cfg | 8 ----- .../config-lgsm/hl2dmserver/_default.cfg | 8 ----- .../config-lgsm/hldmserver/_default.cfg | 8 ----- .../config-lgsm/hldmsserver/_default.cfg | 8 ----- .../config-lgsm/hwserver/_default.cfg | 8 ----- .../config-lgsm/insserver/_default.cfg | 8 ----- .../config-lgsm/inssserver/_default.cfg | 8 ----- .../config-lgsm/iosserver/_default.cfg | 8 ----- .../config-lgsm/jc2server/_default.cfg | 8 ----- .../config-lgsm/jc3server/_default.cfg | 8 ----- .../config-lgsm/jk2server/_default.cfg | 8 ----- .../config-lgsm/kf2server/_default.cfg | 8 ----- .../config-lgsm/kfserver/_default.cfg | 8 ----- .../config-lgsm/l4d2server/_default.cfg | 8 ----- .../config-lgsm/l4dserver/_default.cfg | 8 ----- .../config-lgsm/loserver/_default.cfg | 8 ----- .../config-lgsm/mcbserver/_default.cfg | 8 ----- .../config-lgsm/mcserver/_default.cfg | 8 ----- .../config-lgsm/mhserver/_default.cfg | 8 ----- .../config-lgsm/mohaaserver/_default.cfg | 8 ----- .../config-lgsm/momserver/_default.cfg | 8 ----- .../config-lgsm/mtaserver/_default.cfg | 8 ----- .../config-lgsm/ndserver/_default.cfg | 8 ----- .../config-lgsm/necserver/_default.cfg | 8 ----- .../config-lgsm/nmrihserver/_default.cfg | 8 ----- .../config-lgsm/ns2cserver/_default.cfg | 8 ----- .../config-lgsm/ns2server/_default.cfg | 8 ----- .../config-lgsm/nsserver/_default.cfg | 8 ----- .../config-lgsm/ohdserver/_default.cfg | 8 ----- .../config-lgsm/onsetserver/_default.cfg | 8 ----- .../config-lgsm/opforserver/_default.cfg | 8 ----- .../config-lgsm/pc2server/_default.cfg | 8 ----- .../config-lgsm/pcserver/_default.cfg | 8 ----- .../config-lgsm/pmcserver/_default.cfg | 8 ----- .../config-lgsm/psserver/_default.cfg | 8 ----- .../config-lgsm/pvkiiserver/_default.cfg | 8 ----- .../config-lgsm/pvrserver/_default.cfg | 8 ----- .../config-lgsm/pzserver/_default.cfg | 8 ----- .../config-lgsm/q2server/_default.cfg | 8 ----- .../config-lgsm/q3server/_default.cfg | 8 ----- .../config-lgsm/qlserver/_default.cfg | 8 ----- .../config-lgsm/qwserver/_default.cfg | 8 ----- .../config-lgsm/ricochetserver/_default.cfg | 8 ----- .../config-lgsm/roserver/_default.cfg | 8 ----- .../config-lgsm/rtcwserver/_default.cfg | 8 ----- .../config-lgsm/rustserver/_default.cfg | 8 ----- .../config-lgsm/rwserver/_default.cfg | 8 ----- .../config-lgsm/sampserver/_default.cfg | 8 ----- .../config-lgsm/sbotsserver/_default.cfg | 8 ----- .../config-lgsm/sbserver/_default.cfg | 8 ----- .../config-lgsm/scpslserver/_default.cfg | 8 ----- .../config-lgsm/scpslsmserver/_default.cfg | 8 ----- .../config-lgsm/sdtdserver/_default.cfg | 8 ----- .../config-lgsm/sfcserver/_default.cfg | 8 ----- .../config-lgsm/sfserver/_default.cfg | 8 ----- .../config-lgsm/sof2server/_default.cfg | 8 ----- .../config-lgsm/solserver/_default.cfg | 8 ----- .../config-lgsm/squadserver/_default.cfg | 8 ----- .../config-lgsm/stnserver/_default.cfg | 8 ----- .../config-lgsm/stserver/_default.cfg | 8 ----- .../config-lgsm/svenserver/_default.cfg | 8 ----- .../config-lgsm/terrariaserver/_default.cfg | 8 ----- .../config-lgsm/tf2server/_default.cfg | 8 ----- .../config-lgsm/tfcserver/_default.cfg | 8 ----- .../config-lgsm/tiserver/_default.cfg | 8 ----- .../config-lgsm/ts3server/_default.cfg | 8 ----- .../config-lgsm/tsserver/_default.cfg | 8 ----- .../config-lgsm/tuserver/_default.cfg | 8 ----- .../config-lgsm/twserver/_default.cfg | 8 ----- .../config-lgsm/untserver/_default.cfg | 8 ----- .../config-lgsm/ut2k4server/_default.cfg | 8 ----- .../config-lgsm/ut3server/_default.cfg | 8 ----- .../config-lgsm/ut99server/_default.cfg | 8 ----- .../config-lgsm/utserver/_default.cfg | 8 ----- .../config-lgsm/vhserver/_default.cfg | 8 ----- .../config-lgsm/vintsserver/_default.cfg | 8 ----- .../config-lgsm/vpmcserver/_default.cfg | 8 ----- .../config-lgsm/vsserver/_default.cfg | 8 ----- .../config-lgsm/wetserver/_default.cfg | 8 ----- .../config-lgsm/wfserver/_default.cfg | 8 ----- .../config-lgsm/wmcserver/_default.cfg | 8 ----- .../config-lgsm/wurmserver/_default.cfg | 8 ----- .../config-lgsm/zmrserver/_default.cfg | 8 ----- .../config-lgsm/zpsserver/_default.cfg | 8 ----- lgsm/modules/alert.sh | 11 ------- lgsm/modules/alert_mailgun.sh | 32 ------------------- lgsm/modules/core_functions.sh | 5 --- lgsm/modules/core_modules.sh | 5 --- lgsm/modules/info_stats.sh | 9 ++---- tests/tests_defaultcfg/defaultcfg_1.txt | 1 - 139 files changed, 2 insertions(+), 1125 deletions(-) delete mode 100644 lgsm/modules/alert_mailgun.sh diff --git a/lgsm/config-default/config-lgsm/acserver/_default.cfg b/lgsm/config-default/config-lgsm/acserver/_default.cfg index 3dbc9cbeb4..c6aeb7b631 100644 --- a/lgsm/config-default/config-lgsm/acserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/acserver/_default.cfg @@ -51,14 +51,6 @@ 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" diff --git a/lgsm/config-default/config-lgsm/ahl2server/_default.cfg b/lgsm/config-default/config-lgsm/ahl2server/_default.cfg index 91bfdd25c4..fa8f9fa906 100644 --- a/lgsm/config-default/config-lgsm/ahl2server/_default.cfg +++ b/lgsm/config-default/config-lgsm/ahl2server/_default.cfg @@ -59,14 +59,6 @@ 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" diff --git a/lgsm/config-default/config-lgsm/ahlserver/_default.cfg b/lgsm/config-default/config-lgsm/ahlserver/_default.cfg index 78a3059f96..6b8012b36b 100644 --- a/lgsm/config-default/config-lgsm/ahlserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/ahlserver/_default.cfg @@ -54,14 +54,6 @@ 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" diff --git a/lgsm/config-default/config-lgsm/arkserver/_default.cfg b/lgsm/config-default/config-lgsm/arkserver/_default.cfg index e3fb9654e5..6e3b466fd8 100644 --- a/lgsm/config-default/config-lgsm/arkserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/arkserver/_default.cfg @@ -57,14 +57,6 @@ 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" diff --git a/lgsm/config-default/config-lgsm/arma3server/_default.cfg b/lgsm/config-default/config-lgsm/arma3server/_default.cfg index 60662bed2b..8a59a6fb1f 100644 --- a/lgsm/config-default/config-lgsm/arma3server/_default.cfg +++ b/lgsm/config-default/config-lgsm/arma3server/_default.cfg @@ -70,14 +70,6 @@ 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" diff --git a/lgsm/config-default/config-lgsm/armarserver/_default.cfg b/lgsm/config-default/config-lgsm/armarserver/_default.cfg index faf64c559a..913447e473 100644 --- a/lgsm/config-default/config-lgsm/armarserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/armarserver/_default.cfg @@ -55,14 +55,6 @@ 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" diff --git a/lgsm/config-default/config-lgsm/atsserver/_default.cfg b/lgsm/config-default/config-lgsm/atsserver/_default.cfg index 3274e757e2..04b795dc58 100644 --- a/lgsm/config-default/config-lgsm/atsserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/atsserver/_default.cfg @@ -47,14 +47,6 @@ 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" diff --git a/lgsm/config-default/config-lgsm/avserver/_default.cfg b/lgsm/config-default/config-lgsm/avserver/_default.cfg index 532740d574..45cd149b2f 100644 --- a/lgsm/config-default/config-lgsm/avserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/avserver/_default.cfg @@ -47,14 +47,6 @@ 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" diff --git a/lgsm/config-default/config-lgsm/bb2server/_default.cfg b/lgsm/config-default/config-lgsm/bb2server/_default.cfg index 396893061b..4076878d49 100644 --- a/lgsm/config-default/config-lgsm/bb2server/_default.cfg +++ b/lgsm/config-default/config-lgsm/bb2server/_default.cfg @@ -60,14 +60,6 @@ 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" diff --git a/lgsm/config-default/config-lgsm/bbserver/_default.cfg b/lgsm/config-default/config-lgsm/bbserver/_default.cfg index 32621c7be5..9932d4ffec 100644 --- a/lgsm/config-default/config-lgsm/bbserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/bbserver/_default.cfg @@ -54,14 +54,6 @@ 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" diff --git a/lgsm/config-default/config-lgsm/bdserver/_default.cfg b/lgsm/config-default/config-lgsm/bdserver/_default.cfg index 23bf711968..7fcdb4e1d6 100644 --- a/lgsm/config-default/config-lgsm/bdserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/bdserver/_default.cfg @@ -54,14 +54,6 @@ 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" diff --git a/lgsm/config-default/config-lgsm/bf1942server/_default.cfg b/lgsm/config-default/config-lgsm/bf1942server/_default.cfg index 8cbcd35a1e..d990685225 100644 --- a/lgsm/config-default/config-lgsm/bf1942server/_default.cfg +++ b/lgsm/config-default/config-lgsm/bf1942server/_default.cfg @@ -47,14 +47,6 @@ 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" diff --git a/lgsm/config-default/config-lgsm/bfvserver/_default.cfg b/lgsm/config-default/config-lgsm/bfvserver/_default.cfg index 2c56721068..c6e4b8bb7b 100644 --- a/lgsm/config-default/config-lgsm/bfvserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/bfvserver/_default.cfg @@ -47,14 +47,6 @@ 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" diff --git a/lgsm/config-default/config-lgsm/bmdmserver/_default.cfg b/lgsm/config-default/config-lgsm/bmdmserver/_default.cfg index 659e1abd79..b17a16f4dc 100644 --- a/lgsm/config-default/config-lgsm/bmdmserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/bmdmserver/_default.cfg @@ -60,14 +60,6 @@ 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" diff --git a/lgsm/config-default/config-lgsm/boserver/_default.cfg b/lgsm/config-default/config-lgsm/boserver/_default.cfg index a56292a3a1..1ede22c39e 100644 --- a/lgsm/config-default/config-lgsm/boserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/boserver/_default.cfg @@ -52,14 +52,6 @@ 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" diff --git a/lgsm/config-default/config-lgsm/bsserver/_default.cfg b/lgsm/config-default/config-lgsm/bsserver/_default.cfg index 503cde7b52..d01696170d 100644 --- a/lgsm/config-default/config-lgsm/bsserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/bsserver/_default.cfg @@ -64,14 +64,6 @@ 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" diff --git a/lgsm/config-default/config-lgsm/btlserver/_default.cfg b/lgsm/config-default/config-lgsm/btlserver/_default.cfg index e26ca7e77b..aeaadea9b3 100644 --- a/lgsm/config-default/config-lgsm/btlserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/btlserver/_default.cfg @@ -52,14 +52,6 @@ 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" diff --git a/lgsm/config-default/config-lgsm/btserver/_default.cfg b/lgsm/config-default/config-lgsm/btserver/_default.cfg index 8c32ee2d4d..6361365806 100644 --- a/lgsm/config-default/config-lgsm/btserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/btserver/_default.cfg @@ -47,14 +47,6 @@ 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" diff --git a/lgsm/config-default/config-lgsm/ccserver/_default.cfg b/lgsm/config-default/config-lgsm/ccserver/_default.cfg index 3aaa47dca6..1b8617e119 100644 --- a/lgsm/config-default/config-lgsm/ccserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/ccserver/_default.cfg @@ -55,14 +55,6 @@ 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" diff --git a/lgsm/config-default/config-lgsm/cdserver/_default.cfg b/lgsm/config-default/config-lgsm/cdserver/_default.cfg index 419eb5e3d3..69e4ee51e9 100644 --- a/lgsm/config-default/config-lgsm/cdserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/cdserver/_default.cfg @@ -47,14 +47,6 @@ 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" diff --git a/lgsm/config-default/config-lgsm/ckserver/_default.cfg b/lgsm/config-default/config-lgsm/ckserver/_default.cfg index 164fd85f90..fe3d56f44d 100644 --- a/lgsm/config-default/config-lgsm/ckserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/ckserver/_default.cfg @@ -51,14 +51,6 @@ 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" diff --git a/lgsm/config-default/config-lgsm/cmwserver/_default.cfg b/lgsm/config-default/config-lgsm/cmwserver/_default.cfg index a03f04dd22..d0fe00b0de 100644 --- a/lgsm/config-default/config-lgsm/cmwserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/cmwserver/_default.cfg @@ -53,14 +53,6 @@ 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" diff --git a/lgsm/config-default/config-lgsm/cod2server/_default.cfg b/lgsm/config-default/config-lgsm/cod2server/_default.cfg index e27276e2f7..8f0d889d01 100644 --- a/lgsm/config-default/config-lgsm/cod2server/_default.cfg +++ b/lgsm/config-default/config-lgsm/cod2server/_default.cfg @@ -53,14 +53,6 @@ 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" diff --git a/lgsm/config-default/config-lgsm/cod4server/_default.cfg b/lgsm/config-default/config-lgsm/cod4server/_default.cfg index fb46bcec65..6fce7fea3d 100644 --- a/lgsm/config-default/config-lgsm/cod4server/_default.cfg +++ b/lgsm/config-default/config-lgsm/cod4server/_default.cfg @@ -53,14 +53,6 @@ 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" diff --git a/lgsm/config-default/config-lgsm/codserver/_default.cfg b/lgsm/config-default/config-lgsm/codserver/_default.cfg index 89631a67d6..9929f26262 100644 --- a/lgsm/config-default/config-lgsm/codserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/codserver/_default.cfg @@ -53,14 +53,6 @@ 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" diff --git a/lgsm/config-default/config-lgsm/coduoserver/_default.cfg b/lgsm/config-default/config-lgsm/coduoserver/_default.cfg index 2c26a36bb4..1719eb8f77 100644 --- a/lgsm/config-default/config-lgsm/coduoserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/coduoserver/_default.cfg @@ -53,14 +53,6 @@ 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" diff --git a/lgsm/config-default/config-lgsm/codwawserver/_default.cfg b/lgsm/config-default/config-lgsm/codwawserver/_default.cfg index 2943f832d2..c7169f1709 100644 --- a/lgsm/config-default/config-lgsm/codwawserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/codwawserver/_default.cfg @@ -53,14 +53,6 @@ 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" diff --git a/lgsm/config-default/config-lgsm/colserver/_default.cfg b/lgsm/config-default/config-lgsm/colserver/_default.cfg index 9a88956f73..4d2f04cd23 100644 --- a/lgsm/config-default/config-lgsm/colserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/colserver/_default.cfg @@ -48,14 +48,6 @@ 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" diff --git a/lgsm/config-default/config-lgsm/csczserver/_default.cfg b/lgsm/config-default/config-lgsm/csczserver/_default.cfg index c8996acd79..a3f49922be 100644 --- a/lgsm/config-default/config-lgsm/csczserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/csczserver/_default.cfg @@ -54,14 +54,6 @@ 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" diff --git a/lgsm/config-default/config-lgsm/csgoserver/_default.cfg b/lgsm/config-default/config-lgsm/csgoserver/_default.cfg index e030a98961..f9d0acf1ab 100644 --- a/lgsm/config-default/config-lgsm/csgoserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/csgoserver/_default.cfg @@ -91,14 +91,6 @@ 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" diff --git a/lgsm/config-default/config-lgsm/csserver/_default.cfg b/lgsm/config-default/config-lgsm/csserver/_default.cfg index d81af84dc7..87a132f3d9 100644 --- a/lgsm/config-default/config-lgsm/csserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/csserver/_default.cfg @@ -54,14 +54,6 @@ 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" diff --git a/lgsm/config-default/config-lgsm/cssserver/_default.cfg b/lgsm/config-default/config-lgsm/cssserver/_default.cfg index 018842405a..612aeb0f17 100644 --- a/lgsm/config-default/config-lgsm/cssserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/cssserver/_default.cfg @@ -60,14 +60,6 @@ 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" diff --git a/lgsm/config-default/config-lgsm/ctserver/_default.cfg b/lgsm/config-default/config-lgsm/ctserver/_default.cfg index 205c4e8c22..2c31d5cc6b 100644 --- a/lgsm/config-default/config-lgsm/ctserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/ctserver/_default.cfg @@ -47,14 +47,6 @@ 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" diff --git a/lgsm/config-default/config-lgsm/dabserver/_default.cfg b/lgsm/config-default/config-lgsm/dabserver/_default.cfg index 002ed20331..84ea667e40 100644 --- a/lgsm/config-default/config-lgsm/dabserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/dabserver/_default.cfg @@ -55,14 +55,6 @@ 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" diff --git a/lgsm/config-default/config-lgsm/dayzserver/_default.cfg b/lgsm/config-default/config-lgsm/dayzserver/_default.cfg index 8ec58f0695..01eb4509e6 100644 --- a/lgsm/config-default/config-lgsm/dayzserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/dayzserver/_default.cfg @@ -66,14 +66,6 @@ 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" diff --git a/lgsm/config-default/config-lgsm/dmcserver/_default.cfg b/lgsm/config-default/config-lgsm/dmcserver/_default.cfg index 5ea5c1352c..f46fe5025c 100644 --- a/lgsm/config-default/config-lgsm/dmcserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/dmcserver/_default.cfg @@ -54,14 +54,6 @@ 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" diff --git a/lgsm/config-default/config-lgsm/dodrserver/_default.cfg b/lgsm/config-default/config-lgsm/dodrserver/_default.cfg index cae228a0c7..d692fdfa7f 100644 --- a/lgsm/config-default/config-lgsm/dodrserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/dodrserver/_default.cfg @@ -53,14 +53,6 @@ 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" diff --git a/lgsm/config-default/config-lgsm/dodserver/_default.cfg b/lgsm/config-default/config-lgsm/dodserver/_default.cfg index 7bd86724b3..b2940a658b 100644 --- a/lgsm/config-default/config-lgsm/dodserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/dodserver/_default.cfg @@ -54,14 +54,6 @@ 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" diff --git a/lgsm/config-default/config-lgsm/dodsserver/_default.cfg b/lgsm/config-default/config-lgsm/dodsserver/_default.cfg index af4a32dc22..9ff0cfa964 100644 --- a/lgsm/config-default/config-lgsm/dodsserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/dodsserver/_default.cfg @@ -55,14 +55,6 @@ 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" diff --git a/lgsm/config-default/config-lgsm/doiserver/_default.cfg b/lgsm/config-default/config-lgsm/doiserver/_default.cfg index 1c99abaa7e..1580d58b29 100644 --- a/lgsm/config-default/config-lgsm/doiserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/doiserver/_default.cfg @@ -56,14 +56,6 @@ 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" diff --git a/lgsm/config-default/config-lgsm/dstserver/_default.cfg b/lgsm/config-default/config-lgsm/dstserver/_default.cfg index 7063274603..8b404391db 100644 --- a/lgsm/config-default/config-lgsm/dstserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/dstserver/_default.cfg @@ -58,14 +58,6 @@ 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" diff --git a/lgsm/config-default/config-lgsm/dysserver/_default.cfg b/lgsm/config-default/config-lgsm/dysserver/_default.cfg index 96d12d6770..907482a367 100644 --- a/lgsm/config-default/config-lgsm/dysserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/dysserver/_default.cfg @@ -60,14 +60,6 @@ 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" diff --git a/lgsm/config-default/config-lgsm/ecoserver/_default.cfg b/lgsm/config-default/config-lgsm/ecoserver/_default.cfg index 475edb4baf..ae4bfa681d 100644 --- a/lgsm/config-default/config-lgsm/ecoserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/ecoserver/_default.cfg @@ -47,14 +47,6 @@ 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" diff --git a/lgsm/config-default/config-lgsm/emserver/_default.cfg b/lgsm/config-default/config-lgsm/emserver/_default.cfg index 8f935152fc..33fb4f849f 100644 --- a/lgsm/config-default/config-lgsm/emserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/emserver/_default.cfg @@ -60,14 +60,6 @@ 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" diff --git a/lgsm/config-default/config-lgsm/etlserver/_default.cfg b/lgsm/config-default/config-lgsm/etlserver/_default.cfg index c0c97cd2a3..034f29c5de 100644 --- a/lgsm/config-default/config-lgsm/etlserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/etlserver/_default.cfg @@ -47,14 +47,6 @@ 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" diff --git a/lgsm/config-default/config-lgsm/ets2server/_default.cfg b/lgsm/config-default/config-lgsm/ets2server/_default.cfg index a18d6ca79e..215ab2b41d 100644 --- a/lgsm/config-default/config-lgsm/ets2server/_default.cfg +++ b/lgsm/config-default/config-lgsm/ets2server/_default.cfg @@ -47,14 +47,6 @@ 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" diff --git a/lgsm/config-default/config-lgsm/fctrserver/_default.cfg b/lgsm/config-default/config-lgsm/fctrserver/_default.cfg index d35c360500..6b03f9a301 100644 --- a/lgsm/config-default/config-lgsm/fctrserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/fctrserver/_default.cfg @@ -54,14 +54,6 @@ 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" diff --git a/lgsm/config-default/config-lgsm/fofserver/_default.cfg b/lgsm/config-default/config-lgsm/fofserver/_default.cfg index f85822d30b..41dae637a5 100644 --- a/lgsm/config-default/config-lgsm/fofserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/fofserver/_default.cfg @@ -55,14 +55,6 @@ 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" diff --git a/lgsm/config-default/config-lgsm/gmodserver/_default.cfg b/lgsm/config-default/config-lgsm/gmodserver/_default.cfg index 31a6ceedf4..b170c34365 100644 --- a/lgsm/config-default/config-lgsm/gmodserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/gmodserver/_default.cfg @@ -67,14 +67,6 @@ 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" diff --git a/lgsm/config-default/config-lgsm/hcuserver/_default.cfg b/lgsm/config-default/config-lgsm/hcuserver/_default.cfg index b53af15d38..00b0b30c7e 100644 --- a/lgsm/config-default/config-lgsm/hcuserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/hcuserver/_default.cfg @@ -62,14 +62,6 @@ 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" diff --git a/lgsm/config-default/config-lgsm/hl2dmserver/_default.cfg b/lgsm/config-default/config-lgsm/hl2dmserver/_default.cfg index 74a75fc218..8bbf8fdec4 100644 --- a/lgsm/config-default/config-lgsm/hl2dmserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/hl2dmserver/_default.cfg @@ -55,14 +55,6 @@ 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" diff --git a/lgsm/config-default/config-lgsm/hldmserver/_default.cfg b/lgsm/config-default/config-lgsm/hldmserver/_default.cfg index c94297f1fd..f78e1542b9 100644 --- a/lgsm/config-default/config-lgsm/hldmserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/hldmserver/_default.cfg @@ -54,14 +54,6 @@ 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" diff --git a/lgsm/config-default/config-lgsm/hldmsserver/_default.cfg b/lgsm/config-default/config-lgsm/hldmsserver/_default.cfg index 32d5fe7910..fd854b0c24 100644 --- a/lgsm/config-default/config-lgsm/hldmsserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/hldmsserver/_default.cfg @@ -55,14 +55,6 @@ 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" diff --git a/lgsm/config-default/config-lgsm/hwserver/_default.cfg b/lgsm/config-default/config-lgsm/hwserver/_default.cfg index 923865478d..99b08e3580 100644 --- a/lgsm/config-default/config-lgsm/hwserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/hwserver/_default.cfg @@ -65,14 +65,6 @@ 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" diff --git a/lgsm/config-default/config-lgsm/insserver/_default.cfg b/lgsm/config-default/config-lgsm/insserver/_default.cfg index 8b6b599f34..69d0958819 100644 --- a/lgsm/config-default/config-lgsm/insserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/insserver/_default.cfg @@ -61,14 +61,6 @@ 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" diff --git a/lgsm/config-default/config-lgsm/inssserver/_default.cfg b/lgsm/config-default/config-lgsm/inssserver/_default.cfg index 076b61ecbb..6a7313c7b9 100644 --- a/lgsm/config-default/config-lgsm/inssserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/inssserver/_default.cfg @@ -64,14 +64,6 @@ 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" diff --git a/lgsm/config-default/config-lgsm/iosserver/_default.cfg b/lgsm/config-default/config-lgsm/iosserver/_default.cfg index 48c5511c7e..365a3dee24 100644 --- a/lgsm/config-default/config-lgsm/iosserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/iosserver/_default.cfg @@ -55,14 +55,6 @@ 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" diff --git a/lgsm/config-default/config-lgsm/jc2server/_default.cfg b/lgsm/config-default/config-lgsm/jc2server/_default.cfg index 0610507d6b..69bc8018b3 100644 --- a/lgsm/config-default/config-lgsm/jc2server/_default.cfg +++ b/lgsm/config-default/config-lgsm/jc2server/_default.cfg @@ -47,14 +47,6 @@ 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" diff --git a/lgsm/config-default/config-lgsm/jc3server/_default.cfg b/lgsm/config-default/config-lgsm/jc3server/_default.cfg index c2cac1cfee..8725419615 100644 --- a/lgsm/config-default/config-lgsm/jc3server/_default.cfg +++ b/lgsm/config-default/config-lgsm/jc3server/_default.cfg @@ -47,14 +47,6 @@ 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" diff --git a/lgsm/config-default/config-lgsm/jk2server/_default.cfg b/lgsm/config-default/config-lgsm/jk2server/_default.cfg index 5b7f6b8933..4313daa58f 100644 --- a/lgsm/config-default/config-lgsm/jk2server/_default.cfg +++ b/lgsm/config-default/config-lgsm/jk2server/_default.cfg @@ -56,14 +56,6 @@ 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" diff --git a/lgsm/config-default/config-lgsm/kf2server/_default.cfg b/lgsm/config-default/config-lgsm/kf2server/_default.cfg index 6d71d63514..88fe360be7 100644 --- a/lgsm/config-default/config-lgsm/kf2server/_default.cfg +++ b/lgsm/config-default/config-lgsm/kf2server/_default.cfg @@ -53,14 +53,6 @@ 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" diff --git a/lgsm/config-default/config-lgsm/kfserver/_default.cfg b/lgsm/config-default/config-lgsm/kfserver/_default.cfg index 362dfa54fa..92cfd258cb 100644 --- a/lgsm/config-default/config-lgsm/kfserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/kfserver/_default.cfg @@ -59,14 +59,6 @@ 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" diff --git a/lgsm/config-default/config-lgsm/l4d2server/_default.cfg b/lgsm/config-default/config-lgsm/l4d2server/_default.cfg index 4a04cac2ce..96c2cc5bc5 100644 --- a/lgsm/config-default/config-lgsm/l4d2server/_default.cfg +++ b/lgsm/config-default/config-lgsm/l4d2server/_default.cfg @@ -54,14 +54,6 @@ 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" diff --git a/lgsm/config-default/config-lgsm/l4dserver/_default.cfg b/lgsm/config-default/config-lgsm/l4dserver/_default.cfg index 9447b28236..2b5a64be61 100644 --- a/lgsm/config-default/config-lgsm/l4dserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/l4dserver/_default.cfg @@ -54,14 +54,6 @@ 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" diff --git a/lgsm/config-default/config-lgsm/loserver/_default.cfg b/lgsm/config-default/config-lgsm/loserver/_default.cfg index 7df8a8f3d2..5a205d88f8 100644 --- a/lgsm/config-default/config-lgsm/loserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/loserver/_default.cfg @@ -58,14 +58,6 @@ 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" diff --git a/lgsm/config-default/config-lgsm/mcbserver/_default.cfg b/lgsm/config-default/config-lgsm/mcbserver/_default.cfg index 8ffc45667e..c4d9d54556 100644 --- a/lgsm/config-default/config-lgsm/mcbserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/mcbserver/_default.cfg @@ -50,14 +50,6 @@ 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" diff --git a/lgsm/config-default/config-lgsm/mcserver/_default.cfg b/lgsm/config-default/config-lgsm/mcserver/_default.cfg index 269e96f8b3..cd2a808499 100644 --- a/lgsm/config-default/config-lgsm/mcserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/mcserver/_default.cfg @@ -56,14 +56,6 @@ 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" diff --git a/lgsm/config-default/config-lgsm/mhserver/_default.cfg b/lgsm/config-default/config-lgsm/mhserver/_default.cfg index 8a9b2331ec..4be0fab642 100644 --- a/lgsm/config-default/config-lgsm/mhserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/mhserver/_default.cfg @@ -55,14 +55,6 @@ 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" diff --git a/lgsm/config-default/config-lgsm/mohaaserver/_default.cfg b/lgsm/config-default/config-lgsm/mohaaserver/_default.cfg index 490767e4ad..cbfbcfb92d 100644 --- a/lgsm/config-default/config-lgsm/mohaaserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/mohaaserver/_default.cfg @@ -52,14 +52,6 @@ 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" diff --git a/lgsm/config-default/config-lgsm/momserver/_default.cfg b/lgsm/config-default/config-lgsm/momserver/_default.cfg index 3219ae662f..670e7b3a78 100644 --- a/lgsm/config-default/config-lgsm/momserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/momserver/_default.cfg @@ -52,14 +52,6 @@ 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" diff --git a/lgsm/config-default/config-lgsm/mtaserver/_default.cfg b/lgsm/config-default/config-lgsm/mtaserver/_default.cfg index 5ab7c32832..8397146b8b 100644 --- a/lgsm/config-default/config-lgsm/mtaserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/mtaserver/_default.cfg @@ -51,14 +51,6 @@ 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" diff --git a/lgsm/config-default/config-lgsm/ndserver/_default.cfg b/lgsm/config-default/config-lgsm/ndserver/_default.cfg index 30ee62109f..de3a3aaecd 100644 --- a/lgsm/config-default/config-lgsm/ndserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/ndserver/_default.cfg @@ -55,14 +55,6 @@ 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" diff --git a/lgsm/config-default/config-lgsm/necserver/_default.cfg b/lgsm/config-default/config-lgsm/necserver/_default.cfg index 30290acb56..4857107c81 100644 --- a/lgsm/config-default/config-lgsm/necserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/necserver/_default.cfg @@ -50,14 +50,6 @@ 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" diff --git a/lgsm/config-default/config-lgsm/nmrihserver/_default.cfg b/lgsm/config-default/config-lgsm/nmrihserver/_default.cfg index d3dfa30d3e..e3b56f545f 100644 --- a/lgsm/config-default/config-lgsm/nmrihserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/nmrihserver/_default.cfg @@ -60,14 +60,6 @@ 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" diff --git a/lgsm/config-default/config-lgsm/ns2cserver/_default.cfg b/lgsm/config-default/config-lgsm/ns2cserver/_default.cfg index ce44d932d0..4579d3bb05 100644 --- a/lgsm/config-default/config-lgsm/ns2cserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/ns2cserver/_default.cfg @@ -62,14 +62,6 @@ 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" diff --git a/lgsm/config-default/config-lgsm/ns2server/_default.cfg b/lgsm/config-default/config-lgsm/ns2server/_default.cfg index fdb0252f15..9f09491cff 100644 --- a/lgsm/config-default/config-lgsm/ns2server/_default.cfg +++ b/lgsm/config-default/config-lgsm/ns2server/_default.cfg @@ -62,14 +62,6 @@ 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" diff --git a/lgsm/config-default/config-lgsm/nsserver/_default.cfg b/lgsm/config-default/config-lgsm/nsserver/_default.cfg index 44faa5b953..7880222faf 100644 --- a/lgsm/config-default/config-lgsm/nsserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/nsserver/_default.cfg @@ -54,14 +54,6 @@ 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" diff --git a/lgsm/config-default/config-lgsm/ohdserver/_default.cfg b/lgsm/config-default/config-lgsm/ohdserver/_default.cfg index afc11d09fe..25a418edc4 100644 --- a/lgsm/config-default/config-lgsm/ohdserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/ohdserver/_default.cfg @@ -57,14 +57,6 @@ 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" diff --git a/lgsm/config-default/config-lgsm/onsetserver/_default.cfg b/lgsm/config-default/config-lgsm/onsetserver/_default.cfg index ffbcabdc33..b25cfb60c2 100644 --- a/lgsm/config-default/config-lgsm/onsetserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/onsetserver/_default.cfg @@ -47,14 +47,6 @@ 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" diff --git a/lgsm/config-default/config-lgsm/opforserver/_default.cfg b/lgsm/config-default/config-lgsm/opforserver/_default.cfg index c04666dfde..a0785a4b61 100644 --- a/lgsm/config-default/config-lgsm/opforserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/opforserver/_default.cfg @@ -54,14 +54,6 @@ 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" diff --git a/lgsm/config-default/config-lgsm/pc2server/_default.cfg b/lgsm/config-default/config-lgsm/pc2server/_default.cfg index 37efdd8245..1b9a6e6f13 100644 --- a/lgsm/config-default/config-lgsm/pc2server/_default.cfg +++ b/lgsm/config-default/config-lgsm/pc2server/_default.cfg @@ -51,14 +51,6 @@ 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" diff --git a/lgsm/config-default/config-lgsm/pcserver/_default.cfg b/lgsm/config-default/config-lgsm/pcserver/_default.cfg index e70ce6d261..1d4b153944 100644 --- a/lgsm/config-default/config-lgsm/pcserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/pcserver/_default.cfg @@ -47,14 +47,6 @@ 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" diff --git a/lgsm/config-default/config-lgsm/pmcserver/_default.cfg b/lgsm/config-default/config-lgsm/pmcserver/_default.cfg index 984ebb4708..430daefbe7 100644 --- a/lgsm/config-default/config-lgsm/pmcserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/pmcserver/_default.cfg @@ -54,14 +54,6 @@ 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" diff --git a/lgsm/config-default/config-lgsm/psserver/_default.cfg b/lgsm/config-default/config-lgsm/psserver/_default.cfg index d028fad57b..9d8fa93831 100644 --- a/lgsm/config-default/config-lgsm/psserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/psserver/_default.cfg @@ -56,14 +56,6 @@ 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" diff --git a/lgsm/config-default/config-lgsm/pvkiiserver/_default.cfg b/lgsm/config-default/config-lgsm/pvkiiserver/_default.cfg index e3e96a8ff7..7f8adbf5fb 100644 --- a/lgsm/config-default/config-lgsm/pvkiiserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/pvkiiserver/_default.cfg @@ -55,14 +55,6 @@ 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" diff --git a/lgsm/config-default/config-lgsm/pvrserver/_default.cfg b/lgsm/config-default/config-lgsm/pvrserver/_default.cfg index 5063868b0e..12e089fe09 100644 --- a/lgsm/config-default/config-lgsm/pvrserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/pvrserver/_default.cfg @@ -55,14 +55,6 @@ 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" diff --git a/lgsm/config-default/config-lgsm/pzserver/_default.cfg b/lgsm/config-default/config-lgsm/pzserver/_default.cfg index b82f136edd..a3a5ac3401 100644 --- a/lgsm/config-default/config-lgsm/pzserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/pzserver/_default.cfg @@ -51,14 +51,6 @@ 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" diff --git a/lgsm/config-default/config-lgsm/q2server/_default.cfg b/lgsm/config-default/config-lgsm/q2server/_default.cfg index aa07f21b72..0d899df65f 100644 --- a/lgsm/config-default/config-lgsm/q2server/_default.cfg +++ b/lgsm/config-default/config-lgsm/q2server/_default.cfg @@ -52,14 +52,6 @@ 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" diff --git a/lgsm/config-default/config-lgsm/q3server/_default.cfg b/lgsm/config-default/config-lgsm/q3server/_default.cfg index eacb870494..e53fb4285c 100644 --- a/lgsm/config-default/config-lgsm/q3server/_default.cfg +++ b/lgsm/config-default/config-lgsm/q3server/_default.cfg @@ -52,14 +52,6 @@ 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" diff --git a/lgsm/config-default/config-lgsm/qlserver/_default.cfg b/lgsm/config-default/config-lgsm/qlserver/_default.cfg index f6b5342e0d..3f28329ac8 100644 --- a/lgsm/config-default/config-lgsm/qlserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/qlserver/_default.cfg @@ -47,14 +47,6 @@ 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" diff --git a/lgsm/config-default/config-lgsm/qwserver/_default.cfg b/lgsm/config-default/config-lgsm/qwserver/_default.cfg index 5f62888795..95dea75f8e 100644 --- a/lgsm/config-default/config-lgsm/qwserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/qwserver/_default.cfg @@ -51,14 +51,6 @@ 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" diff --git a/lgsm/config-default/config-lgsm/ricochetserver/_default.cfg b/lgsm/config-default/config-lgsm/ricochetserver/_default.cfg index b1bb3e7943..419825ec10 100644 --- a/lgsm/config-default/config-lgsm/ricochetserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/ricochetserver/_default.cfg @@ -54,14 +54,6 @@ 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" diff --git a/lgsm/config-default/config-lgsm/roserver/_default.cfg b/lgsm/config-default/config-lgsm/roserver/_default.cfg index 8e4fe21a6e..4617289fd5 100644 --- a/lgsm/config-default/config-lgsm/roserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/roserver/_default.cfg @@ -55,14 +55,6 @@ 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" diff --git a/lgsm/config-default/config-lgsm/rtcwserver/_default.cfg b/lgsm/config-default/config-lgsm/rtcwserver/_default.cfg index d99061bdb3..159b8dfd4f 100644 --- a/lgsm/config-default/config-lgsm/rtcwserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/rtcwserver/_default.cfg @@ -52,14 +52,6 @@ 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" diff --git a/lgsm/config-default/config-lgsm/rustserver/_default.cfg b/lgsm/config-default/config-lgsm/rustserver/_default.cfg index a07838143f..fc955a94a1 100644 --- a/lgsm/config-default/config-lgsm/rustserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/rustserver/_default.cfg @@ -66,14 +66,6 @@ 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" diff --git a/lgsm/config-default/config-lgsm/rwserver/_default.cfg b/lgsm/config-default/config-lgsm/rwserver/_default.cfg index 74288a4f8a..c714045ca3 100644 --- a/lgsm/config-default/config-lgsm/rwserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/rwserver/_default.cfg @@ -47,14 +47,6 @@ 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" diff --git a/lgsm/config-default/config-lgsm/sampserver/_default.cfg b/lgsm/config-default/config-lgsm/sampserver/_default.cfg index 709c9922c4..448f8c20f2 100644 --- a/lgsm/config-default/config-lgsm/sampserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/sampserver/_default.cfg @@ -51,14 +51,6 @@ 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" diff --git a/lgsm/config-default/config-lgsm/sbotsserver/_default.cfg b/lgsm/config-default/config-lgsm/sbotsserver/_default.cfg index 50c2a4e76a..0107c39d58 100644 --- a/lgsm/config-default/config-lgsm/sbotsserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/sbotsserver/_default.cfg @@ -53,14 +53,6 @@ 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" diff --git a/lgsm/config-default/config-lgsm/sbserver/_default.cfg b/lgsm/config-default/config-lgsm/sbserver/_default.cfg index 733267b4b5..79e4474543 100644 --- a/lgsm/config-default/config-lgsm/sbserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/sbserver/_default.cfg @@ -54,14 +54,6 @@ 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" diff --git a/lgsm/config-default/config-lgsm/scpslserver/_default.cfg b/lgsm/config-default/config-lgsm/scpslserver/_default.cfg index 100de02a89..ad2e2f9d53 100644 --- a/lgsm/config-default/config-lgsm/scpslserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/scpslserver/_default.cfg @@ -52,14 +52,6 @@ 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" diff --git a/lgsm/config-default/config-lgsm/scpslsmserver/_default.cfg b/lgsm/config-default/config-lgsm/scpslsmserver/_default.cfg index 1e041e93bf..6c7a7b3caf 100644 --- a/lgsm/config-default/config-lgsm/scpslsmserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/scpslsmserver/_default.cfg @@ -52,14 +52,6 @@ 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" diff --git a/lgsm/config-default/config-lgsm/sdtdserver/_default.cfg b/lgsm/config-default/config-lgsm/sdtdserver/_default.cfg index 7775f16abd..b2c8e00f0e 100644 --- a/lgsm/config-default/config-lgsm/sdtdserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/sdtdserver/_default.cfg @@ -50,14 +50,6 @@ 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" diff --git a/lgsm/config-default/config-lgsm/sfcserver/_default.cfg b/lgsm/config-default/config-lgsm/sfcserver/_default.cfg index f642619932..b566de6906 100644 --- a/lgsm/config-default/config-lgsm/sfcserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/sfcserver/_default.cfg @@ -55,14 +55,6 @@ 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" diff --git a/lgsm/config-default/config-lgsm/sfserver/_default.cfg b/lgsm/config-default/config-lgsm/sfserver/_default.cfg index bc25dccfa5..46d0ebf881 100644 --- a/lgsm/config-default/config-lgsm/sfserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/sfserver/_default.cfg @@ -53,14 +53,6 @@ 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" diff --git a/lgsm/config-default/config-lgsm/sof2server/_default.cfg b/lgsm/config-default/config-lgsm/sof2server/_default.cfg index 282c8166dc..6169950c0b 100644 --- a/lgsm/config-default/config-lgsm/sof2server/_default.cfg +++ b/lgsm/config-default/config-lgsm/sof2server/_default.cfg @@ -52,14 +52,6 @@ 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" diff --git a/lgsm/config-default/config-lgsm/solserver/_default.cfg b/lgsm/config-default/config-lgsm/solserver/_default.cfg index aa8d02d5a3..671dcd4292 100644 --- a/lgsm/config-default/config-lgsm/solserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/solserver/_default.cfg @@ -51,14 +51,6 @@ 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" diff --git a/lgsm/config-default/config-lgsm/squadserver/_default.cfg b/lgsm/config-default/config-lgsm/squadserver/_default.cfg index 432b5a4023..dbaa3c7363 100644 --- a/lgsm/config-default/config-lgsm/squadserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/squadserver/_default.cfg @@ -52,14 +52,6 @@ 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" diff --git a/lgsm/config-default/config-lgsm/stnserver/_default.cfg b/lgsm/config-default/config-lgsm/stnserver/_default.cfg index 463e808ed8..8531c111bc 100644 --- a/lgsm/config-default/config-lgsm/stnserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/stnserver/_default.cfg @@ -51,14 +51,6 @@ 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" diff --git a/lgsm/config-default/config-lgsm/stserver/_default.cfg b/lgsm/config-default/config-lgsm/stserver/_default.cfg index eef67827fa..0d8f9317f0 100644 --- a/lgsm/config-default/config-lgsm/stserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/stserver/_default.cfg @@ -52,14 +52,6 @@ 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" diff --git a/lgsm/config-default/config-lgsm/svenserver/_default.cfg b/lgsm/config-default/config-lgsm/svenserver/_default.cfg index 309e73d046..7f47091e46 100644 --- a/lgsm/config-default/config-lgsm/svenserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/svenserver/_default.cfg @@ -54,14 +54,6 @@ 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" diff --git a/lgsm/config-default/config-lgsm/terrariaserver/_default.cfg b/lgsm/config-default/config-lgsm/terrariaserver/_default.cfg index ea0d549be8..562b0fd9b8 100644 --- a/lgsm/config-default/config-lgsm/terrariaserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/terrariaserver/_default.cfg @@ -54,14 +54,6 @@ 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" diff --git a/lgsm/config-default/config-lgsm/tf2server/_default.cfg b/lgsm/config-default/config-lgsm/tf2server/_default.cfg index 851e803864..d7d53928b3 100644 --- a/lgsm/config-default/config-lgsm/tf2server/_default.cfg +++ b/lgsm/config-default/config-lgsm/tf2server/_default.cfg @@ -60,14 +60,6 @@ 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" diff --git a/lgsm/config-default/config-lgsm/tfcserver/_default.cfg b/lgsm/config-default/config-lgsm/tfcserver/_default.cfg index c0c09ec66a..6709767a98 100644 --- a/lgsm/config-default/config-lgsm/tfcserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/tfcserver/_default.cfg @@ -54,14 +54,6 @@ 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" diff --git a/lgsm/config-default/config-lgsm/tiserver/_default.cfg b/lgsm/config-default/config-lgsm/tiserver/_default.cfg index 6e04a4d324..994a2574af 100644 --- a/lgsm/config-default/config-lgsm/tiserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/tiserver/_default.cfg @@ -52,14 +52,6 @@ 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" diff --git a/lgsm/config-default/config-lgsm/ts3server/_default.cfg b/lgsm/config-default/config-lgsm/ts3server/_default.cfg index 8dff8f7f82..dc3e7a3fa1 100644 --- a/lgsm/config-default/config-lgsm/ts3server/_default.cfg +++ b/lgsm/config-default/config-lgsm/ts3server/_default.cfg @@ -47,14 +47,6 @@ 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" diff --git a/lgsm/config-default/config-lgsm/tsserver/_default.cfg b/lgsm/config-default/config-lgsm/tsserver/_default.cfg index 8eb00e73ad..c9ea3b3819 100644 --- a/lgsm/config-default/config-lgsm/tsserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/tsserver/_default.cfg @@ -54,14 +54,6 @@ 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" diff --git a/lgsm/config-default/config-lgsm/tuserver/_default.cfg b/lgsm/config-default/config-lgsm/tuserver/_default.cfg index f627408181..551ce95f46 100644 --- a/lgsm/config-default/config-lgsm/tuserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/tuserver/_default.cfg @@ -57,14 +57,6 @@ 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" diff --git a/lgsm/config-default/config-lgsm/twserver/_default.cfg b/lgsm/config-default/config-lgsm/twserver/_default.cfg index 13edffe2f5..d7e84704a4 100644 --- a/lgsm/config-default/config-lgsm/twserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/twserver/_default.cfg @@ -54,14 +54,6 @@ 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" diff --git a/lgsm/config-default/config-lgsm/untserver/_default.cfg b/lgsm/config-default/config-lgsm/untserver/_default.cfg index fc17189676..b250d32842 100644 --- a/lgsm/config-default/config-lgsm/untserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/untserver/_default.cfg @@ -61,14 +61,6 @@ 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" diff --git a/lgsm/config-default/config-lgsm/ut2k4server/_default.cfg b/lgsm/config-default/config-lgsm/ut2k4server/_default.cfg index 5b0fc6a2bb..dc5d39fd70 100644 --- a/lgsm/config-default/config-lgsm/ut2k4server/_default.cfg +++ b/lgsm/config-default/config-lgsm/ut2k4server/_default.cfg @@ -51,14 +51,6 @@ 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" diff --git a/lgsm/config-default/config-lgsm/ut3server/_default.cfg b/lgsm/config-default/config-lgsm/ut3server/_default.cfg index b52bcbfb06..4124222570 100644 --- a/lgsm/config-default/config-lgsm/ut3server/_default.cfg +++ b/lgsm/config-default/config-lgsm/ut3server/_default.cfg @@ -67,14 +67,6 @@ 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" diff --git a/lgsm/config-default/config-lgsm/ut99server/_default.cfg b/lgsm/config-default/config-lgsm/ut99server/_default.cfg index 21db8e024b..6df4ea539a 100644 --- a/lgsm/config-default/config-lgsm/ut99server/_default.cfg +++ b/lgsm/config-default/config-lgsm/ut99server/_default.cfg @@ -51,14 +51,6 @@ 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" diff --git a/lgsm/config-default/config-lgsm/utserver/_default.cfg b/lgsm/config-default/config-lgsm/utserver/_default.cfg index 82b47bf9aa..1ae90d9bb0 100644 --- a/lgsm/config-default/config-lgsm/utserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/utserver/_default.cfg @@ -55,14 +55,6 @@ 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" diff --git a/lgsm/config-default/config-lgsm/vhserver/_default.cfg b/lgsm/config-default/config-lgsm/vhserver/_default.cfg index 5fd29f6a7c..f0eb4cf8e3 100644 --- a/lgsm/config-default/config-lgsm/vhserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/vhserver/_default.cfg @@ -64,14 +64,6 @@ 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" diff --git a/lgsm/config-default/config-lgsm/vintsserver/_default.cfg b/lgsm/config-default/config-lgsm/vintsserver/_default.cfg index 2db6dbc062..75288012e1 100644 --- a/lgsm/config-default/config-lgsm/vintsserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/vintsserver/_default.cfg @@ -51,14 +51,6 @@ 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" diff --git a/lgsm/config-default/config-lgsm/vpmcserver/_default.cfg b/lgsm/config-default/config-lgsm/vpmcserver/_default.cfg index 8a47f056e2..636f23d9a7 100644 --- a/lgsm/config-default/config-lgsm/vpmcserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/vpmcserver/_default.cfg @@ -54,14 +54,6 @@ 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" diff --git a/lgsm/config-default/config-lgsm/vsserver/_default.cfg b/lgsm/config-default/config-lgsm/vsserver/_default.cfg index e99f063e8a..257c989636 100644 --- a/lgsm/config-default/config-lgsm/vsserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/vsserver/_default.cfg @@ -54,14 +54,6 @@ 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" diff --git a/lgsm/config-default/config-lgsm/wetserver/_default.cfg b/lgsm/config-default/config-lgsm/wetserver/_default.cfg index 045afb9e0e..153a2b1c59 100644 --- a/lgsm/config-default/config-lgsm/wetserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/wetserver/_default.cfg @@ -47,14 +47,6 @@ 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" diff --git a/lgsm/config-default/config-lgsm/wfserver/_default.cfg b/lgsm/config-default/config-lgsm/wfserver/_default.cfg index 5924cd8af1..80fbe2037c 100644 --- a/lgsm/config-default/config-lgsm/wfserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/wfserver/_default.cfg @@ -52,14 +52,6 @@ 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" diff --git a/lgsm/config-default/config-lgsm/wmcserver/_default.cfg b/lgsm/config-default/config-lgsm/wmcserver/_default.cfg index 007e5542d2..82a3983635 100644 --- a/lgsm/config-default/config-lgsm/wmcserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/wmcserver/_default.cfg @@ -54,14 +54,6 @@ 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" diff --git a/lgsm/config-default/config-lgsm/wurmserver/_default.cfg b/lgsm/config-default/config-lgsm/wurmserver/_default.cfg index f648abe054..e4ef942d58 100644 --- a/lgsm/config-default/config-lgsm/wurmserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/wurmserver/_default.cfg @@ -91,14 +91,6 @@ 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" diff --git a/lgsm/config-default/config-lgsm/zmrserver/_default.cfg b/lgsm/config-default/config-lgsm/zmrserver/_default.cfg index ad5619dae0..4de16fd16d 100644 --- a/lgsm/config-default/config-lgsm/zmrserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/zmrserver/_default.cfg @@ -55,14 +55,6 @@ 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" diff --git a/lgsm/config-default/config-lgsm/zpsserver/_default.cfg b/lgsm/config-default/config-lgsm/zpsserver/_default.cfg index 33ad128cbb..0cb9005015 100644 --- a/lgsm/config-default/config-lgsm/zpsserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/zpsserver/_default.cfg @@ -60,14 +60,6 @@ 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" diff --git a/lgsm/modules/alert.sh b/lgsm/modules/alert.sh index 03d672a661..b8b668ef42 100644 --- a/lgsm/modules/alert.sh +++ b/lgsm/modules/alert.sh @@ -178,17 +178,6 @@ elif [ -z "${ifttttoken}" ] && [ "${commandname}" == "TEST-ALERT" ]; then fn_script_error "IFTTT token not set" fi -if [ "${mailgunalert}" == "on" ] && [ -n "${mailgunalert}" ]; then - alert_mailgun.sh -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 - 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 alert_pushbullet.sh elif [ "${pushbulletalert}" != "on" ] && [ "${commandname}" == "TEST-ALERT" ]; then diff --git a/lgsm/modules/alert_mailgun.sh b/lgsm/modules/alert_mailgun.sh deleted file mode 100644 index a25c826486..0000000000 --- a/lgsm/modules/alert_mailgun.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/bash -# LinuxGSM alert_mailgun.sh module -# Author: Daniel Gibbs -# Contributors: http://linuxgsm.com/contrib -# Website: https://linuxgsm.com -# Description: Sends Mailgun Email alert. - -moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" - -if [ "${mailgunapiregion}" == "eu" ]; then - mailgunapiurl="https://api.eu.mailgun.net" -else - mailgunapiurl="https://api.mailgun.net" -fi - -fn_print_dots "Sending Email alert: Mailgun: ${mailgunemail}" - -mailgunsend=$(curl --connect-timeout 10 -s --user "api:${mailguntoken}" \ - -F from="LinuxGSM <${mailgunemailfrom}>" \ - -F to="LinuxGSM Admin <${mailgunemail}>" \ - -F subject="${alertemoji} ${alertsubject} ${alertemoji}" \ - -F o:tag='alert' \ - -F o:tag='LinuxGSM' \ - -F text="$(cat "${alertlog}")" "${mailgunapiurl}/v3/${mailgundomain}/messages") - -if [ -z "${mailgunsend}" ]; then - fn_print_fail_nl "Sending Email alert: Mailgun: ${mailgunemail}" - fn_script_log_fatal "Sending Email alert: Mailgun: ${mailgunemail}" -else - fn_print_ok_nl "Sending Email alert: Mailgun: ${mailgunemail}" - fn_script_log_pass "Sending Email alert: Mailgun: ${mailgunemail}" -fi diff --git a/lgsm/modules/core_functions.sh b/lgsm/modules/core_functions.sh index c0195b2499..09eedeb7be 100644 --- a/lgsm/modules/core_functions.sh +++ b/lgsm/modules/core_functions.sh @@ -565,11 +565,6 @@ alert_ifttt.sh() { fn_fetch_function } -alert_mailgun.sh() { - functionfile="${FUNCNAME[0]}" - fn_fetch_function -} - alert_pushbullet.sh() { functionfile="${FUNCNAME[0]}" fn_fetch_function diff --git a/lgsm/modules/core_modules.sh b/lgsm/modules/core_modules.sh index d03102ef51..c2b5297410 100644 --- a/lgsm/modules/core_modules.sh +++ b/lgsm/modules/core_modules.sh @@ -575,11 +575,6 @@ alert_ifttt.sh() { fn_fetch_module } -alert_mailgun.sh() { - modulefile="${FUNCNAME[0]}" - fn_fetch_module -} - alert_pushbullet.sh() { modulefile="${FUNCNAME[0]}" fn_fetch_module diff --git a/lgsm/modules/info_stats.sh b/lgsm/modules/info_stats.sh index 965e3898e5..8f0119532e 100644 --- a/lgsm/modules/info_stats.sh +++ b/lgsm/modules/info_stats.sh @@ -87,8 +87,8 @@ payload="{ ] }" -fn_alert_payload(){ -alertpayload="{ +fn_alert_payload() { + alertpayload="{ \"client_id\": \"${uuidinstance}\", \"events\": [ { @@ -123,11 +123,6 @@ if [ "${iftttalert}" == "on" ]; then fn_alert_payload curl -X POST "https://www.google-analytics.com/mp/collect?api_secret=${apisecret}&measurement_id=${measurementid}" -H "Content-Type: application/json" -d "${alertpayload}" fi -if [ "${mailgunalert}" == "on" ]; then - alerttype="mailgun" - fn_alert_payload - curl -X POST "https://www.google-analytics.com/mp/collect?api_secret=${apisecret}&measurement_id=${measurementid}" -H "Content-Type: application/json" -d "${alertpayload}" -fi if [ "${pushbulletalert}" == "on" ]; then alerttype="pushbullet" fn_alert_payload diff --git a/tests/tests_defaultcfg/defaultcfg_1.txt b/tests/tests_defaultcfg/defaultcfg_1.txt index aa5b8a207d..63b888f9de 100644 --- a/tests/tests_defaultcfg/defaultcfg_1.txt +++ b/tests/tests_defaultcfg/defaultcfg_1.txt @@ -15,7 +15,6 @@ # Discord Alerts | https://docs.linuxgsm.com/alerts/discord # Email Alerts | https://docs.linuxgsm.com/alerts/email # IFTTT Alerts | https://docs.linuxgsm.com/alerts/ifttt -# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet # Pushover Alerts | https://docs.linuxgsm.com/alerts/pushover # Slack Alerts | https://docs.linuxgsm.com/alerts/slack From e0b77391bc9c11c779d2ccca874fb6e967b6650e Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sat, 7 Oct 2023 23:06:09 +0100 Subject: [PATCH 181/181] feat: various UI changes (#4326) * refactor: remove unnecessary comments in default server configurations The commit removes unnecessary comments from the default server configurations. The comments were providing instructions to edit the configuration files with care, but they are not needed and can be safely removed. * refactor: update server names in default configuration files - Updated the servername value in multiple default configuration files to "LinuxGSM" for consistency. - Refactored the code to reflect the changes made. * refactor: rename fn_script_log_fatal to fn_script_log_faail to create more consistency with naming * feat: improve console output formatting - Added separator function to improve readability of console output. - Replaced multiple instances of manual separators with the new function. - Updated commit message to follow conventional commit standard. * refactor: remove unnecessary fn_sleep_time calls This commit removes the fn_sleep_time function calls that are no longer needed in multiple modules. The fn_sleep_time function was used to introduce a delay, but it is no longer necessary for the current implementation. * better standardise random * removed bold where not required --- .../config-lgsm/dstserver/_default.cfg | 1 - .../config-lgsm/hwserver/_default.cfg | 2 +- .../config-lgsm/inssserver/_default.cfg | 2 +- .../config-lgsm/loserver/_default.cfg | 2 +- .../config-lgsm/mtaserver/_default.cfg | 1 - .../config-lgsm/ns2cserver/_default.cfg | 2 +- .../config-lgsm/ns2server/_default.cfg | 2 +- .../config-lgsm/rustserver/_default.cfg | 2 +- .../config-lgsm/sbotsserver/_default.cfg | 2 +- .../config-lgsm/stnserver/_default.cfg | 2 +- .../config-lgsm/stserver/_default.cfg | 1 - .../config-lgsm/vhserver/_default.cfg | 2 +- lgsm/modules/alert_discord.sh | 2 +- lgsm/modules/alert_email.sh | 3 +- lgsm/modules/alert_gotify.sh | 2 +- lgsm/modules/alert_ifttt.sh | 2 +- lgsm/modules/alert_pushbullet.sh | 2 +- lgsm/modules/alert_pushover.sh | 2 +- lgsm/modules/alert_rocketchat.sh | 2 +- lgsm/modules/alert_slack.sh | 2 +- lgsm/modules/alert_telegram.sh | 2 +- lgsm/modules/check_config.sh | 4 +- lgsm/modules/check_deps.sh | 14 +++-- lgsm/modules/check_executable.sh | 2 +- lgsm/modules/check_permissions.sh | 8 +-- lgsm/modules/check_root.sh | 2 +- lgsm/modules/check_system_dir.sh | 4 +- lgsm/modules/check_tmuxception.sh | 4 +- lgsm/modules/command_backup.sh | 10 ++-- lgsm/modules/command_debug.sh | 2 +- lgsm/modules/command_dev_clear_modules.sh | 6 +-- lgsm/modules/command_dev_details.sh | 10 ++-- lgsm/modules/command_dev_detect_deps.sh | 20 ++++---- lgsm/modules/command_dev_detect_glibc.sh | 10 ++-- lgsm/modules/command_dev_detect_ldd.sh | 8 +-- lgsm/modules/command_dev_query_raw.sh | 20 ++++---- lgsm/modules/command_fastdl.sh | 30 +++++------ lgsm/modules/command_install_resources_mta.sh | 2 +- lgsm/modules/command_mods_install.sh | 6 +-- lgsm/modules/command_mods_remove.sh | 8 +-- lgsm/modules/command_mods_update.sh | 2 +- lgsm/modules/command_monitor.sh | 2 +- lgsm/modules/command_skeleton.sh | 2 +- lgsm/modules/command_sponsor.sh | 2 +- lgsm/modules/command_start.sh | 10 ++-- lgsm/modules/command_stop.sh | 2 +- lgsm/modules/command_update_linuxgsm.sh | 20 ++++---- lgsm/modules/core_dl.sh | 33 ++++++------ lgsm/modules/core_exit.sh | 2 +- lgsm/modules/core_github.sh | 6 +-- lgsm/modules/core_logs.sh | 1 - lgsm/modules/core_messages.sh | 16 ++++-- lgsm/modules/core_steamcmd.sh | 14 ++--- lgsm/modules/fix.sh | 3 +- lgsm/modules/fix_av.sh | 1 - lgsm/modules/fix_kf2.sh | 1 - lgsm/modules/fix_lo.sh | 2 - lgsm/modules/fix_mta.sh | 1 - lgsm/modules/fix_samp.sh | 4 +- lgsm/modules/fix_ts3.sh | 2 +- lgsm/modules/fix_ut3.sh | 1 - lgsm/modules/info_messages.sh | 51 ++++++++----------- lgsm/modules/install_complete.sh | 10 ++-- lgsm/modules/install_config.sh | 38 +++++++++----- lgsm/modules/install_dst_token.sh | 5 +- lgsm/modules/install_eula.sh | 5 +- lgsm/modules/install_factorio_save.sh | 5 +- lgsm/modules/install_gslt.sh | 4 +- lgsm/modules/install_header.sh | 10 ++-- lgsm/modules/install_logs.sh | 5 +- lgsm/modules/install_server_dir.sh | 4 +- lgsm/modules/install_server_files.sh | 9 ++-- lgsm/modules/install_squad_license.sh | 5 +- lgsm/modules/install_stats.sh | 9 ++-- lgsm/modules/install_steamcmd.sh | 5 +- lgsm/modules/install_ts3db.sh | 17 +++---- lgsm/modules/install_ut2k4_key.sh | 5 +- lgsm/modules/mods_core.sh | 42 +++++++-------- lgsm/modules/update_fctr.sh | 4 +- lgsm/modules/update_jk2.sh | 4 +- lgsm/modules/update_mc.sh | 4 +- lgsm/modules/update_mcb.sh | 10 ++-- lgsm/modules/update_mta.sh | 4 +- lgsm/modules/update_pmc.sh | 4 +- lgsm/modules/update_ts3.sh | 6 +-- lgsm/modules/update_ut99.sh | 4 +- lgsm/modules/update_vints.sh | 4 +- linuxgsm.sh | 4 +- tests/tests_fctrserver.sh | 4 +- tests/tests_jc2server.sh | 4 +- tests/tests_mcserver.sh | 4 +- tests/tests_ts3server.sh | 4 +- 92 files changed, 310 insertions(+), 320 deletions(-) diff --git a/lgsm/config-default/config-lgsm/dstserver/_default.cfg b/lgsm/config-default/config-lgsm/dstserver/_default.cfg index 8b404391db..4677162c31 100644 --- a/lgsm/config-default/config-lgsm/dstserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/dstserver/_default.cfg @@ -15,7 +15,6 @@ shard="Master" cluster="Cluster_1" cave="false" -# Edit with care persistentstorageroot="${HOME}/.klei" confdir="DoNotStarveTogether" diff --git a/lgsm/config-default/config-lgsm/hwserver/_default.cfg b/lgsm/config-default/config-lgsm/hwserver/_default.cfg index 99b08e3580..853a52078b 100644 --- a/lgsm/config-default/config-lgsm/hwserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/hwserver/_default.cfg @@ -26,7 +26,7 @@ admins="" loadsave="" ## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters -# Edit with care | http://hurtworld.wikia.com/wiki/Hosting_A_Server +# http://hurtworld.wikia.com/wiki/Hosting_A_Server startparameters="-batchmode -nographics -logfile ${gamelog} -exec \"host ${port} ${defaultmap} ${loadsave};queryport ${queryport};maxplayers ${maxplayers};servername ${servername};creativemode ${creativemode};${admins}\"" #### LinuxGSM Settings #### diff --git a/lgsm/config-default/config-lgsm/inssserver/_default.cfg b/lgsm/config-default/config-lgsm/inssserver/_default.cfg index 6a7313c7b9..117ddbff83 100644 --- a/lgsm/config-default/config-lgsm/inssserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/inssserver/_default.cfg @@ -14,7 +14,7 @@ port="27102" queryport="27131" rconport="27015" rconpassword="" -servername="LinuxGSM Server" +servername="LinuxGSM" defaultmap="Canyon" defaultscenario="Scenario_Crossing_Push_Security" maxplayers="28" diff --git a/lgsm/config-default/config-lgsm/loserver/_default.cfg b/lgsm/config-default/config-lgsm/loserver/_default.cfg index 5a205d88f8..cc2f7b89a3 100644 --- a/lgsm/config-default/config-lgsm/loserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/loserver/_default.cfg @@ -10,7 +10,7 @@ ## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters ## https://docs.linuxgsm.com/game-servers/last-oasis -servername="${selfname}" +servername="LinuxGSM" ip="0.0.0.0" port="7777" queryport="27015" diff --git a/lgsm/config-default/config-lgsm/mtaserver/_default.cfg b/lgsm/config-default/config-lgsm/mtaserver/_default.cfg index 8397146b8b..3af42ea2b0 100644 --- a/lgsm/config-default/config-lgsm/mtaserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/mtaserver/_default.cfg @@ -12,7 +12,6 @@ ip="0.0.0.0" ## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters -# Edit with care startparameters="" #### LinuxGSM Settings #### diff --git a/lgsm/config-default/config-lgsm/ns2cserver/_default.cfg b/lgsm/config-default/config-lgsm/ns2cserver/_default.cfg index 4579d3bb05..2ca53a3354 100644 --- a/lgsm/config-default/config-lgsm/ns2cserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/ns2cserver/_default.cfg @@ -13,7 +13,7 @@ ip="0.0.0.0" port="27015" defaultmap="co_core" maxplayers="24" -servername="LinuxGSM Server" +servername="LinuxGSM" httpuser="admin" httppassword="admin" httpport="8080" diff --git a/lgsm/config-default/config-lgsm/ns2server/_default.cfg b/lgsm/config-default/config-lgsm/ns2server/_default.cfg index 9f09491cff..3ee3a05146 100644 --- a/lgsm/config-default/config-lgsm/ns2server/_default.cfg +++ b/lgsm/config-default/config-lgsm/ns2server/_default.cfg @@ -13,7 +13,7 @@ ip="0.0.0.0" port="27015" defaultmap="ns2_summit" maxplayers="24" -servername="LinuxGSM Server" +servername="LinuxGSM" httpuser="admin" httppassword="admin" httpport="8080" diff --git a/lgsm/config-default/config-lgsm/rustserver/_default.cfg b/lgsm/config-default/config-lgsm/rustserver/_default.cfg index fc955a94a1..9a4bfe1472 100644 --- a/lgsm/config-default/config-lgsm/rustserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/rustserver/_default.cfg @@ -16,7 +16,7 @@ appport="28082" queryport="28017" rconpassword="CHANGE_ME" rconweb="1" # values: Facepunch web panel, Rustadmin desktop and Rustadmin Online = 1, Rusty = 0. -servername="Rust" +servername="LinuxGSM" 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}\" diff --git a/lgsm/config-default/config-lgsm/sbotsserver/_default.cfg b/lgsm/config-default/config-lgsm/sbotsserver/_default.cfg index 0107c39d58..e5fe5b5d8f 100644 --- a/lgsm/config-default/config-lgsm/sbotsserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/sbotsserver/_default.cfg @@ -12,7 +12,7 @@ port="7777" queryport="27015" defaultmap="StationKappa" -servername="LinuxGSM Server" +servername="LinuxGSM" ## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters startparameters="Port=${port}?QueryPort=${queryport} -startup_map ${defaultmap} -server_name \"${servername}\"" diff --git a/lgsm/config-default/config-lgsm/stnserver/_default.cfg b/lgsm/config-default/config-lgsm/stnserver/_default.cfg index 8531c111bc..3e5f97c7ba 100644 --- a/lgsm/config-default/config-lgsm/stnserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/stnserver/_default.cfg @@ -12,7 +12,7 @@ maxplayers="20" region="0" ## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters -# Edit with care | https://colonysurvival.gamepedia.com/Dedicated_Server#Installation_.28Linux.29 +# https://colonysurvival.gamepedia.com/Dedicated_Server#Installation_.28Linux.29 startparameters="-mc ${maxplayers} -r ${region}" #### LinuxGSM Settings #### diff --git a/lgsm/config-default/config-lgsm/stserver/_default.cfg b/lgsm/config-default/config-lgsm/stserver/_default.cfg index 0d8f9317f0..980c4e0458 100644 --- a/lgsm/config-default/config-lgsm/stserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/stserver/_default.cfg @@ -13,7 +13,6 @@ worldname="moon_save" worldtype="Moon" ## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters -# Edit with care startparameters="-LOADLATEST ${worldname} ${worldtype}" #### LinuxGSM Settings #### diff --git a/lgsm/config-default/config-lgsm/vhserver/_default.cfg b/lgsm/config-default/config-lgsm/vhserver/_default.cfg index f0eb4cf8e3..ce90a2b07a 100644 --- a/lgsm/config-default/config-lgsm/vhserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/vhserver/_default.cfg @@ -9,7 +9,7 @@ #### Game Server Settings #### ## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters -servername="Valheim Server" +servername="LinuxGSM" # Minimum password length is 5. serverpassword="" port="2456" diff --git a/lgsm/modules/alert_discord.sh b/lgsm/modules/alert_discord.sh index a384de3db0..f3a79416a9 100644 --- a/lgsm/modules/alert_discord.sh +++ b/lgsm/modules/alert_discord.sh @@ -52,7 +52,7 @@ discordsend=$(curl --connect-timeout 10 -sSL -H "Content-Type: application/json" if [ -n "${discordsend}" ]; then fn_print_fail_nl "Sending Discord alert: ${discordsend}" - fn_script_log_fatal "Sending Discord alert: ${discordsend}" + fn_script_log_fail "Sending Discord alert: ${discordsend}" else fn_print_ok_nl "Sending Discord alert" fn_script_log_pass "Sending Discord alert" diff --git a/lgsm/modules/alert_email.sh b/lgsm/modules/alert_email.sh index e2cf5f1230..0aca09fef1 100644 --- a/lgsm/modules/alert_email.sh +++ b/lgsm/modules/alert_email.sh @@ -8,7 +8,6 @@ moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_print_dots "Sending Email alert: ${email}" -fn_sleep_time if [ -n "${emailfrom}" ]; then mail -s "${alertsubject}" -r "${emailfrom}" "${email}" < "${alertlog}" @@ -21,5 +20,5 @@ if [ "${exitcode}" == "0" ]; then fn_script_log_pass "Sending Email alert: ${email}" else fn_print_fail_nl "Sending Email alert: ${email}" - fn_script_log_fatal "Sending Email alert: ${email}" + fn_script_log_fail "Sending Email alert: ${email}" fi diff --git a/lgsm/modules/alert_gotify.sh b/lgsm/modules/alert_gotify.sh index ef833ba75b..27e4d34399 100644 --- a/lgsm/modules/alert_gotify.sh +++ b/lgsm/modules/alert_gotify.sh @@ -26,5 +26,5 @@ if [ -n "${gotifysend}" ]; then fn_script_log_pass "Sending Gotify alert" else fn_print_fail_nl "Sending Gotify alert: ${gotifysend}" - fn_script_log_fatal "Sending Gotify alert: ${gotifysend}" + fn_script_log_fail "Sending Gotify alert: ${gotifysend}" fi diff --git a/lgsm/modules/alert_ifttt.sh b/lgsm/modules/alert_ifttt.sh index ae0de8ed6f..c1ccfc9cb7 100644 --- a/lgsm/modules/alert_ifttt.sh +++ b/lgsm/modules/alert_ifttt.sh @@ -22,7 +22,7 @@ iftttsend=$(curl --connect-timeout 10 -sSL -H "Content-Type: application/json" - if [ -n "${iftttsend}" ]; then fn_print_fail_nl "Sending IFTTT alert: ${pushbulletsend}" - fn_script_log_fatal "Sending IFTTT alert: ${pushbulletsend}" + fn_script_log_fail "Sending IFTTT alert: ${pushbulletsend}" else fn_print_ok_nl "Sending IFTTT alert" fn_script_log_pass "Sent IFTTT alert" diff --git a/lgsm/modules/alert_pushbullet.sh b/lgsm/modules/alert_pushbullet.sh index eec1416110..3bcd6141b0 100644 --- a/lgsm/modules/alert_pushbullet.sh +++ b/lgsm/modules/alert_pushbullet.sh @@ -23,7 +23,7 @@ pushbulletsend=$(curl --connect-timeout 10 -sSL -u """${pushbullettoken}"":" -H if [ -n "${pushbulletsend}" ]; then fn_print_fail_nl "Sending Pushbullet alert: ${pushbulletsend}" - fn_script_log_fatal "Sending Pushbullet alert: ${pushbulletsend}" + fn_script_log_fail "Sending Pushbullet alert: ${pushbulletsend}" else fn_print_ok_nl "Sending Pushbullet alert" fn_script_log_pass "Sent Pushbullet alert" diff --git a/lgsm/modules/alert_pushover.sh b/lgsm/modules/alert_pushover.sh index 608e73c30e..35229094af 100644 --- a/lgsm/modules/alert_pushover.sh +++ b/lgsm/modules/alert_pushover.sh @@ -26,7 +26,7 @@ pushoversend=$(curl --connect-timeout 10 -sS -F token="${pushovertoken}" -F user if [ -n "${pushoversend}" ]; then fn_print_fail_nl "Sending Pushover alert: ${pushoversend}" - fn_script_log_fatal "Sending Pushover alert: ${pushoversend}" + fn_script_log_fail "Sending Pushover alert: ${pushoversend}" else fn_print_ok_nl "Sending Pushover alert" fn_script_log_pass "Sent Pushover alert" diff --git a/lgsm/modules/alert_rocketchat.sh b/lgsm/modules/alert_rocketchat.sh index 875a6ff5df..f6e410ef88 100644 --- a/lgsm/modules/alert_rocketchat.sh +++ b/lgsm/modules/alert_rocketchat.sh @@ -46,5 +46,5 @@ if [ -n "${rocketchatsend}" ]; then fn_script_log_pass "Sending Rocketchat alert" else fn_print_fail_nl "Sending Rocketchat alert: ${rocketchatsend}" - fn_script_log_fatal "Sending Rocketchat alert: ${rocketchatsend}" + fn_script_log_fail "Sending Rocketchat alert: ${rocketchatsend}" fi diff --git a/lgsm/modules/alert_slack.sh b/lgsm/modules/alert_slack.sh index 3bb148828f..f83df95101 100644 --- a/lgsm/modules/alert_slack.sh +++ b/lgsm/modules/alert_slack.sh @@ -71,5 +71,5 @@ if [ "${slacksend}" == "ok" ]; then fn_script_log_pass "Sending Slack alert" else fn_print_fail_nl "Sending Slack alert: ${slacksend}" - fn_script_log_fatal "Sending Slack alert: ${slacksend}" + fn_script_log_fail "Sending Slack alert: ${slacksend}" fi diff --git a/lgsm/modules/alert_telegram.sh b/lgsm/modules/alert_telegram.sh index 77b89560ca..d2e72346a6 100644 --- a/lgsm/modules/alert_telegram.sh +++ b/lgsm/modules/alert_telegram.sh @@ -23,7 +23,7 @@ telegramsend=$(curl --connect-timeout 10 -sSL -H "Content-Type: application/json if [ -n "${telegramsend}" ]; then fn_print_fail_nl "Sending Telegram alert: ${telegramsend}" - fn_script_log_fatal "Sending Telegram alert: ${telegramsend}" + fn_script_log_fail "Sending Telegram alert: ${telegramsend}" else fn_print_ok_nl "Sending Telegram alert" fn_script_log_pass "Sent Telegram alert" diff --git a/lgsm/modules/check_config.sh b/lgsm/modules/check_config.sh index 4f96a8db47..436740afa9 100644 --- a/lgsm/modules/check_config.sh +++ b/lgsm/modules/check_config.sh @@ -28,8 +28,8 @@ fi if [ "${shortname}" == "vh" ] && [ -z "${serverpassword}" ]; then fn_print_fail_nl "serverpassword is not set" - fn_script_log_fatal "serverpassword is not set" + fn_script_log_fail "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)" + fn_script_log_fail "serverpassword is to short (min 5 chars)" fi diff --git a/lgsm/modules/check_deps.sh b/lgsm/modules/check_deps.sh index 2818ffc116..d10948ca53 100644 --- a/lgsm/modules/check_deps.sh +++ b/lgsm/modules/check_deps.sh @@ -80,7 +80,7 @@ fn_install_mono_repo() { if [ "${monoautoinstall}" != "1" ]; then if [ $? != 0 ]; then fn_print_failure_nl "Unable to install Mono repository." - fn_script_log_fatal "Unable to install Mono repository." + fn_script_log_fail "Unable to install Mono repository." else fn_print_complete_nl "Installing Mono repository completed." fn_script_log_pass "Installing Mono repository completed." @@ -138,7 +138,6 @@ fn_install_missing_deps() { fn_print_warn "Missing dependencies: ${red}${array_deps_missing[*]}${default}" fn_script_log_warn "Missing dependencies: ${array_deps_missing[*]}" fi - fn_sleep_time # Attempt automatic dependency installation if [ "${autoinstall}" == "1" ]; then @@ -216,7 +215,7 @@ fn_install_missing_deps() { if [ "${steamcmdfail}" ]; then if [ "${commandname}" == "INSTALL" ]; then fn_print_failure_nl "Missing dependencies required to run SteamCMD." - fn_script_log_fatal "Missing dependencies required to run SteamCMD." + fn_script_log_fail "Missing dependencies required to run SteamCMD." core_exit.sh else fn_print_error_nl "Missing dependencies required to run SteamCMD." @@ -336,15 +335,14 @@ fn_deps_detector() { if [ "${commandname}" == "INSTALL" ]; then if [ "$(whoami)" == "root" ]; then echo -e "" - echo -e "${lightyellow}Checking Dependencies as root${default}" - echo -e "=================================" + echo -e "${bold}${lightyellow}Checking ${gamename} Dependencies as root${default}" + fn_messages_separator fn_print_information_nl "Checking any missing dependencies for ${gamename} server only." fn_print_information_nl "This will NOT install a ${gamename} server." - fn_sleep_time else echo -e "" - echo -e "${lightyellow}Checking Dependencies${default}" - echo -e "=================================" + echo -e "${bold}${lightyellow}Checking ${gamename} Dependencies${default}" + fn_messages_separator fi fi diff --git a/lgsm/modules/check_executable.sh b/lgsm/modules/check_executable.sh index 6c8feab2a0..91db68f1a3 100644 --- a/lgsm/modules/check_executable.sh +++ b/lgsm/modules/check_executable.sh @@ -20,7 +20,7 @@ if [ ! -f "${executabledir}/${execname}" ]; then fn_print_fail_nl "executable was not found" echo -e "* ${executabledir}/${execname}" if [ -d "${lgsmlogdir}" ]; then - fn_script_log_fatal "Executable was not found: ${executabledir}/${execname}" + fn_script_log_fail "Executable was not found: ${executabledir}/${execname}" fi unset exitbypass core_exit.sh diff --git a/lgsm/modules/check_permissions.sh b/lgsm/modules/check_permissions.sh index d582e5f24a..a6a37ce5c6 100644 --- a/lgsm/modules/check_permissions.sh +++ b/lgsm/modules/check_permissions.sh @@ -25,7 +25,7 @@ fn_check_ownership() { fi if [ "${selfownissue}" == "1" ] || [ "${funcownissue}" == "1" ] || [ "${filesownissue}" == "1" ]; then fn_print_fail_nl "Ownership issues found" - fn_script_log_fatal "Ownership issues found" + fn_script_log_fail "Ownership issues found" fn_print_information_nl "The current user ($(whoami)) does not have ownership of the following files:" fn_script_log_info "The current user ($(whoami)) does not have ownership of the following files:" { @@ -56,7 +56,7 @@ fn_check_permissions() { if [ -d "${modulesdir}" ]; then if [ "$(find "${modulesdir}" -type f -not -executable | wc -l)" -ne "0" ]; then fn_print_fail_nl "Permissions issues found" - fn_script_log_fatal "Permissions issues found" + fn_script_log_fail "Permissions issues found" fn_print_information_nl "The following files are not executable:" fn_script_log_info "The following files are not executable:" { @@ -80,7 +80,7 @@ fn_check_permissions() { grouprootdirperm="${rootdirperm:1:1}" if [ "${userrootdirperm}" != "7" ] && [ "${grouprootdirperm}" != "7" ]; then fn_print_fail_nl "Permissions issues found" - fn_script_log_fatal "Permissions issues found" + fn_script_log_fail "Permissions issues found" fn_print_information_nl "The following directory does not have the correct permissions:" fn_script_log_info "The following directory does not have the correct permissions:" fn_script_log_info "${rootdir}" @@ -198,7 +198,7 @@ fn_sys_perm_errors_fix() { 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 + # Show the user how to fix. fn_sys_perm_fix_manually_msg else diff --git a/lgsm/modules/check_root.sh b/lgsm/modules/check_root.sh index 063a2b0d30..81115394ad 100644 --- a/lgsm/modules/check_root.sh +++ b/lgsm/modules/check_root.sh @@ -11,7 +11,7 @@ if [ "$(whoami)" == "root" ]; then if [ "${commandname}" != "INSTALL" ]; then fn_print_fail_nl "Do NOT run this script as root!" if [ -d "${lgsmlogdir}" ]; then - fn_script_log_fatal "${selfname} attempted to run as root." + fn_script_log_fail "${selfname} attempted to run as root." else # Forces exit code is log does not yet exist. exitcode=1 diff --git a/lgsm/modules/check_system_dir.sh b/lgsm/modules/check_system_dir.sh index 162037861f..01c6437489 100644 --- a/lgsm/modules/check_system_dir.sh +++ b/lgsm/modules/check_system_dir.sh @@ -10,7 +10,7 @@ moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" if [ ! -d "${serverfiles}" ]; then fn_print_fail_nl "Cannot access ${serverfiles}: No such directory" if [ -d "${lgsmlogdir}" ]; then - fn_script_log_fatal "Cannot access ${serverfiles}: No such directory." + fn_script_log_fail "Cannot access ${serverfiles}: No such directory." fi core_exit.sh fi @@ -18,7 +18,7 @@ fi if [ ! -d "${systemdir}" ]; then fn_print_fail_nl "Cannot access ${systemdir}: No such directory" if [ -d "${lgsmlogdir}" ]; then - fn_script_log_fatal "Cannot access ${systemdir}: No such directory." + fn_script_log_fail "Cannot access ${systemdir}: No such directory." fi core_exit.sh fi diff --git a/lgsm/modules/check_tmuxception.sh b/lgsm/modules/check_tmuxception.sh index aded5cb2dc..8f1f94c73e 100644 --- a/lgsm/modules/check_tmuxception.sh +++ b/lgsm/modules/check_tmuxception.sh @@ -10,7 +10,7 @@ moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" 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_script_log_fail "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." echo -e "It is not possible to run a tmux session inside another tmux session" echo -e "https://docs.linuxgsm.com/requirements/tmux#tmuxception" @@ -21,7 +21,7 @@ fn_check_is_in_tmux() { 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." + fn_script_log_fail "Tmuxception error: Attempted to start a tmux session inside of a screen session." fn_print_information_nl "LinuxGSM creates a tmux session when starting the server." echo -e "It is not possible to run a tmux session inside screen session" echo -e "https://docs.linuxgsm.com/requirements/tmux#tmuxception" diff --git a/lgsm/modules/command_backup.sh b/lgsm/modules/command_backup.sh index b63c826256..16223c9145 100644 --- a/lgsm/modules/command_backup.sh +++ b/lgsm/modules/command_backup.sh @@ -148,7 +148,7 @@ fn_backup_compression() { # Check that excludedir is a valid path. 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" + fn_script_log_fail "Problem identifying the previous backup directory for exclusion" core_exit.sh fi @@ -156,10 +156,10 @@ fn_backup_compression() { local exitcode=$? if [ "${exitcode}" != 0 ]; then fn_print_fail_eol - fn_script_log_fatal "Backup in progress: FAIL" + fn_script_log_fail "Backup in progress: FAIL" echo -e "${extractcmd}" | tee -a "${lgsmlog}" fn_print_fail_nl "Starting backup" - fn_script_log_fatal "Starting backup" + fn_script_log_fail "Starting backup" else fn_print_ok_eol fn_print_ok_nl "Completed: ${backupname}.tar.gz, total size $(du -sh "${backupdir}/${backupname}.tar.gz" | awk '{print $1}')" @@ -217,7 +217,7 @@ fn_backup_relpath() { declare -a rdirtoks=($(readlink -f "${rootdir}" | sed "s/\// /g")) if [ ${#rdirtoks[@]} -eq 0 ]; then fn_print_fail_nl "Problem assessing rootdir during relative path assessment" - fn_script_log_fatal "Problem assessing rootdir during relative path assessment: ${rootdir}" + fn_script_log_fail "Problem assessing rootdir during relative path assessment: ${rootdir}" core_exit.sh fi @@ -225,7 +225,7 @@ fn_backup_relpath() { declare -a bdirtoks=($(readlink -f "${backupdir}" | sed "s/\// /g")) if [ ${#bdirtoks[@]} -eq 0 ]; then fn_print_fail_nl "Problem assessing backupdir during relative path assessment" - fn_script_log_fatal "Problem assessing backupdir during relative path assessment: ${rootdir}" + fn_script_log_fail "Problem assessing backupdir during relative path assessment: ${rootdir}" core_exit.sh fi diff --git a/lgsm/modules/command_debug.sh b/lgsm/modules/command_debug.sh index 41722e5074..495417c161 100644 --- a/lgsm/modules/command_debug.sh +++ b/lgsm/modules/command_debug.sh @@ -82,7 +82,7 @@ echo -e "" 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 "" + if ! fn_prompt_yn "Continue?" Y; then exitcode=0 core_exit.sh diff --git a/lgsm/modules/command_dev_clear_modules.sh b/lgsm/modules/command_dev_clear_modules.sh index 52d07ee1ad..bf19b25780 100644 --- a/lgsm/modules/command_dev_clear_modules.sh +++ b/lgsm/modules/command_dev_clear_modules.sh @@ -10,9 +10,9 @@ commandaction="Clearing modules" moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_firstcommand_set -echo -e "=================================" -echo -e "Clear Modules" -echo -e "=================================" +echo -e "" +echo -e "${bold}${lightyellow}Clear Modules${default}" +fn_messages_separator echo -e "" if fn_prompt_yn "Do you want to delete all modules?" Y; then rm -rfv "${modulesdir:?}/"* diff --git a/lgsm/modules/command_dev_details.sh b/lgsm/modules/command_dev_details.sh index b954181210..2659465d33 100644 --- a/lgsm/modules/command_dev_details.sh +++ b/lgsm/modules/command_dev_details.sh @@ -17,8 +17,8 @@ info_game.sh carriagereturn=$(file -b "${servercfgfullpath}" | grep -q CRLF && echo "${red}CRLF${default}" || echo "${lightgreen}LF${default}") echo -e "" -echo -e "${lightgreen}Server Details${default}" -echo -e "==================================================================" +echo -e "${bold}${lightgreen}Server Details${default}" +fn_messages_separator echo -e "" echo -e "Game: ${gamename}" @@ -76,8 +76,8 @@ missing_details="" # Loop through the server details and output them. echo -e "" -echo -e "${lightgreen}Available Server Details${default}" -echo -e "=================================" +echo -e "${bold}${lightgreen}Available Server Details${default}" +fn_messages_separator for key in "${!server_details[@]}"; do value=${server_details[$key]} if [ -z "$value" ]; then @@ -91,7 +91,7 @@ done if [ -n "$missing_details" ]; then echo -e "" echo -e "${lightgreen}Missing Server Details${default}" - echo -e "=================================" + fn_messages_separator echo -e "${missing_details}" fi diff --git a/lgsm/modules/command_dev_detect_deps.sh b/lgsm/modules/command_dev_detect_deps.sh index 763ab5554c..6215fb8974 100644 --- a/lgsm/modules/command_dev_detect_deps.sh +++ b/lgsm/modules/command_dev_detect_deps.sh @@ -10,9 +10,9 @@ commandaction="Developer detect deps" moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_firstcommand_set -echo -e "=================================" -echo -e "Dependencies Checker" -echo -e "=================================" +echo -e "" +echo -e "${bold}Dependencies Checker${default}" +fn_messages_separator echo -e "Checking directory: " echo -e "${serverfiles}" if [ "$(command -v eu-readelf 2> /dev/null)" ]; then @@ -182,33 +182,33 @@ awk -vORS='' '{ print $1,$2 }' "${tmpdir}/.depdetect_ubuntu_list_uniq" > "${tmpd awk -vORS='' '{ print $1,$2 }' "${tmpdir}/.depdetect_debian_list_uniq" > "${tmpdir}/.depdetect_debian_line" echo -e "" echo -e "" -echo -e "Required Dependencies" -echo -e "=================================" +echo -e "${bold}Required Dependencies${default}" +fn_messages_separator echo -e "${executable}" echo -e "" echo -e "CentOS" -echo -e "=================================" +fn_messages_separator cat "${tmpdir}/.depdetect_centos_line" echo -e "" echo -e "" echo -e "Ubuntu" -echo -e "=================================" +fn_messages_separator cat "${tmpdir}/.depdetect_ubuntu_line" echo -e "" echo -e "" echo -e "Debian" -echo -e "=================================" +fn_messages_separator cat "${tmpdir}/.depdetect_debian_line" echo -e "" if [ "${unknownlib}" == "1" ]; then echo -e "" echo -e "Unknown shared Library" - echo -e "=================================" + fn_messages_separator cat "${tmpdir}/.depdetect_unknown" fi echo -e "" echo -e "Required Librarys" -echo -e "=================================" +fn_messages_separator sort "${tmpdir}/.depdetect_readelf" | uniq echo -en "\n" rm -f "${tmpdir:?}/.depdetect_centos_line" diff --git a/lgsm/modules/command_dev_detect_glibc.sh b/lgsm/modules/command_dev_detect_glibc.sh index ca64ed7cc6..214adc88eb 100644 --- a/lgsm/modules/command_dev_detect_glibc.sh +++ b/lgsm/modules/command_dev_detect_glibc.sh @@ -11,13 +11,13 @@ commandaction="Developer detect glibc" moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_firstcommand_set -echo -e "=================================" +fn_messages_separator echo -e "glibc Requirements Checker" -echo -e "=================================" +fn_messages_separator if [ ! "$(command -v objdump 2> /dev/null)" ]; then fn_print_failure_nl "objdump is missing" - fn_script_log_fatal "objdump is missing" + fn_script_log_fail "objdump is missing" core_exit.sh fi @@ -59,7 +59,7 @@ for glibc_check_var in "${glibc_check_dir_array[@]}"; do echo -e "" echo -e "" echo -e "${glibc_check_name} glibc Requirements" - echo -e "=================================" + fn_messages_separator 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" @@ -81,7 +81,7 @@ for glibc_check_var in "${glibc_check_dir_array[@]}"; do done echo -e "" echo -e "Final glibc Requirement" -echo -e "=================================" +fn_messages_separator if [ -f "${tmpdir}/detect_glibc_highest.tmp" ]; then cat "${tmpdir}/detect_glibc_highest.tmp" | sort | uniq | sort -r --version-sort | head -1 rm -f "${tmpdir:?}/detect_glibc_highest.tmp" diff --git a/lgsm/modules/command_dev_detect_ldd.sh b/lgsm/modules/command_dev_detect_ldd.sh index 877c8d95bc..af41bb522e 100644 --- a/lgsm/modules/command_dev_detect_ldd.sh +++ b/lgsm/modules/command_dev_detect_ldd.sh @@ -11,9 +11,9 @@ commandaction="Developer detect ldd" moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_firstcommand_set -echo -e "=================================" +fn_messages_separator echo -e "Shared Object dependencies Checker" -echo -e "=================================" +fn_messages_separator if [ -z "${serverfiles}" ]; then dir=$(dirname "$(readlink -f "${BASH_SOURCE[0]}")") @@ -47,12 +47,12 @@ find "${serverfiles}" -type f -print0 \ echo -e "" echo -e "" echo -e "All" -echo -e "=================================" +fn_messages_separator cat "${tmpdir}/detect_ldd.tmp" echo -e "" echo -e "Not Found" -echo -e "=================================" +fn_messages_separator cat "${tmpdir}/detect_ldd_not_found.tmp" rm -f "${tmpdir:?}/detect_ldd.tmp" diff --git a/lgsm/modules/command_dev_query_raw.sh b/lgsm/modules/command_dev_query_raw.sh index 1abd6cdf36..cf9e148586 100644 --- a/lgsm/modules/command_dev_query_raw.sh +++ b/lgsm/modules/command_dev_query_raw.sh @@ -17,14 +17,14 @@ info_messages.sh echo -e "" echo -e "${lightgreen}Query IP Addresses${default}" -echo -e "==================================================================" +fn_messages_separator echo -e "" for queryip in "${queryips[@]}"; do echo -e "${queryip}" done echo -e "" echo -e "${lightgreen}Game Server Ports${default}" -echo -e "==================================================================" +fn_messages_separator { echo -e "${lightblue}Port Name \tPort Number \tStatus \tTCP \tUDP${default}" if [ -v port ]; then @@ -184,18 +184,18 @@ echo -e "==================================================================" | column -s $'\t' -t echo -e "" echo -e "${lightgreen}SS Output${default}" -echo -e "=================================" +fn_messages_separator fn_info_message_ports eval "${portcommand}" echo -e "" echo -e "${lightgreen}Query Port - Raw Output${default}" -echo -e "==================================================================" +fn_messages_separator echo -e "" echo -e "PORT: ${port}" echo -e "QUERY PORT: ${queryport}" echo -e "" echo -e "${lightgreen}Gamedig Raw Output${default}" -echo -e "=================================" +fn_messages_separator echo -e "" if [ ! "$(command -v gamedig 2> /dev/null)" ]; then fn_print_failure_nl "gamedig not installed" @@ -211,7 +211,7 @@ for queryip in "${queryips[@]}"; do done echo -e "" echo -e "${lightgreen}gsquery Raw Output${default}" -echo -e "=================================" +fn_messages_separator echo -e "" for queryip in "${queryips[@]}"; do echo -e "./query_gsquery.py -a \"${queryip}\" -p \"${queryport}\" -e \"${querytype}\"" @@ -223,7 +223,7 @@ for queryip in "${queryips[@]}"; do done echo -e "" echo -e "${lightgreen}TCP Raw Output${default}" -echo -e "=================================" +fn_messages_separator echo -e "" for queryip in "${queryips[@]}"; do echo -e "bash -c 'exec 3<> /dev/tcp/'${queryip}'/'${queryport}''" @@ -239,10 +239,10 @@ for queryip in "${queryips[@]}"; do done echo -e "" echo -e "${lightgreen}Game Port - Raw Output${default}" -echo -e "==================================================================" +fn_messages_separator echo -e "" echo -e "${lightgreen}TCP Raw Output${default}" -echo -e "=================================" +fn_messages_separator echo -e "" for queryip in "${queryips[@]}"; do echo -e "bash -c 'exec 3<> /dev/tcp/'${queryip}'/'${port}''" @@ -258,7 +258,7 @@ for queryip in "${queryips[@]}"; do done echo -e "" echo -e "${lightgreen}Steam Master Server Response${default}" -echo -e "==================================================================" +fn_messages_separator echo -e "" echo -e "curl -m 3 -s https://api.steampowered.com/ISteamApps/GetServersAtAddress/v0001?addr=${publicip}" echo -e "" diff --git a/lgsm/modules/command_fastdl.sh b/lgsm/modules/command_fastdl.sh index 4aff9994d9..acc3a1ba47 100644 --- a/lgsm/modules/command_fastdl.sh +++ b/lgsm/modules/command_fastdl.sh @@ -26,7 +26,7 @@ luafastdlfullpath="${luasvautorundir}/${luafastdlfile}" # Check if bzip2 is installed. if [ ! "$(command -v bzip2 2> /dev/null)" ]; then fn_print_fail "bzip2 is not installed" - fn_script_log_fatal "bzip2 is not installed" + fn_script_log_fail "bzip2 is not installed" core_exit.sh fi @@ -37,7 +37,7 @@ echo -e "" # Prompts user for FastDL creation settings. echo -e "${commandaction} setup" -echo -e "=================================" +fn_messages_separator # Prompt for clearing old files if directory was already here. if [ -d "${fastdldir}" ]; then @@ -72,7 +72,7 @@ fn_clear_old_fastdl() { exitcode=$? if [ "${exitcode}" != 0 ]; then fn_print_fail_eol_nl - fn_script_log_fatal "Clearing existing FastDL directory ${fastdldir}" + fn_script_log_fail "Clearing existing FastDL directory ${fastdldir}" core_exit.sh else fn_print_ok_eol_nl @@ -89,7 +89,7 @@ fn_fastdl_dirs() { exitcode=$? if [ "${exitcode}" != 0 ]; then fn_print_fail_eol_nl - fn_script_log_fatal "Creating web directory ${webdir}" + fn_script_log_fail "Creating web directory ${webdir}" core_exit.sh else fn_print_ok_eol_nl @@ -102,7 +102,7 @@ fn_fastdl_dirs() { exitcode=$? if [ "${exitcode}" != 0 ]; then fn_print_fail_eol_nl - fn_script_log_fatal "Creating fastdl directory ${fastdldir}" + fn_script_log_fail "Creating fastdl directory ${fastdldir}" core_exit.sh else fn_print_ok_eol_nl @@ -218,13 +218,13 @@ fn_fastdl_preview() { exitcode=$? if [ "${exitcode}" != 0 ]; then fn_print_fail_eol_nl - fn_script_log_fatal "Calculating total file size." + fn_script_log_fail "Calculating total file size." core_exit.sh fi done < "${tmpdir}/fastdl_files_to_compress.txt" else fn_print_fail_eol_nl "generating file list" - fn_script_log_fatal "Generating file list." + fn_script_log_fail "Generating file list." core_exit.sh fi echo -e "about to compress ${totalfiles} files, total size $(fn_human_readable_file_size ${filesizetotal} 0)" @@ -251,7 +251,7 @@ fn_fastdl_gmod() { exitcode=$? if [ "${exitcode}" != 0 ]; then fn_print_fail_eol_nl - fn_script_log_fatal "Copying ${fastdlfile} > ${fastdldir}" + fn_script_log_fail "Copying ${fastdlfile} > ${fastdldir}" core_exit.sh else fn_script_log_pass "Copying ${fastdlfile} > ${fastdldir}" @@ -268,7 +268,7 @@ fn_fastdl_gmod() { exitcode=$? if [ "${exitcode}" != 0 ]; then fn_print_fail_eol_nl - fn_script_log_fatal "Updating addons file structure" + fn_script_log_fail "Updating addons file structure" core_exit.sh else fn_print_ok_eol_nl @@ -281,7 +281,7 @@ fn_fastdl_gmod() { exitcode=$? if [ "${exitcode}" != 0 ]; then fn_print_fail_eol_nl - fn_script_log_fatal "Clearing addons dir from fastdl dir" + fn_script_log_fail "Clearing addons dir from fastdl dir" core_exit.sh else fn_print_ok_eol_nl @@ -296,7 +296,7 @@ fn_fastdl_gmod() { exitcode=$? if [ "${exitcode}" != 0 ]; then fn_print_fail_eol_nl - fn_script_log_fatal "Correcting DarkRP files" + fn_script_log_fail "Correcting DarkRP files" core_exit.sh else fn_print_ok_eol_nl @@ -347,7 +347,7 @@ fn_fastdl_source() { exitcode=$? if [ "${exitcode}" != 0 ]; then fn_print_fail_eol_nl - fn_script_log_fatal "Copying ${fastdlfile} > ${fastdldir}/${copytodir}" + fn_script_log_fail "Copying ${fastdlfile} > ${fastdldir}/${copytodir}" core_exit.sh else fn_script_log_pass "Copying ${fastdlfile} > ${fastdldir}/${copytodir}" @@ -383,7 +383,7 @@ fn_fastdl_gmod_dl_enforcer() { exitcode=$? if [ "${exitcode}" != 0 ]; then fn_print_fail_eol_nl - fn_script_log_fatal "Removing existing download enforcer ${luafastdlfullpath}" + fn_script_log_fail "Removing existing download enforcer ${luafastdlfullpath}" core_exit.sh else fn_print_ok_eol_nl @@ -401,7 +401,7 @@ fn_fastdl_gmod_dl_enforcer() { exitcode=$? if [ "${exitcode}" != 0 ]; then fn_print_fail_eol_nl - fn_script_log_fatal "Creating new download enforcer ${luafastdlfullpath}" + fn_script_log_fail "Creating new download enforcer ${luafastdlfullpath}" core_exit.sh else fn_print_ok_eol_nl @@ -418,7 +418,7 @@ fn_fastdl_bzip2() { exitcode=$? if [ "${exitcode}" != 0 ]; then fn_print_fail_eol_nl - fn_script_log_fatal "Compressing ${filetocompress}" + fn_script_log_fail "Compressing ${filetocompress}" core_exit.sh else fn_script_log_pass "Compressing ${filetocompress}" diff --git a/lgsm/modules/command_install_resources_mta.sh b/lgsm/modules/command_install_resources_mta.sh index c3d745a301..31a9165fd4 100644 --- a/lgsm/modules/command_install_resources_mta.sh +++ b/lgsm/modules/command_install_resources_mta.sh @@ -13,7 +13,7 @@ fn_firstcommand_set fn_install_resources() { echo -e "" echo -e "${lightyellow}Installing Default Resources${default}" - echo -e "=================================" + fn_messages_separator 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}" echo -e "Default Resources Installed." diff --git a/lgsm/modules/command_mods_install.sh b/lgsm/modules/command_mods_install.sh index d602be2cd3..19de72ab04 100644 --- a/lgsm/modules/command_mods_install.sh +++ b/lgsm/modules/command_mods_install.sh @@ -19,7 +19,7 @@ fn_print_header fn_mods_installed_list if [ "${installedmodscount}" -gt "0" ]; then echo -e "Installed addons/mods" - echo -e "=================================" + fn_messages_separator # Go through all available commands, get details and display them to the user. for ((llindex = 0; llindex < ${#installedmodslist[@]}; llindex++)); do # Current mod is the "llindex" value of the array we're going through. @@ -32,7 +32,7 @@ if [ "${installedmodscount}" -gt "0" ]; then fi echo -e "Available addons/mods" -echo -e "=================================" +fn_messages_separator # Display available mods from mods_list.sh. # Set and reset vars compatiblemodslistindex=0 @@ -78,7 +78,7 @@ fn_mod_get_info echo -e "" echo -e "Installing ${modprettyname}" -echo -e "=================================" +fn_messages_separator fn_script_log_info "${modprettyname} selected for install" # Check if the mod is already installed and warn the user. diff --git a/lgsm/modules/command_mods_remove.sh b/lgsm/modules/command_mods_remove.sh index 8f9ea37399..db7763cd8e 100644 --- a/lgsm/modules/command_mods_remove.sh +++ b/lgsm/modules/command_mods_remove.sh @@ -16,7 +16,7 @@ fn_mods_check_installed fn_print_header echo -e "Remove addons/mods" -echo -e "=================================" +fn_messages_separator # Displays list of installed mods. # Generates list to display to user. @@ -72,7 +72,7 @@ while [ "${modfileline}" -le "${modsfilelistsize}" ]; do rm -rf "${modinstalldir:?}/${currentfileremove:?}" ((exitcode = $?)) if [ "${exitcode}" != 0 ]; then - fn_script_log_fatal "Removing ${modinstalldir}/${currentfileremove}" + fn_script_log_fail "Removing ${modinstalldir}/${currentfileremove}" break else fn_script_log_pass "Removing ${modinstalldir}/${currentfileremove}" @@ -103,7 +103,7 @@ fn_sleep_time rm -rf "${modsdir:?}/${modcommand}-files.txt" exitcode=$? if [ "${exitcode}" != 0 ]; then - fn_script_log_fatal "Removing ${modsdir}/${modcommand}-files.txt" + fn_script_log_fail "Removing ${modsdir}/${modcommand}-files.txt" fn_print_fail_eol_nl core_exit.sh else @@ -118,7 +118,7 @@ fn_sleep_time sed -i "/^${modcommand}$/d" "${modsinstalledlistfullpath}" exitcode=$? if [ "${exitcode}" != 0 ]; then - fn_script_log_fatal "Removing ${modcommand} from ${modsinstalledlist}" + fn_script_log_fail "Removing ${modcommand} from ${modsinstalledlist}" fn_print_fail_eol_nl core_exit.sh else diff --git a/lgsm/modules/command_mods_update.sh b/lgsm/modules/command_mods_update.sh index b917f191f5..cfbafc80c5 100644 --- a/lgsm/modules/command_mods_update.sh +++ b/lgsm/modules/command_mods_update.sh @@ -97,7 +97,7 @@ while [ "${installedmodsline}" -le "${installedmodscount}" ]; do ((installedmodsline++)) else fn_print_fail "No mod was selected" - fn_script_log_fatal "No mod was selected" + fn_script_log_fail "No mod was selected" exitcode="1" core_exit.sh fi diff --git a/lgsm/modules/command_monitor.sh b/lgsm/modules/command_monitor.sh index 5ce104a955..079ad334d3 100644 --- a/lgsm/modules/command_monitor.sh +++ b/lgsm/modules/command_monitor.sh @@ -206,7 +206,7 @@ fn_monitor_check_session() { else fn_print_error "Checking session: " fn_print_fail_eol_nl - fn_script_log_fatal "Checking session: FAIL" + fn_script_log_fail "Checking session: FAIL" alert="restart" alert.sh fn_script_log_info "Checking session: Monitor is restarting ${selfname}" diff --git a/lgsm/modules/command_skeleton.sh b/lgsm/modules/command_skeleton.sh index 9e7c19a6aa..48a6bd187a 100644 --- a/lgsm/modules/command_skeleton.sh +++ b/lgsm/modules/command_skeleton.sh @@ -18,7 +18,7 @@ find "${rootdir}" -type d -not \( -path ./skel -prune \) | cpio -pdvm skel 2> /d exitcode=$? if [ "${exitcode}" != 0 ]; then fn_print_fail_nl "Creating skeleton directory" - fn_script_log_fatal "Creating skeleton directory" + fn_script_log_fail "Creating skeleton directory" else fn_print_ok_nl "Creating skeleton directory: ./skel" fn_script_log_pass "Creating skeleton directory: ./skel" diff --git a/lgsm/modules/command_sponsor.sh b/lgsm/modules/command_sponsor.sh index 336f20f0a6..ea49a30993 100755 --- a/lgsm/modules/command_sponsor.sh +++ b/lgsm/modules/command_sponsor.sh @@ -12,7 +12,7 @@ fn_firstcommand_set fn_print_ascii_logo echo -e "${lightyellow}Support LinuxGSM${default}" -echo -e "=================================" +fn_messages_separator echo -e "" echo -e "Been using LinuxGSM?" echo -e "Consider sponsoring to support development." diff --git a/lgsm/modules/command_start.sh b/lgsm/modules/command_start.sh index b2f46855d3..4b45f0bc36 100644 --- a/lgsm/modules/command_start.sh +++ b/lgsm/modules/command_start.sh @@ -120,24 +120,24 @@ fn_start_tmux() { check_status.sh if [ "${status}" == "0" ]; then fn_print_fail_nl "Unable to start ${servername}" - fn_script_log_fatal "Unable to start ${servername}" + fn_script_log_fail "Unable to start ${servername}" if [ -s "${lgsmlogdir}/.${selfname}-tmux-error.tmp" ]; then fn_print_fail_nl "Unable to start ${servername}: tmux error:" - fn_script_log_fatal "Unable to start ${servername}: tmux error:" + fn_script_log_fail "Unable to start ${servername}: tmux error:" echo -e "" echo -e "Command" - echo -e "=================================" + fn_messages_separator echo -e "tmux -L \"${sessionname}\" new-session -d -s \"${sessionname}\" \"${preexecutable} ${executable} ${startparameters}\"" | tee -a "${lgsmlog}" echo -e "" echo -e "Error" - echo -e "=================================" + fn_messages_separator 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 echo -e "" echo -e "Fix" - echo -e "=================================" + fn_messages_separator 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." diff --git a/lgsm/modules/command_stop.sh b/lgsm/modules/command_stop.sh index 409e57b145..ee91528629 100644 --- a/lgsm/modules/command_stop.sh +++ b/lgsm/modules/command_stop.sh @@ -248,7 +248,7 @@ fn_stop_tmux() { fn_script_log_pass "Stopped ${servername}" else fn_print_fail_nl "Unable to stop ${servername}" - fn_script_log_fatal "Unable to stop ${servername}" + fn_script_log_fail "Unable to stop ${servername}" fi } diff --git a/lgsm/modules/command_update_linuxgsm.sh b/lgsm/modules/command_update_linuxgsm.sh index 3c4e6d0809..65b72bcbbd 100644 --- a/lgsm/modules/command_update_linuxgsm.sh +++ b/lgsm/modules/command_update_linuxgsm.sh @@ -24,7 +24,7 @@ if [ $? != "0" ]; then 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" + fn_script_log_fail "Selecting repo: Unable to to access GitHub or Bitbucket repositories" core_exit.sh else remotereponame="Bitbucket" @@ -44,8 +44,8 @@ else fi if [ $? != "0" ]; then fn_print_fail_eol_nl - fn_script_log_fatal "Checking ${remotereponame} linuxgsm.sh" - fn_script_log_fatal "Curl returned error: $?" + fn_script_log_fail "Checking ${remotereponame} linuxgsm.sh" + fn_script_log_fail "Curl returned error: $?" core_exit.sh fi @@ -82,7 +82,7 @@ if [ "${script_diff}" != "" ]; then cp "${rootdir}/${selfname}" "${backupdir}/script/${selfname}-$(date +"%m_%d_%Y_%M").bak" if [ $? != 0 ]; then fn_print_fail_eol_nl - fn_script_log_fatal "Backup ${selfname}" + fn_script_log_fail "Backup ${selfname}" core_exit.sh else fn_print_ok_eol_nl @@ -103,7 +103,7 @@ if [ "${script_diff}" != "" ]; then if [ $? != "0" ]; then fn_print_fail_eol_nl - fn_script_log_fatal "copying ${selfname}" + fn_script_log_fail "copying ${selfname}" core_exit.sh else fn_print_ok_eol_nl @@ -124,8 +124,8 @@ else fi if [ $? != "0" ]; then fn_print_fail_eol_nl - fn_script_log_fatal "Checking ${remotereponame} config _default.cfg" - fn_script_log_fatal "Curl returned error: $?" + fn_script_log_fail "Checking ${remotereponame} config _default.cfg" + fn_script_log_fail "Curl returned error: $?" core_exit.sh fi @@ -158,8 +158,8 @@ if [ -f "${datadir}/${distroid}-${distroversioncsv}.csv" ]; then fi if [ $? != "0" ]; then fn_print_fail_eol_nl - fn_script_log_fatal "Checking ${remotereponame} ${distroid}-${distroversioncsv}.csv" - fn_script_log_fatal "Curl returned error: $?" + fn_script_log_fail "Checking ${remotereponame} ${distroid}-${distroversioncsv}.csv" + fn_script_log_fail "Curl returned error: $?" core_exit.sh fi @@ -200,7 +200,7 @@ if [ -n "${modulesdir}" ]; then echo -en "removing module ${modulefile}...\c" if ! rm -f "${modulefile:?}"; then fn_print_fail_eol_nl - fn_script_log_fatal "Removing module ${modulefile}" + fn_script_log_fail "Removing module ${modulefile}" core_exit.sh else fn_print_ok_eol_nl diff --git a/lgsm/modules/core_dl.sh b/lgsm/modules/core_dl.sh index 2a6c7c400a..3b2e7f117c 100644 --- a/lgsm/modules/core_dl.sh +++ b/lgsm/modules/core_dl.sh @@ -93,27 +93,27 @@ fn_dl_steamcmd() { # 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" - fn_script_log_fatal "${commandaction} ${selfname}: ${remotelocation}: Not enough disk space to download server files" + fn_script_log_fail "${commandaction} ${selfname}: ${remotelocation}: Not enough disk space to download server files" core_exit.sh # Not enough space. elif [ -n "$(grep "0x212" "${steamcmdlog}" | tail -1)" ]; then fn_print_failure_nl "${commandaction} ${selfname}: ${remotelocation}: Not enough disk space to download server files" - fn_script_log_fatal "${commandaction} ${selfname}: ${remotelocation}: Not enough disk space to download server files" + fn_script_log_fail "${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" - fn_script_log_fatal "${commandaction} ${selfname}: ${remotelocation}: Steam account does not have a license for the required game" + fn_script_log_fail "${commandaction} ${selfname}: ${remotelocation}: Steam account does not have a license for the required game" core_exit.sh # Two-factor authentication failure elif [ -n "$(grep "Two-factor code mismatch" "${steamcmdlog}" | tail -1)" ]; then fn_print_failure_nl "${commandaction} ${selfname}: ${remotelocation}: Two-factor authentication failure" - fn_script_log_fatal "${commandaction} ${selfname}: ${remotelocation}: Two-factor authentication failure" + fn_script_log_fail "${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" + fn_script_log_fail "${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 @@ -142,7 +142,7 @@ fn_dl_steamcmd() { if [ "${counter}" -gt "10" ]; then fn_print_failure_nl "${commandaction} ${selfname}: ${remotelocation}: Did not complete the download, too many retrys" - fn_script_log_fatal "${commandaction} ${selfname}: ${remotelocation}: Did not complete the download, too many retrys" + fn_script_log_fail "${commandaction} ${selfname}: ${remotelocation}: Did not complete the download, too many retrys" core_exit.sh fi done @@ -195,7 +195,7 @@ fn_dl_hash() { fn_print_fail_eol_nl echo -e "${local_filename} returned ${hashtype} checksum: ${hashsumcmd}" echo -e "expected ${hashtype} checksum: ${hash}" - fn_script_log_fatal "Verifying ${local_filename} with ${hashtype}" + fn_script_log_fail "Verifying ${local_filename} with ${hashtype}" fn_script_log_info "${local_filename} returned ${hashtype} checksum: ${hashsumcmd}" fn_script_log_info "Expected ${hashtype} checksum: ${hash}" core_exit.sh @@ -226,8 +226,8 @@ fn_dl_extract() { 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" + fn_script_log_fail "Extracting ${local_filename}" + fn_script_log_fail "File ${local_filedir}/${local_filename} not found" core_exit.sh fi mime=$(file -b --mime-type "${local_filedir}/${local_filename}") @@ -259,7 +259,7 @@ fn_dl_extract() { local exitcode=$? if [ "${exitcode}" != 0 ]; then fn_print_fail_eol_nl - fn_script_log_fatal "Extracting ${local_filename}" + fn_script_log_fail "Extracting ${local_filename}" if [ -f "${lgsmlog}" ]; then echo -e "${extractcmd}" >> "${lgsmlog}" fi @@ -277,7 +277,6 @@ fn_fetch_trap() { echo -en "downloading ${local_filename}..." fn_print_canceled_eol_nl fn_script_log_info "Downloading ${local_filename}...CANCELED" - fn_sleep_time rm -f "${local_filedir:?}/${local_filename}" echo -en "downloading ${local_filename}..." fn_print_removed_eol_nl @@ -320,8 +319,8 @@ fn_check_file() { if [ ${counter} -ge 2 ]; then fn_print_fail_eol_nl if [ -f "${lgsmlog}" ]; then - fn_script_log_fatal "Checking ${remote_filename}" - fn_script_log_fatal "${fileurl}" + fn_script_log_fail "Checking ${remote_filename}" + fn_script_log_fail "${fileurl}" checkflag=1 fi else @@ -421,8 +420,8 @@ 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 "${fileurl}" + fn_script_log_fail "Downloading ${local_filename}..." + fn_script_log_fail "${fileurl}" fi core_exit.sh else @@ -617,7 +616,7 @@ fn_dl_latest_release_github() { # Check how many releases we got from the api and exit if we have more then one. if [ "$(echo -e "${githubreleaseassets}" | jq '. | length')" -gt 1 ]; then fn_print_fatal_nl "Found more than one release to download - Please report this to the LinuxGSM issue tracker" - fn_script_log_fatal "Found more than one release to download - Please report this to the LinuxGSM issue tracker" + fn_script_log_fail "Found more than one release to download - Please report this to the LinuxGSM issue tracker" else # Set variables for download via fn_fetch_file. githubreleasefilename=$(echo -e "${githubreleaseassets}" | jq -r '.[]name') @@ -626,7 +625,7 @@ fn_dl_latest_release_github() { # Error if no version is there. if [ -z "${githubreleasefilename}" ]; then fn_print_fail_nl "Cannot get version from GitHub API for ${githubreleaseuser}/${githubreleaserepo}" - fn_script_log_fatal "Cannot get version from GitHub API for ${githubreleaseuser}/${githubreleaserepo}" + fn_script_log_fail "Cannot get version from GitHub API for ${githubreleaseuser}/${githubreleaserepo}" else # Fetch file from the remote location from the existing module to the ${tmpdir} for now. fn_fetch_file "${githubreleasedownloadlink}" "" "${githubreleasefilename}" "" "${githubreleasedownloadpath}" "${githubreleasefilename}" diff --git a/lgsm/modules/core_exit.sh b/lgsm/modules/core_exit.sh index 6947a3d4a8..496cde4221 100644 --- a/lgsm/modules/core_exit.sh +++ b/lgsm/modules/core_exit.sh @@ -29,7 +29,7 @@ elif [ "${exitcode}" != "0" ]; then # List LinuxGSM version in logs fn_script_log_info "LinuxGSM version: ${version}" if [ "${exitcode}" == "1" ]; then - fn_script_log_fatal "${moduleselfname} exiting with code: ${exitcode}" + fn_script_log_fail "${moduleselfname} exiting with code: ${exitcode}" elif [ "${exitcode}" == "2" ]; then fn_script_log_error "${moduleselfname} exiting with code: ${exitcode}" elif [ "${exitcode}" == "3" ]; then diff --git a/lgsm/modules/core_github.sh b/lgsm/modules/core_github.sh index 228fe1078d..7290f9bdfc 100644 --- a/lgsm/modules/core_github.sh +++ b/lgsm/modules/core_github.sh @@ -28,7 +28,7 @@ fn_github_get_latest_release_version() { # error if no version is there if [ -z "${githubreleaseversion}" ]; then fn_print_fail_nl "Cannot get version from GitHub API for ${githubreleaseuser}/${githubreleaserepo}" - fn_script_log_fatal "Cannot get version from GitHub API for ${githubreleaseuser}/${githubreleaserepo}" + fn_script_log_fail "Cannot get version from GitHub API for ${githubreleaseuser}/${githubreleaserepo}" fi } @@ -46,7 +46,7 @@ fn_github_set_latest_release_version() { # error if no version is there if [ -z "${githubreleaseversion}" ]; then fn_print_fail_nl "Cannot get version from GitHub API for ${githubreleaseuser}/${githubreleaserepo}" - fn_script_log_fatal "Cannot get version from GitHub API for ${githubreleaseuser}/${githubreleaserepo}" + fn_script_log_fail "Cannot get version from GitHub API for ${githubreleaseuser}/${githubreleaserepo}" else echo "${githubreleaseversion}" > "${githublocalversionfile}" fi @@ -81,7 +81,7 @@ fn_github_compare_version() { # error if no version is there if [ -z "${githubreleaseversion}" ]; then fn_print_fail_nl "Can not get version from Github Api for ${githubreleaseuser}/${githubreleaserepo}" - fn_script_log_fatal "Can not get version from Github Api for ${githubreleaseuser}/${githubreleaserepo}" + fn_script_log_fail "Can not get version from Github Api for ${githubreleaseuser}/${githubreleaserepo}" else if [ "${githublocalversion}" == "${githubreleaseversion}" ]; then echo -en "\n" diff --git a/lgsm/modules/core_logs.sh b/lgsm/modules/core_logs.sh index 8057f30f74..3166041aef 100644 --- a/lgsm/modules/core_logs.sh +++ b/lgsm/modules/core_logs.sh @@ -46,7 +46,6 @@ if [ "$(find "${lgsmlogdir}"/ -type f -mtime +"${logdays}" | wc -l)" -ne "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" # Logging logfiles to be removed according to "${logdays}", counting and removing them. diff --git a/lgsm/modules/core_messages.sh b/lgsm/modules/core_messages.sh index 6d3ca9a25a..5af4c5639a 100644 --- a/lgsm/modules/core_messages.sh +++ b/lgsm/modules/core_messages.sh @@ -70,7 +70,7 @@ fn_script_log_pass() { } ## Feb 28 14:56:58 ut99-server: Monitor: FATAL: -fn_script_log_fatal() { +fn_script_log_fail() { if [ -d "${lgsmlogdir}" ]; then if [ -n "${commandname}" ]; then echo -e "$(date '+%b %d %H:%M:%S.%3N') ${selfname}: ${commandname}: FATAL: ${1}" >> "${lgsmlog}" @@ -273,12 +273,22 @@ fn_print_start_nl() { # On-Screen - Interactive messages ################################## +# Separator is different for details. +fn_messages_separator() { + if [ "${commandname}" == "DETAILS" ]; then + printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' = + else + echo -e "${bold}=================================${default}" + fn_sleep_time + fi +} + # No More Room in Hell Debug # ================================= fn_print_header() { echo -e "" - echo -e "${lightyellow}${gamename} ${commandaction}${default}" - echo -e "=================================${default}" + echo -e "${bold}${lightyellow}${gamename} ${commandaction}${default}" + fn_messages_separator } # Complete! diff --git a/lgsm/modules/core_steamcmd.sh b/lgsm/modules/core_steamcmd.sh index 6a7b25c111..e628e44b92 100644 --- a/lgsm/modules/core_steamcmd.sh +++ b/lgsm/modules/core_steamcmd.sh @@ -25,7 +25,7 @@ fn_check_steamcmd_user() { fn_print_fail_nl "Steam login not set. Update steamuser in ${configdirserver}" echo -e " * Change steamuser=\"username\" to a valid steam login." if [ -d "${lgsmlogdir}" ]; then - fn_script_log_fatal "Steam login not set. Update steamuser in ${configdirserver}" + fn_script_log_fail "Steam login not set. Update steamuser in ${configdirserver}" fi core_exit.sh fi @@ -129,7 +129,7 @@ fn_check_steamcmd_clear() { rm -rf "${steamcmddir:?}" exitcode=$? if [ "${exitcode}" != 0 ]; then - fn_script_log_fatal "Removing ${rootdir}/steamcmd" + fn_script_log_fail "Removing ${rootdir}/steamcmd" else fn_script_log_pass "Removing ${rootdir}/steamcmd" fi @@ -154,7 +154,7 @@ fn_update_steamcmd_localbuild() { # Checks if localbuild variable has been set. if [ -z "${localbuild}" ]; then fn_print_fail "Checking local build: ${remotelocation}: missing local build info" - fn_script_log_fatal "Missing local build info" + fn_script_log_fail "Missing local build info" core_exit.sh else fn_print_ok "Checking local build: ${remotelocation}" @@ -188,7 +188,7 @@ fn_update_steamcmd_remotebuild() { # 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" + fn_script_log_fail "Checking remote build" core_exit.sh else fn_print_ok "Checking remote build: ${remotelocation}" @@ -198,7 +198,7 @@ fn_update_steamcmd_remotebuild() { # 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" + fn_script_log_fail "Unable to get remote build" core_exit.sh fi fi @@ -305,7 +305,7 @@ fn_check_steamcmd_appmanifest() { # if error can not be resolved. if [ "${appmanifestfilewc}" -ge "2" ]; then fn_print_fail "Unable to remove x${appmanifestfilewc} appmanifest_${appid}.acf files" - fn_script_log_fatal "Unable to remove x${appmanifestfilewc} appmanifest_${appid}.acf files" + fn_script_log_fail "Unable to remove x${appmanifestfilewc} appmanifest_${appid}.acf files" echo -e "* Check user permissions" for appfile in ${appmanifestfile}; do echo -e " ${appfile}" @@ -327,7 +327,7 @@ fn_check_steamcmd_appmanifest() { fn_appmanifest_info if [ "${appmanifestfilewc}" -eq "0" ]; then fn_print_fail_nl "Still no appmanifest_${appid}.acf found" - fn_script_log_fatal "Still no appmanifest_${appid}.acf found" + fn_script_log_fail "Still no appmanifest_${appid}.acf found" core_exit.sh fi fi diff --git a/lgsm/modules/fix.sh b/lgsm/modules/fix.sh index a7f5f73786..9a4f5b779b 100644 --- a/lgsm/modules/fix.sh +++ b/lgsm/modules/fix.sh @@ -80,8 +80,7 @@ if [ "${commandname}" == "INSTALL" ]; 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 + fn_messages_separator postinstall=1 fn_apply_fix "post install" "${shortname}" fi diff --git a/lgsm/modules/fix_av.sh b/lgsm/modules/fix_av.sh index fbb2599002..bfff59af6d 100644 --- a/lgsm/modules/fix_av.sh +++ b/lgsm/modules/fix_av.sh @@ -13,7 +13,6 @@ export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${serverfiles}:${serverfiles}/linux64" 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 cd "${systemdir}" || exit eval "${executable} ${startparameters}" fi diff --git a/lgsm/modules/fix_kf2.sh b/lgsm/modules/fix_kf2.sh index 46850bd64e..13176d4487 100644 --- a/lgsm/modules/fix_kf2.sh +++ b/lgsm/modules/fix_kf2.sh @@ -10,7 +10,6 @@ moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" startparameters="\"${defaultmap}?Game=KFGameContent.KFGameInfo_VersusSurvival\"" fn_print_information "starting ${gamename} server to generate configs." -fn_sleep_time exitbypass=1 command_start.sh fn_firstcommand_reset diff --git a/lgsm/modules/fix_lo.sh b/lgsm/modules/fix_lo.sh index 4c3758b01d..4966afd570 100644 --- a/lgsm/modules/fix_lo.sh +++ b/lgsm/modules/fix_lo.sh @@ -9,9 +9,7 @@ moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" appidfile=${executabledir}/steam_appid.txt if [ ! -f "${appidfile}" ]; then fn_print_information "adding ${appidfile} to ${gamename} server." - fn_sleep_time echo "903950" > "${appidfile}" else fn_print_information "${appidfile} already exists. No action to be taken." - fn_sleep_time fi diff --git a/lgsm/modules/fix_mta.sh b/lgsm/modules/fix_mta.sh index 65488f2a16..4e533eb51d 100644 --- a/lgsm/modules/fix_mta.sh +++ b/lgsm/modules/fix_mta.sh @@ -10,7 +10,6 @@ moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" if [ ! -f "${lgsmdir}/lib/libmysqlclient.so.16" ]; then fixname="libmysqlclient16" fn_fix_msg_start_nl - fn_sleep_time fn_fetch_file "https://nightly.mtasa.com/files/modules/64/libmysqlclient.so.16" "" "" "" "${lgsmdir}/lib" "libmysqlclient.so.16" "chmodx" "norun" "noforce" "6c188e0f8fb5d7a29f4bc413b9fed6c2" fn_fix_msg_end fi diff --git a/lgsm/modules/fix_samp.sh b/lgsm/modules/fix_samp.sh index 461d92aee7..24882f9150 100644 --- a/lgsm/modules/fix_samp.sh +++ b/lgsm/modules/fix_samp.sh @@ -16,8 +16,8 @@ if [ -f "${servercfgfullpath}" ]; 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) - rconpass="admin${random}" + randomstring=$(tr -dc 'A-Za-z0-9_' < /dev/urandom 2> /dev/null | head -c 8 | xargs) + rconpass="admin${randomstring}" sed -i "s/rcon_password changeme/rcon_password ${rconpass}/g" "${servercfgfullpath}" fn_fix_msg_end fi diff --git a/lgsm/modules/fix_ts3.sh b/lgsm/modules/fix_ts3.sh index c655a43224..5c80aa15e1 100644 --- a/lgsm/modules/fix_ts3.sh +++ b/lgsm/modules/fix_ts3.sh @@ -40,7 +40,7 @@ if [ -f "${accountingfile}" ] && [ "${status}" == "0" ]; then # file is not owned by the current user and needs to be deleted manually. else fn_print_error_nl "File ${accountingfile} is not owned by $(whoami) and needs to be deleted manually" - fn_script_log_fatal "File ${accountingfile} is not owned by $(whoami) and needs to be deleted manually" + fn_script_log_fail "File ${accountingfile} is not owned by $(whoami) and needs to be deleted manually" core_exit.sh fi fi diff --git a/lgsm/modules/fix_ut3.sh b/lgsm/modules/fix_ut3.sh index 97326c7868..d725de4a2d 100644 --- a/lgsm/modules/fix_ut3.sh +++ b/lgsm/modules/fix_ut3.sh @@ -10,7 +10,6 @@ moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" startparameters="server VCTF-Suspense?Game=UTGameContent.UTVehicleCTFGame_Content?bIsDedicated=true?bIsLanMatch=false?bUsesStats=false?bShouldAdvertise=false?PureServer=1?bAllowJoinInProgress=true?ConfigSubDir=${selfname} -port=${port} -queryport=${queryport} -multihome=${ip} -nohomedir -unattended -log=${gamelog}" fn_print_information "starting ${gamename} server to generate configs." -fn_sleep_time exitbypass=1 command_start.sh fn_firstcommand_reset diff --git a/lgsm/modules/info_messages.sh b/lgsm/modules/info_messages.sh index a05da414f4..340e11f6bc 100644 --- a/lgsm/modules/info_messages.sh +++ b/lgsm/modules/info_messages.sh @@ -7,15 +7,6 @@ moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" -# Separator is different for details. -fn_messages_separator() { - if [ "${commandname}" == "DETAILS" ]; then - printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' = - else - echo -e "=================================" - fi -} - # Removes the passwords form all but details. fn_info_message_password_strip() { if [ "${commandname}" != "DETAILS" ]; then @@ -57,7 +48,7 @@ fn_info_message_password_strip() { # used with alertlog fn_info_message_head() { echo -e "" - echo -e "${lightyellow}Alert Summary${default}" + echo -e "${bold}${lightyellow}Alert Summary${default}" fn_messages_separator echo -e "Message" echo -e "${alertbody}" @@ -89,7 +80,7 @@ fn_info_message_distro() { # glibc: 2.31 echo -e "" - echo -e "${lightyellow}Distro Details${default}" + echo -e "${bold}${lightyellow}Distro Details${default}" fn_messages_separator { echo -e "${lightblue}Date:\t${default}$(date)" @@ -132,7 +123,7 @@ fn_info_message_server_resource() { # Internet IP: 176.58.124.96 echo -e "" - echo -e "${lightyellow}Server Resource${default}" + echo -e "${bold}${lightyellow}Server Resource${default}" fn_messages_separator { echo -e "${lightyellow}CPU\t${default}" @@ -185,7 +176,7 @@ fn_info_message_gameserver_resource() { # Backups: 24K echo -e "" - echo -e "${lightyellow}Game Server Resource Usage${default}" + echo -e "${bold}${lightgreen}${gamename} Resource Usage${default}" fn_messages_separator { if [ "${status}" != "0" ] && [ -v status ]; then @@ -234,7 +225,7 @@ fn_info_message_gameserver() { # Status: STARTED echo -e "" - echo -e "${lightgreen}${gamename} Server Details${default}" + echo -e "${bold}${lightgreen}${gamename} Server Details${default}" fn_info_message_password_strip fn_messages_separator { @@ -526,7 +517,7 @@ fn_info_message_script() { # Location: /home/lgsm/csgoserver # Config file: /home/lgsm/csgoserver/serverfiles/csgo/cfg/csgoserver.cfg - echo -e "${lightgreen}${selfname} Script Details${default}" + echo -e "${bold}${lightgreen}${selfname} Script Details${default}" fn_messages_separator { # Script name @@ -618,7 +609,7 @@ fn_info_message_backup() { # size: 945M echo -e "" - echo -e "${lightgreen}Backups${default}" + echo -e "${bold}${lightgreen}Backups${default}" fn_messages_separator if [ ! -d "${backupdir}" ] || [ "${backupcount}" == "0" ]; then echo -e "No Backups created" @@ -646,7 +637,7 @@ fn_info_message_commandlineparms() { # ./run_server_x86.sh +set net_strict 1 echo -e "" - echo -e "${lightgreen}Command-line Parameters${default}" + echo -e "${bold}${lightgreen}Command-line Parameters${default}" fn_info_message_password_strip fn_messages_separator if [ "${serverpassword}" == "NOT SET" ]; then @@ -663,7 +654,7 @@ fn_info_message_ports_edit() { # Change ports by editing the parameters in: # /home/lgsm/qlserver/serverfiles/baseq3/ql-server.cfg echo -e "" - echo -e "${lightgreen}Ports${default}" + echo -e "${bold}${lightgreen}Ports${default}" fn_messages_separator echo -e "${lightblue}Change ports by editing the parameters in:${default}" @@ -726,8 +717,8 @@ fn_info_message_statusbottom() { fn_info_logs() { echo -e "" - echo -e "${selfname} Logs" - echo -e "=================================" + echo -e "${bold}${selfname} Logs" + fn_messages_separator if [ -n "${lgsmlog}" ]; then echo -e "\nScript log\n===================" @@ -1111,7 +1102,7 @@ fn_info_message_kf() { fn_port "Steam" steamport udp } | column -s $'\t' -t echo -e "" - echo -e "${lightgreen}${servername} Web Interface${default}" + echo -e "${bold}${lightgreen}${servername} Web Interface${default}" fn_messages_separator { echo -e "${lightblue}Web Interface enabled:\t${default}${httpenabled}" @@ -1130,7 +1121,7 @@ fn_info_message_kf2() { fn_port "Web Interface" httpport tcp } | column -s $'\t' -t echo -e "" - echo -e "${lightgreen}${servername} Web Interface${default}" + echo -e "${bold}${lightgreen}${servername} Web Interface${default}" fn_messages_separator { echo -e "${lightblue}Web Interface enabled:\t${default}${httpenabled}" @@ -1235,7 +1226,7 @@ fn_info_message_pc() { fn_port "API" apiport tcp } | column -s $'\t' -t echo -e "" - echo -e "${lightgreen}${gamename} Web Interface${default}" + echo -e "${bold}${lightgreen}${gamename} Web Interface${default}" fn_messages_separator { echo -e "${lightblue}Web Interface enabled:\t${default}${httpenabled}" @@ -1321,7 +1312,7 @@ fn_info_message_ro() { fn_port "Steam" steamport udp } | column -s $'\t' -t echo -e "" - echo -e "${lightgreen}${servername} Web Interface${default}" + echo -e "${bold}${lightgreen}${servername} Web Interface${default}" fn_messages_separator { echo -e "${lightblue}Web Interface enabled:\t${default}${httpenabled}" @@ -1400,7 +1391,7 @@ fn_info_message_sdtd() { fn_port "Telnet" telnetport tcp } | column -s $'\t' -t echo -e "" - echo -e "${lightgreen}${gamename} Web Interface${default}" + echo -e "${bold}${lightgreen}${gamename} Web Interface${default}" fn_messages_separator { echo -e "${lightblue}Web Interface enabled:\t${default}${httpenabled}" @@ -1408,7 +1399,7 @@ fn_info_message_sdtd() { echo -e "${lightblue}Web Interface password:\t${default}${httppassword}" } | column -s $'\t' -t echo -e "" - echo -e "${lightgreen}${gamename} Telnet${default}" + echo -e "${bold}${lightgreen}${gamename} Telnet${default}" fn_messages_separator { echo -e "${lightblue}Telnet enabled:\t${default}${telnetenabled}" @@ -1475,7 +1466,7 @@ fn_info_message_spark() { fn_port "Web Interface" httpport tcp } | column -s $'\t' -t echo -e "" - echo -e "${lightgreen}${gamename} Web Interface${default}" + echo -e "${bold}${lightgreen}${gamename} Web Interface${default}" fn_messages_separator { echo -e "${lightblue}Web Interface url:\t${default}http://${httpip}:${httpport}/index.html" @@ -1558,7 +1549,7 @@ fn_info_message_ut2k4() { fn_port "LAN" lanport udp } | column -s $'\t' -t echo -e "" - echo -e "${lightgreen}${servername} Web Interface${default}" + echo -e "${bold}${lightgreen}${gamename} Web Interface${default}" fn_messages_separator { echo -e "${lightblue}Web Interface enabled:\t${default}${httpenabled}" @@ -1577,7 +1568,7 @@ fn_info_message_unreal() { fn_port "Web Interface" httpport tcp } | column -s $'\t' -t echo -e "" - echo -e "${lightgreen}${servername} Web Interface${default}" + echo -e "${bold}${lightgreen}${gamename} Web Interface${default}" fn_messages_separator { echo -e "${lightblue}Web Interface enabled:\t${default}${httpenabled}" @@ -1613,7 +1604,7 @@ fn_info_message_ut3() { fn_port "Web Interface" httpport tcp } | column -s $'\t' -t echo -e "" - echo -e "${lightgreen}${servername} Web Interface${default}" + echo -e "${bold}${lightgreen}${gamename} Web Interface${default}" fn_messages_separator { echo -e "${lightblue}Web Interface enabled:\t${default}${httpenabled}" diff --git a/lgsm/modules/install_complete.sh b/lgsm/modules/install_complete.sh index 013ba73345..2c3cb24937 100644 --- a/lgsm/modules/install_complete.sh +++ b/lgsm/modules/install_complete.sh @@ -8,19 +8,19 @@ moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" echo -e "" -echo -e "=================================" +fn_messages_separator if [ "${exitcode}" == "1" ]; then - echo -e "Install Failed!" + echo -e "${bold}${red}Install Failed!${default}" fn_script_log_fatal "Install Failed!" elif [ "${exitcode}" == "2" ]; then - echo -e "Install Completed with Errors!" + echo -e "${bold}${red}Install Completed with Errors!${default}}" fn_script_log_error "Install Completed with Errors!" elif [ "${exitcode}" == "3" ]; then - echo -e "Install Completed with Warnings!" + echo -e "${bold}${lightyellow}Install Completed with Warnings!${default}}" fn_script_log_warn "Install Completed with Warnings!" elif [ -z "${exitcode}" ] || [ "${exitcode}" == "0" ]; then - echo -e "Install Complete!" + echo -e "${bold}${green}Install Complete!${default}" fn_script_log_pass "Install Complete!" fi diff --git a/lgsm/modules/install_config.sh b/lgsm/modules/install_config.sh index 54f819aafd..1e3c243abe 100644 --- a/lgsm/modules/install_config.sh +++ b/lgsm/modules/install_config.sh @@ -19,9 +19,12 @@ fn_check_cfgdir() { # Downloads default configs from Game-Server-Configs repo to lgsm/config-default. fn_fetch_default_config() { echo -e "" - echo -e "${lightyellow}Downloading ${gamename} Configs${default}" - echo -e "=================================" - echo -e "default configs from https://github.com/GameServerManagers/Game-Server-Configs" + echo -e "${bold}${lightyellow}Downloading ${gamename} Configs${default}" + fn_messages_separator + echo -e "Downloading default configs from:" + echo -e "" + echo -e "${italic}https://github.com/GameServerManagers/Game-Server-Configs${default}" + echo -e "" fn_sleep_time mkdir -p "${lgsmdir}/config-default/config-game" githuburl="https://raw.githubusercontent.com/GameServerManagers/Game-Server-Configs/main" @@ -54,9 +57,20 @@ fn_default_config_remote() { # Copys local default config to server config location. fn_default_config_local() { - echo -e "copying ${servercfgdefault} config file." - cp -nv "${servercfgdir}/${servercfgdefault}" "${servercfgfullpath}" - fn_sleep_time + echo -e "" + echo -e "${bold}${lightyellow}Copying ${gamename} Configs${default}" + fn_messages_separator + echo -e "Copying default configs." + fn_check_cfgdir + echo -en "copying config file [ ${italic}${servercfgdefault}${default} ]" + cp -n "${servercfgdir}/${servercfgdefault}" "${servercfgfullpath}" + if [ "${exitcode}" != 0 ]; then + fn_print_fail_eol + fn_script_log_fatal "copying config file [ ${servercfgdefault} ]" + else + fn_print_ok_eol + fn_script_log_pass "copying config file [ ${servercfgdefault} ]" + fi } # Changes some variables within the default configs. @@ -64,9 +78,9 @@ fn_default_config_local() { # PASSWORD to random password fn_set_config_vars() { if [ -f "${servercfgfullpath}" ]; then - random=$(tr -dc 'A-Za-z0-9_' < /dev/urandom 2>/dev/null | head -c 8 | xargs) + randomstring=$(tr -dc 'A-Za-z0-9_' < /dev/urandom 2> /dev/null | head -c 8 | xargs) servername="LinuxGSM" - rconpass="admin${random}" + rconpass="admin${randomstring}" echo -e "changing hostname." fn_script_log_info "changing hostname." fn_sleep_time @@ -107,8 +121,8 @@ fn_set_dst_config_vars() { fn_sleep_time echo -e "randomizing cluster key." fn_script_log_info "randomizing cluster key." - randomkey=$(tr -dc A-Za-z0-9_ < /dev/urandom | head -c 8 | xargs) - sed -i "s/CLUSTERKEY/${randomkey}/g" "${clustercfgfullpath}" + randomstring=$(tr -dc 'A-Za-z0-9_' < /dev/urandom 2> /dev/null | head -c 8 | xargs) + sed -i "s/CLUSTERKEY/${randomstring}/g" "${clustercfgfullpath}" fn_sleep_time else echo -e "${clustercfg} is already configured." @@ -146,8 +160,8 @@ fn_set_dst_config_vars() { # Lists local config file locations fn_list_config_locations() { echo -e "" - echo -e "${lightyellow}Config File Locations${default}" - echo -e "=================================" + echo -e "${bold}${lightyellow}Config Locations${default}" + fn_messages_separator if [ -n "${servercfgfullpath}" ]; then if [ -f "${servercfgfullpath}" ]; then echo -e "Game Server Config File: ${servercfgfullpath}" diff --git a/lgsm/modules/install_dst_token.sh b/lgsm/modules/install_dst_token.sh index 43db58fabe..89ec00a901 100644 --- a/lgsm/modules/install_dst_token.sh +++ b/lgsm/modules/install_dst_token.sh @@ -8,9 +8,8 @@ moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" echo -e "" -echo -e "${lightyellow}Enter ${gamename} Cluster Token${default}" -echo -e "=================================" -fn_sleep_time +echo -e "${bold}${lightyellow}Enter ${gamename} Cluster Token${default}" +fn_messages_separator echo -e "A cluster token is required to run this server!" echo -e "Follow the instructions in this link to obtain this key:" echo -e "https://linuxgsm.com/dst-auth-token" diff --git a/lgsm/modules/install_eula.sh b/lgsm/modules/install_eula.sh index d70ca7d31d..7f0229bfa2 100644 --- a/lgsm/modules/install_eula.sh +++ b/lgsm/modules/install_eula.sh @@ -16,9 +16,8 @@ elif [ "${shortname}" == "ut" ]; then fi echo -e "" -echo -e "${lightyellow}Accept ${gamename} EULA${default}" -echo -e "=================================" -fn_sleep_time +echo -e "${bold}${lightyellow}Accept ${gamename} EULA${default}" +fn_messages_separator echo -e "You are required to accept the EULA:" echo -e "${eulaurl}" echo -e "" diff --git a/lgsm/modules/install_factorio_save.sh b/lgsm/modules/install_factorio_save.sh index c86ee2f371..589a9d8ed8 100644 --- a/lgsm/modules/install_factorio_save.sh +++ b/lgsm/modules/install_factorio_save.sh @@ -8,8 +8,7 @@ moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" echo -e "" -echo -e "${lightyellow}Creating initial Factorio savefile${default}" -echo -e "=================================" -fn_sleep_time +echo -e "${bold}${lightyellow}Creating initial Factorio savefile${default}" +fn_messages_separator check_glibc.sh "${executabledir}"/factorio --create "${serverfiles}/save1" diff --git a/lgsm/modules/install_gslt.sh b/lgsm/modules/install_gslt.sh index e2224276f3..772885d64b 100644 --- a/lgsm/modules/install_gslt.sh +++ b/lgsm/modules/install_gslt.sh @@ -8,8 +8,8 @@ moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" echo -e "" -echo -e "${lightyellow}Game Server Login Token${default}" -echo -e "=================================" +echo -e "${bold}${lightyellow}Game Server Login Token${default}" +fn_messages_separator fn_sleep_time if [ "${shortname}" == "csgo" ] || [ "${shortname}" == "css" ] || [ "${shortname}" == "nmrih" ] || [ "${shortname}" == "bs" ]; then echo -e "GSLT is required to run a public ${gamename} server" diff --git a/lgsm/modules/install_header.sh b/lgsm/modules/install_header.sh index b52e116e7f..a7f1f9ddb1 100644 --- a/lgsm/modules/install_header.sh +++ b/lgsm/modules/install_header.sh @@ -9,14 +9,12 @@ moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" clear fn_print_ascii_logo -fn_sleep_time -echo -e "=================================" -echo -e "${lightyellow}Linux${default}GSM_" -echo -e "by Daniel Gibbs" +fn_messages_separator +echo -e "${bold}${lightyellow}Linux${default}${bold}GSM_${default}" +echo -e "${italic}by Daniel Gibbs${default}" echo -e "${lightblue}Version:${default} ${version}" echo -e "${lightblue}Game:${default} ${gamename}" echo -e "${lightblue}Website:${default} https://linuxgsm.com" echo -e "${lightblue}Contributors:${default} https://linuxgsm.com/contrib" echo -e "${lightblue}Sponsor:${default} https://linuxgsm.com/sponsor" -echo -e "=================================" -fn_sleep_time +fn_messages_separator diff --git a/lgsm/modules/install_logs.sh b/lgsm/modules/install_logs.sh index cd26addd3c..5b12dd3e10 100644 --- a/lgsm/modules/install_logs.sh +++ b/lgsm/modules/install_logs.sh @@ -9,8 +9,9 @@ moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" if [ "${checklogs}" != "1" ]; then echo -e "" - echo -e "${lightyellow}Creating log directories${default}" - echo -e "=================================" + echo -e "${bold}${lightyellow}Creating Log Directories${default}" + fn_messages_separator + fn_sleep_time fi fn_sleep_time # Create LinuxGSM logs. diff --git a/lgsm/modules/install_server_dir.sh b/lgsm/modules/install_server_dir.sh index 08e83dce6c..0136e52fc9 100644 --- a/lgsm/modules/install_server_dir.sh +++ b/lgsm/modules/install_server_dir.sh @@ -8,8 +8,8 @@ moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" echo -e "" -echo -e "${lightyellow}Server Directory${default}" -echo -e "=================================" +echo -e "${bold}${lightyellow}Server Directory${default}" +fn_messages_separator fn_sleep_time if [ -d "${serverfiles}" ]; then fn_print_warning_nl "A server is already installed here." diff --git a/lgsm/modules/install_server_files.sh b/lgsm/modules/install_server_files.sh index 70eb808b0d..2763f470bc 100644 --- a/lgsm/modules/install_server_files.sh +++ b/lgsm/modules/install_server_files.sh @@ -199,16 +199,15 @@ fn_install_server_files() { 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" + fn_script_log_fail "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}" } echo -e "" -echo -e "${lightyellow}Installing ${gamename} Server${default}" -echo -e "=================================" -fn_sleep_time +echo -e "${bold}${lightyellow}Installing ${gamename} Server${default}" +fn_messages_separator if [ "${appid}" ]; then remotelocation="SteamCMD" @@ -250,7 +249,7 @@ fi if [ -z "${autoinstall}" ]; then echo -e "" - echo -e "=================================" + fn_messages_separator if ! fn_prompt_yn "Was the install successful?" Y; then install_retry.sh fi diff --git a/lgsm/modules/install_squad_license.sh b/lgsm/modules/install_squad_license.sh index 75499f4a06..604b3bcad7 100644 --- a/lgsm/modules/install_squad_license.sh +++ b/lgsm/modules/install_squad_license.sh @@ -8,9 +8,8 @@ moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" echo -e "" -echo -e "${lightyellow}Squad Server License${default}" -echo -e "=================================" -fn_sleep_time +echo -e "${bold}${lightyellow}${gamename} Server License${default}" +fn_messages_separator echo -e "Server license is an optional feature for ${gamename} server" fn_script_log_info "Server license is an optional feature for ${gamename} server" diff --git a/lgsm/modules/install_stats.sh b/lgsm/modules/install_stats.sh index 8c65c007c2..c3e92323d9 100644 --- a/lgsm/modules/install_stats.sh +++ b/lgsm/modules/install_stats.sh @@ -8,12 +8,13 @@ moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" echo -e "" -echo -e "${lightyellow}LinuxGSM Stats${default}" -echo -e "=================================" +echo -e "${bold}${lightyellow}LinuxGSM Stats${default}" +fn_messages_separator fn_sleep_time echo -e "Assist LinuxGSM development by sending anonymous stats to developers." -echo -e "More info: https://docs.linuxgsm.com/configuration/linuxgsm-stats" -echo -e "The following info will be sent:" +echo -e "Collected data is publicly available: ${italic}https://linuxgsm.com/data/usage${default}" +echo -e "More info: ${italic}https://docs.linuxgsm.com/configuration/linuxgsm-stats${default}" +echo -e "The following info will be sent: " echo -e "* game server" echo -e "* distro" echo -e "* game server resource usage" diff --git a/lgsm/modules/install_steamcmd.sh b/lgsm/modules/install_steamcmd.sh index 8eeb2de539..50599ebd53 100644 --- a/lgsm/modules/install_steamcmd.sh +++ b/lgsm/modules/install_steamcmd.sh @@ -8,7 +8,6 @@ moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" echo -e "" -echo -e "${lightyellow}Installing SteamCMD${default}" -echo -e "=================================" -fn_sleep_time +echo -e "${bold}${lightyellow}Installing SteamCMD${default}" +fn_messages_separator check_steamcmd.sh diff --git a/lgsm/modules/install_ts3db.sh b/lgsm/modules/install_ts3db.sh index 703f9b6454..e5776c30f8 100644 --- a/lgsm/modules/install_ts3db.sh +++ b/lgsm/modules/install_ts3db.sh @@ -14,7 +14,7 @@ fn_install_ts3db_mariadb() { local exitcode=$? if [ "${exitcode}" != "0" ]; then fn_print_fail_eol_nl - fn_script_log_fatal "copying libmariadb.so.2" + fn_script_log_fail "copying libmariadb.so.2" core_exit.sh else fn_print_ok_eol_nl @@ -23,9 +23,8 @@ fn_install_ts3db_mariadb() { fi echo -e "" - echo -e "${lightyellow}Configure ${gamename} Server for MariaDB${default}" - echo -e "=================================" - fn_sleep_time + echo -e "${bold}${lightyellow}Configure ${gamename} Server for MariaDB${default}" + fn_messages_separator read -rp "Enter MariaDB hostname: " mariahostname read -rp "Enter MariaDB port: " mariaport read -rp "Enter MariaDB username: " mariausername @@ -50,9 +49,8 @@ fn_install_ts3db_mariadb() { } echo -e "" -echo -e "${lightyellow}Select Database${default}" -echo -e "=================================" -fn_sleep_time +echo -e "${bold}${lightyellow}Select Database${default}" +fn_messages_separator if [ -z "${autoinstall}" ]; then if fn_prompt_yn "Do you want to use MariaDB instead of sqlite? (MariaDB must be pre-configured)" N; then fn_install_ts3db_mariadb @@ -64,9 +62,8 @@ fi install_eula.sh echo -e "" -echo -e "${lightyellow}Getting Privilege Key${default}" -echo -e "=================================" -fn_sleep_time +echo -e "${bold}${lightyellow}Getting Privilege Key${default}" +fn_messages_separator fn_print_information_nl "Save these details for later." fn_print_information_nl "Key also saved in:" echo -e "${serverfiles}/privilege_key.txt" diff --git a/lgsm/modules/install_ut2k4_key.sh b/lgsm/modules/install_ut2k4_key.sh index c09c4590ce..6fbd2a838d 100644 --- a/lgsm/modules/install_ut2k4_key.sh +++ b/lgsm/modules/install_ut2k4_key.sh @@ -8,9 +8,8 @@ moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" echo -e "" -echo -e "${lightyellow}Enter ${gamename} CD Key${default}" -echo -e "=================================" -fn_sleep_time +echo -e "${bold}${lightyellow}Enter ${gamename} CD Key${default}" +fn_messages_separator echo -e "To get your server listed on the Master Server list" echo -e "you must get a free CD key. Get a key here:" echo -e "https://www.epicgames.com/unrealtournament/forums/cdkey.php?2004" diff --git a/lgsm/modules/mods_core.sh b/lgsm/modules/mods_core.sh index 2078ae1673..1b85a95b35 100644 --- a/lgsm/modules/mods_core.sh +++ b/lgsm/modules/mods_core.sh @@ -22,7 +22,7 @@ fn_mod_install_files() { # Check if variable is valid checking if file has been downloaded and exists. if [ ! -f "${modstmpdir}/${modfilename}" ]; then fn_print_failure "An issue occurred downloading ${modprettyname}" - fn_script_log_fatal "An issue occurred downloading ${modprettyname}" + fn_script_log_fail "An issue occurred downloading ${modprettyname}" core_exit.sh fi if [ ! -d "${extractdest}" ]; then @@ -77,7 +77,7 @@ fn_mod_create_filelist() { local exitcode=$? if [ "${exitcode}" != 0 ]; then fn_print_fail_eol_nl - fn_script_log_fatal "Building ${modsdir}/${modcommand}-files.txt" + fn_script_log_fail "Building ${modsdir}/${modcommand}-files.txt" core_exit.sh else fn_print_ok_eol_nl @@ -97,7 +97,7 @@ fn_mod_copy_destination() { local exitcode=$? if [ "${exitcode}" != 0 ]; then fn_print_fail_eol_nl - fn_script_log_fatal "Copying ${modprettyname} to ${modinstalldir}" + fn_script_log_fail "Copying ${modprettyname} to ${modinstalldir}" else fn_print_ok_eol_nl fn_script_log_pass "Copying ${modprettyname} to ${modinstalldir}" @@ -135,7 +135,7 @@ fn_mod_tidy_files_list() { local exitcode=$? if [ "${exitcode}" != 0 ]; then fn_print_fail_eol_nl - fn_script_log_fatal "Error while tidying line: ${removefilevar} from: ${modsdir}/${modcommand}-files.txt" + fn_script_log_fail "Error while tidying line: ${removefilevar} from: ${modsdir}/${modcommand}-files.txt" core_exit.sh break fi @@ -228,7 +228,7 @@ 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_script_log_fail "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 @@ -390,7 +390,7 @@ fn_create_mods_dir() { exitcode=$? if [ "${exitcode}" != 0 ]; then fn_print_fail_eol_nl - fn_script_log_fatal "Creating mod download dir ${modsdir}" + fn_script_log_fail "Creating mod download dir ${modsdir}" core_exit.sh else fn_print_ok_eol_nl @@ -404,7 +404,7 @@ fn_create_mods_dir() { exitcode=$? if [ "${exitcode}" != 0 ]; then fn_print_fail_eol_nl - fn_script_log_fatal "Creating mod install directory ${modinstalldir}" + fn_script_log_fail "Creating mod install directory ${modinstalldir}" core_exit.sh else fn_print_ok_eol_nl @@ -427,7 +427,7 @@ fn_mods_create_tmp_dir() { echo -en "creating mod download directory ${modstmpdir}..." if [ "${exitcode}" != 0 ]; then fn_print_fail_eol_nl - fn_script_log_fatal "Creating mod download directory ${modstmpdir}" + fn_script_log_fail "Creating mod download directory ${modstmpdir}" core_exit.sh else fn_print_ok_eol_nl @@ -444,7 +444,7 @@ fn_mods_clear_tmp_dir() { exitcode=$? if [ "${exitcode}" != 0 ]; then fn_print_fail_eol_nl - fn_script_log_fatal "Clearing mod download directory ${modstmpdir}" + fn_script_log_fail "Clearing mod download directory ${modstmpdir}" core_exit.sh else fn_print_ok_eol_nl @@ -491,12 +491,12 @@ fn_check_mod_files_list() { if [ "${modsfilelistsize}" -eq 0 ]; then fn_print_failure "${modcommand}-files.txt is empty" echo -e "* Unable to remove ${modprettyname}" - fn_script_log_fatal "${modcommand}-files.txt is empty: Unable to remove ${modprettyname}." + fn_script_log_fail "${modcommand}-files.txt is empty: Unable to remove ${modprettyname}." core_exit.sh fi else fn_print_failure "${modsdir}/${modcommand}-files.txt does not exist" - fn_script_log_fatal "${modsdir}/${modcommand}-files.txt does not exist: Unable to remove ${modprettyname}." + fn_script_log_fail "${modsdir}/${modcommand}-files.txt does not exist: Unable to remove ${modprettyname}." core_exit.sh fi } @@ -519,7 +519,7 @@ fn_mod_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" + fn_script_log_fail "${modreq}-files.txt is empty: unable to find ${modreq} installed" echo -en "* Unable to find '${modreq}' which is required prior to installing this mod..." fn_print_fail_eol_nl core_exit.sh @@ -581,7 +581,7 @@ fn_mod_install_liblist_gam_file() { exitcode=$? # if replacement back didn't happen, error out. if [ "${exitcode}" != 0 ]; then - fn_script_log_fatal "${logentry}" + fn_script_log_fail "${logentry}" fn_print_fail_eol_nl else fn_script_log_pass "${logentry}" @@ -597,7 +597,7 @@ fn_mod_install_liblist_gam_file() { exitcode=$? # if replacement back didn't happen, error out if [ "${exitcode}" != 0 ]; then - fn_script_log_fatal "${logentry}" + fn_script_log_fail "${logentry}" fn_print_fail_eol_nl else fn_script_log_pass "${logentry}" @@ -615,7 +615,7 @@ fn_mod_install_liblist_gam_file() { exitcode=$? # if replacement back didn't happen, error out. if [ "${exitcode}" != 0 ]; then - fn_script_log_fatal "${logentry}" + fn_script_log_fail "${logentry}" fn_print_fail_eol_nl else fn_script_log_pass ${logentry} @@ -639,7 +639,7 @@ fn_mod_remove_liblist_gam_file() { exitcode=$? # if replacement back didn't happen, error out. if [ "${exitcode}" != 0 ]; then - fn_script_log_fatal "${logentry}" + fn_script_log_fail "${logentry}" fn_print_fail_eol_nl else fn_script_log_pass ${logentry} @@ -655,7 +655,7 @@ fn_mod_remove_liblist_gam_file() { exitcode=$? # if replacement back didn't happen, error out if [ "${exitcode}" != 0 ]; then - fn_script_log_fatal "${logentry}" + fn_script_log_fail "${logentry}" fn_print_fail_eol_nl else fn_script_log_pass ${logentry} @@ -673,7 +673,7 @@ fn_mod_remove_liblist_gam_file() { # if replacement back didn't happen, error out. exitcode=$? if [ "${exitcode}" != 0 ]; then - fn_script_log_fatal "${logentry}" + fn_script_log_fail "${logentry}" fn_print_fail_eol_nl else fn_script_log_pass ${logentry} @@ -696,7 +696,7 @@ fn_mod_install_amxmodx_file() { echo "linux addons/amxmodx/dlls/amxmodx_mm_i386.so" >> "${modinstalldir}/addons/metamod/plugins.ini" exitcode=$? if [ "${exitcode}" != 0 ]; then - fn_script_log_fatal "${logentry}" + fn_script_log_fail "${logentry}" fn_print_fail_eol_nl else fn_script_log_pass ${logentry} @@ -708,7 +708,7 @@ fn_mod_install_amxmodx_file() { echo "linux addons/amxmodx/dlls/amxmodx_mm_i386.so" > "${modinstalldir}/addons/metamod/plugins.ini" exitcode=$? if [ "${exitcode}" != 0 ]; then - fn_script_log_fatal "${logentry}" + fn_script_log_fail "${logentry}" fn_print_fail_eol_nl core_exit.sh else @@ -733,7 +733,7 @@ fn_mod_remove_amxmodx_file() { sed -i '/^$/d' "${modinstalldir}/addons/metamod/plugins.ini" exitcode=$? if [ "${exitcode}" != 0 ]; then - fn_script_log_fatal "${logentry}" + fn_script_log_fail "${logentry}" fn_print_fail_eol_nl else fn_script_log_pass ${logentry} diff --git a/lgsm/modules/update_fctr.sh b/lgsm/modules/update_fctr.sh index 9b88fcd170..2eef0d4cd1 100644 --- a/lgsm/modules/update_fctr.sh +++ b/lgsm/modules/update_fctr.sh @@ -46,7 +46,7 @@ fn_update_remotebuild() { # 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" + fn_script_log_fail "Checking remote build" core_exit.sh else fn_print_ok "Checking remote build: ${remotelocation}" @@ -56,7 +56,7 @@ fn_update_remotebuild() { # 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" + fn_script_log_fail "Unable to get remote build" core_exit.sh fi fi diff --git a/lgsm/modules/update_jk2.sh b/lgsm/modules/update_jk2.sh index e67b0c02b8..f685fd4cb9 100644 --- a/lgsm/modules/update_jk2.sh +++ b/lgsm/modules/update_jk2.sh @@ -43,7 +43,7 @@ fn_update_remotebuild() { # 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" + fn_script_log_fail "Checking remote build" core_exit.sh else fn_print_ok "Checking remote build: ${remotelocation}" @@ -53,7 +53,7 @@ fn_update_remotebuild() { # 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" + fn_script_log_fail "Unable to get remote build" core_exit.sh fi fi diff --git a/lgsm/modules/update_mc.sh b/lgsm/modules/update_mc.sh index 2f7381da78..c4aa1b425c 100644 --- a/lgsm/modules/update_mc.sh +++ b/lgsm/modules/update_mc.sh @@ -58,7 +58,7 @@ fn_update_remotebuild() { # 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" + fn_script_log_fail "Checking remote build" core_exit.sh else fn_print_ok "Checking remote build: ${remotelocation}" @@ -68,7 +68,7 @@ fn_update_remotebuild() { # 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" + fn_script_log_fail "Unable to get remote build" core_exit.sh fi fi diff --git a/lgsm/modules/update_mcb.sh b/lgsm/modules/update_mcb.sh index f3a802e9e4..eb8adfd12c 100644 --- a/lgsm/modules/update_mcb.sh +++ b/lgsm/modules/update_mcb.sh @@ -18,7 +18,7 @@ fn_update_dl() { local exitcode=$? if [ "${exitcode}" != 0 ]; then fn_print_fail_eol_nl - fn_script_log_fatal "Extracting ${local_filename}" + fn_script_log_fail "Extracting ${local_filename}" if [ -f "${lgsmlog}" ]; then echo -e "${extractcmd}" >> "${lgsmlog}" fi @@ -50,10 +50,10 @@ fn_update_localbuild() { fn_update_remotebuild() { # Random number for userAgent - randnum=$((1 + RANDOM % 5000)) + randomint=$(tr -dc 0-9 < /dev/urandom 2> /dev/null | head -c 4 | xargs) # Get remote build info. if [ "${mcversion}" == "latest" ]; then - 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]") + 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.${randomint}.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 remotebuildversion="${mcversion}" fi @@ -64,7 +64,7 @@ fn_update_remotebuild() { # 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" + fn_script_log_fail "Checking remote build" core_exit.sh else fn_print_ok "Checking remote build: ${remotelocation}" @@ -74,7 +74,7 @@ fn_update_remotebuild() { # 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" + fn_script_log_fail "Unable to get remote build" core_exit.sh fi fi diff --git a/lgsm/modules/update_mta.sh b/lgsm/modules/update_mta.sh index fd728b22df..cd11955639 100644 --- a/lgsm/modules/update_mta.sh +++ b/lgsm/modules/update_mta.sh @@ -45,7 +45,7 @@ fn_update_remotebuild() { # 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" + fn_script_log_fail "Checking remote build" core_exit.sh else fn_print_ok "Checking remote build: ${remotelocation}" @@ -55,7 +55,7 @@ fn_update_remotebuild() { # 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" + fn_script_log_fail "Unable to get remote build" core_exit.sh fi fi diff --git a/lgsm/modules/update_pmc.sh b/lgsm/modules/update_pmc.sh index 2ad6b91abc..9bfa82101e 100644 --- a/lgsm/modules/update_pmc.sh +++ b/lgsm/modules/update_pmc.sh @@ -68,7 +68,7 @@ fn_update_remotebuild() { # 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" + fn_script_log_fail "Checking remote build" core_exit.sh else fn_print_ok "Checking remote build: ${remotelocation}" @@ -78,7 +78,7 @@ fn_update_remotebuild() { # 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" + fn_script_log_fail "Unable to get remote build" core_exit.sh fi fi diff --git a/lgsm/modules/update_ts3.sh b/lgsm/modules/update_ts3.sh index bb137a0b30..c00ae75cba 100644 --- a/lgsm/modules/update_ts3.sh +++ b/lgsm/modules/update_ts3.sh @@ -50,7 +50,7 @@ fn_update_remotebuild() { # 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" + fn_script_log_fail "Checking remote build" core_exit.sh else fn_print_ok "Checking remote build: ${remotelocation}" @@ -60,7 +60,7 @@ fn_update_remotebuild() { # 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" + fn_script_log_fail "Unable to get remote build" core_exit.sh fi fi @@ -164,7 +164,7 @@ elif [ "${arch}" == "i386" ] || [ "${arch}" == "i686" ]; then ts3arch="x86" else fn_print_failure "Unknown or unsupported architecture: ${arch}" - fn_script_log_fatal "Unknown or unsupported architecture: ${arch}" + fn_script_log_fail "Unknown or unsupported architecture: ${arch}" core_exit.sh fi diff --git a/lgsm/modules/update_ut99.sh b/lgsm/modules/update_ut99.sh index c1dc1dade5..bdd3631f39 100644 --- a/lgsm/modules/update_ut99.sh +++ b/lgsm/modules/update_ut99.sh @@ -44,7 +44,7 @@ fn_update_remotebuild() { # 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" + fn_script_log_fail "Checking remote build" core_exit.sh else fn_print_ok "Checking remote build: ${remotelocation}" @@ -54,7 +54,7 @@ fn_update_remotebuild() { # 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" + fn_script_log_fail "Unable to get remote build" core_exit.sh fi fi diff --git a/lgsm/modules/update_vints.sh b/lgsm/modules/update_vints.sh index 47195b9b20..b383720588 100644 --- a/lgsm/modules/update_vints.sh +++ b/lgsm/modules/update_vints.sh @@ -51,7 +51,7 @@ fn_update_remotebuild() { # 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" + fn_script_log_fail "Checking remote build" core_exit.sh else fn_print_ok "Checking remote build: ${remotelocation}" @@ -61,7 +61,7 @@ fn_update_remotebuild() { # 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" + fn_script_log_fail "Unable to get remote build" core_exit.sh fi fi diff --git a/linuxgsm.sh b/linuxgsm.sh index 6da7de6641..520373d489 100755 --- a/linuxgsm.sh +++ b/linuxgsm.sh @@ -124,8 +124,8 @@ fn_bootstrap_fetch_file() { if [ ${counter} -ge 2 ]; then echo -e "FAIL" if [ -f "${lgsmlog}" ]; then - fn_script_log_fatal "Downloading ${local_filename}" - fn_script_log_fatal "${fileurl}" + fn_script_log_fail "Downloading ${local_filename}" + fn_script_log_fail "${fileurl}" fi core_exit.sh else diff --git a/tests/tests_fctrserver.sh b/tests/tests_fctrserver.sh index a63023dc8a..0b4530d878 100644 --- a/tests/tests_fctrserver.sh +++ b/tests/tests_fctrserver.sh @@ -122,8 +122,8 @@ fn_bootstrap_fetch_file() { if [ ${counter} -ge 2 ]; then echo -e "FAIL" if [ -f "${lgsmlog}" ]; then - fn_script_log_fatal "Downloading ${local_filename}" - fn_script_log_fatal "${fileurl}" + fn_script_log_fail "Downloading ${local_filename}" + fn_script_log_fail "${fileurl}" fi core_exit.sh else diff --git a/tests/tests_jc2server.sh b/tests/tests_jc2server.sh index b921de2749..adf59ab924 100644 --- a/tests/tests_jc2server.sh +++ b/tests/tests_jc2server.sh @@ -123,8 +123,8 @@ fn_bootstrap_fetch_file() { if [ ${counter} -ge 2 ]; then echo -e "FAIL" if [ -f "${lgsmlog}" ]; then - fn_script_log_fatal "Downloading ${local_filename}" - fn_script_log_fatal "${fileurl}" + fn_script_log_fail "Downloading ${local_filename}" + fn_script_log_fail "${fileurl}" fi core_exit.sh else diff --git a/tests/tests_mcserver.sh b/tests/tests_mcserver.sh index d173c7d680..3a40e9aa54 100644 --- a/tests/tests_mcserver.sh +++ b/tests/tests_mcserver.sh @@ -123,8 +123,8 @@ fn_bootstrap_fetch_file() { if [ ${counter} -ge 2 ]; then echo -e "FAIL" if [ -f "${lgsmlog}" ]; then - fn_script_log_fatal "Downloading ${local_filename}" - fn_script_log_fatal "${fileurl}" + fn_script_log_fail "Downloading ${local_filename}" + fn_script_log_fail "${fileurl}" fi core_exit.sh else diff --git a/tests/tests_ts3server.sh b/tests/tests_ts3server.sh index 7363a10254..3fcb8ae24c 100644 --- a/tests/tests_ts3server.sh +++ b/tests/tests_ts3server.sh @@ -123,8 +123,8 @@ fn_bootstrap_fetch_file() { if [ ${counter} -ge 2 ]; then echo -e "FAIL" if [ -f "${lgsmlog}" ]; then - fn_script_log_fatal "Downloading ${local_filename}" - fn_script_log_fatal "${fileurl}" + fn_script_log_fail "Downloading ${local_filename}" + fn_script_log_fail "${fileurl}" fi core_exit.sh else