Browse Source

module name has been split

now named
commandname and command action
command name is used in logs
command action is used on-screen.
Also alterations to function_selfname now called just selfname
pull/914/head
Daniel Gibbs 9 years ago
parent
commit
21512494fa
  1. 2
      functions/command_update_functions.sh
  2. 14
      lgsm/functions/alert.sh
  3. 5
      lgsm/functions/alert_email.sh
  4. 5
      lgsm/functions/alert_pushbullet.sh
  5. 23
      lgsm/functions/check.sh
  6. 5
      lgsm/functions/check_config.sh
  7. 14
      lgsm/functions/check_deps.sh
  8. 8
      lgsm/functions/check_glibc.sh
  9. 5
      lgsm/functions/check_ip.sh
  10. 5
      lgsm/functions/check_logs.sh
  11. 5
      lgsm/functions/check_permissions.sh
  12. 5
      lgsm/functions/check_root.sh
  13. 5
      lgsm/functions/check_status.sh
  14. 12
      lgsm/functions/check_steamcmd.sh
  15. 5
      lgsm/functions/check_system_dir.sh
  16. 5
      lgsm/functions/check_tmux.sh
  17. 5
      lgsm/functions/command_backup.sh
  18. 5
      lgsm/functions/command_console.sh
  19. 5
      lgsm/functions/command_debug.sh
  20. 5
      lgsm/functions/command_details.sh
  21. 5
      lgsm/functions/command_dev_debug.sh
  22. 5
      lgsm/functions/command_dev_detect_deps.sh
  23. 5
      lgsm/functions/command_fastdl.sh
  24. 5
      lgsm/functions/command_install.sh
  25. 5
      lgsm/functions/command_monitor.sh
  26. 5
      lgsm/functions/command_restart.sh
  27. 5
      lgsm/functions/command_start.sh
  28. 5
      lgsm/functions/command_stop.sh
  29. 5
      lgsm/functions/command_test_alert.sh
  30. 5
      lgsm/functions/command_ts3_server_pass.sh
  31. 5
      lgsm/functions/command_update.sh
  32. 4
      lgsm/functions/command_update_functions.sh
  33. 5
      lgsm/functions/command_validate.sh
  34. 4
      lgsm/functions/compress_unreal2_maps.sh
  35. 4
      lgsm/functions/compress_ut99_maps.sh
  36. 3
      lgsm/functions/core_dl.sh
  37. 12
      lgsm/functions/core_exit.sh
  38. 3
      lgsm/functions/fix.sh
  39. 3
      lgsm/functions/fix_arma3.sh
  40. 4
      lgsm/functions/fix_csgo.sh
  41. 3
      lgsm/functions/fix_dst.sh
  42. 3
      lgsm/functions/fix_glibc.sh
  43. 3
      lgsm/functions/fix_ins.sh
  44. 3
      lgsm/functions/fix_kf.sh
  45. 3
      lgsm/functions/fix_ro.sh
  46. 3
      lgsm/functions/fix_steamcmd.sh
  47. 3
      lgsm/functions/fix_ut2k4.sh
  48. 3
      lgsm/functions/fix_ut99.sh
  49. 3
      lgsm/functions/install_complete.sh
  50. 5
      lgsm/functions/install_config.sh
  51. 5
      lgsm/functions/install_gslt.sh
  52. 5
      lgsm/functions/install_gsquery.sh
  53. 5
      lgsm/functions/install_header.sh
  54. 5
      lgsm/functions/install_logs.sh
  55. 5
      lgsm/functions/install_retry.sh
  56. 5
      lgsm/functions/install_server_dir.sh
  57. 5
      lgsm/functions/install_server_files.sh
  58. 5
      lgsm/functions/install_steamcmd.sh
  59. 5
      lgsm/functions/install_ts3.sh
  60. 5
      lgsm/functions/install_ts3db.sh
  61. 5
      lgsm/functions/install_ut2k4_key.sh
  62. 8
      lgsm/functions/logs.sh
  63. 5
      lgsm/functions/monitor_gsquery.sh
  64. 5
      lgsm/functions/update_check.sh
  65. 5
      lgsm/functions/update_dl.sh
  66. 5
      lgsm/functions/update_steamcmd.sh
  67. 3
      lgsm/functions/update_ts3.sh

2
functions/command_update_functions.sh

@ -6,7 +6,7 @@ lgsm_version="210516"
# 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 function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" local selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
check.sh check.sh
fn_print_dots "Updating functions" fn_print_dots "Updating functions"
fn_script_log "Updating functions" fn_script_log "Updating functions"

14
lgsm/functions/alert.sh

