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.
feature/dst-changes
Daniel Gibbs 2 years ago
parent
commit
9912556383
No known key found for this signature in database GPG Key ID: 2076B128385E8C55
  1. 1
      lgsm/modules/alert_email.sh
  2. 2
      lgsm/modules/check_deps.sh
  3. 2
      lgsm/modules/check_permissions.sh
  4. 2
      lgsm/modules/command_dev_detect_deps.sh
  5. 1
      lgsm/modules/core_dl.sh
  6. 1
      lgsm/modules/core_logs.sh
  7. 7
      lgsm/modules/core_messages.sh
  8. 1
      lgsm/modules/fix.sh
  9. 1
      lgsm/modules/fix_av.sh
  10. 1
      lgsm/modules/fix_kf2.sh
  11. 2
      lgsm/modules/fix_lo.sh
  12. 1
      lgsm/modules/fix_mta.sh
  13. 1
      lgsm/modules/fix_ut3.sh
  14. 1
      lgsm/modules/install_dst_token.sh
  15. 1
      lgsm/modules/install_eula.sh
  16. 1
      lgsm/modules/install_factorio_save.sh
  17. 2
      lgsm/modules/install_header.sh
  18. 1
      lgsm/modules/install_server_dir.sh
  19. 1
      lgsm/modules/install_server_files.sh
  20. 1
      lgsm/modules/install_squad_license.sh
  21. 1
      lgsm/modules/install_steamcmd.sh
  22. 3
      lgsm/modules/install_ts3db.sh
  23. 1
      lgsm/modules/install_ut2k4_key.sh

1
lgsm/modules/alert_email.sh

@ -8,7 +8,6 @@
moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
fn_print_dots "Sending Email alert: ${email}" fn_print_dots "Sending Email alert: ${email}"
fn_sleep_time
if [ -n "${emailfrom}" ]; then if [ -n "${emailfrom}" ]; then
mail -s "${alertsubject}" -r "${emailfrom}" "${email}" < "${alertlog}" mail -s "${alertsubject}" -r "${emailfrom}" "${email}" < "${alertlog}"

2
lgsm/modules/check_deps.sh

