Skip to content

Commit

Permalink
refactor: remove unnecessary fn_sleep_time calls
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
dgibbs64 committed Oct 2, 2023
1 parent 6211092 commit 42d14f5
Show file tree
Hide file tree
Showing 21 changed files with 2 additions and 25 deletions.
1 change: 0 additions & 1 deletion lgsm/modules/alert_email.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand Down
2 changes: 0 additions & 2 deletions lgsm/modules/check_deps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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}"
Expand Down
2 changes: 1 addition & 1 deletion lgsm/modules/check_permissions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion lgsm/modules/core_dl.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion lgsm/modules/core_logs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
1 change: 1 addition & 0 deletions lgsm/modules/core_messages.sh
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,7 @@ fn_messages_separator() {
printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' =
else
echo -e "${bold}=================================${default}"
fn_sleep_time
fi
}

Expand Down
1 change: 0 additions & 1 deletion lgsm/modules/fix.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion lgsm/modules/fix_av.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
1 change: 0 additions & 1 deletion lgsm/modules/fix_kf2.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 0 additions & 2 deletions lgsm/modules/fix_lo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
1 change: 0 additions & 1 deletion lgsm/modules/fix_mta.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
1 change: 0 additions & 1 deletion lgsm/modules/fix_ut3.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion lgsm/modules/install_dst_token.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 0 additions & 1 deletion lgsm/modules/install_eula.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 ""
Expand Down
1 change: 0 additions & 1 deletion lgsm/modules/install_factorio_save.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
2 changes: 0 additions & 2 deletions lgsm/modules/install_header.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand All @@ -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
1 change: 0 additions & 1 deletion lgsm/modules/install_server_files.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 0 additions & 1 deletion lgsm/modules/install_squad_license.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
1 change: 0 additions & 1 deletion lgsm/modules/install_steamcmd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
3 changes: 0 additions & 3 deletions lgsm/modules/install_ts3db.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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"
Expand Down
1 change: 0 additions & 1 deletion lgsm/modules/install_ut2k4_key.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 42d14f5

Please sign in to comment.