@ -4,8 +4,10 @@
# Website: https://gameservermanagers.com # Website: https://gameservermanagers.com
# Description: Overall function for managing alerts. # Description: Overall function for managing alerts.
local modulename="Alert" local commandnane="ALERT"
local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" local commandaction="Alert"
# Cannot have selfname as breaks the function.
#local selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
fn_alert_test(){ fn_alert_test(){
fn_script_log_info "Sending test alert" fn_script_log_info "Sending test alert"
@ -43,20 +45,20 @@ fi
if [ "${emailnotification}" == "on" ]||[ "${emailalert}" == "on" ]&&[ -n "${email}" ]; then if [ "${emailnotification}" == "on" ]||[ "${emailalert}" == "on" ]&&[ -n "${email}" ]; then
alert_email.sh alert_email.sh
elif [ "${emailnotification}" != "on" ]||[ "${emailalert}" != "on" ]&&[ "${function_selfname}" == "command_test_alert.sh" ]; then elif [ "${emailnotification}" != "on" ]||[ "${emailalert}" != "on" ]&&[ "${selfname}" == "command_test_alert.sh" ]; then
fn_print_info_nl "Email alerts not enabled" fn_print_info_nl "Email alerts not enabled"
fn_script_log_info "Email alerts not enabled" fn_script_log_info "Email alerts not enabled"
elif [ -z "${email}" ]&&[ "${function_selfname}" == "command_test_alert.sh" ]; then elif [ -z "${email}" ]&&[ "${selfname}" == "command_test_alert.sh" ]; then
fn_print_fail_nl "Email not set" fn_print_fail_nl "Email not set"
fn_script_log "Email not set" fn_script_log "Email not set"
fi 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" ]&&[ "${selfname}" == "command_test_alert.sh" ]; then
fn_print_info_nl "Pushbullet alerts not enabled" fn_print_info_nl "Pushbullet alerts not enabled"
fn_script_log_info "Pushbullet alerts not enabled" fn_script_log_info "Pushbullet alerts not enabled"
elif [ -z "${pushbullettoken}" ]&&[ "${function_selfname}" == "command_test_alert.sh" ]; then elif [ -z "${pushbullettoken}" ]&&[ "${selfname}" == "command_test_alert.sh" ]; then
fn_print_fail_nl "Pushbullet token not set" fn_print_fail_nl "Pushbullet token not set"
fn_script_log_warn "Pushbullet token not set" fn_script_log_warn "Pushbullet token not set"
fi fi

5
lgsm/functions/alert_email.sh

@ -4,8 +4,9 @@
# Website: https://gameservermanagers.com # Website: https://gameservermanagers.com
# Description: Sends email alert if monitor picks up a failure. # Description: Sends email alert if monitor picks up a failure.
local modulename="Alert" local commandnane="ALERT"
local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" local commandaction="Alert"
local selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
fn_details_email(){ fn_details_email(){
# #

5
lgsm/functions/alert_pushbullet.sh

@ -4,8 +4,9 @@
# Website: https://gameservermanagers.com # Website: https://gameservermanagers.com
# Description: alerts using pushbullet. # Description: alerts using pushbullet.
local modulename="Alert" local commandnane="ALERT"
local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" local commandaction="Alert"
local selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
fn_print_dots "Sending Pushbullet alert" fn_print_dots "Sending Pushbullet alert"
sleep 1 sleep 1

23
lgsm/functions/check.sh

@ -6,7 +6,10 @@
# 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="Checking" local commandnane="CHECK"
local commandaction="Checking"
# Cannot have selfname as breaks the function.
#local selfname="$(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
@ -14,14 +17,14 @@ local modulename="Checking"
check_root.sh check_root.sh
check_permissions.sh check_permissions.sh
if [ "${function_selfname}" != "command_install.sh" ] && [ "${function_selfname}" != "command_update_functions.sh" ]; then if [ "${selfname}" != "command_install.sh" ] && [ "${selfname}" != "command_update_functions.sh" ]; then
check_system_dir.sh check_system_dir.sh
fi fi
local allowed_commands_array=( command_debug.sh command_start.sh command_install.sh ) local allowed_commands_array=( command_debug.sh command_start.sh command_install.sh )
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}" == "${selfname}" ]; then
check_glibc.sh check_glibc.sh
fi fi
done done
@ -29,7 +32,7 @@ done
local allowed_commands_array=( command_backup.sh command_console.sh command_debug.sh command_details.sh command_unreal2_maps.sh command_ut99_maps.sh command_monitor.sh command_start.sh command_stop.sh update_check.sh command_validate.sh command_update_functions.sh command_email_test.sh ) local allowed_commands_array=( command_backup.sh command_console.sh command_debug.sh command_details.sh command_unreal2_maps.sh command_ut99_maps.sh command_monitor.sh command_start.sh command_stop.sh update_check.sh command_validate.sh command_update_functions.sh command_email_test.sh )
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}" == "${selfname}" ]; then
check_logs.sh check_logs.sh
fi fi
done done
@ -37,7 +40,7 @@ done
local allowed_commands_array=( command_debug.sh command_start.sh command_stop.sh ) local allowed_commands_array=( command_debug.sh command_start.sh command_stop.sh )
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}" == "${selfname}" ]; then
check_deps.sh check_deps.sh
fi fi
done done
@ -45,7 +48,7 @@ done
local allowed_commands_array=( command_debug.sh command_details.sh command_monitor.sh command_start.sh command_stop.sh ) local allowed_commands_array=( command_debug.sh command_details.sh command_monitor.sh command_start.sh command_stop.sh )
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}" == "${selfname}" ]; then
check_ip.sh check_ip.sh
fi fi
done done
@ -53,7 +56,7 @@ done
local allowed_commands_array=( update_check.sh command_debug.sh command_start.sh command_validate.sh ) local allowed_commands_array=( update_check.sh command_debug.sh command_start.sh command_validate.sh )
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}" == "${selfname}" ]; then
if [ -n "${appid}" ]; then if [ -n "${appid}" ]; then
check_steamcmd.sh check_steamcmd.sh
fi fi
@ -63,7 +66,7 @@ done
local allowed_commands_array=( command_console.sh command_start.sh ) local allowed_commands_array=( command_console.sh command_start.sh )
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}" == "${selfname}" ]; then
check_tmux.sh check_tmux.sh
fi fi
done done
@ -71,7 +74,7 @@ done
local allowed_commands_array=( command_console.sh command_debug.sh command_details.sh command_monitor.sh command_start.sh command_stop.sh ) local allowed_commands_array=( command_console.sh command_debug.sh command_details.sh command_monitor.sh command_start.sh command_stop.sh )
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}" == "${selfname}" ]; then
check_config.sh check_config.sh
fi fi
done done
@ -79,7 +82,7 @@ done
local allowed_commands_array=( command_details.sh command_monitor.sh command_start.sh command_stop.sh command_ts3_server_pass.sh update_check.sh command_details.sh command_validate.sh ) local allowed_commands_array=( command_details.sh command_monitor.sh command_start.sh command_stop.sh command_ts3_server_pass.sh update_check.sh command_details.sh command_validate.sh )
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}" == "${selfname}" ]; then
check_status.sh check_status.sh
fi fi
done done

