Skip to content

Commit

Permalink
change sleep to fn_sleep_time
Browse files Browse the repository at this point in the history
  • Loading branch information
dgibbs64 committed Oct 10, 2023
1 parent 7d46ea5 commit 6d607a8
Show file tree
Hide file tree
Showing 25 changed files with 43 additions and 43 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/serverlist-validate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ csvlist="$(ls -1 | grep -E '^(ubuntu|debian|centos|rhel|almalinux|rocky).*\.csv$
# loop though each csv file and make sure the number of lines is the same as the serverlistcount
for csv in $csvlist; do
csvcount="$(wc -l < "${csv}")"
csvcount=$((csvcount-2))
csvcount=$((csvcount - 2))
if [ "$csvcount" -ne "$serverlistcount" ]; then
echo "ERROR: $csv ($csvcount) does not match serverlist.csv ($serverlistcount)"
exitcode=1
Expand Down
2 changes: 1 addition & 1 deletion lgsm/functions/check_status.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@

functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"

status=$(tmux -L "${sessionname}" list-sessions -F "#{session_name}" 2>/dev/null | grep -Ecx "^${sessionname}")
status=$(tmux -L "${sessionname}" list-sessions -F "#{session_name}" 2> /dev/null | grep -Ecx "^${sessionname}")
2 changes: 1 addition & 1 deletion lgsm/functions/command_stop.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ fn_stop_graceful_ctrlc() {
fn_print_dots "Graceful: CTRL+c"
fn_script_log_info "Graceful: CTRL+c"
# Sends quit.
tmux -L "${sessionname}" send-keys -t "${sessionname}" C-c > /dev/null 2>&1
tmux -L "${sessionname}" send-keys -t "${sessionname}" C-c > /dev/null 2>&1
# Waits up to 30 seconds giving the server time to shutdown gracefuly.
for seconds in {1..30}; do
check_status.sh
Expand Down
16 changes: 8 additions & 8 deletions lgsm/modules/check_deps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ fn_install_mono_repo() {
fn_print_information_nl "Automatically adding Mono repository."
fn_script_log_info "Automatically adding Mono repository."
echo -en ".\r"
sleep 1
fn_sleep_time_1
echo -en "..\r"
sleep 1
fn_sleep_time_1
echo -en "...\r"
sleep 1
fn_sleep_time_1
echo -en " \r"
if [ "${distroid}" == "ubuntu" ]; then
if [ "${distroversion}" == "22.04" ]; then
Expand Down Expand Up @@ -177,11 +177,11 @@ fn_install_missing_deps() {
fn_print_information_nl "Automatically installing missing dependencies."
fn_script_log_info "Automatically installing missing dependencies."
echo -en ".\r"
sleep 1
fn_sleep_time_1
echo -en "..\r"
sleep 1
fn_sleep_time_1
echo -en "...\r"
sleep 1
fn_sleep_time_1
echo -en " \r"
if [ "$(command -v apt 2> /dev/null)" ]; then
cmd="echo steamcmd steam/question select \"I AGREE\" | sudo debconf-set-selections; echo steamcmd steam/license note '' | sudo debconf-set-selections; ${i386installcommand}sudo apt-get update; sudo apt-get -y install ${array_deps_missing[*]}"
Expand Down Expand Up @@ -306,14 +306,14 @@ fn_deps_detector() {
missingdep=0
if [ "${commandname}" == "INSTALL" ]; then
echo -e "${green}${deptocheck}${default}"
sleep 0.1
fn_sleep_time
fi
elif [ "${depstatus}" != "0" ]; then
# If dependency is not found.
missingdep=1
if [ "${commandname}" == "INSTALL" ]; then
echo -e "${red}${deptocheck}${default}"
sleep 0.1
fn_sleep_time
fi
# If SteamCMD requirements are not met install will fail.
if [ -n "${appid}" ]; then
Expand Down
2 changes: 1 addition & 1 deletion lgsm/modules/command_monitor.sh
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ fn_monitor_query() {
# Second counter will wait for 15s before breaking loop.
for seconds in {1..15}; do
fn_print_fail "Querying port: ${querymethod}: ${ip}:${queryport} : ${totalseconds}/${queryattempt} : ${cyan}WAIT${default}"
sleep 0.5
fn_sleep_time_1
totalseconds=$((totalseconds + 1))
if [ "${seconds}" == "15" ]; then
break
Expand Down
14 changes: 7 additions & 7 deletions lgsm/modules/command_stop.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ fn_stop_graceful_ctrlc() {
fn_script_log_pass "Graceful: CTRL+c: OK: ${seconds} seconds"
break
fi
sleep 1
fn_sleep_time_1
fn_print_dots "Graceful: CTRL+c: ${seconds}"
done
check_status.sh
Expand Down Expand Up @@ -53,7 +53,7 @@ fn_stop_graceful_cmd() {
fn_script_log_pass "Graceful: sending \"${1}\": OK: ${seconds} seconds"
break
fi
sleep 1
fn_sleep_time_1
fn_print_dots "Graceful: sending \"${1}\": ${seconds}"
done
check_status.sh
Expand All @@ -74,7 +74,7 @@ fn_stop_graceful_goldsrc() {
tmux -L "${socketname}" send -t "${sessionname}" quit ENTER > /dev/null 2>&1
# Waits 3 seconds as goldsrc servers restart with the quit command.
for seconds in {1..3}; do
sleep 1
fn_sleep_time_1
fn_print_dots "Graceful: sending \"quit\": ${seconds}"
done
fn_print_ok "Graceful: sending \"quit\": ${seconds}: "
Expand Down Expand Up @@ -154,7 +154,7 @@ fn_stop_graceful_sdtd() {
fn_script_log_pass "Graceful: telnet: ${telnetip}:${telnetport} : ${seconds} seconds"
break
fi
sleep 1
fn_sleep_time_1
fn_print_dots "Graceful: telnet: ${seconds}"
done
# If telnet shutdown fails tmux shutdown will be used, this risks loss of world save.
Expand Down Expand Up @@ -185,7 +185,7 @@ fn_stop_graceful_avorion() {
fn_script_log_info "Graceful: /save /stop"
# Sends /save.
tmux -L "${socketname}" send-keys -t "${sessionname}" /save ENTER > /dev/null 2>&1
sleep 5
fn_sleep_time_5
# Sends /quit.
tmux -L "${socketname}" send-keys -t "${sessionname}" /stop ENTER > /dev/null 2>&1
# Waits up to 30 seconds giving the server time to shutdown gracefuly.
Expand All @@ -197,7 +197,7 @@ fn_stop_graceful_avorion() {
fn_script_log_pass "Graceful: /save /stop: OK: ${seconds} seconds"
break
fi
sleep 1
fn_sleep_time_1
fn_print_dots "Graceful: /save /stop: ${seconds}"
done
check_status.sh
Expand Down Expand Up @@ -241,7 +241,7 @@ fn_stop_tmux() {
fn_script_log_info "tmux kill-session: ${sessionname}: ${servername}"
# Kill tmux session.
tmux -L "${socketname}" kill-session -t "${sessionname}" > /dev/null 2>&1
sleep 0.5
fn_sleep_time_1
check_status.sh
if [ "${status}" == "0" ]; then
fn_print_ok_nl "${servername}"
Expand Down
2 changes: 1 addition & 1 deletion lgsm/modules/command_validate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ fn_validate() {
for seconds in {3..1}; do
fn_print_warn "Validate might overwrite some customised files: ${totalseconds}"
totalseconds=$((totalseconds - 1))
sleep 1
fn_sleep_time_1
if [ "${seconds}" == "0" ]; then
break
fi
Expand Down
4 changes: 2 additions & 2 deletions lgsm/modules/command_wipe.sh
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ fn_map_wipe_warning() {
for seconds in {3..1}; do
fn_print_warn "Map wipe will reset the map data and keep blueprint data: ${totalseconds}"
totalseconds=$((totalseconds - 1))
sleep 1
fn_sleep_time_1
if [ "${seconds}" == "0" ]; then
break
fi
Expand All @@ -96,7 +96,7 @@ fn_full_wipe_warning() {
for seconds in {3..1}; do
fn_print_warn "Server wipe will reset the map data and remove blueprint data: ${totalseconds}"
totalseconds=$((totalseconds - 1))
sleep 1
fn_sleep_time_1
if [ "${seconds}" == "0" ]; then
break
fi
Expand Down
2 changes: 1 addition & 1 deletion lgsm/modules/core_messages.sh
Original file line number Diff line number Diff line change
Expand Up @@ -589,7 +589,7 @@ fn_print_restart_warning() {
for seconds in {3..1}; do
fn_print_warn "${selfname} will be restarted: ${totalseconds}"
totalseconds=$((totalseconds - 1))
sleep 1
fn_sleep_time_1
if [ "${seconds}" == "0" ]; then
break
fi
Expand Down
4 changes: 2 additions & 2 deletions lgsm/modules/fix_kf.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@ fn_sleep_time
exitbypass=1
command_start.sh
fn_firstcommand_reset
sleep 5
fn_sleep_time_5
exitbypass=1
command_stop.sh
fn_firstcommand_reset
exitbypass=1
command_start.sh
fn_firstcommand_reset
sleep 5
fn_sleep_time_5
exitbypass=1
command_stop.sh
fn_firstcommand_reset
2 changes: 1 addition & 1 deletion lgsm/modules/fix_kf2.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ fn_print_information "starting ${gamename} server to generate configs."
exitbypass=1
command_start.sh
fn_firstcommand_reset
sleep 10
fn_sleep_time_10
exitbypass=1
command_stop.sh
fn_firstcommand_reset
4 changes: 2 additions & 2 deletions lgsm/modules/fix_ro.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@ fn_sleep_time
exitbypass=1
command_start.sh
fn_firstcommand_reset
sleep 5
fn_sleep_time_5
exitbypass=1
command_stop.sh
fn_firstcommand_reset
exitbypass=1
command_start.sh
fn_firstcommand_reset
sleep 5
fn_sleep_time_5
exitbypass=1
command_stop.sh
fn_firstcommand_reset
4 changes: 2 additions & 2 deletions lgsm/modules/fix_ut2k4.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@ fn_sleep_time
exitbypass=1
command_start.sh
fn_firstcommand_reset
sleep 5
fn_sleep_time_5
exitbypass=1
command_stop.sh
fn_firstcommand_reset
exitbypass=1
command_start.sh
fn_firstcommand_reset
sleep 5
fn_sleep_time_5
exitbypass=1
command_stop.sh
fn_firstcommand_reset
2 changes: 1 addition & 1 deletion lgsm/modules/fix_ut3.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ fn_print_information "starting ${gamename} server to generate configs."
exitbypass=1
command_start.sh
fn_firstcommand_reset
sleep 10
fn_sleep_time_10
exitbypass=1
command_stop.sh
fn_firstcommand_reset
4 changes: 2 additions & 2 deletions lgsm/modules/install_eula.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ if [ -z "${autoinstall}" ]; then
fi
elif [ "${commandname}" == "START" ]; then
fn_print_info "By continuing you are indicating your agreement to the EULA."
sleep 5
fn_sleep_time_5
else
echo -e "By using auto-install you are indicating your agreement to the EULA."
sleep 5
fn_sleep_time_5
fi

if [ "${shortname}" == "ts3" ]; then
Expand Down
2 changes: 1 addition & 1 deletion lgsm/modules/install_ts3db.sh
Original file line number Diff line number Diff line change
Expand Up @@ -69,5 +69,5 @@ fn_print_information_nl "Key also saved in:"
echo -e "${serverfiles}/privilege_key.txt"
cd "${executabledir}" || exit
./ts3server_startscript.sh start inifile=ts3-server.ini 2>&1 | tee "${serverfiles}/privilege_key.txt"
sleep 5
fn_sleep_time_5
./ts3server_startscript.sh stop
2 changes: 1 addition & 1 deletion lgsm/modules/update_fctr.sh
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ fn_update_compare() {
command_start.sh
fn_firstcommand_reset
exitbypass=1
sleep 5
fn_sleep_time_5
command_stop.sh
fn_firstcommand_reset
fi
Expand Down
2 changes: 1 addition & 1 deletion lgsm/modules/update_jk2.sh
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ fn_update_compare() {
command_start.sh
fn_firstcommand_reset
exitbypass=1
sleep 5
fn_sleep_time_5
command_stop.sh
fn_firstcommand_reset
fi
Expand Down
2 changes: 1 addition & 1 deletion lgsm/modules/update_mc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ fn_update_compare() {
command_start.sh
fn_firstcommand_reset
exitbypass=1
sleep 5
fn_sleep_time_5
command_stop.sh
fn_firstcommand_reset
fi
Expand Down
2 changes: 1 addition & 1 deletion lgsm/modules/update_mcb.sh
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ fn_update_compare() {
command_start.sh
fn_firstcommand_reset
exitbypass=1
sleep 5
fn_sleep_time_5
command_stop.sh
fn_firstcommand_reset
fi
Expand Down
2 changes: 1 addition & 1 deletion lgsm/modules/update_mta.sh
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ fn_update_compare() {
command_start.sh
fn_firstcommand_reset
exitbypass=1
sleep 5
fn_sleep_time_5
command_stop.sh
fn_firstcommand_reset
fi
Expand Down
2 changes: 1 addition & 1 deletion lgsm/modules/update_pmc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ fn_update_compare() {
command_start.sh
fn_firstcommand_reset
exitbypass=1
sleep 5
fn_sleep_time_5
command_stop.sh
fn_firstcommand_reset
fi
Expand Down
2 changes: 1 addition & 1 deletion lgsm/modules/update_ts3.sh
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ fn_update_compare() {
command_start.sh
fn_firstcommand_reset
exitbypass=1
sleep 5
fn_sleep_time_5
command_stop.sh
fn_firstcommand_reset
fi
Expand Down
2 changes: 1 addition & 1 deletion lgsm/modules/update_ut99.sh
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ fn_update_compare() {
command_start.sh
fn_firstcommand_reset
exitbypass=1
sleep 5
fn_sleep_time_5
command_stop.sh
fn_firstcommand_reset
fi
Expand Down
2 changes: 1 addition & 1 deletion lgsm/modules/update_vints.sh
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ fn_update_compare() {
command_start.sh
fn_firstcommand_reset
exitbypass=1
sleep 5
fn_sleep_time_5
command_stop.sh
fn_firstcommand_reset
fi
Expand Down

0 comments on commit 6d607a8

Please sign in to comment.