Browse Source
refactor: remove unnecessary print statements
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.
pull/4339/head
Daniel Gibbs
2 years ago
No known key found for this signature in database
GPG Key ID: 2076B128385E8C55
8 changed files with
15 additions and
8 deletions
lgsm/modules/check_config.sh
lgsm/modules/command_backup.sh
lgsm/modules/command_dev_debug.sh
lgsm/modules/command_monitor.sh
lgsm/modules/command_start.sh
lgsm/modules/command_stop.sh
lgsm/modules/command_update_linuxgsm.sh
lgsm/modules/command_validate.sh
@ -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!"
@ -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
@ -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
@ -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"
@ -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
@ -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.
@ -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.
@ -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"
@ -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