Skip to content
Permalink
Browse files

feat: convert commandname to modulename (#2728)

  • Loading branch information
dgibbs64 committed Mar 10, 2020
1 parent 1f4fa0c commit d106384e2839d579a1f2aad02e04a7fc457b78e6
Showing with 131 additions and 123 deletions.
  1. +1 −1 lgsm/functions/alert.sh
  2. +4 −0 lgsm/functions/alert_discord.sh
  3. +1 −1 lgsm/functions/alert_email.sh
  4. +1 −1 lgsm/functions/alert_ifttt.sh
  5. +1 −1 lgsm/functions/alert_mailgun.sh
  6. +1 −1 lgsm/functions/alert_pushbullet.sh
  7. +1 −1 lgsm/functions/alert_pushover.sh
  8. +4 −0 lgsm/functions/alert_slack.sh
  9. +1 −1 lgsm/functions/alert_telegram.sh
  10. +1 −1 lgsm/functions/check.sh
  11. +2 −2 lgsm/functions/check_config.sh
  12. +1 −1 lgsm/functions/check_deps.sh
  13. +2 −2 lgsm/functions/check_executable.sh
  14. +1 −1 lgsm/functions/check_glibc.sh
  15. +1 −1 lgsm/functions/check_ip.sh
  16. +2 −2 lgsm/functions/check_logs.sh
  17. +1 −1 lgsm/functions/check_permissions.sh
  18. +2 −2 lgsm/functions/check_root.sh
  19. +2 −2 lgsm/functions/check_status.sh
  20. +1 −1 lgsm/functions/check_steamcmd.sh
  21. +2 −2 lgsm/functions/check_system_dir.sh
  22. +2 −2 lgsm/functions/check_system_requirements.sh
  23. +1 −1 lgsm/functions/check_tmuxception.sh
  24. +1 −1 lgsm/functions/command_backup.sh
  25. +1 −1 lgsm/functions/command_console.sh
  26. +1 −1 lgsm/functions/command_debug.sh
  27. +1 −1 lgsm/functions/command_details.sh
  28. +1 −1 lgsm/functions/command_dev_debug.sh
  29. +1 −1 lgsm/functions/command_dev_detect_deps.sh
  30. +1 −1 lgsm/functions/command_dev_detect_glibc.sh
  31. +1 −1 lgsm/functions/command_dev_detect_ldd.sh
  32. +1 −1 lgsm/functions/command_dev_query_raw.sh
  33. +1 −1 lgsm/functions/command_donate.sh
  34. +1 −1 lgsm/functions/command_fastdl.sh
  35. +1 −1 lgsm/functions/command_install.sh
  36. +1 −1 lgsm/functions/command_install_resources_mta.sh
  37. +1 −1 lgsm/functions/command_mods_install.sh
  38. +1 −1 lgsm/functions/command_mods_remove.sh
  39. +1 −1 lgsm/functions/command_mods_update.sh
  40. +1 −1 lgsm/functions/command_monitor.sh
  41. +1 −1 lgsm/functions/command_postdetails.sh
  42. +1 −1 lgsm/functions/command_restart.sh
  43. +1 −1 lgsm/functions/command_start.sh
  44. +1 −1 lgsm/functions/command_stop.sh
  45. +1 −1 lgsm/functions/command_test_alert.sh
  46. +1 −1 lgsm/functions/command_ts3_server_pass.sh
  47. +1 −1 lgsm/functions/command_update.sh
  48. +1 −1 lgsm/functions/command_update_linuxgsm.sh
  49. +1 −1 lgsm/functions/command_validate.sh
  50. +1 −1 lgsm/functions/command_wipe.sh
  51. +1 −1 lgsm/functions/core_dl.sh
  52. +12 −12 lgsm/functions/core_messages.sh
  53. +1 −1 lgsm/functions/fix.sh
  54. +1 −1 lgsm/functions/fix_arma3.sh
  55. +1 −1 lgsm/functions/fix_csgo.sh
  56. +1 −1 lgsm/functions/fix_dst.sh
  57. +1 −1 lgsm/functions/fix_ges.sh
  58. +1 −1 lgsm/functions/fix_ins.sh
  59. +1 −1 lgsm/functions/fix_kf.sh
  60. +1 −1 lgsm/functions/fix_kf2.sh
  61. +2 −2 lgsm/functions/fix_mcb.sh
  62. +1 −1 lgsm/functions/fix_mta.sh
  63. +1 −1 lgsm/functions/fix_onset.sh
  64. +1 −1 lgsm/functions/fix_ro.sh
  65. +1 −1 lgsm/functions/fix_rust.sh
  66. +1 −1 lgsm/functions/fix_rw.sh
  67. +1 −1 lgsm/functions/fix_sdtd.sh
  68. +1 −1 lgsm/functions/fix_sfc.sh
  69. +1 −1 lgsm/functions/fix_sof2.sh
  70. +1 −1 lgsm/functions/fix_ss3.sh
  71. +2 −2 lgsm/functions/fix_steamcmd.sh
  72. +1 −1 lgsm/functions/fix_terraria.sh
  73. +1 −1 lgsm/functions/fix_tf2.sh
  74. +1 −1 lgsm/functions/fix_ts3.sh
  75. +1 −1 lgsm/functions/fix_unt.sh
  76. +1 −1 lgsm/functions/fix_ut.sh
  77. +1 −1 lgsm/functions/fix_ut2k4.sh
  78. +1 −1 lgsm/functions/fix_ut3.sh
  79. +1 −1 lgsm/functions/fix_zmr.sh
  80. +1 −1 lgsm/functions/install_complete.sh
  81. +1 −1 lgsm/functions/install_config.sh
  82. +1 −1 lgsm/functions/install_dst_token.sh
  83. +1 −1 lgsm/functions/install_factorio_save.sh
  84. +1 −1 lgsm/functions/install_gslt.sh
  85. +1 −1 lgsm/functions/install_header.sh
  86. +1 −1 lgsm/functions/install_logs.sh
  87. +1 −1 lgsm/functions/install_mta_resources.sh
  88. +1 −1 lgsm/functions/install_retry.sh
  89. +1 −1 lgsm/functions/install_server_dir.sh
  90. +1 −1 lgsm/functions/install_server_files.sh
  91. +1 −1 lgsm/functions/install_squad_license.sh
  92. +1 −1 lgsm/functions/install_stats.sh
  93. +1 −1 lgsm/functions/install_steamcmd.sh
  94. +1 −1 lgsm/functions/install_ts3db.sh
  95. +1 −1 lgsm/functions/install_ut2k4_key.sh
  96. +1 −1 lgsm/functions/logs.sh
  97. +1 −1 lgsm/functions/mods_core.sh
  98. +1 −1 lgsm/functions/mods_list.sh
  99. +1 −1 lgsm/functions/update_factorio.sh
  100. +1 −1 lgsm/functions/update_minecraft.sh
  101. +1 −1 lgsm/functions/update_minecraft_bedrock.sh
  102. +1 −1 lgsm/functions/update_mta.sh
  103. +1 −1 lgsm/functions/update_mumble.sh
  104. +1 −1 lgsm/functions/update_steamcmd.sh
  105. +1 −1 lgsm/functions/update_ts3.sh
@@ -4,7 +4,7 @@
# Website: https://linuxgsm.com
# Description: Overall function for managing alerts.

local commandname="ALERT"
local modulename="ALERT"
local commandaction="Alert"

fn_alert_log(){
@@ -5,6 +5,10 @@
# Website: https://linuxgsm.com
# Description: Sends Discord alert.

local modulename="ALERT"
local commandaction="Alert"
local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"

if ! command -v jq > /dev/null; then
fn_print_fail_nl "Sending Discord alert: jq is missing."
fn_script_log_fatal "Sending Discord alert: jq is missing."
@@ -4,7 +4,7 @@
# Website: https://linuxgsm.com
# Description: Sends email alert.

local commandname="ALERT"
local modulename="ALERT"
local commandaction="Alert"
local function_selfname=$(basename "$(readlink -f "${BASH_SOURCE[0]}")")

@@ -4,7 +4,7 @@
# Website: https://linuxgsm.com
# Description: Sends IFTTT alert.

local commandname="ALERT"
local modulename="ALERT"
local commandaction="Alert"
local function_selfname=$(basename "$(readlink -f "${BASH_SOURCE[0]}")")

@@ -4,7 +4,7 @@
# Website: https://linuxgsm.com
# Description: Sends Mailgun Email alert.

local commandname="ALERT"
local modulename="ALERT"
local commandaction="Alert"
local function_selfname=$(basename "$(readlink -f "${BASH_SOURCE[0]}")")

@@ -4,7 +4,7 @@
# Website: https://linuxgsm.com
# Description: Sends Pushbullet Messenger alert.

local commandname="ALERT"
local modulename="ALERT"
local commandaction="Alert"
local function_selfname=$(basename "$(readlink -f "${BASH_SOURCE[0]}")")

@@ -4,7 +4,7 @@
# Website: https://linuxgsm.com
# Description: Sends Pushover alert.

local commandname="ALERT"
local modulename="ALERT"
local commandaction="Alert"
local function_selfname=$(basename "$(readlink -f "${BASH_SOURCE[0]}")")

@@ -4,6 +4,10 @@
# Website: https://linuxgsm.com
# Description: Sends Slack alert.

local modulename="ALERT"
local commandaction="Alert"
local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"

if ! command -v jq > /dev/null; then
fn_print_fail_nl "Sending Slack alert: jq is missing."
fn_script_log_fatal "Sending Slack alert: jq is missing."
@@ -4,7 +4,7 @@
# Website: https://bytegaming.de
# Description: Sends Telegram Messenger alert.

local commandname="ALERT"
local modulename="ALERT"
local commandaction="Alert"
local function_selfname=$(basename "$(readlink -f "${BASH_SOURCE[0]}")")

@@ -5,7 +5,7 @@
# Description: Overall function for managing checks.
# Runs checks that will either halt on or fix an issue.

local commandname="CHECK"
local modulename="CHECK"

# Every command that requires checks just references check.sh.
# check.sh selects which checks to run by using arrays.
@@ -4,8 +4,8 @@
# Website: https://linuxgsm.com
# Description: Checks if the server config is missing and warns the user if needed.

local commandname="CHECK"
local function_selfname=$(basename "$(readlink -f "${BASH_SOURCE[0]}")")
local modulename="CHECK"
local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"

if [ ! -e "${servercfgfullpath}" ]; then
if [ "${shortname}" != "hw" ]&&[ "${shortname}" != "ut3" ]&&[ "${shortname}" != "kf2" ]; then
@@ -4,7 +4,7 @@
# Website: https://linuxgsm.com
# Description: Checks if required dependencies are installed for LinuxGSM.

local commandname="CHECK"
local modulename="CHECK"

fn_install_mono_repo(){
if [ "${monostatus}" != "0" ]; then
@@ -4,8 +4,8 @@
# Website: https://linuxgsm.com
# Description: Checks if server executable exists.

local commandname="CHECK"
local function_selfname=$(basename "$(readlink -f "${BASH_SOURCE[0]}")")
local modulename="CHECK"
local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"

# Check if executable exists
if [ ! -f "${executabledir}/${execname}" ]; then
@@ -4,7 +4,7 @@
# Website: https://linuxgsm.com
# Description: Checks if the server has the correct Glibc version.

local commandname="CHECK"
local modulename="CHECK"

info_distro.sh

@@ -5,7 +5,7 @@
# 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".

local commandname="CHECK"
local modulename="CHECK"

if [ "${travistest}" != "1" ]; then
if [ ! -f "/bin/ip" ]; then
@@ -4,8 +4,8 @@
# Website: https://linuxgsm.com
# Description: Checks if log files exist.

local commandname="CHECK"
local function_selfname=$(basename "$(readlink -f "${BASH_SOURCE[0]}")")
local modulename="CHECK"
local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"

fn_check_logs(){
fn_print_dots "Checking for log files"
@@ -5,7 +5,7 @@
# Website: https://linuxgsm.com
# Description: Checks ownership & permissions of scripts, files and directories.

local commandname="CHECK"
local modulename="CHECK"

fn_check_ownership(){
if [ -f "${rootdir}/${selfname}" ]; then
@@ -4,8 +4,8 @@
# Website: https://linuxgsm.com
# Description: Checks if the user tried to run the script as root.

local commandname="CHECK"
local function_selfname=$(basename "$(readlink -f "${BASH_SOURCE[0]}")")
local modulename="CHECK"
local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"

if [ "$(whoami)" = "root" ]; then
if [ "${function_selfname}" != "command_install.sh" ]; then
@@ -5,7 +5,7 @@
# Website: https://linuxgsm.com
# Description: Checks the process status of the server. Either online or offline.

local commandname="CHECK"
local function_selfname=$(basename "$(readlink -f "${BASH_SOURCE[0]}")")
local modulename="CHECK"
local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"

status=$(tmux list-sessions -F "#{session_name}" 2>/dev/null | grep -Ecx "^${selfname}")
@@ -4,7 +4,7 @@
# Website: https://linuxgsm.com
# Description: Checks if SteamCMD is installed correctly.

local commandname="CHECK"
local modulename="CHECK"

fn_install_steamcmd(){
if [ ! -d "${steamcmddir}" ]; then
@@ -4,8 +4,8 @@
# Website: https://linuxgsm.com
# Description: Checks if systemdir/serverfiles is accessible.

local commandname="CHECK"
local function_selfname=$(basename "$(readlink -f "${BASH_SOURCE[0]}")")
local modulename="CHECK"
local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"

if [ "${function_selfname}" != "command_validate.sh" ]; then
checkdir="${serverfiles}"
@@ -5,8 +5,8 @@
# Website: https://linuxgsm.com
# Description: Checks RAM requirements

local commandname="CHECK"
local function_selfname=$(basename "$(readlink -f "${BASH_SOURCE[0]}")")
local modulename="CHECK"
local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"

info_distro.sh

@@ -5,7 +5,7 @@
# Website: https://linuxgsm.com
# Description: Checks if run from tmux or screen

local commandname="CHECK"
local modulename="CHECK"

fn_check_is_in_tmux(){
if [ -n "${TMUX}" ]; then
@@ -5,7 +5,7 @@
# Website: https://linuxgsm.com
# Description: Creates a .tar.gz file in the backup directory.

local commandname="BACKUP"
local modulename="BACKUP"
local commandaction="Backup"
local function_selfname=$(basename "$(readlink -f "${BASH_SOURCE[0]}")")

@@ -4,7 +4,7 @@
# Website: https://linuxgsm.com
# Description: Gives access to the server tmux console.

local commandname="CONSOLE"
local modulename="CONSOLE"
local commandaction="Console"
local function_selfname=$(basename "$(readlink -f "${BASH_SOURCE[0]}")")

@@ -4,7 +4,7 @@
# Website: https://linuxgsm.com
# Description: Runs the server without tmux and directly from the terminal.

local commandname="DEBUG"
local modulename="DEBUG"
local commandaction="Debug"
local function_selfname=$(basename "$(readlink -f "${BASH_SOURCE[0]}")")

@@ -5,7 +5,7 @@
# Website: https://linuxgsm.com
# Description: Displays server information.

local commandname="DETAILS"
local modulename="DETAILS"
local commandaction="Details"
local function_selfname=$(basename "$(readlink -f "${BASH_SOURCE[0]}")")

@@ -4,7 +4,7 @@
# Website: https://linuxgsm.com
# Description: Dev only: Enables debugging log to be saved to dev-debug.log.

local commandname="DEV-DEBUG"
local modulename="DEV-DEBUG"
local commandaction="Dev-Debug"
local function_selfname=$(basename "$(readlink -f "${BASH_SOURCE[0]}")")

@@ -4,7 +4,7 @@
# Website: https://linuxgsm.com
# Description: Detects dependencies the server binary requires.

local commandname="DETECT-DEPS"
local modulename="DETECT-DEPS"
local commandaction="Detect-Deps"
local function_selfname=$(basename "$(readlink -f "${BASH_SOURCE[0]}")")

@@ -5,7 +5,7 @@
# Description: Automatically detects the version of GLIBC that is required.
# Can check a file or directory recursively.

local commandname="DETECT-GLIBC"
local modulename="DETECT-GLIBC"
local commandaction="Detect-Glibc"
local function_selfname=$(basename "$(readlink -f "${BASH_SOURCE[0]}")")

@@ -5,7 +5,7 @@
# Description: Automatically detects required deps using ldd.
# Can check a file or directory recursively.

local commandname="DETECT-LDD"
local modulename="DETECT-LDD"
local commandaction="Detect-LDD"
local function_selfname=$(basename "$(readlink -f "${BASH_SOURCE[0]}")")

@@ -4,7 +4,7 @@
# Website: https://linuxgsm.com
# Description: Raw gamedig output of the server.

local commandname="QUERY-RAW"
local modulename="QUERY-RAW"
local commandaction="Query Raw"
local function_selfname=$(basename "$(readlink -f "${BASH_SOURCE[0]}")")

@@ -4,7 +4,7 @@
# Website: https://linuxgsm.com
# Description: Shows ways to donate.

local commandname="CONSOLE"
local modulename="CONSOLE"
local commandaction="Console"
local function_selfname=$(basename "$(readlink -f "${BASH_SOURCE[0]}")")

@@ -5,7 +5,7 @@
# Website: https://linuxgsm.com
# Description: Creates a FastDL directory.

local commandname="FASTDL"
local modulename="FASTDL"
local commandaction="FastDL"
local function_selfname=$(basename "$(readlink -f "${BASH_SOURCE[0]}")")

@@ -5,7 +5,7 @@
# Website: https://linuxgsm.com
# Description: Overall function for the installer.

local commandname="INSTALL"
local modulename="INSTALL"
local commandaction="Install"
local function_selfname=$(basename "$(readlink -f "${BASH_SOURCE[0]}")")

@@ -4,7 +4,7 @@
# Website: https://linuxgsm.com
# Description: Installs the default resources for Multi Theft Auto.

local commandname="DEFAULT_RESOURCES"
local modulename="DEFAULT_RESOURCES"
local commandaction="Default Resources"
local function_selfname=$(basename "$(readlink -f "${BASH_SOURCE[0]}")")

@@ -5,7 +5,7 @@
# Website: https://linuxgsm.com
# Description: List and installs available mods along with mods_list.sh and mods_core.sh.

local commandname="MODS"
local modulename="MODS"
local commandaction="addons/mods"
local function_selfname=$(basename "$(readlink -f "${BASH_SOURCE[0]}")")

@@ -5,7 +5,7 @@
# Website: https://linuxgsm.com
# Description: Uninstall mods along with mods_list.sh and mods_core.sh.

local commandname="MODS"
local modulename="MODS"
local commandaction="Mods Remove"
local function_selfname=$(basename "$(readlink -f "${BASH_SOURCE[0]}")")

@@ -5,7 +5,7 @@
# Website: https://linuxgsm.com
# Description: Updates installed mods along with mods_list.sh and mods_core.sh.

local commandname="MODS"
local modulename="MODS"
local commandaction="Mods Update"
local function_selfname=$(basename "$(readlink -f "${BASH_SOURCE[0]}")")

@@ -6,7 +6,7 @@
# Description: Monitors server by checking for running processes
# then passes to gamedig and gsquery.

local commandname="MONITOR"
local modulename="MONITOR"
local commandaction="Monitor"
local function_selfname=$(basename "$(readlink -f "${BASH_SOURCE[0]}")")

@@ -5,7 +5,7 @@
# Website: https://linuxgsm.com
# Description: Strips sensitive information out of Details output

local commandname="POSTDETAILS"
local modulename="POSTDETAILS"
local commandaction="Postdetails"
local function_selfname=$(basename "$(readlink -f "${BASH_SOURCE[0]}")")

@@ -4,7 +4,7 @@
# Website: https://linuxgsm.com
# Description: Restarts the server.

local commandname="RESTART"
local modulename="RESTART"
local commandaction="Restarting"
local function_selfname=$(basename "$(readlink -f "${BASH_SOURCE[0]}")")

0 comments on commit d106384

Please sign in to comment.
You can’t perform that action at this time.