Skip to content

Commit

Permalink
refactor: remove unnecessary print statements
Browse files Browse the repository at this point in the history
This commit refactors the code by removing unnecessary print statements in multiple files. The removed print statements were used for displaying dots and warnings, but they are not needed anymore. This improves the readability and cleanliness of the code.
  • Loading branch information
dgibbs64 committed Oct 10, 2023
1 parent 3d0409f commit 9b1b8c3
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 8 deletions.
3 changes: 0 additions & 3 deletions lgsm/modules/check_config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"

if [ -n "${servercfgfullpath}" ] && [ ! -f "${servercfgfullpath}" ]; then
fn_print_dots ""
fn_print_warn_nl "Configuration file missing!"
echo -e "${servercfgfullpath}"
fn_script_log_warn "Configuration file missing!"
Expand All @@ -17,11 +16,9 @@ if [ -n "${servercfgfullpath}" ] && [ ! -f "${servercfgfullpath}" ]; then
fi

if [ "${shortname}" == "rust" ] && [ -v rconpassword ] && [ -z "${rconpassword}" ]; then
fn_print_dots ""
fn_print_fail_nl "RCON password is not set"
fn_script_log_warn "RCON password is not set"
elif [ -v rconpassword ] && [ "${rconpassword}" == "CHANGE_ME" ]; then
fn_print_dots ""
fn_print_warn_nl "Default RCON Password detected"
fn_script_log_warn "Default RCON Password detected"
fi
Expand Down
5 changes: 4 additions & 1 deletion lgsm/modules/command_backup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,10 @@ fn_backup_start_server() {
fi
}

# Run functions.
fn_print_dots ""
check.sh
core_logs.sh

fn_backup_check_lockfile
fn_backup_init
fn_backup_stop_server
Expand Down
4 changes: 4 additions & 0 deletions lgsm/modules/command_dev_debug.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ commandaction="Developer debug"
moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
fn_firstcommand_reset

fn_print_dots ""
check.sh
core_logs.sh

if [ -f "${rootdir}/.dev-debug" ]; then
rm -f "${rootdir:?}/.dev-debug"
fn_print_ok_nl "Disabled dev-debug"
Expand Down
1 change: 1 addition & 0 deletions lgsm/modules/command_monitor.sh
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,7 @@ fn_monitor_loop() {
done
}

fn_print_dots ""
monitorflag=1
# Dont do any monitoring or checks if installer is running.
fn_monitor_check_install
Expand Down
1 change: 1 addition & 0 deletions lgsm/modules/command_start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,7 @@ if [ "${firstcommandname}" == "START" ] || [ "${firstcommandname}" == "RESTART"
date '+%s' > "${lockdir:?}/${selfname}-monitoring.lock"
fi

fn_print_dots ""
check.sh

# If the server already started dont start again.
Expand Down
1 change: 1 addition & 0 deletions lgsm/modules/command_stop.sh
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,7 @@ fn_stop_pre_check() {
fi
}

fn_print_dots ""
check.sh

# Create a stopping lockfile that only exists while the stop command is running.
Expand Down
2 changes: 1 addition & 1 deletion lgsm/modules/command_update_linuxgsm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ commandaction="Updating LinuxGSM"
moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
fn_firstcommand_set

fn_print_dots ""
check.sh
info_distro.sh

fn_print_dots ""
fn_script_log_info "Updating LinuxGSM"

fn_print_dots "Selecting repo"
Expand Down
6 changes: 3 additions & 3 deletions lgsm/modules/command_validate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ fn_validate() {
fn_dl_steamcmd
}

# The location where the builds are checked and downloaded.
remotelocation="SteamCMD"
fn_print_dots ""
check.sh
core_logs.sh

fn_print_dots "${remotelocation}"
fn_print_dots "SteamCMD"

if [ "${status}" != "0" ]; then
fn_print_restart_warning
Expand Down

0 comments on commit 9b1b8c3

Please sign in to comment.