From e9dbda748e85392a3fc8a73d09dce97aeb35d7c3 Mon Sep 17 00:00:00 2001 From: Christian Date: Sun, 3 Jan 2021 00:12:19 +0100 Subject: [PATCH 1/4] fix(steamcmd): retries are not honored if install succeeds (#3155) --- lgsm/functions/core_dl.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lgsm/functions/core_dl.sh b/lgsm/functions/core_dl.sh index 35b5e008b..01ffcfbc3 100755 --- a/lgsm/functions/core_dl.sh +++ b/lgsm/functions/core_dl.sh @@ -87,8 +87,9 @@ fn_dl_steamcmd(){ 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 "Error!" "${steamcmdlog}" | tail -1)" ]||[ -n "$(grep "ERROR!" "${steamcmdlog}" | tail -1)" ]; then + if [ -n "$(grep -i "Error!" "${steamcmdlog}" | tail -1)" ]&&[ "$(grep -ic "Error!" "${steamcmdlog}")" -ge "${counter}" ] ; then # Not enough space. if [ -n "$(grep "0x202" "${steamcmdlog}" | tail -1)" ]; then fn_print_failure_nl "${commandaction} ${selfname}: ${remotelocation}: Not enough space to download server files" From ede205ad6bb4af90a4c7db0c3c06683e70b024a7 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Thu, 7 Jan 2021 16:11:30 +0000 Subject: [PATCH 2/4] feat: refactor check_config removing some game specific code (#3160) --- lgsm/functions/check_config.sh | 35 +++++++++++++++------------------- 1 file changed, 15 insertions(+), 20 deletions(-) diff --git a/lgsm/functions/check_config.sh b/lgsm/functions/check_config.sh index 2b4443cb3..ce9035744 100755 --- a/lgsm/functions/check_config.sh +++ b/lgsm/functions/check_config.sh @@ -6,26 +6,21 @@ functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" -if [ ! -f "${servercfgfullpath}" ]; then - if [ "${shortname}" != "hw" ]&&[ "${shortname}" != "ut3" ]&&[ "${shortname}" != "kf2" ]; 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 [ -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" ]; then - if [ -z "${rconpassword}" ]; then - fn_print_dots "" - fn_print_fail_nl "RCON password is not set" - fn_script_log_fatal "RCON password is not set" - core_exit.sh - elif [ "${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}" == "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 From 16e58f1d327b8c6818dd31114733f1c8dcbfafee Mon Sep 17 00:00:00 2001 From: Christian Date: Sat, 9 Jan 2021 00:10:57 +0100 Subject: [PATCH 3/4] fix(gmod): update link for wiki page (#3165) --- lgsm/config-default/config-lgsm/gmodserver/_default.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lgsm/config-default/config-lgsm/gmodserver/_default.cfg b/lgsm/config-default/config-lgsm/gmodserver/_default.cfg index 1e8fb92aa..4bac3995c 100644 --- a/lgsm/config-default/config-lgsm/gmodserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/gmodserver/_default.cfg @@ -18,7 +18,7 @@ maxplayers="16" tickrate="66" gamemode="sandbox" -## Workshop Parameters | https://wiki.garrysmod.com/page/Workshop_for_Dedicated_Servers +## Workshop Parameters | https://wiki.facepunch.com/gmod/Workshop_for_Dedicated_Servers # To get an API key visit - https://steamcommunity.com/dev/apikey wsapikey="" wscollectionid="" From 681d878e9270eb6c442998b144af73e4b9ee19fe Mon Sep 17 00:00:00 2001 From: Christian Date: Sat, 9 Jan 2021 22:01:15 +0100 Subject: [PATCH 4/4] fix(steamcmd): fix branch switch (#3168) --- lgsm/functions/core_dl.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lgsm/functions/core_dl.sh b/lgsm/functions/core_dl.sh index 01ffcfbc3..7bb346a85 100755 --- a/lgsm/functions/core_dl.sh +++ b/lgsm/functions/core_dl.sh @@ -61,7 +61,7 @@ fn_dl_steamcmd(){ # If using a specific branch. if [ -n "${branch}" ]&&[ -n "${betapassword}" ]; then ${unbuffer} ${steamcmdcommand} +login "${steamuser}" "${steampass}" +force_install_dir "${serverfiles}" +app_set_config 90 mod "${appidmod}" +app_update "${appid}" -beta "${branch}" -betapassword "${betapassword}" ${validate} +quit | uniq | tee -a "${lgsmlog}" "${steamcmdlog}" - elif [ -n "${branch}" ]&&[ "${branch}" != "public" ]; then + elif [ -n "${branch}" ]; then ${unbuffer} ${steamcmdcommand} +login "${steamuser}" "${steampass}" +force_install_dir "${serverfiles}" +app_set_config 90 mod "${appidmod}" +app_update "${appid}" -beta "${branch}" ${validate} +quit | uniq | tee -a "${lgsmlog}" "${steamcmdlog}" else ${unbuffer} ${steamcmdcommand} +login "${steamuser}" "${steampass}" +force_install_dir "${serverfiles}" +app_set_config 90 mod "${appidmod}" +app_update "${appid}" ${validate} +quit | uniq | tee -a "${lgsmlog}" "${steamcmdlog}" @@ -70,7 +70,7 @@ fn_dl_steamcmd(){ elif [ "${shortname}" == "ac" ]||[ "${shortname}" == "jk2" ]; then if [ -n "${branch}" ]&&[ -n "${betapassword}" ]; then ${unbuffer} ${steamcmdcommand} +@sSteamCmdForcePlatformType windows +login "${steamuser}" "${steampass}" +force_install_dir "${serverfiles}" +app_update "${appid}" -beta "${branch}" -betapassword "${betapassword}" ${validate} +quit | uniq | tee -a "${lgsmlog}" "${steamcmdlog}" - elif [ -n "${branch}" ]&&[ "${branch}" != "public" ]; then + elif [ -n "${branch}" ]; then ${unbuffer} ${steamcmdcommand} +@sSteamCmdForcePlatformType windows +login "${steamuser}" "${steampass}" +force_install_dir "${serverfiles}" +app_update "${appid}" -beta "${branch}" ${validate} +quit | uniq | tee -a "${lgsmlog}" "${steamcmdlog}" else ${unbuffer} ${steamcmdcommand} +@sSteamCmdForcePlatformType windows +login "${steamuser}" "${steampass}" +force_install_dir "${serverfiles}" +app_update "${appid}" ${validate} +quit | uniq | tee -a "${lgsmlog}" "${steamcmdlog}" @@ -79,7 +79,7 @@ fn_dl_steamcmd(){ else if [ -n "${branch}" ]&&[ -n "${betapassword}" ]; then ${unbuffer} ${steamcmdcommand} +login "${steamuser}" "${steampass}" +force_install_dir "${serverfiles}" +app_update "${appid}" -beta "${branch}" -betapassword "${betapassword}" ${validate} +quit | uniq | tee -a "${lgsmlog}" "${steamcmdlog}" - elif [ -n "${branch}" ]&&[ "${branch}" != "public" ]; then + elif [ -n "${branch}" ]; then ${unbuffer} ${steamcmdcommand} +login "${steamuser}" "${steampass}" +force_install_dir "${serverfiles}" +app_update "${appid}" -beta "${branch}" ${validate} +quit | uniq | tee -a "${lgsmlog}" "${steamcmdlog}" else ${unbuffer} ${steamcmdcommand} +login "${steamuser}" "${steampass}" +force_install_dir "${serverfiles}" +app_update "${appid}" ${validate} +quit | uniq | tee -a "${lgsmlog}" "${steamcmdlog}"