Browse Source

feat: change sleep timers (#4339)

* refactor: simplify sleep time functions

The `fn_sleep_time` function has been refactored to remove unnecessary conditions and set a default sleep time of 0.5 seconds. Additionally, four new functions (`fn_sleep_time_1`, `fn_sleep_time_5`, `fn_sleep_time_10`) have been added to provide different sleep times of 1, 5, and 10 seconds respectively. This improves code readability and allows for more flexibility in setting sleep times.

* change sleep to fn_sleep_time

* refactor: optimize sleep time functions

- Refactored the code to optimize the sleep time functions.
- Updated the `fn_sleep_time` function calls to `fn_sleep_time_1` in multiple files.
- Removed unnecessary sleep time calls in some files.

* refactor: simplify sleep time function call

The code changes refactor the sleep time function call in the check_deps.sh file. Instead of calling fn_sleep_time_1, it now calls fn_sleep_time. This change simplifies the code and improves readability.

* feat: add sleep time before checking session

Add a sleep time of 1 second before checking the session in the command_monitor.sh file. This allows for better synchronization and improves the accuracy of the session check.

* changes

* refactor: optimize sleep time function

The code changes refactor the sleep time function in multiple files to improve efficiency. The fn_sleep_time function is replaced with fn_sleep_time_1. This change reduces unnecessary delays during execution.

* refactor: update sleep time function names

The sleep time functions in the core_messages.sh file have been updated to use more descriptive names. The fn_sleep_time function has been renamed to fn_sleep_time_1 for clarity and consistency. This change improves code readability and maintainability.

* refactor: optimize sleep time in core_messages.sh

The commit optimizes the sleep time in the core_messages.sh file. The fn_sleep_time and fn_print_dots functions now use a shorter sleep time of 0.5 seconds instead of 1 second, resulting in faster execution.

* refactor: improve readability and consistency in code

- Refactored the log messages to use consistent capitalization and wording.
- Updated log messages in check_glibc.sh, check_permissions.sh, command_backup.sh, command_update_linuxgsm.sh, command_wipe.sh, fix_samp.sh, install_config.sh, and set_dst_config_vars() functions.

feat: add more descriptive log messages

- Added more descriptive log messages to provide clearer information about the actions being performed.
- Updated log messages in check_glibc.sh, check_permissions.sh, command_backup.sh, command_update_linuxgsm.sh, command_wipe.sh, fix_samp.sh, install_config.sh.

fix: correct spelling errors in log messages

- Corrected spelling errors in some of the log messages for better clarity.
- Updated log messages in check_glibc.sh and fix_samp.sh.

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

* refactor: improve commit messages for code changes

- Refactored check_glibc.sh to improve readability and clarity of error messages.
- Refactored check_permissions.sh to provide more informative error messages when checking /sys permissions.
- Refactored check_system_requirements.sh to provide clearer warning message when checking RAM requirements.
- Refactored command_backup.sh to provide more descriptive messages when starting a backup.

* remove legacy code

* fix: remove \t

* fix: run check_root

check root was never running because of logic in linuxgsm.sh

* fix: update warning message for missing sudo access

The warning message for users without sudo access has been updated to provide clearer instructions. Instead of just suggesting manual installation, it now also suggests running the script as root using `./${selfname} install`. This change improves user experience and helps them resolve dependency installation issues more effectively.

* tidy
pull/4186/merge
Daniel Gibbs 2 years ago
committed by GitHub
parent
commit
68ae13c069
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      .github/workflows/serverlist-validate.sh
  2. 2
      lgsm/functions/check_status.sh
  3. 3
      lgsm/modules/check_config.sh
  4. 20
      lgsm/modules/check_deps.sh
  5. 18
      lgsm/modules/check_glibc.sh
  6. 13
      lgsm/modules/check_permissions.sh
  7. 2
      lgsm/modules/check_root.sh
  8. 6
      lgsm/modules/check_system_requirements.sh
  9. 2
      lgsm/modules/check_version.sh
  10. 50
      lgsm/modules/command_backup.sh
  11. 4
      lgsm/modules/command_dev_debug.sh
  12. 2
      lgsm/modules/command_dev_details.sh
  13. 11
      lgsm/modules/command_fastdl.sh
  14. 6
      lgsm/modules/command_mods_remove.sh
  15. 2
      lgsm/modules/command_mods_update.sh
  16. 3
      lgsm/modules/command_monitor.sh
  17. 3
      lgsm/modules/command_start.sh
  18. 15
      lgsm/modules/command_stop.sh
  19. 4
      lgsm/modules/command_update_linuxgsm.sh
  20. 8
      lgsm/modules/command_validate.sh
  21. 14
      lgsm/modules/command_wipe.sh
  22. 49
      lgsm/modules/core_messages.sh
  23. 8
      lgsm/modules/fix_kf.sh
  24. 2
      lgsm/modules/fix_kf2.sh
  25. 10
      lgsm/modules/fix_ro.sh
  26. 4
      lgsm/modules/fix_samp.sh
  27. 4
      lgsm/modules/fix_ut2k4.sh
  28. 2
      lgsm/modules/fix_ut3.sh
  29. 4
      lgsm/modules/info_messages.sh
  30. 22
      lgsm/modules/install_config.sh
  31. 4
      lgsm/modules/install_eula.sh
  32. 4
      lgsm/modules/install_gslt.sh
  33. 2
      lgsm/modules/install_logs.sh
  34. 1
      lgsm/modules/install_server_dir.sh
  35. 2
      lgsm/modules/install_squad_license.sh
  36. 1
      lgsm/modules/install_stats.sh
  37. 4
      lgsm/modules/install_ts3db.sh
  38. 2
      lgsm/modules/update_fctr.sh
  39. 2
      lgsm/modules/update_jk2.sh
  40. 2
      lgsm/modules/update_mc.sh
  41. 2
      lgsm/modules/update_mcb.sh
  42. 2
      lgsm/modules/update_mta.sh
  43. 2
      lgsm/modules/update_pmc.sh
  44. 2
      lgsm/modules/update_ts3.sh
  45. 2
      lgsm/modules/update_ut99.sh
  46. 2
      lgsm/modules/update_vints.sh
  47. 19
      linuxgsm.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 # loop though each csv file and make sure the number of lines is the same as the serverlistcount
for csv in $csvlist; do for csv in $csvlist; do
csvcount="$(wc -l < "${csv}")" csvcount="$(wc -l < "${csv}")"
csvcount=$((csvcount-2)) csvcount=$((csvcount - 2))
if [ "$csvcount" -ne "$serverlistcount" ]; then if [ "$csvcount" -ne "$serverlistcount" ]; then
echo "ERROR: $csv ($csvcount) does not match serverlist.csv ($serverlistcount)" echo "ERROR: $csv ($csvcount) does not match serverlist.csv ($serverlistcount)"
exitcode=1 exitcode=1

2
lgsm/functions/check_status.sh

@ -7,4 +7,4 @@
functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" 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}")

3
lgsm/modules/check_config.sh

@ -8,7 +8,6 @@
moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
if [ -n "${servercfgfullpath}" ] && [ ! -f "${servercfgfullpath}" ]; then if [ -n "${servercfgfullpath}" ] && [ ! -f "${servercfgfullpath}" ]; then
fn_print_dots ""
fn_print_warn_nl "Configuration file missing!" fn_print_warn_nl "Configuration file missing!"
echo -e "${servercfgfullpath}" echo -e "${servercfgfullpath}"
fn_script_log_warn "Configuration file missing!" fn_script_log_warn "Configuration file missing!"
@ -17,11 +16,9 @@ if [ -n "${servercfgfullpath}" ] && [ ! -f "${servercfgfullpath}" ]; then
fi fi
if [ "${shortname}" == "rust" ] && [ -v rconpassword ] && [ -z "${rconpassword}" ]; then if [ "${shortname}" == "rust" ] && [ -v rconpassword ] && [ -z "${rconpassword}" ]; then
fn_print_dots ""
fn_print_fail_nl "RCON password is not set" fn_print_fail_nl "RCON password is not set"
fn_script_log_warn "RCON password is not set" fn_script_log_warn "RCON password is not set"
elif [ -v rconpassword ] && [ "${rconpassword}" == "CHANGE_ME" ]; then elif [ -v rconpassword ] && [ "${rconpassword}" == "CHANGE_ME" ]; then
fn_print_dots ""
fn_print_warn_nl "Default RCON Password detected" fn_print_warn_nl "Default RCON Password detected"
fn_script_log_warn "Default RCON Password detected" fn_script_log_warn "Default RCON Password detected"
fi fi

20
lgsm/modules/check_deps.sh

