Browse Source
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.
pull/4326/head
Daniel Gibbs
2 years ago
No known key found for this signature in database
GPG Key ID: 2076B128385E8C55
21 changed files with
2 additions and
25 deletions
lgsm/modules/alert_email.sh
lgsm/modules/check_deps.sh
lgsm/modules/check_permissions.sh
lgsm/modules/core_dl.sh
lgsm/modules/core_logs.sh
lgsm/modules/core_messages.sh
lgsm/modules/fix.sh
lgsm/modules/fix_av.sh
lgsm/modules/fix_kf2.sh
lgsm/modules/fix_lo.sh
lgsm/modules/fix_mta.sh
lgsm/modules/fix_ut3.sh
lgsm/modules/install_dst_token.sh
lgsm/modules/install_eula.sh
lgsm/modules/install_factorio_save.sh
lgsm/modules/install_header.sh
lgsm/modules/install_server_files.sh
lgsm/modules/install_squad_license.sh
lgsm/modules/install_steamcmd.sh
lgsm/modules/install_ts3db.sh
lgsm/modules/install_ut2k4_key.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 } "
@ -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
@ -340,7 +339,6 @@ if [ "${commandname}" == "INSTALL" ]; then
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 " ${ bold } ${ lightyellow } Checking ${ gamename } Dependencies ${ default } "
@ -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
@ -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
@ -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.
@ -279,6 +279,7 @@ fn_messages_separator() {
printf '%*s\n' " ${ COLUMNS :- $( tput cols) } " '' | tr ' ' =
else
echo -e " ${ bold } ================================= ${ default } "
fn_sleep_time
fi
}
@ -81,7 +81,6 @@ if [ "${commandname}" == "INSTALL" ]; then
echo -e ""
echo -e " ${ lightyellow } Applying Post-Install Fixes ${ default } "
fn_messages_separator
fn_sleep_time
postinstall = 1
fn_apply_fix "post install" " ${ shortname } "
fi
@ -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
@ -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
@ -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
@ -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
@ -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
@ -10,7 +10,6 @@ moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
echo -e ""
echo -e " ${ bold } ${ lightyellow } Enter ${ gamename } Cluster Token ${ default } "
fn_messages_separator
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"
@ -18,7 +18,6 @@ fi
echo -e ""
echo -e " ${ bold } ${ lightyellow } Accept ${ gamename } EULA ${ default } "
fn_messages_separator
fn_sleep_time
echo -e "You are required to accept the EULA:"
echo -e " ${ eulaurl } "
echo -e ""
@ -10,6 +10,5 @@ moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
echo -e ""
echo -e " ${ bold } ${ lightyellow } Creating initial Factorio savefile ${ default } "
fn_messages_separator
fn_sleep_time
check_glibc.sh
" ${ executabledir } " /factorio --create " ${ serverfiles } /save1 "
@ -9,7 +9,6 @@ moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
clear
fn_print_ascii_logo
fn_sleep_time
fn_messages_separator
echo -e " ${ bold } ${ lightyellow } Linux ${ default } ${ bold } GSM_ ${ default } "
echo -e " ${ italic } by Daniel Gibbs ${ default } "
@ -19,4 +18,3 @@ 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 "
fn_messages_separator
fn_sleep_time
@ -208,7 +208,6 @@ fn_install_server_files() {
echo -e ""
echo -e " ${ bold } ${ lightyellow } Installing ${ gamename } Server ${ default } "
fn_messages_separator
fn_sleep_time
if [ " ${ appid } " ] ; then
remotelocation = "SteamCMD"
@ -10,7 +10,6 @@ moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
echo -e ""
echo -e " ${ bold } ${ lightyellow } ${ gamename } Server License ${ default } "
fn_messages_separator
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 "
@ -10,5 +10,4 @@ moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
echo -e ""
echo -e " ${ bold } ${ lightyellow } Installing SteamCMD ${ default } "
fn_messages_separator
fn_sleep_time
check_steamcmd.sh
@ -25,7 +25,6 @@ fn_install_ts3db_mariadb() {
echo -e ""
echo -e " ${ bold } ${ lightyellow } Configure ${ gamename } Server for MariaDB ${ default } "
fn_messages_separator
fn_sleep_time
read -rp "Enter MariaDB hostname: " mariahostname
read -rp "Enter MariaDB port: " mariaport
read -rp "Enter MariaDB username: " mariausername
@ -52,7 +51,6 @@ fn_install_ts3db_mariadb() {
echo -e ""
echo -e " ${ bold } ${ lightyellow } Select Database ${ default } "
fn_messages_separator
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
@ -66,7 +64,6 @@ install_eula.sh
echo -e ""
echo -e " ${ bold } ${ lightyellow } Getting Privilege Key ${ default } "
fn_messages_separator
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 "
@ -10,7 +10,6 @@ moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
echo -e ""
echo -e " ${ bold } ${ lightyellow } Enter ${ gamename } CD Key ${ default } "
fn_messages_separator
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"