Browse Source

feat: various UI changes (#4326)

* refactor: remove unnecessary comments in default server configurations

The commit removes unnecessary comments from the default server configurations. The comments were providing instructions to edit the configuration files with care, but they are not needed and can be safely removed.

* refactor: update server names in default configuration files

- Updated the servername value in multiple default configuration files to "LinuxGSM" for consistency.
- Refactored the code to reflect the changes made.

* refactor: rename fn_script_log_fatal to fn_script_log_faail

to create more consistency with naming

* feat: improve console output formatting

- Added separator function to improve readability of console output.
- Replaced multiple instances of manual separators with the new function.
- Updated commit message to follow conventional commit standard.

* refactor: remove unnecessary fn_sleep_time calls

This commit removes the fn_sleep_time function calls that are no longer needed in multiple modules. The fn_sleep_time function was used to introduce a delay, but it is no longer necessary for the current implementation.

* better standardise random

* removed bold where not required
pull/4338/head
Daniel Gibbs 2 years ago
committed by GitHub
parent
commit
e0b77391bc
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      lgsm/config-default/config-lgsm/dstserver/_default.cfg
  2. 2
      lgsm/config-default/config-lgsm/hwserver/_default.cfg
  3. 2
      lgsm/config-default/config-lgsm/inssserver/_default.cfg
  4. 2
      lgsm/config-default/config-lgsm/loserver/_default.cfg
  5. 1
      lgsm/config-default/config-lgsm/mtaserver/_default.cfg
  6. 2
      lgsm/config-default/config-lgsm/ns2cserver/_default.cfg
  7. 2
      lgsm/config-default/config-lgsm/ns2server/_default.cfg
  8. 2
      lgsm/config-default/config-lgsm/rustserver/_default.cfg
  9. 2
      lgsm/config-default/config-lgsm/sbotsserver/_default.cfg
  10. 2
      lgsm/config-default/config-lgsm/stnserver/_default.cfg
  11. 1
      lgsm/config-default/config-lgsm/stserver/_default.cfg
  12. 2
      lgsm/config-default/config-lgsm/vhserver/_default.cfg
  13. 2
      lgsm/modules/alert_discord.sh
  14. 3
      lgsm/modules/alert_email.sh
  15. 2
      lgsm/modules/alert_gotify.sh
  16. 2
      lgsm/modules/alert_ifttt.sh
  17. 2
      lgsm/modules/alert_pushbullet.sh
  18. 2
      lgsm/modules/alert_pushover.sh
  19. 2
      lgsm/modules/alert_rocketchat.sh
  20. 2
      lgsm/modules/alert_slack.sh
  21. 2
      lgsm/modules/alert_telegram.sh
  22. 4
      lgsm/modules/check_config.sh
  23. 14
      lgsm/modules/check_deps.sh
  24. 2
      lgsm/modules/check_executable.sh
  25. 8
      lgsm/modules/check_permissions.sh
  26. 2
      lgsm/modules/check_root.sh
  27. 4
      lgsm/modules/check_system_dir.sh
  28. 4
      lgsm/modules/check_tmuxception.sh
  29. 10
      lgsm/modules/command_backup.sh
  30. 2
      lgsm/modules/command_debug.sh
  31. 6
      lgsm/modules/command_dev_clear_modules.sh
  32. 10
      lgsm/modules/command_dev_details.sh
  33. 20
      lgsm/modules/command_dev_detect_deps.sh
  34. 10
      lgsm/modules/command_dev_detect_glibc.sh
  35. 8
      lgsm/modules/command_dev_detect_ldd.sh
  36. 20
      lgsm/modules/command_dev_query_raw.sh
  37. 30
      lgsm/modules/command_fastdl.sh
  38. 2
      lgsm/modules/command_install_resources_mta.sh
  39. 6
      lgsm/modules/command_mods_install.sh
  40. 8
      lgsm/modules/command_mods_remove.sh
  41. 2
      lgsm/modules/command_mods_update.sh
  42. 2
      lgsm/modules/command_monitor.sh
  43. 2
      lgsm/modules/command_skeleton.sh
  44. 2
      lgsm/modules/command_sponsor.sh
  45. 10
      lgsm/modules/command_start.sh
  46. 2
      lgsm/modules/command_stop.sh
  47. 20
      lgsm/modules/command_update_linuxgsm.sh
  48. 33
      lgsm/modules/core_dl.sh
  49. 2
      lgsm/modules/core_exit.sh
  50. 6
      lgsm/modules/core_github.sh
  51. 1
      lgsm/modules/core_logs.sh
  52. 16
      lgsm/modules/core_messages.sh
  53. 14
      lgsm/modules/core_steamcmd.sh
  54. 3
      lgsm/modules/fix.sh
  55. 1
      lgsm/modules/fix_av.sh
  56. 1
      lgsm/modules/fix_kf2.sh
  57. 2
      lgsm/modules/fix_lo.sh
  58. 1
      lgsm/modules/fix_mta.sh
  59. 4
      lgsm/modules/fix_samp.sh
  60. 2
      lgsm/modules/fix_ts3.sh
  61. 1
      lgsm/modules/fix_ut3.sh
  62. 51
      lgsm/modules/info_messages.sh
  63. 10
      lgsm/modules/install_complete.sh
  64. 38
      lgsm/modules/install_config.sh
  65. 5
      lgsm/modules/install_dst_token.sh
  66. 5
      lgsm/modules/install_eula.sh
  67. 5
      lgsm/modules/install_factorio_save.sh
  68. 4
      lgsm/modules/install_gslt.sh
  69. 10
      lgsm/modules/install_header.sh
  70. 5
      lgsm/modules/install_logs.sh
  71. 4
      lgsm/modules/install_server_dir.sh
  72. 9
      lgsm/modules/install_server_files.sh
  73. 5
      lgsm/modules/install_squad_license.sh
  74. 9
      lgsm/modules/install_stats.sh
  75. 5
      lgsm/modules/install_steamcmd.sh
  76. 17
      lgsm/modules/install_ts3db.sh
  77. 5
      lgsm/modules/install_ut2k4_key.sh
  78. 42
      lgsm/modules/mods_core.sh
  79. 4
      lgsm/modules/update_fctr.sh
  80. 4
      lgsm/modules/update_jk2.sh
  81. 4
      lgsm/modules/update_mc.sh
  82. 10
      lgsm/modules/update_mcb.sh
  83. 4
      lgsm/modules/update_mta.sh
  84. 4
      lgsm/modules/update_pmc.sh
  85. 6
      lgsm/modules/update_ts3.sh
  86. 4
      lgsm/modules/update_ut99.sh
  87. 4
      lgsm/modules/update_vints.sh
  88. 4
      linuxgsm.sh
  89. 4
      tests/tests_fctrserver.sh
  90. 4
      tests/tests_jc2server.sh
  91. 4
      tests/tests_mcserver.sh
  92. 4
      tests/tests_ts3server.sh

1
lgsm/config-default/config-lgsm/dstserver/_default.cfg

@ -15,7 +15,6 @@ shard="Master"
cluster="Cluster_1" cluster="Cluster_1"
cave="false" cave="false"
# Edit with care
persistentstorageroot="${HOME}/.klei" persistentstorageroot="${HOME}/.klei"
confdir="DoNotStarveTogether" confdir="DoNotStarveTogether"

2
lgsm/config-default/config-lgsm/hwserver/_default.cfg

@ -26,7 +26,7 @@ admins=""
loadsave="" loadsave=""
## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters ## 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}\"" startparameters="-batchmode -nographics -logfile ${gamelog} -exec \"host ${port} ${defaultmap} ${loadsave};queryport ${queryport};maxplayers ${maxplayers};servername ${servername};creativemode ${creativemode};${admins}\""
#### LinuxGSM Settings #### #### LinuxGSM Settings ####

2
lgsm/config-default/config-lgsm/inssserver/_default.cfg

@ -14,7 +14,7 @@ port="27102"
queryport="27131" queryport="27131"
rconport="27015" rconport="27015"
rconpassword="" rconpassword=""
servername="LinuxGSM Server" servername="LinuxGSM"
defaultmap="Canyon" defaultmap="Canyon"
defaultscenario="Scenario_Crossing_Push_Security" defaultscenario="Scenario_Crossing_Push_Security"
maxplayers="28" maxplayers="28"

2
lgsm/config-default/config-lgsm/loserver/_default.cfg

@ -10,7 +10,7 @@
## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters ## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters
## https://docs.linuxgsm.com/game-servers/last-oasis ## https://docs.linuxgsm.com/game-servers/last-oasis
servername="${selfname}" servername="LinuxGSM"
ip="0.0.0.0" ip="0.0.0.0"
port="7777" port="7777"
queryport="27015" queryport="27015"

1
lgsm/config-default/config-lgsm/mtaserver/_default.cfg

@ -12,7 +12,6 @@
ip="0.0.0.0" ip="0.0.0.0"
## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters ## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters
# Edit with care
startparameters="" startparameters=""
#### LinuxGSM Settings #### #### LinuxGSM Settings ####

2
lgsm/config-default/config-lgsm/ns2cserver/_default.cfg

@ -13,7 +13,7 @@ ip="0.0.0.0"
port="27015" port="27015"
defaultmap="co_core" defaultmap="co_core"
maxplayers="24" maxplayers="24"
servername="LinuxGSM Server" servername="LinuxGSM"
httpuser="admin" httpuser="admin"
httppassword="admin" httppassword="admin"
httpport="8080" httpport="8080"

2
lgsm/config-default/config-lgsm/ns2server/_default.cfg

@ -13,7 +13,7 @@ ip="0.0.0.0"
port="27015" port="27015"
defaultmap="ns2_summit" defaultmap="ns2_summit"
maxplayers="24" maxplayers="24"
servername="LinuxGSM Server" servername="LinuxGSM"
httpuser="admin" httpuser="admin"
httppassword="admin" httppassword="admin"
httpport="8080" httpport="8080"

2
lgsm/config-default/config-lgsm/rustserver/_default.cfg

@ -16,7 +16,7 @@ appport="28082"
queryport="28017" queryport="28017"
rconpassword="CHANGE_ME" rconpassword="CHANGE_ME"
rconweb="1" # values: Facepunch web panel, Rustadmin desktop and Rustadmin Online = 1, Rusty = 0. 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 ) gamemode="vanilla" # values: vanilla, softcore ( Doc: https://wiki.facepunch.com/rust/server-gamemodes )
serverlevel="Procedural Map" # values: Procedural Map, Barren, HapisIsland, SavasIsland serverlevel="Procedural Map" # values: Procedural Map, Barren, HapisIsland, SavasIsland
customlevelurl="" # Custom level url. +server.levelurl \"${customlevelurl}\" customlevelurl="" # Custom level url. +server.levelurl \"${customlevelurl}\"

2
lgsm/config-default/config-lgsm/sbotsserver/_default.cfg

@ -12,7 +12,7 @@
port="7777" port="7777"
queryport="27015" queryport="27015"
defaultmap="StationKappa" defaultmap="StationKappa"
servername="LinuxGSM Server" servername="LinuxGSM"
## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters ## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters
startparameters="Port=${port}?QueryPort=${queryport} -startup_map ${defaultmap} -server_name \"${servername}\"" startparameters="Port=${port}?QueryPort=${queryport} -startup_map ${defaultmap} -server_name \"${servername}\""

2
lgsm/config-default/config-lgsm/stnserver/_default.cfg

@ -12,7 +12,7 @@ maxplayers="20"
region="0" region="0"
## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters ## 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}" startparameters="-mc ${maxplayers} -r ${region}"
#### LinuxGSM Settings #### #### LinuxGSM Settings ####

1
lgsm/config-default/config-lgsm/stserver/_default.cfg

@ -13,7 +13,6 @@ worldname="moon_save"
worldtype="Moon" worldtype="Moon"
## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters ## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters
# Edit with care
startparameters="-LOADLATEST ${worldname} ${worldtype}" startparameters="-LOADLATEST ${worldname} ${worldtype}"
#### LinuxGSM Settings #### #### LinuxGSM Settings ####

2
lgsm/config-default/config-lgsm/vhserver/_default.cfg

@ -9,7 +9,7 @@
#### Game Server Settings #### #### Game Server Settings ####
## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters ## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters
servername="Valheim Server" servername="LinuxGSM"
# Minimum password length is 5. # Minimum password length is 5.
serverpassword="" serverpassword=""
port="2456" port="2456"

2
lgsm/modules/alert_discord.sh

@ -52,7 +52,7 @@ discordsend=$(curl --connect-timeout 10 -sSL -H "Content-Type: application/json"
if [ -n "${discordsend}" ]; then if [ -n "${discordsend}" ]; then
fn_print_fail_nl "Sending Discord alert: ${discordsend}" 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 else
fn_print_ok_nl "Sending Discord alert" fn_print_ok_nl "Sending Discord alert"
fn_script_log_pass "Sending Discord alert" fn_script_log_pass "Sending Discord alert"

3
lgsm/modules/alert_email.sh

@ -8,7 +8,6 @@
moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
fn_print_dots "Sending Email alert: ${email}" fn_print_dots "Sending Email alert: ${email}"
fn_sleep_time
if [ -n "${emailfrom}" ]; then if [ -n "${emailfrom}" ]; then
mail -s "${alertsubject}" -r "${emailfrom}" "${email}" < "${alertlog}" mail -s "${alertsubject}" -r "${emailfrom}" "${email}" < "${alertlog}"
@ -21,5 +20,5 @@ if [ "${exitcode}" == "0" ]; then
fn_script_log_pass "Sending Email alert: ${email}" fn_script_log_pass "Sending Email alert: ${email}"
else else
fn_print_fail_nl "Sending Email alert: ${email}" 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 fi

2
lgsm/modules/alert_gotify.sh

@ -26,5 +26,5 @@ if [ -n "${gotifysend}" ]; then
fn_script_log_pass "Sending Gotify alert" fn_script_log_pass "Sending Gotify alert"
else else
fn_print_fail_nl "Sending Gotify alert: ${gotifysend}" 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 fi

2
lgsm/modules/alert_ifttt.sh

@ -22,7 +22,7 @@ iftttsend=$(curl --connect-timeout 10 -sSL -H "Content-Type: application/json" -
if [ -n "${iftttsend}" ]; then if [ -n "${iftttsend}" ]; then
fn_print_fail_nl "Sending IFTTT alert: ${pushbulletsend}" 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 else
fn_print_ok_nl "Sending IFTTT alert" fn_print_ok_nl "Sending IFTTT alert"
fn_script_log_pass "Sent IFTTT alert" fn_script_log_pass "Sent IFTTT alert"

2
lgsm/modules/alert_pushbullet.sh

@ -23,7 +23,7 @@ pushbulletsend=$(curl --connect-timeout 10 -sSL -u """${pushbullettoken}"":" -H
if [ -n "${pushbulletsend}" ]; then if [ -n "${pushbulletsend}" ]; then
fn_print_fail_nl "Sending Pushbullet alert: ${pushbulletsend}" 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 else
fn_print_ok_nl "Sending Pushbullet alert" fn_print_ok_nl "Sending Pushbullet alert"
fn_script_log_pass "Sent Pushbullet alert" fn_script_log_pass "Sent Pushbullet alert"

2
lgsm/modules/alert_pushover.sh

@ -26,7 +26,7 @@ pushoversend=$(curl --connect-timeout 10 -sS -F token="${pushovertoken}" -F user
if [ -n "${pushoversend}" ]; then if [ -n "${pushoversend}" ]; then
fn_print_fail_nl "Sending Pushover alert: ${pushoversend}" 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 else
fn_print_ok_nl "Sending Pushover alert" fn_print_ok_nl "Sending Pushover alert"
fn_script_log_pass "Sent Pushover alert" fn_script_log_pass "Sent Pushover alert"

2
lgsm/modules/alert_rocketchat.sh

@ -46,5 +46,5 @@ if [ -n "${rocketchatsend}" ]; then
fn_script_log_pass "Sending Rocketchat alert" fn_script_log_pass "Sending Rocketchat alert"
else else
fn_print_fail_nl "Sending Rocketchat alert: ${rocketchatsend}" 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 fi

2
lgsm/modules/alert_slack.sh

@ -71,5 +71,5 @@ if [ "${slacksend}" == "ok" ]; then
fn_script_log_pass "Sending Slack alert" fn_script_log_pass "Sending Slack alert"
else else
fn_print_fail_nl "Sending Slack alert: ${slacksend}" 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 fi

2
lgsm/modules/alert_telegram.sh

@ -23,7 +23,7 @@ telegramsend=$(curl --connect-timeout 10 -sSL -H "Content-Type: application/json
if [ -n "${telegramsend}" ]; then if [ -n "${telegramsend}" ]; then
fn_print_fail_nl "Sending Telegram alert: ${telegramsend}" 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 else
fn_print_ok_nl "Sending Telegram alert" fn_print_ok_nl "Sending Telegram alert"
fn_script_log_pass "Sent Telegram alert" fn_script_log_pass "Sent Telegram alert"

4
lgsm/modules/check_config.sh

@ -28,8 +28,8 @@ fi
if [ "${shortname}" == "vh" ] && [ -z "${serverpassword}" ]; then if [ "${shortname}" == "vh" ] && [ -z "${serverpassword}" ]; then
fn_print_fail_nl "serverpassword is not set" 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 elif [ "${shortname}" == "vh" ] && [ "${#serverpassword}" -le "4" ]; then
fn_print_fail_nl "serverpassword is to short (min 5 chars)" 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 fi

14
lgsm/modules/check_deps.sh

@ -80,7 +80,7 @@ fn_install_mono_repo() {
if [ "${monoautoinstall}" != "1" ]; then if [ "${monoautoinstall}" != "1" ]; then
if [ $? != 0 ]; then if [ $? != 0 ]; then
fn_print_failure_nl "Unable to install Mono repository." 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 else
fn_print_complete_nl "Installing Mono repository completed." fn_print_complete_nl "Installing Mono repository completed."
fn_script_log_pass "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_print_warn "Missing dependencies: ${red}${array_deps_missing[*]}${default}"
fn_script_log_warn "Missing dependencies: ${array_deps_missing[*]}" fn_script_log_warn "Missing dependencies: ${array_deps_missing[*]}"
fi fi
fn_sleep_time
# Attempt automatic dependency installation # Attempt automatic dependency installation
if [ "${autoinstall}" == "1" ]; then if [ "${autoinstall}" == "1" ]; then
@ -216,7 +215,7 @@ fn_install_missing_deps() {
if [ "${steamcmdfail}" ]; then if [ "${steamcmdfail}" ]; then
if [ "${commandname}" == "INSTALL" ]; then if [ "${commandname}" == "INSTALL" ]; then
fn_print_failure_nl "Missing dependencies required to run SteamCMD." 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 core_exit.sh
else else
fn_print_error_nl "Missing dependencies required to run SteamCMD." fn_print_error_nl "Missing dependencies required to run SteamCMD."
@ -336,15 +335,14 @@ fn_deps_detector() {
if [ "${commandname}" == "INSTALL" ]; then if [ "${commandname}" == "INSTALL" ]; then
if [ "$(whoami)" == "root" ]; then if [ "$(whoami)" == "root" ]; then
echo -e "" echo -e ""
echo -e "${lightyellow}Checking Dependencies as root${default}" echo -e "${bold}${lightyellow}Checking ${gamename} Dependencies as root${default}"
echo -e "=================================" fn_messages_separator
fn_print_information_nl "Checking any missing dependencies for ${gamename} server only." fn_print_information_nl "Checking any missing dependencies for ${gamename} server only."
fn_print_information_nl "This will NOT install a ${gamename} server." fn_print_information_nl "This will NOT install a ${gamename} server."
fn_sleep_time
else else
echo -e "" echo -e ""
echo -e "${lightyellow}Checking Dependencies${default}" echo -e "${bold}${lightyellow}Checking ${gamename} Dependencies${default}"
echo -e "=================================" fn_messages_separator
fi fi
fi fi

2
lgsm/modules/check_executable.sh

@ -20,7 +20,7 @@ if [ ! -f "${executabledir}/${execname}" ]; then
fn_print_fail_nl "executable was not found" fn_print_fail_nl "executable was not found"
echo -e "* ${executabledir}/${execname}" echo -e "* ${executabledir}/${execname}"
if [ -d "${lgsmlogdir}" ]; then 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 fi
unset exitbypass unset exitbypass
core_exit.sh core_exit.sh

8
lgsm/modules/check_permissions.sh

@ -25,7 +25,7 @@ fn_check_ownership() {
fi fi
if [ "${selfownissue}" == "1" ] || [ "${funcownissue}" == "1" ] || [ "${filesownissue}" == "1" ]; then if [ "${selfownissue}" == "1" ] || [ "${funcownissue}" == "1" ] || [ "${filesownissue}" == "1" ]; then
fn_print_fail_nl "Ownership issues found" 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_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:" 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 [ -d "${modulesdir}" ]; then
if [ "$(find "${modulesdir}" -type f -not -executable | wc -l)" -ne "0" ]; then if [ "$(find "${modulesdir}" -type f -not -executable | wc -l)" -ne "0" ]; then
fn_print_fail_nl "Permissions issues found" 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_print_information_nl "The following files are not executable:"
fn_script_log_info "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}" grouprootdirperm="${rootdirperm:1:1}"
if [ "${userrootdirperm}" != "7" ] && [ "${grouprootdirperm}" != "7" ]; then if [ "${userrootdirperm}" != "7" ] && [ "${grouprootdirperm}" != "7" ]; then
fn_print_fail_nl "Permissions issues found" 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_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 "The following directory does not have the correct permissions:"
fn_script_log_info "${rootdir}" fn_script_log_info "${rootdir}"
@ -198,7 +198,7 @@ fn_sys_perm_errors_fix() {
if [ "${sysdirpermerror}" == "1" ] || [ "${classdirpermerror}" == "1" ] || [ "${netdirpermerror}" == "1" ]; then if [ "${sysdirpermerror}" == "1" ] || [ "${classdirpermerror}" == "1" ] || [ "${netdirpermerror}" == "1" ]; then
fn_print_error "Could not fix /sys permissions" fn_print_error "Could not fix /sys permissions"
fn_script_log_error "Could not fix /sys permissions." fn_script_log_error "Could not fix /sys permissions."
fn_sleep_time
# Show the user how to fix. # Show the user how to fix.
fn_sys_perm_fix_manually_msg fn_sys_perm_fix_manually_msg
else else

2
lgsm/modules/check_root.sh

@ -11,7 +11,7 @@ if [ "$(whoami)" == "root" ]; then
if [ "${commandname}" != "INSTALL" ]; then if [ "${commandname}" != "INSTALL" ]; then
fn_print_fail_nl "Do NOT run this script as root!" fn_print_fail_nl "Do NOT run this script as root!"
if [ -d "${lgsmlogdir}" ]; then 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 else
# Forces exit code is log does not yet exist. # Forces exit code is log does not yet exist.
exitcode=1 exitcode=1

4
lgsm/modules/check_system_dir.sh

@ -10,7 +10,7 @@ moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
if [ ! -d "${serverfiles}" ]; then if [ ! -d "${serverfiles}" ]; then
fn_print_fail_nl "Cannot access ${serverfiles}: No such directory" fn_print_fail_nl "Cannot access ${serverfiles}: No such directory"
if [ -d "${lgsmlogdir}" ]; then 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 fi
core_exit.sh core_exit.sh
fi fi
@ -18,7 +18,7 @@ fi
if [ ! -d "${systemdir}" ]; then if [ ! -d "${systemdir}" ]; then
fn_print_fail_nl "Cannot access ${systemdir}: No such directory" fn_print_fail_nl "Cannot access ${systemdir}: No such directory"
if [ -d "${lgsmlogdir}" ]; then 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 fi
core_exit.sh core_exit.sh
fi fi

4
lgsm/modules/check_tmuxception.sh

@ -10,7 +10,7 @@ moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
fn_check_is_in_tmux() { fn_check_is_in_tmux() {
if [ "${TMUX}" ]; then if [ "${TMUX}" ]; then
fn_print_fail_nl "tmuxception error: Sorry Cobb you cannot start a tmux session inside of a tmux session." 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." 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 "It is not possible to run a tmux session inside another tmux session"
echo -e "https://docs.linuxgsm.com/requirements/tmux#tmuxception" echo -e "https://docs.linuxgsm.com/requirements/tmux#tmuxception"
@ -21,7 +21,7 @@ fn_check_is_in_tmux() {
fn_check_is_in_screen() { fn_check_is_in_screen() {
if [ "${STY}" ]; then if [ "${STY}" ]; then
fn_print_fail_nl "tmuxception error: Sorry Cobb you cannot start a tmux session inside of a screen session." 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." 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 "It is not possible to run a tmux session inside screen session"
echo -e "https://docs.linuxgsm.com/requirements/tmux#tmuxception" echo -e "https://docs.linuxgsm.com/requirements/tmux#tmuxception"

10
lgsm/modules/command_backup.sh

@ -148,7 +148,7 @@ fn_backup_compression() {
# Check that excludedir is a valid path. # Check that excludedir is a valid path.
if [ ! -d "${excludedir}" ]; then if [ ! -d "${excludedir}" ]; then
fn_print_fail_nl "Problem identifying the previous backup directory for exclusion." 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 core_exit.sh
fi fi
@ -156,10 +156,10 @@ fn_backup_compression() {
local exitcode=$? local exitcode=$?
if [ "${exitcode}" != 0 ]; then if [ "${exitcode}" != 0 ]; then
fn_print_fail_eol 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}" echo -e "${extractcmd}" | tee -a "${lgsmlog}"
fn_print_fail_nl "Starting backup" fn_print_fail_nl "Starting backup"
fn_script_log_fatal "Starting backup" fn_script_log_fail "Starting backup"
else else
fn_print_ok_eol fn_print_ok_eol
fn_print_ok_nl "Completed: ${backupname}.tar.gz, total size $(du -sh "${backupdir}/${backupname}.tar.gz" | awk '{print $1}')" 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")) declare -a rdirtoks=($(readlink -f "${rootdir}" | sed "s/\// /g"))
if [ ${#rdirtoks[@]} -eq 0 ]; then if [ ${#rdirtoks[@]} -eq 0 ]; then
fn_print_fail_nl "Problem assessing rootdir during relative path assessment" 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 core_exit.sh
fi fi
@ -225,7 +225,7 @@ fn_backup_relpath() {
declare -a bdirtoks=($(readlink -f "${backupdir}" | sed "s/\// /g")) declare -a bdirtoks=($(readlink -f "${backupdir}" | sed "s/\// /g"))
if [ ${#bdirtoks[@]} -eq 0 ]; then if [ ${#bdirtoks[@]} -eq 0 ]; then
fn_print_fail_nl "Problem assessing backupdir during relative path assessment" 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 core_exit.sh
fi fi

2
lgsm/modules/command_debug.sh

@ -82,7 +82,7 @@ echo -e ""
echo -e "Use debug for identifying server issues only!" echo -e "Use debug for identifying server issues only!"
echo -e "Press CTRL+c to drop out of debug mode." echo -e "Press CTRL+c to drop out of debug mode."
fn_print_warning_nl "If ${selfname} is already running it will be stopped." fn_print_warning_nl "If ${selfname} is already running it will be stopped."
echo -e ""
if ! fn_prompt_yn "Continue?" Y; then if ! fn_prompt_yn "Continue?" Y; then
exitcode=0 exitcode=0
core_exit.sh core_exit.sh

6
lgsm/modules/command_dev_clear_modules.sh

@ -10,9 +10,9 @@ commandaction="Clearing modules"
moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
fn_firstcommand_set fn_firstcommand_set
echo -e "=================================" echo -e ""
echo -e "Clear Modules" echo -e "${bold}${lightyellow}Clear Modules${default}"
echo -e "=================================" fn_messages_separator
echo -e "" echo -e ""
if fn_prompt_yn "Do you want to delete all modules?" Y; then if fn_prompt_yn "Do you want to delete all modules?" Y; then
rm -rfv "${modulesdir:?}/"* rm -rfv "${modulesdir:?}/"*

10
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}") carriagereturn=$(file -b "${servercfgfullpath}" | grep -q CRLF && echo "${red}CRLF${default}" || echo "${lightgreen}LF${default}")
echo -e "" echo -e ""
echo -e "${lightgreen}Server Details${default}" echo -e "${bold}${lightgreen}Server Details${default}"
echo -e "==================================================================" fn_messages_separator
echo -e "" echo -e ""
echo -e "Game: ${gamename}" echo -e "Game: ${gamename}"
@ -76,8 +76,8 @@ missing_details=""
# Loop through the server details and output them. # Loop through the server details and output them.
echo -e "" echo -e ""
echo -e "${lightgreen}Available Server Details${default}" echo -e "${bold}${lightgreen}Available Server Details${default}"
echo -e "=================================" fn_messages_separator
for key in "${!server_details[@]}"; do for key in "${!server_details[@]}"; do
value=${server_details[$key]} value=${server_details[$key]}
if [ -z "$value" ]; then if [ -z "$value" ]; then
@ -91,7 +91,7 @@ done
if [ -n "$missing_details" ]; then if [ -n "$missing_details" ]; then
echo -e "" echo -e ""
echo -e "${lightgreen}Missing Server Details${default}" echo -e "${lightgreen}Missing Server Details${default}"
echo -e "=================================" fn_messages_separator
echo -e "${missing_details}" echo -e "${missing_details}"
fi fi

20
lgsm/modules/command_dev_detect_deps.sh

@ -10,9 +10,9 @@ commandaction="Developer detect deps"
moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
fn_firstcommand_set fn_firstcommand_set
echo -e "=================================" echo -e ""
echo -e "Dependencies Checker" echo -e "${bold}Dependencies Checker${default}"
echo -e "=================================" fn_messages_separator
echo -e "Checking directory: " echo -e "Checking directory: "
echo -e "${serverfiles}" echo -e "${serverfiles}"
if [ "$(command -v eu-readelf 2> /dev/null)" ]; then 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" awk -vORS='' '{ print $1,$2 }' "${tmpdir}/.depdetect_debian_list_uniq" > "${tmpdir}/.depdetect_debian_line"
echo -e "" echo -e ""
echo -e "" echo -e ""
echo -e "Required Dependencies" echo -e "${bold}Required Dependencies${default}"
echo -e "=================================" fn_messages_separator
echo -e "${executable}" echo -e "${executable}"
echo -e "" echo -e ""
echo -e "CentOS" echo -e "CentOS"
echo -e "=================================" fn_messages_separator
cat "${tmpdir}/.depdetect_centos_line" cat "${tmpdir}/.depdetect_centos_line"
echo -e "" echo -e ""
echo -e "" echo -e ""
echo -e "Ubuntu" echo -e "Ubuntu"
echo -e "=================================" fn_messages_separator
cat "${tmpdir}/.depdetect_ubuntu_line" cat "${tmpdir}/.depdetect_ubuntu_line"
echo -e "" echo -e ""
echo -e "" echo -e ""
echo -e "Debian" echo -e "Debian"
echo -e "=================================" fn_messages_separator
cat "${tmpdir}/.depdetect_debian_line" cat "${tmpdir}/.depdetect_debian_line"
echo -e "" echo -e ""
if [ "${unknownlib}" == "1" ]; then if [ "${unknownlib}" == "1" ]; then
echo -e "" echo -e ""
echo -e "Unknown shared Library" echo -e "Unknown shared Library"
echo -e "=================================" fn_messages_separator
cat "${tmpdir}/.depdetect_unknown" cat "${tmpdir}/.depdetect_unknown"
fi fi
echo -e "" echo -e ""
echo -e "Required Librarys" echo -e "Required Librarys"
echo -e "=================================" fn_messages_separator
sort "${tmpdir}/.depdetect_readelf" | uniq sort "${tmpdir}/.depdetect_readelf" | uniq
echo -en "\n" echo -en "\n"
rm -f "${tmpdir:?}/.depdetect_centos_line" rm -f "${tmpdir:?}/.depdetect_centos_line"

10
lgsm/modules/command_dev_detect_glibc.sh

@ -11,13 +11,13 @@ commandaction="Developer detect glibc"
moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
fn_firstcommand_set fn_firstcommand_set
echo -e "=================================" fn_messages_separator
echo -e "glibc Requirements Checker" echo -e "glibc Requirements Checker"
echo -e "=================================" fn_messages_separator
if [ ! "$(command -v objdump 2> /dev/null)" ]; then if [ ! "$(command -v objdump 2> /dev/null)" ]; then
fn_print_failure_nl "objdump is missing" fn_print_failure_nl "objdump is missing"
fn_script_log_fatal "objdump is missing" fn_script_log_fail "objdump is missing"
core_exit.sh core_exit.sh
fi fi
@ -59,7 +59,7 @@ for glibc_check_var in "${glibc_check_dir_array[@]}"; do
echo -e "" echo -e ""
echo -e "" echo -e ""
echo -e "${glibc_check_name} glibc Requirements" echo -e "${glibc_check_name} glibc Requirements"
echo -e "=================================" fn_messages_separator
if [ -f "${tmpdir}/detect_glibc_files_${glibc_check_var}.tmp" ]; then if [ -f "${tmpdir}/detect_glibc_files_${glibc_check_var}.tmp" ]; then
echo -e "Required glibc" 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" 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 done
echo -e "" echo -e ""
echo -e "Final glibc Requirement" echo -e "Final glibc Requirement"
echo -e "=================================" fn_messages_separator
if [ -f "${tmpdir}/detect_glibc_highest.tmp" ]; then if [ -f "${tmpdir}/detect_glibc_highest.tmp" ]; then
cat "${tmpdir}/detect_glibc_highest.tmp" | sort | uniq | sort -r --version-sort | head -1 cat "${tmpdir}/detect_glibc_highest.tmp" | sort | uniq | sort -r --version-sort | head -1
rm -f "${tmpdir:?}/detect_glibc_highest.tmp" rm -f "${tmpdir:?}/detect_glibc_highest.tmp"

8
lgsm/modules/command_dev_detect_ldd.sh

@ -11,9 +11,9 @@ commandaction="Developer detect ldd"
moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
fn_firstcommand_set fn_firstcommand_set
echo -e "=================================" fn_messages_separator
echo -e "Shared Object dependencies Checker" echo -e "Shared Object dependencies Checker"
echo -e "=================================" fn_messages_separator
if [ -z "${serverfiles}" ]; then if [ -z "${serverfiles}" ]; then
dir=$(dirname "$(readlink -f "${BASH_SOURCE[0]}")") dir=$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")
@ -47,12 +47,12 @@ find "${serverfiles}" -type f -print0 \
echo -e "" echo -e ""
echo -e "" echo -e ""
echo -e "All" echo -e "All"
echo -e "=================================" fn_messages_separator
cat "${tmpdir}/detect_ldd.tmp" cat "${tmpdir}/detect_ldd.tmp"
echo -e "" echo -e ""
echo -e "Not Found" echo -e "Not Found"
echo -e "=================================" fn_messages_separator
cat "${tmpdir}/detect_ldd_not_found.tmp" cat "${tmpdir}/detect_ldd_not_found.tmp"
rm -f "${tmpdir:?}/detect_ldd.tmp" rm -f "${tmpdir:?}/detect_ldd.tmp"

20
lgsm/modules/command_dev_query_raw.sh

@ -17,14 +17,14 @@ info_messages.sh
echo -e "" echo -e ""
echo -e "${lightgreen}Query IP Addresses${default}" echo -e "${lightgreen}Query IP Addresses${default}"
echo -e "==================================================================" fn_messages_separator
echo -e "" echo -e ""
for queryip in "${queryips[@]}"; do for queryip in "${queryips[@]}"; do
echo -e "${queryip}" echo -e "${queryip}"
done done
echo -e "" echo -e ""
echo -e "${lightgreen}Game Server Ports${default}" echo -e "${lightgreen}Game Server Ports${default}"
echo -e "==================================================================" fn_messages_separator
{ {
echo -e "${lightblue}Port Name \tPort Number \tStatus \tTCP \tUDP${default}" echo -e "${lightblue}Port Name \tPort Number \tStatus \tTCP \tUDP${default}"
if [ -v port ]; then if [ -v port ]; then
@ -184,18 +184,18 @@ echo -e "=================================================================="
| column -s $'\t' -t | column -s $'\t' -t
echo -e "" echo -e ""
echo -e "${lightgreen}SS Output${default}" echo -e "${lightgreen}SS Output${default}"
echo -e "=================================" fn_messages_separator
fn_info_message_ports fn_info_message_ports
eval "${portcommand}" eval "${portcommand}"
echo -e "" echo -e ""
echo -e "${lightgreen}Query Port - Raw Output${default}" echo -e "${lightgreen}Query Port - Raw Output${default}"
echo -e "==================================================================" fn_messages_separator
echo -e "" echo -e ""
echo -e "PORT: ${port}" echo -e "PORT: ${port}"
echo -e "QUERY PORT: ${queryport}" echo -e "QUERY PORT: ${queryport}"
echo -e "" echo -e ""
echo -e "${lightgreen}Gamedig Raw Output${default}" echo -e "${lightgreen}Gamedig Raw Output${default}"
echo -e "=================================" fn_messages_separator
echo -e "" echo -e ""
if [ ! "$(command -v gamedig 2> /dev/null)" ]; then if [ ! "$(command -v gamedig 2> /dev/null)" ]; then
fn_print_failure_nl "gamedig not installed" fn_print_failure_nl "gamedig not installed"
@ -211,7 +211,7 @@ for queryip in "${queryips[@]}"; do
done done
echo -e "" echo -e ""
echo -e "${lightgreen}gsquery Raw Output${default}" echo -e "${lightgreen}gsquery Raw Output${default}"
echo -e "=================================" fn_messages_separator
echo -e "" echo -e ""
for queryip in "${queryips[@]}"; do for queryip in "${queryips[@]}"; do
echo -e "./query_gsquery.py -a \"${queryip}\" -p \"${queryport}\" -e \"${querytype}\"" echo -e "./query_gsquery.py -a \"${queryip}\" -p \"${queryport}\" -e \"${querytype}\""
@ -223,7 +223,7 @@ for queryip in "${queryips[@]}"; do
done done
echo -e "" echo -e ""
echo -e "${lightgreen}TCP Raw Output${default}" echo -e "${lightgreen}TCP Raw Output${default}"
echo -e "=================================" fn_messages_separator
echo -e "" echo -e ""
for queryip in "${queryips[@]}"; do for queryip in "${queryips[@]}"; do
echo -e "bash -c 'exec 3<> /dev/tcp/'${queryip}'/'${queryport}''" echo -e "bash -c 'exec 3<> /dev/tcp/'${queryip}'/'${queryport}''"
@ -239,10 +239,10 @@ for queryip in "${queryips[@]}"; do
done done
echo -e "" echo -e ""
echo -e "${lightgreen}Game Port - Raw Output${default}" echo -e "${lightgreen}Game Port - Raw Output${default}"
echo -e "==================================================================" fn_messages_separator
echo -e "" echo -e ""
echo -e "${lightgreen}TCP Raw Output${default}" echo -e "${lightgreen}TCP Raw Output${default}"
echo -e "=================================" fn_messages_separator
echo -e "" echo -e ""
for queryip in "${queryips[@]}"; do for queryip in "${queryips[@]}"; do
echo -e "bash -c 'exec 3<> /dev/tcp/'${queryip}'/'${port}''" echo -e "bash -c 'exec 3<> /dev/tcp/'${queryip}'/'${port}''"
@ -258,7 +258,7 @@ for queryip in "${queryips[@]}"; do
done done
echo -e "" echo -e ""
echo -e "${lightgreen}Steam Master Server Response${default}" echo -e "${lightgreen}Steam Master Server Response${default}"
echo -e "==================================================================" fn_messages_separator
echo -e "" echo -e ""
echo -e "curl -m 3 -s https://api.steampowered.com/ISteamApps/GetServersAtAddress/v0001?addr=${publicip}" echo -e "curl -m 3 -s https://api.steampowered.com/ISteamApps/GetServersAtAddress/v0001?addr=${publicip}"
echo -e "" echo -e ""

30
lgsm/modules/command_fastdl.sh

@ -26,7 +26,7 @@ luafastdlfullpath="${luasvautorundir}/${luafastdlfile}"
# Check if bzip2 is installed. # Check if bzip2 is installed.
if [ ! "$(command -v bzip2 2> /dev/null)" ]; then if [ ! "$(command -v bzip2 2> /dev/null)" ]; then
fn_print_fail "bzip2 is not installed" 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 core_exit.sh
fi fi
@ -37,7 +37,7 @@ echo -e ""
# Prompts user for FastDL creation settings. # Prompts user for FastDL creation settings.
echo -e "${commandaction} setup" echo -e "${commandaction} setup"
echo -e "=================================" fn_messages_separator
# Prompt for clearing old files if directory was already here. # Prompt for clearing old files if directory was already here.
if [ -d "${fastdldir}" ]; then if [ -d "${fastdldir}" ]; then
@ -72,7 +72,7 @@ fn_clear_old_fastdl() {
exitcode=$? exitcode=$?
if [ "${exitcode}" != 0 ]; then if [ "${exitcode}" != 0 ]; then
fn_print_fail_eol_nl 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 core_exit.sh
else else
fn_print_ok_eol_nl fn_print_ok_eol_nl
@ -89,7 +89,7 @@ fn_fastdl_dirs() {
exitcode=$? exitcode=$?
if [ "${exitcode}" != 0 ]; then if [ "${exitcode}" != 0 ]; then
fn_print_fail_eol_nl fn_print_fail_eol_nl
fn_script_log_fatal "Creating web directory ${webdir}" fn_script_log_fail "Creating web directory ${webdir}"
core_exit.sh core_exit.sh
else else
fn_print_ok_eol_nl fn_print_ok_eol_nl
@ -102,7 +102,7 @@ fn_fastdl_dirs() {
exitcode=$? exitcode=$?
if [ "${exitcode}" != 0 ]; then if [ "${exitcode}" != 0 ]; then
fn_print_fail_eol_nl fn_print_fail_eol_nl
fn_script_log_fatal "Creating fastdl directory ${fastdldir}" fn_script_log_fail "Creating fastdl directory ${fastdldir}"
core_exit.sh core_exit.sh
else else
fn_print_ok_eol_nl fn_print_ok_eol_nl
@ -218,13 +218,13 @@ fn_fastdl_preview() {
exitcode=$? exitcode=$?
if [ "${exitcode}" != 0 ]; then if [ "${exitcode}" != 0 ]; then
fn_print_fail_eol_nl fn_print_fail_eol_nl
fn_script_log_fatal "Calculating total file size." fn_script_log_fail "Calculating total file size."
core_exit.sh core_exit.sh
fi fi
done < "${tmpdir}/fastdl_files_to_compress.txt" done < "${tmpdir}/fastdl_files_to_compress.txt"
else else
fn_print_fail_eol_nl "generating file list" 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 core_exit.sh
fi fi
echo -e "about to compress ${totalfiles} files, total size $(fn_human_readable_file_size ${filesizetotal} 0)" echo -e "about to compress ${totalfiles} files, total size $(fn_human_readable_file_size ${filesizetotal} 0)"
@ -251,7 +251,7 @@ fn_fastdl_gmod() {
exitcode=$? exitcode=$?
if [ "${exitcode}" != 0 ]; then if [ "${exitcode}" != 0 ]; then
fn_print_fail_eol_nl fn_print_fail_eol_nl
fn_script_log_fatal "Copying ${fastdlfile} > ${fastdldir}" fn_script_log_fail "Copying ${fastdlfile} > ${fastdldir}"
core_exit.sh core_exit.sh
else else
fn_script_log_pass "Copying ${fastdlfile} > ${fastdldir}" fn_script_log_pass "Copying ${fastdlfile} > ${fastdldir}"
@ -268,7 +268,7 @@ fn_fastdl_gmod() {
exitcode=$? exitcode=$?
if [ "${exitcode}" != 0 ]; then if [ "${exitcode}" != 0 ]; then
fn_print_fail_eol_nl fn_print_fail_eol_nl
fn_script_log_fatal "Updating addons file structure" fn_script_log_fail "Updating addons file structure"
core_exit.sh core_exit.sh
else else
fn_print_ok_eol_nl fn_print_ok_eol_nl
@ -281,7 +281,7 @@ fn_fastdl_gmod() {
exitcode=$? exitcode=$?
if [ "${exitcode}" != 0 ]; then if [ "${exitcode}" != 0 ]; then
fn_print_fail_eol_nl 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 core_exit.sh
else else
fn_print_ok_eol_nl fn_print_ok_eol_nl
@ -296,7 +296,7 @@ fn_fastdl_gmod() {
exitcode=$? exitcode=$?
if [ "${exitcode}" != 0 ]; then if [ "${exitcode}" != 0 ]; then
fn_print_fail_eol_nl fn_print_fail_eol_nl
fn_script_log_fatal "Correcting DarkRP files" fn_script_log_fail "Correcting DarkRP files"
core_exit.sh core_exit.sh
else else
fn_print_ok_eol_nl fn_print_ok_eol_nl
@ -347,7 +347,7 @@ fn_fastdl_source() {
exitcode=$? exitcode=$?
if [ "${exitcode}" != 0 ]; then if [ "${exitcode}" != 0 ]; then
fn_print_fail_eol_nl fn_print_fail_eol_nl
fn_script_log_fatal "Copying ${fastdlfile} > ${fastdldir}/${copytodir}" fn_script_log_fail "Copying ${fastdlfile} > ${fastdldir}/${copytodir}"
core_exit.sh core_exit.sh
else else
fn_script_log_pass "Copying ${fastdlfile} > ${fastdldir}/${copytodir}" fn_script_log_pass "Copying ${fastdlfile} > ${fastdldir}/${copytodir}"
@ -383,7 +383,7 @@ fn_fastdl_gmod_dl_enforcer() {
exitcode=$? exitcode=$?
if [ "${exitcode}" != 0 ]; then if [ "${exitcode}" != 0 ]; then
fn_print_fail_eol_nl 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 core_exit.sh
else else
fn_print_ok_eol_nl fn_print_ok_eol_nl
@ -401,7 +401,7 @@ fn_fastdl_gmod_dl_enforcer() {
exitcode=$? exitcode=$?
if [ "${exitcode}" != 0 ]; then if [ "${exitcode}" != 0 ]; then
fn_print_fail_eol_nl 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 core_exit.sh
else else
fn_print_ok_eol_nl fn_print_ok_eol_nl
@ -418,7 +418,7 @@ fn_fastdl_bzip2() {
exitcode=$? exitcode=$?
if [ "${exitcode}" != 0 ]; then if [ "${exitcode}" != 0 ]; then
fn_print_fail_eol_nl fn_print_fail_eol_nl
fn_script_log_fatal "Compressing ${filetocompress}" fn_script_log_fail "Compressing ${filetocompress}"
core_exit.sh core_exit.sh
else else
fn_script_log_pass "Compressing ${filetocompress}" fn_script_log_pass "Compressing ${filetocompress}"

2
lgsm/modules/command_install_resources_mta.sh

@ -13,7 +13,7 @@ fn_firstcommand_set
fn_install_resources() { fn_install_resources() {
echo -e "" echo -e ""
echo -e "${lightyellow}Installing Default Resources${default}" 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_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}" fn_dl_extract "${tmpdir}" "mtasa-resources-latest.zip" "${resourcesdir}"
echo -e "Default Resources Installed." echo -e "Default Resources Installed."

6
lgsm/modules/command_mods_install.sh

@ -19,7 +19,7 @@ fn_print_header
fn_mods_installed_list fn_mods_installed_list
if [ "${installedmodscount}" -gt "0" ]; then if [ "${installedmodscount}" -gt "0" ]; then
echo -e "Installed addons/mods" echo -e "Installed addons/mods"
echo -e "=================================" fn_messages_separator
# Go through all available commands, get details and display them to the user. # Go through all available commands, get details and display them to the user.
for ((llindex = 0; llindex < ${#installedmodslist[@]}; llindex++)); do for ((llindex = 0; llindex < ${#installedmodslist[@]}; llindex++)); do
# Current mod is the "llindex" value of the array we're going through. # Current mod is the "llindex" value of the array we're going through.
@ -32,7 +32,7 @@ if [ "${installedmodscount}" -gt "0" ]; then
fi fi
echo -e "Available addons/mods" echo -e "Available addons/mods"
echo -e "=================================" fn_messages_separator
# Display available mods from mods_list.sh. # Display available mods from mods_list.sh.
# Set and reset vars # Set and reset vars
compatiblemodslistindex=0 compatiblemodslistindex=0
@ -78,7 +78,7 @@ fn_mod_get_info
echo -e "" echo -e ""
echo -e "Installing ${modprettyname}" echo -e "Installing ${modprettyname}"
echo -e "=================================" fn_messages_separator
fn_script_log_info "${modprettyname} selected for install" fn_script_log_info "${modprettyname} selected for install"
# Check if the mod is already installed and warn the user. # Check if the mod is already installed and warn the user.

8
lgsm/modules/command_mods_remove.sh

@ -16,7 +16,7 @@ fn_mods_check_installed
fn_print_header fn_print_header
echo -e "Remove addons/mods" echo -e "Remove addons/mods"
echo -e "=================================" fn_messages_separator
# Displays list of installed mods. # Displays list of installed mods.
# Generates list to display to user. # Generates list to display to user.
@ -72,7 +72,7 @@ while [ "${modfileline}" -le "${modsfilelistsize}" ]; do
rm -rf "${modinstalldir:?}/${currentfileremove:?}" rm -rf "${modinstalldir:?}/${currentfileremove:?}"
((exitcode = $?)) ((exitcode = $?))
if [ "${exitcode}" != 0 ]; then if [ "${exitcode}" != 0 ]; then
fn_script_log_fatal "Removing ${modinstalldir}/${currentfileremove}" fn_script_log_fail "Removing ${modinstalldir}/${currentfileremove}"
break break
else else
fn_script_log_pass "Removing ${modinstalldir}/${currentfileremove}" fn_script_log_pass "Removing ${modinstalldir}/${currentfileremove}"
@ -103,7 +103,7 @@ fn_sleep_time
rm -rf "${modsdir:?}/${modcommand}-files.txt" rm -rf "${modsdir:?}/${modcommand}-files.txt"
exitcode=$? exitcode=$?
if [ "${exitcode}" != 0 ]; then 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 fn_print_fail_eol_nl
core_exit.sh core_exit.sh
else else
@ -118,7 +118,7 @@ fn_sleep_time
sed -i "/^${modcommand}$/d" "${modsinstalledlistfullpath}" sed -i "/^${modcommand}$/d" "${modsinstalledlistfullpath}"
exitcode=$? exitcode=$?
if [ "${exitcode}" != 0 ]; then 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 fn_print_fail_eol_nl
core_exit.sh core_exit.sh
else else

2
lgsm/modules/command_mods_update.sh

@ -97,7 +97,7 @@ while [ "${installedmodsline}" -le "${installedmodscount}" ]; do
((installedmodsline++)) ((installedmodsline++))
else else
fn_print_fail "No mod was selected" 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" exitcode="1"
core_exit.sh core_exit.sh
fi fi

2
lgsm/modules/command_monitor.sh

@ -206,7 +206,7 @@ fn_monitor_check_session() {
else else
fn_print_error "Checking session: " fn_print_error "Checking session: "
fn_print_fail_eol_nl fn_print_fail_eol_nl
fn_script_log_fatal "Checking session: FAIL" fn_script_log_fail "Checking session: FAIL"
alert="restart" alert="restart"
alert.sh alert.sh
fn_script_log_info "Checking session: Monitor is restarting ${selfname}" fn_script_log_info "Checking session: Monitor is restarting ${selfname}"

2
lgsm/modules/command_skeleton.sh

@ -18,7 +18,7 @@ find "${rootdir}" -type d -not \( -path ./skel -prune \) | cpio -pdvm skel 2> /d
exitcode=$? exitcode=$?
if [ "${exitcode}" != 0 ]; then if [ "${exitcode}" != 0 ]; then
fn_print_fail_nl "Creating skeleton directory" fn_print_fail_nl "Creating skeleton directory"
fn_script_log_fatal "Creating skeleton directory" fn_script_log_fail "Creating skeleton directory"
else else
fn_print_ok_nl "Creating skeleton directory: ./skel" fn_print_ok_nl "Creating skeleton directory: ./skel"
fn_script_log_pass "Creating skeleton directory: ./skel" fn_script_log_pass "Creating skeleton directory: ./skel"

2
lgsm/modules/command_sponsor.sh

@ -12,7 +12,7 @@ fn_firstcommand_set
fn_print_ascii_logo fn_print_ascii_logo
echo -e "${lightyellow}Support LinuxGSM${default}" echo -e "${lightyellow}Support LinuxGSM${default}"
echo -e "=================================" fn_messages_separator
echo -e "" echo -e ""
echo -e "Been using LinuxGSM?" echo -e "Been using LinuxGSM?"
echo -e "Consider sponsoring to support development." echo -e "Consider sponsoring to support development."

10
lgsm/modules/command_start.sh

@ -120,24 +120,24 @@ fn_start_tmux() {
check_status.sh check_status.sh
if [ "${status}" == "0" ]; then if [ "${status}" == "0" ]; then
fn_print_fail_nl "Unable to start ${servername}" 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 if [ -s "${lgsmlogdir}/.${selfname}-tmux-error.tmp" ]; then
fn_print_fail_nl "Unable to start ${servername}: tmux error:" 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 ""
echo -e "Command" 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 "tmux -L \"${sessionname}\" new-session -d -s \"${sessionname}\" \"${preexecutable} ${executable} ${startparameters}\"" | tee -a "${lgsmlog}"
echo -e "" echo -e ""
echo -e "Error" echo -e "Error"
echo -e "=================================" fn_messages_separator
tee -a "${lgsmlog}" < "${lgsmlogdir}/.${selfname}-tmux-error.tmp" tee -a "${lgsmlog}" < "${lgsmlogdir}/.${selfname}-tmux-error.tmp"
# Detected error https://linuxgsm.com/support # Detected error https://linuxgsm.com/support
if grep -c "Operation not permitted" "${lgsmlogdir}/.${selfname}-tmux-error.tmp"; then if grep -c "Operation not permitted" "${lgsmlogdir}/.${selfname}-tmux-error.tmp"; then
echo -e "" echo -e ""
echo -e "Fix" echo -e "Fix"
echo -e "=================================" fn_messages_separator
if ! grep "tty:" /etc/group | grep "$(whoami)"; then if ! grep "tty:" /etc/group | grep "$(whoami)"; then
echo -e "$(whoami) is not part of the tty group." echo -e "$(whoami) is not part of the tty group."
fn_script_log_info "$(whoami) is not part of the tty group." fn_script_log_info "$(whoami) is not part of the tty group."

2
lgsm/modules/command_stop.sh

@ -248,7 +248,7 @@ fn_stop_tmux() {
fn_script_log_pass "Stopped ${servername}" fn_script_log_pass "Stopped ${servername}"
else else
fn_print_fail_nl "Unable to stop ${servername}" 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 fi
} }

20
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 curl --connect-timeout 10 -IsfL "https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/linuxgsm.sh" 1> /dev/null
if [ $? != "0" ]; then if [ $? != "0" ]; then
fn_print_fail_nl "Selecting repo: Unable to to access GitHub or Bitbucket repositories" 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 core_exit.sh
else else
remotereponame="Bitbucket" remotereponame="Bitbucket"
@ -44,8 +44,8 @@ else
fi fi
if [ $? != "0" ]; then if [ $? != "0" ]; then
fn_print_fail_eol_nl fn_print_fail_eol_nl
fn_script_log_fatal "Checking ${remotereponame} linuxgsm.sh" fn_script_log_fail "Checking ${remotereponame} linuxgsm.sh"
fn_script_log_fatal "Curl returned error: $?" fn_script_log_fail "Curl returned error: $?"
core_exit.sh core_exit.sh
fi fi
@ -82,7 +82,7 @@ if [ "${script_diff}" != "" ]; then
cp "${rootdir}/${selfname}" "${backupdir}/script/${selfname}-$(date +"%m_%d_%Y_%M").bak" cp "${rootdir}/${selfname}" "${backupdir}/script/${selfname}-$(date +"%m_%d_%Y_%M").bak"
if [ $? != 0 ]; then if [ $? != 0 ]; then
fn_print_fail_eol_nl fn_print_fail_eol_nl
fn_script_log_fatal "Backup ${selfname}" fn_script_log_fail "Backup ${selfname}"
core_exit.sh core_exit.sh
else else
fn_print_ok_eol_nl fn_print_ok_eol_nl
@ -103,7 +103,7 @@ if [ "${script_diff}" != "" ]; then
if [ $? != "0" ]; then if [ $? != "0" ]; then
fn_print_fail_eol_nl fn_print_fail_eol_nl
fn_script_log_fatal "copying ${selfname}" fn_script_log_fail "copying ${selfname}"
core_exit.sh core_exit.sh
else else
fn_print_ok_eol_nl fn_print_ok_eol_nl
@ -124,8 +124,8 @@ else
fi fi
if [ $? != "0" ]; then if [ $? != "0" ]; then
fn_print_fail_eol_nl fn_print_fail_eol_nl
fn_script_log_fatal "Checking ${remotereponame} config _default.cfg" fn_script_log_fail "Checking ${remotereponame} config _default.cfg"
fn_script_log_fatal "Curl returned error: $?" fn_script_log_fail "Curl returned error: $?"
core_exit.sh core_exit.sh
fi fi
@ -158,8 +158,8 @@ if [ -f "${datadir}/${distroid}-${distroversioncsv}.csv" ]; then
fi fi
if [ $? != "0" ]; then if [ $? != "0" ]; then
fn_print_fail_eol_nl fn_print_fail_eol_nl
fn_script_log_fatal "Checking ${remotereponame} ${distroid}-${distroversioncsv}.csv" fn_script_log_fail "Checking ${remotereponame} ${distroid}-${distroversioncsv}.csv"
fn_script_log_fatal "Curl returned error: $?" fn_script_log_fail "Curl returned error: $?"
core_exit.sh core_exit.sh
fi fi
@ -200,7 +200,7 @@ if [ -n "${modulesdir}" ]; then
echo -en "removing module ${modulefile}...\c" echo -en "removing module ${modulefile}...\c"
if ! rm -f "${modulefile:?}"; then if ! rm -f "${modulefile:?}"; then
fn_print_fail_eol_nl fn_print_fail_eol_nl
fn_script_log_fatal "Removing module ${modulefile}" fn_script_log_fail "Removing module ${modulefile}"
core_exit.sh core_exit.sh
else else
fn_print_ok_eol_nl fn_print_ok_eol_nl

33
lgsm/modules/core_dl.sh

@ -93,27 +93,27 @@ fn_dl_steamcmd() {
# Not enough space. # Not enough space.
if [ -n "$(grep "0x202" "${steamcmdlog}" | tail -1)" ]; then if [ -n "$(grep "0x202" "${steamcmdlog}" | tail -1)" ]; then
fn_print_failure_nl "${commandaction} ${selfname}: ${remotelocation}: Not enough disk space to download server files" 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 core_exit.sh
# Not enough space. # Not enough space.
elif [ -n "$(grep "0x212" "${steamcmdlog}" | tail -1)" ]; then elif [ -n "$(grep "0x212" "${steamcmdlog}" | tail -1)" ]; then
fn_print_failure_nl "${commandaction} ${selfname}: ${remotelocation}: Not enough disk space to download server files" 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 core_exit.sh
# Need tp purchase game. # Need tp purchase game.
elif [ -n "$(grep "No subscription" "${steamcmdlog}" | tail -1)" ]; then 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_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 core_exit.sh
# Two-factor authentication failure # Two-factor authentication failure
elif [ -n "$(grep "Two-factor code mismatch" "${steamcmdlog}" | tail -1)" ]; then elif [ -n "$(grep "Two-factor code mismatch" "${steamcmdlog}" | tail -1)" ]; then
fn_print_failure_nl "${commandaction} ${selfname}: ${remotelocation}: Two-factor authentication failure" 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 core_exit.sh
# Incorrect Branch password # Incorrect Branch password
elif [ -n "$(grep "Password check for AppId" "${steamcmdlog}" | tail -1)" ]; then elif [ -n "$(grep "Password check for AppId" "${steamcmdlog}" | tail -1)" ]; then
fn_print_failure_nl "${commandaction} ${selfname}: ${remotelocation}: betapassword is incorrect" 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 core_exit.sh
# Update did not finish. # Update did not finish.
elif [ -n "$(grep "0x402" "${steamcmdlog}" | tail -1)" ] || [ -n "$(grep "0x602" "${steamcmdlog}" | tail -1)" ]; then 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 if [ "${counter}" -gt "10" ]; then
fn_print_failure_nl "${commandaction} ${selfname}: ${remotelocation}: Did not complete the download, too many retrys" 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 core_exit.sh
fi fi
done done
@ -195,7 +195,7 @@ fn_dl_hash() {
fn_print_fail_eol_nl fn_print_fail_eol_nl
echo -e "${local_filename} returned ${hashtype} checksum: ${hashsumcmd}" echo -e "${local_filename} returned ${hashtype} checksum: ${hashsumcmd}"
echo -e "expected ${hashtype} checksum: ${hash}" 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 "${local_filename} returned ${hashtype} checksum: ${hashsumcmd}"
fn_script_log_info "Expected ${hashtype} checksum: ${hash}" fn_script_log_info "Expected ${hashtype} checksum: ${hash}"
core_exit.sh core_exit.sh
@ -226,8 +226,8 @@ fn_dl_extract() {
if [ ! -f "${local_filedir}/${local_filename}" ]; then if [ ! -f "${local_filedir}/${local_filename}" ]; then
fn_print_fail_eol_nl fn_print_fail_eol_nl
echo -en "file ${local_filedir}/${local_filename} not found" echo -en "file ${local_filedir}/${local_filename} not found"
fn_script_log_fatal "Extracting ${local_filename}" fn_script_log_fail "Extracting ${local_filename}"
fn_script_log_fatal "File ${local_filedir}/${local_filename} not found" fn_script_log_fail "File ${local_filedir}/${local_filename} not found"
core_exit.sh core_exit.sh
fi fi
mime=$(file -b --mime-type "${local_filedir}/${local_filename}") mime=$(file -b --mime-type "${local_filedir}/${local_filename}")
@ -259,7 +259,7 @@ fn_dl_extract() {
local exitcode=$? local exitcode=$?
if [ "${exitcode}" != 0 ]; then if [ "${exitcode}" != 0 ]; then
fn_print_fail_eol_nl fn_print_fail_eol_nl
fn_script_log_fatal "Extracting ${local_filename}" fn_script_log_fail "Extracting ${local_filename}"
if [ -f "${lgsmlog}" ]; then if [ -f "${lgsmlog}" ]; then
echo -e "${extractcmd}" >> "${lgsmlog}" echo -e "${extractcmd}" >> "${lgsmlog}"
fi fi
@ -277,7 +277,6 @@ fn_fetch_trap() {
echo -en "downloading ${local_filename}..." echo -en "downloading ${local_filename}..."
fn_print_canceled_eol_nl fn_print_canceled_eol_nl
fn_script_log_info "Downloading ${local_filename}...CANCELED" fn_script_log_info "Downloading ${local_filename}...CANCELED"
fn_sleep_time
rm -f "${local_filedir:?}/${local_filename}" rm -f "${local_filedir:?}/${local_filename}"
echo -en "downloading ${local_filename}..." echo -en "downloading ${local_filename}..."
fn_print_removed_eol_nl fn_print_removed_eol_nl
@ -320,8 +319,8 @@ fn_check_file() {
if [ ${counter} -ge 2 ]; then if [ ${counter} -ge 2 ]; then
fn_print_fail_eol_nl fn_print_fail_eol_nl
if [ -f "${lgsmlog}" ]; then if [ -f "${lgsmlog}" ]; then
fn_script_log_fatal "Checking ${remote_filename}" fn_script_log_fail "Checking ${remote_filename}"
fn_script_log_fatal "${fileurl}" fn_script_log_fail "${fileurl}"
checkflag=1 checkflag=1
fi fi
else else
@ -421,8 +420,8 @@ fn_fetch_file() {
if [ ${counter} -ge 2 ]; then if [ ${counter} -ge 2 ]; then
fn_print_fail_eol_nl fn_print_fail_eol_nl
if [ -f "${lgsmlog}" ]; then if [ -f "${lgsmlog}" ]; then
fn_script_log_fatal "Downloading ${local_filename}..." fn_script_log_fail "Downloading ${local_filename}..."
fn_script_log_fatal "${fileurl}" fn_script_log_fail "${fileurl}"
fi fi
core_exit.sh core_exit.sh
else 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. # 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 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_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 else
# Set variables for download via fn_fetch_file. # Set variables for download via fn_fetch_file.
githubreleasefilename=$(echo -e "${githubreleaseassets}" | jq -r '.[]name') githubreleasefilename=$(echo -e "${githubreleaseassets}" | jq -r '.[]name')
@ -626,7 +625,7 @@ fn_dl_latest_release_github() {
# Error if no version is there. # Error if no version is there.
if [ -z "${githubreleasefilename}" ]; then if [ -z "${githubreleasefilename}" ]; then
fn_print_fail_nl "Cannot get version from GitHub API for ${githubreleaseuser}/${githubreleaserepo}" 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 else
# Fetch file from the remote location from the existing module to the ${tmpdir} for now. # Fetch file from the remote location from the existing module to the ${tmpdir} for now.
fn_fetch_file "${githubreleasedownloadlink}" "" "${githubreleasefilename}" "" "${githubreleasedownloadpath}" "${githubreleasefilename}" fn_fetch_file "${githubreleasedownloadlink}" "" "${githubreleasefilename}" "" "${githubreleasedownloadpath}" "${githubreleasefilename}"

2
lgsm/modules/core_exit.sh

@ -29,7 +29,7 @@ elif [ "${exitcode}" != "0" ]; then
# List LinuxGSM version in logs # List LinuxGSM version in logs
fn_script_log_info "LinuxGSM version: ${version}" fn_script_log_info "LinuxGSM version: ${version}"
if [ "${exitcode}" == "1" ]; then 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 elif [ "${exitcode}" == "2" ]; then
fn_script_log_error "${moduleselfname} exiting with code: ${exitcode}" fn_script_log_error "${moduleselfname} exiting with code: ${exitcode}"
elif [ "${exitcode}" == "3" ]; then elif [ "${exitcode}" == "3" ]; then

6
lgsm/modules/core_github.sh

@ -28,7 +28,7 @@ fn_github_get_latest_release_version() {
# error if no version is there # error if no version is there
if [ -z "${githubreleaseversion}" ]; then if [ -z "${githubreleaseversion}" ]; then
fn_print_fail_nl "Cannot get version from GitHub API for ${githubreleaseuser}/${githubreleaserepo}" 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 fi
} }
@ -46,7 +46,7 @@ fn_github_set_latest_release_version() {
# error if no version is there # error if no version is there
if [ -z "${githubreleaseversion}" ]; then if [ -z "${githubreleaseversion}" ]; then
fn_print_fail_nl "Cannot get version from GitHub API for ${githubreleaseuser}/${githubreleaserepo}" 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 else
echo "${githubreleaseversion}" > "${githublocalversionfile}" echo "${githubreleaseversion}" > "${githublocalversionfile}"
fi fi
@ -81,7 +81,7 @@ fn_github_compare_version() {
# error if no version is there # error if no version is there
if [ -z "${githubreleaseversion}" ]; then if [ -z "${githubreleaseversion}" ]; then
fn_print_fail_nl "Can not get version from Github Api for ${githubreleaseuser}/${githubreleaserepo}" 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 else
if [ "${githublocalversion}" == "${githubreleaseversion}" ]; then if [ "${githublocalversion}" == "${githubreleaseversion}" ]; then
echo -en "\n" echo -en "\n"

1
lgsm/modules/core_logs.sh

@ -46,7 +46,6 @@ if [ "$(find "${lgsmlogdir}"/ -type f -mtime +"${logdays}" | wc -l)" -ne "0" ];
ulxcount="0" ulxcount="0"
darkrpcount="0" darkrpcount="0"
legacycount="0" legacycount="0"
fn_sleep_time
fn_print_info "Removing logs older than ${logdays} days" fn_print_info "Removing logs older than ${logdays} days"
fn_script_log_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. # Logging logfiles to be removed according to "${logdays}", counting and removing them.

16
lgsm/modules/core_messages.sh

@ -70,7 +70,7 @@ fn_script_log_pass() {
} }
## Feb 28 14:56:58 ut99-server: Monitor: FATAL: ## Feb 28 14:56:58 ut99-server: Monitor: FATAL:
fn_script_log_fatal() { fn_script_log_fail() {
if [ -d "${lgsmlogdir}" ]; then if [ -d "${lgsmlogdir}" ]; then
if [ -n "${commandname}" ]; then if [ -n "${commandname}" ]; then
echo -e "$(date '+%b %d %H:%M:%S.%3N') ${selfname}: ${commandname}: FATAL: ${1}" >> "${lgsmlog}" 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 # 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 # No More Room in Hell Debug
# ================================= # =================================
fn_print_header() { fn_print_header() {
echo -e "" echo -e ""
echo -e "${lightyellow}${gamename} ${commandaction}${default}" echo -e "${bold}${lightyellow}${gamename} ${commandaction}${default}"
echo -e "=================================${default}" fn_messages_separator
} }
# Complete! # Complete!

14
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}" fn_print_fail_nl "Steam login not set. Update steamuser in ${configdirserver}"
echo -e " * Change steamuser=\"username\" to a valid steam login." echo -e " * Change steamuser=\"username\" to a valid steam login."
if [ -d "${lgsmlogdir}" ]; then 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 fi
core_exit.sh core_exit.sh
fi fi
@ -129,7 +129,7 @@ fn_check_steamcmd_clear() {
rm -rf "${steamcmddir:?}" rm -rf "${steamcmddir:?}"
exitcode=$? exitcode=$?
if [ "${exitcode}" != 0 ]; then if [ "${exitcode}" != 0 ]; then
fn_script_log_fatal "Removing ${rootdir}/steamcmd" fn_script_log_fail "Removing ${rootdir}/steamcmd"
else else
fn_script_log_pass "Removing ${rootdir}/steamcmd" fn_script_log_pass "Removing ${rootdir}/steamcmd"
fi fi
@ -154,7 +154,7 @@ fn_update_steamcmd_localbuild() {
# Checks if localbuild variable has been set. # Checks if localbuild variable has been set.
if [ -z "${localbuild}" ]; then if [ -z "${localbuild}" ]; then
fn_print_fail "Checking local build: ${remotelocation}: missing local build info" 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 core_exit.sh
else else
fn_print_ok "Checking local build: ${remotelocation}" fn_print_ok "Checking local build: ${remotelocation}"
@ -188,7 +188,7 @@ fn_update_steamcmd_remotebuild() {
# Checks if remotebuildversion variable has been set. # Checks if remotebuildversion variable has been set.
if [ -z "${remotebuildversion}" ] || [ "${remotebuildversion}" == "null" ]; then if [ -z "${remotebuildversion}" ] || [ "${remotebuildversion}" == "null" ]; then
fn_print_fail "Checking remote build: ${remotelocation}" fn_print_fail "Checking remote build: ${remotelocation}"
fn_script_log_fatal "Checking remote build" fn_script_log_fail "Checking remote build"
core_exit.sh core_exit.sh
else else
fn_print_ok "Checking remote build: ${remotelocation}" fn_print_ok "Checking remote build: ${remotelocation}"
@ -198,7 +198,7 @@ fn_update_steamcmd_remotebuild() {
# Checks if remotebuild variable has been set. # Checks if remotebuild variable has been set.
if [ -z "${remotebuildversion}" ] || [ "${remotebuildversion}" == "null" ]; then if [ -z "${remotebuildversion}" ] || [ "${remotebuildversion}" == "null" ]; then
fn_print_failure "Unable to get remote build" 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 core_exit.sh
fi fi
fi fi
@ -305,7 +305,7 @@ fn_check_steamcmd_appmanifest() {
# if error can not be resolved. # if error can not be resolved.
if [ "${appmanifestfilewc}" -ge "2" ]; then if [ "${appmanifestfilewc}" -ge "2" ]; then
fn_print_fail "Unable to remove x${appmanifestfilewc} appmanifest_${appid}.acf files" 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" echo -e "* Check user permissions"
for appfile in ${appmanifestfile}; do for appfile in ${appmanifestfile}; do
echo -e " ${appfile}" echo -e " ${appfile}"
@ -327,7 +327,7 @@ fn_check_steamcmd_appmanifest() {
fn_appmanifest_info fn_appmanifest_info
if [ "${appmanifestfilewc}" -eq "0" ]; then if [ "${appmanifestfilewc}" -eq "0" ]; then
fn_print_fail_nl "Still no appmanifest_${appid}.acf found" 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 core_exit.sh
fi fi
fi fi

3
lgsm/modules/fix.sh

@ -80,8 +80,7 @@ if [ "${commandname}" == "INSTALL" ]; then
if grep -qEe "(^|\s)${shortname}(\s|$)" <<< "${apply_post_install_fix[@]}"; then if grep -qEe "(^|\s)${shortname}(\s|$)" <<< "${apply_post_install_fix[@]}"; then
echo -e "" echo -e ""
echo -e "${lightyellow}Applying Post-Install Fixes${default}" echo -e "${lightyellow}Applying Post-Install Fixes${default}"
echo -e "=================================" fn_messages_separator
fn_sleep_time
postinstall=1 postinstall=1
fn_apply_fix "post install" "${shortname}" fn_apply_fix "post install" "${shortname}"
fi fi

1
lgsm/modules/fix_av.sh

@ -13,7 +13,6 @@ export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${serverfiles}:${serverfiles}/linux64"
if [ ! -f "${servercfgfullpath}" ]; then if [ ! -f "${servercfgfullpath}" ]; then
startparameters="--datapath ${avdatapath} --galaxy-name ${selfname} --init-folders-only" startparameters="--datapath ${avdatapath} --galaxy-name ${selfname} --init-folders-only"
fn_print_information "starting ${gamename} server to generate configs." fn_print_information "starting ${gamename} server to generate configs."
fn_sleep_time
cd "${systemdir}" || exit cd "${systemdir}" || exit
eval "${executable} ${startparameters}" eval "${executable} ${startparameters}"
fi fi

1
lgsm/modules/fix_kf2.sh

@ -10,7 +10,6 @@ moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
startparameters="\"${defaultmap}?Game=KFGameContent.KFGameInfo_VersusSurvival\"" startparameters="\"${defaultmap}?Game=KFGameContent.KFGameInfo_VersusSurvival\""
fn_print_information "starting ${gamename} server to generate configs." fn_print_information "starting ${gamename} server to generate configs."
fn_sleep_time
exitbypass=1 exitbypass=1
command_start.sh command_start.sh
fn_firstcommand_reset fn_firstcommand_reset

2
lgsm/modules/fix_lo.sh

@ -9,9 +9,7 @@ moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
appidfile=${executabledir}/steam_appid.txt appidfile=${executabledir}/steam_appid.txt
if [ ! -f "${appidfile}" ]; then if [ ! -f "${appidfile}" ]; then
fn_print_information "adding ${appidfile} to ${gamename} server." fn_print_information "adding ${appidfile} to ${gamename} server."
fn_sleep_time
echo "903950" > "${appidfile}" echo "903950" > "${appidfile}"
else else
fn_print_information "${appidfile} already exists. No action to be taken." fn_print_information "${appidfile} already exists. No action to be taken."
fn_sleep_time
fi fi

1
lgsm/modules/fix_mta.sh

@ -10,7 +10,6 @@ moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
if [ ! -f "${lgsmdir}/lib/libmysqlclient.so.16" ]; then if [ ! -f "${lgsmdir}/lib/libmysqlclient.so.16" ]; then
fixname="libmysqlclient16" fixname="libmysqlclient16"
fn_fix_msg_start_nl 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_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 fn_fix_msg_end
fi fi

4
lgsm/modules/fix_samp.sh

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

2
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. # file is not owned by the current user and needs to be deleted manually.
else else
fn_print_error_nl "File ${accountingfile} is not owned by $(whoami) and needs to be deleted manually" 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 core_exit.sh
fi fi
fi fi

1
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}" 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_print_information "starting ${gamename} server to generate configs."
fn_sleep_time
exitbypass=1 exitbypass=1
command_start.sh command_start.sh
fn_firstcommand_reset fn_firstcommand_reset

51
lgsm/modules/info_messages.sh

@ -7,15 +7,6 @@
moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" 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. # Removes the passwords form all but details.
fn_info_message_password_strip() { fn_info_message_password_strip() {
if [ "${commandname}" != "DETAILS" ]; then if [ "${commandname}" != "DETAILS" ]; then
@ -57,7 +48,7 @@ fn_info_message_password_strip() {
# used with alertlog # used with alertlog
fn_info_message_head() { fn_info_message_head() {
echo -e "" echo -e ""
echo -e "${lightyellow}Alert Summary${default}" echo -e "${bold}${lightyellow}Alert Summary${default}"
fn_messages_separator fn_messages_separator
echo -e "Message" echo -e "Message"
echo -e "${alertbody}" echo -e "${alertbody}"
@ -89,7 +80,7 @@ fn_info_message_distro() {
# glibc: 2.31 # glibc: 2.31
echo -e "" echo -e ""
echo -e "${lightyellow}Distro Details${default}" echo -e "${bold}${lightyellow}Distro Details${default}"
fn_messages_separator fn_messages_separator
{ {
echo -e "${lightblue}Date:\t${default}$(date)" echo -e "${lightblue}Date:\t${default}$(date)"
@ -132,7 +123,7 @@ fn_info_message_server_resource() {
# Internet IP: 176.58.124.96 # Internet IP: 176.58.124.96
echo -e "" echo -e ""
echo -e "${lightyellow}Server Resource${default}" echo -e "${bold}${lightyellow}Server Resource${default}"
fn_messages_separator fn_messages_separator
{ {
echo -e "${lightyellow}CPU\t${default}" echo -e "${lightyellow}CPU\t${default}"
@ -185,7 +176,7 @@ fn_info_message_gameserver_resource() {
# Backups: 24K # Backups: 24K
echo -e "" echo -e ""
echo -e "${lightyellow}Game Server Resource Usage${default}" echo -e "${bold}${lightgreen}${gamename} Resource Usage${default}"
fn_messages_separator fn_messages_separator
{ {
if [ "${status}" != "0" ] && [ -v status ]; then if [ "${status}" != "0" ] && [ -v status ]; then
@ -234,7 +225,7 @@ fn_info_message_gameserver() {
# Status: STARTED # Status: STARTED
echo -e "" echo -e ""
echo -e "${lightgreen}${gamename} Server Details${default}" echo -e "${bold}${lightgreen}${gamename} Server Details${default}"
fn_info_message_password_strip fn_info_message_password_strip
fn_messages_separator fn_messages_separator
{ {
@ -526,7 +517,7 @@ fn_info_message_script() {
# Location: /home/lgsm/csgoserver # Location: /home/lgsm/csgoserver
# Config file: /home/lgsm/csgoserver/serverfiles/csgo/cfg/csgoserver.cfg # 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 fn_messages_separator
{ {
# Script name # Script name
@ -618,7 +609,7 @@ fn_info_message_backup() {
# size: 945M # size: 945M
echo -e "" echo -e ""
echo -e "${lightgreen}Backups${default}" echo -e "${bold}${lightgreen}Backups${default}"
fn_messages_separator fn_messages_separator
if [ ! -d "${backupdir}" ] || [ "${backupcount}" == "0" ]; then if [ ! -d "${backupdir}" ] || [ "${backupcount}" == "0" ]; then
echo -e "No Backups created" echo -e "No Backups created"
@ -646,7 +637,7 @@ fn_info_message_commandlineparms() {
# ./run_server_x86.sh +set net_strict 1 # ./run_server_x86.sh +set net_strict 1
echo -e "" echo -e ""
echo -e "${lightgreen}Command-line Parameters${default}" echo -e "${bold}${lightgreen}Command-line Parameters${default}"
fn_info_message_password_strip fn_info_message_password_strip
fn_messages_separator fn_messages_separator
if [ "${serverpassword}" == "NOT SET" ]; then if [ "${serverpassword}" == "NOT SET" ]; then
@ -663,7 +654,7 @@ fn_info_message_ports_edit() {
# Change ports by editing the parameters in: # Change ports by editing the parameters in:
# /home/lgsm/qlserver/serverfiles/baseq3/ql-server.cfg # /home/lgsm/qlserver/serverfiles/baseq3/ql-server.cfg
echo -e "" echo -e ""
echo -e "${lightgreen}Ports${default}" echo -e "${bold}${lightgreen}Ports${default}"
fn_messages_separator fn_messages_separator
echo -e "${lightblue}Change ports by editing the parameters in:${default}" echo -e "${lightblue}Change ports by editing the parameters in:${default}"
@ -726,8 +717,8 @@ fn_info_message_statusbottom() {
fn_info_logs() { fn_info_logs() {
echo -e "" echo -e ""
echo -e "${selfname} Logs" echo -e "${bold}${selfname} Logs"
echo -e "=================================" fn_messages_separator
if [ -n "${lgsmlog}" ]; then if [ -n "${lgsmlog}" ]; then
echo -e "\nScript log\n===================" echo -e "\nScript log\n==================="
@ -1111,7 +1102,7 @@ fn_info_message_kf() {
fn_port "Steam" steamport udp fn_port "Steam" steamport udp
} | column -s $'\t' -t } | column -s $'\t' -t
echo -e "" echo -e ""
echo -e "${lightgreen}${servername} Web Interface${default}" echo -e "${bold}${lightgreen}${servername} Web Interface${default}"
fn_messages_separator fn_messages_separator
{ {
echo -e "${lightblue}Web Interface enabled:\t${default}${httpenabled}" echo -e "${lightblue}Web Interface enabled:\t${default}${httpenabled}"
@ -1130,7 +1121,7 @@ fn_info_message_kf2() {
fn_port "Web Interface" httpport tcp fn_port "Web Interface" httpport tcp
} | column -s $'\t' -t } | column -s $'\t' -t
echo -e "" echo -e ""
echo -e "${lightgreen}${servername} Web Interface${default}" echo -e "${bold}${lightgreen}${servername} Web Interface${default}"
fn_messages_separator fn_messages_separator
{ {
echo -e "${lightblue}Web Interface enabled:\t${default}${httpenabled}" echo -e "${lightblue}Web Interface enabled:\t${default}${httpenabled}"
@ -1235,7 +1226,7 @@ fn_info_message_pc() {
fn_port "API" apiport tcp fn_port "API" apiport tcp
} | column -s $'\t' -t } | column -s $'\t' -t
echo -e "" echo -e ""
echo -e "${lightgreen}${gamename} Web Interface${default}" echo -e "${bold}${lightgreen}${gamename} Web Interface${default}"
fn_messages_separator fn_messages_separator
{ {
echo -e "${lightblue}Web Interface enabled:\t${default}${httpenabled}" echo -e "${lightblue}Web Interface enabled:\t${default}${httpenabled}"
@ -1321,7 +1312,7 @@ fn_info_message_ro() {
fn_port "Steam" steamport udp fn_port "Steam" steamport udp
} | column -s $'\t' -t } | column -s $'\t' -t
echo -e "" echo -e ""
echo -e "${lightgreen}${servername} Web Interface${default}" echo -e "${bold}${lightgreen}${servername} Web Interface${default}"
fn_messages_separator fn_messages_separator
{ {
echo -e "${lightblue}Web Interface enabled:\t${default}${httpenabled}" echo -e "${lightblue}Web Interface enabled:\t${default}${httpenabled}"
@ -1400,7 +1391,7 @@ fn_info_message_sdtd() {
fn_port "Telnet" telnetport tcp fn_port "Telnet" telnetport tcp
} | column -s $'\t' -t } | column -s $'\t' -t
echo -e "" echo -e ""
echo -e "${lightgreen}${gamename} Web Interface${default}" echo -e "${bold}${lightgreen}${gamename} Web Interface${default}"
fn_messages_separator fn_messages_separator
{ {
echo -e "${lightblue}Web Interface enabled:\t${default}${httpenabled}" 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}" echo -e "${lightblue}Web Interface password:\t${default}${httppassword}"
} | column -s $'\t' -t } | column -s $'\t' -t
echo -e "" echo -e ""
echo -e "${lightgreen}${gamename} Telnet${default}" echo -e "${bold}${lightgreen}${gamename} Telnet${default}"
fn_messages_separator fn_messages_separator
{ {
echo -e "${lightblue}Telnet enabled:\t${default}${telnetenabled}" echo -e "${lightblue}Telnet enabled:\t${default}${telnetenabled}"
@ -1475,7 +1466,7 @@ fn_info_message_spark() {
fn_port "Web Interface" httpport tcp fn_port "Web Interface" httpport tcp
} | column -s $'\t' -t } | column -s $'\t' -t
echo -e "" echo -e ""
echo -e "${lightgreen}${gamename} Web Interface${default}" echo -e "${bold}${lightgreen}${gamename} Web Interface${default}"
fn_messages_separator fn_messages_separator
{ {
echo -e "${lightblue}Web Interface url:\t${default}http://${httpip}:${httpport}/index.html" 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 fn_port "LAN" lanport udp
} | column -s $'\t' -t } | column -s $'\t' -t
echo -e "" echo -e ""
echo -e "${lightgreen}${servername} Web Interface${default}" echo -e "${bold}${lightgreen}${gamename} Web Interface${default}"
fn_messages_separator fn_messages_separator
{ {
echo -e "${lightblue}Web Interface enabled:\t${default}${httpenabled}" echo -e "${lightblue}Web Interface enabled:\t${default}${httpenabled}"
@ -1577,7 +1568,7 @@ fn_info_message_unreal() {
fn_port "Web Interface" httpport tcp fn_port "Web Interface" httpport tcp
} | column -s $'\t' -t } | column -s $'\t' -t
echo -e "" echo -e ""
echo -e "${lightgreen}${servername} Web Interface${default}" echo -e "${bold}${lightgreen}${gamename} Web Interface${default}"
fn_messages_separator fn_messages_separator
{ {
echo -e "${lightblue}Web Interface enabled:\t${default}${httpenabled}" echo -e "${lightblue}Web Interface enabled:\t${default}${httpenabled}"
@ -1613,7 +1604,7 @@ fn_info_message_ut3() {
fn_port "Web Interface" httpport tcp fn_port "Web Interface" httpport tcp
} | column -s $'\t' -t } | column -s $'\t' -t
echo -e "" echo -e ""
echo -e "${lightgreen}${servername} Web Interface${default}" echo -e "${bold}${lightgreen}${gamename} Web Interface${default}"
fn_messages_separator fn_messages_separator
{ {
echo -e "${lightblue}Web Interface enabled:\t${default}${httpenabled}" echo -e "${lightblue}Web Interface enabled:\t${default}${httpenabled}"

10
lgsm/modules/install_complete.sh

@ -8,19 +8,19 @@
moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
echo -e "" echo -e ""
echo -e "=================================" fn_messages_separator
if [ "${exitcode}" == "1" ]; then if [ "${exitcode}" == "1" ]; then
echo -e "Install Failed!" echo -e "${bold}${red}Install Failed!${default}"
fn_script_log_fatal "Install Failed!" fn_script_log_fatal "Install Failed!"
elif [ "${exitcode}" == "2" ]; then 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!" fn_script_log_error "Install Completed with Errors!"
elif [ "${exitcode}" == "3" ]; then 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!" fn_script_log_warn "Install Completed with Warnings!"
elif [ -z "${exitcode}" ] || [ "${exitcode}" == "0" ]; then elif [ -z "${exitcode}" ] || [ "${exitcode}" == "0" ]; then
echo -e "Install Complete!" echo -e "${bold}${green}Install Complete!${default}"
fn_script_log_pass "Install Complete!" fn_script_log_pass "Install Complete!"
fi fi

38
lgsm/modules/install_config.sh

@ -19,9 +19,12 @@ fn_check_cfgdir() {
# Downloads default configs from Game-Server-Configs repo to lgsm/config-default. # Downloads default configs from Game-Server-Configs repo to lgsm/config-default.
fn_fetch_default_config() { fn_fetch_default_config() {
echo -e "" echo -e ""
echo -e "${lightyellow}Downloading ${gamename} Configs${default}" echo -e "${bold}${lightyellow}Downloading ${gamename} Configs${default}"
echo -e "=================================" fn_messages_separator
echo -e "default configs from https://github.com/GameServerManagers/Game-Server-Configs" echo -e "Downloading default configs from:"
echo -e ""
echo -e "${italic}https://github.com/GameServerManagers/Game-Server-Configs${default}"
echo -e ""
fn_sleep_time fn_sleep_time
mkdir -p "${lgsmdir}/config-default/config-game" mkdir -p "${lgsmdir}/config-default/config-game"
githuburl="https://raw.githubusercontent.com/GameServerManagers/Game-Server-Configs/main" githuburl="https://raw.githubusercontent.com/GameServerManagers/Game-Server-Configs/main"
@ -54,9 +57,20 @@ fn_default_config_remote() {
# Copys local default config to server config location. # Copys local default config to server config location.
fn_default_config_local() { fn_default_config_local() {
echo -e "copying ${servercfgdefault} config file." echo -e ""
cp -nv "${servercfgdir}/${servercfgdefault}" "${servercfgfullpath}" echo -e "${bold}${lightyellow}Copying ${gamename} Configs${default}"
fn_sleep_time 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. # Changes some variables within the default configs.
@ -64,9 +78,9 @@ fn_default_config_local() {
# PASSWORD to random password # PASSWORD to random password
fn_set_config_vars() { fn_set_config_vars() {
if [ -f "${servercfgfullpath}" ]; then 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" servername="LinuxGSM"
rconpass="admin${random}" rconpass="admin${randomstring}"
echo -e "changing hostname." echo -e "changing hostname."
fn_script_log_info "changing hostname." fn_script_log_info "changing hostname."
fn_sleep_time fn_sleep_time
@ -107,8 +121,8 @@ fn_set_dst_config_vars() {
fn_sleep_time fn_sleep_time
echo -e "randomizing cluster key." echo -e "randomizing cluster key."
fn_script_log_info "randomizing cluster key." fn_script_log_info "randomizing cluster key."
randomkey=$(tr -dc A-Za-z0-9_ < /dev/urandom | head -c 8 | xargs) randomstring=$(tr -dc 'A-Za-z0-9_' < /dev/urandom 2> /dev/null | head -c 8 | xargs)
sed -i "s/CLUSTERKEY/${randomkey}/g" "${clustercfgfullpath}" sed -i "s/CLUSTERKEY/${randomstring}/g" "${clustercfgfullpath}"
fn_sleep_time fn_sleep_time
else else
echo -e "${clustercfg} is already configured." echo -e "${clustercfg} is already configured."
@ -146,8 +160,8 @@ fn_set_dst_config_vars() {
# Lists local config file locations # Lists local config file locations
fn_list_config_locations() { fn_list_config_locations() {
echo -e "" echo -e ""
echo -e "${lightyellow}Config File Locations${default}" echo -e "${bold}${lightyellow}Config Locations${default}"
echo -e "=================================" fn_messages_separator
if [ -n "${servercfgfullpath}" ]; then if [ -n "${servercfgfullpath}" ]; then
if [ -f "${servercfgfullpath}" ]; then if [ -f "${servercfgfullpath}" ]; then
echo -e "Game Server Config File: ${servercfgfullpath}" echo -e "Game Server Config File: ${servercfgfullpath}"

5
lgsm/modules/install_dst_token.sh

@ -8,9 +8,8 @@
moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
echo -e "" echo -e ""
echo -e "${lightyellow}Enter ${gamename} Cluster Token${default}" echo -e "${bold}${lightyellow}Enter ${gamename} Cluster Token${default}"
echo -e "=================================" fn_messages_separator
fn_sleep_time
echo -e "A cluster token is required to run this server!" 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 "Follow the instructions in this link to obtain this key:"
echo -e "https://linuxgsm.com/dst-auth-token" echo -e "https://linuxgsm.com/dst-auth-token"

5
lgsm/modules/install_eula.sh

@ -16,9 +16,8 @@ elif [ "${shortname}" == "ut" ]; then
fi fi
echo -e "" echo -e ""
echo -e "${lightyellow}Accept ${gamename} EULA${default}" echo -e "${bold}${lightyellow}Accept ${gamename} EULA${default}"
echo -e "=================================" fn_messages_separator
fn_sleep_time
echo -e "You are required to accept the EULA:" echo -e "You are required to accept the EULA:"
echo -e "${eulaurl}" echo -e "${eulaurl}"
echo -e "" echo -e ""

5
lgsm/modules/install_factorio_save.sh

@ -8,8 +8,7 @@
moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
echo -e "" echo -e ""
echo -e "${lightyellow}Creating initial Factorio savefile${default}" echo -e "${bold}${lightyellow}Creating initial Factorio savefile${default}"
echo -e "=================================" fn_messages_separator
fn_sleep_time
check_glibc.sh check_glibc.sh
"${executabledir}"/factorio --create "${serverfiles}/save1" "${executabledir}"/factorio --create "${serverfiles}/save1"

4
lgsm/modules/install_gslt.sh

@ -8,8 +8,8 @@
moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
echo -e "" echo -e ""
echo -e "${lightyellow}Game Server Login Token${default}" echo -e "${bold}${lightyellow}Game Server Login Token${default}"
echo -e "=================================" fn_messages_separator
fn_sleep_time fn_sleep_time
if [ "${shortname}" == "csgo" ] || [ "${shortname}" == "css" ] || [ "${shortname}" == "nmrih" ] || [ "${shortname}" == "bs" ]; then if [ "${shortname}" == "csgo" ] || [ "${shortname}" == "css" ] || [ "${shortname}" == "nmrih" ] || [ "${shortname}" == "bs" ]; then
echo -e "GSLT is required to run a public ${gamename} server" echo -e "GSLT is required to run a public ${gamename} server"

10
lgsm/modules/install_header.sh

@ -9,14 +9,12 @@ moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
clear clear
fn_print_ascii_logo fn_print_ascii_logo
fn_sleep_time fn_messages_separator
echo -e "=================================" echo -e "${bold}${lightyellow}Linux${default}${bold}GSM_${default}"
echo -e "${lightyellow}Linux${default}GSM_" echo -e "${italic}by Daniel Gibbs${default}"
echo -e "by Daniel Gibbs"
echo -e "${lightblue}Version:${default} ${version}" echo -e "${lightblue}Version:${default} ${version}"
echo -e "${lightblue}Game:${default} ${gamename}" echo -e "${lightblue}Game:${default} ${gamename}"
echo -e "${lightblue}Website:${default} https://linuxgsm.com" echo -e "${lightblue}Website:${default} https://linuxgsm.com"
echo -e "${lightblue}Contributors:${default} https://linuxgsm.com/contrib" echo -e "${lightblue}Contributors:${default} https://linuxgsm.com/contrib"
echo -e "${lightblue}Sponsor:${default} https://linuxgsm.com/sponsor" echo -e "${lightblue}Sponsor:${default} https://linuxgsm.com/sponsor"
echo -e "=================================" fn_messages_separator
fn_sleep_time

5
lgsm/modules/install_logs.sh

@ -9,8 +9,9 @@ moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
if [ "${checklogs}" != "1" ]; then if [ "${checklogs}" != "1" ]; then
echo -e "" echo -e ""
echo -e "${lightyellow}Creating log directories${default}" echo -e "${bold}${lightyellow}Creating Log Directories${default}"
echo -e "=================================" fn_messages_separator
fn_sleep_time
fi fi
fn_sleep_time fn_sleep_time
# Create LinuxGSM logs. # Create LinuxGSM logs.

4
lgsm/modules/install_server_dir.sh

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

9
lgsm/modules/install_server_files.sh

@ -199,16 +199,15 @@ fn_install_server_files() {
md5="0188ae86dbc9376f11ae3032dba2d665" md5="0188ae86dbc9376f11ae3032dba2d665"
else else
fn_print_fail_nl "Installing ${gamename} Server failed, missing default configuration" 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 fi
fn_fetch_file "${remote_fileurl}" "" "" "" "${local_filedir}" "${local_filename}" "${chmodx}" "${run}" "${forcedl}" "${md5}" fn_fetch_file "${remote_fileurl}" "" "" "" "${local_filedir}" "${local_filename}" "${chmodx}" "${run}" "${forcedl}" "${md5}"
fn_dl_extract "${local_filedir}" "${local_filename}" "${serverfiles}" fn_dl_extract "${local_filedir}" "${local_filename}" "${serverfiles}"
} }
echo -e "" echo -e ""
echo -e "${lightyellow}Installing ${gamename} Server${default}" echo -e "${bold}${lightyellow}Installing ${gamename} Server${default}"
echo -e "=================================" fn_messages_separator
fn_sleep_time
if [ "${appid}" ]; then if [ "${appid}" ]; then
remotelocation="SteamCMD" remotelocation="SteamCMD"
@ -250,7 +249,7 @@ fi
if [ -z "${autoinstall}" ]; then if [ -z "${autoinstall}" ]; then
echo -e "" echo -e ""
echo -e "=================================" fn_messages_separator
if ! fn_prompt_yn "Was the install successful?" Y; then if ! fn_prompt_yn "Was the install successful?" Y; then
install_retry.sh install_retry.sh
fi fi

5
lgsm/modules/install_squad_license.sh

@ -8,9 +8,8 @@
moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
echo -e "" echo -e ""
echo -e "${lightyellow}Squad Server License${default}" echo -e "${bold}${lightyellow}${gamename} Server License${default}"
echo -e "=================================" fn_messages_separator
fn_sleep_time
echo -e "Server license is an optional feature for ${gamename} server" echo -e "Server license is an optional feature for ${gamename} server"
fn_script_log_info "Server license is an optional feature for ${gamename} server" fn_script_log_info "Server license is an optional feature for ${gamename} server"

9
lgsm/modules/install_stats.sh

@ -8,12 +8,13 @@
moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
echo -e "" echo -e ""
echo -e "${lightyellow}LinuxGSM Stats${default}" echo -e "${bold}${lightyellow}LinuxGSM Stats${default}"
echo -e "=================================" fn_messages_separator
fn_sleep_time fn_sleep_time
echo -e "Assist LinuxGSM development by sending anonymous stats to developers." echo -e "Assist LinuxGSM development by sending anonymous stats to developers."
echo -e "More info: https://docs.linuxgsm.com/configuration/linuxgsm-stats" echo -e "Collected data is publicly available: ${italic}https://linuxgsm.com/data/usage${default}"
echo -e "The following info will be sent:" 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 "* game server"
echo -e "* distro" echo -e "* distro"
echo -e "* game server resource usage" echo -e "* game server resource usage"

5
lgsm/modules/install_steamcmd.sh

@ -8,7 +8,6 @@
moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
echo -e "" echo -e ""
echo -e "${lightyellow}Installing SteamCMD${default}" echo -e "${bold}${lightyellow}Installing SteamCMD${default}"
echo -e "=================================" fn_messages_separator
fn_sleep_time
check_steamcmd.sh check_steamcmd.sh

17
lgsm/modules/install_ts3db.sh

@ -14,7 +14,7 @@ fn_install_ts3db_mariadb() {
local exitcode=$? local exitcode=$?
if [ "${exitcode}" != "0" ]; then if [ "${exitcode}" != "0" ]; then
fn_print_fail_eol_nl fn_print_fail_eol_nl
fn_script_log_fatal "copying libmariadb.so.2" fn_script_log_fail "copying libmariadb.so.2"
core_exit.sh core_exit.sh
else else
fn_print_ok_eol_nl fn_print_ok_eol_nl
@ -23,9 +23,8 @@ fn_install_ts3db_mariadb() {
fi fi
echo -e "" echo -e ""
echo -e "${lightyellow}Configure ${gamename} Server for MariaDB${default}" echo -e "${bold}${lightyellow}Configure ${gamename} Server for MariaDB${default}"
echo -e "=================================" fn_messages_separator
fn_sleep_time
read -rp "Enter MariaDB hostname: " mariahostname read -rp "Enter MariaDB hostname: " mariahostname
read -rp "Enter MariaDB port: " mariaport read -rp "Enter MariaDB port: " mariaport
read -rp "Enter MariaDB username: " mariausername read -rp "Enter MariaDB username: " mariausername
@ -50,9 +49,8 @@ fn_install_ts3db_mariadb() {
} }
echo -e "" echo -e ""
echo -e "${lightyellow}Select Database${default}" echo -e "${bold}${lightyellow}Select Database${default}"
echo -e "=================================" fn_messages_separator
fn_sleep_time
if [ -z "${autoinstall}" ]; then if [ -z "${autoinstall}" ]; then
if fn_prompt_yn "Do you want to use MariaDB instead of sqlite? (MariaDB must be pre-configured)" N; 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 fn_install_ts3db_mariadb
@ -64,9 +62,8 @@ fi
install_eula.sh install_eula.sh
echo -e "" echo -e ""
echo -e "${lightyellow}Getting Privilege Key${default}" echo -e "${bold}${lightyellow}Getting Privilege Key${default}"
echo -e "=================================" fn_messages_separator
fn_sleep_time
fn_print_information_nl "Save these details for later." fn_print_information_nl "Save these details for later."
fn_print_information_nl "Key also saved in:" fn_print_information_nl "Key also saved in:"
echo -e "${serverfiles}/privilege_key.txt" echo -e "${serverfiles}/privilege_key.txt"

5
lgsm/modules/install_ut2k4_key.sh

@ -8,9 +8,8 @@
moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
echo -e "" echo -e ""
echo -e "${lightyellow}Enter ${gamename} CD Key${default}" echo -e "${bold}${lightyellow}Enter ${gamename} CD Key${default}"
echo -e "=================================" fn_messages_separator
fn_sleep_time
echo -e "To get your server listed on the Master Server list" 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 "you must get a free CD key. Get a key here:"
echo -e "https://www.epicgames.com/unrealtournament/forums/cdkey.php?2004" echo -e "https://www.epicgames.com/unrealtournament/forums/cdkey.php?2004"

42
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. # Check if variable is valid checking if file has been downloaded and exists.
if [ ! -f "${modstmpdir}/${modfilename}" ]; then if [ ! -f "${modstmpdir}/${modfilename}" ]; then
fn_print_failure "An issue occurred downloading ${modprettyname}" 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 core_exit.sh
fi fi
if [ ! -d "${extractdest}" ]; then if [ ! -d "${extractdest}" ]; then
@ -77,7 +77,7 @@ fn_mod_create_filelist() {
local exitcode=$? local exitcode=$?
if [ "${exitcode}" != 0 ]; then if [ "${exitcode}" != 0 ]; then
fn_print_fail_eol_nl 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 core_exit.sh
else else
fn_print_ok_eol_nl fn_print_ok_eol_nl
@ -97,7 +97,7 @@ fn_mod_copy_destination() {
local exitcode=$? local exitcode=$?
if [ "${exitcode}" != 0 ]; then if [ "${exitcode}" != 0 ]; then
fn_print_fail_eol_nl fn_print_fail_eol_nl
fn_script_log_fatal "Copying ${modprettyname} to ${modinstalldir}" fn_script_log_fail "Copying ${modprettyname} to ${modinstalldir}"
else else
fn_print_ok_eol_nl fn_print_ok_eol_nl
fn_script_log_pass "Copying ${modprettyname} to ${modinstalldir}" fn_script_log_pass "Copying ${modprettyname} to ${modinstalldir}"
@ -135,7 +135,7 @@ fn_mod_tidy_files_list() {
local exitcode=$? local exitcode=$?
if [ "${exitcode}" != 0 ]; then if [ "${exitcode}" != 0 ]; then
fn_print_fail_eol_nl 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 core_exit.sh
break break
fi fi
@ -228,7 +228,7 @@ fn_mod_get_info() {
# Define all variables for a mod at once when index is set to a separator. # Define all variables for a mod at once when index is set to a separator.
fn_mods_define() { fn_mods_define() {
if [ -z "$index" ]; then 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." fn_print_error "index variable not set. Please report an issue."
echo -e "* https://github.com/GameServerManagers/LinuxGSM/issues" echo -e "* https://github.com/GameServerManagers/LinuxGSM/issues"
core_exit.sh core_exit.sh
@ -390,7 +390,7 @@ fn_create_mods_dir() {
exitcode=$? exitcode=$?
if [ "${exitcode}" != 0 ]; then if [ "${exitcode}" != 0 ]; then
fn_print_fail_eol_nl 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 core_exit.sh
else else
fn_print_ok_eol_nl fn_print_ok_eol_nl
@ -404,7 +404,7 @@ fn_create_mods_dir() {
exitcode=$? exitcode=$?
if [ "${exitcode}" != 0 ]; then if [ "${exitcode}" != 0 ]; then
fn_print_fail_eol_nl 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 core_exit.sh
else else
fn_print_ok_eol_nl fn_print_ok_eol_nl
@ -427,7 +427,7 @@ fn_mods_create_tmp_dir() {
echo -en "creating mod download directory ${modstmpdir}..." echo -en "creating mod download directory ${modstmpdir}..."
if [ "${exitcode}" != 0 ]; then if [ "${exitcode}" != 0 ]; then
fn_print_fail_eol_nl 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 core_exit.sh
else else
fn_print_ok_eol_nl fn_print_ok_eol_nl
@ -444,7 +444,7 @@ fn_mods_clear_tmp_dir() {
exitcode=$? exitcode=$?
if [ "${exitcode}" != 0 ]; then if [ "${exitcode}" != 0 ]; then
fn_print_fail_eol_nl 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 core_exit.sh
else else
fn_print_ok_eol_nl fn_print_ok_eol_nl
@ -491,12 +491,12 @@ fn_check_mod_files_list() {
if [ "${modsfilelistsize}" -eq 0 ]; then if [ "${modsfilelistsize}" -eq 0 ]; then
fn_print_failure "${modcommand}-files.txt is empty" fn_print_failure "${modcommand}-files.txt is empty"
echo -e "* Unable to remove ${modprettyname}" 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 core_exit.sh
fi fi
else else
fn_print_failure "${modsdir}/${modcommand}-files.txt does not exist" 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 core_exit.sh
fi fi
} }
@ -519,7 +519,7 @@ fn_mod_exist() {
fn_mod_required_fail_exist() { fn_mod_required_fail_exist() {
modreq=$1 modreq=$1
# requires one parameter, the mod # 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..." echo -en "* Unable to find '${modreq}' which is required prior to installing this mod..."
fn_print_fail_eol_nl fn_print_fail_eol_nl
core_exit.sh core_exit.sh
@ -581,7 +581,7 @@ fn_mod_install_liblist_gam_file() {
exitcode=$? exitcode=$?
# if replacement back didn't happen, error out. # if replacement back didn't happen, error out.
if [ "${exitcode}" != 0 ]; then if [ "${exitcode}" != 0 ]; then
fn_script_log_fatal "${logentry}" fn_script_log_fail "${logentry}"
fn_print_fail_eol_nl fn_print_fail_eol_nl
else else
fn_script_log_pass "${logentry}" fn_script_log_pass "${logentry}"
@ -597,7 +597,7 @@ fn_mod_install_liblist_gam_file() {
exitcode=$? exitcode=$?
# if replacement back didn't happen, error out # if replacement back didn't happen, error out
if [ "${exitcode}" != 0 ]; then if [ "${exitcode}" != 0 ]; then
fn_script_log_fatal "${logentry}" fn_script_log_fail "${logentry}"
fn_print_fail_eol_nl fn_print_fail_eol_nl
else else
fn_script_log_pass "${logentry}" fn_script_log_pass "${logentry}"
@ -615,7 +615,7 @@ fn_mod_install_liblist_gam_file() {
exitcode=$? exitcode=$?
# if replacement back didn't happen, error out. # if replacement back didn't happen, error out.
if [ "${exitcode}" != 0 ]; then if [ "${exitcode}" != 0 ]; then
fn_script_log_fatal "${logentry}" fn_script_log_fail "${logentry}"
fn_print_fail_eol_nl fn_print_fail_eol_nl
else else
fn_script_log_pass ${logentry} fn_script_log_pass ${logentry}
@ -639,7 +639,7 @@ fn_mod_remove_liblist_gam_file() {
exitcode=$? exitcode=$?
# if replacement back didn't happen, error out. # if replacement back didn't happen, error out.
if [ "${exitcode}" != 0 ]; then if [ "${exitcode}" != 0 ]; then
fn_script_log_fatal "${logentry}" fn_script_log_fail "${logentry}"
fn_print_fail_eol_nl fn_print_fail_eol_nl
else else
fn_script_log_pass ${logentry} fn_script_log_pass ${logentry}
@ -655,7 +655,7 @@ fn_mod_remove_liblist_gam_file() {
exitcode=$? exitcode=$?
# if replacement back didn't happen, error out # if replacement back didn't happen, error out
if [ "${exitcode}" != 0 ]; then if [ "${exitcode}" != 0 ]; then
fn_script_log_fatal "${logentry}" fn_script_log_fail "${logentry}"
fn_print_fail_eol_nl fn_print_fail_eol_nl
else else
fn_script_log_pass ${logentry} fn_script_log_pass ${logentry}
@ -673,7 +673,7 @@ fn_mod_remove_liblist_gam_file() {
# if replacement back didn't happen, error out. # if replacement back didn't happen, error out.
exitcode=$? exitcode=$?
if [ "${exitcode}" != 0 ]; then if [ "${exitcode}" != 0 ]; then
fn_script_log_fatal "${logentry}" fn_script_log_fail "${logentry}"
fn_print_fail_eol_nl fn_print_fail_eol_nl
else else
fn_script_log_pass ${logentry} 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" echo "linux addons/amxmodx/dlls/amxmodx_mm_i386.so" >> "${modinstalldir}/addons/metamod/plugins.ini"
exitcode=$? exitcode=$?
if [ "${exitcode}" != 0 ]; then if [ "${exitcode}" != 0 ]; then
fn_script_log_fatal "${logentry}" fn_script_log_fail "${logentry}"
fn_print_fail_eol_nl fn_print_fail_eol_nl
else else
fn_script_log_pass ${logentry} 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" echo "linux addons/amxmodx/dlls/amxmodx_mm_i386.so" > "${modinstalldir}/addons/metamod/plugins.ini"
exitcode=$? exitcode=$?
if [ "${exitcode}" != 0 ]; then if [ "${exitcode}" != 0 ]; then
fn_script_log_fatal "${logentry}" fn_script_log_fail "${logentry}"
fn_print_fail_eol_nl fn_print_fail_eol_nl
core_exit.sh core_exit.sh
else else
@ -733,7 +733,7 @@ fn_mod_remove_amxmodx_file() {
sed -i '/^$/d' "${modinstalldir}/addons/metamod/plugins.ini" sed -i '/^$/d' "${modinstalldir}/addons/metamod/plugins.ini"
exitcode=$? exitcode=$?
if [ "${exitcode}" != 0 ]; then if [ "${exitcode}" != 0 ]; then
fn_script_log_fatal "${logentry}" fn_script_log_fail "${logentry}"
fn_print_fail_eol_nl fn_print_fail_eol_nl
else else
fn_script_log_pass ${logentry} fn_script_log_pass ${logentry}

4
lgsm/modules/update_fctr.sh

@ -46,7 +46,7 @@ fn_update_remotebuild() {
# Checks if remotebuildversion variable has been set. # Checks if remotebuildversion variable has been set.
if [ -z "${remotebuildversion}" ] || [ "${remotebuildversion}" == "null" ]; then if [ -z "${remotebuildversion}" ] || [ "${remotebuildversion}" == "null" ]; then
fn_print_fail "Checking remote build: ${remotelocation}" fn_print_fail "Checking remote build: ${remotelocation}"
fn_script_log_fatal "Checking remote build" fn_script_log_fail "Checking remote build"
core_exit.sh core_exit.sh
else else
fn_print_ok "Checking remote build: ${remotelocation}" fn_print_ok "Checking remote build: ${remotelocation}"
@ -56,7 +56,7 @@ fn_update_remotebuild() {
# Checks if remotebuild variable has been set. # Checks if remotebuild variable has been set.
if [ -z "${remotebuildversion}" ] || [ "${remotebuildversion}" == "null" ]; then if [ -z "${remotebuildversion}" ] || [ "${remotebuildversion}" == "null" ]; then
fn_print_failure "Unable to get remote build" 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 core_exit.sh
fi fi
fi fi

4
lgsm/modules/update_jk2.sh

@ -43,7 +43,7 @@ fn_update_remotebuild() {
# Checks if remotebuildversion variable has been set. # Checks if remotebuildversion variable has been set.
if [ -z "${remotebuildversion}" ] || [ "${remotebuildversion}" == "null" ]; then if [ -z "${remotebuildversion}" ] || [ "${remotebuildversion}" == "null" ]; then
fn_print_fail "Checking remote build: ${remotelocation}" fn_print_fail "Checking remote build: ${remotelocation}"
fn_script_log_fatal "Checking remote build" fn_script_log_fail "Checking remote build"
core_exit.sh core_exit.sh
else else
fn_print_ok "Checking remote build: ${remotelocation}" fn_print_ok "Checking remote build: ${remotelocation}"
@ -53,7 +53,7 @@ fn_update_remotebuild() {
# Checks if remotebuild variable has been set. # Checks if remotebuild variable has been set.
if [ -z "${remotebuildversion}" ] || [ "${remotebuildversion}" == "null" ]; then if [ -z "${remotebuildversion}" ] || [ "${remotebuildversion}" == "null" ]; then
fn_print_failure "Unable to get remote build" 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 core_exit.sh
fi fi
fi fi

4
lgsm/modules/update_mc.sh

@ -58,7 +58,7 @@ fn_update_remotebuild() {
# Checks if remotebuildversion variable has been set. # Checks if remotebuildversion variable has been set.
if [ -z "${remotebuildversion}" ] || [ "${remotebuildversion}" == "null" ]; then if [ -z "${remotebuildversion}" ] || [ "${remotebuildversion}" == "null" ]; then
fn_print_fail "Checking remote build: ${remotelocation}" fn_print_fail "Checking remote build: ${remotelocation}"
fn_script_log_fatal "Checking remote build" fn_script_log_fail "Checking remote build"
core_exit.sh core_exit.sh
else else
fn_print_ok "Checking remote build: ${remotelocation}" fn_print_ok "Checking remote build: ${remotelocation}"
@ -68,7 +68,7 @@ fn_update_remotebuild() {
# Checks if remotebuild variable has been set. # Checks if remotebuild variable has been set.
if [ -z "${remotebuildversion}" ] || [ "${remotebuildversion}" == "null" ]; then if [ -z "${remotebuildversion}" ] || [ "${remotebuildversion}" == "null" ]; then
fn_print_failure "Unable to get remote build" 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 core_exit.sh
fi fi
fi fi

10
lgsm/modules/update_mcb.sh

@ -18,7 +18,7 @@ fn_update_dl() {
local exitcode=$? local exitcode=$?
if [ "${exitcode}" != 0 ]; then if [ "${exitcode}" != 0 ]; then
fn_print_fail_eol_nl fn_print_fail_eol_nl
fn_script_log_fatal "Extracting ${local_filename}" fn_script_log_fail "Extracting ${local_filename}"
if [ -f "${lgsmlog}" ]; then if [ -f "${lgsmlog}" ]; then
echo -e "${extractcmd}" >> "${lgsmlog}" echo -e "${extractcmd}" >> "${lgsmlog}"
fi fi
@ -50,10 +50,10 @@ fn_update_localbuild() {
fn_update_remotebuild() { fn_update_remotebuild() {
# Random number for userAgent # 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. # Get remote build info.
if [ "${mcversion}" == "latest" ]; then 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 else
remotebuildversion="${mcversion}" remotebuildversion="${mcversion}"
fi fi
@ -64,7 +64,7 @@ fn_update_remotebuild() {
# Checks if remotebuildversion variable has been set. # Checks if remotebuildversion variable has been set.
if [ -z "${remotebuildversion}" ] || [ "${remotebuildversion}" == "null" ]; then if [ -z "${remotebuildversion}" ] || [ "${remotebuildversion}" == "null" ]; then
fn_print_fail "Checking remote build: ${remotelocation}" fn_print_fail "Checking remote build: ${remotelocation}"
fn_script_log_fatal "Checking remote build" fn_script_log_fail "Checking remote build"
core_exit.sh core_exit.sh
else else
fn_print_ok "Checking remote build: ${remotelocation}" fn_print_ok "Checking remote build: ${remotelocation}"
@ -74,7 +74,7 @@ fn_update_remotebuild() {
# Checks if remotebuild variable has been set. # Checks if remotebuild variable has been set.
if [ -z "${remotebuildversion}" ] || [ "${remotebuildversion}" == "null" ]; then if [ -z "${remotebuildversion}" ] || [ "${remotebuildversion}" == "null" ]; then
fn_print_failure "Unable to get remote build" 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 core_exit.sh
fi fi
fi fi

4
lgsm/modules/update_mta.sh

@ -45,7 +45,7 @@ fn_update_remotebuild() {
# Checks if remotebuildversion variable has been set. # Checks if remotebuildversion variable has been set.
if [ -z "${remotebuildversion}" ] || [ "${remotebuildversion}" == "null" ]; then if [ -z "${remotebuildversion}" ] || [ "${remotebuildversion}" == "null" ]; then
fn_print_fail "Checking remote build: ${remotelocation}" fn_print_fail "Checking remote build: ${remotelocation}"
fn_script_log_fatal "Checking remote build" fn_script_log_fail "Checking remote build"
core_exit.sh core_exit.sh
else else
fn_print_ok "Checking remote build: ${remotelocation}" fn_print_ok "Checking remote build: ${remotelocation}"
@ -55,7 +55,7 @@ fn_update_remotebuild() {
# Checks if remotebuild variable has been set. # Checks if remotebuild variable has been set.
if [ -z "${remotebuildversion}" ] || [ "${remotebuildversion}" == "null" ]; then if [ -z "${remotebuildversion}" ] || [ "${remotebuildversion}" == "null" ]; then
fn_print_failure "Unable to get remote build" 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 core_exit.sh
fi fi
fi fi

4
lgsm/modules/update_pmc.sh

@ -68,7 +68,7 @@ fn_update_remotebuild() {
# Checks if remotebuildversion variable has been set. # Checks if remotebuildversion variable has been set.
if [ -z "${remotebuildversion}" ] || [ "${remotebuildversion}" == "null" ]; then if [ -z "${remotebuildversion}" ] || [ "${remotebuildversion}" == "null" ]; then
fn_print_fail "Checking remote build: ${remotelocation}" fn_print_fail "Checking remote build: ${remotelocation}"
fn_script_log_fatal "Checking remote build" fn_script_log_fail "Checking remote build"
core_exit.sh core_exit.sh
else else
fn_print_ok "Checking remote build: ${remotelocation}" fn_print_ok "Checking remote build: ${remotelocation}"
@ -78,7 +78,7 @@ fn_update_remotebuild() {
# Checks if remotebuild variable has been set. # Checks if remotebuild variable has been set.
if [ -z "${remotebuildversion}" ] || [ "${remotebuildversion}" == "null" ]; then if [ -z "${remotebuildversion}" ] || [ "${remotebuildversion}" == "null" ]; then
fn_print_failure "Unable to get remote build" 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 core_exit.sh
fi fi
fi fi

6
lgsm/modules/update_ts3.sh

@ -50,7 +50,7 @@ fn_update_remotebuild() {
# Checks if remotebuildversion variable has been set. # Checks if remotebuildversion variable has been set.
if [ -z "${remotebuildversion}" ] || [ "${remotebuildversion}" == "null" ]; then if [ -z "${remotebuildversion}" ] || [ "${remotebuildversion}" == "null" ]; then
fn_print_fail "Checking remote build: ${remotelocation}" fn_print_fail "Checking remote build: ${remotelocation}"
fn_script_log_fatal "Checking remote build" fn_script_log_fail "Checking remote build"
core_exit.sh core_exit.sh
else else
fn_print_ok "Checking remote build: ${remotelocation}" fn_print_ok "Checking remote build: ${remotelocation}"
@ -60,7 +60,7 @@ fn_update_remotebuild() {
# Checks if remotebuild variable has been set. # Checks if remotebuild variable has been set.
if [ -z "${remotebuildversion}" ] || [ "${remotebuildversion}" == "null" ]; then if [ -z "${remotebuildversion}" ] || [ "${remotebuildversion}" == "null" ]; then
fn_print_failure "Unable to get remote build" 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 core_exit.sh
fi fi
fi fi
@ -164,7 +164,7 @@ elif [ "${arch}" == "i386" ] || [ "${arch}" == "i686" ]; then
ts3arch="x86" ts3arch="x86"
else else
fn_print_failure "Unknown or unsupported architecture: ${arch}" 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 core_exit.sh
fi fi

4
lgsm/modules/update_ut99.sh

@ -44,7 +44,7 @@ fn_update_remotebuild() {
# Checks if remotebuildversion variable has been set. # Checks if remotebuildversion variable has been set.
if [ -z "${remotebuildversion}" ] || [ "${remotebuildversion}" == "null" ]; then if [ -z "${remotebuildversion}" ] || [ "${remotebuildversion}" == "null" ]; then
fn_print_fail "Checking remote build: ${remotelocation}" fn_print_fail "Checking remote build: ${remotelocation}"
fn_script_log_fatal "Checking remote build" fn_script_log_fail "Checking remote build"
core_exit.sh core_exit.sh
else else
fn_print_ok "Checking remote build: ${remotelocation}" fn_print_ok "Checking remote build: ${remotelocation}"
@ -54,7 +54,7 @@ fn_update_remotebuild() {
# Checks if remotebuild variable has been set. # Checks if remotebuild variable has been set.
if [ -z "${remotebuildversion}" ] || [ "${remotebuildversion}" == "null" ]; then if [ -z "${remotebuildversion}" ] || [ "${remotebuildversion}" == "null" ]; then
fn_print_failure "Unable to get remote build" 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 core_exit.sh
fi fi
fi fi

4
lgsm/modules/update_vints.sh

@ -51,7 +51,7 @@ fn_update_remotebuild() {
# Checks if remotebuildversion variable has been set. # Checks if remotebuildversion variable has been set.
if [ -z "${remotebuildversion}" ] || [ "${remotebuildversion}" == "null" ]; then if [ -z "${remotebuildversion}" ] || [ "${remotebuildversion}" == "null" ]; then
fn_print_fail "Checking remote build: ${remotelocation}" fn_print_fail "Checking remote build: ${remotelocation}"
fn_script_log_fatal "Checking remote build" fn_script_log_fail "Checking remote build"
core_exit.sh core_exit.sh
else else
fn_print_ok "Checking remote build: ${remotelocation}" fn_print_ok "Checking remote build: ${remotelocation}"
@ -61,7 +61,7 @@ fn_update_remotebuild() {
# Checks if remotebuild variable has been set. # Checks if remotebuild variable has been set.
if [ -z "${remotebuildversion}" ] || [ "${remotebuildversion}" == "null" ]; then if [ -z "${remotebuildversion}" ] || [ "${remotebuildversion}" == "null" ]; then
fn_print_failure "Unable to get remote build" 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 core_exit.sh
fi fi
fi fi

4
linuxgsm.sh

@ -124,8 +124,8 @@ fn_bootstrap_fetch_file() {
if [ ${counter} -ge 2 ]; then if [ ${counter} -ge 2 ]; then
echo -e "FAIL" echo -e "FAIL"
if [ -f "${lgsmlog}" ]; then if [ -f "${lgsmlog}" ]; then
fn_script_log_fatal "Downloading ${local_filename}" fn_script_log_fail "Downloading ${local_filename}"
fn_script_log_fatal "${fileurl}" fn_script_log_fail "${fileurl}"
fi fi
core_exit.sh core_exit.sh
else else

4
tests/tests_fctrserver.sh

@ -122,8 +122,8 @@ fn_bootstrap_fetch_file() {
if [ ${counter} -ge 2 ]; then if [ ${counter} -ge 2 ]; then
echo -e "FAIL" echo -e "FAIL"
if [ -f "${lgsmlog}" ]; then if [ -f "${lgsmlog}" ]; then
fn_script_log_fatal "Downloading ${local_filename}" fn_script_log_fail "Downloading ${local_filename}"
fn_script_log_fatal "${fileurl}" fn_script_log_fail "${fileurl}"
fi fi
core_exit.sh core_exit.sh
else else

4
tests/tests_jc2server.sh

@ -123,8 +123,8 @@ fn_bootstrap_fetch_file() {
if [ ${counter} -ge 2 ]; then if [ ${counter} -ge 2 ]; then
echo -e "FAIL" echo -e "FAIL"
if [ -f "${lgsmlog}" ]; then if [ -f "${lgsmlog}" ]; then
fn_script_log_fatal "Downloading ${local_filename}" fn_script_log_fail "Downloading ${local_filename}"
fn_script_log_fatal "${fileurl}" fn_script_log_fail "${fileurl}"
fi fi
core_exit.sh core_exit.sh
else else

4
tests/tests_mcserver.sh

@ -123,8 +123,8 @@ fn_bootstrap_fetch_file() {
if [ ${counter} -ge 2 ]; then if [ ${counter} -ge 2 ]; then
echo -e "FAIL" echo -e "FAIL"
if [ -f "${lgsmlog}" ]; then if [ -f "${lgsmlog}" ]; then
fn_script_log_fatal "Downloading ${local_filename}" fn_script_log_fail "Downloading ${local_filename}"
fn_script_log_fatal "${fileurl}" fn_script_log_fail "${fileurl}"
fi fi
core_exit.sh core_exit.sh
else else

4
tests/tests_ts3server.sh

@ -123,8 +123,8 @@ fn_bootstrap_fetch_file() {
if [ ${counter} -ge 2 ]; then if [ ${counter} -ge 2 ]; then
echo -e "FAIL" echo -e "FAIL"
if [ -f "${lgsmlog}" ]; then if [ -f "${lgsmlog}" ]; then
fn_script_log_fatal "Downloading ${local_filename}" fn_script_log_fail "Downloading ${local_filename}"
fn_script_log_fatal "${fileurl}" fn_script_log_fail "${fileurl}"
fi fi
core_exit.sh core_exit.sh
else else

Loading…
Cancel
Save