@ -25,11 +25,11 @@ fn_install_mono_repo() {
fn_print_information_nl "Automatically adding Mono repository." fn_print_information_nl "Automatically adding Mono repository."
fn_script_log_info "Automatically adding Mono repository." fn_script_log_info "Automatically adding Mono repository."
echo -en ".\r" echo -en ".\r"
sleep 1 fn_sleep_time_1
echo -en "..\r" echo -en "..\r"
sleep 1 fn_sleep_time_1
echo -en "...\r" echo -en "...\r"
sleep 1 fn_sleep_time_1
echo -en " \r" echo -en " \r"
if [ "${distroid}" == "ubuntu" ]; then if [ "${distroid}" == "ubuntu" ]; then
if [ "${distroversion}" == "22.04" ]; then if [ "${distroversion}" == "22.04" ]; then
@ -160,8 +160,8 @@ fn_install_missing_deps() {
fn_print_information_nl "$(whoami) has sudo access." fn_print_information_nl "$(whoami) has sudo access."
fn_script_log_info "$(whoami) has sudo access." fn_script_log_info "$(whoami) has sudo access."
else else
fn_print_warning_nl "$(whoami) does not have sudo access. Manually install dependencies." fn_print_warning_nl "$(whoami) does not have sudo access. Manually install dependencies or run ./${selfname} install as root."
fn_script_log_warn "$(whoami) does not have sudo access. Manually install dependencies." fn_script_log_warn "$(whoami) does not have sudo access. Manually install dependencies or run ./${selfname} install as root."
fi fi
fi fi
@ -177,11 +177,11 @@ fn_install_missing_deps() {
fn_print_information_nl "Automatically installing missing dependencies." fn_print_information_nl "Automatically installing missing dependencies."
fn_script_log_info "Automatically installing missing dependencies." fn_script_log_info "Automatically installing missing dependencies."
echo -en ".\r" echo -en ".\r"
sleep 1 fn_sleep_time_1
echo -en "..\r" echo -en "..\r"
sleep 1 fn_sleep_time_1
echo -en "...\r" echo -en "...\r"
sleep 1 fn_sleep_time_1
echo -en " \r" echo -en " \r"
if [ "$(command -v apt 2> /dev/null)" ]; then 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[*]}" 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 missingdep=0
if [ "${commandname}" == "INSTALL" ]; then if [ "${commandname}" == "INSTALL" ]; then
echo -e "${green}${deptocheck}${default}" echo -e "${green}${deptocheck}${default}"
sleep 0.1 fn_sleep_time
fi fi
elif [ "${depstatus}" != "0" ]; then elif [ "${depstatus}" != "0" ]; then
# If dependency is not found. # If dependency is not found.
missingdep=1 missingdep=1
if [ "${commandname}" == "INSTALL" ]; then if [ "${commandname}" == "INSTALL" ]; then
echo -e "${red}${deptocheck}${default}" echo -e "${red}${deptocheck}${default}"
sleep 0.1 fn_sleep_time
fi fi
# If SteamCMD requirements are not met install will fail. # If SteamCMD requirements are not met install will fail.
if [ -n "${appid}" ]; then if [ -n "${appid}" ]; then

18
lgsm/modules/check_glibc.sh

@ -13,17 +13,19 @@ if [ "${glibc}" == "null" ]; then
# Glibc is not required. # Glibc is not required.
: :
elif [ -z "${glibc}" ]; then elif [ -z "${glibc}" ]; then
fn_print_dots "glibc" fn_print_dots "Checking glibc"
fn_print_error_nl "glibc requirement unknown" fn_print_error_nl "Checking glibc: requirement unknown"
fn_script_log_error "glibc requirement unknown" fn_script_log_error "Checking glibc: requirement unknown"
fn_sleep_time_5
elif [ "$(printf '%s\n'${glibc}'\n' "${glibcversion}" | sort -V | head -n 1)" != "${glibc}" ]; then elif [ "$(printf '%s\n'${glibc}'\n' "${glibcversion}" | sort -V | head -n 1)" != "${glibc}" ]; then
fn_print_dots "glibc" fn_print_dots "Checking glibc"
fn_print_error_nl "glibc requirements not met" fn_print_error_nl "Checking glibc: requirements not met"
fn_script_log_error "glibc requirements not met" fn_script_log_error "Checking glibc: requirements not met"
echo -en "\n" echo -en "\n"
echo -e " * glibc required: ${glibc}" echo -e " * glibc required: ${glibc}"
echo -e " * glibc installed: ${red}${glibcversion}${default}" echo -e " * glibc installed: ${red}${glibcversion}${default}"
echo -en "\n" echo -en "\n"
fn_print_information_nl "distro upgrade is required" fn_print_information_nl "Distro upgrade is required"
fn_script_log_info "distro upgrade is required" fn_script_log_info "Distro upgrade is required"
fn_sleep_time_5
fi fi

13
lgsm/modules/check_permissions.sh

@ -171,7 +171,7 @@ fn_sys_perm_fix_manually_msg() {
fn_script_log_info "To fix this issue, run the following command as root:" fn_script_log_info "To fix this issue, run the following command as root:"
echo -e " chmod a+rx /sys /sys/class /sys/class/net" echo -e " chmod a+rx /sys /sys/class /sys/class/net"
fn_script_log "chmod a+rx /sys /sys/class /sys/class/net" fn_script_log "chmod a+rx /sys /sys/class /sys/class/net"
fn_sleep_time fn_sleep_time_5
if [ "${monitorflag}" == 1 ]; then if [ "${monitorflag}" == 1 ]; then
alert="permissions" alert="permissions"
alert.sh alert.sh
@ -182,8 +182,8 @@ fn_sys_perm_fix_manually_msg() {
# Attempt to fix /sys related permission errors if sudo is available, exits otherwise. # Attempt to fix /sys related permission errors if sudo is available, exits otherwise.
fn_sys_perm_errors_fix() { fn_sys_perm_errors_fix() {
if sudo -n true > /dev/null 2>&1; then if sudo -n true > /dev/null 2>&1; then
fn_print_dots "Automatically fixing /sys permissions" fn_print_dots "Fixing /sys permissions"
fn_script_log_info "Automatically fixing /sys permissions." fn_script_log_info "Fixing /sys permissions."
if [ "${sysdirpermerror}" == "1" ]; then if [ "${sysdirpermerror}" == "1" ]; then
sudo chmod a+rx "/sys" sudo chmod a+rx "/sys"
fi fi
@ -202,7 +202,7 @@ fn_sys_perm_errors_fix() {
# Show the user how to fix. # Show the user how to fix.
fn_sys_perm_fix_manually_msg fn_sys_perm_fix_manually_msg
else else
fn_print_ok_nl "Automatically fixing /sys permissions" fn_print_ok_nl "Fixing /sys permissions"
fn_script_log_pass "Permissions in /sys fixed" fn_script_log_pass "Permissions in /sys fixed"
fi fi
else else
@ -216,8 +216,9 @@ fn_sys_perm_error_process() {
fn_sys_perm_errors_detect fn_sys_perm_errors_detect
# If any error was found. # If any error was found.
if [ "${sysdirpermerror}" == "1" ] || [ "${classdirpermerror}" == "1" ] || [ "${netdirpermerror}" == "1" ]; then if [ "${sysdirpermerror}" == "1" ] || [ "${classdirpermerror}" == "1" ] || [ "${netdirpermerror}" == "1" ]; then
fn_print_error_nl "Permission error(s) found in /sys" fn_print_dots "Checking /sys permissions"
fn_script_log_error "Permission error(s) found in /sys" fn_print_error_nl "Checking /sys permissions"
fn_script_log_error "Checking /sys permissions"
# Run the fix # Run the fix
fn_sys_perm_errors_fix fn_sys_perm_errors_fix
fi fi

2
lgsm/modules/check_root.sh

@ -9,7 +9,7 @@ moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
if [ "$(whoami)" == "root" ]; then if [ "$(whoami)" == "root" ]; then
if [ "${commandname}" != "INSTALL" ]; then if [ "${commandname}" != "INSTALL" ]; then
fn_print_fail_nl "Do NOT run this script as root!" fn_print_fail_nl "Do NOT run as root!"
if [ -d "${lgsmlogdir}" ]; then if [ -d "${lgsmlogdir}" ]; then
fn_script_log_fail "${selfname} attempted to run as root." fn_script_log_fail "${selfname} attempted to run as root."
else else

6
lgsm/modules/check_system_requirements.sh

@ -46,10 +46,10 @@ fi
# If the game or engine has a minimum RAM Requirement, compare it to system's available RAM. # If the game or engine has a minimum RAM Requirement, compare it to system's available RAM.
if [ "${ramrequirementmb}" ]; then if [ "${ramrequirementmb}" ]; then
if [ "${physmemtotalmb}" -lt "${ramrequirementmb}" ]; then if [ "${physmemtotalmb}" -lt "${ramrequirementmb}" ]; then
fn_print_dots "Check RAM" fn_print_dots "Checking RAM"
# Warn the user. # Warn the user.
fn_print_warn_nl "Check RAM: ${ramrequirementgb}G required, ${physmemtotal} available" fn_print_warn_nl "Checking RAM: ${ramrequirementgb}G required, ${physmemtotal} available"
echo "* ${gamename} server may fail to run or experience poor performance." echo "* ${gamename} server may fail to run or experience poor performance."
fn_sleep_time fn_sleep_time_5
fi fi
fi fi

2
lgsm/modules/check_version.sh

@ -16,8 +16,8 @@ if [ -n "${modulesversion}" ] && [ -n "${version}" ] && [ "${version}" != "${mod
echo -e "* ${selfname}: ${version}" echo -e "* ${selfname}: ${version}"
echo -e "* modules: ${modulesversion}" echo -e "* modules: ${modulesversion}"
echo -e "" echo -e ""
fn_sleep_time
fn_script_log_error "LinuxGSM Version mismatch: ${selfname}: ${version}: modules: ${modulesversion}" fn_script_log_error "LinuxGSM Version mismatch: ${selfname}: ${version}: modules: ${modulesversion}"
fn_sleep_time_1
command_update_linuxgsm.sh command_update_linuxgsm.sh
fn_firstcommand_reset fn_firstcommand_reset
fi fi

50
lgsm/modules/command_backup.sh

@ -10,8 +10,6 @@ commandaction="Backing up"
moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
fn_firstcommand_set fn_firstcommand_set
check.sh
# Trap to remove lockfile on quit. # Trap to remove lockfile on quit.
fn_backup_trap() { fn_backup_trap() {
echo -e "" echo -e ""
@ -56,12 +54,14 @@ fn_backup_init() {
backupname="${selfname}-$(date '+%Y-%m-%d-%H%M%S')" backupname="${selfname}-$(date '+%Y-%m-%d-%H%M%S')"
info_distro.sh info_distro.sh
fn_print_dots "Backup starting" fn_print_dots "Starting backup"
fn_script_log_info "Backup starting" fn_script_log_info "Starting backup"
fn_print_ok_nl "Backup starting"
if [ ! -d "${backupdir}" ] || [ "${backupcount}" == "0" ]; then if [ ! -d "${backupdir}" ] || [ "${backupcount}" == "0" ]; then
fn_print_info_nl "There are no previous backups" fn_print_info_nl "Starting backup: No previous backups found"
fn_script_log_info "No previous backups found"
else else
fn_print_info_nl "Starting backup: Previous backups found"
fn_script_log_info "Previous backups found"
if [ "${lastbackupdaysago}" == "0" ]; then if [ "${lastbackupdaysago}" == "0" ]; then
daysago="less than 1 day ago" daysago="less than 1 day ago"
elif [ "${lastbackupdaysago}" == "1" ]; then elif [ "${lastbackupdaysago}" == "1" ]; then
@ -101,32 +101,6 @@ fn_backup_dir() {
fi fi
} }
# Migrate Backups from old dir before refactor
fn_backup_migrate_olddir() {
# Check if old backup dir is there before the refactor and move the backups
if [ -d "${rootdir}/backups" ]; then
if [ "${rootdir}/backups" != "${backupdir}" ]; then
fn_print_dots "Backup directory is being migrated"
fn_script_log_info "Backup directory is being migrated"
fn_script_log_info "${rootdir}/backups > ${backupdir}"
mv "${rootdir}/backups/"* "${backupdir}" 2> /dev/null
exitcode=$?
if [ "${exitcode}" == 0 ]; then
rmdir "${rootdir}/backups" 2> /dev/null
exitcode=$?
fi
if [ "${exitcode}" != 0 ]; then
fn_print_error_nl "Backup directory is being migrated"
fn_script_log_error "Backup directory is being migrated"
else
fn_print_ok_nl "Backup directory is being migrated"
fn_script_log_pass "Backup directory is being migrated"
fi
fi
fi
}
fn_backup_create_lockfile() { fn_backup_create_lockfile() {
# Create lockfile. # Create lockfile.
date '+%s' > "${lockdir:?}/backup.lock" date '+%s' > "${lockdir:?}/backup.lock"
@ -142,7 +116,7 @@ fn_backup_compression() {
fn_print_info "A total of ${rootdirduexbackup} will be compressed." fn_print_info "A total of ${rootdirduexbackup} will be compressed."
fn_script_log_info "A total of ${rootdirduexbackup} will be compressed: ${backupdir}/${backupname}.tar.gz" fn_script_log_info "A total of ${rootdirduexbackup} will be compressed: ${backupdir}/${backupname}.tar.gz"
fn_print_dots "Backup (${rootdirduexbackup}) ${backupname}.tar.gz, in progress..." fn_print_dots "Backup (${rootdirduexbackup}) ${backupname}.tar.gz, in progress..."
fn_script_log_info "backup ${rootdirduexbackup} ${backupname}.tar.gz, in progress" fn_script_log_info "Backup ${rootdirduexbackup} ${backupname}.tar.gz, in progress"
excludedir=$(fn_backup_relpath) excludedir=$(fn_backup_relpath)
# Check that excludedir is a valid path. # Check that excludedir is a valid path.
@ -187,7 +161,7 @@ fn_backup_prune() {
# Display how many backups will be cleared. # Display how many backups will be cleared.
echo -e "* Pruning: ${backupquotadiff} backup(s) has exceeded the ${maxbackups} backups limit" echo -e "* Pruning: ${backupquotadiff} backup(s) has exceeded the ${maxbackups} backups limit"
fn_script_log_info "Pruning: ${backupquotadiff} backup(s) has exceeded the ${maxbackups} backups limit" fn_script_log_info "Pruning: ${backupquotadiff} backup(s) has exceeded the ${maxbackups} backups limit"
fn_sleep_time fn_sleep_time_1
fn_print_dots "Pruning: Clearing ${backupquotadiff} backup(s)" fn_print_dots "Pruning: Clearing ${backupquotadiff} backup(s)"
fn_script_log_info "Pruning: Clearing ${backupquotadiff} backup(s)" fn_script_log_info "Pruning: Clearing ${backupquotadiff} backup(s)"
# Clear backups over quota. # Clear backups over quota.
@ -199,7 +173,7 @@ fn_backup_prune() {
# Display how many backups will be cleared. # Display how many backups will be cleared.
echo -e "* Pruning: ${backupsoudatedcount} backup(s) are older than ${maxbackupdays} days." echo -e "* Pruning: ${backupsoudatedcount} backup(s) are older than ${maxbackupdays} days."
fn_script_log_info "Pruning: ${backupsoudatedcount} backup(s) older than ${maxbackupdays} days." fn_script_log_info "Pruning: ${backupsoudatedcount} backup(s) older than ${maxbackupdays} days."
fn_sleep_time fn_sleep_time_1
fn_print_dots "Pruning: Clearing ${backupquotadiff} backup(s)." fn_print_dots "Pruning: Clearing ${backupquotadiff} backup(s)."
fn_script_log_info "Pruning: Clearing ${backupquotadiff} backup(s)" fn_script_log_info "Pruning: Clearing ${backupquotadiff} backup(s)"
# Clear backups over quota # Clear backups over quota
@ -264,12 +238,14 @@ fn_backup_start_server() {
fi fi
} }
# Run functions. fn_print_dots ""
check.sh
core_logs.sh
fn_backup_check_lockfile fn_backup_check_lockfile
fn_backup_init fn_backup_init
fn_backup_stop_server fn_backup_stop_server
fn_backup_dir fn_backup_dir
fn_backup_migrate_olddir
fn_backup_create_lockfile fn_backup_create_lockfile
fn_backup_compression fn_backup_compression
fn_backup_prune fn_backup_prune

4
lgsm/modules/command_dev_debug.sh

@ -10,6 +10,10 @@ commandaction="Developer debug"
moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
fn_firstcommand_reset fn_firstcommand_reset
fn_print_dots ""
check.sh
core_logs.sh
if [ -f "${rootdir}/.dev-debug" ]; then if [ -f "${rootdir}/.dev-debug" ]; then
rm -f "${rootdir:?}/.dev-debug" rm -f "${rootdir:?}/.dev-debug"
fn_print_ok_nl "Disabled dev-debug" fn_print_ok_nl "Disabled dev-debug"

2
lgsm/modules/command_dev_details.sh

@ -19,8 +19,8 @@ carriagereturn=$(file -b "${servercfgfullpath}" | grep -q CRLF && echo "${red}CR
echo -e "" echo -e ""
echo -e "${bold}${lightgreen}Server Details${default}" echo -e "${bold}${lightgreen}Server Details${default}"
fn_messages_separator fn_messages_separator
echo -e ""
echo -e ""
echo -e "Game: ${gamename}" echo -e "Game: ${gamename}"
echo -e "Config type: ${configtype}" echo -e "Config type: ${configtype}"
echo -e "Config file: ${servercfgfullpath}" echo -e "Config file: ${servercfgfullpath}"

11
lgsm/modules/command_fastdl.sh

@ -10,8 +10,6 @@ commandaction="Fastdl"
moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
fn_firstcommand_set fn_firstcommand_set
check.sh
# Directories. # Directories.
if [ -z "${webdir}" ]; then if [ -z "${webdir}" ]; then
webdir="${rootdir}/public_html" webdir="${rootdir}/public_html"
@ -209,7 +207,7 @@ fn_fastdl_preview() {
fi fi
if [ -f "${tmpdir}/fastdl_files_to_compress.txt" ]; then if [ -f "${tmpdir}/fastdl_files_to_compress.txt" ]; then
echo -e "calculating total file size..." echo -e "calculating total file size..."
fn_sleep_time fn_sleep_time_1
totalfiles=$(wc -l < "${tmpdir}/fastdl_files_to_compress.txt") totalfiles=$(wc -l < "${tmpdir}/fastdl_files_to_compress.txt")
# Calculates total file size. # Calculates total file size.
while read -r dufile; do while read -r dufile; do
@ -276,7 +274,7 @@ fn_fastdl_gmod() {
fi fi
# Clear addons directory in fastdl. # Clear addons directory in fastdl.
echo -en "clearing addons dir from fastdl dir..." echo -en "clearing addons dir from fastdl dir..."
fn_sleep_time fn_sleep_time_1
rm -rf "${fastdldir:?}/addons" rm -rf "${fastdldir:?}/addons"
exitcode=$? exitcode=$?
if [ "${exitcode}" != 0 ]; then if [ "${exitcode}" != 0 ]; then
@ -291,7 +289,7 @@ fn_fastdl_gmod() {
# Correct content that may be into a lua directory by mistake like some darkrpmodification addons. # Correct content that may be into a lua directory by mistake like some darkrpmodification addons.
if [ -d "${fastdldir}/lua" ]; then if [ -d "${fastdldir}/lua" ]; then
echo -en "correcting DarkRP files..." echo -en "correcting DarkRP files..."
fn_sleep_time fn_sleep_time_1
cp -Rf "${fastdldir}/lua/"* "${fastdldir}" cp -Rf "${fastdldir}/lua/"* "${fastdldir}"
exitcode=$? exitcode=$?
if [ "${exitcode}" != 0 ]; then if [ "${exitcode}" != 0 ]; then
@ -335,7 +333,7 @@ fn_fastdl_source() {
tput rc tput rc
tput el tput el
echo -e "copying ${directory} ${allowed_extention} : ${fileswc}..." echo -e "copying ${directory} ${allowed_extention} : ${fileswc}..."
fn_sleep_time fn_sleep_time_1
# get relative path of file in the dir # get relative path of file in the dir
tmprelfilepath="${fastdlfile#"${systemdir}/"}" tmprelfilepath="${fastdlfile#"${systemdir}/"}"
copytodir="${tmprelfilepath%/*}" copytodir="${tmprelfilepath%/*}"
@ -427,6 +425,7 @@ fn_fastdl_bzip2() {
fn_print_ok_eol_nl fn_print_ok_eol_nl
} }
check.sh
# Run functions. # Run functions.
fn_fastdl_preview fn_fastdl_preview
fn_clear_old_fastdl fn_clear_old_fastdl

6
lgsm/modules/command_mods_remove.sh

@ -59,7 +59,7 @@ fn_script_log_info "Removing ${modsfilelistsize} files from ${modprettyname}"
echo -e "removing ${modprettyname}" echo -e "removing ${modprettyname}"
echo -e "* ${modsfilelistsize} files to be removed" echo -e "* ${modsfilelistsize} files to be removed"
echo -e "* location: ${modinstalldir}" echo -e "* location: ${modinstalldir}"
fn_sleep_time fn_sleep_time_1
# Go through every file and remove it. # Go through every file and remove it.
modfileline="1" modfileline="1"
tput sc tput sc
@ -99,7 +99,7 @@ fi
# Remove file list. # Remove file list.
echo -en "removing ${modcommand}-files.txt..." echo -en "removing ${modcommand}-files.txt..."
fn_sleep_time fn_sleep_time_1
rm -rf "${modsdir:?}/${modcommand}-files.txt" rm -rf "${modsdir:?}/${modcommand}-files.txt"
exitcode=$? exitcode=$?
if [ "${exitcode}" != 0 ]; then if [ "${exitcode}" != 0 ]; then
@ -113,7 +113,7 @@ fi
# Remove mods from installed mods list. # Remove mods from installed mods list.
echo -en "removing ${modcommand} from ${modsinstalledlist}..." echo -en "removing ${modcommand} from ${modsinstalledlist}..."
fn_sleep_time fn_sleep_time_1
sed -i "/^${modcommand}$/d" "${modsinstalledlistfullpath}" sed -i "/^${modcommand}$/d" "${modsinstalledlistfullpath}"
exitcode=$? exitcode=$?

2
lgsm/modules/command_mods_update.sh

@ -18,7 +18,7 @@ mods_core.sh
fn_remove_cfg_files() { fn_remove_cfg_files() {
if [ "${modkeepfiles}" != "OVERWRITE" ] && [ "${modkeepfiles}" != "NOUPDATE" ]; then if [ "${modkeepfiles}" != "OVERWRITE" ] && [ "${modkeepfiles}" != "NOUPDATE" ]; then
echo -e "the following files/directories will be preserved:" echo -e "the following files/directories will be preserved:"
fn_sleep_time fn_sleep_time_1
# Count how many files there are to remove. # Count how many files there are to remove.
filestopreserve=$(echo -e "${modkeepfiles}" | awk -F ';' '{ print NF }') filestopreserve=$(echo -e "${modkeepfiles}" | awk -F ';' '{ print NF }')
# Test all subvalues of "modkeepfiles" using the ";" separator. # Test all subvalues of "modkeepfiles" using the ";" separator.

3
lgsm/modules/command_monitor.sh

@ -330,7 +330,7 @@ fn_monitor_query() {
# Second counter will wait for 15s before breaking loop. # Second counter will wait for 15s before breaking loop.
for seconds in {1..15}; do for seconds in {1..15}; do
fn_print_fail "Querying port: ${querymethod}: ${ip}:${queryport} : ${totalseconds}/${queryattempt} : ${cyan}WAIT${default}" fn_print_fail "Querying port: ${querymethod}: ${ip}:${queryport} : ${totalseconds}/${queryattempt} : ${cyan}WAIT${default}"
sleep 0.5 fn_sleep_time_1
totalseconds=$((totalseconds + 1)) totalseconds=$((totalseconds + 1))
if [ "${seconds}" == "15" ]; then if [ "${seconds}" == "15" ]; then
break break
@ -371,6 +371,7 @@ fn_monitor_loop() {
done done
} }
fn_print_dots ""
monitorflag=1 monitorflag=1
# Dont do any monitoring or checks if installer is running. # Dont do any monitoring or checks if installer is running.
fn_monitor_check_install fn_monitor_check_install

3
lgsm/modules/command_start.sh

@ -114,7 +114,7 @@ fn_start_tmux() {
echo -e "Console logging disabled in settings" >> "${consolelog}" echo -e "Console logging disabled in settings" >> "${consolelog}"
fn_script_log_info "Console logging disabled by user" fn_script_log_info "Console logging disabled by user"
fi fi
fn_sleep_time fn_sleep_time_1
# If the server fails to start. # If the server fails to start.
check_status.sh check_status.sh
@ -186,6 +186,7 @@ if [ "${firstcommandname}" == "START" ] || [ "${firstcommandname}" == "RESTART"
date '+%s' > "${lockdir:?}/${selfname}-monitoring.lock" date '+%s' > "${lockdir:?}/${selfname}-monitoring.lock"
fi fi
fn_print_dots ""
check.sh check.sh
# If the server already started dont start again. # If the server already started dont start again.

15
lgsm/modules/command_stop.sh

@ -25,7 +25,7 @@ fn_stop_graceful_ctrlc() {
fn_script_log_pass "Graceful: CTRL+c: OK: ${seconds} seconds" fn_script_log_pass "Graceful: CTRL+c: OK: ${seconds} seconds"
break break
fi fi
sleep 1 fn_sleep_time_1
fn_print_dots "Graceful: CTRL+c: ${seconds}" fn_print_dots "Graceful: CTRL+c: ${seconds}"
done done
check_status.sh check_status.sh
@ -53,7 +53,7 @@ fn_stop_graceful_cmd() {
fn_script_log_pass "Graceful: sending \"${1}\": OK: ${seconds} seconds" fn_script_log_pass "Graceful: sending \"${1}\": OK: ${seconds} seconds"
break break
fi fi
sleep 1 fn_sleep_time_1
fn_print_dots "Graceful: sending \"${1}\": ${seconds}" fn_print_dots "Graceful: sending \"${1}\": ${seconds}"
done done
check_status.sh check_status.sh
@ -74,7 +74,7 @@ fn_stop_graceful_goldsrc() {
tmux -L "${socketname}" send -t "${sessionname}" quit ENTER > /dev/null 2>&1 tmux -L "${socketname}" send -t "${sessionname}" quit ENTER > /dev/null 2>&1
# Waits 3 seconds as goldsrc servers restart with the quit command. # Waits 3 seconds as goldsrc servers restart with the quit command.
for seconds in {1..3}; do for seconds in {1..3}; do
sleep 1 fn_sleep_time_1
fn_print_dots "Graceful: sending \"quit\": ${seconds}" fn_print_dots "Graceful: sending \"quit\": ${seconds}"
done done
fn_print_ok "Graceful: sending \"quit\": ${seconds}: " 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" fn_script_log_pass "Graceful: telnet: ${telnetip}:${telnetport} : ${seconds} seconds"
break break
fi fi
sleep 1 fn_sleep_time_1
fn_print_dots "Graceful: telnet: ${seconds}" fn_print_dots "Graceful: telnet: ${seconds}"
done done
# If telnet shutdown fails tmux shutdown will be used, this risks loss of world save. # 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" fn_script_log_info "Graceful: /save /stop"
# Sends /save. # Sends /save.
tmux -L "${socketname}" send-keys -t "${sessionname}" /save ENTER > /dev/null 2>&1 tmux -L "${socketname}" send-keys -t "${sessionname}" /save ENTER > /dev/null 2>&1
sleep 5 fn_sleep_time_5
# Sends /quit. # Sends /quit.
tmux -L "${socketname}" send-keys -t "${sessionname}" /stop ENTER > /dev/null 2>&1 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. # 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" fn_script_log_pass "Graceful: /save /stop: OK: ${seconds} seconds"
break break
fi fi
sleep 1 fn_sleep_time_1
fn_print_dots "Graceful: /save /stop: ${seconds}" fn_print_dots "Graceful: /save /stop: ${seconds}"
done done
check_status.sh check_status.sh
@ -241,7 +241,7 @@ fn_stop_tmux() {
fn_script_log_info "tmux kill-session: ${sessionname}: ${servername}" fn_script_log_info "tmux kill-session: ${sessionname}: ${servername}"
# Kill tmux session. # Kill tmux session.
tmux -L "${socketname}" kill-session -t "${sessionname}" > /dev/null 2>&1 tmux -L "${socketname}" kill-session -t "${sessionname}" > /dev/null 2>&1
sleep 0.5 fn_sleep_time_1
check_status.sh check_status.sh
if [ "${status}" == "0" ]; then if [ "${status}" == "0" ]; then
fn_print_ok_nl "${servername}" fn_print_ok_nl "${servername}"
@ -268,6 +268,7 @@ fn_stop_pre_check() {
fi fi
} }
fn_print_dots ""
check.sh check.sh
# Create a stopping lockfile that only exists while the stop command is running. # Create a stopping lockfile that only exists while the stop command is running.

4
lgsm/modules/command_update_linuxgsm.sh

@ -10,10 +10,10 @@ commandaction="Updating LinuxGSM"
moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
fn_firstcommand_set fn_firstcommand_set
fn_print_dots ""
check.sh check.sh
info_distro.sh info_distro.sh
fn_print_dots ""
fn_script_log_info "Updating LinuxGSM" fn_script_log_info "Updating LinuxGSM"
fn_print_dots "Selecting repo" fn_print_dots "Selecting repo"
@ -92,7 +92,7 @@ if [ "${script_diff}" != "" ]; then
fi fi
echo -en "copying ${selfname}...\c" echo -en "copying ${selfname}...\c"
fn_script_log_info "copying ${selfname}" fn_script_log_info "Copying ${selfname}"
cp "${tmpdir}/linuxgsm.sh" "${rootdir}/${selfname}" cp "${tmpdir}/linuxgsm.sh" "${rootdir}/${selfname}"
sed -i "s+shortname=\"core\"+shortname=\"${shortname}\"+g" "${rootdir}/${selfname}" sed -i "s+shortname=\"core\"+shortname=\"${shortname}\"+g" "${rootdir}/${selfname}"
sed -i "s+gameservername=\"core\"+gameservername=\"${gameservername}\"+g" "${rootdir}/${selfname}" sed -i "s+gameservername=\"core\"+gameservername=\"${gameservername}\"+g" "${rootdir}/${selfname}"

8
lgsm/modules/command_validate.sh

@ -17,7 +17,7 @@ fn_validate() {
for seconds in {3..1}; do for seconds in {3..1}; do
fn_print_warn "Validate might overwrite some customised files: ${totalseconds}" fn_print_warn "Validate might overwrite some customised files: ${totalseconds}"
totalseconds=$((totalseconds - 1)) totalseconds=$((totalseconds - 1))
sleep 1 fn_sleep_time_1
if [ "${seconds}" == "0" ]; then if [ "${seconds}" == "0" ]; then
break break
fi fi
@ -27,11 +27,11 @@ fn_validate() {
fn_dl_steamcmd fn_dl_steamcmd
} }
# The location where the builds are checked and downloaded. fn_print_dots ""
remotelocation="SteamCMD"
check.sh check.sh
core_logs.sh
fn_print_dots "${remotelocation}" fn_print_dots "SteamCMD"
if [ "${status}" != "0" ]; then if [ "${status}" != "0" ]; then
fn_print_restart_warning fn_print_restart_warning

14
lgsm/modules/command_wipe.sh

@ -30,7 +30,7 @@ fn_wipe_files() {
if [ -n "${serverwipe}" ] || [ -n "${mapwipe}" ]; then if [ -n "${serverwipe}" ] || [ -n "${mapwipe}" ]; then
if [ -n "$(find "${serveridentitydir}" -type f -name "*.map")" ]; then if [ -n "$(find "${serveridentitydir}" -type f -name "*.map")" ]; then
echo -en "removing .map file(s)..." echo -en "removing .map file(s)..."
fn_script_log_info "removing *.map file(s)" fn_script_log_info "Removing *.map file(s)"
fn_sleep_time fn_sleep_time
find "${serveridentitydir:?}" -type f -name "*.map" -printf "%f\n" >> "${lgsmlog}" find "${serveridentitydir:?}" -type f -name "*.map" -printf "%f\n" >> "${lgsmlog}"
find "${serveridentitydir:?}" -type f -name "*.map" -delete | tee -a "${lgsmlog}" find "${serveridentitydir:?}" -type f -name "*.map" -delete | tee -a "${lgsmlog}"
@ -45,7 +45,7 @@ fn_wipe_files() {
if [ -n "${serverwipe}" ] || [ -n "${mapwipe}" ]; then if [ -n "${serverwipe}" ] || [ -n "${mapwipe}" ]; then
if [ -n "$(find "${serveridentitydir}" -type f -name "*.sav*")" ]; then if [ -n "$(find "${serveridentitydir}" -type f -name "*.sav*")" ]; then
echo -en "removing .sav file(s)..." echo -en "removing .sav file(s)..."
fn_script_log_info "removing .sav file(s)" fn_script_log_info "Removing .sav file(s)"
fn_sleep_time fn_sleep_time
find "${serveridentitydir:?}" -type f -name "*.sav*" -printf "%f\n" >> "${lgsmlog}" find "${serveridentitydir:?}" -type f -name "*.sav*" -printf "%f\n" >> "${lgsmlog}"
find "${serveridentitydir:?}" -type f -name "*.sav*" -delete find "${serveridentitydir:?}" -type f -name "*.sav*" -delete
@ -61,7 +61,7 @@ fn_wipe_files() {
if [ -n "${serverwipe}" ]; then if [ -n "${serverwipe}" ]; then
if [ -n "$(find "${serveridentitydir}" -type f ! -name 'player.tokens.db' -name "*.db")" ]; then if [ -n "$(find "${serveridentitydir}" -type f ! -name 'player.tokens.db' -name "*.db")" ]; then
echo -en "removing .db file(s)..." echo -en "removing .db file(s)..."
fn_script_log_info "removing .db file(s)" fn_script_log_info "Removing .db file(s)"
fn_sleep_time fn_sleep_time
find "${serveridentitydir:?}" -type f ! -name 'player.tokens.db' -name "*.db" -printf "%f\n" >> "${lgsmlog}" find "${serveridentitydir:?}" -type f ! -name 'player.tokens.db' -name "*.db" -printf "%f\n" >> "${lgsmlog}"
find "${serveridentitydir:?}" -type f ! -name 'player.tokens.db' -name "*.db" -delete find "${serveridentitydir:?}" -type f ! -name 'player.tokens.db' -name "*.db" -delete
@ -79,9 +79,9 @@ fn_map_wipe_warning() {
fn_script_log_warn "Map wipe will reset the map data and keep blueprint data" fn_script_log_warn "Map wipe will reset the map data and keep blueprint data"
totalseconds=3 totalseconds=3
for seconds in {3..1}; do for seconds in {3..1}; do
fn_print_warn "Map wipe will reset the map data and keep blueprint data: ${totalseconds}" fn_print_warn "map wipe will reset the map data and keep blueprint data: ${totalseconds}"
totalseconds=$((totalseconds - 1)) totalseconds=$((totalseconds - 1))
sleep 1 fn_sleep_time_1
if [ "${seconds}" == "0" ]; then if [ "${seconds}" == "0" ]; then
break break
fi fi
@ -94,9 +94,9 @@ fn_full_wipe_warning() {
fn_script_log_warn "Server wipe will reset the map data and remove blueprint data" fn_script_log_warn "Server wipe will reset the map data and remove blueprint data"
totalseconds=3 totalseconds=3
for seconds in {3..1}; do for seconds in {3..1}; do
fn_print_warn "Server wipe will reset the map data and remove blueprint data: ${totalseconds}" fn_print_warn "server wipe will reset the map data and remove blueprint data: ${totalseconds}"
totalseconds=$((totalseconds - 1)) totalseconds=$((totalseconds - 1))
sleep 1 fn_sleep_time_1
if [ "${seconds}" == "0" ]; then if [ "${seconds}" == "0" ]; then
break break
fi fi

49
lgsm/modules/core_messages.sh

@ -35,12 +35,23 @@ fn_ansi_loader() {
} }
fn_sleep_time() { fn_sleep_time() {
if [ "${sleeptime}" != "0" ] || [ "${travistest}" != "1" ]; then sleep "0.1"
if [ -z "${sleeptime}" ]; then }
sleeptime=0.5
fi fn_sleep_time_05() {
sleep "${sleeptime}" sleep "0.5"
fi }
fn_sleep_time_1() {
sleep "1"
}
fn_sleep_time_5() {
sleep "5"
}
fn_sleep_time_10() {
sleep "10"
} }
# Log display # Log display
@ -137,7 +148,7 @@ fn_print_dots() {
else else
echo -en "${creeol}[ .... ] $*" echo -en "${creeol}[ .... ] $*"
fi fi
fn_sleep_time fn_sleep_time_05
} }
fn_print_dots_nl() { fn_print_dots_nl() {
@ -146,7 +157,7 @@ fn_print_dots_nl() {
else else
echo -e "${creeol}[ .... ] $*" echo -e "${creeol}[ .... ] $*"
fi fi
fn_sleep_time fn_sleep_time_05
echo -en "\n" echo -en "\n"
} }
@ -476,56 +487,56 @@ fn_print_info_eol_nl() {
# QUERYING # QUERYING
fn_print_querying_eol() { fn_print_querying_eol() {
echo -en "${cyan}QUERYING${default}" echo -en "${cyan}QUERYING${default}"
fn_sleep_time fn_sleep_time_1
} }
fn_print_querying_eol_nl() { fn_print_querying_eol_nl() {
echo -e "${cyan}QUERYING${default}" echo -e "${cyan}QUERYING${default}"
fn_sleep_time fn_sleep_time_1
} }
# CHECKING # CHECKING
fn_print_checking_eol() { fn_print_checking_eol() {
echo -en "${cyan}CHECKING${default}" echo -en "${cyan}CHECKING${default}"
fn_sleep_time fn_sleep_time_1
} }
fn_print_checking_eol_nl() { fn_print_checking_eol_nl() {
echo -e "${cyan}CHECKING${default}" echo -e "${cyan}CHECKING${default}"
fn_sleep_time fn_sleep_time_1
} }
# DELAY # DELAY
fn_print_delay_eol() { fn_print_delay_eol() {
echo -en "${green}DELAY${default}" echo -en "${green}DELAY${default}"
fn_sleep_time fn_sleep_time_1
} }
fn_print_delay_eol_nl() { fn_print_delay_eol_nl() {
echo -e "${green}DELAY${default}" echo -e "${green}DELAY${default}"
fn_sleep_time fn_sleep_time_1
} }
# CANCELED # CANCELED
fn_print_canceled_eol() { fn_print_canceled_eol() {
echo -en "${lightyellow}CANCELED${default}" echo -en "${lightyellow}CANCELED${default}"
fn_sleep_time fn_sleep_time_1
} }
fn_print_canceled_eol_nl() { fn_print_canceled_eol_nl() {
echo -e "${lightyellow}CANCELED${default}" echo -e "${lightyellow}CANCELED${default}"
fn_sleep_time fn_sleep_time_1
} }
# REMOVED # REMOVED
fn_print_removed_eol() { fn_print_removed_eol() {
echo -en "${red}REMOVED${default}" echo -en "${red}REMOVED${default}"
fn_sleep_time fn_sleep_time_1
} }
fn_print_removed_eol_nl() { fn_print_removed_eol_nl() {
echo -e "${red}REMOVED${default}" echo -e "${red}REMOVED${default}"
fn_sleep_time fn_sleep_time_1
} }
# UPDATE # UPDATE
@ -582,7 +593,7 @@ fn_print_restart_warning() {
for seconds in {3..1}; do for seconds in {3..1}; do
fn_print_warn "${selfname} will be restarted: ${totalseconds}" fn_print_warn "${selfname} will be restarted: ${totalseconds}"
totalseconds=$((totalseconds - 1)) totalseconds=$((totalseconds - 1))
sleep 1 fn_sleep_time_1
if [ "${seconds}" == "0" ]; then if [ "${seconds}" == "0" ]; then
break break
fi fi

8
lgsm/modules/fix_kf.sh

@ -7,12 +7,12 @@
moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
echo -e "Applying WebAdmin ROOst.css fix." echo -e "applying WebAdmin ROOst.css fix."
echo -e "http://forums.tripwireinteractive.com/showpost.php?p=585435&postcount=13" echo -e "http://forums.tripwireinteractive.com/showpost.php?p=585435&postcount=13"
sed -i 's/none}/none;/g' "${serverfiles}/Web/ServerAdmin/ROOst.css" sed -i 's/none}/none;/g' "${serverfiles}/Web/ServerAdmin/ROOst.css"
sed -i 's/underline}/underline;/g' "${serverfiles}/Web/ServerAdmin/ROOst.css" sed -i 's/underline}/underline;/g' "${serverfiles}/Web/ServerAdmin/ROOst.css"
fn_sleep_time fn_sleep_time
echo -e "Applying WebAdmin CharSet fix." echo -e "applying WebAdmin CharSet fix."
echo -e "http://forums.tripwireinteractive.com/showpost.php?p=442340&postcount=1" echo -e "http://forums.tripwireinteractive.com/showpost.php?p=442340&postcount=1"
sed -i 's/CharSet="iso-8859-1"/CharSet="utf-8"/g' "${systemdir}/UWeb.int" sed -i 's/CharSet="iso-8859-1"/CharSet="utf-8"/g' "${systemdir}/UWeb.int"
fn_sleep_time fn_sleep_time
@ -23,14 +23,14 @@ fn_sleep_time
exitbypass=1 exitbypass=1
command_start.sh command_start.sh
fn_firstcommand_reset fn_firstcommand_reset
sleep 5 fn_sleep_time_5
exitbypass=1 exitbypass=1
command_stop.sh command_stop.sh
fn_firstcommand_reset fn_firstcommand_reset
exitbypass=1 exitbypass=1
command_start.sh command_start.sh
fn_firstcommand_reset fn_firstcommand_reset
sleep 5 fn_sleep_time_5
exitbypass=1 exitbypass=1
command_stop.sh command_stop.sh
fn_firstcommand_reset fn_firstcommand_reset

2
lgsm/modules/fix_kf2.sh

@ -13,7 +13,7 @@ fn_print_information "starting ${gamename} server to generate configs."
exitbypass=1 exitbypass=1
command_start.sh command_start.sh
fn_firstcommand_reset fn_firstcommand_reset
sleep 10 fn_sleep_time_10
exitbypass=1 exitbypass=1
command_stop.sh command_stop.sh
fn_firstcommand_reset fn_firstcommand_reset

10
lgsm/modules/fix_ro.sh

@ -7,16 +7,16 @@
moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
echo -e "Applying webinterface ROOst.css fix." echo -e "applying webinterface ROOst.css fix."
echo -e "http://forums.tripwireinteractive.com/showpost.php?p=585435&postcount=13" echo -e "http://forums.tripwireinteractive.com/showpost.php?p=585435&postcount=13"
sed -i 's/none}/none;/g' "${serverfiles}/Web/ServerAdmin/ROOst.css" sed -i 's/none}/none;/g' "${serverfiles}/Web/ServerAdmin/ROOst.css"
sed -i 's/underline}/underline;/g' "${serverfiles}/Web/ServerAdmin/ROOst.css" sed -i 's/underline}/underline;/g' "${serverfiles}/Web/ServerAdmin/ROOst.css"
fn_sleep_time fn_sleep_time
echo -e "Applying webinterface CharSet fix." echo -e "applying webinterface CharSet fix."
echo -e "http://forums.tripwireinteractive.com/showpost.php?p=442340&postcount=1" echo -e "http://forums.tripwireinteractive.com/showpost.php?p=442340&postcount=1"
sed -i 's/CharSet="iso-8859-1"/CharSet="utf-8"/g' "${systemdir}/uweb.int" sed -i 's/CharSet="iso-8859-1"/CharSet="utf-8"/g' "${systemdir}/uweb.int"
fn_sleep_time fn_sleep_time
echo -e "Applying Steam AppID fix." echo -e "applying Steam AppID fix."
sed -i 's/1210/1200/g' "${systemdir}/steam_appid.txt" sed -i 's/1210/1200/g' "${systemdir}/steam_appid.txt"
fn_sleep_time fn_sleep_time
echo -e "applying server name fix." echo -e "applying server name fix."
@ -26,14 +26,14 @@ fn_sleep_time
exitbypass=1 exitbypass=1
command_start.sh command_start.sh
fn_firstcommand_reset fn_firstcommand_reset
sleep 5 fn_sleep_time_5
exitbypass=1 exitbypass=1
command_stop.sh command_stop.sh
fn_firstcommand_reset fn_firstcommand_reset
exitbypass=1 exitbypass=1
command_start.sh command_start.sh
fn_firstcommand_reset fn_firstcommand_reset
sleep 5 fn_sleep_time_5
exitbypass=1 exitbypass=1
command_stop.sh command_stop.sh
fn_firstcommand_reset fn_firstcommand_reset

4
lgsm/modules/fix_samp.sh

@ -15,7 +15,7 @@ if [ -f "${servercfgfullpath}" ]; then
if [ "${currentpass}" == "${defaultpass}" ]; then if [ "${currentpass}" == "${defaultpass}" ]; then
fixname="change default rcon password" fixname="change default rcon password"
fn_fix_msg_start fn_fix_msg_start
fn_script_log_info "changing rcon/admin password." fn_script_log_info "Changing rcon/admin password."
randomstring=$(tr -dc 'A-Za-z0-9_' < /dev/urandom 2> /dev/null | head -c 8 | xargs) randomstring=$(tr -dc 'A-Za-z0-9_' < /dev/urandom 2> /dev/null | head -c 8 | xargs)
rconpass="admin${randomstring}" rconpass="admin${randomstring}"
sed -i "s/rcon_password changeme/rcon_password ${rconpass}/g" "${servercfgfullpath}" sed -i "s/rcon_password changeme/rcon_password ${rconpass}/g" "${servercfgfullpath}"
@ -27,7 +27,7 @@ if [ -f "${servercfgfullpath}" ]; then
if [ "${currenthostname}" == "${defaulthostname}" ]; then if [ "${currenthostname}" == "${defaulthostname}" ]; then
fixname="change default hostname" fixname="change default hostname"
fn_fix_msg_start fn_fix_msg_start
fn_script_log_info "changing default hostname to LinuxGSM" fn_script_log_info "Changing default hostname to LinuxGSM"
sed -i "s/hostname ${defaulthostname}/hostname LinuxGSM/g" "${servercfgfullpath}" sed -i "s/hostname ${defaulthostname}/hostname LinuxGSM/g" "${servercfgfullpath}"
fn_fix_msg_end fn_fix_msg_end
fi fi

4
lgsm/modules/fix_ut2k4.sh

@ -23,14 +23,14 @@ fn_sleep_time
exitbypass=1 exitbypass=1
command_start.sh command_start.sh
fn_firstcommand_reset fn_firstcommand_reset
sleep 5 fn_sleep_time_5
exitbypass=1 exitbypass=1
command_stop.sh command_stop.sh
fn_firstcommand_reset fn_firstcommand_reset
exitbypass=1 exitbypass=1
command_start.sh command_start.sh
fn_firstcommand_reset fn_firstcommand_reset
sleep 5 fn_sleep_time_5
exitbypass=1 exitbypass=1
command_stop.sh command_stop.sh
fn_firstcommand_reset fn_firstcommand_reset

2
lgsm/modules/fix_ut3.sh

@ -13,7 +13,7 @@ fn_print_information "starting ${gamename} server to generate configs."
exitbypass=1 exitbypass=1
command_start.sh command_start.sh
fn_firstcommand_reset fn_firstcommand_reset
sleep 10 fn_sleep_time_10
exitbypass=1 exitbypass=1
command_stop.sh command_stop.sh
fn_firstcommand_reset fn_firstcommand_reset

4
lgsm/modules/info_messages.sh

@ -143,8 +143,8 @@ fn_info_message_server_resource() {
{ {
echo -e "${lightyellow}Storage${default}" echo -e "${lightyellow}Storage${default}"
echo -e "${lightblue}Filesystem:\t${default}${filesystem}" echo -e "${lightblue}Filesystem:\t${default}${filesystem}"
echo -e "${lightblue}Total:\t\t${default}${totalspace}" echo -e "${lightblue}Total:\t${default}${totalspace}"
echo -e "${lightblue}Used:\t\t${default}${usedspace}" echo -e "${lightblue}Used:\t${default}${usedspace}"
echo -e "${lightblue}Available:\t${default}${availspace}" echo -e "${lightblue}Available:\t${default}${availspace}"
} | column -s $'\t' -t } | column -s $'\t' -t
echo -e "" echo -e ""

22
lgsm/modules/install_config.sh

@ -11,7 +11,7 @@ moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
fn_check_cfgdir() { fn_check_cfgdir() {
if [ ! -d "${servercfgdir}" ]; then if [ ! -d "${servercfgdir}" ]; then
echo -e "creating ${servercfgdir} config directory." echo -e "creating ${servercfgdir} config directory."
fn_script_log_info "creating ${servercfgdir} config directory." fn_script_log_info "Creating ${servercfgdir} config directory."
mkdir -pv "${servercfgdir}" mkdir -pv "${servercfgdir}"
fi fi
} }
@ -25,7 +25,7 @@ fn_fetch_default_config() {
echo -e "" echo -e ""
echo -e "${italic}https://github.com/GameServerManagers/Game-Server-Configs${default}" echo -e "${italic}https://github.com/GameServerManagers/Game-Server-Configs${default}"
echo -e "" echo -e ""
fn_sleep_time fn_sleep_time_1
mkdir -p "${lgsmdir}/config-default/config-game" mkdir -p "${lgsmdir}/config-default/config-game"
githuburl="https://raw.githubusercontent.com/GameServerManagers/Game-Server-Configs/main" githuburl="https://raw.githubusercontent.com/GameServerManagers/Game-Server-Configs/main"
for config in "${array_configs[@]}"; do for config in "${array_configs[@]}"; do
@ -38,7 +38,7 @@ fn_default_config_remote() {
for config in "${array_configs[@]}"; do for config in "${array_configs[@]}"; do
# every config is copied # every config is copied
echo -e "copying ${config} config file." echo -e "copying ${config} config file."
fn_script_log_info "copying ${servercfg} config file." fn_script_log_info "Copying ${servercfg} config file."
if [ "${config}" == "${servercfgdefault}" ]; then if [ "${config}" == "${servercfgdefault}" ]; then
mkdir -p "${servercfgdir}" mkdir -p "${servercfgdir}"
cp -nv "${lgsmdir}/config-default/config-game/${config}" "${servercfgfullpath}" cp -nv "${lgsmdir}/config-default/config-game/${config}" "${servercfgfullpath}"
@ -82,7 +82,7 @@ fn_set_config_vars() {
servername="LinuxGSM" servername="LinuxGSM"
rconpass="admin${randomstring}" rconpass="admin${randomstring}"
echo -e "changing hostname." echo -e "changing hostname."
fn_script_log_info "changing hostname." fn_script_log_info "Changing hostname."
fn_sleep_time fn_sleep_time
# prevents var from being overwritten with the servername. # prevents var from being overwritten with the servername.
if grep -q "SERVERNAME=SERVERNAME" "${lgsmdir}/config-default/config-game/${config}" 2> /dev/null; then if grep -q "SERVERNAME=SERVERNAME" "${lgsmdir}/config-default/config-game/${config}" 2> /dev/null; then
@ -93,7 +93,7 @@ fn_set_config_vars() {
sed -i "s/SERVERNAME/${servername}/g" "${servercfgfullpath}" sed -i "s/SERVERNAME/${servername}/g" "${servercfgfullpath}"
fi fi
echo -e "changing rcon/admin password." echo -e "changing rcon/admin password."
fn_script_log_info "changing rcon/admin password." fn_script_log_info "Changing rcon/admin password."
if [ "${shortname}" == "squad" ]; then if [ "${shortname}" == "squad" ]; then
sed -i "s/ADMINPASSWORD/${rconpass}/g" "${servercfgdir}/Rcon.cfg" sed -i "s/ADMINPASSWORD/${rconpass}/g" "${servercfgdir}/Rcon.cfg"
else else
@ -112,15 +112,15 @@ fn_set_dst_config_vars() {
## cluster.ini ## cluster.ini
if grep -Fq "SERVERNAME" "${clustercfgfullpath}"; then if grep -Fq "SERVERNAME" "${clustercfgfullpath}"; then
echo -e "changing server name." echo -e "changing server name."
fn_script_log_info "changing server name." fn_script_log_info "Changing server name."
sed -i "s/SERVERNAME/LinuxGSM/g" "${clustercfgfullpath}" sed -i "s/SERVERNAME/LinuxGSM/g" "${clustercfgfullpath}"
fn_sleep_time fn_sleep_time
echo -e "changing shard mode." echo -e "changing shard mode."
fn_script_log_info "changing shard mode." fn_script_log_info "Changing shard mode."
sed -i "s/USESHARDING/${sharding}/g" "${clustercfgfullpath}" sed -i "s/USESHARDING/${sharding}/g" "${clustercfgfullpath}"
fn_sleep_time fn_sleep_time
echo -e "randomizing cluster key." echo -e "randomizing cluster key."
fn_script_log_info "randomizing cluster key." fn_script_log_info "Randomizing cluster key."
randomstring=$(tr -dc 'A-Za-z0-9_' < /dev/urandom 2> /dev/null | head -c 8 | xargs) randomstring=$(tr -dc 'A-Za-z0-9_' < /dev/urandom 2> /dev/null | head -c 8 | xargs)
sed -i "s/CLUSTERKEY/${randomstring}/g" "${clustercfgfullpath}" sed -i "s/CLUSTERKEY/${randomstring}/g" "${clustercfgfullpath}"
fn_sleep_time fn_sleep_time
@ -139,18 +139,18 @@ fn_set_dst_config_vars() {
fi fi
echo -e "changing shard name." echo -e "changing shard name."
fn_script_log_info "changing shard name." fn_script_log_info "Changing shard name."
sed -i "s/SHARDNAME/${shard}/g" "${servercfgfullpath}" sed -i "s/SHARDNAME/${shard}/g" "${servercfgfullpath}"
fn_sleep_time fn_sleep_time
echo -e "changing master setting." echo -e "changing master setting."
fn_script_log_info "changing master setting." fn_script_log_info "Changing master setting."
sed -i "s/ISMASTER/${master}/g" "${servercfgfullpath}" sed -i "s/ISMASTER/${master}/g" "${servercfgfullpath}"
fn_sleep_time fn_sleep_time
## worldgenoverride.lua ## worldgenoverride.lua
if [ "${cave}" == "true" ]; then if [ "${cave}" == "true" ]; then
echo -e "defining ${shard} as cave in ${servercfgdir}/worldgenoverride.lua." echo -e "defining ${shard} as cave in ${servercfgdir}/worldgenoverride.lua."
fn_script_log_info "defining ${shard} as cave in ${servercfgdir}/worldgenoverride.lua." fn_script_log_info "Defining ${shard} as cave in ${servercfgdir}/worldgenoverride.lua."
echo 'return { override_enabled = true, preset = "DST_CAVE", }' > "${servercfgdir}/worldgenoverride.lua" echo 'return { override_enabled = true, preset = "DST_CAVE", }' > "${servercfgdir}/worldgenoverride.lua"
fi fi
fn_sleep_time fn_sleep_time

4
lgsm/modules/install_eula.sh

@ -30,10 +30,10 @@ if [ -z "${autoinstall}" ]; then
fi fi
elif [ "${commandname}" == "START" ]; then elif [ "${commandname}" == "START" ]; then
fn_print_info "By continuing you are indicating your agreement to the EULA." fn_print_info "By continuing you are indicating your agreement to the EULA."
sleep 5 fn_sleep_time_5
else else
echo -e "By using auto-install you are indicating your agreement to the EULA." echo -e "By using auto-install you are indicating your agreement to the EULA."
sleep 5 fn_sleep_time_5
fi fi
if [ "${shortname}" == "ts3" ]; then if [ "${shortname}" == "ts3" ]; then

4
lgsm/modules/install_gslt.sh

@ -10,7 +10,6 @@ moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
echo -e "" echo -e ""
echo -e "${bold}${lightyellow}Game Server Login Token${default}" echo -e "${bold}${lightyellow}Game Server Login Token${default}"
fn_messages_separator fn_messages_separator
fn_sleep_time
if [ "${shortname}" == "csgo" ] || [ "${shortname}" == "css" ] || [ "${shortname}" == "nmrih" ] || [ "${shortname}" == "bs" ]; then if [ "${shortname}" == "csgo" ] || [ "${shortname}" == "css" ] || [ "${shortname}" == "nmrih" ] || [ "${shortname}" == "bs" ]; then
echo -e "GSLT is required to run a public ${gamename} server" echo -e "GSLT is required to run a public ${gamename} server"
fn_script_log_info "GSLT is required to run a public ${gamename} server" fn_script_log_info "GSLT is required to run a public ${gamename} server"
@ -36,7 +35,7 @@ if [ -z "${autoinstall}" ]; then
fi fi
fi fi
fi fi
fn_sleep_time
if [ "${shortname}" == "tu" ]; then if [ "${shortname}" == "tu" ]; then
echo -e "The GSLT can be changed by editing ${servercfgdir}/${servercfg}." echo -e "The GSLT can be changed by editing ${servercfgdir}/${servercfg}."
fn_script_log_info "The GSLT can be changed by editing ${servercfgdir}/${servercfg}." fn_script_log_info "The GSLT can be changed by editing ${servercfgdir}/${servercfg}."
@ -44,4 +43,5 @@ else
echo -e "The GSLT can be changed by editing ${configdirserver}/${selfname}.cfg." echo -e "The GSLT can be changed by editing ${configdirserver}/${selfname}.cfg."
fn_script_log_info "The GSLT can be changed by editing ${configdirserver}/${selfname}.cfg." fn_script_log_info "The GSLT can be changed by editing ${configdirserver}/${selfname}.cfg."
fi fi
fn_sleep_time_1
echo -e "" echo -e ""

2
lgsm/modules/install_logs.sh

@ -11,9 +11,7 @@ if [ "${checklogs}" != "1" ]; then
echo -e "" echo -e ""
echo -e "${bold}${lightyellow}Creating Log Directories${default}" echo -e "${bold}${lightyellow}Creating Log Directories${default}"
fn_messages_separator fn_messages_separator
fn_sleep_time
fi fi
fn_sleep_time
# Create LinuxGSM logs. # Create LinuxGSM logs.
echo -en "installing log dir: ${logdir}..." echo -en "installing log dir: ${logdir}..."
mkdir -p "${logdir}" mkdir -p "${logdir}"

1
lgsm/modules/install_server_dir.sh

@ -10,7 +10,6 @@ moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
echo -e "" echo -e ""
echo -e "${bold}${lightyellow}Server Directory${default}" echo -e "${bold}${lightyellow}Server Directory${default}"
fn_messages_separator fn_messages_separator
fn_sleep_time
if [ -d "${serverfiles}" ]; then if [ -d "${serverfiles}" ]; then
fn_print_warning_nl "A server is already installed here." fn_print_warning_nl "A server is already installed here."
fi fi

2
lgsm/modules/install_squad_license.sh

@ -18,7 +18,7 @@ echo -e "https://squad.fandom.com/wiki/Server_licensing"
fn_script_log_info "Get more info and a server license here:" fn_script_log_info "Get more info and a server license here:"
fn_script_log_info "https://squad.fandom.com/wiki/Server_licensing" fn_script_log_info "https://squad.fandom.com/wiki/Server_licensing"
echo -e "" echo -e ""
fn_sleep_time fn_sleep_time_1
echo -e "The Squad server license can be changed by editing ${servercfgdir}/License.cfg." echo -e "The Squad server license can be changed by editing ${servercfgdir}/License.cfg."
fn_script_log_info "The Squad server license can be changed by editing ${selfname}." fn_script_log_info "The Squad server license can be changed by editing ${selfname}."
echo -e "" echo -e ""

1
lgsm/modules/install_stats.sh

@ -10,7 +10,6 @@ moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
echo -e "" echo -e ""
echo -e "${bold}${lightyellow}LinuxGSM Stats${default}" echo -e "${bold}${lightyellow}LinuxGSM Stats${default}"
fn_messages_separator fn_messages_separator
fn_sleep_time
echo -e "Assist LinuxGSM development by sending anonymous stats to developers." echo -e "Assist LinuxGSM development by sending anonymous stats to developers."
echo -e "Collected data is publicly available: ${italic}https://linuxgsm.com/data/usage${default}" echo -e "Collected data is publicly available: ${italic}https://linuxgsm.com/data/usage${default}"
echo -e "More info: ${italic}https://docs.linuxgsm.com/configuration/linuxgsm-stats${default}" echo -e "More info: ${italic}https://docs.linuxgsm.com/configuration/linuxgsm-stats${default}"

4
lgsm/modules/install_ts3db.sh

@ -45,7 +45,7 @@ fn_install_ts3db_mariadb() {
sed -i "s/dbpluginparameter=/dbpluginparameter=ts3db_mariadb.ini/g" "${servercfgfullpath}" sed -i "s/dbpluginparameter=/dbpluginparameter=ts3db_mariadb.ini/g" "${servercfgfullpath}"
sed -i "s/dbsqlcreatepath=create_sqlite\//dbsqlcreatepath=create_mariadb\//g" "${servercfgfullpath}" sed -i "s/dbsqlcreatepath=create_sqlite\//dbsqlcreatepath=create_mariadb\//g" "${servercfgfullpath}"
echo -e "updating ts3db_mariadb.ini." echo -e "updating ts3db_mariadb.ini."
fn_sleep_time fn_sleep_time_1
} }
echo -e "" echo -e ""
@ -69,5 +69,5 @@ fn_print_information_nl "Key also saved in:"
echo -e "${serverfiles}/privilege_key.txt" echo -e "${serverfiles}/privilege_key.txt"
cd "${executabledir}" || exit cd "${executabledir}" || exit
./ts3server_startscript.sh start inifile=ts3-server.ini 2>&1 | tee "${serverfiles}/privilege_key.txt" ./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 ./ts3server_startscript.sh stop

2
lgsm/modules/update_fctr.sh

@ -104,7 +104,7 @@ fn_update_compare() {
command_start.sh command_start.sh
fn_firstcommand_reset fn_firstcommand_reset
exitbypass=1 exitbypass=1
sleep 5 fn_sleep_time_5
command_stop.sh command_stop.sh
fn_firstcommand_reset fn_firstcommand_reset
fi fi

2
lgsm/modules/update_jk2.sh

@ -100,7 +100,7 @@ fn_update_compare() {
command_start.sh command_start.sh
fn_firstcommand_reset fn_firstcommand_reset
exitbypass=1 exitbypass=1
sleep 5 fn_sleep_time_5
command_stop.sh command_stop.sh
fn_firstcommand_reset fn_firstcommand_reset
fi fi

2
lgsm/modules/update_mc.sh

@ -116,7 +116,7 @@ fn_update_compare() {
command_start.sh command_start.sh
fn_firstcommand_reset fn_firstcommand_reset
exitbypass=1 exitbypass=1
sleep 5 fn_sleep_time_5
command_stop.sh command_stop.sh
fn_firstcommand_reset fn_firstcommand_reset
fi fi

2
lgsm/modules/update_mcb.sh

@ -122,7 +122,7 @@ fn_update_compare() {
command_start.sh command_start.sh
fn_firstcommand_reset fn_firstcommand_reset
exitbypass=1 exitbypass=1
sleep 5 fn_sleep_time_5
command_stop.sh command_stop.sh
fn_firstcommand_reset fn_firstcommand_reset
fi fi

2
lgsm/modules/update_mta.sh

@ -108,7 +108,7 @@ fn_update_compare() {
command_start.sh command_start.sh
fn_firstcommand_reset fn_firstcommand_reset
exitbypass=1 exitbypass=1
sleep 5 fn_sleep_time_5
command_stop.sh command_stop.sh
fn_firstcommand_reset fn_firstcommand_reset
fi fi

2
lgsm/modules/update_pmc.sh

@ -126,7 +126,7 @@ fn_update_compare() {
command_start.sh command_start.sh
fn_firstcommand_reset fn_firstcommand_reset
exitbypass=1 exitbypass=1
sleep 5 fn_sleep_time_5
command_stop.sh command_stop.sh
fn_firstcommand_reset fn_firstcommand_reset
fi fi

2
lgsm/modules/update_ts3.sh

@ -108,7 +108,7 @@ fn_update_compare() {
command_start.sh command_start.sh
fn_firstcommand_reset fn_firstcommand_reset
exitbypass=1 exitbypass=1
sleep 5 fn_sleep_time_5
command_stop.sh command_stop.sh
fn_firstcommand_reset fn_firstcommand_reset
fi fi

2
lgsm/modules/update_ut99.sh

@ -102,7 +102,7 @@ fn_update_compare() {
command_start.sh command_start.sh
fn_firstcommand_reset fn_firstcommand_reset
exitbypass=1 exitbypass=1
sleep 5 fn_sleep_time_5
command_stop.sh command_stop.sh
fn_firstcommand_reset fn_firstcommand_reset
fi fi

2
lgsm/modules/update_vints.sh

@ -109,7 +109,7 @@ fn_update_compare() {
command_start.sh command_start.sh
fn_firstcommand_reset fn_firstcommand_reset
exitbypass=1 exitbypass=1
sleep 5 fn_sleep_time_5
command_stop.sh command_stop.sh
fn_firstcommand_reset fn_firstcommand_reset
fi fi

19
linuxgsm.sh

@ -323,18 +323,19 @@ fn_install_file() {
# Prevent LinuxGSM from running as root. Except if doing a dependency install. # Prevent LinuxGSM from running as root. Except if doing a dependency install.
if [ "$(whoami)" == "root" ]; then if [ "$(whoami)" == "root" ]; then
if [ "${userinput}" == "install" ] || [ "${userinput}" == "auto-install" ] || [ "${userinput}" == "i" ] || [ "${userinput}" == "ai" ]; then if [ -f "${modulesdir}/core_modules.sh" ] || [ -f "${modulesdir}/check_root.sh" ] || [ -f "${modulesdir}/core_messages.sh" ]; then
if [ "${shortname}" == "core" ]; then if [ "${userinput}" != "install" ] && [ "${userinput}" != "auto-install" ] && [ "${userinput}" != "i" ] && [ "${userinput}" != "ai" ]; then
echo -e "[ FAIL ] Do NOT run this script as root!"
exit 1
fi
elif [ ! -f "${modulesdir}/core_modules.sh" ] || [ ! -f "${modulesdir}/check_root.sh" ] || [ ! -f "${modulesdir}/core_messages.sh" ]; then
echo -e "[ FAIL ] Do NOT run this script as root!"
exit 1
else
core_modules.sh core_modules.sh
core_messages.sh
fn_ansi_loader
check_root.sh check_root.sh
fi fi
else
if [ "${userinput}" != "install" ] && [ "${userinput}" != "auto-install" ] && [ "${userinput}" != "i" ] && [ "${userinput}" != "ai" ]; then
echo -e "[ FAIL ] Do NOT run as root!"
exit 1
fi
fi
fi fi
# LinuxGSM installer mode. # LinuxGSM installer mode.

Loading…
Cancel
Save