Browse Source

feat(log): refactor log handling (#2859)

* standardise module identifiers
* renamed logs.sh to core_logs.sh
* improve stats log
* remove local
* functionselfname rename
pull/2878/head
Daniel Gibbs 5 years ago
committed by GitHub
parent
commit
66bf5e059e
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 43
      lgsm/functions/alert.sh
  2. 4
      lgsm/functions/alert_discord.sh
  3. 4
      lgsm/functions/alert_email.sh
  4. 4
      lgsm/functions/alert_ifttt.sh
  5. 4
      lgsm/functions/alert_mailgun.sh
  6. 4
      lgsm/functions/alert_pushbullet.sh
  7. 4
      lgsm/functions/alert_pushover.sh
  8. 4
      lgsm/functions/alert_slack.sh
  9. 4
      lgsm/functions/alert_telegram.sh
  10. 44
      lgsm/functions/check.sh
  11. 3
      lgsm/functions/check_config.sh
  12. 16
      lgsm/functions/check_deps.sh
  13. 3
      lgsm/functions/check_executable.sh
  14. 2
      lgsm/functions/check_glibc.sh
  15. 14
      lgsm/functions/check_ip.sh
  16. 2
      lgsm/functions/check_last_update.sh
  17. 3
      lgsm/functions/check_logs.sh
  18. 4
      lgsm/functions/check_permissions.sh
  19. 5
      lgsm/functions/check_root.sh
  20. 3
      lgsm/functions/check_status.sh
  21. 10
      lgsm/functions/check_steamcmd.sh
  22. 5
      lgsm/functions/check_system_dir.sh
  23. 3
      lgsm/functions/check_system_requirements.sh
  24. 2
      lgsm/functions/check_tmuxception.sh
  25. 6
      lgsm/functions/command_backup.sh
  26. 6
      lgsm/functions/command_console.sh
  27. 6
      lgsm/functions/command_debug.sh
  28. 6
      lgsm/functions/command_details.sh
  29. 6
      lgsm/functions/command_dev_clear_functions.sh
  30. 6
      lgsm/functions/command_dev_debug.sh
  31. 12
      lgsm/functions/command_dev_detect_deps.sh
  32. 8
      lgsm/functions/command_dev_detect_glibc.sh
  33. 6
      lgsm/functions/command_dev_detect_ldd.sh
  34. 6
      lgsm/functions/command_dev_query_raw.sh
  35. 6
      lgsm/functions/command_donate.sh
  36. 8
      lgsm/functions/command_fastdl.sh
  37. 6
      lgsm/functions/command_install.sh
  38. 6
      lgsm/functions/command_install_resources_mta.sh
  39. 6
      lgsm/functions/command_mods_install.sh
  40. 6
      lgsm/functions/command_mods_remove.sh
  41. 6
      lgsm/functions/command_mods_update.sh
  42. 23
      lgsm/functions/command_monitor.sh
  43. 34
      lgsm/functions/command_postdetails.sh
  44. 6
      lgsm/functions/command_restart.sh
  45. 8
      lgsm/functions/command_start.sh
  46. 6
      lgsm/functions/command_stop.sh
  47. 6
      lgsm/functions/command_test_alert.sh
  48. 6
      lgsm/functions/command_ts3_server_pass.sh
  49. 8
      lgsm/functions/command_update.sh
  50. 13
      lgsm/functions/command_update_functions.sh
  51. 6
      lgsm/functions/command_update_linuxgsm.sh
  52. 6
      lgsm/functions/command_validate.sh
  53. 6
      lgsm/functions/command_wipe.sh
  54. 5
      lgsm/functions/compress_unreal2_maps.sh
  55. 5
      lgsm/functions/compress_ut99_maps.sh
  56. 6
      lgsm/functions/core_dl.sh
  57. 16
      lgsm/functions/core_exit.sh
  58. 4
      lgsm/functions/core_functions.sh
  59. 2
      lgsm/functions/core_getopt.sh
  60. 2
      lgsm/functions/core_legacy.sh
  61. 7
      lgsm/functions/core_logs.sh
  62. 26
      lgsm/functions/core_messages.sh
  63. 2
      lgsm/functions/core_trap.sh
  64. 7
      lgsm/functions/fix.sh
  65. 2
      lgsm/functions/fix_ark.sh
  66. 4
      lgsm/functions/fix_arma3.sh
  67. 3
      lgsm/functions/fix_av.sh
  68. 4
      lgsm/functions/fix_csgo.sh
  69. 4
      lgsm/functions/fix_dst.sh
  70. 3
      lgsm/functions/fix_ges.sh
  71. 2
      lgsm/functions/fix_hw.sh
  72. 5
      lgsm/functions/fix_ins.sh
  73. 4
      lgsm/functions/fix_kf.sh
  74. 4
      lgsm/functions/fix_kf2.sh
  75. 3
      lgsm/functions/fix_mcb.sh
  76. 4
      lgsm/functions/fix_mta.sh
  77. 3
      lgsm/functions/fix_nmrih.sh
  78. 4
      lgsm/functions/fix_onset.sh
  79. 4
      lgsm/functions/fix_ro.sh
  80. 3
      lgsm/functions/fix_rust.sh
  81. 3
      lgsm/functions/fix_rw.sh
  82. 3
      lgsm/functions/fix_sdtd.sh
  83. 4
      lgsm/functions/fix_sfc.sh
  84. 4
      lgsm/functions/fix_sof2.sh
  85. 4
      lgsm/functions/fix_ss3.sh
  86. 4
      lgsm/functions/fix_steamcmd.sh
  87. 4
      lgsm/functions/fix_terraria.sh
  88. 4
      lgsm/functions/fix_tf2.sh
  89. 4
      lgsm/functions/fix_ts3.sh
  90. 2
      lgsm/functions/fix_tu.sh
  91. 3
      lgsm/functions/fix_unt.sh
  92. 4
      lgsm/functions/fix_ut.sh
  93. 4
      lgsm/functions/fix_ut2k4.sh
  94. 4
      lgsm/functions/fix_ut3.sh
  95. 3
      lgsm/functions/fix_wurm.sh
  96. 4
      lgsm/functions/fix_zmr.sh
  97. 2
      lgsm/functions/info_config.sh
  98. 2
      lgsm/functions/info_distro.sh
  99. 6
      lgsm/functions/info_messages.sh
  100. 2
      lgsm/functions/info_parms.sh

43
lgsm/functions/alert.sh

@ -4,8 +4,7 @@
# Website: https://linuxgsm.com # Website: https://linuxgsm.com
# Description: Overall function for managing alerts. # Description: Overall function for managing alerts.
local modulename="ALERT" functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
local commandaction="Alert"
fn_alert_log(){ fn_alert_log(){
info_distro.sh info_distro.sh
@ -100,23 +99,23 @@ fn_alert_log
if [ "${postalert}" == "on" ]&&[ -n "${postalert}" ]; then if [ "${postalert}" == "on" ]&&[ -n "${postalert}" ]; then
exitbypass=1 exitbypass=1
command_postdetails.sh command_postdetails.sh
elif [ "${postalert}" != "on" ]&&[ "${function_selfname}" == "command_test_alert.sh" ]; then elif [ "${postalert}" != "on" ]&&[ "${commandname}" == "TEST-ALERT" ]; then
fn_print_warn_nl "More Info not enabled" fn_print_warn_nl "More Info not enabled"
fn_script_log_warn "More Info alerts not enabled" fn_script_log_warn "More Info alerts not enabled"
elif [ -z "${posttarget}" ]&&[ "${function_selfname}" == "command_test_alert.sh" ]; then elif [ -z "${posttarget}" ]&&[ "${commandname}" == "TEST-ALERT" ]; then
fn_print_error_nl "posttarget not set" fn_print_error_nl "posttarget not set"
fn_script_error "posttarget not set" fn_script_error "posttarget not set"
elif [ -z "${postdays}" ]&&[ "${function_selfname}" == "command_test_alert.sh" ]; then elif [ -z "${postdays}" ]&&[ "${commandname}" == "TEST-ALERT" ]; then
fn_print_error_nl "postdays not set" fn_print_error_nl "postdays not set"
fn_script_error "postdays not set" fn_script_error "postdays not set"
fi fi
if [ "${discordalert}" == "on" ]&&[ -n "${discordalert}" ]; then if [ "${discordalert}" == "on" ]&&[ -n "${discordalert}" ]; then
alert_discord.sh alert_discord.sh
elif [ "${discordalert}" != "on" ]&&[ "${function_selfname}" == "command_test_alert.sh" ]; then elif [ "${discordalert}" != "on" ]&&[ "${commandname}" == "TEST-ALERT" ]; then
fn_print_warn_nl "Discord alerts not enabled" fn_print_warn_nl "Discord alerts not enabled"
fn_script_log_warn "Discord alerts not enabled" fn_script_log_warn "Discord alerts not enabled"
elif [ -z "${discordtoken}" ]&&[ "${function_selfname}" == "command_test_alert.sh" ]; then elif [ -z "${discordtoken}" ]&&[ "${commandname}" == "TEST-ALERT" ]; then
fn_print_error_nl "Discord token not set" fn_print_error_nl "Discord token not set"
echo -e "* https://docs.linuxgsm.com/alerts/discord" echo -e "* https://docs.linuxgsm.com/alerts/discord"
fn_script_error "Discord token not set" fn_script_error "Discord token not set"
@ -124,20 +123,20 @@ fi
if [ "${emailalert}" == "on" ]&&[ -n "${email}" ]; then if [ "${emailalert}" == "on" ]&&[ -n "${email}" ]; then
alert_email.sh alert_email.sh
elif [ "${emailalert}" != "on" ]&&[ "${function_selfname}" == "command_test_alert.sh" ]; then elif [ "${emailalert}" != "on" ]&&[ "${commandname}" == "TEST-ALERT" ]; then
fn_print_warn_nl "Email alerts not enabled" fn_print_warn_nl "Email alerts not enabled"
fn_script_log_warn "Email alerts not enabled" fn_script_log_warn "Email alerts not enabled"
elif [ -z "${email}" ]&&[ "${function_selfname}" == "command_test_alert.sh" ]; then elif [ -z "${email}" ]&&[ "${commandname}" == "TEST-ALERT" ]; then
fn_print_error_nl "Email not set" fn_print_error_nl "Email not set"
fn_script_log_error "Email not set" fn_script_log_error "Email not set"
fi fi
if [ "${iftttalert}" == "on" ]&&[ -n "${iftttalert}" ]; then if [ "${iftttalert}" == "on" ]&&[ -n "${iftttalert}" ]; then
alert_ifttt.sh alert_ifttt.sh
elif [ "${iftttalert}" != "on" ]&&[ "${function_selfname}" == "command_test_alert.sh" ]; then elif [ "${iftttalert}" != "on" ]&&[ "${commandname}" == "TEST-ALERT" ]; then
fn_print_warn_nl "IFTTT alerts not enabled" fn_print_warn_nl "IFTTT alerts not enabled"
fn_script_log_warn "IFTTT alerts not enabled" fn_script_log_warn "IFTTT alerts not enabled"
elif [ -z "${ifttttoken}" ]&&[ "${function_selfname}" == "command_test_alert.sh" ]; then elif [ -z "${ifttttoken}" ]&&[ "${commandname}" == "TEST-ALERT" ]; then
fn_print_error_nl "IFTTT token not set" fn_print_error_nl "IFTTT token not set"
echo -e "* https://docs.linuxgsm.com/alerts/ifttt" echo -e "* https://docs.linuxgsm.com/alerts/ifttt"
fn_script_error "IFTTT token not set" fn_script_error "IFTTT token not set"
@ -145,10 +144,10 @@ fi
if [ "${mailgunalert}" == "on" ]&&[ -n "${mailgunalert}" ]; then if [ "${mailgunalert}" == "on" ]&&[ -n "${mailgunalert}" ]; then
alert_mailgun.sh alert_mailgun.sh
elif [ "${mailgunalert}" != "on" ]&&[ "${function_selfname}" == "command_test_alert.sh" ]; then elif [ "${mailgunalert}" != "on" ]&&[ "${commandname}" == "TEST-ALERT" ]; then
fn_print_warn_nl "Mailgun alerts not enabled" fn_print_warn_nl "Mailgun alerts not enabled"
fn_script_log_warn "Mailgun alerts not enabled" fn_script_log_warn "Mailgun alerts not enabled"
elif [ -z "${mailguntoken}" ]&&[ "${function_selfname}" == "command_test_alert.sh" ]; then elif [ -z "${mailguntoken}" ]&&[ "${commandname}" == "TEST-ALERT" ]; then
fn_print_error_nl "Mailgun token not set" fn_print_error_nl "Mailgun token not set"
echo -e "* https://docs.linuxgsm.com/alerts/mailgun" echo -e "* https://docs.linuxgsm.com/alerts/mailgun"
fn_script_error "Mailgun token not set" fn_script_error "Mailgun token not set"
@ -156,10 +155,10 @@ fi
if [ "${pushbulletalert}" == "on" ]&&[ -n "${pushbullettoken}" ]; then if [ "${pushbulletalert}" == "on" ]&&[ -n "${pushbullettoken}" ]; then
alert_pushbullet.sh alert_pushbullet.sh
elif [ "${pushbulletalert}" != "on" ]&&[ "${function_selfname}" == "command_test_alert.sh" ]; then elif [ "${pushbulletalert}" != "on" ]&&[ "${commandname}" == "TEST-ALERT" ]; then
fn_print_warn_nl "Pushbullet alerts not enabled" fn_print_warn_nl "Pushbullet alerts not enabled"
fn_script_log_warn "Pushbullet alerts not enabled" fn_script_log_warn "Pushbullet alerts not enabled"
elif [ -z "${pushbullettoken}" ]&&[ "${function_selfname}" == "command_test_alert.sh" ]; then elif [ -z "${pushbullettoken}" ]&&[ "${commandname}" == "TEST-ALERT" ]; then
fn_print_error_nl "Pushbullet token not set" fn_print_error_nl "Pushbullet token not set"
echo -e "* https://docs.linuxgsm.com/alerts/pushbullet" echo -e "* https://docs.linuxgsm.com/alerts/pushbullet"
fn_script_error "Pushbullet token not set" fn_script_error "Pushbullet token not set"
@ -167,10 +166,10 @@ fi
if [ "${pushoveralert}" == "on" ]&&[ -n "${pushoveralert}" ]; then if [ "${pushoveralert}" == "on" ]&&[ -n "${pushoveralert}" ]; then
alert_pushover.sh alert_pushover.sh
elif [ "${pushoveralert}" != "on" ]&&[ "${function_selfname}" == "command_test_alert.sh" ]; then elif [ "${pushoveralert}" != "on" ]&&[ "${commandname}" == "TEST-ALERT" ]; then
fn_print_warn_nl "Pushover alerts not enabled" fn_print_warn_nl "Pushover alerts not enabled"
fn_script_log_warn "Pushover alerts not enabled" fn_script_log_warn "Pushover alerts not enabled"
elif [ -z "${pushovertoken}" ]&&[ "${function_selfname}" == "command_test_alert.sh" ]; then elif [ -z "${pushovertoken}" ]&&[ "${commandname}" == "TEST-ALERT" ]; then
fn_print_error_nl "Pushover token not set" fn_print_error_nl "Pushover token not set"
echo -e "* https://docs.linuxgsm.com/alerts/pushover" echo -e "* https://docs.linuxgsm.com/alerts/pushover"
fn_script_error "Pushover token not set" fn_script_error "Pushover token not set"
@ -178,14 +177,14 @@ fi
if [ "${telegramalert}" == "on" ]&&[ -n "${telegramtoken}" ]; then if [ "${telegramalert}" == "on" ]&&[ -n "${telegramtoken}" ]; then
alert_telegram.sh alert_telegram.sh
elif [ "${telegramalert}" != "on" ]&&[ "${function_selfname}" == "command_test_alert.sh" ]; then elif [ "${telegramalert}" != "on" ]&&[ "${commandname}" == "TEST-ALERT" ]; then
fn_print_warn_nl "Telegram Messages not enabled" fn_print_warn_nl "Telegram Messages not enabled"
fn_script_log_warn "Telegram Messages not enabled" fn_script_log_warn "Telegram Messages not enabled"
elif [ -z "${telegramtoken}" ]&&[ "${function_selfname}" == "command_test_alert.sh" ]; then elif [ -z "${telegramtoken}" ]&&[ "${commandname}" == "TEST-ALERT" ]; then
fn_print_error_nl "Telegram token not set." fn_print_error_nl "Telegram token not set."
echo -e "* https://docs.linuxgsm.com/alerts/telegram" echo -e "* https://docs.linuxgsm.com/alerts/telegram"
fn_script_error "Telegram token not set." fn_script_error "Telegram token not set."
elif [ -z "${telegramchatid}" ]&&[ "${function_selfname}" == "command_test_alert.sh" ]; then elif [ -z "${telegramchatid}" ]&&[ "${commandname}" == "TEST-ALERT" ]; then
fn_print_error_nl "Telegram chat id not set." fn_print_error_nl "Telegram chat id not set."
echo -e "* https://docs.linuxgsm.com/alerts/telegram" echo -e "* https://docs.linuxgsm.com/alerts/telegram"
fn_script_error "Telegram chat id not set." fn_script_error "Telegram chat id not set."
@ -193,10 +192,10 @@ fi
if [ "${slackalert}" == "on" ]&&[ -n "${slackalert}" ]; then if [ "${slackalert}" == "on" ]&&[ -n "${slackalert}" ]; then
alert_slack.sh alert_slack.sh
elif [ "${slackalert}" != "on" ]&&[ "${function_selfname}" == "command_test_alert.sh" ]; then elif [ "${slackalert}" != "on" ]&&[ "${commandname}" == "TEST-ALERT" ]; then
fn_print_warn_nl "Slack alerts not enabled" fn_print_warn_nl "Slack alerts not enabled"
fn_script_log_warn "Slack alerts not enabled" fn_script_log_warn "Slack alerts not enabled"
elif [ -z "${slacktoken}" ]&&[ "${function_selfname}" == "command_test_alert.sh" ]; then elif [ -z "${slacktoken}" ]&&[ "${commandname}" == "TEST-ALERT" ]; then
fn_print_error_nl "Slack token not set" fn_print_error_nl "Slack token not set"
echo -e "* https://docs.linuxgsm.com/alerts/slack" echo -e "* https://docs.linuxgsm.com/alerts/slack"
fn_script_error "Slack token not set" fn_script_error "Slack token not set"

4
lgsm/functions/alert_discord.sh

@ -5,9 +5,7 @@
# Website: https://linuxgsm.com # Website: https://linuxgsm.com
# Description: Sends Discord alert. # Description: Sends Discord alert.
local modulename="ALERT" functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
local commandaction="Alert"
local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
if ! command -v jq > /dev/null; then if ! command -v jq > /dev/null; then
fn_print_fail_nl "Sending Discord alert: jq is missing." fn_print_fail_nl "Sending Discord alert: jq is missing."

4
lgsm/functions/alert_email.sh

@ -4,9 +4,7 @@
# Website: https://linuxgsm.com # Website: https://linuxgsm.com
# Description: Sends email alert. # Description: Sends email alert.
local modulename="ALERT" functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
local commandaction="Alert"
local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
fn_print_dots "Sending Email alert: ${email}" fn_print_dots "Sending Email alert: ${email}"
fn_sleep_time fn_sleep_time

4
lgsm/functions/alert_ifttt.sh

@ -4,9 +4,7 @@
# Website: https://linuxgsm.com # Website: https://linuxgsm.com
# Description: Sends IFTTT alert. # Description: Sends IFTTT alert.
local modulename="ALERT" functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
local commandaction="Alert"
local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
json=$(cat <<EOF json=$(cat <<EOF
{ {

4
lgsm/functions/alert_mailgun.sh

@ -4,9 +4,7 @@
# Website: https://linuxgsm.com # Website: https://linuxgsm.com
# Description: Sends Mailgun Email alert. # Description: Sends Mailgun Email alert.
local modulename="ALERT" functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
local commandaction="Alert"
local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
fn_print_dots "Sending Email alert: Mailgun: ${email}" fn_print_dots "Sending Email alert: Mailgun: ${email}"

4
lgsm/functions/alert_pushbullet.sh

@ -4,9 +4,7 @@
# Website: https://linuxgsm.com # Website: https://linuxgsm.com
# Description: Sends Pushbullet Messenger alert. # Description: Sends Pushbullet Messenger alert.
local modulename="ALERT" functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
local commandaction="Alert"
local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
json=$(cat <<EOF json=$(cat <<EOF
{ {

4
lgsm/functions/alert_pushover.sh

@ -4,9 +4,7 @@
# Website: https://linuxgsm.com # Website: https://linuxgsm.com
# Description: Sends Pushover alert. # Description: Sends Pushover alert.
local modulename="ALERT" functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
local commandaction="Alert"
local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
fn_print_dots "Sending Pushover alert" fn_print_dots "Sending Pushover alert"

4
lgsm/functions/alert_slack.sh

@ -4,9 +4,7 @@
# Website: https://linuxgsm.com # Website: https://linuxgsm.com
# Description: Sends Slack alert. # Description: Sends Slack alert.
local modulename="ALERT" functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
local commandaction="Alert"
local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
if ! command -v jq > /dev/null; then if ! command -v jq > /dev/null; then
fn_print_fail_nl "Sending Slack alert: jq is missing." fn_print_fail_nl "Sending Slack alert: jq is missing."

4
lgsm/functions/alert_telegram.sh

@ -4,9 +4,7 @@
# Website: https://bytegaming.de # Website: https://bytegaming.de
# Description: Sends Telegram Messenger alert. # Description: Sends Telegram Messenger alert.
local modulename="ALERT" functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
local commandaction="Alert"
local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
json=$(cat <<EOF json=$(cat <<EOF
{ {

44
lgsm/functions/check.sh

@ -5,101 +5,101 @@
# Description: Overall function for managing checks. # Description: Overall function for managing checks.
# Runs checks that will either halt on or fix an issue. # Runs checks that will either halt on or fix an issue.
local modulename="CHECK" functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
# Every command that requires checks just references check.sh. # Every command that requires checks just references check.sh.
# check.sh selects which checks to run by using arrays. # check.sh selects which checks to run by using arrays.
if [ "${userinput}" != "install" ]&&[ "${userinput}" != "auto-install" ]&&[ "${userinput}" != "i" ]&&[ "${userinput}" != "ai" ]; then if [ "${commandname}" != "INSTALL" ]; then
check_root.sh check_root.sh
fi fi
check_tmuxception.sh check_tmuxception.sh
if [ "$(whoami)" != "root" ]; then if [ "$(whoami)" != "root" ]; then
if [ "${function_selfname}" != "command_monitor.sh" ]; then if [ "${commandname}" != "MONITOR" ]; then
check_permissions.sh check_permissions.sh
fi fi
fi fi
if [ "${function_selfname}" != "command_install.sh" ]&&[ "${function_selfname}" != "command_update_functions.sh" ]&&[ "${function_selfname}" != "command_update_linuxgsm.sh" ]&&[ "${function_selfname}" != "command_details.sh" ]&&[ "${function_selfname}" != "command_postdetails.sh" ]; then if [ "${commandname}" != "INSTALL" ]&&[ "${commandname}" != "UPDATE-LGSM" ]&&[ "${commandname}" != "DETAILS" ]&&[ "${commandname}" != "POST-DETAILS" ]; then
check_system_dir.sh check_system_dir.sh
fi fi
local allowed_commands_array=( command_start.sh command_debug.sh ) allowed_commands_array=( START DEBUG )
for allowed_command in "${allowed_commands_array[@]}" for allowed_command in "${allowed_commands_array[@]}"
do do
if [ "${allowed_command}" == "${function_selfname}" ]; then if [ "${allowed_command}" == "${commandname}" ]; then
check_executable.sh check_executable.sh
fi fi
done done
if [ "$(whoami)" != "root" ]; then if [ "$(whoami)" != "root" ]; then
local allowed_commands_array=( command_debug.sh command_start.sh command_install.sh ) allowed_commands_array=( DEBUG START INSTALL )
for allowed_command in "${allowed_commands_array[@]}" for allowed_command in "${allowed_commands_array[@]}"
do do
if [ "${allowed_command}" == "${function_selfname}" ]; then if [ "${allowed_command}" == "${commandname}" ]; then
check_glibc.sh check_glibc.sh
fi fi
done done
fi fi
local allowed_commands_array=( command_backup.sh command_console.sh command_debug.sh command_details.sh command_unreal2_maps.sh command_fastdl.sh command_mods_install.sh command_mods_remove.sh command_mods_update.sh command_monitor.sh command_postdetails.sh command_restart.sh command_start.sh command_stop.sh command_test_alert.sh command_ts3_server_pass.sh command_update.sh command_update_functions.sh command_validate.sh command_wipe.sh command_unreal2_maps.sh command_ut99maps.sh) allowed_commands_array=( BACKUP CONSOLE DEBUG DETAILS MAP-COMPRESSOR FASTDL MODS-INSTALL MODS-REMOVE MODS-UPDATE MONITOR POST-DETAILS RESTART START STOP TEST-ALERT CHANGE-PASSWORD UPDATE UPDATE-LGSM VALIDATE WIPW )
for allowed_command in "${allowed_commands_array[@]}" for allowed_command in "${allowed_commands_array[@]}"
do do
if [ "${allowed_command}" == "${function_selfname}" ]; then if [ "${allowed_command}" == "${commandname}" ]; then
check_logs.sh check_logs.sh
fi fi
done done
local allowed_commands_array=( command_debug.sh command_start.sh command_stop.sh ) allowed_commands_array=( DEBUG START STOP )
for allowed_command in "${allowed_commands_array[@]}" for allowed_command in "${allowed_commands_array[@]}"
do do
if [ "${allowed_command}" == "${function_selfname}" ]; then if [ "${allowed_command}" == "${commandname}" ]; then
check_deps.sh check_deps.sh
fi fi
done done
local allowed_commands_array=( command_console.sh command_debug.sh command_monitor.sh command_start.sh command_stop.sh ) allowed_commands_array=( CONSOLE DEBUG MONITOR START STOP )
for allowed_command in "${allowed_commands_array[@]}" for allowed_command in "${allowed_commands_array[@]}"
do do
if [ "${allowed_command}" == "${function_selfname}" ]; then if [ "${allowed_command}" == "${commandname}" ]; then
check_config.sh check_config.sh
fi fi
done done
local allowed_commands_array=( command_debug.sh command_details.sh command_postdetails.sh command_monitor.sh command_start.sh command_stop.sh command_dev_query_raw.sh ) allowed_commands_array=( DEBUG DETAILS POST_DETAILS MONITOR START STOP DEV-QUERY-RAW )
for allowed_command in "${allowed_commands_array[@]}" for allowed_command in "${allowed_commands_array[@]}"
do do
if [ "${allowed_command}" == "${function_selfname}" ]; then if [ "${allowed_command}" == "${commandname}" ]; then
if [ -z "${installflag}" ]; then if [ -z "${installflag}" ]; then
check_ip.sh check_ip.sh
fi fi
fi fi
done done
local allowed_commands_array=( update_steamcmd.sh command_debug.sh command_start.sh command_validate.sh ) allowed_commands_array=( DEBUG START VALIDATE )
for allowed_command in "${allowed_commands_array[@]}" for allowed_command in "${allowed_commands_array[@]}"
do do
if [ "${allowed_command}" == "${function_selfname}" ]; then if [ "${allowed_command}" == "${commandname}" ]; then
if [ "${appid}" ]; then if [ "${appid}" ]; then
check_steamcmd.sh check_steamcmd.sh
fi fi
fi fi
done done
local allowed_commands_array=( command_details.sh command_monitor.sh command_start.sh command_stop.sh command_ts3_server_pass.sh command_update.sh command_details.sh command_validate.sh ) allowed_commands_array=( DETAILS MONITOR START STOP CHANGE-PASSWORD UPDATE VALIDATE )
for allowed_command in "${allowed_commands_array[@]}" for allowed_command in "${allowed_commands_array[@]}"
do do
if [ "${allowed_command}" == "${function_selfname}" ]; then if [ "${allowed_command}" == "${commandname}" ]; then
check_status.sh check_status.sh
fi fi
done done
local allowed_commands_array=( command_debug.sh command_start.sh command_install.sh ) allowed_commands_array=( DEBUG START INSTALL )
for allowed_command in "${allowed_commands_array[@]}" for allowed_command in "${allowed_commands_array[@]}"
do do
if [ "${allowed_command}" == "${function_selfname}" ]; then if [ "${allowed_command}" == "${commandname}" ]; then
check_system_requirements.sh check_system_requirements.sh
fi fi
done done

3
lgsm/functions/check_config.sh

@ -4,8 +4,7 @@
# Website: https://linuxgsm.com # Website: https://linuxgsm.com
# Description: Checks if the server config is missing and warns the user if needed. # Description: Checks if the server config is missing and warns the user if needed.
local modulename="CHECK" functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
if [ ! -f "${servercfgfullpath}" ]; then if [ ! -f "${servercfgfullpath}" ]; then
if [ "${shortname}" != "hw" ]&&[ "${shortname}" != "ut3" ]&&[ "${shortname}" != "kf2" ]; then if [ "${shortname}" != "hw" ]&&[ "${shortname}" != "ut3" ]&&[ "${shortname}" != "kf2" ]; then

16
lgsm/functions/check_deps.sh

@ -4,7 +4,7 @@
# Website: https://linuxgsm.com # Website: https://linuxgsm.com
# Description: Checks if required dependencies are installed for LinuxGSM. # Description: Checks if required dependencies are installed for LinuxGSM.
local modulename="CHECK" functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
fn_install_mono_repo(){ fn_install_mono_repo(){
if [ "${monostatus}" != "0" ]; then if [ "${monostatus}" != "0" ]; then
@ -171,14 +171,14 @@ if [ "${javacheck}" == "1" ]; then
if [ "${depstatus}" == "0" ]; then if [ "${depstatus}" == "0" ]; then
# If dependency is found. # If dependency is found.
missingdep=0 missingdep=0
if [ "${function_selfname}" == "command_install.sh" ]; then if [ "${commandname}" == "INSTALL" ]; then
echo -e "${green}${deptocheck}${default}" echo -e "${green}${deptocheck}${default}"
fn_sleep_time fn_sleep_time
fi fi
else else
# If dependency is not found. # If dependency is not found.
missingdep=1 missingdep=1
if [ "${function_selfname}" == "command_install.sh" ]; then if [ "${commandname}" == "INSTALL" ]; then
echo -e "${red}${deptocheck}${default}" echo -e "${red}${deptocheck}${default}"
fn_sleep_time fn_sleep_time
fi fi
@ -272,7 +272,7 @@ fn_found_missing_deps(){
fi fi
if [ "${steamcmdfail}" ]; then if [ "${steamcmdfail}" ]; then
echo -e "" echo -e ""
if [ "${function_selfname}" == "command_install.sh" ]; 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_fatal "Missing dependencies required to run SteamCMD."
core_exit.sh core_exit.sh
@ -298,7 +298,7 @@ fn_found_missing_deps(){
fi fi
if [ "${steamcmdfail}" ]; then if [ "${steamcmdfail}" ]; then
echo -e "" echo -e ""
if [ "${function_selfname}" == "command_install.sh" ]; 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_fatal "Missing dependencies required to run SteamCMD."
core_exit.sh core_exit.sh
@ -309,11 +309,11 @@ fn_found_missing_deps(){
fi fi
echo -e "" echo -e ""
fi fi
if [ "${function_selfname}" == "command_install.sh" ]; then if [ "${commandname}" == "INSTALL" ]; then
sleep 5 sleep 5
fi fi
else else
if [ "${function_selfname}" == "command_install.sh" ]; then if [ "${commandname}" == "INSTALL" ]; then
fn_print_information_nl "Required dependencies already installed." fn_print_information_nl "Required dependencies already installed."
fn_script_log_info "Required dependencies already installed." fn_script_log_info "Required dependencies already installed."
fi fi
@ -550,7 +550,7 @@ fn_deps_build_redhat(){
fn_check_loop fn_check_loop
} }
if [ "${function_selfname}" == "command_install.sh" ]; 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 "${lightyellow}Checking Dependencies as root${default}"

3
lgsm/functions/check_executable.sh

@ -4,8 +4,7 @@
# Website: https://linuxgsm.com # Website: https://linuxgsm.com
# Description: Checks if server executable exists. # Description: Checks if server executable exists.
local modulename="CHECK" functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
# Check if executable exists # Check if executable exists
if [ ! -f "${executabledir}/${execname}" ]; then if [ ! -f "${executabledir}/${execname}" ]; then

2
lgsm/functions/check_glibc.sh

@ -4,7 +4,7 @@
# Website: https://linuxgsm.com # Website: https://linuxgsm.com
# Description: Checks if the server has the correct Glibc version. # Description: Checks if the server has the correct Glibc version.
local modulename="CHECK" functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
info_distro.sh info_distro.sh

14
lgsm/functions/check_ip.sh

@ -5,7 +5,7 @@
# Description: Automatically identifies the server interface IP. # Description: Automatically identifies the server interface IP.
# If multiple interfaces are detected the user will need to manually set using ip="0.0.0.0". # If multiple interfaces are detected the user will need to manually set using ip="0.0.0.0".
local modulename="CHECK" functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
if [ "${travistest}" != "1" ]; then if [ "${travistest}" != "1" ]; then
if [ ! -f "/bin/ip" ]; then if [ ! -f "/bin/ip" ]; then
@ -23,10 +23,10 @@ if [ "${travistest}" != "1" ]; then
fn_print_dots "Check IP" fn_print_dots "Check IP"
# Multiple interfaces. # Multiple interfaces.
if [ "${getipwc}" -ge "2" ]; then if [ "${getipwc}" -ge "2" ]; then
if [ "${function_selfname}" == "command_details.sh" ]; then if [ "${commandname}" == "details" ]; then
fn_print_warn "Check IP: Multiple IP addresses found." fn_print_warn "Check IP: Multiple IP addresses found."
else else
fn_print_fail "Check IP: Multiple IP addresses found." fn_print_fail "Check IP: Multiple IP addresses found."
fi fi
echo -en "\n" echo -en "\n"
# IP is set within game config. # IP is set within game config.
@ -55,7 +55,7 @@ if [ "${travistest}" != "1" ]; then
echo -en "https://linuxgsm.com/network-interfaces\n" echo -en "https://linuxgsm.com/network-interfaces\n"
echo -en "" echo -en ""
# Do not exit for details and postdetails commands. # Do not exit for details and postdetails commands.
if [ "${function_selfname}" != "command_details.sh" ]||[ "${function_selfname}" != "command_postdetails.sh" ]; then if [ "${commandname}" != "DETAILS" ]||[ "${commandname}" != "POST-DETAILS" ]; then
fn_script_log_fatal "https://linuxgsm.com/network-interfaces\n" fn_script_log_fatal "https://linuxgsm.com/network-interfaces\n"
core_exit.sh core_exit.sh
else else
@ -76,8 +76,8 @@ if [ "${travistest}" != "1" ]; then
fn_script_log_fatal "IP address not set in game config." fn_script_log_fatal "IP address not set in game config."
fn_script_log_fatal "Specify the IP you want to bind within: ${servercfgfullpath}." fn_script_log_fatal "Specify the IP you want to bind within: ${servercfgfullpath}."
fn_script_log_fatal "https://linuxgsm.com/network-interfaces\n" fn_script_log_fatal "https://linuxgsm.com/network-interfaces\n"
if [ "${function_selfname}" != "command_details.sh" ]; then if [ "${commandname}" != "DETAILS" ]; then
core_exit.sh core_exit.sh
fi fi
else else
fn_print_info_nl "Check IP: ${getip}" fn_print_info_nl "Check IP: ${getip}"

2
lgsm/functions/check_last_update.sh

@ -5,6 +5,8 @@
# Description: Checks lock file to see when last update happened. # Description: Checks lock file to see when last update happened.
# Will reboot server if instance not rebooted since update. # Will reboot server if instance not rebooted since update.
functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
if [ -f "${lockdir}/${selfname}-laststart.lock" ]; then if [ -f "${lockdir}/${selfname}-laststart.lock" ]; then
laststart=$(cat "${lockdir}/${selfname}-laststart.lock") laststart=$(cat "${lockdir}/${selfname}-laststart.lock")
fi fi

3
lgsm/functions/check_logs.sh

@ -4,8 +4,7 @@
# Website: https://linuxgsm.com # Website: https://linuxgsm.com
# Description: Checks if log files exist. # Description: Checks if log files exist.
local modulename="CHECK" functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
fn_check_logs(){ fn_check_logs(){
fn_print_dots "Checking for log files" fn_print_dots "Checking for log files"

4
lgsm/functions/check_permissions.sh

@ -5,7 +5,7 @@
# Website: https://linuxgsm.com # Website: https://linuxgsm.com
# Description: Checks ownership & permissions of scripts, files and directories. # Description: Checks ownership & permissions of scripts, files and directories.
local modulename="CHECK" functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
fn_check_ownership(){ fn_check_ownership(){
if [ -f "${rootdir}/${selfname}" ]; then if [ -f "${rootdir}/${selfname}" ]; then
@ -229,7 +229,7 @@ fn_sys_perm_error_process(){
if [ "$(whoami)" != "root" ]; then if [ "$(whoami)" != "root" ]; then
fn_check_ownership fn_check_ownership
fn_check_permissions fn_check_permissions
if [ "${function_selfname}" == "command_start.sh" ]; then if [ "${commandname}" == "START" ]; then
fn_sys_perm_error_process fn_sys_perm_error_process
fi fi
fi fi

5
lgsm/functions/check_root.sh

@ -4,11 +4,10 @@
# Website: https://linuxgsm.com # Website: https://linuxgsm.com
# Description: Checks if the user tried to run the script as root. # Description: Checks if the user tried to run the script as root.
local modulename="CHECK" functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
if [ "$(whoami)" = "root" ]; then if [ "$(whoami)" = "root" ]; then
if [ "${function_selfname}" != "command_install.sh" ]; 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_fatal "${selfname} attempted to run as root."

3
lgsm/functions/check_status.sh

@ -5,7 +5,6 @@
# Website: https://linuxgsm.com # Website: https://linuxgsm.com
# Description: Checks the process status of the server. Either online or offline. # Description: Checks the process status of the server. Either online or offline.
local modulename="CHECK" functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
status=$(tmux list-sessions -F "#{session_name}" 2>/dev/null | grep -Ecx "^${selfname}") status=$(tmux list-sessions -F "#{session_name}" 2>/dev/null | grep -Ecx "^${selfname}")

10
lgsm/functions/check_steamcmd.sh

@ -4,7 +4,7 @@
# Website: https://linuxgsm.com # Website: https://linuxgsm.com
# Description: Checks if SteamCMD is installed correctly. # Description: Checks if SteamCMD is installed correctly.
local modulename="CHECK" functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
fn_install_steamcmd(){ fn_install_steamcmd(){
if [ ${shortname} == "ark" ]&&[ "${installsteamcmd}" == "1" ]; then if [ ${shortname} == "ark" ]&&[ "${installsteamcmd}" == "1" ]; then
@ -50,14 +50,14 @@ fn_check_steamcmd(){
# Checks if SteamCMD exists when starting or updating a server. # Checks if SteamCMD exists when starting or updating a server.
# Only install if steamcmd package is missing or steamcmd dir is missing. # Only install if steamcmd package is missing or steamcmd dir is missing.
if [ ! -f "${steamcmddir}/steamcmd.sh" ]&&[ -z "$(command -v steamcmd 2>/dev/null)" ]; then if [ ! -f "${steamcmddir}/steamcmd.sh" ]&&[ -z "$(command -v steamcmd 2>/dev/null)" ]; then
if [ "${function_selfname}" == "command_install.sh" ]; then if [ "${commandname}" == "INSTALL" ]; then
fn_install_steamcmd fn_install_steamcmd
else else
fn_print_warn_nl "SteamCMD is missing" fn_print_warn_nl "SteamCMD is missing"
fn_script_log_warn "SteamCMD is missing" fn_script_log_warn "SteamCMD is missing"
fn_install_steamcmd fn_install_steamcmd
fi fi
elif [ "${function_selfname}" == "command_install.sh" ]; then elif [ "${commandname}" == "INSTALL" ]; then
fn_print_information "SteamCMD is already installed..." fn_print_information "SteamCMD is already installed..."
fn_print_ok_eol_nl fn_print_ok_eol_nl
fi fi
@ -110,14 +110,14 @@ fn_check_steamcmd_ark(){
# to allow ark mods to work # to allow ark mods to work
if [ ! -f "${serverfiles}/Engine/Binaries/ThirdParty/SteamCMD/Linux/steamcmd.sh" ]; then if [ ! -f "${serverfiles}/Engine/Binaries/ThirdParty/SteamCMD/Linux/steamcmd.sh" ]; then
installsteamcmd=1 installsteamcmd=1
if [ "${function_selfname}" == "command_install.sh" ]; then if [ "${commandname}" == "INSTALL" ]; then
fn_install_steamcmd fn_install_steamcmd
else else
fn_print_warn_nl "ARK mods SteamCMD is missing" fn_print_warn_nl "ARK mods SteamCMD is missing"
fn_script_log_warn "ARK mods SteamCMD is missing" fn_script_log_warn "ARK mods SteamCMD is missing"
fn_install_steamcmd fn_install_steamcmd
fi fi
elif [ "${function_selfname}" == "command_install.sh" ]; then elif [ "${commandname}" == "INSTALL" ]; then
fn_print_information "ARK mods SteamCMD is already installed..." fn_print_information "ARK mods SteamCMD is already installed..."
fn_print_ok_eol_nl fn_print_ok_eol_nl
fi fi

5
lgsm/functions/check_system_dir.sh

@ -4,10 +4,9 @@
# Website: https://linuxgsm.com # Website: https://linuxgsm.com
# Description: Checks if systemdir/serverfiles is accessible. # Description: Checks if systemdir/serverfiles is accessible.
local modulename="CHECK" functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
if [ "${function_selfname}" != "command_validate.sh" ]; then if [ "${commandname}" != "VALIDATE" ]; then
checkdir="${serverfiles}" checkdir="${serverfiles}"
else else
checkdir="${systemdir}" checkdir="${systemdir}"

3
lgsm/functions/check_system_requirements.sh

@ -5,8 +5,7 @@
# Website: https://linuxgsm.com # Website: https://linuxgsm.com
# Description: Checks RAM requirements # Description: Checks RAM requirements
local modulename="CHECK" functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
info_distro.sh info_distro.sh

2
lgsm/functions/check_tmuxception.sh

@ -5,7 +5,7 @@
# Website: https://linuxgsm.com # Website: https://linuxgsm.com
# Description: Checks if run from tmux or screen # Description: Checks if run from tmux or screen
local modulename="CHECK" functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
fn_check_is_in_tmux(){ fn_check_is_in_tmux(){
if [ "${TMUX}" ]; then if [ "${TMUX}" ]; then

6
lgsm/functions/command_backup.sh

@ -5,9 +5,9 @@
# Website: https://linuxgsm.com # Website: https://linuxgsm.com
# Description: Creates a .tar.gz file in the backup directory. # Description: Creates a .tar.gz file in the backup directory.
local modulename="BACKUP" commandname="BACKUP"
local commandaction="Backup" commandaction="Backing up"
local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
check.sh check.sh

6
lgsm/functions/command_console.sh

@ -4,9 +4,9 @@
# Website: https://linuxgsm.com # Website: https://linuxgsm.com
# Description: Gives access to the server tmux console. # Description: Gives access to the server tmux console.
local modulename="CONSOLE" commandname="CONSOLE"
local commandaction="Console" commandaction="Access console"
local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
check.sh check.sh
fn_print_header fn_print_header

6
lgsm/functions/command_debug.sh

@ -4,9 +4,9 @@
# Website: https://linuxgsm.com # Website: https://linuxgsm.com
# Description: Runs the server without tmux and directly from the terminal. # Description: Runs the server without tmux and directly from the terminal.
local modulename="DEBUG" commandname="DEBUG"
local commandaction="Debug" commandaction="Debuging"
local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
# Trap to remove lockfile on quit. # Trap to remove lockfile on quit.
fn_lockfile_trap(){ fn_lockfile_trap(){

6
lgsm/functions/command_details.sh

@ -5,9 +5,9 @@
# Website: https://linuxgsm.com # Website: https://linuxgsm.com
# Description: Displays server information. # Description: Displays server information.
local modulename="DETAILS" commandname="DETAILS"
local commandaction="Details" commandaction="Viewing details"
local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
# Run checks and gathers details to display. # Run checks and gathers details to display.
check.sh check.sh

6
lgsm/functions/command_dev_clear_functions.sh

@ -4,6 +4,10 @@
# Website: https://linuxgsm.com # Website: https://linuxgsm.com
# Description: Deletes the contents of the functions dir. # Description: Deletes the contents of the functions dir.
commandname="DEV-CLEAR-MODULES"
commandaction="Clearing modules"
functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
echo -e "=================================" echo -e "================================="
echo -e "Clear Functions" echo -e "Clear Functions"
echo -e "=================================" echo -e "================================="
@ -11,6 +15,8 @@ echo -e ""
if fn_prompt_yn "Do you want to delete all functions?" Y; then if fn_prompt_yn "Do you want to delete all functions?" Y; then
rm -rfv "${functionsdir:?}/"* rm -rfv "${functionsdir:?}/"*
rm -rfv "${configdirdefault:?}/"* rm -rfv "${configdirdefault:?}/"*
fn_script_log_info "Cleared modules directory"
fn_script_log_info "Cleared default config directory"
fi fi
core_exit.sh core_exit.sh

6
lgsm/functions/command_dev_debug.sh

@ -4,9 +4,9 @@
# Website: https://linuxgsm.com # Website: https://linuxgsm.com
# Description: Dev only: Enables debugging log to be saved to dev-debug.log. # Description: Dev only: Enables debugging log to be saved to dev-debug.log.
local modulename="DEV-DEBUG" commandname="DEV-DEBUG"
local commandaction="Dev Debug" commandaction="Developer debug"
local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
if [ -f "${rootdir}/.dev-debug" ]; then if [ -f "${rootdir}/.dev-debug" ]; then
rm "${rootdir:?}/.dev-debug" rm "${rootdir:?}/.dev-debug"

12
lgsm/functions/command_dev_detect_deps.sh

@ -4,9 +4,9 @@
# Website: https://linuxgsm.com # Website: https://linuxgsm.com
# Description: Detects dependencies the server binary requires. # Description: Detects dependencies the server binary requires.
local modulename="DETECT-DEPS" commandname="DEV-DETECT-DEPS"
local commandaction="Detect Deps" commandaction="Developer detect deps"
local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
echo -e "=================================" echo -e "================================="
echo -e "Dependencies Checker" echo -e "Dependencies Checker"
@ -40,7 +40,7 @@ touch "${tmpdir}/.depdetect_debian_list"
while read -r lib; do while read -r lib; do
echo -e "${lib}" echo -e "${lib}"
local libs_array=( libm.so.6 libc.so.6 libtcmalloc_minimal.so.4 libpthread.so.0 libdl.so.2 libnsl.so.1 libgcc_s.so.1 librt.so.1 ld-linux.so.2 libdbus-glib-1.so.2 libgio-2.0.so.0 libglib-2.0.so.0 libGL.so.1 libgobject-2.0.so.0 libnm-glib.so.4 libnm-util.so.2 ) libs_array=( libm.so.6 libc.so.6 libtcmalloc_minimal.so.4 libpthread.so.0 libdl.so.2 libnsl.so.1 libgcc_s.so.1 librt.so.1 ld-linux.so.2 libdbus-glib-1.so.2 libgio-2.0.so.0 libglib-2.0.so.0 libGL.so.1 libgobject-2.0.so.0 libnm-glib.so.4 libnm-util.so.2 )
for lib_file in "${libs_array[@]}" for lib_file in "${libs_array[@]}"
do do
if [ "${lib}" == "${lib_file}" ]; then if [ "${lib}" == "${lib_file}" ]; then
@ -51,7 +51,7 @@ while read -r lib; do
fi fi
done done
local libs_array=( libawt.so libjava.so libjli.so libjvm.so libnet.so libnio.so libverify.so ) libs_array=( libawt.so libjava.so libjli.so libjvm.so libnet.so libnio.so libverify.so )
for lib_file in "${libs_array[@]}" for lib_file in "${libs_array[@]}"
do do
if [ "${lib}" == "${lib_file}" ]; then if [ "${lib}" == "${lib_file}" ]; then
@ -62,7 +62,7 @@ while read -r lib; do
fi fi
done done
local libs_array=( libtier0.so libtier0_srv.so libvstdlib_srv.so Core.so libvstdlib.so libtier0_s.so Editor.so Engine.so liblua.so libsteam_api.so ld-linux-x86-64.so.2 libPhysX3_x86.so libPhysX3Common_x86.so libPhysX3Cooking_x86.so) libs_array=( libtier0.so libtier0_srv.so libvstdlib_srv.so Core.so libvstdlib.so libtier0_s.so Editor.so Engine.so liblua.so libsteam_api.so ld-linux-x86-64.so.2 libPhysX3_x86.so libPhysX3Common_x86.so libPhysX3Cooking_x86.so)
for lib_file in "${libs_array[@]}" for lib_file in "${libs_array[@]}"
do do
# Known shared libs what dont requires dependencies. # Known shared libs what dont requires dependencies.

8
lgsm/functions/command_dev_detect_glibc.sh

@ -5,9 +5,9 @@
# Description: Automatically detects the version of GLIBC that is required. # Description: Automatically detects the version of GLIBC that is required.
# Can check a file or directory recursively. # Can check a file or directory recursively.
local modulename="DETECT-GLIBC" commandname="DEV-DETECT-GLIBC"
local commandaction="Detect Glibc" commandaction="Developer detect glibc"
local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
echo -e "=================================" echo -e "================================="
echo -e "glibc Requirements Checker" echo -e "glibc Requirements Checker"
@ -33,7 +33,7 @@ fi
echo -e "" echo -e ""
local glibc_check_dir_array=( steamcmddir serverfiles ) glibc_check_dir_array=( steamcmddir serverfiles )
for glibc_check_var in "${glibc_check_dir_array[@]}" for glibc_check_var in "${glibc_check_dir_array[@]}"
do do
if [ "${glibc_check_var}" == "serverfiles" ]; then if [ "${glibc_check_var}" == "serverfiles" ]; then

6
lgsm/functions/command_dev_detect_ldd.sh

@ -5,9 +5,9 @@
# Description: Automatically detects required deps using ldd. # Description: Automatically detects required deps using ldd.
# Can check a file or directory recursively. # Can check a file or directory recursively.
local modulename="DETECT-LDD" commandname="DEV-DETECT-LDD"
local commandaction="Detect LDD" commandaction="Developer detect ldd"
local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
echo -e "=================================" echo -e "================================="
echo -e "Shared Object dependencies Checker" echo -e "Shared Object dependencies Checker"

6
lgsm/functions/command_dev_query_raw.sh

@ -4,9 +4,9 @@
# Website: https://linuxgsm.com # Website: https://linuxgsm.com
# Description: Raw gamedig output of the server. # Description: Raw gamedig output of the server.
local modulename="QUERY-RAW" commandname="DEV-QUERY-RAW"
local commandaction="Query Raw" commandaction="Developer query raw"
local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
check.sh check.sh
info_config.sh info_config.sh

6
lgsm/functions/command_donate.sh

@ -4,9 +4,9 @@
# Website: https://linuxgsm.com # Website: https://linuxgsm.com
# Description: Shows ways to donate. # Description: Shows ways to donate.
local modulename="CONSOLE" commandname="DONATE"
local commandaction="Console" commandaction="Donate"
local function_selfname=$(basename "$(readlink -f "${BASH_SOURCE[0]}")") functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
fn_print_ascii_logo fn_print_ascii_logo
echo -e "${lightyellow}Support LinuxGSM${default}" echo -e "${lightyellow}Support LinuxGSM${default}"

8
lgsm/functions/command_fastdl.sh

@ -5,9 +5,9 @@
# Website: https://linuxgsm.com # Website: https://linuxgsm.com
# Description: Creates a FastDL directory. # Description: Creates a FastDL directory.
local modulename="FASTDL" commandname="FASTDL"
local commandaction="FastDL" commandaction="Fastdl"
local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
check.sh check.sh
@ -135,7 +135,7 @@ fn_human_readable_file_size(){
local factor="${item%:*}" local factor="${item%:*}"
local abbrev="${item#*:}" local abbrev="${item#*:}"
if [[ "${bytes}" -ge "${factor}" ]]; then if [[ "${bytes}" -ge "${factor}" ]]; then
local size=$(bc -l <<< "${bytes} / ${factor}") size=$(bc -l <<< "${bytes} / ${factor}")
printf "%.*f %s\n" "${precision}" "${size}" "${abbrev}" printf "%.*f %s\n" "${precision}" "${size}" "${abbrev}"
break break
fi fi

6
lgsm/functions/command_install.sh

@ -5,9 +5,9 @@
# Website: https://linuxgsm.com # Website: https://linuxgsm.com
# Description: Overall function for the installer. # Description: Overall function for the installer.
local modulename="INSTALL" commandname="INSTALL"
local commandaction="Install" commandaction="Installing"
local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
check.sh check.sh
if [ "$(whoami)" = "root" ]; then if [ "$(whoami)" = "root" ]; then

6
lgsm/functions/command_install_resources_mta.sh

@ -4,9 +4,9 @@
# Website: https://linuxgsm.com # Website: https://linuxgsm.com
# Description: Installs the default resources for Multi Theft Auto. # Description: Installs the default resources for Multi Theft Auto.
local modulename="DEFAULT_RESOURCES" commandname="DEFAULT-RESOURCES"
local commandaction="Default Resources" commandaction="Default Resources"
local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
fn_install_resources(){ fn_install_resources(){
echo -e "" echo -e ""

6
lgsm/functions/command_mods_install.sh

@ -5,9 +5,9 @@
# Website: https://linuxgsm.com # Website: https://linuxgsm.com
# Description: List and installs available mods along with mods_list.sh and mods_core.sh. # Description: List and installs available mods along with mods_list.sh and mods_core.sh.
local modulename="MODS" commandname="MODS-INSTALL"
local commandaction="addons/mods" commandaction="Installing mods"
local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
check.sh check.sh
mods_core.sh mods_core.sh

6
lgsm/functions/command_mods_remove.sh

@ -5,9 +5,9 @@
# Website: https://linuxgsm.com # Website: https://linuxgsm.com
# Description: Uninstall mods along with mods_list.sh and mods_core.sh. # Description: Uninstall mods along with mods_list.sh and mods_core.sh.
local modulename="MODS" commandname="MODS-REMOVE"
local commandaction="Mods Remove" commandaction="Removing mods"
local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
check.sh check.sh
mods_core.sh mods_core.sh

6
lgsm/functions/command_mods_update.sh

@ -5,9 +5,9 @@
# Website: https://linuxgsm.com # Website: https://linuxgsm.com
# Description: Updates installed mods along with mods_list.sh and mods_core.sh. # Description: Updates installed mods along with mods_list.sh and mods_core.sh.
local modulename="MODS" commandname="MODS-UPDATE"
local commandaction="Mods Update" commandaction="Updating mods"
local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
check.sh check.sh
mods_core.sh mods_core.sh

23
lgsm/functions/command_monitor.sh

@ -6,9 +6,9 @@
# Description: Monitors server by checking for running processes # Description: Monitors server by checking for running processes
# then passes to gamedig and gsquery. # then passes to gamedig and gsquery.
local modulename="MONITOR" commandname="MONITOR"
local commandaction="Monitor" commandaction="Monitoring"
local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
fn_monitor_check_lockfile(){ fn_monitor_check_lockfile(){
# Monitor does not run it lockfile is not found. # Monitor does not run it lockfile is not found.
@ -141,11 +141,7 @@ for queryattempt in {1..5}; do
fn_script_log_pass "Querying port: ${querymethod}: ${ip}:${queryport} : ${queryattempt}: OK" fn_script_log_pass "Querying port: ${querymethod}: ${ip}:${queryport} : ${queryattempt}: OK"
fn_sleep_time fn_sleep_time
monitorpass=1 monitorpass=1
# send LinuxGSM stats if monitor is OK. if [ "${querystatus}" == "0" ]; then
if [ "${stats}" == "on" ]||[ "${stats}" == "y" ]; then
info_stats.sh
fi
if [ "${querystatus}" == "0" ]; then
# Add query data to log. # Add query data to log.
if [ "${gdname}" ]; then if [ "${gdname}" ]; then
fn_script_log_info "Server name: ${gdname}" fn_script_log_info "Server name: ${gdname}"
@ -154,14 +150,19 @@ for queryattempt in {1..5}; do
fn_script_log_info "Players: ${gdplayers}/${gdmaxplayers}" fn_script_log_info "Players: ${gdplayers}/${gdmaxplayers}"
fi fi
if [ "${gdbots}" ]; then if [ "${gdbots}" ]; then
fn_script_log_info "Bots: ${gdbots}" fn_script_log_info "Bots: ${gdbots}"
fi fi
if [ "${gdmap}" ]; then if [ "${gdmap}" ]; then
fn_script_log_info "Map: ${gdmap}" fn_script_log_info "Map: ${gdmap}"
fi fi
if [ "${gdgamemode}" ]; then if [ "${gdgamemode}" ]; then
fn_script_log_info "Game Mode: ${gdgamemode}" fn_script_log_info "Game Mode: ${gdgamemode}"
fi fi
# send LinuxGSM stats if monitor is OK.
if [ "${stats}" == "on" ]||[ "${stats}" == "y" ]; then
info_stats.sh
fi
fi fi
core_exit.sh core_exit.sh
else else
@ -239,7 +240,7 @@ fn_monitor_loop(){
monitorflag=1 monitorflag=1
check.sh check.sh
logs.sh core_logs.sh
info_config.sh info_config.sh
info_parms.sh info_parms.sh

34
lgsm/functions/command_postdetails.sh

@ -5,9 +5,9 @@
# Website: https://linuxgsm.com # Website: https://linuxgsm.com
# Description: Strips sensitive information out of Details output # Description: Strips sensitive information out of Details output
local modulename="POSTDETAILS" commandname="POST-DETAILS"
local commandaction="Postdetails" commandaction="Posting details"
local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
# Set posttarget to the appropriately-defined post destination. # Set posttarget to the appropriately-defined post destination.
@ -74,14 +74,13 @@ else
fn_info_message_ports fn_info_message_ports
fn_info_message_select_engine fn_info_message_select_engine
fn_info_message_statusbottom fn_info_message_statusbottom
} | sed -r "s/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]//g"| tee -a "${postdetailslog}" > /dev/null 2>&1 } | sed -r "s/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]//g" | tee -a "${postdetailslog}" > /dev/null 2>&1
fi fi
# Pastebin
if [ "${posttarget}" == "http://pastebin.com" ] ; then if [ "${posttarget}" == "http://pastebin.com" ] ; then
fn_print_dots "pastbin.com for ${postexpire}" fn_print_dots "pastbin.com for ${postexpire}"
# grab the return from 'value' from an initial visit to pastebin. # grab the return from 'value' from an initial visit to pastebin.
csrftoken=$(curl -s "${posttarget}" | csrftoken=$(curl -s "${posttarget}" | sed -n 's/^.*input type="hidden" name="csrf_token_post" value="\(.*\)".*$/\1/p')
sed -n 's/^.*input type="hidden" name="csrf_token_post" value="\(.*\)".*$/\1/p')
# #
# Use the csrftoken to then post the content. # Use the csrftoken to then post the content.
# #
@ -94,9 +93,9 @@ if [ "${posttarget}" == "http://pastebin.com" ] ; then
# Output the resulting link. # Output the resulting link.
fn_print_ok_nl "pastbin.com for ${postexpire}" fn_print_ok_nl "pastbin.com for ${postexpire}"
fn_script_log_pass "pastbin.com for ${postexpire}"
pdurl="${posttarget}${link}" pdurl="${posttarget}${link}"
echo -e "" # Hastebin
echo -e " Please share the following url for support: ${pdurl}"
elif [ "${posttarget}" == "https://hastebin.com" ] ; then elif [ "${posttarget}" == "https://hastebin.com" ] ; then
fn_print_dots "hastebin.com" fn_print_dots "hastebin.com"
# hastebin is a bit simpler. If successful, the returned result # hastebin is a bit simpler. If successful, the returned result
@ -104,21 +103,20 @@ elif [ "${posttarget}" == "https://hastebin.com" ] ; then
# we need in "key". TODO - error handling. -CedarLUG # we need in "key". TODO - error handling. -CedarLUG
link=$(curl -H "HTTP_X_REQUESTED_WITH:XMLHttpRequest" -s -d "$(<${postdetailslog})" "${posttarget}/documents" | cut -d\" -f4) link=$(curl -H "HTTP_X_REQUESTED_WITH:XMLHttpRequest" -s -d "$(<${postdetailslog})" "${posttarget}/documents" | cut -d\" -f4)
fn_print_ok_nl "hastebin.com for ${postexpire}" fn_print_ok_nl "hastebin.com for ${postexpire}"
fn_script_log_pass "hastebin.com for ${postexpire}"
pdurl="${posttarget}/${link}" pdurl="${posttarget}/${link}"
echo -e "" # Termbin
echo -e "Please share the following url for support: ${pdurl}"
elif [ "${posttarget}" == "https://termbin.com" ] ; then elif [ "${posttarget}" == "https://termbin.com" ] ; then
fn_print_dots "termbin.com" fn_print_dots "termbin.com"
link=$(cat "${postdetailslog}" | nc termbin.com 9999 | tr -d '\n\0') link=$(cat "${postdetailslog}" | nc termbin.com 9999 | tr -d '\n\0')
fn_print_ok_nl "termbin.com" fn_print_ok_nl "termbin.com for 30D"
fn_script_log_pass "termbin.com for 30D"
pdurl="${link}" pdurl="${link}"
echo -e ""
echo -e "Please share the following url for support: "
echo -e "${pdurl}"
else
fn_print_warn_nl "Review output in: ${postdetailslog}"
core_exit.sh
fi fi
echo -e ""
echo -e "Please share the following url for support: "
echo -e "${pdurl}"
fn_script_log_info "${pdurl}"
if [ -z "${exitbypass}" ]; then if [ -z "${exitbypass}" ]; then
core_exit.sh core_exit.sh

6
lgsm/functions/command_restart.sh

@ -4,9 +4,9 @@
# Website: https://linuxgsm.com # Website: https://linuxgsm.com
# Description: Restarts the server. # Description: Restarts the server.
local modulename="RESTART" commandname="MODS-INSTALL"
local commandaction="Restarting" commandaction="Restarting"
local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
info_config.sh info_config.sh
exitbypass=1 exitbypass=1

8
lgsm/functions/command_start.sh

@ -5,9 +5,9 @@
# Website: https://linuxgsm.com # Website: https://linuxgsm.com
# Description: Starts the server. # Description: Starts the server.
local modulename="START" commandname="START"
local commandaction="Starting" commandaction="Starting"
local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
fn_start_teamspeak3(){ fn_start_teamspeak3(){
if [ ! -f "${servercfgfullpath}" ]; then if [ ! -f "${servercfgfullpath}" ]; then
@ -183,7 +183,7 @@ if [ -z "${fixbypass}" ]; then
fix.sh fix.sh
fi fi
info_config.sh info_config.sh
logs.sh core_logs.sh
# Will check for updates is updateonstart is yes. # Will check for updates is updateonstart is yes.
if [ "${updateonstart}" == "yes" ]||[ "${updateonstart}" == "1" ]||[ "${updateonstart}" == "on" ]; then if [ "${updateonstart}" == "yes" ]||[ "${updateonstart}" == "1" ]||[ "${updateonstart}" == "on" ]; then

6
lgsm/functions/command_stop.sh

@ -5,9 +5,9 @@
# Website: https://linuxgsm.com # Website: https://linuxgsm.com
# Description: Stops the server. # Description: Stops the server.
local modulename="STOP" commandname="STOP"
local commandaction="Stopping" commandaction="Stopping"
local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
# Attempts graceful shutdown by sending 'CTRL+c'. # Attempts graceful shutdown by sending 'CTRL+c'.
fn_stop_graceful_ctrlc(){ fn_stop_graceful_ctrlc(){

6
lgsm/functions/command_test_alert.sh

@ -4,9 +4,9 @@
# Website: https://linuxgsm.com # Website: https://linuxgsm.com
# Description: Sends a test alert. # Description: Sends a test alert.
local modulename="ALERT" commandname="TEST-ALERT"
local commandaction="Alert" commandaction="Sending Alert"
local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
fn_print_dots "${servername}" fn_print_dots "${servername}"
check.sh check.sh

6
lgsm/functions/command_ts3_server_pass.sh

@ -5,9 +5,9 @@
# Website: https://linuxgsm.com # Website: https://linuxgsm.com
# Description: Changes TS3 serveradmin password. # Description: Changes TS3 serveradmin password.
local modulename="PASSWORD-CHANGE" commandname="CHANGE-PASSWORD"
local commandaction="Password Change" commandaction="Changing password"
local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
fn_serveradmin_password_prompt(){ fn_serveradmin_password_prompt(){
fn_print_header fn_print_header

8
lgsm/functions/command_update.sh

@ -4,13 +4,13 @@
# Website: https://linuxgsm.com # Website: https://linuxgsm.com
# Description: Handles updating of servers. # Description: Handles updating of servers.
local modulename="UPDATE" commandname="UPDATE"
local commandaction="Update" commandaction="Updating"
local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
fn_print_dots "" fn_print_dots ""
check.sh check.sh
logs.sh core_logs.sh
check_last_update.sh check_last_update.sh
if [ "${shortname}" == "ts3" ]; then if [ "${shortname}" == "ts3" ]; then

13
lgsm/functions/command_update_functions.sh

@ -1,13 +0,0 @@
#!/bin/bash
# LinuxGSM command_update_functions.sh function
# Author: Daniel Gibbs
# Website: https://linuxgsm.com
# Description: Deletes the functions dir to allow re-downloading of functions from GitHub.
# Legacy Command
command_update_linuxgsm.sh(){
functionfile="${FUNCNAME[0]}"
fn_fetch_function
}
command_update_linuxgsm.sh

6
lgsm/functions/command_update_linuxgsm.sh

@ -4,9 +4,9 @@
# Website: https://linuxgsm.com # Website: https://linuxgsm.com
# Description: Deletes the functions dir to allow re-downloading of functions from GitHub. # Description: Deletes the functions dir to allow re-downloading of functions from GitHub.
local modulename="UPDATE LINUXGSM" commandname="UPDATE-LGSM"
local commandaction="Update LinuxGSM" commandaction="Updating LinuxGSM"
local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
fn_print_dots "Updating LinuxGSM" fn_print_dots "Updating LinuxGSM"
check.sh check.sh

6
lgsm/functions/command_validate.sh

@ -4,9 +4,9 @@
# Website: https://linuxgsm.com # Website: https://linuxgsm.com
# Description: Runs a server validation. # Description: Runs a server validation.
local modulename="VALIDATE" commandname="VALIDATE"
local commandaction="Validate" commandaction="Validating"
local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
fn_validate(){ fn_validate(){
fn_script_log_warn "Validating server: SteamCMD: Validate might overwrite some customised files" fn_script_log_warn "Validating server: SteamCMD: Validate might overwrite some customised files"

6
lgsm/functions/command_wipe.sh

@ -5,9 +5,9 @@
# Website: https://linuxgsm.com # Website: https://linuxgsm.com
# Description: Wipes server data, useful after updates for some games like Rust # Description: Wipes server data, useful after updates for some games like Rust
local modulename="WIPE" commandname="WIPE"
local commandaction="Wipe" commandaction="Wiping"
local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
check.sh check.sh
fn_print_header fn_print_header

5
lgsm/functions/compress_unreal2_maps.sh

@ -4,8 +4,9 @@
# Website: https://linuxgsm.com # Website: https://linuxgsm.com
# Description: Compresses unreal maps. # Description: Compresses unreal maps.
local commandaction="Unreal Map Compressor" commandname="MAP-COMPRESSOR"
local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" commandaction="Compressing maps"
functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
check.sh check.sh
fn_print_header fn_print_header

5
lgsm/functions/compress_ut99_maps.sh

@ -4,8 +4,9 @@
# Website: https://linuxgsm.com # Website: https://linuxgsm.com
# Description: Compresses unreal maps. # Description: Compresses unreal maps.
local commandaction="Unreal Map Compressor" commandname="MAP-COMPRESSOR"
local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" commandaction="Compressing maps"
functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
check.sh check.sh
fn_print_header fn_print_header

6
lgsm/functions/core_dl.sh

@ -17,9 +17,7 @@
# 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_fetch_file "http://example.com/file.tar.bz2" "/some/dir" "file.tar.bz2" "chmodx" "run" "forcedl" "10cd7353aa9d758a075c600a6dd193fd" # fn_fetch_file "http://example.com/file.tar.bz2" "/some/dir" "file.tar.bz2" "chmodx" "run" "forcedl" "10cd7353aa9d758a075c600a6dd193fd"
local modulename="DOWNLOAD" functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
local commandaction="Download"
local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
# Emptys contents of the LinuxGSM tmpdir. # Emptys contents of the LinuxGSM tmpdir.
fn_clear_tmp(){ fn_clear_tmp(){
@ -42,7 +40,7 @@ fn_dl_md5(){
if [ "${md5}" != "0" ]&&[ "${md5}" != "nomd5" ]; then if [ "${md5}" != "0" ]&&[ "${md5}" != "nomd5" ]; then
echo -en "verifying ${local_filename} with MD5..." echo -en "verifying ${local_filename} with MD5..."
fn_sleep_time fn_sleep_time
local md5sumcmd=$(md5sum "${local_filedir}/${local_filename}"|awk '{print $1;}') md5sumcmd=$(md5sum "${local_filedir}/${local_filename}"|awk '{print $1;}')
if [ "${md5sumcmd}" != "${md5}" ]; then if [ "${md5sumcmd}" != "${md5}" ]; then
fn_print_fail_eol_nl fn_print_fail_eol_nl
echo -e "${local_filename} returned MD5 checksum: ${md5sumcmd}" echo -e "${local_filename} returned MD5 checksum: ${md5sumcmd}"

16
lgsm/functions/core_exit.sh

@ -4,10 +4,12 @@
# Website: https://linuxgsm.com # Website: https://linuxgsm.com
# Description: Handles exiting of LinuxGSM by running and reporting an exit code. # Description: Handles exiting of LinuxGSM by running and reporting an exit code.
functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
fn_exit_dev_debug(){ fn_exit_dev_debug(){
if [ -f "${rootdir}/.dev-debug" ]; then if [ -f "${rootdir}/.dev-debug" ]; then
echo -e "" echo -e ""
echo -e "${function_selfname} exiting with code: ${exitcode}" echo -e "${functionselfname} exiting with code: ${exitcode}"
if [ -f "${rootdir}/dev-debug.log" ]; then if [ -f "${rootdir}/dev-debug.log" ]; then
grep "functionfile=" "${rootdir}/dev-debug.log" | sed 's/functionfile=//g' > "${rootdir}/dev-debug-function-order.log" grep "functionfile=" "${rootdir}/dev-debug.log" | sed 's/functionfile=//g' > "${rootdir}/dev-debug-function-order.log"
fi fi
@ -26,13 +28,13 @@ elif [ "${exitcode}" ]&&[ "${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 "${function_selfname} exiting with code: ${exitcode}" fn_script_log_fatal "${functionselfname} exiting with code: ${exitcode}"
elif [ "${exitcode}" == "2" ]; then elif [ "${exitcode}" == "2" ]; then
fn_script_log_error "${function_selfname} exiting with code: ${exitcode}" fn_script_log_error "${functionselfname} exiting with code: ${exitcode}"
elif [ "${exitcode}" == "3" ]; then elif [ "${exitcode}" == "3" ]; then
fn_script_log_warn "${function_selfname} exiting with code: ${exitcode}" fn_script_log_warn "${functionselfname} exiting with code: ${exitcode}"
else else
fn_script_log_warn "${function_selfname} exiting with code: ${exitcode}" fn_script_log_warn "${functionselfname} exiting with code: ${exitcode}"
fi fi
fn_exit_dev_debug fn_exit_dev_debug
# remove trap. # remove trap.
@ -41,7 +43,7 @@ elif [ "${exitcode}" ]&&[ "${exitcode}" != "0" ]; then
elif [ "${exitcode}" ]&&[ "${exitcode}" == "0" ]; then elif [ "${exitcode}" ]&&[ "${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}"
fn_script_log_pass "${function_selfname} exiting with code: ${exitcode}" fn_script_log_pass "${functionselfname} exiting with code: ${exitcode}"
fn_exit_dev_debug fn_exit_dev_debug
# remove trap. # remove trap.
trap - INT trap - INT
@ -50,7 +52,7 @@ else
# List LinuxGSM version in logs # List LinuxGSM version in logs
fn_script_log_info "LinuxGSM version: ${version}" fn_script_log_info "LinuxGSM version: ${version}"
fn_print_error "No exit code set" fn_print_error "No exit code set"
fn_script_log_pass "${function_selfname} exiting with code: NOT SET" fn_script_log_pass "${functionselfname} exiting with code: NOT SET"
fn_exit_dev_debug fn_exit_dev_debug
# remove trap. # remove trap.
trap - INT trap - INT

4
lgsm/functions/core_functions.sh

@ -5,6 +5,8 @@
# Description: Defines all functions to allow download and execution of functions using fn_fetch_function. # Description: Defines all functions to allow download and execution of functions using fn_fetch_function.
# This function is called first before any other function. Without this file other functions will not load. # This function is called first before any other function. Without this file other functions will not load.
functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
# Core # Core
core_dl.sh(){ core_dl.sh(){
@ -541,7 +543,7 @@ fn_fetch_function
} }
# Logs # Logs
logs.sh(){ core_logs.sh(){
functionfile="${FUNCNAME[0]}" functionfile="${FUNCNAME[0]}"
fn_fetch_function fn_fetch_function
} }

2
lgsm/functions/core_getopt.sh

@ -4,7 +4,7 @@
# Website: https://linuxgsm.com # Website: https://linuxgsm.com
# Description: getopt arguments. # Description: getopt arguments.
local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
### Define all commands here. ### Define all commands here.
## User commands | Trigger commands | Description ## User commands | Trigger commands | Description

2
lgsm/functions/core_legacy.sh

@ -4,6 +4,8 @@
# Website: https://linuxgsm.com # Website: https://linuxgsm.com
# Description: Code for backwards compatability with older versions of LinuxGSM. # Description: Code for backwards compatability with older versions of LinuxGSM.
functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
if [ -z "${serverfiles}" ]; then if [ -z "${serverfiles}" ]; then
legacymode=1 legacymode=1
serverfiles="${filesdir}" serverfiles="${filesdir}"

7
lgsm/functions/logs.sh → lgsm/functions/core_logs.sh

@ -1,12 +1,11 @@
#!/bin/bash #!/bin/bash
# LinuxGSM logs.sh function # LinuxGSM core_logs.sh function
# Author: Daniel Gibbs # Author: Daniel Gibbs
# Contributor: UltimateByte # Contributor: UltimateByte
# Website: https://linuxgsm.com # Website: https://linuxgsm.com
# Description: Acts as a log rotator, removing old logs. # Description: Acts as a log rotator, removing old logs.
local modulename="LOGS" functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
local commandaction="Log-Manager"
# Check if logfile variable and file exist, create logfile if it doesn't exist. # Check if logfile variable and file exist, create logfile if it doesn't exist.
if [ "${consolelog}" ]; then if [ "${consolelog}" ]; then
@ -17,7 +16,7 @@ fi
# For games not displaying a console, and having logs into their game directory. # For games not displaying a console, and having logs into their game directory.
check_status.sh check_status.sh
if [ "${status}" != "0" ]&&[ "${function_selfname}" == "command_start.sh" ]&&[ -n "${gamelogfile}" ]; then if [ "${status}" != "0" ]&&[ "${commandname}" == "START" ]&&[ -n "${gamelogfile}" ]; then
if [ "$(find "${systemdir}" -name "gamelog*.log")" ]; then if [ "$(find "${systemdir}" -name "gamelog*.log")" ]; then
fn_print_info "Moving game logs to ${gamelogdir}" fn_print_info "Moving game logs to ${gamelogdir}"
fn_script_log_info "Moving game logs to ${gamelogdir}" fn_script_log_info "Moving game logs to ${gamelogdir}"

26
lgsm/functions/core_messages.sh

@ -5,6 +5,8 @@
# Website: https://linuxgsm.com # Website: https://linuxgsm.com
# Description: Defines on-screen messages such as [ OK ] and how script logs look. # Description: Defines on-screen messages such as [ OK ] and how script logs look.
functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
# nl: new line: message is following by a new line. # nl: new line: message is following by a new line.
# eol: end of line: message is placed at the end of the current line. # eol: end of line: message is placed at the end of the current line.
fn_ansi_loader(){ fn_ansi_loader(){
@ -46,8 +48,8 @@ fn_sleep_time(){
## Feb 28 14:56:58 ut99-server: Monitor: ## Feb 28 14:56:58 ut99-server: Monitor:
fn_script_log(){ fn_script_log(){
if [ -d "${lgsmlogdir}" ]; then if [ -d "${lgsmlogdir}" ]; then
if [ "${modulename}" ]; then if [ -n "${commandname}" ]; then
echo -e "$(date '+%b %d %H:%M:%S.%3N') ${selfname}: ${modulename}: ${1}" >> "${lgsmlog}" echo -e "$(date '+%b %d %H:%M:%S.%3N') ${selfname}: ${commandname}: ${1}" >> "${lgsmlog}"
else else
echo -e "$(date '+%b %d %H:%M:%S.%3N') ${selfname}: ${1}" >> "${lgsmlog}" echo -e "$(date '+%b %d %H:%M:%S.%3N') ${selfname}: ${1}" >> "${lgsmlog}"
fi fi
@ -58,8 +60,8 @@ fn_script_log(){
fn_script_log_pass(){ fn_script_log_pass(){
if [ -d "${lgsmlogdir}" ]; then if [ -d "${lgsmlogdir}" ]; then
if [ "${modulename}" ]; then if [ -n "${commandname}" ]; then
echo -e "$(date '+%b %d %H:%M:%S.%3N') ${selfname}: ${modulename}: PASS: ${1}" >> "${lgsmlog}" echo -e "$(date '+%b %d %H:%M:%S.%3N') ${selfname}: ${commandname}: PASS: ${1}" >> "${lgsmlog}"
else else
echo -e "$(date '+%b %d %H:%M:%S.%3N') ${selfname}: PASS: ${1}" >> "${lgsmlog}" echo -e "$(date '+%b %d %H:%M:%S.%3N') ${selfname}: PASS: ${1}" >> "${lgsmlog}"
fi fi
@ -70,8 +72,8 @@ 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_fatal(){
if [ -d "${lgsmlogdir}" ]; then if [ -d "${lgsmlogdir}" ]; then
if [ "${modulename}" ]; then if [ -n "${commandname}" ]; then
echo -e "$(date '+%b %d %H:%M:%S.%3N') ${selfname}: ${modulename}: FATAL: ${1}" >> "${lgsmlog}" echo -e "$(date '+%b %d %H:%M:%S.%3N') ${selfname}: ${commandname}: FATAL: ${1}" >> "${lgsmlog}"
else else
echo -e "$(date '+%b %d %H:%M:%S.%3N') ${selfname}: FATAL: ${1}" >> "${lgsmlog}" echo -e "$(date '+%b %d %H:%M:%S.%3N') ${selfname}: FATAL: ${1}" >> "${lgsmlog}"
fi fi
@ -82,8 +84,8 @@ fn_script_log_fatal(){
## Feb 28 14:56:58 ut99-server: Monitor: ERROR: ## Feb 28 14:56:58 ut99-server: Monitor: ERROR:
fn_script_log_error(){ fn_script_log_error(){
if [ -d "${lgsmlogdir}" ]; then if [ -d "${lgsmlogdir}" ]; then
if [ "${modulename}" ]; then if [ -n "${commandname}" ]; then
echo -e "$(date '+%b %d %H:%M:%S.%3N') ${selfname}: ${modulename}: ERROR: ${1}" >> "${lgsmlog}" echo -e "$(date '+%b %d %H:%M:%S.%3N') ${selfname}: ${commandname}: ERROR: ${1}" >> "${lgsmlog}"
else else
echo -e "$(date '+%b %d %H:%M:%S.%3N') ${selfname}: ERROR: ${1}" >> "${lgsmlog}" echo -e "$(date '+%b %d %H:%M:%S.%3N') ${selfname}: ERROR: ${1}" >> "${lgsmlog}"
fi fi
@ -94,8 +96,8 @@ fn_script_log_error(){
## Feb 28 14:56:58 ut99-server: Monitor: WARN: ## Feb 28 14:56:58 ut99-server: Monitor: WARN:
fn_script_log_warn(){ fn_script_log_warn(){
if [ -d "${lgsmlogdir}" ]; then if [ -d "${lgsmlogdir}" ]; then
if [ "${modulename}" ]; then if [ -n "${commandname}" ]; then
echo -e "$(date '+%b %d %H:%M:%S.%3N') ${selfname}: ${modulename}: WARN: ${1}" >> "${lgsmlog}" echo -e "$(date '+%b %d %H:%M:%S.%3N') ${selfname}: ${commandname}: WARN: ${1}" >> "${lgsmlog}"
else else
echo -e "$(date '+%b %d %H:%M:%S.%3N') ${selfname}: WARN: ${1}" >> "${lgsmlog}" echo -e "$(date '+%b %d %H:%M:%S.%3N') ${selfname}: WARN: ${1}" >> "${lgsmlog}"
fi fi
@ -106,8 +108,8 @@ fn_script_log_warn(){
## Feb 28 14:56:58 ut99-server: Monitor: INFO: ## Feb 28 14:56:58 ut99-server: Monitor: INFO:
fn_script_log_info(){ fn_script_log_info(){
if [ -d "${lgsmlogdir}" ]; then if [ -d "${lgsmlogdir}" ]; then
if [ "${modulename}" ]; then if [ -n "${commandname}" ]; then
echo -e "$(date '+%b %d %H:%M:%S.%3N') ${selfname}: ${modulename}: INFO: ${1}" >> "${lgsmlog}" echo -e "$(date '+%b %d %H:%M:%S.%3N') ${selfname}: ${commandname}: INFO: ${1}" >> "${lgsmlog}"
else else
echo -e "$(date '+%b %d %H:%M:%S.%3N') ${selfname}: INFO: ${1}" >> "${lgsmlog}" echo -e "$(date '+%b %d %H:%M:%S.%3N') ${selfname}: INFO: ${1}" >> "${lgsmlog}"
fi fi

2
lgsm/functions/core_trap.sh

@ -4,6 +4,8 @@
# Website: https://linuxgsm.com # Website: https://linuxgsm.com
# Description: Handles CTRL-C trap to give an exit code. # Description: Handles CTRL-C trap to give an exit code.
functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
fn_exit_trap(){ fn_exit_trap(){
echo -e "" echo -e ""
core_exit.sh core_exit.sh

7
lgsm/functions/fix.sh

@ -5,8 +5,7 @@
# Description: Overall function for managing fixes. # Description: Overall function for managing fixes.
# Runs functions that will fix an issue. # Runs functions that will fix an issue.
local modulename="FIX" functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
local commandaction="Fix"
# Messages that are displayed for some fixes. # Messages that are displayed for some fixes.
fn_fix_msg_start(){ fn_fix_msg_start(){
@ -32,7 +31,7 @@ fn_fix_msg_end(){
} }
# Fixes that are run on start. # Fixes that are run on start.
if [ "${function_selfname}" != "command_install.sh" ]&&[ -z "${fixbypass}" ]; then if [ "${commandname}" != "INSTALL" ]&&[ -z "${fixbypass}" ]; then
if [ "${appid}" ]; then if [ "${appid}" ]; then
fix_steamcmd.sh fix_steamcmd.sh
fi fi
@ -89,7 +88,7 @@ if [ "${function_selfname}" != "command_install.sh" ]&&[ -z "${fixbypass}" ]; th
fi fi
# Fixes that are run on install only. # Fixes that are run on install only.
if [ "${function_selfname}" == "command_install.sh" ]; then if [ "${commandname}" == "INSTALL" ]; then
if [ "${shortname}" == "av" ]||[ "${shortname}" == "kf" ]||[ "${shortname}" == "kf2" ]||[ "${shortname}" == "onset" ]||[ "${shortname}" == "ro" ]||[ "${shortname}" == "ut2k4" ]||[ "${shortname}" == "ut" ]||[ "${shortname}" == "ut3" ]; then if [ "${shortname}" == "av" ]||[ "${shortname}" == "kf" ]||[ "${shortname}" == "kf2" ]||[ "${shortname}" == "onset" ]||[ "${shortname}" == "ro" ]||[ "${shortname}" == "ut2k4" ]||[ "${shortname}" == "ut" ]||[ "${shortname}" == "ut3" ]; then
echo -e "" echo -e ""
echo -e "Applying Post-Install Fixes" echo -e "Applying Post-Install Fixes"

2
lgsm/functions/fix_ark.sh

@ -4,6 +4,8 @@
# Website: https://linuxgsm.com # Website: https://linuxgsm.com
# Description: Resolves various issues with ARK: Survival Evolved. # Description: Resolves various issues with ARK: Survival Evolved.
functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
# removes mulitple appworkshop_346110.acf if found. # removes mulitple appworkshop_346110.acf if found.
steamappsfilewc=$(find ${HOME} -name appworkshop_346110.acf | wc -l) steamappsfilewc=$(find ${HOME} -name appworkshop_346110.acf | wc -l)
if [ "${steamappsfilewc}" -gt "1" ]; then if [ "${steamappsfilewc}" -gt "1" ]; then

4
lgsm/functions/fix_arma3.sh

@ -4,9 +4,7 @@
# Website: https://linuxgsm.com # Website: https://linuxgsm.com
# Description: Resolves an issue with ARMA3. # Description: Resolves an issue with ARMA3.
local modulename="FIX" functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
local commandaction="Fix"
local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
# Fixes: 20150 Segmentation fault (core dumped) error. # Fixes: 20150 Segmentation fault (core dumped) error.
if [ ! -d "${XDG_DATA_HOME:="${HOME}/.local/share"}/Arma 3" ]||[ ! -d "${XDG_DATA_HOME:="${HOME}/.local/share"}/Arma 3 - Other Profiles" ]; then if [ ! -d "${XDG_DATA_HOME:="${HOME}/.local/share"}/Arma 3" ]||[ ! -d "${XDG_DATA_HOME:="${HOME}/.local/share"}/Arma 3 - Other Profiles" ]; then

3
lgsm/functions/fix_av.sh

@ -4,8 +4,7 @@
# Website: https://linuxgsm.com # Website: https://linuxgsm.com
# Description: Resolves startup issue with Avorion # Description: Resolves startup issue with Avorion
local commandname="FIX" functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
local commandaction="Fix"
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${serverfiles}:${serverfiles}/linux64" export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${serverfiles}:${serverfiles}/linux64"

4
lgsm/functions/fix_csgo.sh

@ -4,9 +4,7 @@
# Website: https://linuxgsm.com # Website: https://linuxgsm.com
# Description: Resolves various issues with CS:GO. # Description: Resolves various issues with CS:GO.
local modulename="FIX" functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
local commandaction="Fix"
local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
# Fixes: server not always creating steam_appid.txt file. # Fixes: server not always creating steam_appid.txt file.
if [ ! -f "${serverfiles}/steam_appid.txt" ]; then if [ ! -f "${serverfiles}/steam_appid.txt" ]; then

4
lgsm/functions/fix_dst.sh

@ -4,9 +4,7 @@
# Website: https://linuxgsm.com # Website: https://linuxgsm.com
# Description: Resolves various issues with Don't Starve Together. # Description: Resolves various issues with Don't Starve Together.
local modulename="FIX" functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
local commandaction="Fix"
local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
# Fixes: ./dontstarve_dedicated_server_nullrenderer: ./lib32/libcurl-gnutls.so.4: no version information available (required by ./dontstarve_dedicated_server_nullrenderer). # Fixes: ./dontstarve_dedicated_server_nullrenderer: ./lib32/libcurl-gnutls.so.4: no version information available (required by ./dontstarve_dedicated_server_nullrenderer).
# Issue only occures on CentOS as libcurl-gnutls.so.4 is called libcurl.so.4 on CentOS. # Issue only occures on CentOS as libcurl-gnutls.so.4 is called libcurl.so.4 on CentOS.

3
lgsm/functions/fix_ges.sh

@ -4,8 +4,7 @@
# Website: https://linuxgsm.com # Website: https://linuxgsm.com
# Description: Resolves various issues with GoldenEye: Source. # Description: Resolves various issues with GoldenEye: Source.
local modulename="FIX" functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
local commandaction="Fix"
# Fixes: MALLOC_CHECK_ needing to be set to 0. # Fixes: MALLOC_CHECK_ needing to be set to 0.
export MALLOC_CHECK_=0 export MALLOC_CHECK_=0

2
lgsm/functions/fix_hw.sh

@ -4,6 +4,8 @@
# Website: https://linuxgsm.com # Website: https://linuxgsm.com
# Description: Resolves various issues with Hurtworld. # Description: Resolves various issues with Hurtworld.
functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
if [ "${shortname}" == "hw" ]; then if [ "${shortname}" == "hw" ]; then
# Fixes: [S_API FAIL] SteamAPI_Init() failed; unable to locate a running instance of Steam, or a local steamclient.so. # Fixes: [S_API FAIL] SteamAPI_Init() failed; unable to locate a running instance of Steam, or a local steamclient.so.
if [ ! -f "${serverfiles}/Hurtworld_Data/Plugins/x86/steamclient.so" ]; then if [ ! -f "${serverfiles}/Hurtworld_Data/Plugins/x86/steamclient.so" ]; then

5
lgsm/functions/fix_ins.sh

@ -4,8 +4,7 @@
# Website: https://linuxgsm.com # Website: https://linuxgsm.com
# Description: Resolves various issues with Insurgency. # Description: Resolves various issues with Insurgency.
local modulename="FIX" functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
local commandaction="Fix"
# Fixes: ./srcds_linux: error while loading shared libraries: libtier0.so: cannot open shared object file: No such file or directory. # Fixes: ./srcds_linux: error while loading shared libraries: libtier0.so: cannot open shared object file: No such file or directory.
@ -13,7 +12,7 @@ export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${serverfiles}:${serverfiles}/bin"
# Fixes: issue #529 - gamemode not passed to debug or start. # Fixes: issue #529 - gamemode not passed to debug or start.
if [ "${function_selfname}" == "command_debug.sh" ]; then if [ "${commandname}" == "DEBUG" ]; then
defaultmap="\"${defaultmap}\"" defaultmap="\"${defaultmap}\""
else else
defaultmap="\\\"${defaultmap}\\\"" defaultmap="\\\"${defaultmap}\\\""

4
lgsm/functions/fix_kf.sh

@ -4,9 +4,7 @@
# Website: https://linuxgsm.com # Website: https://linuxgsm.com
# Description: Resolves various issues with Killing Floor. # Description: Resolves various issues with Killing Floor.
local modulename="FIX" functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
local commandaction="Fix"
local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
echo -e "Applying WebAdmin ROOst.css fix." echo -e "Applying WebAdmin ROOst.css fix."
echo -e "http://forums.tripwireinteractive.com/showpost.php?p=585435&postcount=13" echo -e "http://forums.tripwireinteractive.com/showpost.php?p=585435&postcount=13"

4
lgsm/functions/fix_kf2.sh

@ -4,9 +4,7 @@
# Website: https://linuxgsm.com # Website: https://linuxgsm.com
# Description: Resolves various issues with Killing Floor 2. # Description: Resolves various issues with Killing Floor 2.
local modulename="FIX" functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
local commandaction="Fix"
local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
fn_parms(){ fn_parms(){
parms="\"${defaultmap}?Game=KFGameContent.KFGameInfo_VersusSurvival\"" parms="\"${defaultmap}?Game=KFGameContent.KFGameInfo_VersusSurvival\""

3
lgsm/functions/fix_mcb.sh

@ -4,8 +4,7 @@
# Website: https://linuxgsm.com # Website: https://linuxgsm.com
# Description: Resolves possible startup issue with Minecraft Bedrock. # Description: Resolves possible startup issue with Minecraft Bedrock.
local modulename="FIX" functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
local commandaction="Fix"
# official docs state that the server should be started with: LD_LIBRARY_PATH=. ./bedrock_server # official docs state that the server should be started with: LD_LIBRARY_PATH=. ./bedrock_server
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${serverfiles}" export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${serverfiles}"

4
lgsm/functions/fix_mta.sh

@ -5,9 +5,7 @@
# Website: https://linuxgsm.com # Website: https://linuxgsm.com
# Description: Installs the libmysqlclient for database functions on the server. # Description: Installs the libmysqlclient for database functions on the server.
local modulename="FIX" functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
local commandaction="Fix"
local function_selfname="$(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"

3
lgsm/functions/fix_nmrih.sh

@ -4,8 +4,7 @@
# Description: Create symlinks for renamed No More Room In Hell serverfiles. # Description: Create symlinks for renamed No More Room In Hell serverfiles.
# Solution from Steam Community post: https://steamcommunity.com/app/224260/discussions/2/1732089092441769414/ # Solution from Steam Community post: https://steamcommunity.com/app/224260/discussions/2/1732089092441769414/
local modulename="FIX" functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
local commandaction="Fix"
ln -s "${serverfiles}/bin/vphysics_srv.so" "${serverfiles}/bin/vphysics.so" ln -s "${serverfiles}/bin/vphysics_srv.so" "${serverfiles}/bin/vphysics.so"
ln -s "${serverfiles}/bin/studiorender_srv.so" "${serverfiles}/bin/studiorender.so" ln -s "${serverfiles}/bin/studiorender_srv.so" "${serverfiles}/bin/studiorender.so"

4
lgsm/functions/fix_onset.sh

@ -4,9 +4,7 @@
# Website: https://linuxgsm.com # Website: https://linuxgsm.com
# Description: Resolves various issues with Onset. # Description: Resolves various issues with Onset.
local modulename="FIX" functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
local commandaction="Fix"
local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${serverfiles}" export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${serverfiles}"

4
lgsm/functions/fix_ro.sh

@ -4,9 +4,7 @@
# Website: https://linuxgsm.com # Website: https://linuxgsm.com
# Description: Resolves various issues with Red Orchestra. # Description: Resolves various issues with Red Orchestra.
local modulename="FIX" functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
local commandaction="Fix"
local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
echo -e "Applying WebAdmin ROOst.css fix." echo -e "Applying WebAdmin ROOst.css fix."
echo -e "http://forums.tripwireinteractive.com/showpost.php?p=585435&postcount=13" echo -e "http://forums.tripwireinteractive.com/showpost.php?p=585435&postcount=13"

3
lgsm/functions/fix_rust.sh

@ -4,8 +4,7 @@
# Website: https://linuxgsm.com # Website: https://linuxgsm.com
# Description: Resolves startup issue with Rust. # Description: Resolves startup issue with Rust.
local modulename="FIX" functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
local commandaction="Fix"
# Fixes: [Raknet] Server Shutting Down (Shutting Down). # Fixes: [Raknet] Server Shutting Down (Shutting Down).
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${systemdir}/RustDedicated_Data/Plugins/x86_64" export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${systemdir}/RustDedicated_Data/Plugins/x86_64"

3
lgsm/functions/fix_rw.sh

@ -4,7 +4,6 @@
# Website: https://linuxgsm.com # Website: https://linuxgsm.com
# Description: Resolves various issues with Rising World. # Description: Resolves various issues with Rising World.
local modulename="FIX" functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
local commandaction="Fix"
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${serverfiles}:${serverfiles}/linux64" export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${serverfiles}:${serverfiles}/linux64"

3
lgsm/functions/fix_sdtd.sh

@ -4,7 +4,6 @@
# Website: https://linuxgsm.com # Website: https://linuxgsm.com
# Description: Resolves various issues with 7 Days to Die. # Description: Resolves various issues with 7 Days to Die.
local modulename="FIX" functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
local commandaction="Fix"
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${serverfiles}" export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${serverfiles}"

4
lgsm/functions/fix_sfc.sh

@ -4,9 +4,7 @@
# Website: https://linuxgsm.com # Website: https://linuxgsm.com
# Description: Resolves various issues with Source Forts Classic. # Description: Resolves various issues with Source Forts Classic.
local modulename="FIX" functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
local commandaction="Fix"
local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
if [ ! -f "${serverfiles}/bin/datacache.so" ]; then if [ ! -f "${serverfiles}/bin/datacache.so" ]; then
ln -s "${serverfiles}/bin/datacache_srv.so" "${serverfiles}/bin/datacache.so" ln -s "${serverfiles}/bin/datacache_srv.so" "${serverfiles}/bin/datacache.so"

4
lgsm/functions/fix_sof2.sh

@ -4,8 +4,6 @@
# Website: https://linuxgsm.com # Website: https://linuxgsm.com
# Description: Resolves various issues with Soldier of Fortune 2. # Description: Resolves various issues with Soldier of Fortune 2.
local modulename="FIX" functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
local commandaction="Fix"
# Fixes: error while loading shared libraries: libcxa.so.1 # Fixes: error while loading shared libraries: libcxa.so.1
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${serverfiles}" export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${serverfiles}"

4
lgsm/functions/fix_ss3.sh

@ -4,9 +4,7 @@
# Website: https://linuxgsm.com # Website: https://linuxgsm.com
# Description: Resolves various issues with Serious Sam 3. # Description: Resolves various issues with Serious Sam 3.
local modulename="FIX" functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
local commandaction="Fix"
local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
# Fixes: https://steamcommunity.com/app/41070/discussions/0/353916981477716386/ # Fixes: https://steamcommunity.com/app/41070/discussions/0/353916981477716386/
if [ ! -f "${serverfiles}/Bin/steamclient.so" ]||[ "$(diff "${HOME}/.steam/steamcmd/linux32/steamclient.so" "${serverfiles}/Bin/steamclient.so" 2>/dev/null)" ]; then if [ ! -f "${serverfiles}/Bin/steamclient.so" ]||[ "$(diff "${HOME}/.steam/steamcmd/linux32/steamclient.so" "${serverfiles}/Bin/steamclient.so" 2>/dev/null)" ]; then

4
lgsm/functions/fix_steamcmd.sh

@ -4,9 +4,7 @@
# Website: https://linuxgsm.com # Website: https://linuxgsm.com
# Description: Resolves various issues related to SteamCMD. # Description: Resolves various issues related to SteamCMD.
local modulename="FIX" functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
local commandaction="Fix"
local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
# Helps fix: [S_API FAIL] SteamAPI_Init() failed; unable to locate a running instance of Steam,or a local steamclient.so. # Helps fix: [S_API FAIL] SteamAPI_Init() failed; unable to locate a running instance of Steam,or a local steamclient.so.
if [ ! -f "${HOME}/.steam/sdk64/steamclient.so" ]; then if [ ! -f "${HOME}/.steam/sdk64/steamclient.so" ]; then

4
lgsm/functions/fix_terraria.sh

@ -4,8 +4,6 @@
# Website: https://linuxgsm.com # Website: https://linuxgsm.com
# Description: Resolves an issue with Terraria. # Description: Resolves an issue with Terraria.
local modulename="FIX" functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
local commandaction="Fix"
local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
export TERM=xterm export TERM=xterm

4
lgsm/functions/fix_tf2.sh

@ -4,9 +4,7 @@
# Website: https://github.com/vectorsigma # Website: https://github.com/vectorsigma
# Description: Resolves various issues with Team Fortress 2. # Description: Resolves various issues with Team Fortress 2.
local modulename="FIX" functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
local commandaction="Fix"
local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
# Fixes: Team Fortress 2 Segmentation fault for Red-Hat Distros #2062. # Fixes: Team Fortress 2 Segmentation fault for Red-Hat Distros #2062.
if [ -f "/etc/redhat-release" ]&&[ ! -f "${serverfiles}/bin/libcurl-gnutls.so.4" ]; then if [ -f "/etc/redhat-release" ]&&[ ! -f "${serverfiles}/bin/libcurl-gnutls.so.4" ]; then

4
lgsm/functions/fix_ts3.sh

@ -4,9 +4,7 @@
# Website: https://linuxgsm.com # Website: https://linuxgsm.com
# Description: Resolves various issues with Teamspeak 3. # Description: Resolves various issues with Teamspeak 3.
local modulename="FIX" functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
local commandaction="Fix"
local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
# Fixes: makes libmariadb2 available #1924. # Fixes: makes libmariadb2 available #1924.
if [ ! -f "${serverfiles}/libmariadb.so.2" ]; then if [ ! -f "${serverfiles}/libmariadb.so.2" ]; then

2
lgsm/functions/fix_tu.sh

@ -4,6 +4,8 @@
# Website: https://linuxgsm.com # Website: https://linuxgsm.com
# Description: Resolves various issues with Tower Unite. # Description: Resolves various issues with Tower Unite.
functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
if [ "${shortname}" == "tu" ]; then if [ "${shortname}" == "tu" ]; then
# Fixes: [S_API FAIL] SteamAPI_Init() failed; unable to locate a running instance of Steam, or a local steamclient.so. # Fixes: [S_API FAIL] SteamAPI_Init() failed; unable to locate a running instance of Steam, or a local steamclient.so.
if [ ! -f "${executabledir}/steamclient.so" ]; then if [ ! -f "${executabledir}/steamclient.so" ]; then

3
lgsm/functions/fix_unt.sh

@ -4,8 +4,7 @@
# Website: https://linuxgsm.com # Website: https://linuxgsm.com
# Description: Resolves startup issue with Unturned. # Description: Resolves startup issue with Unturned.
local modulename="FIX" functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
local commandaction="Fix"
# steamclient.so: cannot open shared object file: No such file or directory # steamclient.so: cannot open shared object file: No such file or directory
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${serverfiles}:${serverfiles}/linux64" export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${serverfiles}:${serverfiles}/linux64"

4
lgsm/functions/fix_ut.sh

@ -4,9 +4,7 @@
# Website: https://linuxgsm.com # Website: https://linuxgsm.com
# Description: Resolves various issues with Unreal Tournament. # Description: Resolves various issues with Unreal Tournament.
local modulename="FIX" functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
local commandaction="Fix"
local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
#Set Binary Executable #Set Binary Executable
echo -e "chmod +x ${executabledir}/${executable}" echo -e "chmod +x ${executabledir}/${executable}"

4
lgsm/functions/fix_ut2k4.sh

@ -4,9 +4,7 @@
# Website: https://linuxgsm.com # Website: https://linuxgsm.com
# Description: Resolves various issues with Unreal Tournament 2004. # Description: Resolves various issues with Unreal Tournament 2004.
local modulename="FIX" functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
local commandaction="Fix"
local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
echo -e "applying WebAdmin ut2003.css fix." echo -e "applying WebAdmin ut2003.css fix."
echo -e "http://forums.tripwireinteractive.com/showpost.php?p=585435&postcount=13" echo -e "http://forums.tripwireinteractive.com/showpost.php?p=585435&postcount=13"

4
lgsm/functions/fix_ut3.sh

@ -4,9 +4,7 @@
# Website: https://linuxgsm.com # Website: https://linuxgsm.com
# Description: Resolves various issues with Unreal Tournament 3. # Description: Resolves various issues with Unreal Tournament 3.
local modulename="FIX" functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
local commandaction="Fix"
local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
fn_parms(){ fn_parms(){
parms="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}" parms="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}"

3
lgsm/functions/fix_wurm.sh

@ -4,8 +4,7 @@
# Website: https://linuxgsm.com # Website: https://linuxgsm.com
# Description: Resolves various issues with Wurm Unlimited. # Description: Resolves various issues with Wurm Unlimited.
local modulename="FIX" functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
local commandaction="Fix"
# Copies steamclient.so to correct location. # Copies steamclient.so to correct location.
if [ ! -f "${serverfiles}/nativelibs" ]; then if [ ! -f "${serverfiles}/nativelibs" ]; then

4
lgsm/functions/fix_zmr.sh

@ -4,9 +4,7 @@
# Website: https://linuxgsm.com # Website: https://linuxgsm.com
# Description: Resolves various issues with Zombie Master: Reborn. # Description: Resolves various issues with Zombie Master: Reborn.
local modulename="FIX" functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
local commandaction="Fix"
local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
if [ ! -f "${serverfiles}/bin/datacache.so" ]; then if [ ! -f "${serverfiles}/bin/datacache.so" ]; then
ln -s "${serverfiles}/bin/datacache_srv.so" "${serverfiles}/bin/datacache.so" ln -s "${serverfiles}/bin/datacache_srv.so" "${serverfiles}/bin/datacache.so"

2
lgsm/functions/info_config.sh

@ -5,7 +5,7 @@
# Website: https://linuxgsm.com # Website: https://linuxgsm.com
# Description: Gets specific details from config files. # Description: Gets specific details from config files.
local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
## Examples of filtering to get info from config files. ## Examples of filtering to get info from config files.
# sed 's/foo//g' - remove foo # sed 's/foo//g' - remove foo

2
lgsm/functions/info_distro.sh

@ -5,7 +5,7 @@
# Description: Variables providing useful info on the Operating System such as disk and performace info. # Description: Variables providing useful info on the Operating System such as disk and performace info.
# Used for command_details.sh, command_debug.sh and alert.sh. # Used for command_details.sh, command_debug.sh and alert.sh.
local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
### Game Server pid ### Game Server pid
if [ "${status}" == "1" ]; then if [ "${status}" == "1" ]; then

6
lgsm/functions/info_messages.sh

@ -4,6 +4,8 @@
# Website: https://linuxgsm.com # Website: https://linuxgsm.com
# Description: Defines server info messages for details and alerts. # Description: Defines server info messages for details and alerts.
functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
# Standard Details # Standard Details
# This applies to all engines # This applies to all engines
@ -1507,7 +1509,7 @@ fn_info_message_select_engine(){
# Separator is different for details # Separator is different for details
fn_messages_separator(){ fn_messages_separator(){
if [ "${function_selfname}" == "command_details.sh" ]; then if [ "${commandname}" == "details" ]; then
printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' = printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' =
else else
echo -e "=================================" echo -e "================================="
@ -1516,7 +1518,7 @@ fn_messages_separator(){
# 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 [ "${function_selfname}" != "command_details.sh" ]; then if [ "${commandname}" != "DETAILS" ]; then
if [ "${serverpassword}" ]; then if [ "${serverpassword}" ]; then
serverpassword="********" serverpassword="********"
fi fi

2
lgsm/functions/info_parms.sh

@ -4,7 +4,7 @@
# Website: https://linuxgsm.com # Website: https://linuxgsm.com
# Description: If specific parms are not set then this will be displayed in details. # Description: If specific parms are not set then this will be displayed in details.
local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
## Examples of filtering to get info from config files ## Examples of filtering to get info from config files
# sed 's/foo//g' - remove foo # sed 's/foo//g' - remove foo

Some files were not shown because too many files changed in this diff

Loading…
Cancel
Save