Просмотр исходного кода

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.
Daniel Gibbs 2 лет назад
Родитель
Сommit
9912556383

+ 0 - 1
lgsm/modules/alert_email.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}"

+ 0 - 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_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}"

+ 1 - 1
lgsm/modules/check_permissions.sh

@@ -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

+ 1 - 1
lgsm/modules/command_dev_detect_deps.sh

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

+ 0 - 1
lgsm/modules/core_dl.sh

@@ -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

+ 0 - 1
lgsm/modules/core_logs.sh

@@ -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.

+ 1 - 6
lgsm/modules/core_messages.sh

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

+ 0 - 1
lgsm/modules/fix.sh

@@ -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

+ 0 - 1
lgsm/modules/fix_av.sh

@@ -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

+ 0 - 1
lgsm/modules/fix_kf2.sh

@@ -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

+ 0 - 2
lgsm/modules/fix_lo.sh

@@ -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

+ 0 - 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
 	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

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

+ 0 - 1
lgsm/modules/install_dst_token.sh

@@ -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"

+ 0 - 1
lgsm/modules/install_eula.sh

@@ -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 ""
 echo -e "${italic}${eulaurl}${default}"

+ 0 - 1
lgsm/modules/install_factorio_save.sh

@@ -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"

+ 0 - 2
lgsm/modules/install_header.sh

@@ -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

+ 0 - 1
lgsm/modules/install_server_dir.sh

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

+ 0 - 1
lgsm/modules/install_server_files.sh

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

+ 0 - 1
lgsm/modules/install_squad_license.sh

@@ -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"
 

+ 0 - 1
lgsm/modules/install_steamcmd.sh

@@ -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

+ 0 - 3
lgsm/modules/install_ts3db.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"

+ 0 - 1
lgsm/modules/install_ut2k4_key.sh

@@ -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"