5
lgsm/functions/check_config.sh

@ -4,8 +4,9 @@
# Website: https://gameservermanagers.com # Website: https://gameservermanagers.com
# Description: If server config missing warn user. # Description: If server config missing warn user.
local modulename="Checking" local commandnane="CHECK"
local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" local commandaction="Checking"
local selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
if [ ! -e "${servercfgfullpath}" ]; then if [ ! -e "${servercfgfullpath}" ]; then
if [ "${gamename}" != "Hurtworld" ]; then if [ "${gamename}" != "Hurtworld" ]; then

14
lgsm/functions/check_deps.sh

@ -4,8 +4,10 @@
# Website: https://gameservermanagers.com # Website: https://gameservermanagers.com
# Description: Checks that the requires dependencies are installed for LGSM. # Description: Checks that the requires dependencies are installed for LGSM.
local modulename="Checking" local commandnane="CHECK"
local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" local commandaction="Checking"
# Cannot have selfname as breaks the function.
#local selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
fn_deps_detector(){ fn_deps_detector(){
# Checks if dependency is missing # Checks if dependency is missing
@ -18,14 +20,14 @@ fn_deps_detector(){
fi fi
if [ "${depstatus}" == "0" ]; then if [ "${depstatus}" == "0" ]; then
missingdep=0 missingdep=0
if [ "${function_selfname}" == "command_install.sh" ]; then if [ "${selfname}" == "command_install.sh" ]; then
echo -e "\e[0;32m${deptocheck}\e[0m" echo -e "\e[0;32m${deptocheck}\e[0m"
sleep 0.5 sleep 0.5
fi fi
else else
# if missing dependency is found # if missing dependency is found
missingdep=1 missingdep=1
if [ "${function_selfname}" == "command_install.sh" ]; then if [ "${selfname}" == "command_install.sh" ]; then
echo -e "\e[0;31m${deptocheck}\e[0m" echo -e "\e[0;31m${deptocheck}\e[0m"
sleep 0.5 sleep 0.5
fi fi
@ -97,7 +99,7 @@ fn_found_missing_deps(){
fi fi
echo "" echo ""
fi fi
if [ "${function_selfname}" == "command_install.sh" ]; then if [ "${selfname}" == "command_install.sh" ]; then
sleep 5 sleep 5
fi fi
fi fi
@ -116,7 +118,7 @@ fn_check_loop(){
info_distro.sh info_distro.sh
if [ "${function_selfname}" == "command_install.sh" ]; then if [ "${selfname}" == "command_install.sh" ]; then
echo "" echo ""
echo "Checking Dependecies" echo "Checking Dependecies"
echo "=================================" echo "================================="

8
lgsm/functions/check_glibc.sh

@ -4,8 +4,10 @@
# Website: https://gameservermanagers.com # Website: https://gameservermanagers.com
# Description: Checks if server has correct glibc or has a fix available. # Description: Checks if server has correct glibc or has a fix available.
local modulename="Checking" local commandnane="CHECK"
local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" local commandaction="Checking"
# Cannot have selfname as breaks the function.
#local selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
info_glibc.sh info_glibc.sh
info_distro.sh info_distro.sh
@ -18,7 +20,7 @@ elif [ "${glibcrequired}" == "UNKNOWN" ]; then
echo -e " * glibc installed: ${glibcversion}" echo -e " * glibc installed: ${glibcversion}"
elif [ "$(printf '%s\n'${glibcrequired}'\n' ${glibcversion} | sort -V | head -n 1)" != "${glibcrequired}" ]; then elif [ "$(printf '%s\n'${glibcrequired}'\n' ${glibcversion} | sort -V | head -n 1)" != "${glibcrequired}" ]; then
if [ "${glibcfix}" == "yes" ]; then if [ "${glibcfix}" == "yes" ]; then
if [ "${function_selfname}" != "command_install.sh" ]; then if [ "${selfname}" != "command_install.sh" ]; then
fn_print_info_nl "Glibc fix: \e[0;32mUsing Glibc fix\e[0m" fn_print_info_nl "Glibc fix: \e[0;32mUsing Glibc fix\e[0m"
echo -e " * glibc required: \e[0;31m${glibcrequired}\e[0m" echo -e " * glibc required: \e[0;31m${glibcrequired}\e[0m"
echo -e " * glibc installed: ${glibcversion}" echo -e " * glibc installed: ${glibcversion}"

5
lgsm/functions/check_ip.sh

@ -5,8 +5,9 @@
# Description: Automatically identifies the server interface IP. # Description: Automatically identifies the server interface IP.
# If multiple interfaces are detected the user will need to manualy set using ip="0.0.0.0". # If multiple interfaces are detected the user will need to manualy set using ip="0.0.0.0".
local modulename="Checking" local commandnane="CHECK"
local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" local commandaction="Checking"
local selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
if [ "${gamename}" != "Teamspeak 3" ]; then if [ "${gamename}" != "Teamspeak 3" ]; then
if [ ! -f "/bin/ip" ]; then if [ ! -f "/bin/ip" ]; then

5
lgsm/functions/check_logs.sh

@ -4,8 +4,9 @@
# Website: https://gameservermanagers.com # Website: https://gameservermanagers.com
# Description: Checks that log files exist on server start # Description: Checks that log files exist on server start
local modulename="Checking" local commandnane="CHECK"
local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" local commandaction="Checking"
local selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
# Create dir's for the script and console logs # Create dir's for the script and console logs
if [ ! -d "${scriptlogdir}" ]||[ ! -d "${consolelogdir}" ]&&[ "${gamename}" != "Teamspeak 3" ]; then if [ ! -d "${scriptlogdir}" ]||[ ! -d "${consolelogdir}" ]&&[ "${gamename}" != "Teamspeak 3" ]; then

5
lgsm/functions/check_permissions.sh

@ -5,8 +5,9 @@
# Website: https://gameservermanagers.com # Website: https://gameservermanagers.com
# Description: Checks script, files and folders ownership and permissions. # Description: Checks script, files and folders ownership and permissions.
local modulename="Checking" local commandnane="CHECK"
local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" local commandaction="Checking"
local selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
# Useful variables # Useful variables
currentuser="$(whoami)" currentuser="$(whoami)"

5
lgsm/functions/check_root.sh

@ -3,8 +3,9 @@
# Author: Daniel Gibbs # Author: Daniel Gibbs
# Website: https://gameservermanagers.com # Website: https://gameservermanagers.com
local modulename="Checking" local commandnane="CHECK"
local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" local commandaction="Checking"
local selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
if [ $(whoami) = "root" ]; then if [ $(whoami) = "root" ]; then
fn_print_fail_nl "Do NOT run this script as root!" fn_print_fail_nl "Do NOT run this script as root!"

5
lgsm/functions/check_status.sh

@ -4,8 +4,9 @@
# Website: https://gameservermanagers.com # Website: https://gameservermanagers.com
# Description: Checks the proccess status of the server. Either online or offline. # Description: Checks the proccess status of the server. Either online or offline.
local modulename="Checking" local commandnane="CHECK"
local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" local commandaction="Checking"
local selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
if [ "${gamename}" == "Teamspeak 3" ]; then if [ "${gamename}" == "Teamspeak 3" ]; then
# 1: Server is running # 1: Server is running

12
lgsm/functions/check_steamcmd.sh

@ -4,8 +4,10 @@
# Website: https://gameservermanagers.com # Website: https://gameservermanagers.com
# Description: Checks SteamCMD is installed and correct. # Description: Checks SteamCMD is installed and correct.
local modulename="Checking" local commandnane="CHECK"
local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" local commandaction="Checking"
# Cannot have selfname as breaks the function.
#local selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
fn_install_steamcmd(){ fn_install_steamcmd(){
if [ ! -d "${steamcmddir}" ]; then if [ ! -d "${steamcmddir}" ]; then
@ -44,7 +46,7 @@ fn_check_steamcmd_sh(){
# Installs if missing. # Installs if missing.
steamcmddir="${rootdir}/steamcmd" steamcmddir="${rootdir}/steamcmd"
if [ ! -f "${steamcmddir}/steamcmd.sh" ]; then if [ ! -f "${steamcmddir}/steamcmd.sh" ]; then
if [ "${function_selfname}" == "command_install.sh" ]; then if [ "${selfname}" == "command_install.sh" ]; then
fn_install_steamcmd fn_install_steamcmd
else else
fn_print_warn_nl "SteamCMD is missing" fn_print_warn_nl "SteamCMD is missing"
@ -52,14 +54,14 @@ fn_check_steamcmd_sh(){
sleep 1 sleep 1
fn_install_steamcmd fn_install_steamcmd
fi fi
elif [ "${function_selfname}" == "command_install.sh" ]; then elif [ "${selfname}" == "command_install.sh" ]; then
fn_print_infomation "SteamCMD is already installed..." fn_print_infomation "SteamCMD is already installed..."
fn_print_ok_eol_nl fn_print_ok_eol_nl
fi fi
} }
fn_check_steamcmd_guard(){ fn_check_steamcmd_guard(){
if [ "${function_selfname}" == "command_update.sh" ]||[ "${function_selfname}" == "command_validate.sh" ]; then if [ "${selfname}" == "command_update.sh" ]||[ "${selfname}" == "command_validate.sh" ]; then
# Checks that steamcmd is working correctly and will prompt Steam Guard if required. # Checks that steamcmd is working correctly and will prompt Steam Guard if required.
"${steamcmddir}"/steamcmd.sh +login "${steamuser}" "${steampass}" +quit "${steamcmddir}"/steamcmd.sh +login "${steamuser}" "${steampass}" +quit
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then

5
lgsm/functions/check_system_dir.sh

@ -3,8 +3,9 @@
# Author: Daniel Gibbs # Author: Daniel Gibbs
# Website: https://gameservermanagers.com # Website: https://gameservermanagers.com
local modulename="Checking" local commandnane="CHECK"
local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" local commandaction="Checking"
local selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
if [ ! -d "${systemdir}" ]; then if [ ! -d "${systemdir}" ]; then
fn_print_fail_nl "Cannot access ${systemdir}: No such directory" fn_print_fail_nl "Cannot access ${systemdir}: No such directory"

5
lgsm/functions/check_tmux.sh

@ -4,8 +4,9 @@
# Website: https://gameservermanagers.com # Website: https://gameservermanagers.com
# Description: Checks if tmux is installed as too many users do not RTFM or know how to use Google. # Description: Checks if tmux is installed as too many users do not RTFM or know how to use Google.
local modulename="Checking" local commandnane="CHECK"
local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" local commandaction="Checking"
local selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
if [ "$(command -v tmux)" ]||[ "$(which tmux >/dev/null 2>&1)" ]||[ -f "/usr/bin/tmux" ]||[ -f "/bin/tmux" ]; then if [ "$(command -v tmux)" ]||[ "$(which tmux >/dev/null 2>&1)" ]||[ -f "/usr/bin/tmux" ]||[ -f "/bin/tmux" ]; then
: :

5
lgsm/functions/command_backup.sh

@ -4,8 +4,9 @@
# Website: https://gameservermanagers.com # Website: https://gameservermanagers.com
# Description: Creates a .tar.gz file in the backup directory. # Description: Creates a .tar.gz file in the backup directory.
local modulename="Backup" local commandnane="BACKUP"
local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" local commandaction="Backup"
local selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
check.sh check.sh
info_distro.sh info_distro.sh

5
lgsm/functions/command_console.sh

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

5
lgsm/functions/command_debug.sh

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

5
lgsm/functions/command_details.sh

@ -4,8 +4,9 @@
# Website: https://gameservermanagers.com # Website: https://gameservermanagers.com
# Description: Displays server infomation. # Description: Displays server infomation.
local modulename="Details" local commandnane="DETAILS"
local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" local commandaction="Details"
local selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
# Standard Details # Standard Details
# This applies to all engines # This applies to all engines

5
lgsm/functions/command_dev_debug.sh

@ -4,8 +4,9 @@
# Website: https://gameservermanagers.com # Website: https://gameservermanagers.com
# Description: Dev only: enables debuging log to be saved to dev-debug.log. # Description: Dev only: enables debuging log to be saved to dev-debug.log.
local modulename="Dev Debug" local commandnane="DEV-DEBUG"
local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" local commandaction="Dev-Debug"
local selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
if [ -f ".dev-debug" ]; then if [ -f ".dev-debug" ]; then

5
lgsm/functions/command_dev_detect_deps.sh

@ -4,8 +4,9 @@
# Website: https://gameservermanagers.com # Website: https://gameservermanagers.com
# Description: Detects dependencies the server binary requires. # Description: Detects dependencies the server binary requires.
local modulename="Deps Detect" local commandnane="DEPS-DETECT"
local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" local commandaction="Deps-Detect"
local selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
check.sh check.sh
cd "${executabledir}" cd "${executabledir}"

5
lgsm/functions/command_fastdl.sh

@ -5,8 +5,9 @@
# Website: https://gameservermanagers.com # Website: https://gameservermanagers.com
# Description: Creates a FastDL folder # Description: Creates a FastDL folder
local modulename="FastDL" local commandnane="FASTDL"
local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" local commandaction="FastDL"
local selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
check.sh check.sh

5
lgsm/functions/command_install.sh

@ -4,8 +4,9 @@
# Website: https://gameservermanagers.com # Website: https://gameservermanagers.com
# Description: Overall function for the installer. # Description: Overall function for the installer.
local modulename="Install" local commandnane="INSTALL"
local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" local commandaction="Install"
local selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
check.sh check.sh
install_header.sh install_header.sh

5
lgsm/functions/command_monitor.sh

@ -5,8 +5,9 @@
# Description: Monitors server by checking for running proccesses # Description: Monitors server by checking for running proccesses
# then passes to monitor_gsquery.sh. # then passes to monitor_gsquery.sh.
local modulename="Monitor" local commandnane="MONITOR"
local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" local commandaction="Monitor"
local selfname="$(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

5
lgsm/functions/command_restart.sh

@ -4,8 +4,9 @@
# Website: https://gameservermanagers.com # Website: https://gameservermanagers.com
# Description: Starts the server. # Description: Starts the server.
local modulename="Restarting" local commandnane="RESTART"
local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" local commandaction="Restarting"
local selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
exitbypass=1 exitbypass=1
info_config.sh info_config.sh

5
lgsm/functions/command_start.sh

@ -4,8 +4,9 @@
# Website: https://gameservermanagers.com # Website: https://gameservermanagers.com
# Description: Starts the server. # Description: Starts the server.
local modulename="Starting" local commandnane="START"
local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" local commandaction="Starting"
local selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
fn_start_teamspeak3(){ fn_start_teamspeak3(){
if [ ! -e "${servercfgfullpath}" ]; then if [ ! -e "${servercfgfullpath}" ]; then

5
lgsm/functions/command_stop.sh

@ -4,8 +4,9 @@
# Website: https://gameservermanagers.com # Website: https://gameservermanagers.com
# Description: Stops the server. # Description: Stops the server.
local modulename="Stopping" local commandnane="STOP"
local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" local commandaction="Stopping"
local selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
# Attempts Graceful of source using rcon 'quit' command. # Attempts Graceful of source using rcon 'quit' command.
fn_stop_graceful_source(){ fn_stop_graceful_source(){

5
lgsm/functions/command_test_alert.sh

@ -4,8 +4,9 @@
# Website: https://gameservermanagers.com # Website: https://gameservermanagers.com
# Description: Sends a test email alert. # Description: Sends a test email alert.
local modulename="Alert" local commandnane="ALERT"
local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" local commandaction="Alert"
local selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
check.sh check.sh
info_config.sh info_config.sh

5
lgsm/functions/command_ts3_server_pass.sh

@ -5,8 +5,9 @@
# Website: https://gameservermanagers.com # Website: https://gameservermanagers.com
# Description: Changes TS3 serveradmin password # Description: Changes TS3 serveradmin password
local modulename="TS3 Change Password" local commandnane="TS3-CHANGE-PASS"
local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" local commandaction="TS3 Change Password"
local selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
fn_serveradmin_password_prompt(){ fn_serveradmin_password_prompt(){

5
lgsm/functions/command_update.sh

@ -4,8 +4,9 @@
# Website: https://gameservermanagers.com # Website: https://gameservermanagers.com
# Description: Handles updating of servers. # Description: Handles updating of servers.
local modulename="Update" local commandnane="UPDATE"
local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" local commandaction="Update"
local selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
check.sh check.sh

4
lgsm/functions/command_update_functions.sh

@ -4,8 +4,8 @@
# Website: https://gameservermanagers.com # Website: https://gameservermanagers.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 LGSM" local commandaction="Update LGSM"
local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" local selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
check.sh check.sh
fn_print_dots "Updating functions" fn_print_dots "Updating functions"
fn_script_log_info "Updating functions" fn_script_log_info "Updating functions"

5
lgsm/functions/command_validate.sh

@ -4,8 +4,9 @@
# Website: https://gameservermanagers.com # Website: https://gameservermanagers.com
# Description: Runs a server validation. # Description: Runs a server validation.
local modulename="Validate" local commandnane="VALIDATE"
local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" local commandaction="Validate"
local selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
fn_validation(){ fn_validation(){
fn_print_warn_nl "Validating may overwrite some customised files." fn_print_warn_nl "Validating may overwrite some customised files."

4
lgsm/functions/compress_unreal2_maps.sh

@ -4,8 +4,8 @@
# Website: https://gameservermanagers.com # Website: https://gameservermanagers.com
# Description: compresses unreal maps # Description: compresses unreal maps
local modulename="Unreal Map Compressor" local commandaction="Unreal Map Compressor"
local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" local selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
check.sh check.sh
clear clear

4
lgsm/functions/compress_ut99_maps.sh

@ -4,8 +4,8 @@
# Website: https://gameservermanagers.com # Website: https://gameservermanagers.com
# Description: compresses unreal maps # Description: compresses unreal maps
local modulename="Unreal Map Compressor" local commandaction="Unreal Map Compressor"
local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" local selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
check.sh check.sh
clear clear

3
lgsm/functions/core_dl.sh

@ -16,7 +16,8 @@
# fn_fetch_file "${fileurl}" "${filedir}" "${filename}" "${executecmd}" "${run}" "${force}" "${md5}" # fn_fetch_file "${fileurl}" "${filedir}" "${filename}" "${executecmd}" "${run}" "${force}" "${md5}"
# fn_fetch_file "http://example.com/file.tar.bz2" "/some/dir" "file.tar.bz2" "executecmd" "run" "force" "10cd7353aa9d758a075c600a6dd193fd" # fn_fetch_file "http://example.com/file.tar.bz2" "/some/dir" "file.tar.bz2" "executecmd" "run" "force" "10cd7353aa9d758a075c600a6dd193fd"
local modulename="Download" local commandnane="DOWNLOAD"
local commandaction="Download"
local selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" local selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
fn_dl_md5(){ fn_dl_md5(){

12
lgsm/functions/core_exit.sh

@ -7,19 +7,19 @@
fn_exit_dev_debug(){ fn_exit_dev_debug(){
if [ -f "${rootdir}/.dev-debug" ]; then if [ -f "${rootdir}/.dev-debug" ]; then
echo "" echo ""
echo "${function_selfname} exiting with code: ${exitcode}" echo "${selfname} exiting with code: ${exitcode}"
fi fi
} }
if [ -n "${exitcode}" ]&&[ "${exitcode}" != "0" ]; then if [ -n "${exitcode}" ]&&[ "${exitcode}" != "0" ]; then
if [ "${exitcode}" == "1" ]; then if [ "${exitcode}" == "1" ]; then
fn_script_log_fatal "${function_selfname} exiting with code: ${exitcode}" fn_script_log_fatal "${selfname} 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 "${selfname} 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 "${selfname} exiting with code: ${exitcode}"
else else
fn_script_log_warn "${function_selfname} exiting with code: ${exitcode}" fn_script_log_warn "${selfname} exiting with code: ${exitcode}"
fi fi
fn_exit_dev_debug fn_exit_dev_debug
# remove trap. # remove trap.
@ -29,7 +29,7 @@ elif [ -n "${exitbypass}" ]; then
unset exitbypass unset exitbypass
else else
exitcode=0 exitcode=0
fn_script_log_pass "${function_selfname} exiting with code: ${exitcode}" fn_script_log_pass "${selfname} exiting with code: ${exitcode}"
fn_exit_dev_debug fn_exit_dev_debug
# remove trap. # remove trap.
trap - INT trap - INT

3
lgsm/functions/fix.sh

@ -5,7 +5,8 @@
# 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" local commandnane="FIX"
local commandaction="Fix"
# Cannot have selfname as breaks if statements. # Cannot have selfname as breaks if statements.
#local selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" #local selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"

3
lgsm/functions/fix_arma3.sh

@ -4,7 +4,8 @@
# Website: https://gameservermanagers.com # Website: https://gameservermanagers.com
# Description: Resolves an issue with ARMA3. # Description: Resolves an issue with ARMA3.
local modulename="Fix" local commandnane="FIX"
local commandaction="Fix"
local selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" local selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
# Fixes: 20150 Segmentation fault (core dumped) error. # Fixes: 20150 Segmentation fault (core dumped) error.

4
lgsm/functions/fix_csgo.sh

@ -4,6 +4,10 @@
# Website: https://gameservermanagers.com # Website: https://gameservermanagers.com
# Description: Resolves various issues with csgo. # Description: Resolves various issues with csgo.
local commandnane="FIX"
local commandaction="Fix"
local 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 "${filesdir}/steam_appid.txt" ]; then if [ ! -f "${filesdir}/steam_appid.txt" ]; then
fixname="730 steam_appid.txt" fixname="730 steam_appid.txt"

3
lgsm/functions/fix_dst.sh

@ -4,7 +4,8 @@
# Website: https://gameservermanagers.com # Website: https://gameservermanagers.com
# Description: Resolves various issues with Dont Starve together. # Description: Resolves various issues with Dont Starve together.
local modulename="Fix" local commandnane="FIX"
local commandaction="Fix"
local selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" local 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)

3
lgsm/functions/fix_glibc.sh

@ -4,7 +4,8 @@
# Website: https://gameservermanagers.com # Website: https://gameservermanagers.com
# Description: Downloads required glibc files and applys teh glibc fix if required # Description: Downloads required glibc files and applys teh glibc fix if required
local modulename="Fix" local commandnane="FIX"
local commandaction="Fix"
local selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" local selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
local libstdc_servers_array=( "ARMA 3" "Blade Symphony" "Garry's Mod" "Just Cause 2" ) local libstdc_servers_array=( "ARMA 3" "Blade Symphony" "Garry's Mod" "Just Cause 2" )

3
lgsm/functions/fix_ins.sh

@ -4,7 +4,8 @@
# Website: https://gameservermanagers.com # Website: https://gameservermanagers.com
# Description: Resolves various issues with Insurgency. # Description: Resolves various issues with Insurgency.
local modulename="Fix" local commandnane="FIX"
local commandaction="Fix"
# Cannot have selfname as breaks if statement. # Cannot have selfname as breaks if statement.
#local selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" #local selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"

3
lgsm/functions/fix_kf.sh

@ -4,7 +4,8 @@
# Website: https://gameservermanagers.com # Website: https://gameservermanagers.com
# Description: Resolves various issues with Killing Floor. # Description: Resolves various issues with Killing Floor.
local modulename="Fix" local commandnane="FIX"
local commandaction="Fix"
local selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" local selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
echo "Applying WebAdmin ROOst.css fix." echo "Applying WebAdmin ROOst.css fix."

3
lgsm/functions/fix_ro.sh

@ -4,7 +4,8 @@
# Website: https://gameservermanagers.com # Website: https://gameservermanagers.com
# Description: Resolves various issues with Red Orchestra. # Description: Resolves various issues with Red Orchestra.
local modulename="Fix" local commandnane="FIX"
local commandaction="Fix"
local selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" local selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
echo "Applying WebAdmin ROOst.css fix." echo "Applying WebAdmin ROOst.css fix."

3
lgsm/functions/fix_steamcmd.sh

@ -4,7 +4,8 @@
# Website: https://gameservermanagers.com # Website: https://gameservermanagers.com
# Description: Resolves various issues related to steamCMD. # Description: Resolves various issues related to steamCMD.
local modulename="Fix" local commandnane="FIX"
local commandaction="Fix"
local selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" local selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
# 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.

3
lgsm/functions/fix_ut2k4.sh

@ -4,7 +4,8 @@
# Website: https://gameservermanagers.com # Website: https://gameservermanagers.com
# Description: Resolves various issues with Unreal Tournament 2004. # Description: Resolves various issues with Unreal Tournament 2004.
local modulename="Fix" local commandnane="FIX"
local commandaction="Fix"
local selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" local selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
echo "applying WebAdmin ut2003.css fix." echo "applying WebAdmin ut2003.css fix."

3
lgsm/functions/fix_ut99.sh

@ -4,7 +4,8 @@
# Website: https://gameservermanagers.com # Website: https://gameservermanagers.com
# Description: Resolves various issues with Unreal Tournament 99. # Description: Resolves various issues with Unreal Tournament 99.
local modulename="Fix" local commandnane="FIX"
local commandaction="Fix"
local selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" local selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
echo "${servercfgfullpath}" echo "${servercfgfullpath}"

3
lgsm/functions/install_complete.sh

@ -3,7 +3,8 @@
# Author: Daniel Gibbs # Author: Daniel Gibbs
# Website: https://gameservermanagers.com # Website: https://gameservermanagers.com
local modulename="Install" local commandnane="INSTALL"
local commandaction="Install"
local selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" local selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
if [ "${gamename}" == "Don't Starve Together" ]; then if [ "${gamename}" == "Don't Starve Together" ]; then

5
lgsm/functions/install_config.sh

@ -3,8 +3,9 @@
# Author: Daniel Gibbs # Author: Daniel Gibbs
# Website: https://gameservermanagers.com # Website: https://gameservermanagers.com
local modulename="Install" local commandnane="INSTALL"
local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" local commandaction="Install"
local selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
fn_defaultconfig(){ fn_defaultconfig(){
echo "creating ${servercfg} config file." echo "creating ${servercfg} config file."

5
lgsm/functions/install_gslt.sh

@ -4,8 +4,9 @@
# Website: https://gameservermanagers.com # Website: https://gameservermanagers.com
# Description: Configures GSLT. # Description: Configures GSLT.
local modulename="Install" local commandnane="INSTALL"
local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" local commandaction="Install"
local selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
echo "" echo ""
echo "Game Server Login Token" echo "Game Server Login Token"

5
lgsm/functions/install_gsquery.sh

@ -3,8 +3,9 @@
# Author: Daniel Gibbs # Author: Daniel Gibbs
# Website: https://gameservermanagers.com # Website: https://gameservermanagers.com
local modulename="Install" local commandnane="INSTALL"
local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" local commandaction="Install"
local selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
fn_dlgsquery(){ fn_dlgsquery(){
cd "${functionsdir}" cd "${functionsdir}"

5
lgsm/functions/install_header.sh

@ -3,8 +3,9 @@
# Author: Daniel Gibbs # Author: Daniel Gibbs
# Website: https://gameservermanagers.com # Website: https://gameservermanagers.com
local modulename="Install" local commandnane="INSTALL"
local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" local commandaction="Install"
local selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
clear clear
echo "=================================" echo "================================="

5
lgsm/functions/install_logs.sh

@ -3,8 +3,9 @@
# Author: Daniel Gibbs # Author: Daniel Gibbs
# Website: https://gameservermanagers.com # Website: https://gameservermanagers.com
local modulename="Install" local commandnane="INSTALL"
local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" local commandaction="Install"
local selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
if [ "${checklogs}" != "1" ]; then if [ "${checklogs}" != "1" ]; then
echo "" echo ""

5
lgsm/functions/install_retry.sh

@ -3,8 +3,9 @@
# Author: Daniel Gibbs # Author: Daniel Gibbs
# Website: https://gameservermanagers.com # Website: https://gameservermanagers.com
local modulename="Install" local commandnane="INSTALL"
local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" local commandaction="Install"
local selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
while true; do while true; do
read -e -i "y" -p "Retry install? [Y/n]" yn read -e -i "y" -p "Retry install? [Y/n]" yn

5
lgsm/functions/install_server_dir.sh

@ -3,8 +3,9 @@
# Author: Daniel Gibbs # Author: Daniel Gibbs
# Website: https://gameservermanagers.com # Website: https://gameservermanagers.com
local modulename="Install" local commandnane="INSTALL"
local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" local commandaction="Install"
local selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
echo "" echo ""
echo "Server Directory" echo "Server Directory"

5
lgsm/functions/install_server_files.sh

@ -3,8 +3,9 @@
# Author: Daniel Gibbs # Author: Daniel Gibbs
# Website: https://gameservermanagers.com # Website: https://gameservermanagers.com
local modulename="Install" local commandnane="INSTALL"
local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" local commandaction="Install"
local selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
fn_install_server_files(){ fn_install_server_files(){
if [ "${gamename}" == "Unreal Tournament 99" ]; then if [ "${gamename}" == "Unreal Tournament 99" ]; then

5
lgsm/functions/install_steamcmd.sh

@ -4,8 +4,9 @@
# Website: https://gameservermanagers.com # Website: https://gameservermanagers.com
# Description: Downloads SteamCMD on install. # Description: Downloads SteamCMD on install.
local modulename="Install" local commandnane="INSTALL"
local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" local commandaction="Install"
local selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
echo "" echo ""
echo "Installing SteamCMD" echo "Installing SteamCMD"

5
lgsm/functions/install_ts3.sh

@ -3,8 +3,9 @@
# Author: Daniel Gibbs # Author: Daniel Gibbs
# Website: https://gameservermanagers.com # Website: https://gameservermanagers.com
local modulename="Install" local commandnane="INSTALL"
local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" local commandaction="Install"
local selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
info_distro.sh info_distro.sh
# Gets the teamspeak server architecture # Gets the teamspeak server architecture

5
lgsm/functions/install_ts3db.sh

@ -4,8 +4,9 @@
# Contributor: PhilPhonic # Contributor: PhilPhonic
# Website: https://gameservermanagers.com # Website: https://gameservermanagers.com
local modulename="Install" local commandnane="INSTALL"
local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" local commandaction="Install"
local selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
fn_install_ts3db_mariadb(){ fn_install_ts3db_mariadb(){
echo "" echo ""

5
lgsm/functions/install_ut2k4_key.sh

@ -3,8 +3,9 @@
# Author: Daniel Gibbs # Author: Daniel Gibbs
# Website: https://gameservermanagers.com # Website: https://gameservermanagers.com
local modulename="Install" local commandnane="INSTALL"
local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" local commandaction="Install"
local selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
echo "" echo ""
echo "Enter ${gamename} CD Key" echo "Enter ${gamename} CD Key"

8
lgsm/functions/logs.sh

@ -5,8 +5,10 @@
# Website: https://gameservermanagers.com # Website: https://gameservermanagers.com
# Description: Acts as a log rotater, removing old logs. # Description: Acts as a log rotater, removing old logs.
local modulename="Log Manager" local commandnane="LOGS"
local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" local commandaction="Log-Manager"
# Cannot have selfname as breaks the function.
#local selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
# 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 [ -n "${consolelog}" ]; then if [ -n "${consolelog}" ]; then
@ -16,7 +18,7 @@ if [ -n "${consolelog}" ]; then
fi fi
# For games not displaying a console, and having logs into their game folder # For games not displaying a console, and having logs into their game folder
if [ "${function_selfname}" == "command_start.sh" ] && [ -n "${gamelogfile}" ]; then if [ "${selfname}" == "command_start.sh" ] && [ -n "${gamelogfile}" ]; then
if [ -n "$(find "${systemdir}" -name "gamelog*.log")" ]; then if [ -n "$(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}"

5
lgsm/functions/monitor_gsquery.sh

@ -5,8 +5,9 @@
# Description: uses gsquery.py to query the server port. # Description: uses gsquery.py to query the server port.
# Detects if the server has frozen with the proccess still running. # Detects if the server has frozen with the proccess still running.
local modulename="Monitor" local commandnane="MONITOR"
local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" local commandaction="Monitor"
local selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
# Forces legecy servers to use gsquery # Forces legecy servers to use gsquery
if [ -z "${gsquery}" ]; then if [ -z "${gsquery}" ]; then

5
lgsm/functions/update_check.sh

@ -4,8 +4,9 @@
# Website: https://gameservermanagers.com # Website: https://gameservermanagers.com
# Description: Checks if a server update is available. # Description: Checks if a server update is available.
local modulename="Update" local commandnane="UPDATE"
local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" local commandaction="Update"
local selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
### SteamCMD Update Checker ### ### SteamCMD Update Checker ###

5
lgsm/functions/update_dl.sh

@ -4,8 +4,9 @@
# Website: https://gameservermanagers.com # Website: https://gameservermanagers.com
# Description: Runs a server update. # Description: Runs a server update.
local modulename="Update" local commandnane="UPDATE"
local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" local commandaction="Update"
local selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
fn_steamcmd_dl(){ fn_steamcmd_dl(){
cd "${rootdir}" cd "${rootdir}"

5
lgsm/functions/update_steamcmd.sh

@ -4,8 +4,9 @@
# Website: https://gameservermanagers.com # Website: https://gameservermanagers.com
# Description:Handles updating using steamCMD. # Description:Handles updating using steamCMD.
local modulename="Update" local commandnane="UPDATE"
local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" local commandaction="Update"
local selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
fn_update_steamcmd_dl(){ fn_update_steamcmd_dl(){

3
lgsm/functions/update_ts3.sh

@ -4,7 +4,8 @@
# Website: https://gameservermanagers.com # Website: https://gameservermanagers.com
# Description:Handles updating of teamspeak 3 servers. # Description:Handles updating of teamspeak 3 servers.
local modulename="Update" local commandnane="UPDATE"
local commandaction="Update"
local selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))" local selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
fn_update_ts3_dl(){ fn_update_ts3_dl(){

Loading…
Cancel
Save