Browse Source

change sleep to fn_sleep_time

pull/4339/head
Daniel Gibbs 2 years ago
parent
commit
6d607a81a5
No known key found for this signature in database GPG Key ID: 2076B128385E8C55
  1. 2
      .github/workflows/serverlist-validate.sh
  2. 2
      lgsm/functions/check_status.sh
  3. 2
      lgsm/functions/command_stop.sh
  4. 16
      lgsm/modules/check_deps.sh
  5. 2
      lgsm/modules/command_monitor.sh
  6. 14
      lgsm/modules/command_stop.sh
  7. 2
      lgsm/modules/command_validate.sh
  8. 4
      lgsm/modules/command_wipe.sh
  9. 2
      lgsm/modules/core_messages.sh
  10. 4
      lgsm/modules/fix_kf.sh
  11. 2
      lgsm/modules/fix_kf2.sh
  12. 4
      lgsm/modules/fix_ro.sh
  13. 4
      lgsm/modules/fix_ut2k4.sh
  14. 2
      lgsm/modules/fix_ut3.sh
  15. 4
      lgsm/modules/install_eula.sh
  16. 2
      lgsm/modules/install_ts3db.sh
  17. 2
      lgsm/modules/update_fctr.sh
  18. 2
      lgsm/modules/update_jk2.sh
  19. 2
      lgsm/modules/update_mc.sh
  20. 2
      lgsm/modules/update_mcb.sh
  21. 2
      lgsm/modules/update_mta.sh
  22. 2
      lgsm/modules/update_pmc.sh
  23. 2
      lgsm/modules/update_ts3.sh
  24. 2
      lgsm/modules/update_ut99.sh
  25. 2
      lgsm/modules/update_vints.sh

2
.github/workflows/serverlist-validate.sh

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

2
lgsm/functions/check_status.sh

@ -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
lgsm/functions/command_stop.sh

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

16
lgsm/modules/check_deps.sh

@ -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
@ -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[*]}"
@ -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

2
lgsm/modules/command_monitor.sh

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

14
lgsm/modules/command_stop.sh

@ -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
@ -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
@ -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}: "
@ -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.
@ -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.
@ -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
@ -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}"

2
lgsm/modules/command_validate.sh

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

4
lgsm/modules/command_wipe.sh

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

2
lgsm/modules/core_messages.sh

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

4
lgsm/modules/fix_kf.sh

@ -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
lgsm/modules/fix_kf2.sh

@ -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
lgsm/modules/fix_ro.sh

@ -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
lgsm/modules/fix_ut2k4.sh

@ -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
lgsm/modules/fix_ut3.sh

@ -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
lgsm/modules/install_eula.sh

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

2
lgsm/modules/install_ts3db.sh

@ -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
lgsm/modules/update_fctr.sh

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

2
lgsm/modules/update_jk2.sh

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

2
lgsm/modules/update_mc.sh

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

2
lgsm/modules/update_mcb.sh

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

2
lgsm/modules/update_mta.sh

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

2
lgsm/modules/update_pmc.sh

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

2
lgsm/modules/update_ts3.sh

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

2
lgsm/modules/update_ut99.sh

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

2
lgsm/modules/update_vints.sh

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

Loading…
Cancel
Save