@ -138,7 +138,6 @@ fn_install_missing_deps() {
fn_print_warn "Missing dependencies: ${red}${array_deps_missing[*]}${default}" fn_print_warn "Missing dependencies: ${red}${array_deps_missing[*]}${default}"
fn_script_log_warn "Missing dependencies: ${array_deps_missing[*]}" fn_script_log_warn "Missing dependencies: ${array_deps_missing[*]}"
fi fi
fn_sleep_time
# Attempt automatic dependency installation # Attempt automatic dependency installation
if [ "${autoinstall}" == "1" ]; then if [ "${autoinstall}" == "1" ]; then
@ -340,7 +339,6 @@ if [ "${commandname}" == "INSTALL" ]; then
fn_messages_separator fn_messages_separator
fn_print_information_nl "Checking any missing dependencies for ${gamename} server only." fn_print_information_nl "Checking any missing dependencies for ${gamename} server only."
fn_print_information_nl "This will NOT install a ${gamename} server." fn_print_information_nl "This will NOT install a ${gamename} server."
fn_sleep_time
else else
echo -e "" echo -e ""
echo -e "${bold}${lightyellow}Checking ${gamename} Dependencies${default}" echo -e "${bold}${lightyellow}Checking ${gamename} Dependencies${default}"

2
lgsm/modules/check_permissions.sh

@ -198,7 +198,7 @@ fn_sys_perm_errors_fix() {
if [ "${sysdirpermerror}" == "1" ] || [ "${classdirpermerror}" == "1" ] || [ "${netdirpermerror}" == "1" ]; then if [ "${sysdirpermerror}" == "1" ] || [ "${classdirpermerror}" == "1" ] || [ "${netdirpermerror}" == "1" ]; then
fn_print_error "Could not fix /sys permissions" fn_print_error "Could not fix /sys permissions"
fn_script_log_error "Could not fix /sys permissions." fn_script_log_error "Could not fix /sys permissions."
fn_sleep_time
# Show the user how to fix. # Show the user how to fix.
fn_sys_perm_fix_manually_msg fn_sys_perm_fix_manually_msg
else else

2
lgsm/modules/command_dev_detect_deps.sh

@ -186,7 +186,7 @@ echo -e "${bold}Required Dependencies${default}"
fn_messages_separator fn_messages_separator
echo -e "${executable}" echo -e "${executable}"
echo -e "" echo -e ""
echo -e "CentOS" echo -e "${bold}CentOS"
fn_messages_separator fn_messages_separator
cat "${tmpdir}/.depdetect_centos_line" cat "${tmpdir}/.depdetect_centos_line"
echo -e "" echo -e ""

1
lgsm/modules/core_dl.sh

@ -277,7 +277,6 @@ fn_fetch_trap() {
echo -en "downloading ${local_filename}..." echo -en "downloading ${local_filename}..."
fn_print_canceled_eol_nl fn_print_canceled_eol_nl
fn_script_log_info "Downloading ${local_filename}...CANCELED" fn_script_log_info "Downloading ${local_filename}...CANCELED"
fn_sleep_time
rm -f "${local_filedir:?}/${local_filename}" rm -f "${local_filedir:?}/${local_filename}"
echo -en "downloading ${local_filename}..." echo -en "downloading ${local_filename}..."
fn_print_removed_eol_nl fn_print_removed_eol_nl

1
lgsm/modules/core_logs.sh

@ -46,7 +46,6 @@ if [ "$(find "${lgsmlogdir}"/ -type f -mtime +"${logdays}" | wc -l)" -ne "0" ];
ulxcount="0" ulxcount="0"
darkrpcount="0" darkrpcount="0"
legacycount="0" legacycount="0"
fn_sleep_time
fn_print_info "Removing logs older than ${logdays} days" fn_print_info "Removing logs older than ${logdays} days"
fn_script_log_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. # Logging logfiles to be removed according to "${logdays}", counting and removing them.

7
lgsm/modules/core_messages.sh

@ -41,12 +41,7 @@ fn_ansi_loader() {
} }
fn_sleep_time() { fn_sleep_time() {
if [ "${sleeptime}" != "0" ] || [ "${travistest}" != "1" ]; then sleep "0.1"
if [ -z "${sleeptime}" ]; then
sleeptime=0.5
fi
sleep "${sleeptime}"
fi
} }
# Log display # Log display

1
lgsm/modules/fix.sh

@ -81,7 +81,6 @@ if [ "${commandname}" == "INSTALL" ]; then
echo -e "" echo -e ""
echo -e "${lightyellow}Applying Post-Install Fixes${default}" echo -e "${lightyellow}Applying Post-Install Fixes${default}"
fn_messages_separator fn_messages_separator
fn_sleep_time
postinstall=1 postinstall=1
fn_apply_fix "post install" "${shortname}" fn_apply_fix "post install" "${shortname}"
fi fi

1
lgsm/modules/fix_av.sh

@ -13,7 +13,6 @@ export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${serverfiles}:${serverfiles}/linux64"
if [ ! -f "${servercfgfullpath}" ]; then if [ ! -f "${servercfgfullpath}" ]; then
startparameters="--datapath ${avdatapath} --galaxy-name ${selfname} --init-folders-only" startparameters="--datapath ${avdatapath} --galaxy-name ${selfname} --init-folders-only"
fn_print_information "starting ${gamename} server to generate configs." fn_print_information "starting ${gamename} server to generate configs."
fn_sleep_time
cd "${systemdir}" || exit cd "${systemdir}" || exit
eval "${executable} ${startparameters}" eval "${executable} ${startparameters}"
fi fi

1
lgsm/modules/fix_kf2.sh

@ -10,7 +10,6 @@ moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
startparameters="\"${defaultmap}?Game=KFGameContent.KFGameInfo_VersusSurvival\"" startparameters="\"${defaultmap}?Game=KFGameContent.KFGameInfo_VersusSurvival\""
fn_print_information "starting ${gamename} server to generate configs." fn_print_information "starting ${gamename} server to generate configs."
fn_sleep_time
exitbypass=1 exitbypass=1
command_start.sh command_start.sh
fn_firstcommand_reset fn_firstcommand_reset

2
lgsm/modules/fix_lo.sh

@ -9,9 +9,7 @@ moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
appidfile=${executabledir}/steam_appid.txt appidfile=${executabledir}/steam_appid.txt
if [ ! -f "${appidfile}" ]; then if [ ! -f "${appidfile}" ]; then
fn_print_information "adding ${appidfile} to ${gamename} server." fn_print_information "adding ${appidfile} to ${gamename} server."
fn_sleep_time
echo "903950" > "${appidfile}" echo "903950" > "${appidfile}"
else else
fn_print_information "${appidfile} already exists. No action to be taken." fn_print_information "${appidfile} already exists. No action to be taken."
fn_sleep_time
fi fi

1
lgsm/modules/fix_mta.sh

@ -10,7 +10,6 @@ moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
if [ ! -f "${lgsmdir}/lib/libmysqlclient.so.16" ]; then if [ ! -f "${lgsmdir}/lib/libmysqlclient.so.16" ]; then
fixname="libmysqlclient16" fixname="libmysqlclient16"
fn_fix_msg_start_nl 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_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 fn_fix_msg_end
fi fi

1
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}" 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_print_information "starting ${gamename} server to generate configs."
fn_sleep_time
exitbypass=1 exitbypass=1
command_start.sh command_start.sh
fn_firstcommand_reset fn_firstcommand_reset

1
lgsm/modules/install_dst_token.sh

@ -10,7 +10,6 @@ moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
echo -e "" echo -e ""
echo -e "${bold}${lightyellow}Enter ${gamename} Cluster Token${default}" echo -e "${bold}${lightyellow}Enter ${gamename} Cluster Token${default}"
fn_messages_separator fn_messages_separator
fn_sleep_time
echo -e "A cluster token is required to run this server!" 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 "Follow the instructions in this link to obtain this key:"
echo -e "https://linuxgsm.com/dst-auth-token" echo -e "https://linuxgsm.com/dst-auth-token"

1
lgsm/modules/install_eula.sh

@ -18,7 +18,6 @@ fi
echo -e "" echo -e ""
echo -e "${bold}${lightyellow}Accept ${gamename} EULA${default}" echo -e "${bold}${lightyellow}Accept ${gamename} EULA${default}"
fn_messages_separator fn_messages_separator
fn_sleep_time
echo -e "You are required to accept the EULA:" echo -e "You are required to accept the EULA:"
echo -e "" echo -e ""
echo -e "${italic}${eulaurl}${default}" echo -e "${italic}${eulaurl}${default}"

1
lgsm/modules/install_factorio_save.sh

@ -10,6 +10,5 @@ moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
echo -e "" echo -e ""
echo -e "${bold}${lightyellow}Creating initial Factorio savefile${default}" echo -e "${bold}${lightyellow}Creating initial Factorio savefile${default}"
fn_messages_separator fn_messages_separator
fn_sleep_time
check_glibc.sh check_glibc.sh
"${executabledir}"/factorio --create "${serverfiles}/save1" "${executabledir}"/factorio --create "${serverfiles}/save1"

2
lgsm/modules/install_header.sh

@ -9,7 +9,6 @@ moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
clear clear
fn_print_ascii_logo fn_print_ascii_logo
fn_sleep_time
fn_messages_separator fn_messages_separator
echo -e "${bold}${lightyellow}Linux${default}${bold}GSM_${default}" echo -e "${bold}${lightyellow}Linux${default}${bold}GSM_${default}"
echo -e "${italic}by Daniel Gibbs${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}Contributors:${default} https://linuxgsm.com/contrib"
echo -e "${lightblue}Sponsor:${default} https://linuxgsm.com/sponsor" echo -e "${lightblue}Sponsor:${default} https://linuxgsm.com/sponsor"
fn_messages_separator fn_messages_separator
fn_sleep_time

1
lgsm/modules/install_server_dir.sh

@ -10,7 +10,6 @@ moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
echo -e "" echo -e ""
echo -e "${bold}${lightyellow}Server Directory${default}" echo -e "${bold}${lightyellow}Server Directory${default}"
fn_messages_separator fn_messages_separator
fn_sleep_time
echo -en "creating serverfiles directory [ ${italic}${serverfiles}${default} ]" echo -en "creating serverfiles directory [ ${italic}${serverfiles}${default} ]"
if [ -d "${serverfiles}" ]; then if [ -d "${serverfiles}" ]; then

1
lgsm/modules/install_server_files.sh

@ -212,7 +212,6 @@ fi
echo -e "" echo -e ""
echo -e "${bold}${lightyellow}Installing ${gamename} Server${default}" echo -e "${bold}${lightyellow}Installing ${gamename} Server${default}"
fn_messages_separator fn_messages_separator
fn_sleep_time
if [ "${appid}" ]; then if [ "${appid}" ]; then
remotelocation="SteamCMD" remotelocation="SteamCMD"

1
lgsm/modules/install_squad_license.sh

@ -10,7 +10,6 @@ moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
echo -e "" echo -e ""
echo -e "${bold}${lightyellow}${gamename} Server License${default}" echo -e "${bold}${lightyellow}${gamename} Server License${default}"
fn_messages_separator fn_messages_separator
fn_sleep_time
echo -e "Server license is an optional feature for ${gamename} server" echo -e "Server license is an optional feature for ${gamename} server"
fn_script_log_info "Server license is an optional feature for ${gamename} server" fn_script_log_info "Server license is an optional feature for ${gamename} server"

1
lgsm/modules/install_steamcmd.sh

@ -10,5 +10,4 @@ moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
echo -e "" echo -e ""
echo -e "${bold}${lightyellow}Installing SteamCMD${default}" echo -e "${bold}${lightyellow}Installing SteamCMD${default}"
fn_messages_separator fn_messages_separator
fn_sleep_time
check_steamcmd.sh check_steamcmd.sh

3
lgsm/modules/install_ts3db.sh

@ -25,7 +25,6 @@ fn_install_ts3db_mariadb() {
echo -e "" echo -e ""
echo -e "${bold}${lightyellow}Configure ${gamename} Server for MariaDB${default}" echo -e "${bold}${lightyellow}Configure ${gamename} Server for MariaDB${default}"
fn_messages_separator fn_messages_separator
fn_sleep_time
read -rp "Enter MariaDB hostname: " mariahostname read -rp "Enter MariaDB hostname: " mariahostname
read -rp "Enter MariaDB port: " mariaport read -rp "Enter MariaDB port: " mariaport
read -rp "Enter MariaDB username: " mariausername read -rp "Enter MariaDB username: " mariausername
@ -52,7 +51,6 @@ fn_install_ts3db_mariadb() {
echo -e "" echo -e ""
echo -e "${bold}${lightyellow}Select Database${default}" echo -e "${bold}${lightyellow}Select Database${default}"
fn_messages_separator fn_messages_separator
fn_sleep_time
if [ -z "${autoinstall}" ]; then if [ -z "${autoinstall}" ]; then
if fn_prompt_yn "Do you want to use MariaDB instead of sqlite? (MariaDB must be pre-configured)" N; 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 fn_install_ts3db_mariadb
@ -66,7 +64,6 @@ install_eula.sh
echo -e "" echo -e ""
echo -e "${bold}${lightyellow}Getting Privilege Key${default}" echo -e "${bold}${lightyellow}Getting Privilege Key${default}"
fn_messages_separator fn_messages_separator
fn_sleep_time
fn_print_information_nl "Save these details for later." fn_print_information_nl "Save these details for later."
fn_print_information_nl "Key also saved in:" fn_print_information_nl "Key also saved in:"
echo -e "${serverfiles}/privilege_key.txt" echo -e "${serverfiles}/privilege_key.txt"

1
lgsm/modules/install_ut2k4_key.sh

@ -10,7 +10,6 @@ moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
echo -e "" echo -e ""
echo -e "${bold}${lightyellow}Enter ${gamename} CD Key${default}" echo -e "${bold}${lightyellow}Enter ${gamename} CD Key${default}"
fn_messages_separator fn_messages_separator
fn_sleep_time
echo -e "To get your server listed on the Master Server list" 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 "you must get a free CD key. Get a key here:"
echo -e "https://www.epicgames.com/unrealtournament/forums/cdkey.php?2004" echo -e "https://www.epicgames.com/unrealtournament/forums/cdkey.php?2004"

Loading…
Cancel
Save