diff --git a/lgsm/config-default/config-lgsm/dstserver/_default.cfg b/lgsm/config-default/config-lgsm/dstserver/_default.cfg index 8b404391d..4677162c3 100644 --- a/lgsm/config-default/config-lgsm/dstserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/dstserver/_default.cfg @@ -15,7 +15,6 @@ shard="Master" cluster="Cluster_1" cave="false" -# Edit with care persistentstorageroot="${HOME}/.klei" confdir="DoNotStarveTogether" diff --git a/lgsm/config-default/config-lgsm/hwserver/_default.cfg b/lgsm/config-default/config-lgsm/hwserver/_default.cfg index 99b08e358..853a52078 100644 --- a/lgsm/config-default/config-lgsm/hwserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/hwserver/_default.cfg @@ -26,7 +26,7 @@ admins="" loadsave="" ## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters -# Edit with care | http://hurtworld.wikia.com/wiki/Hosting_A_Server +# http://hurtworld.wikia.com/wiki/Hosting_A_Server startparameters="-batchmode -nographics -logfile ${gamelog} -exec \"host ${port} ${defaultmap} ${loadsave};queryport ${queryport};maxplayers ${maxplayers};servername ${servername};creativemode ${creativemode};${admins}\"" #### LinuxGSM Settings #### diff --git a/lgsm/config-default/config-lgsm/inssserver/_default.cfg b/lgsm/config-default/config-lgsm/inssserver/_default.cfg index 6a7313c7b..117ddbff8 100644 --- a/lgsm/config-default/config-lgsm/inssserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/inssserver/_default.cfg @@ -14,7 +14,7 @@ port="27102" queryport="27131" rconport="27015" rconpassword="" -servername="LinuxGSM Server" +servername="LinuxGSM" defaultmap="Canyon" defaultscenario="Scenario_Crossing_Push_Security" maxplayers="28" diff --git a/lgsm/config-default/config-lgsm/loserver/_default.cfg b/lgsm/config-default/config-lgsm/loserver/_default.cfg index 5a205d88f..cc2f7b89a 100644 --- a/lgsm/config-default/config-lgsm/loserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/loserver/_default.cfg @@ -10,7 +10,7 @@ ## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters ## https://docs.linuxgsm.com/game-servers/last-oasis -servername="${selfname}" +servername="LinuxGSM" ip="0.0.0.0" port="7777" queryport="27015" diff --git a/lgsm/config-default/config-lgsm/mtaserver/_default.cfg b/lgsm/config-default/config-lgsm/mtaserver/_default.cfg index 8397146b8..3af42ea2b 100644 --- a/lgsm/config-default/config-lgsm/mtaserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/mtaserver/_default.cfg @@ -12,7 +12,6 @@ ip="0.0.0.0" ## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters -# Edit with care startparameters="" #### LinuxGSM Settings #### diff --git a/lgsm/config-default/config-lgsm/ns2cserver/_default.cfg b/lgsm/config-default/config-lgsm/ns2cserver/_default.cfg index 4579d3bb0..2ca53a335 100644 --- a/lgsm/config-default/config-lgsm/ns2cserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/ns2cserver/_default.cfg @@ -13,7 +13,7 @@ ip="0.0.0.0" port="27015" defaultmap="co_core" maxplayers="24" -servername="LinuxGSM Server" +servername="LinuxGSM" httpuser="admin" httppassword="admin" httpport="8080" diff --git a/lgsm/config-default/config-lgsm/ns2server/_default.cfg b/lgsm/config-default/config-lgsm/ns2server/_default.cfg index 9f09491cf..3ee3a0514 100644 --- a/lgsm/config-default/config-lgsm/ns2server/_default.cfg +++ b/lgsm/config-default/config-lgsm/ns2server/_default.cfg @@ -13,7 +13,7 @@ ip="0.0.0.0" port="27015" defaultmap="ns2_summit" maxplayers="24" -servername="LinuxGSM Server" +servername="LinuxGSM" httpuser="admin" httppassword="admin" httpport="8080" diff --git a/lgsm/config-default/config-lgsm/rustserver/_default.cfg b/lgsm/config-default/config-lgsm/rustserver/_default.cfg index fc955a94a..9a4bfe147 100644 --- a/lgsm/config-default/config-lgsm/rustserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/rustserver/_default.cfg @@ -16,7 +16,7 @@ appport="28082" queryport="28017" rconpassword="CHANGE_ME" rconweb="1" # values: Facepunch web panel, Rustadmin desktop and Rustadmin Online = 1, Rusty = 0. -servername="Rust" +servername="LinuxGSM" gamemode="vanilla" # values: vanilla, softcore ( Doc: https://wiki.facepunch.com/rust/server-gamemodes ) serverlevel="Procedural Map" # values: Procedural Map, Barren, HapisIsland, SavasIsland customlevelurl="" # Custom level url. +server.levelurl \"${customlevelurl}\" diff --git a/lgsm/config-default/config-lgsm/sbotsserver/_default.cfg b/lgsm/config-default/config-lgsm/sbotsserver/_default.cfg index 0107c39d5..e5fe5b5d8 100644 --- a/lgsm/config-default/config-lgsm/sbotsserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/sbotsserver/_default.cfg @@ -12,7 +12,7 @@ port="7777" queryport="27015" defaultmap="StationKappa" -servername="LinuxGSM Server" +servername="LinuxGSM" ## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters startparameters="Port=${port}?QueryPort=${queryport} -startup_map ${defaultmap} -server_name \"${servername}\"" diff --git a/lgsm/config-default/config-lgsm/stnserver/_default.cfg b/lgsm/config-default/config-lgsm/stnserver/_default.cfg index 8531c111b..3e5f97c7b 100644 --- a/lgsm/config-default/config-lgsm/stnserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/stnserver/_default.cfg @@ -12,7 +12,7 @@ maxplayers="20" region="0" ## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters -# Edit with care | https://colonysurvival.gamepedia.com/Dedicated_Server#Installation_.28Linux.29 +# https://colonysurvival.gamepedia.com/Dedicated_Server#Installation_.28Linux.29 startparameters="-mc ${maxplayers} -r ${region}" #### LinuxGSM Settings #### diff --git a/lgsm/config-default/config-lgsm/stserver/_default.cfg b/lgsm/config-default/config-lgsm/stserver/_default.cfg index 0d8f9317f..980c4e045 100644 --- a/lgsm/config-default/config-lgsm/stserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/stserver/_default.cfg @@ -13,7 +13,6 @@ worldname="moon_save" worldtype="Moon" ## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters -# Edit with care startparameters="-LOADLATEST ${worldname} ${worldtype}" #### LinuxGSM Settings #### diff --git a/lgsm/config-default/config-lgsm/vhserver/_default.cfg b/lgsm/config-default/config-lgsm/vhserver/_default.cfg index f0eb4cf8e..ce90a2b07 100644 --- a/lgsm/config-default/config-lgsm/vhserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/vhserver/_default.cfg @@ -9,7 +9,7 @@ #### Game Server Settings #### ## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters -servername="Valheim Server" +servername="LinuxGSM" # Minimum password length is 5. serverpassword="" port="2456" diff --git a/lgsm/modules/alert_discord.sh b/lgsm/modules/alert_discord.sh index a384de3db..f3a79416a 100644 --- a/lgsm/modules/alert_discord.sh +++ b/lgsm/modules/alert_discord.sh @@ -52,7 +52,7 @@ discordsend=$(curl --connect-timeout 10 -sSL -H "Content-Type: application/json" if [ -n "${discordsend}" ]; then fn_print_fail_nl "Sending Discord alert: ${discordsend}" - fn_script_log_fatal "Sending Discord alert: ${discordsend}" + fn_script_log_fail "Sending Discord alert: ${discordsend}" else fn_print_ok_nl "Sending Discord alert" fn_script_log_pass "Sending Discord alert" diff --git a/lgsm/modules/alert_email.sh b/lgsm/modules/alert_email.sh index e2cf5f123..0aca09fef 100644 --- a/lgsm/modules/alert_email.sh +++ b/lgsm/modules/alert_email.sh @@ -8,7 +8,6 @@ moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_print_dots "Sending Email alert: ${email}" -fn_sleep_time if [ -n "${emailfrom}" ]; then mail -s "${alertsubject}" -r "${emailfrom}" "${email}" < "${alertlog}" @@ -21,5 +20,5 @@ if [ "${exitcode}" == "0" ]; then fn_script_log_pass "Sending Email alert: ${email}" else fn_print_fail_nl "Sending Email alert: ${email}" - fn_script_log_fatal "Sending Email alert: ${email}" + fn_script_log_fail "Sending Email alert: ${email}" fi diff --git a/lgsm/modules/alert_gotify.sh b/lgsm/modules/alert_gotify.sh index ef833ba75..27e4d3439 100644 --- a/lgsm/modules/alert_gotify.sh +++ b/lgsm/modules/alert_gotify.sh @@ -26,5 +26,5 @@ if [ -n "${gotifysend}" ]; then fn_script_log_pass "Sending Gotify alert" else fn_print_fail_nl "Sending Gotify alert: ${gotifysend}" - fn_script_log_fatal "Sending Gotify alert: ${gotifysend}" + fn_script_log_fail "Sending Gotify alert: ${gotifysend}" fi diff --git a/lgsm/modules/alert_ifttt.sh b/lgsm/modules/alert_ifttt.sh index ae0de8ed6..c1ccfc9cb 100644 --- a/lgsm/modules/alert_ifttt.sh +++ b/lgsm/modules/alert_ifttt.sh @@ -22,7 +22,7 @@ iftttsend=$(curl --connect-timeout 10 -sSL -H "Content-Type: application/json" - if [ -n "${iftttsend}" ]; then fn_print_fail_nl "Sending IFTTT alert: ${pushbulletsend}" - fn_script_log_fatal "Sending IFTTT alert: ${pushbulletsend}" + fn_script_log_fail "Sending IFTTT alert: ${pushbulletsend}" else fn_print_ok_nl "Sending IFTTT alert" fn_script_log_pass "Sent IFTTT alert" diff --git a/lgsm/modules/alert_pushbullet.sh b/lgsm/modules/alert_pushbullet.sh index eec141611..3bcd6141b 100644 --- a/lgsm/modules/alert_pushbullet.sh +++ b/lgsm/modules/alert_pushbullet.sh @@ -23,7 +23,7 @@ pushbulletsend=$(curl --connect-timeout 10 -sSL -u """${pushbullettoken}"":" -H if [ -n "${pushbulletsend}" ]; then fn_print_fail_nl "Sending Pushbullet alert: ${pushbulletsend}" - fn_script_log_fatal "Sending Pushbullet alert: ${pushbulletsend}" + fn_script_log_fail "Sending Pushbullet alert: ${pushbulletsend}" else fn_print_ok_nl "Sending Pushbullet alert" fn_script_log_pass "Sent Pushbullet alert" diff --git a/lgsm/modules/alert_pushover.sh b/lgsm/modules/alert_pushover.sh index 608e73c30..35229094a 100644 --- a/lgsm/modules/alert_pushover.sh +++ b/lgsm/modules/alert_pushover.sh @@ -26,7 +26,7 @@ pushoversend=$(curl --connect-timeout 10 -sS -F token="${pushovertoken}" -F user if [ -n "${pushoversend}" ]; then fn_print_fail_nl "Sending Pushover alert: ${pushoversend}" - fn_script_log_fatal "Sending Pushover alert: ${pushoversend}" + fn_script_log_fail "Sending Pushover alert: ${pushoversend}" else fn_print_ok_nl "Sending Pushover alert" fn_script_log_pass "Sent Pushover alert" diff --git a/lgsm/modules/alert_rocketchat.sh b/lgsm/modules/alert_rocketchat.sh index 875a6ff5d..f6e410ef8 100644 --- a/lgsm/modules/alert_rocketchat.sh +++ b/lgsm/modules/alert_rocketchat.sh @@ -46,5 +46,5 @@ if [ -n "${rocketchatsend}" ]; then fn_script_log_pass "Sending Rocketchat alert" else fn_print_fail_nl "Sending Rocketchat alert: ${rocketchatsend}" - fn_script_log_fatal "Sending Rocketchat alert: ${rocketchatsend}" + fn_script_log_fail "Sending Rocketchat alert: ${rocketchatsend}" fi diff --git a/lgsm/modules/alert_slack.sh b/lgsm/modules/alert_slack.sh index 3bb148828..f83df9510 100644 --- a/lgsm/modules/alert_slack.sh +++ b/lgsm/modules/alert_slack.sh @@ -71,5 +71,5 @@ if [ "${slacksend}" == "ok" ]; then fn_script_log_pass "Sending Slack alert" else fn_print_fail_nl "Sending Slack alert: ${slacksend}" - fn_script_log_fatal "Sending Slack alert: ${slacksend}" + fn_script_log_fail "Sending Slack alert: ${slacksend}" fi diff --git a/lgsm/modules/alert_telegram.sh b/lgsm/modules/alert_telegram.sh index 77b89560c..d2e72346a 100644 --- a/lgsm/modules/alert_telegram.sh +++ b/lgsm/modules/alert_telegram.sh @@ -23,7 +23,7 @@ telegramsend=$(curl --connect-timeout 10 -sSL -H "Content-Type: application/json if [ -n "${telegramsend}" ]; then fn_print_fail_nl "Sending Telegram alert: ${telegramsend}" - fn_script_log_fatal "Sending Telegram alert: ${telegramsend}" + fn_script_log_fail "Sending Telegram alert: ${telegramsend}" else fn_print_ok_nl "Sending Telegram alert" fn_script_log_pass "Sent Telegram alert" diff --git a/lgsm/modules/check_config.sh b/lgsm/modules/check_config.sh index 4f96a8db4..436740afa 100644 --- a/lgsm/modules/check_config.sh +++ b/lgsm/modules/check_config.sh @@ -28,8 +28,8 @@ fi if [ "${shortname}" == "vh" ] && [ -z "${serverpassword}" ]; then fn_print_fail_nl "serverpassword is not set" - fn_script_log_fatal "serverpassword is not set" + fn_script_log_fail "serverpassword is not set" elif [ "${shortname}" == "vh" ] && [ "${#serverpassword}" -le "4" ]; then fn_print_fail_nl "serverpassword is to short (min 5 chars)" - fn_script_log_fatal "serverpassword is to short (min 5 chars)" + fn_script_log_fail "serverpassword is to short (min 5 chars)" fi diff --git a/lgsm/modules/check_deps.sh b/lgsm/modules/check_deps.sh index 2818ffc11..d10948ca5 100644 --- a/lgsm/modules/check_deps.sh +++ b/lgsm/modules/check_deps.sh @@ -80,7 +80,7 @@ fn_install_mono_repo() { if [ "${monoautoinstall}" != "1" ]; then if [ $? != 0 ]; then fn_print_failure_nl "Unable to install Mono repository." - fn_script_log_fatal "Unable to install Mono repository." + fn_script_log_fail "Unable to install Mono repository." else fn_print_complete_nl "Installing Mono repository completed." fn_script_log_pass "Installing Mono repository completed." @@ -138,7 +138,6 @@ fn_install_missing_deps() { fn_print_warn "Missing dependencies: ${red}${array_deps_missing[*]}${default}" fn_script_log_warn "Missing dependencies: ${array_deps_missing[*]}" fi - fn_sleep_time # Attempt automatic dependency installation if [ "${autoinstall}" == "1" ]; then @@ -216,7 +215,7 @@ fn_install_missing_deps() { if [ "${steamcmdfail}" ]; then if [ "${commandname}" == "INSTALL" ]; then fn_print_failure_nl "Missing dependencies required to run SteamCMD." - fn_script_log_fatal "Missing dependencies required to run SteamCMD." + fn_script_log_fail "Missing dependencies required to run SteamCMD." core_exit.sh else fn_print_error_nl "Missing dependencies required to run SteamCMD." @@ -336,15 +335,14 @@ fn_deps_detector() { if [ "${commandname}" == "INSTALL" ]; then if [ "$(whoami)" == "root" ]; then echo -e "" - echo -e "${lightyellow}Checking Dependencies as root${default}" - echo -e "=================================" + echo -e "${bold}${lightyellow}Checking ${gamename} Dependencies as root${default}" + fn_messages_separator fn_print_information_nl "Checking any missing dependencies for ${gamename} server only." fn_print_information_nl "This will NOT install a ${gamename} server." - fn_sleep_time else echo -e "" - echo -e "${lightyellow}Checking Dependencies${default}" - echo -e "=================================" + echo -e "${bold}${lightyellow}Checking ${gamename} Dependencies${default}" + fn_messages_separator fi fi diff --git a/lgsm/modules/check_executable.sh b/lgsm/modules/check_executable.sh index 6c8feab2a..91db68f1a 100644 --- a/lgsm/modules/check_executable.sh +++ b/lgsm/modules/check_executable.sh @@ -20,7 +20,7 @@ if [ ! -f "${executabledir}/${execname}" ]; then fn_print_fail_nl "executable was not found" echo -e "* ${executabledir}/${execname}" if [ -d "${lgsmlogdir}" ]; then - fn_script_log_fatal "Executable was not found: ${executabledir}/${execname}" + fn_script_log_fail "Executable was not found: ${executabledir}/${execname}" fi unset exitbypass core_exit.sh diff --git a/lgsm/modules/check_permissions.sh b/lgsm/modules/check_permissions.sh index d582e5f24..a6a37ce5c 100644 --- a/lgsm/modules/check_permissions.sh +++ b/lgsm/modules/check_permissions.sh @@ -25,7 +25,7 @@ fn_check_ownership() { fi if [ "${selfownissue}" == "1" ] || [ "${funcownissue}" == "1" ] || [ "${filesownissue}" == "1" ]; then fn_print_fail_nl "Ownership issues found" - fn_script_log_fatal "Ownership issues found" + fn_script_log_fail "Ownership issues found" fn_print_information_nl "The current user ($(whoami)) does not have ownership of the following files:" fn_script_log_info "The current user ($(whoami)) does not have ownership of the following files:" { @@ -56,7 +56,7 @@ fn_check_permissions() { if [ -d "${modulesdir}" ]; then if [ "$(find "${modulesdir}" -type f -not -executable | wc -l)" -ne "0" ]; then fn_print_fail_nl "Permissions issues found" - fn_script_log_fatal "Permissions issues found" + fn_script_log_fail "Permissions issues found" fn_print_information_nl "The following files are not executable:" fn_script_log_info "The following files are not executable:" { @@ -80,7 +80,7 @@ fn_check_permissions() { grouprootdirperm="${rootdirperm:1:1}" if [ "${userrootdirperm}" != "7" ] && [ "${grouprootdirperm}" != "7" ]; then fn_print_fail_nl "Permissions issues found" - fn_script_log_fatal "Permissions issues found" + fn_script_log_fail "Permissions issues found" fn_print_information_nl "The following directory does not have the correct permissions:" fn_script_log_info "The following directory does not have the correct permissions:" fn_script_log_info "${rootdir}" @@ -198,7 +198,7 @@ fn_sys_perm_errors_fix() { if [ "${sysdirpermerror}" == "1" ] || [ "${classdirpermerror}" == "1" ] || [ "${netdirpermerror}" == "1" ]; then fn_print_error "Could not fix /sys permissions" fn_script_log_error "Could not fix /sys permissions." - fn_sleep_time + # Show the user how to fix. fn_sys_perm_fix_manually_msg else diff --git a/lgsm/modules/check_root.sh b/lgsm/modules/check_root.sh index 063a2b0d3..81115394a 100644 --- a/lgsm/modules/check_root.sh +++ b/lgsm/modules/check_root.sh @@ -11,7 +11,7 @@ if [ "$(whoami)" == "root" ]; then if [ "${commandname}" != "INSTALL" ]; then fn_print_fail_nl "Do NOT run this script as root!" if [ -d "${lgsmlogdir}" ]; then - fn_script_log_fatal "${selfname} attempted to run as root." + fn_script_log_fail "${selfname} attempted to run as root." else # Forces exit code is log does not yet exist. exitcode=1 diff --git a/lgsm/modules/check_system_dir.sh b/lgsm/modules/check_system_dir.sh index 162037861..01c643748 100644 --- a/lgsm/modules/check_system_dir.sh +++ b/lgsm/modules/check_system_dir.sh @@ -10,7 +10,7 @@ moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" if [ ! -d "${serverfiles}" ]; then fn_print_fail_nl "Cannot access ${serverfiles}: No such directory" if [ -d "${lgsmlogdir}" ]; then - fn_script_log_fatal "Cannot access ${serverfiles}: No such directory." + fn_script_log_fail "Cannot access ${serverfiles}: No such directory." fi core_exit.sh fi @@ -18,7 +18,7 @@ fi if [ ! -d "${systemdir}" ]; then fn_print_fail_nl "Cannot access ${systemdir}: No such directory" if [ -d "${lgsmlogdir}" ]; then - fn_script_log_fatal "Cannot access ${systemdir}: No such directory." + fn_script_log_fail "Cannot access ${systemdir}: No such directory." fi core_exit.sh fi diff --git a/lgsm/modules/check_tmuxception.sh b/lgsm/modules/check_tmuxception.sh index aded5cb2d..8f1f94c73 100644 --- a/lgsm/modules/check_tmuxception.sh +++ b/lgsm/modules/check_tmuxception.sh @@ -10,7 +10,7 @@ moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_check_is_in_tmux() { if [ "${TMUX}" ]; then fn_print_fail_nl "tmuxception error: Sorry Cobb you cannot start a tmux session inside of a tmux session." - fn_script_log_fatal "Tmuxception error: Attempted to start a tmux session inside of a tmux session." + fn_script_log_fail "Tmuxception error: Attempted to start a tmux session inside of a tmux session." fn_print_information_nl "LinuxGSM creates a tmux session when starting the server." echo -e "It is not possible to run a tmux session inside another tmux session" echo -e "https://docs.linuxgsm.com/requirements/tmux#tmuxception" @@ -21,7 +21,7 @@ fn_check_is_in_tmux() { fn_check_is_in_screen() { if [ "${STY}" ]; then fn_print_fail_nl "tmuxception error: Sorry Cobb you cannot start a tmux session inside of a screen session." - fn_script_log_fatal "Tmuxception error: Attempted to start a tmux session inside of a screen session." + fn_script_log_fail "Tmuxception error: Attempted to start a tmux session inside of a screen session." fn_print_information_nl "LinuxGSM creates a tmux session when starting the server." echo -e "It is not possible to run a tmux session inside screen session" echo -e "https://docs.linuxgsm.com/requirements/tmux#tmuxception" diff --git a/lgsm/modules/command_backup.sh b/lgsm/modules/command_backup.sh index b63c82625..16223c914 100644 --- a/lgsm/modules/command_backup.sh +++ b/lgsm/modules/command_backup.sh @@ -148,7 +148,7 @@ fn_backup_compression() { # Check that excludedir is a valid path. if [ ! -d "${excludedir}" ]; then fn_print_fail_nl "Problem identifying the previous backup directory for exclusion." - fn_script_log_fatal "Problem identifying the previous backup directory for exclusion" + fn_script_log_fail "Problem identifying the previous backup directory for exclusion" core_exit.sh fi @@ -156,10 +156,10 @@ fn_backup_compression() { local exitcode=$? if [ "${exitcode}" != 0 ]; then fn_print_fail_eol - fn_script_log_fatal "Backup in progress: FAIL" + fn_script_log_fail "Backup in progress: FAIL" echo -e "${extractcmd}" | tee -a "${lgsmlog}" fn_print_fail_nl "Starting backup" - fn_script_log_fatal "Starting backup" + fn_script_log_fail "Starting backup" else fn_print_ok_eol fn_print_ok_nl "Completed: ${backupname}.tar.gz, total size $(du -sh "${backupdir}/${backupname}.tar.gz" | awk '{print $1}')" @@ -217,7 +217,7 @@ fn_backup_relpath() { declare -a rdirtoks=($(readlink -f "${rootdir}" | sed "s/\// /g")) if [ ${#rdirtoks[@]} -eq 0 ]; then fn_print_fail_nl "Problem assessing rootdir during relative path assessment" - fn_script_log_fatal "Problem assessing rootdir during relative path assessment: ${rootdir}" + fn_script_log_fail "Problem assessing rootdir during relative path assessment: ${rootdir}" core_exit.sh fi @@ -225,7 +225,7 @@ fn_backup_relpath() { declare -a bdirtoks=($(readlink -f "${backupdir}" | sed "s/\// /g")) if [ ${#bdirtoks[@]} -eq 0 ]; then fn_print_fail_nl "Problem assessing backupdir during relative path assessment" - fn_script_log_fatal "Problem assessing backupdir during relative path assessment: ${rootdir}" + fn_script_log_fail "Problem assessing backupdir during relative path assessment: ${rootdir}" core_exit.sh fi diff --git a/lgsm/modules/command_debug.sh b/lgsm/modules/command_debug.sh index 41722e507..495417c16 100644 --- a/lgsm/modules/command_debug.sh +++ b/lgsm/modules/command_debug.sh @@ -82,7 +82,7 @@ echo -e "" echo -e "Use debug for identifying server issues only!" echo -e "Press CTRL+c to drop out of debug mode." fn_print_warning_nl "If ${selfname} is already running it will be stopped." -echo -e "" + if ! fn_prompt_yn "Continue?" Y; then exitcode=0 core_exit.sh diff --git a/lgsm/modules/command_dev_clear_modules.sh b/lgsm/modules/command_dev_clear_modules.sh index 52d07ee1a..bf19b2578 100644 --- a/lgsm/modules/command_dev_clear_modules.sh +++ b/lgsm/modules/command_dev_clear_modules.sh @@ -10,9 +10,9 @@ commandaction="Clearing modules" moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_firstcommand_set -echo -e "=================================" -echo -e "Clear Modules" -echo -e "=================================" +echo -e "" +echo -e "${bold}${lightyellow}Clear Modules${default}" +fn_messages_separator echo -e "" if fn_prompt_yn "Do you want to delete all modules?" Y; then rm -rfv "${modulesdir:?}/"* diff --git a/lgsm/modules/command_dev_details.sh b/lgsm/modules/command_dev_details.sh index b95418121..2659465d3 100644 --- a/lgsm/modules/command_dev_details.sh +++ b/lgsm/modules/command_dev_details.sh @@ -17,8 +17,8 @@ info_game.sh carriagereturn=$(file -b "${servercfgfullpath}" | grep -q CRLF && echo "${red}CRLF${default}" || echo "${lightgreen}LF${default}") echo -e "" -echo -e "${lightgreen}Server Details${default}" -echo -e "==================================================================" +echo -e "${bold}${lightgreen}Server Details${default}" +fn_messages_separator echo -e "" echo -e "Game: ${gamename}" @@ -76,8 +76,8 @@ missing_details="" # Loop through the server details and output them. echo -e "" -echo -e "${lightgreen}Available Server Details${default}" -echo -e "=================================" +echo -e "${bold}${lightgreen}Available Server Details${default}" +fn_messages_separator for key in "${!server_details[@]}"; do value=${server_details[$key]} if [ -z "$value" ]; then @@ -91,7 +91,7 @@ done if [ -n "$missing_details" ]; then echo -e "" echo -e "${lightgreen}Missing Server Details${default}" - echo -e "=================================" + fn_messages_separator echo -e "${missing_details}" fi diff --git a/lgsm/modules/command_dev_detect_deps.sh b/lgsm/modules/command_dev_detect_deps.sh index 763ab5554..6215fb897 100644 --- a/lgsm/modules/command_dev_detect_deps.sh +++ b/lgsm/modules/command_dev_detect_deps.sh @@ -10,9 +10,9 @@ commandaction="Developer detect deps" moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_firstcommand_set -echo -e "=================================" -echo -e "Dependencies Checker" -echo -e "=================================" +echo -e "" +echo -e "${bold}Dependencies Checker${default}" +fn_messages_separator echo -e "Checking directory: " echo -e "${serverfiles}" if [ "$(command -v eu-readelf 2> /dev/null)" ]; then @@ -182,33 +182,33 @@ awk -vORS='' '{ print $1,$2 }' "${tmpdir}/.depdetect_ubuntu_list_uniq" > "${tmpd awk -vORS='' '{ print $1,$2 }' "${tmpdir}/.depdetect_debian_list_uniq" > "${tmpdir}/.depdetect_debian_line" echo -e "" echo -e "" -echo -e "Required Dependencies" -echo -e "=================================" +echo -e "${bold}Required Dependencies${default}" +fn_messages_separator echo -e "${executable}" echo -e "" echo -e "CentOS" -echo -e "=================================" +fn_messages_separator cat "${tmpdir}/.depdetect_centos_line" echo -e "" echo -e "" echo -e "Ubuntu" -echo -e "=================================" +fn_messages_separator cat "${tmpdir}/.depdetect_ubuntu_line" echo -e "" echo -e "" echo -e "Debian" -echo -e "=================================" +fn_messages_separator cat "${tmpdir}/.depdetect_debian_line" echo -e "" if [ "${unknownlib}" == "1" ]; then echo -e "" echo -e "Unknown shared Library" - echo -e "=================================" + fn_messages_separator cat "${tmpdir}/.depdetect_unknown" fi echo -e "" echo -e "Required Librarys" -echo -e "=================================" +fn_messages_separator sort "${tmpdir}/.depdetect_readelf" | uniq echo -en "\n" rm -f "${tmpdir:?}/.depdetect_centos_line" diff --git a/lgsm/modules/command_dev_detect_glibc.sh b/lgsm/modules/command_dev_detect_glibc.sh index ca64ed7cc..214adc88e 100644 --- a/lgsm/modules/command_dev_detect_glibc.sh +++ b/lgsm/modules/command_dev_detect_glibc.sh @@ -11,13 +11,13 @@ commandaction="Developer detect glibc" moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_firstcommand_set -echo -e "=================================" +fn_messages_separator echo -e "glibc Requirements Checker" -echo -e "=================================" +fn_messages_separator if [ ! "$(command -v objdump 2> /dev/null)" ]; then fn_print_failure_nl "objdump is missing" - fn_script_log_fatal "objdump is missing" + fn_script_log_fail "objdump is missing" core_exit.sh fi @@ -59,7 +59,7 @@ for glibc_check_var in "${glibc_check_dir_array[@]}"; do echo -e "" echo -e "" echo -e "${glibc_check_name} glibc Requirements" - echo -e "=================================" + fn_messages_separator if [ -f "${tmpdir}/detect_glibc_files_${glibc_check_var}.tmp" ]; then echo -e "Required glibc" cat "${tmpdir}/detect_glibc_${glibc_check_var}.tmp" | sort | uniq | sort -r --version-sort | head -1 | tee -a "${tmpdir}/detect_glibc_highest.tmp" @@ -81,7 +81,7 @@ for glibc_check_var in "${glibc_check_dir_array[@]}"; do done echo -e "" echo -e "Final glibc Requirement" -echo -e "=================================" +fn_messages_separator if [ -f "${tmpdir}/detect_glibc_highest.tmp" ]; then cat "${tmpdir}/detect_glibc_highest.tmp" | sort | uniq | sort -r --version-sort | head -1 rm -f "${tmpdir:?}/detect_glibc_highest.tmp" diff --git a/lgsm/modules/command_dev_detect_ldd.sh b/lgsm/modules/command_dev_detect_ldd.sh index 877c8d95b..af41bb522 100644 --- a/lgsm/modules/command_dev_detect_ldd.sh +++ b/lgsm/modules/command_dev_detect_ldd.sh @@ -11,9 +11,9 @@ commandaction="Developer detect ldd" moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_firstcommand_set -echo -e "=================================" +fn_messages_separator echo -e "Shared Object dependencies Checker" -echo -e "=================================" +fn_messages_separator if [ -z "${serverfiles}" ]; then dir=$(dirname "$(readlink -f "${BASH_SOURCE[0]}")") @@ -47,12 +47,12 @@ find "${serverfiles}" -type f -print0 \ echo -e "" echo -e "" echo -e "All" -echo -e "=================================" +fn_messages_separator cat "${tmpdir}/detect_ldd.tmp" echo -e "" echo -e "Not Found" -echo -e "=================================" +fn_messages_separator cat "${tmpdir}/detect_ldd_not_found.tmp" rm -f "${tmpdir:?}/detect_ldd.tmp" diff --git a/lgsm/modules/command_dev_query_raw.sh b/lgsm/modules/command_dev_query_raw.sh index 1abd6cdf3..cf9e14858 100644 --- a/lgsm/modules/command_dev_query_raw.sh +++ b/lgsm/modules/command_dev_query_raw.sh @@ -17,14 +17,14 @@ info_messages.sh echo -e "" echo -e "${lightgreen}Query IP Addresses${default}" -echo -e "==================================================================" +fn_messages_separator echo -e "" for queryip in "${queryips[@]}"; do echo -e "${queryip}" done echo -e "" echo -e "${lightgreen}Game Server Ports${default}" -echo -e "==================================================================" +fn_messages_separator { echo -e "${lightblue}Port Name \tPort Number \tStatus \tTCP \tUDP${default}" if [ -v port ]; then @@ -184,18 +184,18 @@ echo -e "==================================================================" | column -s $'\t' -t echo -e "" echo -e "${lightgreen}SS Output${default}" -echo -e "=================================" +fn_messages_separator fn_info_message_ports eval "${portcommand}" echo -e "" echo -e "${lightgreen}Query Port - Raw Output${default}" -echo -e "==================================================================" +fn_messages_separator echo -e "" echo -e "PORT: ${port}" echo -e "QUERY PORT: ${queryport}" echo -e "" echo -e "${lightgreen}Gamedig Raw Output${default}" -echo -e "=================================" +fn_messages_separator echo -e "" if [ ! "$(command -v gamedig 2> /dev/null)" ]; then fn_print_failure_nl "gamedig not installed" @@ -211,7 +211,7 @@ for queryip in "${queryips[@]}"; do done echo -e "" echo -e "${lightgreen}gsquery Raw Output${default}" -echo -e "=================================" +fn_messages_separator echo -e "" for queryip in "${queryips[@]}"; do echo -e "./query_gsquery.py -a \"${queryip}\" -p \"${queryport}\" -e \"${querytype}\"" @@ -223,7 +223,7 @@ for queryip in "${queryips[@]}"; do done echo -e "" echo -e "${lightgreen}TCP Raw Output${default}" -echo -e "=================================" +fn_messages_separator echo -e "" for queryip in "${queryips[@]}"; do echo -e "bash -c 'exec 3<> /dev/tcp/'${queryip}'/'${queryport}''" @@ -239,10 +239,10 @@ for queryip in "${queryips[@]}"; do done echo -e "" echo -e "${lightgreen}Game Port - Raw Output${default}" -echo -e "==================================================================" +fn_messages_separator echo -e "" echo -e "${lightgreen}TCP Raw Output${default}" -echo -e "=================================" +fn_messages_separator echo -e "" for queryip in "${queryips[@]}"; do echo -e "bash -c 'exec 3<> /dev/tcp/'${queryip}'/'${port}''" @@ -258,7 +258,7 @@ for queryip in "${queryips[@]}"; do done echo -e "" echo -e "${lightgreen}Steam Master Server Response${default}" -echo -e "==================================================================" +fn_messages_separator echo -e "" echo -e "curl -m 3 -s https://api.steampowered.com/ISteamApps/GetServersAtAddress/v0001?addr=${publicip}" echo -e "" diff --git a/lgsm/modules/command_fastdl.sh b/lgsm/modules/command_fastdl.sh index 4aff9994d..acc3a1ba4 100644 --- a/lgsm/modules/command_fastdl.sh +++ b/lgsm/modules/command_fastdl.sh @@ -26,7 +26,7 @@ luafastdlfullpath="${luasvautorundir}/${luafastdlfile}" # Check if bzip2 is installed. if [ ! "$(command -v bzip2 2> /dev/null)" ]; then fn_print_fail "bzip2 is not installed" - fn_script_log_fatal "bzip2 is not installed" + fn_script_log_fail "bzip2 is not installed" core_exit.sh fi @@ -37,7 +37,7 @@ echo -e "" # Prompts user for FastDL creation settings. echo -e "${commandaction} setup" -echo -e "=================================" +fn_messages_separator # Prompt for clearing old files if directory was already here. if [ -d "${fastdldir}" ]; then @@ -72,7 +72,7 @@ fn_clear_old_fastdl() { exitcode=$? if [ "${exitcode}" != 0 ]; then fn_print_fail_eol_nl - fn_script_log_fatal "Clearing existing FastDL directory ${fastdldir}" + fn_script_log_fail "Clearing existing FastDL directory ${fastdldir}" core_exit.sh else fn_print_ok_eol_nl @@ -89,7 +89,7 @@ fn_fastdl_dirs() { exitcode=$? if [ "${exitcode}" != 0 ]; then fn_print_fail_eol_nl - fn_script_log_fatal "Creating web directory ${webdir}" + fn_script_log_fail "Creating web directory ${webdir}" core_exit.sh else fn_print_ok_eol_nl @@ -102,7 +102,7 @@ fn_fastdl_dirs() { exitcode=$? if [ "${exitcode}" != 0 ]; then fn_print_fail_eol_nl - fn_script_log_fatal "Creating fastdl directory ${fastdldir}" + fn_script_log_fail "Creating fastdl directory ${fastdldir}" core_exit.sh else fn_print_ok_eol_nl @@ -218,13 +218,13 @@ fn_fastdl_preview() { exitcode=$? if [ "${exitcode}" != 0 ]; then fn_print_fail_eol_nl - fn_script_log_fatal "Calculating total file size." + fn_script_log_fail "Calculating total file size." core_exit.sh fi done < "${tmpdir}/fastdl_files_to_compress.txt" else fn_print_fail_eol_nl "generating file list" - fn_script_log_fatal "Generating file list." + fn_script_log_fail "Generating file list." core_exit.sh fi echo -e "about to compress ${totalfiles} files, total size $(fn_human_readable_file_size ${filesizetotal} 0)" @@ -251,7 +251,7 @@ fn_fastdl_gmod() { exitcode=$? if [ "${exitcode}" != 0 ]; then fn_print_fail_eol_nl - fn_script_log_fatal "Copying ${fastdlfile} > ${fastdldir}" + fn_script_log_fail "Copying ${fastdlfile} > ${fastdldir}" core_exit.sh else fn_script_log_pass "Copying ${fastdlfile} > ${fastdldir}" @@ -268,7 +268,7 @@ fn_fastdl_gmod() { exitcode=$? if [ "${exitcode}" != 0 ]; then fn_print_fail_eol_nl - fn_script_log_fatal "Updating addons file structure" + fn_script_log_fail "Updating addons file structure" core_exit.sh else fn_print_ok_eol_nl @@ -281,7 +281,7 @@ fn_fastdl_gmod() { exitcode=$? if [ "${exitcode}" != 0 ]; then fn_print_fail_eol_nl - fn_script_log_fatal "Clearing addons dir from fastdl dir" + fn_script_log_fail "Clearing addons dir from fastdl dir" core_exit.sh else fn_print_ok_eol_nl @@ -296,7 +296,7 @@ fn_fastdl_gmod() { exitcode=$? if [ "${exitcode}" != 0 ]; then fn_print_fail_eol_nl - fn_script_log_fatal "Correcting DarkRP files" + fn_script_log_fail "Correcting DarkRP files" core_exit.sh else fn_print_ok_eol_nl @@ -347,7 +347,7 @@ fn_fastdl_source() { exitcode=$? if [ "${exitcode}" != 0 ]; then fn_print_fail_eol_nl - fn_script_log_fatal "Copying ${fastdlfile} > ${fastdldir}/${copytodir}" + fn_script_log_fail "Copying ${fastdlfile} > ${fastdldir}/${copytodir}" core_exit.sh else fn_script_log_pass "Copying ${fastdlfile} > ${fastdldir}/${copytodir}" @@ -383,7 +383,7 @@ fn_fastdl_gmod_dl_enforcer() { exitcode=$? if [ "${exitcode}" != 0 ]; then fn_print_fail_eol_nl - fn_script_log_fatal "Removing existing download enforcer ${luafastdlfullpath}" + fn_script_log_fail "Removing existing download enforcer ${luafastdlfullpath}" core_exit.sh else fn_print_ok_eol_nl @@ -401,7 +401,7 @@ fn_fastdl_gmod_dl_enforcer() { exitcode=$? if [ "${exitcode}" != 0 ]; then fn_print_fail_eol_nl - fn_script_log_fatal "Creating new download enforcer ${luafastdlfullpath}" + fn_script_log_fail "Creating new download enforcer ${luafastdlfullpath}" core_exit.sh else fn_print_ok_eol_nl @@ -418,7 +418,7 @@ fn_fastdl_bzip2() { exitcode=$? if [ "${exitcode}" != 0 ]; then fn_print_fail_eol_nl - fn_script_log_fatal "Compressing ${filetocompress}" + fn_script_log_fail "Compressing ${filetocompress}" core_exit.sh else fn_script_log_pass "Compressing ${filetocompress}" diff --git a/lgsm/modules/command_install_resources_mta.sh b/lgsm/modules/command_install_resources_mta.sh index c3d745a30..31a9165fd 100644 --- a/lgsm/modules/command_install_resources_mta.sh +++ b/lgsm/modules/command_install_resources_mta.sh @@ -13,7 +13,7 @@ fn_firstcommand_set fn_install_resources() { echo -e "" echo -e "${lightyellow}Installing Default Resources${default}" - echo -e "=================================" + fn_messages_separator fn_fetch_file "http://mirror.mtasa.com/mtasa/resources/mtasa-resources-latest.zip" "" "" "" "${tmpdir}" "mtasa-resources-latest.zip" "nochmodx" "norun" "noforce" "nohash" fn_dl_extract "${tmpdir}" "mtasa-resources-latest.zip" "${resourcesdir}" echo -e "Default Resources Installed." diff --git a/lgsm/modules/command_mods_install.sh b/lgsm/modules/command_mods_install.sh index d602be2cd..19de72ab0 100644 --- a/lgsm/modules/command_mods_install.sh +++ b/lgsm/modules/command_mods_install.sh @@ -19,7 +19,7 @@ fn_print_header fn_mods_installed_list if [ "${installedmodscount}" -gt "0" ]; then echo -e "Installed addons/mods" - echo -e "=================================" + fn_messages_separator # Go through all available commands, get details and display them to the user. for ((llindex = 0; llindex < ${#installedmodslist[@]}; llindex++)); do # Current mod is the "llindex" value of the array we're going through. @@ -32,7 +32,7 @@ if [ "${installedmodscount}" -gt "0" ]; then fi echo -e "Available addons/mods" -echo -e "=================================" +fn_messages_separator # Display available mods from mods_list.sh. # Set and reset vars compatiblemodslistindex=0 @@ -78,7 +78,7 @@ fn_mod_get_info echo -e "" echo -e "Installing ${modprettyname}" -echo -e "=================================" +fn_messages_separator fn_script_log_info "${modprettyname} selected for install" # Check if the mod is already installed and warn the user. diff --git a/lgsm/modules/command_mods_remove.sh b/lgsm/modules/command_mods_remove.sh index 8f9ea3739..db7763cd8 100644 --- a/lgsm/modules/command_mods_remove.sh +++ b/lgsm/modules/command_mods_remove.sh @@ -16,7 +16,7 @@ fn_mods_check_installed fn_print_header echo -e "Remove addons/mods" -echo -e "=================================" +fn_messages_separator # Displays list of installed mods. # Generates list to display to user. @@ -72,7 +72,7 @@ while [ "${modfileline}" -le "${modsfilelistsize}" ]; do rm -rf "${modinstalldir:?}/${currentfileremove:?}" ((exitcode = $?)) if [ "${exitcode}" != 0 ]; then - fn_script_log_fatal "Removing ${modinstalldir}/${currentfileremove}" + fn_script_log_fail "Removing ${modinstalldir}/${currentfileremove}" break else fn_script_log_pass "Removing ${modinstalldir}/${currentfileremove}" @@ -103,7 +103,7 @@ fn_sleep_time rm -rf "${modsdir:?}/${modcommand}-files.txt" exitcode=$? if [ "${exitcode}" != 0 ]; then - fn_script_log_fatal "Removing ${modsdir}/${modcommand}-files.txt" + fn_script_log_fail "Removing ${modsdir}/${modcommand}-files.txt" fn_print_fail_eol_nl core_exit.sh else @@ -118,7 +118,7 @@ fn_sleep_time sed -i "/^${modcommand}$/d" "${modsinstalledlistfullpath}" exitcode=$? if [ "${exitcode}" != 0 ]; then - fn_script_log_fatal "Removing ${modcommand} from ${modsinstalledlist}" + fn_script_log_fail "Removing ${modcommand} from ${modsinstalledlist}" fn_print_fail_eol_nl core_exit.sh else diff --git a/lgsm/modules/command_mods_update.sh b/lgsm/modules/command_mods_update.sh index b917f191f..cfbafc80c 100644 --- a/lgsm/modules/command_mods_update.sh +++ b/lgsm/modules/command_mods_update.sh @@ -97,7 +97,7 @@ while [ "${installedmodsline}" -le "${installedmodscount}" ]; do ((installedmodsline++)) else fn_print_fail "No mod was selected" - fn_script_log_fatal "No mod was selected" + fn_script_log_fail "No mod was selected" exitcode="1" core_exit.sh fi diff --git a/lgsm/modules/command_monitor.sh b/lgsm/modules/command_monitor.sh index 5ce104a95..079ad334d 100644 --- a/lgsm/modules/command_monitor.sh +++ b/lgsm/modules/command_monitor.sh @@ -206,7 +206,7 @@ fn_monitor_check_session() { else fn_print_error "Checking session: " fn_print_fail_eol_nl - fn_script_log_fatal "Checking session: FAIL" + fn_script_log_fail "Checking session: FAIL" alert="restart" alert.sh fn_script_log_info "Checking session: Monitor is restarting ${selfname}" diff --git a/lgsm/modules/command_skeleton.sh b/lgsm/modules/command_skeleton.sh index 9e7c19a6a..48a6bd187 100644 --- a/lgsm/modules/command_skeleton.sh +++ b/lgsm/modules/command_skeleton.sh @@ -18,7 +18,7 @@ find "${rootdir}" -type d -not \( -path ./skel -prune \) | cpio -pdvm skel 2> /d exitcode=$? if [ "${exitcode}" != 0 ]; then fn_print_fail_nl "Creating skeleton directory" - fn_script_log_fatal "Creating skeleton directory" + fn_script_log_fail "Creating skeleton directory" else fn_print_ok_nl "Creating skeleton directory: ./skel" fn_script_log_pass "Creating skeleton directory: ./skel" diff --git a/lgsm/modules/command_sponsor.sh b/lgsm/modules/command_sponsor.sh index 336f20f0a..ea49a3099 100755 --- a/lgsm/modules/command_sponsor.sh +++ b/lgsm/modules/command_sponsor.sh @@ -12,7 +12,7 @@ fn_firstcommand_set fn_print_ascii_logo echo -e "${lightyellow}Support LinuxGSM${default}" -echo -e "=================================" +fn_messages_separator echo -e "" echo -e "Been using LinuxGSM?" echo -e "Consider sponsoring to support development." diff --git a/lgsm/modules/command_start.sh b/lgsm/modules/command_start.sh index b2f46855d..4b45f0bc3 100644 --- a/lgsm/modules/command_start.sh +++ b/lgsm/modules/command_start.sh @@ -120,24 +120,24 @@ fn_start_tmux() { check_status.sh if [ "${status}" == "0" ]; then fn_print_fail_nl "Unable to start ${servername}" - fn_script_log_fatal "Unable to start ${servername}" + fn_script_log_fail "Unable to start ${servername}" if [ -s "${lgsmlogdir}/.${selfname}-tmux-error.tmp" ]; then fn_print_fail_nl "Unable to start ${servername}: tmux error:" - fn_script_log_fatal "Unable to start ${servername}: tmux error:" + fn_script_log_fail "Unable to start ${servername}: tmux error:" echo -e "" echo -e "Command" - echo -e "=================================" + fn_messages_separator echo -e "tmux -L \"${sessionname}\" new-session -d -s \"${sessionname}\" \"${preexecutable} ${executable} ${startparameters}\"" | tee -a "${lgsmlog}" echo -e "" echo -e "Error" - echo -e "=================================" + fn_messages_separator tee -a "${lgsmlog}" < "${lgsmlogdir}/.${selfname}-tmux-error.tmp" # Detected error https://linuxgsm.com/support if grep -c "Operation not permitted" "${lgsmlogdir}/.${selfname}-tmux-error.tmp"; then echo -e "" echo -e "Fix" - echo -e "=================================" + fn_messages_separator if ! grep "tty:" /etc/group | grep "$(whoami)"; then echo -e "$(whoami) is not part of the tty group." fn_script_log_info "$(whoami) is not part of the tty group." diff --git a/lgsm/modules/command_stop.sh b/lgsm/modules/command_stop.sh index 409e57b14..ee9152862 100644 --- a/lgsm/modules/command_stop.sh +++ b/lgsm/modules/command_stop.sh @@ -248,7 +248,7 @@ fn_stop_tmux() { fn_script_log_pass "Stopped ${servername}" else fn_print_fail_nl "Unable to stop ${servername}" - fn_script_log_fatal "Unable to stop ${servername}" + fn_script_log_fail "Unable to stop ${servername}" fi } diff --git a/lgsm/modules/command_update_linuxgsm.sh b/lgsm/modules/command_update_linuxgsm.sh index 3c4e6d080..65b72bcbb 100644 --- a/lgsm/modules/command_update_linuxgsm.sh +++ b/lgsm/modules/command_update_linuxgsm.sh @@ -24,7 +24,7 @@ if [ $? != "0" ]; then curl --connect-timeout 10 -IsfL "https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/linuxgsm.sh" 1> /dev/null if [ $? != "0" ]; then fn_print_fail_nl "Selecting repo: Unable to to access GitHub or Bitbucket repositories" - fn_script_log_fatal "Selecting repo: Unable to to access GitHub or Bitbucket repositories" + fn_script_log_fail "Selecting repo: Unable to to access GitHub or Bitbucket repositories" core_exit.sh else remotereponame="Bitbucket" @@ -44,8 +44,8 @@ else fi if [ $? != "0" ]; then fn_print_fail_eol_nl - fn_script_log_fatal "Checking ${remotereponame} linuxgsm.sh" - fn_script_log_fatal "Curl returned error: $?" + fn_script_log_fail "Checking ${remotereponame} linuxgsm.sh" + fn_script_log_fail "Curl returned error: $?" core_exit.sh fi @@ -82,7 +82,7 @@ if [ "${script_diff}" != "" ]; then cp "${rootdir}/${selfname}" "${backupdir}/script/${selfname}-$(date +"%m_%d_%Y_%M").bak" if [ $? != 0 ]; then fn_print_fail_eol_nl - fn_script_log_fatal "Backup ${selfname}" + fn_script_log_fail "Backup ${selfname}" core_exit.sh else fn_print_ok_eol_nl @@ -103,7 +103,7 @@ if [ "${script_diff}" != "" ]; then if [ $? != "0" ]; then fn_print_fail_eol_nl - fn_script_log_fatal "copying ${selfname}" + fn_script_log_fail "copying ${selfname}" core_exit.sh else fn_print_ok_eol_nl @@ -124,8 +124,8 @@ else fi if [ $? != "0" ]; then fn_print_fail_eol_nl - fn_script_log_fatal "Checking ${remotereponame} config _default.cfg" - fn_script_log_fatal "Curl returned error: $?" + fn_script_log_fail "Checking ${remotereponame} config _default.cfg" + fn_script_log_fail "Curl returned error: $?" core_exit.sh fi @@ -158,8 +158,8 @@ if [ -f "${datadir}/${distroid}-${distroversioncsv}.csv" ]; then fi if [ $? != "0" ]; then fn_print_fail_eol_nl - fn_script_log_fatal "Checking ${remotereponame} ${distroid}-${distroversioncsv}.csv" - fn_script_log_fatal "Curl returned error: $?" + fn_script_log_fail "Checking ${remotereponame} ${distroid}-${distroversioncsv}.csv" + fn_script_log_fail "Curl returned error: $?" core_exit.sh fi @@ -200,7 +200,7 @@ if [ -n "${modulesdir}" ]; then echo -en "removing module ${modulefile}...\c" if ! rm -f "${modulefile:?}"; then fn_print_fail_eol_nl - fn_script_log_fatal "Removing module ${modulefile}" + fn_script_log_fail "Removing module ${modulefile}" core_exit.sh else fn_print_ok_eol_nl diff --git a/lgsm/modules/core_dl.sh b/lgsm/modules/core_dl.sh index 2a6c7c400..3b2e7f117 100644 --- a/lgsm/modules/core_dl.sh +++ b/lgsm/modules/core_dl.sh @@ -93,27 +93,27 @@ fn_dl_steamcmd() { # Not enough space. if [ -n "$(grep "0x202" "${steamcmdlog}" | tail -1)" ]; then fn_print_failure_nl "${commandaction} ${selfname}: ${remotelocation}: Not enough disk space to download server files" - fn_script_log_fatal "${commandaction} ${selfname}: ${remotelocation}: Not enough disk space to download server files" + fn_script_log_fail "${commandaction} ${selfname}: ${remotelocation}: Not enough disk space to download server files" core_exit.sh # Not enough space. elif [ -n "$(grep "0x212" "${steamcmdlog}" | tail -1)" ]; then fn_print_failure_nl "${commandaction} ${selfname}: ${remotelocation}: Not enough disk space to download server files" - fn_script_log_fatal "${commandaction} ${selfname}: ${remotelocation}: Not enough disk space to download server files" + fn_script_log_fail "${commandaction} ${selfname}: ${remotelocation}: Not enough disk space to download server files" core_exit.sh # Need tp purchase game. elif [ -n "$(grep "No subscription" "${steamcmdlog}" | tail -1)" ]; then fn_print_failure_nl "${commandaction} ${selfname}: ${remotelocation}: Steam account does not have a license for the required game" - fn_script_log_fatal "${commandaction} ${selfname}: ${remotelocation}: Steam account does not have a license for the required game" + fn_script_log_fail "${commandaction} ${selfname}: ${remotelocation}: Steam account does not have a license for the required game" core_exit.sh # Two-factor authentication failure elif [ -n "$(grep "Two-factor code mismatch" "${steamcmdlog}" | tail -1)" ]; then fn_print_failure_nl "${commandaction} ${selfname}: ${remotelocation}: Two-factor authentication failure" - fn_script_log_fatal "${commandaction} ${selfname}: ${remotelocation}: Two-factor authentication failure" + fn_script_log_fail "${commandaction} ${selfname}: ${remotelocation}: Two-factor authentication failure" core_exit.sh # Incorrect Branch password elif [ -n "$(grep "Password check for AppId" "${steamcmdlog}" | tail -1)" ]; then fn_print_failure_nl "${commandaction} ${selfname}: ${remotelocation}: betapassword is incorrect" - fn_script_log_fatal "${commandaction} ${selfname}: ${remotelocation}: betapassword is incorrect" + fn_script_log_fail "${commandaction} ${selfname}: ${remotelocation}: betapassword is incorrect" core_exit.sh # Update did not finish. elif [ -n "$(grep "0x402" "${steamcmdlog}" | tail -1)" ] || [ -n "$(grep "0x602" "${steamcmdlog}" | tail -1)" ]; then @@ -142,7 +142,7 @@ fn_dl_steamcmd() { if [ "${counter}" -gt "10" ]; then fn_print_failure_nl "${commandaction} ${selfname}: ${remotelocation}: Did not complete the download, too many retrys" - fn_script_log_fatal "${commandaction} ${selfname}: ${remotelocation}: Did not complete the download, too many retrys" + fn_script_log_fail "${commandaction} ${selfname}: ${remotelocation}: Did not complete the download, too many retrys" core_exit.sh fi done @@ -195,7 +195,7 @@ fn_dl_hash() { fn_print_fail_eol_nl echo -e "${local_filename} returned ${hashtype} checksum: ${hashsumcmd}" echo -e "expected ${hashtype} checksum: ${hash}" - fn_script_log_fatal "Verifying ${local_filename} with ${hashtype}" + fn_script_log_fail "Verifying ${local_filename} with ${hashtype}" fn_script_log_info "${local_filename} returned ${hashtype} checksum: ${hashsumcmd}" fn_script_log_info "Expected ${hashtype} checksum: ${hash}" core_exit.sh @@ -226,8 +226,8 @@ fn_dl_extract() { if [ ! -f "${local_filedir}/${local_filename}" ]; then fn_print_fail_eol_nl echo -en "file ${local_filedir}/${local_filename} not found" - fn_script_log_fatal "Extracting ${local_filename}" - fn_script_log_fatal "File ${local_filedir}/${local_filename} not found" + fn_script_log_fail "Extracting ${local_filename}" + fn_script_log_fail "File ${local_filedir}/${local_filename} not found" core_exit.sh fi mime=$(file -b --mime-type "${local_filedir}/${local_filename}") @@ -259,7 +259,7 @@ fn_dl_extract() { local exitcode=$? if [ "${exitcode}" != 0 ]; then fn_print_fail_eol_nl - fn_script_log_fatal "Extracting ${local_filename}" + fn_script_log_fail "Extracting ${local_filename}" if [ -f "${lgsmlog}" ]; then echo -e "${extractcmd}" >> "${lgsmlog}" fi @@ -277,7 +277,6 @@ fn_fetch_trap() { echo -en "downloading ${local_filename}..." fn_print_canceled_eol_nl fn_script_log_info "Downloading ${local_filename}...CANCELED" - fn_sleep_time rm -f "${local_filedir:?}/${local_filename}" echo -en "downloading ${local_filename}..." fn_print_removed_eol_nl @@ -320,8 +319,8 @@ fn_check_file() { if [ ${counter} -ge 2 ]; then fn_print_fail_eol_nl if [ -f "${lgsmlog}" ]; then - fn_script_log_fatal "Checking ${remote_filename}" - fn_script_log_fatal "${fileurl}" + fn_script_log_fail "Checking ${remote_filename}" + fn_script_log_fail "${fileurl}" checkflag=1 fi else @@ -421,8 +420,8 @@ fn_fetch_file() { if [ ${counter} -ge 2 ]; then fn_print_fail_eol_nl if [ -f "${lgsmlog}" ]; then - fn_script_log_fatal "Downloading ${local_filename}..." - fn_script_log_fatal "${fileurl}" + fn_script_log_fail "Downloading ${local_filename}..." + fn_script_log_fail "${fileurl}" fi core_exit.sh else @@ -617,7 +616,7 @@ fn_dl_latest_release_github() { # Check how many releases we got from the api and exit if we have more then one. if [ "$(echo -e "${githubreleaseassets}" | jq '. | length')" -gt 1 ]; then fn_print_fatal_nl "Found more than one release to download - Please report this to the LinuxGSM issue tracker" - fn_script_log_fatal "Found more than one release to download - Please report this to the LinuxGSM issue tracker" + fn_script_log_fail "Found more than one release to download - Please report this to the LinuxGSM issue tracker" else # Set variables for download via fn_fetch_file. githubreleasefilename=$(echo -e "${githubreleaseassets}" | jq -r '.[]name') @@ -626,7 +625,7 @@ fn_dl_latest_release_github() { # Error if no version is there. if [ -z "${githubreleasefilename}" ]; then fn_print_fail_nl "Cannot get version from GitHub API for ${githubreleaseuser}/${githubreleaserepo}" - fn_script_log_fatal "Cannot get version from GitHub API for ${githubreleaseuser}/${githubreleaserepo}" + fn_script_log_fail "Cannot get version from GitHub API for ${githubreleaseuser}/${githubreleaserepo}" else # Fetch file from the remote location from the existing module to the ${tmpdir} for now. fn_fetch_file "${githubreleasedownloadlink}" "" "${githubreleasefilename}" "" "${githubreleasedownloadpath}" "${githubreleasefilename}" diff --git a/lgsm/modules/core_exit.sh b/lgsm/modules/core_exit.sh index 6947a3d4a..496cde422 100644 --- a/lgsm/modules/core_exit.sh +++ b/lgsm/modules/core_exit.sh @@ -29,7 +29,7 @@ elif [ "${exitcode}" != "0" ]; then # List LinuxGSM version in logs fn_script_log_info "LinuxGSM version: ${version}" if [ "${exitcode}" == "1" ]; then - fn_script_log_fatal "${moduleselfname} exiting with code: ${exitcode}" + fn_script_log_fail "${moduleselfname} exiting with code: ${exitcode}" elif [ "${exitcode}" == "2" ]; then fn_script_log_error "${moduleselfname} exiting with code: ${exitcode}" elif [ "${exitcode}" == "3" ]; then diff --git a/lgsm/modules/core_github.sh b/lgsm/modules/core_github.sh index 228fe1078..7290f9bdf 100644 --- a/lgsm/modules/core_github.sh +++ b/lgsm/modules/core_github.sh @@ -28,7 +28,7 @@ fn_github_get_latest_release_version() { # error if no version is there if [ -z "${githubreleaseversion}" ]; then fn_print_fail_nl "Cannot get version from GitHub API for ${githubreleaseuser}/${githubreleaserepo}" - fn_script_log_fatal "Cannot get version from GitHub API for ${githubreleaseuser}/${githubreleaserepo}" + fn_script_log_fail "Cannot get version from GitHub API for ${githubreleaseuser}/${githubreleaserepo}" fi } @@ -46,7 +46,7 @@ fn_github_set_latest_release_version() { # error if no version is there if [ -z "${githubreleaseversion}" ]; then fn_print_fail_nl "Cannot get version from GitHub API for ${githubreleaseuser}/${githubreleaserepo}" - fn_script_log_fatal "Cannot get version from GitHub API for ${githubreleaseuser}/${githubreleaserepo}" + fn_script_log_fail "Cannot get version from GitHub API for ${githubreleaseuser}/${githubreleaserepo}" else echo "${githubreleaseversion}" > "${githublocalversionfile}" fi @@ -81,7 +81,7 @@ fn_github_compare_version() { # error if no version is there if [ -z "${githubreleaseversion}" ]; then fn_print_fail_nl "Can not get version from Github Api for ${githubreleaseuser}/${githubreleaserepo}" - fn_script_log_fatal "Can not get version from Github Api for ${githubreleaseuser}/${githubreleaserepo}" + fn_script_log_fail "Can not get version from Github Api for ${githubreleaseuser}/${githubreleaserepo}" else if [ "${githublocalversion}" == "${githubreleaseversion}" ]; then echo -en "\n" diff --git a/lgsm/modules/core_logs.sh b/lgsm/modules/core_logs.sh index 8057f30f7..3166041ae 100644 --- a/lgsm/modules/core_logs.sh +++ b/lgsm/modules/core_logs.sh @@ -46,7 +46,6 @@ if [ "$(find "${lgsmlogdir}"/ -type f -mtime +"${logdays}" | wc -l)" -ne "0" ]; ulxcount="0" darkrpcount="0" legacycount="0" - fn_sleep_time fn_print_info "Removing logs older than ${logdays} days" fn_script_log_info "Removing logs older than ${logdays} days" # Logging logfiles to be removed according to "${logdays}", counting and removing them. diff --git a/lgsm/modules/core_messages.sh b/lgsm/modules/core_messages.sh index 6d3ca9a25..5af4c5639 100644 --- a/lgsm/modules/core_messages.sh +++ b/lgsm/modules/core_messages.sh @@ -70,7 +70,7 @@ fn_script_log_pass() { } ## Feb 28 14:56:58 ut99-server: Monitor: FATAL: -fn_script_log_fatal() { +fn_script_log_fail() { if [ -d "${lgsmlogdir}" ]; then if [ -n "${commandname}" ]; then echo -e "$(date '+%b %d %H:%M:%S.%3N') ${selfname}: ${commandname}: FATAL: ${1}" >> "${lgsmlog}" @@ -273,12 +273,22 @@ fn_print_start_nl() { # On-Screen - Interactive messages ################################## +# Separator is different for details. +fn_messages_separator() { + if [ "${commandname}" == "DETAILS" ]; then + printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' = + else + echo -e "${bold}=================================${default}" + fn_sleep_time + fi +} + # No More Room in Hell Debug # ================================= fn_print_header() { echo -e "" - echo -e "${lightyellow}${gamename} ${commandaction}${default}" - echo -e "=================================${default}" + echo -e "${bold}${lightyellow}${gamename} ${commandaction}${default}" + fn_messages_separator } # Complete! diff --git a/lgsm/modules/core_steamcmd.sh b/lgsm/modules/core_steamcmd.sh index 6a7b25c11..e628e44b9 100644 --- a/lgsm/modules/core_steamcmd.sh +++ b/lgsm/modules/core_steamcmd.sh @@ -25,7 +25,7 @@ fn_check_steamcmd_user() { fn_print_fail_nl "Steam login not set. Update steamuser in ${configdirserver}" echo -e " * Change steamuser=\"username\" to a valid steam login." if [ -d "${lgsmlogdir}" ]; then - fn_script_log_fatal "Steam login not set. Update steamuser in ${configdirserver}" + fn_script_log_fail "Steam login not set. Update steamuser in ${configdirserver}" fi core_exit.sh fi @@ -129,7 +129,7 @@ fn_check_steamcmd_clear() { rm -rf "${steamcmddir:?}" exitcode=$? if [ "${exitcode}" != 0 ]; then - fn_script_log_fatal "Removing ${rootdir}/steamcmd" + fn_script_log_fail "Removing ${rootdir}/steamcmd" else fn_script_log_pass "Removing ${rootdir}/steamcmd" fi @@ -154,7 +154,7 @@ fn_update_steamcmd_localbuild() { # Checks if localbuild variable has been set. if [ -z "${localbuild}" ]; then fn_print_fail "Checking local build: ${remotelocation}: missing local build info" - fn_script_log_fatal "Missing local build info" + fn_script_log_fail "Missing local build info" core_exit.sh else fn_print_ok "Checking local build: ${remotelocation}" @@ -188,7 +188,7 @@ fn_update_steamcmd_remotebuild() { # Checks if remotebuildversion variable has been set. if [ -z "${remotebuildversion}" ] || [ "${remotebuildversion}" == "null" ]; then fn_print_fail "Checking remote build: ${remotelocation}" - fn_script_log_fatal "Checking remote build" + fn_script_log_fail "Checking remote build" core_exit.sh else fn_print_ok "Checking remote build: ${remotelocation}" @@ -198,7 +198,7 @@ fn_update_steamcmd_remotebuild() { # Checks if remotebuild variable has been set. if [ -z "${remotebuildversion}" ] || [ "${remotebuildversion}" == "null" ]; then fn_print_failure "Unable to get remote build" - fn_script_log_fatal "Unable to get remote build" + fn_script_log_fail "Unable to get remote build" core_exit.sh fi fi @@ -305,7 +305,7 @@ fn_check_steamcmd_appmanifest() { # if error can not be resolved. if [ "${appmanifestfilewc}" -ge "2" ]; then fn_print_fail "Unable to remove x${appmanifestfilewc} appmanifest_${appid}.acf files" - fn_script_log_fatal "Unable to remove x${appmanifestfilewc} appmanifest_${appid}.acf files" + fn_script_log_fail "Unable to remove x${appmanifestfilewc} appmanifest_${appid}.acf files" echo -e "* Check user permissions" for appfile in ${appmanifestfile}; do echo -e " ${appfile}" @@ -327,7 +327,7 @@ fn_check_steamcmd_appmanifest() { fn_appmanifest_info if [ "${appmanifestfilewc}" -eq "0" ]; then fn_print_fail_nl "Still no appmanifest_${appid}.acf found" - fn_script_log_fatal "Still no appmanifest_${appid}.acf found" + fn_script_log_fail "Still no appmanifest_${appid}.acf found" core_exit.sh fi fi diff --git a/lgsm/modules/fix.sh b/lgsm/modules/fix.sh index a7f5f7378..9a4f5b779 100644 --- a/lgsm/modules/fix.sh +++ b/lgsm/modules/fix.sh @@ -80,8 +80,7 @@ if [ "${commandname}" == "INSTALL" ]; then if grep -qEe "(^|\s)${shortname}(\s|$)" <<< "${apply_post_install_fix[@]}"; then echo -e "" echo -e "${lightyellow}Applying Post-Install Fixes${default}" - echo -e "=================================" - fn_sleep_time + fn_messages_separator postinstall=1 fn_apply_fix "post install" "${shortname}" fi diff --git a/lgsm/modules/fix_av.sh b/lgsm/modules/fix_av.sh index fbb259900..bfff59af6 100644 --- a/lgsm/modules/fix_av.sh +++ b/lgsm/modules/fix_av.sh @@ -13,7 +13,6 @@ export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${serverfiles}:${serverfiles}/linux64" if [ ! -f "${servercfgfullpath}" ]; then startparameters="--datapath ${avdatapath} --galaxy-name ${selfname} --init-folders-only" fn_print_information "starting ${gamename} server to generate configs." - fn_sleep_time cd "${systemdir}" || exit eval "${executable} ${startparameters}" fi diff --git a/lgsm/modules/fix_kf2.sh b/lgsm/modules/fix_kf2.sh index 46850bd64..13176d448 100644 --- a/lgsm/modules/fix_kf2.sh +++ b/lgsm/modules/fix_kf2.sh @@ -10,7 +10,6 @@ moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" startparameters="\"${defaultmap}?Game=KFGameContent.KFGameInfo_VersusSurvival\"" fn_print_information "starting ${gamename} server to generate configs." -fn_sleep_time exitbypass=1 command_start.sh fn_firstcommand_reset diff --git a/lgsm/modules/fix_lo.sh b/lgsm/modules/fix_lo.sh index 4c3758b01..4966afd57 100644 --- a/lgsm/modules/fix_lo.sh +++ b/lgsm/modules/fix_lo.sh @@ -9,9 +9,7 @@ moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" appidfile=${executabledir}/steam_appid.txt if [ ! -f "${appidfile}" ]; then fn_print_information "adding ${appidfile} to ${gamename} server." - fn_sleep_time echo "903950" > "${appidfile}" else fn_print_information "${appidfile} already exists. No action to be taken." - fn_sleep_time fi diff --git a/lgsm/modules/fix_mta.sh b/lgsm/modules/fix_mta.sh index 65488f2a1..4e533eb51 100644 --- a/lgsm/modules/fix_mta.sh +++ b/lgsm/modules/fix_mta.sh @@ -10,7 +10,6 @@ moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" if [ ! -f "${lgsmdir}/lib/libmysqlclient.so.16" ]; then fixname="libmysqlclient16" fn_fix_msg_start_nl - fn_sleep_time fn_fetch_file "https://nightly.mtasa.com/files/modules/64/libmysqlclient.so.16" "" "" "" "${lgsmdir}/lib" "libmysqlclient.so.16" "chmodx" "norun" "noforce" "6c188e0f8fb5d7a29f4bc413b9fed6c2" fn_fix_msg_end fi diff --git a/lgsm/modules/fix_samp.sh b/lgsm/modules/fix_samp.sh index 461d92aee..24882f915 100644 --- a/lgsm/modules/fix_samp.sh +++ b/lgsm/modules/fix_samp.sh @@ -16,8 +16,8 @@ if [ -f "${servercfgfullpath}" ]; then fixname="change default rcon password" fn_fix_msg_start fn_script_log_info "changing rcon/admin password." - random=$(tr -dc A-Za-z0-9_ < /dev/urandom | head -c 8 | xargs) - rconpass="admin${random}" + randomstring=$(tr -dc 'A-Za-z0-9_' < /dev/urandom 2> /dev/null | head -c 8 | xargs) + rconpass="admin${randomstring}" sed -i "s/rcon_password changeme/rcon_password ${rconpass}/g" "${servercfgfullpath}" fn_fix_msg_end fi diff --git a/lgsm/modules/fix_ts3.sh b/lgsm/modules/fix_ts3.sh index c655a4322..5c80aa15e 100644 --- a/lgsm/modules/fix_ts3.sh +++ b/lgsm/modules/fix_ts3.sh @@ -40,7 +40,7 @@ if [ -f "${accountingfile}" ] && [ "${status}" == "0" ]; then # file is not owned by the current user and needs to be deleted manually. else fn_print_error_nl "File ${accountingfile} is not owned by $(whoami) and needs to be deleted manually" - fn_script_log_fatal "File ${accountingfile} is not owned by $(whoami) and needs to be deleted manually" + fn_script_log_fail "File ${accountingfile} is not owned by $(whoami) and needs to be deleted manually" core_exit.sh fi fi diff --git a/lgsm/modules/fix_ut3.sh b/lgsm/modules/fix_ut3.sh index 97326c786..d725de4a2 100644 --- a/lgsm/modules/fix_ut3.sh +++ b/lgsm/modules/fix_ut3.sh @@ -10,7 +10,6 @@ moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" startparameters="server VCTF-Suspense?Game=UTGameContent.UTVehicleCTFGame_Content?bIsDedicated=true?bIsLanMatch=false?bUsesStats=false?bShouldAdvertise=false?PureServer=1?bAllowJoinInProgress=true?ConfigSubDir=${selfname} -port=${port} -queryport=${queryport} -multihome=${ip} -nohomedir -unattended -log=${gamelog}" fn_print_information "starting ${gamename} server to generate configs." -fn_sleep_time exitbypass=1 command_start.sh fn_firstcommand_reset diff --git a/lgsm/modules/info_messages.sh b/lgsm/modules/info_messages.sh index a05da414f..340e11f6b 100644 --- a/lgsm/modules/info_messages.sh +++ b/lgsm/modules/info_messages.sh @@ -7,15 +7,6 @@ moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" -# Separator is different for details. -fn_messages_separator() { - if [ "${commandname}" == "DETAILS" ]; then - printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' = - else - echo -e "=================================" - fi -} - # Removes the passwords form all but details. fn_info_message_password_strip() { if [ "${commandname}" != "DETAILS" ]; then @@ -57,7 +48,7 @@ fn_info_message_password_strip() { # used with alertlog fn_info_message_head() { echo -e "" - echo -e "${lightyellow}Alert Summary${default}" + echo -e "${bold}${lightyellow}Alert Summary${default}" fn_messages_separator echo -e "Message" echo -e "${alertbody}" @@ -89,7 +80,7 @@ fn_info_message_distro() { # glibc: 2.31 echo -e "" - echo -e "${lightyellow}Distro Details${default}" + echo -e "${bold}${lightyellow}Distro Details${default}" fn_messages_separator { echo -e "${lightblue}Date:\t${default}$(date)" @@ -132,7 +123,7 @@ fn_info_message_server_resource() { # Internet IP: 176.58.124.96 echo -e "" - echo -e "${lightyellow}Server Resource${default}" + echo -e "${bold}${lightyellow}Server Resource${default}" fn_messages_separator { echo -e "${lightyellow}CPU\t${default}" @@ -185,7 +176,7 @@ fn_info_message_gameserver_resource() { # Backups: 24K echo -e "" - echo -e "${lightyellow}Game Server Resource Usage${default}" + echo -e "${bold}${lightgreen}${gamename} Resource Usage${default}" fn_messages_separator { if [ "${status}" != "0" ] && [ -v status ]; then @@ -234,7 +225,7 @@ fn_info_message_gameserver() { # Status: STARTED echo -e "" - echo -e "${lightgreen}${gamename} Server Details${default}" + echo -e "${bold}${lightgreen}${gamename} Server Details${default}" fn_info_message_password_strip fn_messages_separator { @@ -526,7 +517,7 @@ fn_info_message_script() { # Location: /home/lgsm/csgoserver # Config file: /home/lgsm/csgoserver/serverfiles/csgo/cfg/csgoserver.cfg - echo -e "${lightgreen}${selfname} Script Details${default}" + echo -e "${bold}${lightgreen}${selfname} Script Details${default}" fn_messages_separator { # Script name @@ -618,7 +609,7 @@ fn_info_message_backup() { # size: 945M echo -e "" - echo -e "${lightgreen}Backups${default}" + echo -e "${bold}${lightgreen}Backups${default}" fn_messages_separator if [ ! -d "${backupdir}" ] || [ "${backupcount}" == "0" ]; then echo -e "No Backups created" @@ -646,7 +637,7 @@ fn_info_message_commandlineparms() { # ./run_server_x86.sh +set net_strict 1 echo -e "" - echo -e "${lightgreen}Command-line Parameters${default}" + echo -e "${bold}${lightgreen}Command-line Parameters${default}" fn_info_message_password_strip fn_messages_separator if [ "${serverpassword}" == "NOT SET" ]; then @@ -663,7 +654,7 @@ fn_info_message_ports_edit() { # Change ports by editing the parameters in: # /home/lgsm/qlserver/serverfiles/baseq3/ql-server.cfg echo -e "" - echo -e "${lightgreen}Ports${default}" + echo -e "${bold}${lightgreen}Ports${default}" fn_messages_separator echo -e "${lightblue}Change ports by editing the parameters in:${default}" @@ -726,8 +717,8 @@ fn_info_message_statusbottom() { fn_info_logs() { echo -e "" - echo -e "${selfname} Logs" - echo -e "=================================" + echo -e "${bold}${selfname} Logs" + fn_messages_separator if [ -n "${lgsmlog}" ]; then echo -e "\nScript log\n===================" @@ -1111,7 +1102,7 @@ fn_info_message_kf() { fn_port "Steam" steamport udp } | column -s $'\t' -t echo -e "" - echo -e "${lightgreen}${servername} Web Interface${default}" + echo -e "${bold}${lightgreen}${servername} Web Interface${default}" fn_messages_separator { echo -e "${lightblue}Web Interface enabled:\t${default}${httpenabled}" @@ -1130,7 +1121,7 @@ fn_info_message_kf2() { fn_port "Web Interface" httpport tcp } | column -s $'\t' -t echo -e "" - echo -e "${lightgreen}${servername} Web Interface${default}" + echo -e "${bold}${lightgreen}${servername} Web Interface${default}" fn_messages_separator { echo -e "${lightblue}Web Interface enabled:\t${default}${httpenabled}" @@ -1235,7 +1226,7 @@ fn_info_message_pc() { fn_port "API" apiport tcp } | column -s $'\t' -t echo -e "" - echo -e "${lightgreen}${gamename} Web Interface${default}" + echo -e "${bold}${lightgreen}${gamename} Web Interface${default}" fn_messages_separator { echo -e "${lightblue}Web Interface enabled:\t${default}${httpenabled}" @@ -1321,7 +1312,7 @@ fn_info_message_ro() { fn_port "Steam" steamport udp } | column -s $'\t' -t echo -e "" - echo -e "${lightgreen}${servername} Web Interface${default}" + echo -e "${bold}${lightgreen}${servername} Web Interface${default}" fn_messages_separator { echo -e "${lightblue}Web Interface enabled:\t${default}${httpenabled}" @@ -1400,7 +1391,7 @@ fn_info_message_sdtd() { fn_port "Telnet" telnetport tcp } | column -s $'\t' -t echo -e "" - echo -e "${lightgreen}${gamename} Web Interface${default}" + echo -e "${bold}${lightgreen}${gamename} Web Interface${default}" fn_messages_separator { echo -e "${lightblue}Web Interface enabled:\t${default}${httpenabled}" @@ -1408,7 +1399,7 @@ fn_info_message_sdtd() { echo -e "${lightblue}Web Interface password:\t${default}${httppassword}" } | column -s $'\t' -t echo -e "" - echo -e "${lightgreen}${gamename} Telnet${default}" + echo -e "${bold}${lightgreen}${gamename} Telnet${default}" fn_messages_separator { echo -e "${lightblue}Telnet enabled:\t${default}${telnetenabled}" @@ -1475,7 +1466,7 @@ fn_info_message_spark() { fn_port "Web Interface" httpport tcp } | column -s $'\t' -t echo -e "" - echo -e "${lightgreen}${gamename} Web Interface${default}" + echo -e "${bold}${lightgreen}${gamename} Web Interface${default}" fn_messages_separator { echo -e "${lightblue}Web Interface url:\t${default}http://${httpip}:${httpport}/index.html" @@ -1558,7 +1549,7 @@ fn_info_message_ut2k4() { fn_port "LAN" lanport udp } | column -s $'\t' -t echo -e "" - echo -e "${lightgreen}${servername} Web Interface${default}" + echo -e "${bold}${lightgreen}${gamename} Web Interface${default}" fn_messages_separator { echo -e "${lightblue}Web Interface enabled:\t${default}${httpenabled}" @@ -1577,7 +1568,7 @@ fn_info_message_unreal() { fn_port "Web Interface" httpport tcp } | column -s $'\t' -t echo -e "" - echo -e "${lightgreen}${servername} Web Interface${default}" + echo -e "${bold}${lightgreen}${gamename} Web Interface${default}" fn_messages_separator { echo -e "${lightblue}Web Interface enabled:\t${default}${httpenabled}" @@ -1613,7 +1604,7 @@ fn_info_message_ut3() { fn_port "Web Interface" httpport tcp } | column -s $'\t' -t echo -e "" - echo -e "${lightgreen}${servername} Web Interface${default}" + echo -e "${bold}${lightgreen}${gamename} Web Interface${default}" fn_messages_separator { echo -e "${lightblue}Web Interface enabled:\t${default}${httpenabled}" diff --git a/lgsm/modules/install_complete.sh b/lgsm/modules/install_complete.sh index 013ba7334..2c3cb2493 100644 --- a/lgsm/modules/install_complete.sh +++ b/lgsm/modules/install_complete.sh @@ -8,19 +8,19 @@ moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" echo -e "" -echo -e "=================================" +fn_messages_separator if [ "${exitcode}" == "1" ]; then - echo -e "Install Failed!" + echo -e "${bold}${red}Install Failed!${default}" fn_script_log_fatal "Install Failed!" elif [ "${exitcode}" == "2" ]; then - echo -e "Install Completed with Errors!" + echo -e "${bold}${red}Install Completed with Errors!${default}}" fn_script_log_error "Install Completed with Errors!" elif [ "${exitcode}" == "3" ]; then - echo -e "Install Completed with Warnings!" + echo -e "${bold}${lightyellow}Install Completed with Warnings!${default}}" fn_script_log_warn "Install Completed with Warnings!" elif [ -z "${exitcode}" ] || [ "${exitcode}" == "0" ]; then - echo -e "Install Complete!" + echo -e "${bold}${green}Install Complete!${default}" fn_script_log_pass "Install Complete!" fi diff --git a/lgsm/modules/install_config.sh b/lgsm/modules/install_config.sh index 54f819aaf..1e3c243ab 100644 --- a/lgsm/modules/install_config.sh +++ b/lgsm/modules/install_config.sh @@ -19,9 +19,12 @@ fn_check_cfgdir() { # Downloads default configs from Game-Server-Configs repo to lgsm/config-default. fn_fetch_default_config() { echo -e "" - echo -e "${lightyellow}Downloading ${gamename} Configs${default}" - echo -e "=================================" - echo -e "default configs from https://github.com/GameServerManagers/Game-Server-Configs" + echo -e "${bold}${lightyellow}Downloading ${gamename} Configs${default}" + fn_messages_separator + echo -e "Downloading default configs from:" + echo -e "" + echo -e "${italic}https://github.com/GameServerManagers/Game-Server-Configs${default}" + echo -e "" fn_sleep_time mkdir -p "${lgsmdir}/config-default/config-game" githuburl="https://raw.githubusercontent.com/GameServerManagers/Game-Server-Configs/main" @@ -54,9 +57,20 @@ fn_default_config_remote() { # Copys local default config to server config location. fn_default_config_local() { - echo -e "copying ${servercfgdefault} config file." - cp -nv "${servercfgdir}/${servercfgdefault}" "${servercfgfullpath}" - fn_sleep_time + echo -e "" + echo -e "${bold}${lightyellow}Copying ${gamename} Configs${default}" + fn_messages_separator + echo -e "Copying default configs." + fn_check_cfgdir + echo -en "copying config file [ ${italic}${servercfgdefault}${default} ]" + cp -n "${servercfgdir}/${servercfgdefault}" "${servercfgfullpath}" + if [ "${exitcode}" != 0 ]; then + fn_print_fail_eol + fn_script_log_fatal "copying config file [ ${servercfgdefault} ]" + else + fn_print_ok_eol + fn_script_log_pass "copying config file [ ${servercfgdefault} ]" + fi } # Changes some variables within the default configs. @@ -64,9 +78,9 @@ fn_default_config_local() { # PASSWORD to random password fn_set_config_vars() { if [ -f "${servercfgfullpath}" ]; then - random=$(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) servername="LinuxGSM" - rconpass="admin${random}" + rconpass="admin${randomstring}" echo -e "changing hostname." fn_script_log_info "changing hostname." fn_sleep_time @@ -107,8 +121,8 @@ fn_set_dst_config_vars() { fn_sleep_time echo -e "randomizing cluster key." fn_script_log_info "randomizing cluster key." - randomkey=$(tr -dc A-Za-z0-9_ < /dev/urandom | head -c 8 | xargs) - sed -i "s/CLUSTERKEY/${randomkey}/g" "${clustercfgfullpath}" + randomstring=$(tr -dc 'A-Za-z0-9_' < /dev/urandom 2> /dev/null | head -c 8 | xargs) + sed -i "s/CLUSTERKEY/${randomstring}/g" "${clustercfgfullpath}" fn_sleep_time else echo -e "${clustercfg} is already configured." @@ -146,8 +160,8 @@ fn_set_dst_config_vars() { # Lists local config file locations fn_list_config_locations() { echo -e "" - echo -e "${lightyellow}Config File Locations${default}" - echo -e "=================================" + echo -e "${bold}${lightyellow}Config Locations${default}" + fn_messages_separator if [ -n "${servercfgfullpath}" ]; then if [ -f "${servercfgfullpath}" ]; then echo -e "Game Server Config File: ${servercfgfullpath}" diff --git a/lgsm/modules/install_dst_token.sh b/lgsm/modules/install_dst_token.sh index 43db58fab..89ec00a90 100644 --- a/lgsm/modules/install_dst_token.sh +++ b/lgsm/modules/install_dst_token.sh @@ -8,9 +8,8 @@ moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" echo -e "" -echo -e "${lightyellow}Enter ${gamename} Cluster Token${default}" -echo -e "=================================" -fn_sleep_time +echo -e "${bold}${lightyellow}Enter ${gamename} Cluster Token${default}" +fn_messages_separator echo -e "A cluster token is required to run this server!" echo -e "Follow the instructions in this link to obtain this key:" echo -e "https://linuxgsm.com/dst-auth-token" diff --git a/lgsm/modules/install_eula.sh b/lgsm/modules/install_eula.sh index d70ca7d31..7f0229bfa 100644 --- a/lgsm/modules/install_eula.sh +++ b/lgsm/modules/install_eula.sh @@ -16,9 +16,8 @@ elif [ "${shortname}" == "ut" ]; then fi echo -e "" -echo -e "${lightyellow}Accept ${gamename} EULA${default}" -echo -e "=================================" -fn_sleep_time +echo -e "${bold}${lightyellow}Accept ${gamename} EULA${default}" +fn_messages_separator echo -e "You are required to accept the EULA:" echo -e "${eulaurl}" echo -e "" diff --git a/lgsm/modules/install_factorio_save.sh b/lgsm/modules/install_factorio_save.sh index c86ee2f37..589a9d8ed 100644 --- a/lgsm/modules/install_factorio_save.sh +++ b/lgsm/modules/install_factorio_save.sh @@ -8,8 +8,7 @@ moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" echo -e "" -echo -e "${lightyellow}Creating initial Factorio savefile${default}" -echo -e "=================================" -fn_sleep_time +echo -e "${bold}${lightyellow}Creating initial Factorio savefile${default}" +fn_messages_separator check_glibc.sh "${executabledir}"/factorio --create "${serverfiles}/save1" diff --git a/lgsm/modules/install_gslt.sh b/lgsm/modules/install_gslt.sh index e2224276f..772885d64 100644 --- a/lgsm/modules/install_gslt.sh +++ b/lgsm/modules/install_gslt.sh @@ -8,8 +8,8 @@ moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" echo -e "" -echo -e "${lightyellow}Game Server Login Token${default}" -echo -e "=================================" +echo -e "${bold}${lightyellow}Game Server Login Token${default}" +fn_messages_separator fn_sleep_time if [ "${shortname}" == "csgo" ] || [ "${shortname}" == "css" ] || [ "${shortname}" == "nmrih" ] || [ "${shortname}" == "bs" ]; then echo -e "GSLT is required to run a public ${gamename} server" diff --git a/lgsm/modules/install_header.sh b/lgsm/modules/install_header.sh index b52e116e7..a7f1f9ddb 100644 --- a/lgsm/modules/install_header.sh +++ b/lgsm/modules/install_header.sh @@ -9,14 +9,12 @@ moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" clear fn_print_ascii_logo -fn_sleep_time -echo -e "=================================" -echo -e "${lightyellow}Linux${default}GSM_" -echo -e "by Daniel Gibbs" +fn_messages_separator +echo -e "${bold}${lightyellow}Linux${default}${bold}GSM_${default}" +echo -e "${italic}by Daniel Gibbs${default}" echo -e "${lightblue}Version:${default} ${version}" echo -e "${lightblue}Game:${default} ${gamename}" echo -e "${lightblue}Website:${default} https://linuxgsm.com" echo -e "${lightblue}Contributors:${default} https://linuxgsm.com/contrib" echo -e "${lightblue}Sponsor:${default} https://linuxgsm.com/sponsor" -echo -e "=================================" -fn_sleep_time +fn_messages_separator diff --git a/lgsm/modules/install_logs.sh b/lgsm/modules/install_logs.sh index cd26addd3..5b12dd3e1 100644 --- a/lgsm/modules/install_logs.sh +++ b/lgsm/modules/install_logs.sh @@ -9,8 +9,9 @@ moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" if [ "${checklogs}" != "1" ]; then echo -e "" - echo -e "${lightyellow}Creating log directories${default}" - echo -e "=================================" + echo -e "${bold}${lightyellow}Creating Log Directories${default}" + fn_messages_separator + fn_sleep_time fi fn_sleep_time # Create LinuxGSM logs. diff --git a/lgsm/modules/install_server_dir.sh b/lgsm/modules/install_server_dir.sh index 08e83dce6..0136e52fc 100644 --- a/lgsm/modules/install_server_dir.sh +++ b/lgsm/modules/install_server_dir.sh @@ -8,8 +8,8 @@ moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" echo -e "" -echo -e "${lightyellow}Server Directory${default}" -echo -e "=================================" +echo -e "${bold}${lightyellow}Server Directory${default}" +fn_messages_separator fn_sleep_time if [ -d "${serverfiles}" ]; then fn_print_warning_nl "A server is already installed here." diff --git a/lgsm/modules/install_server_files.sh b/lgsm/modules/install_server_files.sh index 70eb808b0..2763f470b 100644 --- a/lgsm/modules/install_server_files.sh +++ b/lgsm/modules/install_server_files.sh @@ -199,16 +199,15 @@ fn_install_server_files() { md5="0188ae86dbc9376f11ae3032dba2d665" else fn_print_fail_nl "Installing ${gamename} Server failed, missing default configuration" - fn_script_log_fatal "Installing ${gamename} Server failed, missing default configuration" + fn_script_log_fail "Installing ${gamename} Server failed, missing default configuration" fi fn_fetch_file "${remote_fileurl}" "" "" "" "${local_filedir}" "${local_filename}" "${chmodx}" "${run}" "${forcedl}" "${md5}" fn_dl_extract "${local_filedir}" "${local_filename}" "${serverfiles}" } echo -e "" -echo -e "${lightyellow}Installing ${gamename} Server${default}" -echo -e "=================================" -fn_sleep_time +echo -e "${bold}${lightyellow}Installing ${gamename} Server${default}" +fn_messages_separator if [ "${appid}" ]; then remotelocation="SteamCMD" @@ -250,7 +249,7 @@ fi if [ -z "${autoinstall}" ]; then echo -e "" - echo -e "=================================" + fn_messages_separator if ! fn_prompt_yn "Was the install successful?" Y; then install_retry.sh fi diff --git a/lgsm/modules/install_squad_license.sh b/lgsm/modules/install_squad_license.sh index 75499f4a0..604b3bcad 100644 --- a/lgsm/modules/install_squad_license.sh +++ b/lgsm/modules/install_squad_license.sh @@ -8,9 +8,8 @@ moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" echo -e "" -echo -e "${lightyellow}Squad Server License${default}" -echo -e "=================================" -fn_sleep_time +echo -e "${bold}${lightyellow}${gamename} Server License${default}" +fn_messages_separator echo -e "Server license is an optional feature for ${gamename} server" fn_script_log_info "Server license is an optional feature for ${gamename} server" diff --git a/lgsm/modules/install_stats.sh b/lgsm/modules/install_stats.sh index 8c65c007c..c3e92323d 100644 --- a/lgsm/modules/install_stats.sh +++ b/lgsm/modules/install_stats.sh @@ -8,12 +8,13 @@ moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" echo -e "" -echo -e "${lightyellow}LinuxGSM Stats${default}" -echo -e "=================================" +echo -e "${bold}${lightyellow}LinuxGSM Stats${default}" +fn_messages_separator fn_sleep_time echo -e "Assist LinuxGSM development by sending anonymous stats to developers." -echo -e "More info: https://docs.linuxgsm.com/configuration/linuxgsm-stats" -echo -e "The following info will be sent:" +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 "The following info will be sent: " echo -e "* game server" echo -e "* distro" echo -e "* game server resource usage" diff --git a/lgsm/modules/install_steamcmd.sh b/lgsm/modules/install_steamcmd.sh index 8eeb2de53..50599ebd5 100644 --- a/lgsm/modules/install_steamcmd.sh +++ b/lgsm/modules/install_steamcmd.sh @@ -8,7 +8,6 @@ moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" echo -e "" -echo -e "${lightyellow}Installing SteamCMD${default}" -echo -e "=================================" -fn_sleep_time +echo -e "${bold}${lightyellow}Installing SteamCMD${default}" +fn_messages_separator check_steamcmd.sh diff --git a/lgsm/modules/install_ts3db.sh b/lgsm/modules/install_ts3db.sh index 703f9b645..e5776c30f 100644 --- a/lgsm/modules/install_ts3db.sh +++ b/lgsm/modules/install_ts3db.sh @@ -14,7 +14,7 @@ fn_install_ts3db_mariadb() { local exitcode=$? if [ "${exitcode}" != "0" ]; then fn_print_fail_eol_nl - fn_script_log_fatal "copying libmariadb.so.2" + fn_script_log_fail "copying libmariadb.so.2" core_exit.sh else fn_print_ok_eol_nl @@ -23,9 +23,8 @@ fn_install_ts3db_mariadb() { fi echo -e "" - echo -e "${lightyellow}Configure ${gamename} Server for MariaDB${default}" - echo -e "=================================" - fn_sleep_time + echo -e "${bold}${lightyellow}Configure ${gamename} Server for MariaDB${default}" + fn_messages_separator read -rp "Enter MariaDB hostname: " mariahostname read -rp "Enter MariaDB port: " mariaport read -rp "Enter MariaDB username: " mariausername @@ -50,9 +49,8 @@ fn_install_ts3db_mariadb() { } echo -e "" -echo -e "${lightyellow}Select Database${default}" -echo -e "=================================" -fn_sleep_time +echo -e "${bold}${lightyellow}Select Database${default}" +fn_messages_separator if [ -z "${autoinstall}" ]; then if fn_prompt_yn "Do you want to use MariaDB instead of sqlite? (MariaDB must be pre-configured)" N; then fn_install_ts3db_mariadb @@ -64,9 +62,8 @@ fi install_eula.sh echo -e "" -echo -e "${lightyellow}Getting Privilege Key${default}" -echo -e "=================================" -fn_sleep_time +echo -e "${bold}${lightyellow}Getting Privilege Key${default}" +fn_messages_separator fn_print_information_nl "Save these details for later." fn_print_information_nl "Key also saved in:" echo -e "${serverfiles}/privilege_key.txt" diff --git a/lgsm/modules/install_ut2k4_key.sh b/lgsm/modules/install_ut2k4_key.sh index c09c4590c..6fbd2a838 100644 --- a/lgsm/modules/install_ut2k4_key.sh +++ b/lgsm/modules/install_ut2k4_key.sh @@ -8,9 +8,8 @@ moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" echo -e "" -echo -e "${lightyellow}Enter ${gamename} CD Key${default}" -echo -e "=================================" -fn_sleep_time +echo -e "${bold}${lightyellow}Enter ${gamename} CD Key${default}" +fn_messages_separator echo -e "To get your server listed on the Master Server list" echo -e "you must get a free CD key. Get a key here:" echo -e "https://www.epicgames.com/unrealtournament/forums/cdkey.php?2004" diff --git a/lgsm/modules/mods_core.sh b/lgsm/modules/mods_core.sh index 2078ae167..1b85a95b3 100644 --- a/lgsm/modules/mods_core.sh +++ b/lgsm/modules/mods_core.sh @@ -22,7 +22,7 @@ fn_mod_install_files() { # Check if variable is valid checking if file has been downloaded and exists. if [ ! -f "${modstmpdir}/${modfilename}" ]; then fn_print_failure "An issue occurred downloading ${modprettyname}" - fn_script_log_fatal "An issue occurred downloading ${modprettyname}" + fn_script_log_fail "An issue occurred downloading ${modprettyname}" core_exit.sh fi if [ ! -d "${extractdest}" ]; then @@ -77,7 +77,7 @@ fn_mod_create_filelist() { local exitcode=$? if [ "${exitcode}" != 0 ]; then fn_print_fail_eol_nl - fn_script_log_fatal "Building ${modsdir}/${modcommand}-files.txt" + fn_script_log_fail "Building ${modsdir}/${modcommand}-files.txt" core_exit.sh else fn_print_ok_eol_nl @@ -97,7 +97,7 @@ fn_mod_copy_destination() { local exitcode=$? if [ "${exitcode}" != 0 ]; then fn_print_fail_eol_nl - fn_script_log_fatal "Copying ${modprettyname} to ${modinstalldir}" + fn_script_log_fail "Copying ${modprettyname} to ${modinstalldir}" else fn_print_ok_eol_nl fn_script_log_pass "Copying ${modprettyname} to ${modinstalldir}" @@ -135,7 +135,7 @@ fn_mod_tidy_files_list() { local exitcode=$? if [ "${exitcode}" != 0 ]; then fn_print_fail_eol_nl - fn_script_log_fatal "Error while tidying line: ${removefilevar} from: ${modsdir}/${modcommand}-files.txt" + fn_script_log_fail "Error while tidying line: ${removefilevar} from: ${modsdir}/${modcommand}-files.txt" core_exit.sh break fi @@ -228,7 +228,7 @@ fn_mod_get_info() { # Define all variables for a mod at once when index is set to a separator. fn_mods_define() { if [ -z "$index" ]; then - fn_script_log_fatal "index variable not set. Please report an issue." + fn_script_log_fail "index variable not set. Please report an issue." fn_print_error "index variable not set. Please report an issue." echo -e "* https://github.com/GameServerManagers/LinuxGSM/issues" core_exit.sh @@ -390,7 +390,7 @@ fn_create_mods_dir() { exitcode=$? if [ "${exitcode}" != 0 ]; then fn_print_fail_eol_nl - fn_script_log_fatal "Creating mod download dir ${modsdir}" + fn_script_log_fail "Creating mod download dir ${modsdir}" core_exit.sh else fn_print_ok_eol_nl @@ -404,7 +404,7 @@ fn_create_mods_dir() { exitcode=$? if [ "${exitcode}" != 0 ]; then fn_print_fail_eol_nl - fn_script_log_fatal "Creating mod install directory ${modinstalldir}" + fn_script_log_fail "Creating mod install directory ${modinstalldir}" core_exit.sh else fn_print_ok_eol_nl @@ -427,7 +427,7 @@ fn_mods_create_tmp_dir() { echo -en "creating mod download directory ${modstmpdir}..." if [ "${exitcode}" != 0 ]; then fn_print_fail_eol_nl - fn_script_log_fatal "Creating mod download directory ${modstmpdir}" + fn_script_log_fail "Creating mod download directory ${modstmpdir}" core_exit.sh else fn_print_ok_eol_nl @@ -444,7 +444,7 @@ fn_mods_clear_tmp_dir() { exitcode=$? if [ "${exitcode}" != 0 ]; then fn_print_fail_eol_nl - fn_script_log_fatal "Clearing mod download directory ${modstmpdir}" + fn_script_log_fail "Clearing mod download directory ${modstmpdir}" core_exit.sh else fn_print_ok_eol_nl @@ -491,12 +491,12 @@ fn_check_mod_files_list() { if [ "${modsfilelistsize}" -eq 0 ]; then fn_print_failure "${modcommand}-files.txt is empty" echo -e "* Unable to remove ${modprettyname}" - fn_script_log_fatal "${modcommand}-files.txt is empty: Unable to remove ${modprettyname}." + fn_script_log_fail "${modcommand}-files.txt is empty: Unable to remove ${modprettyname}." core_exit.sh fi else fn_print_failure "${modsdir}/${modcommand}-files.txt does not exist" - fn_script_log_fatal "${modsdir}/${modcommand}-files.txt does not exist: Unable to remove ${modprettyname}." + fn_script_log_fail "${modsdir}/${modcommand}-files.txt does not exist: Unable to remove ${modprettyname}." core_exit.sh fi } @@ -519,7 +519,7 @@ fn_mod_exist() { fn_mod_required_fail_exist() { modreq=$1 # requires one parameter, the mod - fn_script_log_fatal "${modreq}-files.txt is empty: unable to find ${modreq} installed" + fn_script_log_fail "${modreq}-files.txt is empty: unable to find ${modreq} installed" echo -en "* Unable to find '${modreq}' which is required prior to installing this mod..." fn_print_fail_eol_nl core_exit.sh @@ -581,7 +581,7 @@ fn_mod_install_liblist_gam_file() { exitcode=$? # if replacement back didn't happen, error out. if [ "${exitcode}" != 0 ]; then - fn_script_log_fatal "${logentry}" + fn_script_log_fail "${logentry}" fn_print_fail_eol_nl else fn_script_log_pass "${logentry}" @@ -597,7 +597,7 @@ fn_mod_install_liblist_gam_file() { exitcode=$? # if replacement back didn't happen, error out if [ "${exitcode}" != 0 ]; then - fn_script_log_fatal "${logentry}" + fn_script_log_fail "${logentry}" fn_print_fail_eol_nl else fn_script_log_pass "${logentry}" @@ -615,7 +615,7 @@ fn_mod_install_liblist_gam_file() { exitcode=$? # if replacement back didn't happen, error out. if [ "${exitcode}" != 0 ]; then - fn_script_log_fatal "${logentry}" + fn_script_log_fail "${logentry}" fn_print_fail_eol_nl else fn_script_log_pass ${logentry} @@ -639,7 +639,7 @@ fn_mod_remove_liblist_gam_file() { exitcode=$? # if replacement back didn't happen, error out. if [ "${exitcode}" != 0 ]; then - fn_script_log_fatal "${logentry}" + fn_script_log_fail "${logentry}" fn_print_fail_eol_nl else fn_script_log_pass ${logentry} @@ -655,7 +655,7 @@ fn_mod_remove_liblist_gam_file() { exitcode=$? # if replacement back didn't happen, error out if [ "${exitcode}" != 0 ]; then - fn_script_log_fatal "${logentry}" + fn_script_log_fail "${logentry}" fn_print_fail_eol_nl else fn_script_log_pass ${logentry} @@ -673,7 +673,7 @@ fn_mod_remove_liblist_gam_file() { # if replacement back didn't happen, error out. exitcode=$? if [ "${exitcode}" != 0 ]; then - fn_script_log_fatal "${logentry}" + fn_script_log_fail "${logentry}" fn_print_fail_eol_nl else fn_script_log_pass ${logentry} @@ -696,7 +696,7 @@ fn_mod_install_amxmodx_file() { echo "linux addons/amxmodx/dlls/amxmodx_mm_i386.so" >> "${modinstalldir}/addons/metamod/plugins.ini" exitcode=$? if [ "${exitcode}" != 0 ]; then - fn_script_log_fatal "${logentry}" + fn_script_log_fail "${logentry}" fn_print_fail_eol_nl else fn_script_log_pass ${logentry} @@ -708,7 +708,7 @@ fn_mod_install_amxmodx_file() { echo "linux addons/amxmodx/dlls/amxmodx_mm_i386.so" > "${modinstalldir}/addons/metamod/plugins.ini" exitcode=$? if [ "${exitcode}" != 0 ]; then - fn_script_log_fatal "${logentry}" + fn_script_log_fail "${logentry}" fn_print_fail_eol_nl core_exit.sh else @@ -733,7 +733,7 @@ fn_mod_remove_amxmodx_file() { sed -i '/^$/d' "${modinstalldir}/addons/metamod/plugins.ini" exitcode=$? if [ "${exitcode}" != 0 ]; then - fn_script_log_fatal "${logentry}" + fn_script_log_fail "${logentry}" fn_print_fail_eol_nl else fn_script_log_pass ${logentry} diff --git a/lgsm/modules/update_fctr.sh b/lgsm/modules/update_fctr.sh index 9b88fcd17..2eef0d4cd 100644 --- a/lgsm/modules/update_fctr.sh +++ b/lgsm/modules/update_fctr.sh @@ -46,7 +46,7 @@ fn_update_remotebuild() { # Checks if remotebuildversion variable has been set. if [ -z "${remotebuildversion}" ] || [ "${remotebuildversion}" == "null" ]; then fn_print_fail "Checking remote build: ${remotelocation}" - fn_script_log_fatal "Checking remote build" + fn_script_log_fail "Checking remote build" core_exit.sh else fn_print_ok "Checking remote build: ${remotelocation}" @@ -56,7 +56,7 @@ fn_update_remotebuild() { # Checks if remotebuild variable has been set. if [ -z "${remotebuildversion}" ] || [ "${remotebuildversion}" == "null" ]; then fn_print_failure "Unable to get remote build" - fn_script_log_fatal "Unable to get remote build" + fn_script_log_fail "Unable to get remote build" core_exit.sh fi fi diff --git a/lgsm/modules/update_jk2.sh b/lgsm/modules/update_jk2.sh index e67b0c02b..f685fd4cb 100644 --- a/lgsm/modules/update_jk2.sh +++ b/lgsm/modules/update_jk2.sh @@ -43,7 +43,7 @@ fn_update_remotebuild() { # Checks if remotebuildversion variable has been set. if [ -z "${remotebuildversion}" ] || [ "${remotebuildversion}" == "null" ]; then fn_print_fail "Checking remote build: ${remotelocation}" - fn_script_log_fatal "Checking remote build" + fn_script_log_fail "Checking remote build" core_exit.sh else fn_print_ok "Checking remote build: ${remotelocation}" @@ -53,7 +53,7 @@ fn_update_remotebuild() { # Checks if remotebuild variable has been set. if [ -z "${remotebuildversion}" ] || [ "${remotebuildversion}" == "null" ]; then fn_print_failure "Unable to get remote build" - fn_script_log_fatal "Unable to get remote build" + fn_script_log_fail "Unable to get remote build" core_exit.sh fi fi diff --git a/lgsm/modules/update_mc.sh b/lgsm/modules/update_mc.sh index 2f7381da7..c4aa1b425 100644 --- a/lgsm/modules/update_mc.sh +++ b/lgsm/modules/update_mc.sh @@ -58,7 +58,7 @@ fn_update_remotebuild() { # Checks if remotebuildversion variable has been set. if [ -z "${remotebuildversion}" ] || [ "${remotebuildversion}" == "null" ]; then fn_print_fail "Checking remote build: ${remotelocation}" - fn_script_log_fatal "Checking remote build" + fn_script_log_fail "Checking remote build" core_exit.sh else fn_print_ok "Checking remote build: ${remotelocation}" @@ -68,7 +68,7 @@ fn_update_remotebuild() { # Checks if remotebuild variable has been set. if [ -z "${remotebuildversion}" ] || [ "${remotebuildversion}" == "null" ]; then fn_print_failure "Unable to get remote build" - fn_script_log_fatal "Unable to get remote build" + fn_script_log_fail "Unable to get remote build" core_exit.sh fi fi diff --git a/lgsm/modules/update_mcb.sh b/lgsm/modules/update_mcb.sh index f3a802e9e..eb8adfd12 100644 --- a/lgsm/modules/update_mcb.sh +++ b/lgsm/modules/update_mcb.sh @@ -18,7 +18,7 @@ fn_update_dl() { local exitcode=$? if [ "${exitcode}" != 0 ]; then fn_print_fail_eol_nl - fn_script_log_fatal "Extracting ${local_filename}" + fn_script_log_fail "Extracting ${local_filename}" if [ -f "${lgsmlog}" ]; then echo -e "${extractcmd}" >> "${lgsmlog}" fi @@ -50,10 +50,10 @@ fn_update_localbuild() { fn_update_remotebuild() { # Random number for userAgent - randnum=$((1 + RANDOM % 5000)) + randomint=$(tr -dc 0-9 < /dev/urandom 2> /dev/null | head -c 4 | xargs) # Get remote build info. if [ "${mcversion}" == "latest" ]; then - remotebuildversion=$(curl -H "Accept-Encoding: identity" -H "Accept-Language: en" -Ls -A "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.${randnum}.212 Safari/537.36" "https://www.minecraft.net/en-us/download/server/bedrock/" | grep -o 'https://minecraft.azureedge.net/bin-linux/[^"]*' | sed 's/.*\///' | grep -Eo "[.0-9]+[0-9]") + remotebuildversion=$(curl -H "Accept-Encoding: identity" -H "Accept-Language: en" -Ls -A "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.${randomint}.212 Safari/537.36" "https://www.minecraft.net/en-us/download/server/bedrock/" | grep -o 'https://minecraft.azureedge.net/bin-linux/[^"]*' | sed 's/.*\///' | grep -Eo "[.0-9]+[0-9]") else remotebuildversion="${mcversion}" fi @@ -64,7 +64,7 @@ fn_update_remotebuild() { # Checks if remotebuildversion variable has been set. if [ -z "${remotebuildversion}" ] || [ "${remotebuildversion}" == "null" ]; then fn_print_fail "Checking remote build: ${remotelocation}" - fn_script_log_fatal "Checking remote build" + fn_script_log_fail "Checking remote build" core_exit.sh else fn_print_ok "Checking remote build: ${remotelocation}" @@ -74,7 +74,7 @@ fn_update_remotebuild() { # Checks if remotebuild variable has been set. if [ -z "${remotebuildversion}" ] || [ "${remotebuildversion}" == "null" ]; then fn_print_failure "Unable to get remote build" - fn_script_log_fatal "Unable to get remote build" + fn_script_log_fail "Unable to get remote build" core_exit.sh fi fi diff --git a/lgsm/modules/update_mta.sh b/lgsm/modules/update_mta.sh index fd728b22d..cd1195563 100644 --- a/lgsm/modules/update_mta.sh +++ b/lgsm/modules/update_mta.sh @@ -45,7 +45,7 @@ fn_update_remotebuild() { # Checks if remotebuildversion variable has been set. if [ -z "${remotebuildversion}" ] || [ "${remotebuildversion}" == "null" ]; then fn_print_fail "Checking remote build: ${remotelocation}" - fn_script_log_fatal "Checking remote build" + fn_script_log_fail "Checking remote build" core_exit.sh else fn_print_ok "Checking remote build: ${remotelocation}" @@ -55,7 +55,7 @@ fn_update_remotebuild() { # Checks if remotebuild variable has been set. if [ -z "${remotebuildversion}" ] || [ "${remotebuildversion}" == "null" ]; then fn_print_failure "Unable to get remote build" - fn_script_log_fatal "Unable to get remote build" + fn_script_log_fail "Unable to get remote build" core_exit.sh fi fi diff --git a/lgsm/modules/update_pmc.sh b/lgsm/modules/update_pmc.sh index 2ad6b91ab..9bfa82101 100644 --- a/lgsm/modules/update_pmc.sh +++ b/lgsm/modules/update_pmc.sh @@ -68,7 +68,7 @@ fn_update_remotebuild() { # Checks if remotebuildversion variable has been set. if [ -z "${remotebuildversion}" ] || [ "${remotebuildversion}" == "null" ]; then fn_print_fail "Checking remote build: ${remotelocation}" - fn_script_log_fatal "Checking remote build" + fn_script_log_fail "Checking remote build" core_exit.sh else fn_print_ok "Checking remote build: ${remotelocation}" @@ -78,7 +78,7 @@ fn_update_remotebuild() { # Checks if remotebuild variable has been set. if [ -z "${remotebuildversion}" ] || [ "${remotebuildversion}" == "null" ]; then fn_print_failure "Unable to get remote build" - fn_script_log_fatal "Unable to get remote build" + fn_script_log_fail "Unable to get remote build" core_exit.sh fi fi diff --git a/lgsm/modules/update_ts3.sh b/lgsm/modules/update_ts3.sh index bb137a0b3..c00ae75cb 100644 --- a/lgsm/modules/update_ts3.sh +++ b/lgsm/modules/update_ts3.sh @@ -50,7 +50,7 @@ fn_update_remotebuild() { # Checks if remotebuildversion variable has been set. if [ -z "${remotebuildversion}" ] || [ "${remotebuildversion}" == "null" ]; then fn_print_fail "Checking remote build: ${remotelocation}" - fn_script_log_fatal "Checking remote build" + fn_script_log_fail "Checking remote build" core_exit.sh else fn_print_ok "Checking remote build: ${remotelocation}" @@ -60,7 +60,7 @@ fn_update_remotebuild() { # Checks if remotebuild variable has been set. if [ -z "${remotebuildversion}" ] || [ "${remotebuildversion}" == "null" ]; then fn_print_failure "Unable to get remote build" - fn_script_log_fatal "Unable to get remote build" + fn_script_log_fail "Unable to get remote build" core_exit.sh fi fi @@ -164,7 +164,7 @@ elif [ "${arch}" == "i386" ] || [ "${arch}" == "i686" ]; then ts3arch="x86" else fn_print_failure "Unknown or unsupported architecture: ${arch}" - fn_script_log_fatal "Unknown or unsupported architecture: ${arch}" + fn_script_log_fail "Unknown or unsupported architecture: ${arch}" core_exit.sh fi diff --git a/lgsm/modules/update_ut99.sh b/lgsm/modules/update_ut99.sh index c1dc1dade..bdd3631f3 100644 --- a/lgsm/modules/update_ut99.sh +++ b/lgsm/modules/update_ut99.sh @@ -44,7 +44,7 @@ fn_update_remotebuild() { # Checks if remotebuildversion variable has been set. if [ -z "${remotebuildversion}" ] || [ "${remotebuildversion}" == "null" ]; then fn_print_fail "Checking remote build: ${remotelocation}" - fn_script_log_fatal "Checking remote build" + fn_script_log_fail "Checking remote build" core_exit.sh else fn_print_ok "Checking remote build: ${remotelocation}" @@ -54,7 +54,7 @@ fn_update_remotebuild() { # Checks if remotebuild variable has been set. if [ -z "${remotebuildversion}" ] || [ "${remotebuildversion}" == "null" ]; then fn_print_failure "Unable to get remote build" - fn_script_log_fatal "Unable to get remote build" + fn_script_log_fail "Unable to get remote build" core_exit.sh fi fi diff --git a/lgsm/modules/update_vints.sh b/lgsm/modules/update_vints.sh index 47195b9b2..b38372058 100644 --- a/lgsm/modules/update_vints.sh +++ b/lgsm/modules/update_vints.sh @@ -51,7 +51,7 @@ fn_update_remotebuild() { # Checks if remotebuildversion variable has been set. if [ -z "${remotebuildversion}" ] || [ "${remotebuildversion}" == "null" ]; then fn_print_fail "Checking remote build: ${remotelocation}" - fn_script_log_fatal "Checking remote build" + fn_script_log_fail "Checking remote build" core_exit.sh else fn_print_ok "Checking remote build: ${remotelocation}" @@ -61,7 +61,7 @@ fn_update_remotebuild() { # Checks if remotebuild variable has been set. if [ -z "${remotebuildversion}" ] || [ "${remotebuildversion}" == "null" ]; then fn_print_failure "Unable to get remote build" - fn_script_log_fatal "Unable to get remote build" + fn_script_log_fail "Unable to get remote build" core_exit.sh fi fi diff --git a/linuxgsm.sh b/linuxgsm.sh index 6da7de664..520373d48 100755 --- a/linuxgsm.sh +++ b/linuxgsm.sh @@ -124,8 +124,8 @@ fn_bootstrap_fetch_file() { if [ ${counter} -ge 2 ]; then echo -e "FAIL" if [ -f "${lgsmlog}" ]; then - fn_script_log_fatal "Downloading ${local_filename}" - fn_script_log_fatal "${fileurl}" + fn_script_log_fail "Downloading ${local_filename}" + fn_script_log_fail "${fileurl}" fi core_exit.sh else diff --git a/tests/tests_fctrserver.sh b/tests/tests_fctrserver.sh index a63023dc8..0b4530d87 100644 --- a/tests/tests_fctrserver.sh +++ b/tests/tests_fctrserver.sh @@ -122,8 +122,8 @@ fn_bootstrap_fetch_file() { if [ ${counter} -ge 2 ]; then echo -e "FAIL" if [ -f "${lgsmlog}" ]; then - fn_script_log_fatal "Downloading ${local_filename}" - fn_script_log_fatal "${fileurl}" + fn_script_log_fail "Downloading ${local_filename}" + fn_script_log_fail "${fileurl}" fi core_exit.sh else diff --git a/tests/tests_jc2server.sh b/tests/tests_jc2server.sh index b921de274..adf59ab92 100644 --- a/tests/tests_jc2server.sh +++ b/tests/tests_jc2server.sh @@ -123,8 +123,8 @@ fn_bootstrap_fetch_file() { if [ ${counter} -ge 2 ]; then echo -e "FAIL" if [ -f "${lgsmlog}" ]; then - fn_script_log_fatal "Downloading ${local_filename}" - fn_script_log_fatal "${fileurl}" + fn_script_log_fail "Downloading ${local_filename}" + fn_script_log_fail "${fileurl}" fi core_exit.sh else diff --git a/tests/tests_mcserver.sh b/tests/tests_mcserver.sh index d173c7d68..3a40e9aa5 100644 --- a/tests/tests_mcserver.sh +++ b/tests/tests_mcserver.sh @@ -123,8 +123,8 @@ fn_bootstrap_fetch_file() { if [ ${counter} -ge 2 ]; then echo -e "FAIL" if [ -f "${lgsmlog}" ]; then - fn_script_log_fatal "Downloading ${local_filename}" - fn_script_log_fatal "${fileurl}" + fn_script_log_fail "Downloading ${local_filename}" + fn_script_log_fail "${fileurl}" fi core_exit.sh else diff --git a/tests/tests_ts3server.sh b/tests/tests_ts3server.sh index 7363a1025..3fcb8ae24 100644 --- a/tests/tests_ts3server.sh +++ b/tests/tests_ts3server.sh @@ -123,8 +123,8 @@ fn_bootstrap_fetch_file() { if [ ${counter} -ge 2 ]; then echo -e "FAIL" if [ -f "${lgsmlog}" ]; then - fn_script_log_fatal "Downloading ${local_filename}" - fn_script_log_fatal "${fileurl}" + fn_script_log_fail "Downloading ${local_filename}" + fn_script_log_fail "${fileurl}" fi core_exit.sh else