Browse Source

fix merge bugs

pull/4169/head
Daniel Gibbs 3 years ago
parent
commit
f90e5f0ae8
No known key found for this signature in database GPG Key ID: 7CA38B43F78F12FE
  1. 2
      lgsm/modules/alert_gotify.sh
  2. 13
      lgsm/modules/check_permissions.sh
  3. 4
      lgsm/modules/command_start.sh
  4. 57
      lgsm/modules/command_update_linuxgsm.sh
  5. 94
      lgsm/modules/core_dl.sh
  6. 2
      lgsm/modules/core_functions.sh
  7. 37
      lgsm/modules/core_getopt.sh
  8. 5
      lgsm/modules/core_legacy.sh
  9. 32
      lgsm/modules/core_modules.sh
  10. 2
      lgsm/modules/fix.sh
  11. 2
      lgsm/modules/fix_armar.sh
  12. 2
      lgsm/modules/fix_bt.sh
  13. 5
      lgsm/modules/query_gamedig.sh
  14. 143
      lgsm/modules/update_mumble.sh
  15. 8
      lgsm/modules/update_papermc.sh
  16. 2
      lgsm/modules/update_ut99.sh
  17. 12
      linuxgsm.sh
  18. 6
      tests/tests_fctrserver.sh
  19. 6
      tests/tests_jc2server.sh
  20. 6
      tests/tests_mcserver.sh
  21. 6
      tests/tests_ts3server.sh

2
lgsm/modules/alert_gotify.sh

