diff --git a/functions/fn_check_steamuser b/functions/fn_check_steamuser index 29a3d72c4..d9043db17 100644 --- a/functions/fn_check_steamuser +++ b/functions/fn_check_steamuser @@ -1,11 +1,17 @@ #!/bin/bash -# LGSM fn_install_serverfiles function +# LGSM fn_check_steamuser function # Author: Daniel Gibbs # Website: http://gameservermanagers.com -# Version: 160515 +# Version: 190515 -if [ -z "${steamuser}" ]; then - fn_printwarningnl "SteamCMD user variable is not assigned in the main script! Resorting to anonymous login" - steamuser="anonymous" - steampass="" +if [ -z "${steamuser}" ]||[ "${steamuser}" == "username" ];; then + fn_printwarningnl "Steam Login not set. Using anonymous login." + fn_scriptlog "Steam Login not set. Using anonymous login." + if [ "${steamuser}" == "username" ]; then + echo " * Change steamuser=\"username\" to a valid steam login." + fn_scriptlog "Change steamuser=\"username\" to a valid steam login." + fi + steamuser="anonymous" + steampass="" + sleep 2 fi diff --git a/functions/fn_functions b/functions/fn_functions index f43b0a867..fa1fb76a3 100644 --- a/functions/fn_functions +++ b/functions/fn_functions @@ -2,7 +2,7 @@ # LGSM fn_functions function # Author: Daniel Gibbs # Website: http://gameservermanagers.com -# Version: 110415 +# Version: 160515 # Description: Defines all functions to allow download and execution of functions using fn_runfunction. # This function is called first before any other function. Without this file other functions would not load. @@ -32,6 +32,11 @@ functionfile="${FUNCNAME}" fn_runfunction } +fn_check_steamuser(){ +functionfile="${FUNCNAME}" +fn_runfunction +} + fn_check_systemdir(){ functionfile="${FUNCNAME}" fn_runfunction diff --git a/functions/fn_install_serverfiles b/functions/fn_install_serverfiles index 2d28c438b..a13042b88 100644 --- a/functions/fn_install_serverfiles +++ b/functions/fn_install_serverfiles @@ -2,15 +2,10 @@ # LGSM fn_install_serverfiles function # Author: Daniel Gibbs # Website: http://gameservermanagers.com -# Version: 050515 +# Version: 190515 fn_steaminstallcommand(){ -if [ -z "${steamuser}" ]; then - fn_printwarningnl "SteamCMD user variable is not assigned in the main script! Resorting to anonymous login" - steamuser="anonymous" - steampass="" -fi - +fn_check_steamuser counter="0" while [ "${counter}" == "0" ]||[ "$(grep -wc 0x402 .fn_install_serverfiles.tmp)" -ge "1" ]||[ "$(grep -wc 0x406 .fn_install_serverfiles.tmp)" -ge "1" ]||[ "$(grep -wc 0x6 .fn_install_serverfiles.tmp)" -ge "1" ]||[ "$(grep -wc 0x106 .fn_install_serverfiles.tmp)" -ge "1" ]; do counter=$((counter+1)) diff --git a/functions/fn_update_check b/functions/fn_update_check index 1a05e760b..0ff141e45 100644 --- a/functions/fn_update_check +++ b/functions/fn_update_check @@ -2,7 +2,7 @@ # LGSM fn_update_check function # Author: Daniel Gibbs # Website: http://gameservermanagers.com -# Version: 160515 +# Version: 190515 # Description: Checks if a server update is available. @@ -101,6 +101,8 @@ echo "" } fn_steamcmdcheck(){ +fn_check_steamcmd +fn_check_steamuser fn_appmanifestcheck # Checks for server update from SteamCMD fn_printdots "Checking for update: SteamCMD" diff --git a/functions/fn_update_dl b/functions/fn_update_dl index d9d996035..de27a0e92 100644 --- a/functions/fn_update_dl +++ b/functions/fn_update_dl @@ -14,7 +14,6 @@ fn_check_systemdir fn_details_config fn_printdots "Updating ${servername}" sleep 1 -fn_check_steamcmd fn_printoknl "Updating ${servername}" fn_scriptlog "Updating ${servername}" sleep 1 diff --git a/functions/fn_validate b/functions/fn_validate index 1c928f650..75864bdd4 100644 --- a/functions/fn_validate +++ b/functions/fn_validate @@ -2,7 +2,7 @@ # LGSM fn_validate function # Author: Daniel Gibbs # Website: http://gameservermanagers.com -# Version: 050515 +# Version: 190515 # Description: Runs a server validation. @@ -22,9 +22,11 @@ fn_scriptlog "Checking server files" sleep 1 cd "${rootdir}" cd "steamcmd" +fn_check_steamcmd +fn_check_steamuser if [ $(command -v unbuffer) ]; then - unbuffer=unbuffer + unbuffer=unbuffer fi ${unbuffer} ./steamcmd.sh +login "${steamuser}" "${steampass}" +force_install_dir "${filesdir}" +app_update "${appid}" validate +quit|tee -a "${scriptlog}"