Browse Source

Merge branch 'develop' into feature/vintagestory

pull/3156/head
Daniel Gibbs 5 years ago
committed by GitHub
parent
commit
f5a8f3c7ba
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      lgsm/config-default/config-lgsm/gmodserver/_default.cfg
  2. 13
      lgsm/functions/check_config.sh
  3. 9
      lgsm/functions/core_dl.sh

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

@ -18,7 +18,7 @@ maxplayers="16"
tickrate="66" tickrate="66"
gamemode="sandbox" 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 # To get an API key visit - https://steamcommunity.com/dev/apikey
wsapikey="" wsapikey=""
wscollectionid="" wscollectionid=""

13
lgsm/functions/check_config.sh

@ -6,8 +6,7 @@
functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
if [ ! -f "${servercfgfullpath}" ]; then if [ -n "${servercfgfullpath}" ]&&[ ! -f "${servercfgfullpath}" ]; then
if [ "${shortname}" != "hw" ]&&[ "${shortname}" != "ut3" ]&&[ "${shortname}" != "kf2" ]; then
fn_print_dots "" fn_print_dots ""
fn_print_warn_nl "Configuration file missing!" fn_print_warn_nl "Configuration file missing!"
echo -e "${servercfgfullpath}" echo -e "${servercfgfullpath}"
@ -15,17 +14,13 @@ if [ ! -f "${servercfgfullpath}" ]; then
fn_script_log_warn "${servercfgfullpath}" fn_script_log_warn "${servercfgfullpath}"
install_config.sh install_config.sh
fi fi
fi
if [ "${shortname}" == "rust" ]; then if [ "${shortname}" == "rust" ]&&[ -v rconpassword ]&&[ -z "${rconpassword}" ]; then
if [ -z "${rconpassword}" ]; then
fn_print_dots "" fn_print_dots ""
fn_print_fail_nl "RCON password is not set" fn_print_fail_nl "RCON password is not set"
fn_script_log_fatal "RCON password is not set" fn_script_log_warn "RCON password is not set"
core_exit.sh elif [ -v rconpassword ]&&[ "${rconpassword}" == "CHANGE_ME" ]; then
elif [ "${rconpassword}" == "CHANGE_ME" ]; then
fn_print_dots "" fn_print_dots ""
fn_print_warn_nl "Default RCON Password detected" fn_print_warn_nl "Default RCON Password detected"
fn_script_log_warn "Default RCON Password detected" fn_script_log_warn "Default RCON Password detected"
fi fi
fi

9
lgsm/functions/core_dl.sh

@ -61,7 +61,7 @@ fn_dl_steamcmd(){
# If using a specific branch. # If using a specific branch.
if [ -n "${branch}" ]&&[ -n "${betapassword}" ]; then 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}" ${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}" ${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 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}" ${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 elif [ "${shortname}" == "ac" ]||[ "${shortname}" == "jk2" ]; then
if [ -n "${branch}" ]&&[ -n "${betapassword}" ]; 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}" ${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}" ${unbuffer} ${steamcmdcommand} +@sSteamCmdForcePlatformType windows +login "${steamuser}" "${steampass}" +force_install_dir "${serverfiles}" +app_update "${appid}" -beta "${branch}" ${validate} +quit | uniq | tee -a "${lgsmlog}" "${steamcmdlog}"
else else
${unbuffer} ${steamcmdcommand} +@sSteamCmdForcePlatformType windows +login "${steamuser}" "${steampass}" +force_install_dir "${serverfiles}" +app_update "${appid}" ${validate} +quit | uniq | tee -a "${lgsmlog}" "${steamcmdlog}" ${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 else
if [ -n "${branch}" ]&&[ -n "${betapassword}" ]; then 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}" ${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}" ${unbuffer} ${steamcmdcommand} +login "${steamuser}" "${steampass}" +force_install_dir "${serverfiles}" +app_update "${appid}" -beta "${branch}" ${validate} +quit | uniq | tee -a "${lgsmlog}" "${steamcmdlog}"
else else
${unbuffer} ${steamcmdcommand} +login "${steamuser}" "${steampass}" +force_install_dir "${serverfiles}" +app_update "${appid}" ${validate} +quit | uniq | tee -a "${lgsmlog}" "${steamcmdlog}" ${unbuffer} ${steamcmdcommand} +login "${steamuser}" "${steampass}" +force_install_dir "${serverfiles}" +app_update "${appid}" ${validate} +quit | uniq | tee -a "${lgsmlog}" "${steamcmdlog}"
@ -87,8 +87,9 @@ fn_dl_steamcmd(){
fi fi
# Error checking for SteamCMD. Some errors will loop to try again and some will just exit. # 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=$? 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. # Not enough space.
if [ -n "$(grep "0x202" "${steamcmdlog}" | tail -1)" ]; then if [ -n "$(grep "0x202" "${steamcmdlog}" | tail -1)" ]; then
fn_print_failure_nl "${commandaction} ${selfname}: ${remotelocation}: Not enough space to download server files" fn_print_failure_nl "${commandaction} ${selfname}: ${remotelocation}: Not enough space to download server files"

Loading…
Cancel
Save