@ -5,7 +5,7 @@
# Website: https://linuxgsm.com
# Description: Sends Gotify alert.
functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
module_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
json=$(
cat << EOF

13
lgsm/modules/check_permissions.sh

@ -52,15 +52,9 @@ fn_check_ownership() {
fi
}
<<<<<<< HEAD:lgsm/modules/check_permissions.sh
fn_check_permissions() {
if [ -d "${modulesdir}" ]; then
if [ "$(find "${modulesdir}" -type f -not -executable | wc -l)" -ne "0" ]; then
=======
fn_check_permissions() {
if [ -d "${functionsdir}" ]; then
if [ "$(find "${functionsdir}" -type f -not -executable | wc -l)" -ne "0" ]; then
>>>>>>> develop:lgsm/functions/check_permissions.sh
fn_print_fail_nl "Permissions issues found"
fn_script_log_fatal "Permissions issues found"
fn_print_information_nl "The following files are not executable:"
@ -229,15 +223,8 @@ fn_sys_perm_error_process() {
fi
}
<<<<<<< HEAD:lgsm/modules/check_permissions.sh
# Run perm error detect & fix/alert modules on /sys directories.
## Run checks.
if [ "$(whoami)" != "root" ]; then
=======
## Run permisions checks when not root or docker.
if [ "$(whoami)" != "root" ] && [ ! -f /.dockerenv ]; then
>>>>>>> develop:lgsm/functions/check_permissions.sh
fn_check_ownership
fn_check_permissions
if [ "${commandname}" == "START" ]; then

4
lgsm/modules/command_start.sh

@ -7,12 +7,8 @@
commandname="START"
commandaction="Starting"
<<<<<<< HEAD:lgsm/modules/command_start.sh
moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
=======
functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
addtimestamp="gawk '{ print strftime(\\\"[$logtimestampformat]\\\"), \\\$0 }'"
>>>>>>> develop:lgsm/functions/command_start.sh
fn_firstcommand_set
fn_start_teamspeak3() {

57
lgsm/modules/command_update_linuxgsm.sh

@ -180,19 +180,19 @@ if [ -f "${datadir}/${distroid}-${distroversioncsv}.csv" ]; then
fi
fi
# Check and update modules.
<<<<<<< HEAD:lgsm/modules/command_update_linuxgsm.sh
if [ -n "${modulesdir}" ]; then
if [ -d "${modulesdir}" ]; then
(
cd "${modulesdir}" || exit
for modulefile in *; do
# check if module exists in the repo and remove if missing.
# commonly used if module names change.
echo -en "checking ${remotereponame} module ${modulefile}...\c"
github_fileurl_dir="lgsm/modules"
github_file_url_dir="lgsm/modules"
if [ "${remotereponame}" == "GitHub" ]; then
curl --connect-timeout 10 -IsfL "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_fileurl_dir}/${modulefile}" 1>/dev/null
curl --connect-timeout 10 -IsfL "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${modulefile}" 1> /dev/null
else
curl --connect-timeout 10 -IsfL "https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/${github_fileurl_dir}/${modulefile}" 1>/dev/null
curl --connect-timeout 10 -IsfL "https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/${github_file_url_dir}/${modulefile}" 1> /dev/null
fi
if [ $? != 0 ]; then
fn_print_error_eol_nl
@ -209,9 +209,9 @@ if [ -n "${modulesdir}" ]; then
else
# compare file
if [ "${remotereponame}" == "GitHub" ]; then
module_file_diff=$(diff "${modulesdir}/${modulefile}" <(curl --connect-timeout 10 -s "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_fileurl_dir}/${modulefile}"))
module_file_diff=$(diff "${modulesdir}/${modulefile}" <(curl --connect-timeout 10 -s "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${modulefile}"))
else
module_file_diff=$(diff "${modulesdir}/${modulefile}" <(curl --connect-timeout 10 -s "https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/${github_fileurl_dir}/${modulefile}"))
module_file_diff=$(diff "${modulesdir}/${modulefile}" <(curl --connect-timeout 10 -s "https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/${github_file_url_dir}/${modulefile}"))
fi
# results
@ -223,52 +223,7 @@ if [ -n "${modulesdir}" ]; then
else
fn_print_ok_eol_nl
fn_script_log_pass "Checking ${remotereponame} module ${modulefile}"
=======
if [ -n "${functionsdir}" ]; then
if [ -d "${functionsdir}" ]; then
(
cd "${functionsdir}" || exit
for functionfile in *; do
# check if module exists in the repo and remove if missing.
# commonly used if module names change.
echo -en "checking ${remotereponame} module ${functionfile}...\c"
github_file_url_dir="lgsm/functions"
if [ "${remotereponame}" == "GitHub" ]; then
curl --connect-timeout 10 -IsfL "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${functionfile}" 1> /dev/null
else
curl --connect-timeout 10 -IsfL "https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/${github_file_url_dir}/${functionfile}" 1> /dev/null
fi
if [ $? != 0 ]; then
fn_print_error_eol_nl
fn_script_log_error "Checking ${remotereponame} module ${functionfile}"
echo -en "removing module ${functionfile}...\c"
if ! rm -f "${functionfile:?}"; then
fn_print_fail_eol_nl
fn_script_log_fatal "Removing module ${functionfile}"
core_exit.sh
else
fn_print_ok_eol_nl
fn_script_log_pass "Removing module ${functionfile}"
fi
else
# compare file
if [ "${remotereponame}" == "GitHub" ]; then
function_file_diff=$(diff "${functionsdir}/${functionfile}" <(curl --connect-timeout 10 -s "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${functionfile}"))
else
function_file_diff=$(diff "${functionsdir}/${functionfile}" <(curl --connect-timeout 10 -s "https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/${github_file_url_dir}/${functionfile}"))
fi
# results
if [ "${function_file_diff}" != "" ]; then
fn_print_update_eol_nl
fn_script_log_update "Checking ${remotereponame} module ${functionfile}"
rm -rf "${functionsdir:?}/${functionfile}"
fn_update_function
else
fn_print_ok_eol_nl
fn_script_log_pass "Checking ${remotereponame} module ${functionfile}"
fi
>>>>>>> develop:lgsm/functions/command_update_linuxgsm.sh
fi
done
)

94
lgsm/modules/core_dl.sh

@ -456,10 +456,10 @@ fn_fetch_file() {
# GitHub file download modules.
# Used to simplify downloading specific files from GitHub.
# github_fileurl_dir: the directory of the file in the GitHub: lgsm/modules
# github_fileurl_name: the filename of the file to download from GitHub: core_messages.sh
# github_fileurl_dir: the directory of the file in the GitHub: lgsm/modules
# github_fileurl_name: the filename of the file to download from GitHub: core_messages.sh
# github_file_url_dir: the directory of the file in the GitHub: lgsm/modules
# github_file_url_name: the filename of the file to download from GitHub: core_messages.sh
# github_file_url_dir: the directory of the file in the GitHub: lgsm/modules
# github_file_url_name: the filename of the file to download from GitHub: core_messages.sh
# githuburl: the full GitHub url
# remote_fileurl: The URL of the file: http://example.com/dl/File.tar.bz2
@ -472,24 +472,24 @@ fn_fetch_file() {
# Fetches files from the Git repo.
fn_fetch_file_github() {
github_fileurl_dir="${1}"
github_fileurl_name="${2}"
github_file_url_dir="${1}"
github_file_url_name="${2}"
# For legacy versions - code can be removed at a future date
if [ "${legacymode}" == "1" ]; then
remote_fileurl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_fileurl_dir}/${github_fileurl_name}"
remote_fileurl_backup="https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/${github_fileurl_dir}/${github_fileurl_name}"
remote_fileurl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}"
remote_fileurl_backup="https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/${github_file_url_dir}/${github_file_url_name}"
# If master branch will currently running LinuxGSM version to prevent "version mixing". This is ignored if a fork.
elif [ "${githubbranch}" == "master" ] && [ "${githubuser}" == "GameServerManagers" ] && [ "${commandname}" != "UPDATE-LGSM" ]; then
remote_fileurl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${version}/${github_fileurl_dir}/${github_fileurl_name}"
remote_fileurl_backup="https://bitbucket.org/${githubuser}/${githubrepo}/raw/${version}/${github_fileurl_dir}/${github_fileurl_name}"
remote_fileurl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${version}/${github_file_url_dir}/${github_file_url_name}"
remote_fileurl_backup="https://bitbucket.org/${githubuser}/${githubrepo}/raw/${version}/${github_file_url_dir}/${github_file_url_name}"
else
remote_fileurl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_fileurl_dir}/${github_fileurl_name}"
remote_fileurl_backup="https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/${github_fileurl_dir}/${github_fileurl_name}"
remote_fileurl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}"
remote_fileurl_backup="https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/${github_file_url_dir}/${github_file_url_name}"
fi
remote_fileurl_name="GitHub"
remote_fileurl_backup_name="Bitbucket"
local_filedir="${3}"
local_filename="${github_fileurl_name}"
local_filename="${github_file_url_name}"
chmodx="${4:-0}"
run="${5:-0}"
forcedl="${6:-0}"
@ -499,31 +499,31 @@ fn_fetch_file_github() {
}
fn_check_file_github() {
github_fileurl_dir="${1}"
github_fileurl_name="${2}"
github_file_url_dir="${1}"
github_file_url_name="${2}"
if [ "${githubbranch}" == "master" ] && [ "${githubuser}" == "GameServerManagers" ] && [ "${commandname}" != "UPDATE-LGSM" ]; then
remote_fileurl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${version}/${github_fileurl_dir}/${github_fileurl_name}"
remote_fileurl_backup="https://bitbucket.org/${githubuser}/${githubrepo}/raw/${version}/${github_fileurl_dir}/${github_fileurl_name}"
remote_fileurl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${version}/${github_file_url_dir}/${github_file_url_name}"
remote_fileurl_backup="https://bitbucket.org/${githubuser}/${githubrepo}/raw/${version}/${github_file_url_dir}/${github_file_url_name}"
else
remote_fileurl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_fileurl_dir}/${github_fileurl_name}"
remote_fileurl_backup="https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/${github_fileurl_dir}/${github_fileurl_name}"
remote_fileurl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}"
remote_fileurl_backup="https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/${github_file_url_dir}/${github_file_url_name}"
fi
remote_fileurl_name="GitHub"
remote_fileurl_backup_name="Bitbucket"
fn_check_file "${remote_fileurl}" "${remote_fileurl_backup}" "${remote_fileurl_name}" "${remote_fileurl_backup_name}" "${github_fileurl_name}"
fn_check_file "${remote_fileurl}" "${remote_fileurl_backup}" "${remote_fileurl_name}" "${remote_fileurl_backup_name}" "${github_file_url_name}"
}
# Fetches config files from the Git repo.
fn_fetch_config() {
github_fileurl_dir="${1}"
github_fileurl_name="${2}"
github_file_url_dir="${1}"
github_file_url_name="${2}"
# If master branch will currently running LinuxGSM version to prevent "version mixing". This is ignored if a fork.
if [ "${githubbranch}" == "master" ] && [ "${githubuser}" == "GameServerManagers" ] && [ "${commandname}" != "UPDATE-LGSM" ]; then
remote_fileurl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${version}/${github_fileurl_dir}/${github_fileurl_name}"
remote_fileurl_backup="https://bitbucket.org/${githubuser}/${githubrepo}/raw/${version}/${github_fileurl_dir}/${github_fileurl_name}"
remote_fileurl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${version}/${github_file_url_dir}/${github_file_url_name}"
remote_fileurl_backup="https://bitbucket.org/${githubuser}/${githubrepo}/raw/${version}/${github_file_url_dir}/${github_file_url_name}"
else
remote_fileurl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_fileurl_dir}/${github_fileurl_name}"
remote_fileurl_backup="https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/${github_fileurl_dir}/${github_fileurl_name}"
remote_fileurl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}"
remote_fileurl_backup="https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/${github_file_url_dir}/${github_file_url_name}"
fi
remote_fileurl_name="GitHub"
remote_fileurl_backup_name="Bitbucket"
@ -538,29 +538,21 @@ fn_fetch_config() {
}
# Fetches modules from the Git repo during first download.
<<<<<<< HEAD:lgsm/modules/core_dl.sh
fn_fetch_module() {
github_fileurl_dir="lgsm/modules"
github_fileurl_name="${modulefile}"
# If master branch will currently running LinuxGSM version to prevent "version mixing". This is ignored if a fork.
if [ "${githubbranch}" == "master" ]&&[ "${githubuser}" == "GameServerManager" ]&&[ "${commandname}" != "UPDATE-LGSM" ]; then
=======
fn_fetch_function() {
github_fileurl_dir="lgsm/functions"
github_fileurl_name="${functionfile}"
github_file_url_dir="lgsm/modules"
github_file_url_name="${modulefile}"
# If master branch will currently running LinuxGSM version to prevent "version mixing". This is ignored if a fork.
if [ "${githubbranch}" == "master" ] && [ "${githubuser}" == "GameServerManagers" ] && [ "${commandname}" != "UPDATE-LGSM" ]; then
>>>>>>> develop:lgsm/functions/core_dl.sh
remote_fileurl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${version}/${github_fileurl_dir}/${github_fileurl_name}"
remote_fileurl_backup="https://bitbucket.org/${githubuser}/${githubrepo}/raw/${version}/${github_fileurl_dir}/${github_fileurl_name}"
remote_fileurl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${version}/${github_file_url_dir}/${github_file_url_name}"
remote_fileurl_backup="https://bitbucket.org/${githubuser}/${githubrepo}/raw/${version}/${github_file_url_dir}/${github_file_url_name}"
else
remote_fileurl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_fileurl_dir}/${github_fileurl_name}"
remote_fileurl_backup="https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/${github_fileurl_dir}/${github_fileurl_name}"
remote_fileurl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}"
remote_fileurl_backup="https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/${github_file_url_dir}/${github_file_url_name}"
fi
remote_fileurl_name="GitHub"
remote_fileurl_backup_name="Bitbucket"
local_filedir="${modulesdir}"
local_filename="${github_fileurl_name}"
local_filename="${github_file_url_name}"
chmodx="chmodx"
run="run"
forcedl="noforce"
@ -570,27 +562,21 @@ fn_fetch_function() {
}
# Fetches modules from the Git repo during update-lgsm.
<<<<<<< HEAD:lgsm/modules/core_dl.sh
fn_update_module() {
github_fileurl_dir="lgsm/modules"
github_fileurl_name="${modulefile}"
=======
fn_update_function() {
github_fileurl_dir="lgsm/functions"
github_fileurl_name="${functionfile}"
>>>>>>> develop:lgsm/functions/core_dl.sh
github_file_url_dir="lgsm/modules"
github_file_url_name="${modulefile}"
# If master branch will currently running LinuxGSM version to prevent "version mixing". This is ignored if a fork.
if [ "${githubbranch}" == "master" ] && [ "${githubuser}" == "GameServerManagers" ] && [ "${commandname}" != "UPDATE-LGSM" ]; then
remote_fileurl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${version}/${github_fileurl_dir}/${github_fileurl_name}"
remote_fileurl_backup="https://bitbucket.org/${githubuser}/${githubrepo}/raw/${version}/${github_fileurl_dir}/${github_fileurl_name}"
remote_fileurl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${version}/${github_file_url_dir}/${github_file_url_name}"
remote_fileurl_backup="https://bitbucket.org/${githubuser}/${githubrepo}/raw/${version}/${github_file_url_dir}/${github_file_url_name}"
else
remote_fileurl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_fileurl_dir}/${github_fileurl_name}"
remote_fileurl_backup="https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/${github_fileurl_dir}/${github_fileurl_name}"
remote_fileurl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}"
remote_fileurl_backup="https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/${github_file_url_dir}/${github_file_url_name}"
fi
remote_fileurl_name="GitHub"
remote_fileurl_backup_name="Bitbucket"
local_filedir="${modulesdir}"
local_filename="${github_fileurl_name}"
local_filename="${github_file_url_name}"
chmodx="chmodx"
run="norun"
forcedl="noforce"

2
lgsm/modules/core_functions.sh

@ -6,7 +6,7 @@
# 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.
functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
module_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
modulesversion="v23.2.0"

37
lgsm/modules/core_getopt.sh

@ -10,7 +10,6 @@ moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
### Define all commands here.
## User commands | Trigger commands | Description
# Standard commands.
<<<<<<< HEAD:lgsm/modules/core_getopt.sh
cmd_install=("i;install" "command_install.sh" "Install the server.")
cmd_auto_install=("ai;auto-install" "fn_autoinstall" "Install the server without prompts.")
cmd_start=("st;start" "command_start.sh" "Start the server.")
@ -23,24 +22,8 @@ cmd_update_linuxgsm=( "ul;update-lgsm;uf;update-modules" "command_update_linuxgs
cmd_test_alert=("ta;test-alert" "command_test_alert.sh" "Send a test alert.")
cmd_monitor=("m;monitor" "command_monitor.sh" "Check server status and restart if crashed.")
cmd_skeleton=("sk;skeleton" "command_skeleton.sh" "Create a skeleton directory.")
cmd_sponsor=( "do;sponsor" "command_sponsor.sh" "Donation options." )
cmd_sponso=("s;sponsor" "command_sponsor.sh" "Donation options.")
cmd_send=("sd;send" "command_send.sh" "Send command to game server console.")
=======
cmd_install=("i;install" "command_install.sh" "Install the server.")
cmd_auto_install=("ai;auto-install" "fn_autoinstall" "Install the server without prompts.")
cmd_start=("st;start" "command_start.sh" "Start the server.")
cmd_stop=("sp;stop" "command_stop.sh" "Stop the server.")
cmd_restart=("r;restart" "command_restart.sh" "Restart the server.")
cmd_details=("dt;details" "command_details.sh" "Display server information.")
cmd_postdetails=("pd;postdetails" "command_postdetails.sh" "Post details to termbin.com (removing passwords).")
cmd_backup=("b;backup" "command_backup.sh" "Create backup archives of the server.")
cmd_update_linuxgsm=("ul;update-lgsm;uf;update-functions" "command_update_linuxgsm.sh" "Check and apply any LinuxGSM updates.")
cmd_test_alert=("ta;test-alert" "command_test_alert.sh" "Send a test alert.")
cmd_monitor=("m;monitor" "command_monitor.sh" "Check server status and restart if crashed.")
cmd_skeleton=("sk;skeleton" "command_skeleton.sh" "Create a skeleton directory.")
cmd_sponsor=("s;sponsor" "command_sponsor.sh" "Donation options.")
cmd_send=("sd;send" "command_send.sh" "Send command to game server console.")
>>>>>>> develop:lgsm/functions/core_getopt.sh
# Console servers only.
cmd_console=("c;console" "command_console.sh" "Access server console.")
cmd_debug=("d;debug" "command_debug.sh" "Start server directly in your terminal.")
@ -66,7 +49,6 @@ cmd_install_dst_token=("ct;cluster-token" "install_dst_token.sh" "Configure clus
cmd_install_squad_license=("li;license" "install_squad_license.sh" "Add your Squad server license.")
cmd_fastdl=("fd;fastdl" "command_fastdl.sh" "Build a FastDL directory.")
# Dev commands.
<<<<<<< HEAD:lgsm/modules/core_getopt.sh
cmd_dev_debug=("dev;developer" "command_dev_debug.sh" "Enable developer Mode.")
cmd_dev_detect_deps=("dd;detect-deps" "command_dev_detect_deps.sh" "Detect required dependencies.")
cmd_dev_detect_glibc=("dg;detect-glibc" "command_dev_detect_glibc.sh" "Detect required glibc.")
@ -74,15 +56,6 @@ cmd_dev_detect_ldd=( "dl;detect-ldd" "command_dev_detect_ldd.sh" "Detect require
cmd_dev_query_raw=("qr;query-raw" "command_dev_query_raw.sh" "The raw output of gamedig and gsquery.")
cmd_dev_clear_modules=("cf;clear-modules" "command_dev_clear_modules.sh" "Delete the contents of the modules dir.")
=======
cmd_dev_debug=("dev;developer" "command_dev_debug.sh" "Enable developer Mode.")
cmd_dev_detect_deps=("dd;detect-deps" "command_dev_detect_deps.sh" "Detect required dependencies.")
cmd_dev_detect_glibc=("dg;detect-glibc" "command_dev_detect_glibc.sh" "Detect required glibc.")
cmd_dev_detect_ldd=("dl;detect-ldd" "command_dev_detect_ldd.sh" "Detect required dynamic dependencies.")
cmd_dev_query_raw=("qr;query-raw" "command_dev_query_raw.sh" "The raw output of gamedig and gsquery.")
cmd_dev_clear_functions=("cf;clear-functions" "command_dev_clear_functions.sh" "Delete the contents of the functions dir.")
>>>>>>> develop:lgsm/functions/core_getopt.sh
### Set specific opt here.
currentopt=("${cmd_start[@]}" "${cmd_stop[@]}" "${cmd_restart[@]}" "${cmd_monitor[@]}" "${cmd_test_alert[@]}" "${cmd_details[@]}" "${cmd_postdetails[@]}" "${cmd_skeleton[@]}")
@ -172,19 +145,11 @@ currentopt+=("${cmd_install[@]}" "${cmd_auto_install[@]}")
## Developer commands.
currentopt+=("${cmd_dev_debug[@]}")
if [ -f ".dev-debug" ]; then
<<<<<<< HEAD:lgsm/modules/core_getopt.sh
currentopt+=("${cmd_dev_detect_deps[@]}" "${cmd_dev_detect_glibc[@]}" "${cmd_dev_detect_ldd[@]}" "${cmd_dev_query_raw[@]}" "${cmd_dev_clear_modules[@]}")
fi
## Donate.
currentopt+=( "${cmd_sponsor[@]}" )
=======
currentopt+=("${cmd_dev_detect_deps[@]}" "${cmd_dev_detect_glibc[@]}" "${cmd_dev_detect_ldd[@]}" "${cmd_dev_query_raw[@]}" "${cmd_dev_clear_functions[@]}")
fi
## Sponsor.
currentopt+=("${cmd_sponsor[@]}")
>>>>>>> develop:lgsm/functions/core_getopt.sh
### Build list of available commands.
optcommands=()

5
lgsm/modules/core_legacy.sh

@ -78,7 +78,6 @@ if [ -z "${wsstartmap}" ]; then
fi
fi
<<<<<<< HEAD:lgsm/modules/core_legacy.sh
# Added as part of migrating functions dir to modules dir.
# Will remove functions dir if files in modules dir older than 14 days
functionsdir="${lgsmdir}/modules"
@ -87,10 +86,8 @@ if [ -d "${lgsmdir}/functions" ]; then
rm -rf "${lgsmdir:?}/functions"
fi
fi
fn_parms() {
=======
fn_parms() {
>>>>>>> develop:lgsm/functions/core_legacy.sh
fn_reload_startparameters
parms="${startparameters}"
}

32
lgsm/modules/core_modules.sh

@ -8,7 +8,7 @@
moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
modulesversion="v21.2.5"
modulesversion="v23.2.0"
# Core
@ -341,6 +341,16 @@ modulefile="${FUNCNAME[0]}"
fn_fetch_module
}
fix_armar.sh() {
modulefile="${FUNCNAME[0]}"
fn_fetch_module
}
fix_bt.sh() {
modulefile="${FUNCNAME[0]}"
fn_fetch_module
}
fix_bo.sh() {
modulefile="${FUNCNAME[0]}"
fn_fetch_module
@ -523,11 +533,6 @@ modulefile="${FUNCNAME[0]}"
fn_fetch_module
}
info_gamedig.sh(){
modulefile="${FUNCNAME[0]}"
fn_fetch_module
}
info_messages.sh() {
modulefile="${FUNCNAME[0]}"
fn_fetch_module
@ -575,6 +580,11 @@ modulefile="${FUNCNAME[0]}"
fn_fetch_module
}
alert_gotify.sh() {
modulefile="${FUNCNAME[0]}"
fn_fetch_module
}
alert_telegram.sh() {
modulefile="${FUNCNAME[0]}"
fn_fetch_module
@ -645,11 +655,6 @@ modulefile="${FUNCNAME[0]}"
fn_fetch_module
}
update_mumble.sh(){
modulefile="${FUNCNAME[0]}"
fn_fetch_module
}
update_mta.sh() {
modulefile="${FUNCNAME[0]}"
fn_fetch_module
@ -675,6 +680,11 @@ modulefile="${FUNCNAME[0]}"
fn_fetch_module
}
update_ut99.sh() {
modulefile="${FUNCNAME[0]}"
fn_fetch_module
}
fn_update_modules.sh() {
modulefile="${FUNCNAME[0]}"
fn_fetch_module

2
lgsm/modules/fix.sh

@ -59,7 +59,7 @@ apply_post_install_fix=(av kf kf2 lo ro samp ut2k4 ut ut3)
for fix in "${apply_pre_start_fix[@]}" "${apply_post_install_fix[@]}"; do
if ! fn_exists_fix "${fix}"; then
fn_print_fail_nl "fix_${fix}.sh is registered but doesn't exist. Typo or did you miss to modify core_functions.sh?"
exitcode 1
exitcode=1
core_exit.sh
fi
done

2
lgsm/modules/fix_armar.sh

@ -5,7 +5,7 @@
# Website: https://linuxgsm.com
# Description: Resolves an issue with Arma Reforger.
functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
module_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
# Fixes: Profile directory doesn't exist.
# Issue Link: https://feedback.bistudio.com/T164845

2
lgsm/modules/fix_bt.sh

@ -5,7 +5,7 @@
# Website: https://linuxgsm.com
# Description: Resolves an issue with Barotrauma.
functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
module_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
# Fixes: Missing user data directory error.
if [ ! -d "${XDG_DATA_HOME:="${HOME}/.local/share"}/Daedalic Entertainment GmbH/Barotrauma" ]; then

5
lgsm/modules/query_gamedig.sh

@ -6,13 +6,8 @@
# Description: Querys a gameserver using node-gamedig.
# https://github.com/sonicsnes/node-gamedig
<<<<<<< HEAD:lgsm/modules/query_gamedig.sh
moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
=======
functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
querystatus="2"
>>>>>>> develop:lgsm/functions/query_gamedig.sh
# Check if gamedig and jq are installed.
if [ "$(command -v gamedig 2> /dev/null)" ] && [ "$(command -v jq 2> /dev/null)" ]; then

143
lgsm/modules/update_mumble.sh

@ -1,143 +0,0 @@
#!/bin/bash
# LinuxGSM update_mumble.sh module
# Author: Daniel Gibbs
# Contributors: http://linuxgsm.com/contrib
# Website: https://linuxgsm.com
# Description: Handles updating of Mumble servers.
moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
fn_update_mumble_dl(){
fn_fetch_file "https://github.com/mumble-voip/mumble/releases/download/${remotebuild}/murmur-static_${mumblearch}-${remotebuild}.tar.bz2" "" "" "" "${tmpdir}" "murmur-static_${mumblearch}-${remotebuild}.tar.bz2" "" "norun" "noforce" "nohash"
fn_dl_extract "${tmpdir}" "murmur-static_${mumblearch}-${remotebuild}.tar.bz2" "${tmpdir}"
echo -e "copying to ${serverfiles}...\c"
cp -R "${tmpdir}/murmur-static_${mumblearch}-${remotebuild}/"* "${serverfiles}"
local exitcode=$?
if [ "${exitcode}" == "0" ]; then
fn_print_ok_eol_nl
fn_script_log_pass "Copying to ${serverfiles}"
fn_clear_tmp
else
fn_print_fail_eol_nl
fn_script_log_fatal "Copying to ${serverfiles}"
fn_clear_tmp
core_exit.sh
fi
}
fn_update_mumble_localbuild(){
# Gets local build info.
fn_print_dots "Checking local build: ${remotelocation}"
# Uses executable to find local build.
cd "${executabledir}" || exit
if [ -f "${executable}" ]; then
localbuild=$(${executable} -version 2>&1 >/dev/null | awk '{print $5}')
fn_print_ok "Checking local build: ${remotelocation}"
fn_script_log_pass "Checking local build"
else
localbuild="0"
fn_print_error "Checking local build: ${remotelocation}"
fn_script_log_error "Checking local build"
fi
}
fn_update_mumble_remotebuild(){
# Gets remote build info.
remotebuild=$(curl -s "https://api.github.com/repos/mumble-voip/mumble/releases/latest" | grep 'murmur-static_x86.*\.bz2"' | tail -1 | awk -F"/" '{ print $8 }')
if [ "${firstcommandname}" != "INSTALL" ]; then
fn_print_dots "Checking remote build: ${remotelocation}"
# Checks if remotebuild variable has been set.
if [ -z "${remotebuild}" ]||[ "${remotebuild}" == "null" ]; then
fn_print_fail "Checking remote build: ${remotelocation}"
fn_script_log_fatal "Checking remote build"
core_exit.sh
else
fn_print_ok "Checking remote build: ${remotelocation}"
fn_script_log_pass "Checking remote build"
fi
else
# Checks if remotebuild variable has been set.
if [ -z "${remotebuild}" ]||[ "${remotebuild}" == "null" ]; then
fn_print_failure "Unable to get remote build"
fn_script_log_fatal "Unable to get remote build"
core_exit.sh
fi
fi
}
fn_update_mumble_compare(){
# Removes dots so if statement can compare version numbers.
fn_print_dots "Checking for update: ${remotelocation}"
localbuilddigit=$(echo -e "${localbuild}" | tr -cd '[:digit:]')
remotebuilddigit=$(echo -e "${remotebuild}" | tr -cd '[:digit:]')
if [ "${localbuilddigit}" -ne "${remotebuilddigit}" ]||[ "${forceupdate}" == "1" ]; then
fn_print_ok_nl "Checking for update: ${remotelocation}"
echo -en "\n"
echo -e "Update available"
echo -e "* Local build: ${red}${localbuild} ${mumblearch}${default}"
echo -e "* Remote build: ${green}${remotebuild} ${mumblearch}${default}"
echo -en "\n"
fn_script_log_info "Update available"
fn_script_log_info "Local build: ${localbuild} ${mumblearch}"
fn_script_log_info "Remote build: ${remotebuild} ${mumblearch}"
fn_script_log_info "${localbuild} > ${remotebuild}"
unset updateonstart
check_status.sh
# If server stopped.
if [ "${status}" == "0" ]; then
exitbypass=1
fn_update_mumble_dl
if [ "${requirerestart}" == "1" ]; then
exitbypass=1
command_start.sh
fn_firstcommand_reset
exitbypass=1
command_stop.sh
fn_firstcommand_reset
fi
# If server started.
else
fn_print_restart_warning
exitbypass=1
command_stop.sh
fn_firstcommand_reset
exitbypass=1
fn_update_mumble_dl
exitbypass=1
command_start.sh
fn_firstcommand_reset
fi
unset exitbypass
date +%s > "${lockdir}/lastupdate.lock"
alert="update"
alert.sh
else
fn_print_ok_nl "Checking for update: ${remotelocation}"
echo -en "\n"
echo -e "No update available"
echo -e "* Local build: ${green}${localbuild} ${mumblearch}${default}"
echo -e "* Remote build: ${green}${remotebuild} ${mumblearch}${default}"
echo -en "\n"
fn_script_log_info "No update available"
fn_script_log_info "Local build: ${localbuild} ${mumblearch}"
fn_script_log_info "Remote build: ${remotebuild} ${mumblearch}"
fi
}
# The location where the builds are checked and downloaded.
remotelocation="mumble.info"
# Game server architecture.
mumblearch="x86"
if [ "${firstcommandname}" == "INSTALL" ]; then
fn_update_mumble_remotebuild
fn_update_mumble_dl
else
fn_print_dots "Checking for update: ${remotelocation}"
fn_script_log_info "Checking for update: ${remotelocation}"
fn_update_mumble_localbuild
fn_update_mumble_remotebuild
fn_update_mumble_compare
fi

8
lgsm/modules/update_papermc.sh

@ -5,13 +5,7 @@
# Website: https://linuxgsm.com
# Description: Handles updating of PaperMC and Waterfall servers.
<<<<<<< HEAD:lgsm/modules/update_papermc.sh
local commandname="UPDATE"
local commandaction="Update"
local module_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
=======
functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
>>>>>>> develop:lgsm/functions/update_papermc.sh
module_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
fn_update_dl() {
# Download and extract files to serverfiles

2
lgsm/modules/update_ut99.sh

@ -5,7 +5,7 @@
# Website: https://linuxgsm.com
# Description: Handles updating of Unreal Tournament 99 servers.
functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
module_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
fn_update_dl() {
# Download and extract files to serverfiles

12
linuxgsm.sh

@ -51,6 +51,12 @@ userinput2="${2}"
[ -n "${LGSM_GITHUBREPO}" ] && githubrepo="${LGSM_GITHUBREPO}" || githubrepo="LinuxGSM"
[ -n "${LGSM_GITHUBBRANCH}" ] && githubbranch="${LGSM_GITHUBBRANCH}" || githubbranch="master"
# Check that curl is installed before doing anything
if [ ! "$(command -v curl 2> /dev/null)" ]; then
echo -e "[ FAIL ] Curl is not installed"
exit 1
fi
# Core module that is required first.
core_modules.sh() {
modulefile="${FUNCNAME[0]}"
@ -166,13 +172,13 @@ fn_bootstrap_fetch_file_github() {
remote_fileurl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${version}/${github_file_url_dir}/${github_file_url_name}"
remote_fileurl_backup="https://bitbucket.org/${githubuser}/${githubrepo}/raw/${version}/${github_file_url_dir}/${github_file_url_name}"
else
remote_fileurl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_fileurl_dir}/${github_fileurl_name}"
remote_fileurl_backup="https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/${github_fileurl_dir}/${github_fileurl_name}"
remote_fileurl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}"
remote_fileurl_backup="https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/${github_file_url_dir}/${github_file_url_name}"
fi
remote_fileurl_name="GitHub"
remote_fileurl_backup_name="Bitbucket"
local_filedir="${3}"
local_filename="${github_fileurl_name}"
local_filename="${github_file_url_name}"
chmodx="${4:-0}"
run="${5:-0}"
forcedl="${6:-0}"

6
tests/tests_fctrserver.sh

@ -172,13 +172,13 @@ fn_bootstrap_fetch_file_github() {
remote_fileurl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${version}/${github_file_url_dir}/${github_file_url_name}"
remote_fileurl_backup="https://bitbucket.org/${githubuser}/${githubrepo}/raw/${version}/${github_file_url_dir}/${github_file_url_name}"
else
remote_fileurl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_fileurl_dir}/${github_fileurl_name}"
remote_fileurl_backup="https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/${github_fileurl_dir}/${github_fileurl_name}"
remote_fileurl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}"
remote_fileurl_backup="https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/${github_file_url_dir}/${github_file_url_name}"
fi
remote_fileurl_name="GitHub"
remote_fileurl_backup_name="Bitbucket"
local_filedir="${3}"
local_filename="${github_fileurl_name}"
local_filename="${github_file_url_name}"
chmodx="${4:-0}"
run="${5:-0}"
forcedl="${6:-0}"

6
tests/tests_jc2server.sh

@ -173,13 +173,13 @@ fn_bootstrap_fetch_file_github() {
remote_fileurl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${version}/${github_file_url_dir}/${github_file_url_name}"
remote_fileurl_backup="https://bitbucket.org/${githubuser}/${githubrepo}/raw/${version}/${github_file_url_dir}/${github_file_url_name}"
else
remote_fileurl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_fileurl_dir}/${github_fileurl_name}"
remote_fileurl_backup="https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/${github_fileurl_dir}/${github_fileurl_name}"
remote_fileurl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}"
remote_fileurl_backup="https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/${github_file_url_dir}/${github_file_url_name}"
fi
remote_fileurl_name="GitHub"
remote_fileurl_backup_name="Bitbucket"
local_filedir="${3}"
local_filename="${github_fileurl_name}"
local_filename="${github_file_url_name}"
chmodx="${4:-0}"
run="${5:-0}"
forcedl="${6:-0}"

6
tests/tests_mcserver.sh

@ -173,13 +173,13 @@ fn_bootstrap_fetch_file_github() {
remote_fileurl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${version}/${github_file_url_dir}/${github_file_url_name}"
remote_fileurl_backup="https://bitbucket.org/${githubuser}/${githubrepo}/raw/${version}/${github_file_url_dir}/${github_file_url_name}"
else
remote_fileurl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_fileurl_dir}/${github_fileurl_name}"
remote_fileurl_backup="https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/${github_fileurl_dir}/${github_fileurl_name}"
remote_fileurl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}"
remote_fileurl_backup="https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/${github_file_url_dir}/${github_file_url_name}"
fi
remote_fileurl_name="GitHub"
remote_fileurl_backup_name="Bitbucket"
local_filedir="${3}"
local_filename="${github_fileurl_name}"
local_filename="${github_file_url_name}"
chmodx="${4:-0}"
run="${5:-0}"
forcedl="${6:-0}"

6
tests/tests_ts3server.sh

@ -173,13 +173,13 @@ fn_bootstrap_fetch_file_github() {
remote_fileurl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${version}/${github_file_url_dir}/${github_file_url_name}"
remote_fileurl_backup="https://bitbucket.org/${githubuser}/${githubrepo}/raw/${version}/${github_file_url_dir}/${github_file_url_name}"
else
remote_fileurl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_fileurl_dir}/${github_fileurl_name}"
remote_fileurl_backup="https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/${github_fileurl_dir}/${github_fileurl_name}"
remote_fileurl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}"
remote_fileurl_backup="https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/${github_file_url_dir}/${github_file_url_name}"
fi
remote_fileurl_name="GitHub"
remote_fileurl_backup_name="Bitbucket"
local_filedir="${3}"
local_filename="${github_fileurl_name}"
local_filename="${github_file_url_name}"
chmodx="${4:-0}"
run="${5:-0}"
forcedl="${6:-0}"

Loading…
Cancel
Save