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

14
lgsm/functions/alert.sh

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

5
lgsm/functions/alert_email.sh

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

5
lgsm/functions/alert_pushbullet.sh

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

23
lgsm/functions/check.sh

@ -6,7 +6,10 @@
# Description: Overall function for managing checks.
# 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
# check.sh selects which checks to run by using arrays
@ -14,14 +17,14 @@ local modulename="Checking"
check_root.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
fi
local allowed_commands_array=( command_debug.sh command_start.sh command_install.sh )
for allowed_command in "${allowed_commands_array[@]}"
do
if [ "${allowed_command}" == "${function_selfname}" ]; then
if [ "${allowed_command}" == "${selfname}" ]; then
check_glibc.sh
fi
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 )
for allowed_command in "${allowed_commands_array[@]}"
do
if [ "${allowed_command}" == "${function_selfname}" ]; then
if [ "${allowed_command}" == "${selfname}" ]; then
check_logs.sh
fi
done
@ -37,7 +40,7 @@ done
local allowed_commands_array=( command_debug.sh command_start.sh command_stop.sh )
for allowed_command in "${allowed_commands_array[@]}"
do
if [ "${allowed_command}" == "${function_selfname}" ]; then
if [ "${allowed_command}" == "${selfname}" ]; then
check_deps.sh
fi
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 )
for allowed_command in "${allowed_commands_array[@]}"
do
if [ "${allowed_command}" == "${function_selfname}" ]; then
if [ "${allowed_command}" == "${selfname}" ]; then
check_ip.sh
fi
done
@ -53,7 +56,7 @@ done
local allowed_commands_array=( update_check.sh command_debug.sh command_start.sh command_validate.sh )
for allowed_command in "${allowed_commands_array[@]}"
do
if [ "${allowed_command}" == "${function_selfname}" ]; then
if [ "${allowed_command}" == "${selfname}" ]; then
if [ -n "${appid}" ]; then
check_steamcmd.sh
fi
@ -63,7 +66,7 @@ done
local allowed_commands_array=( command_console.sh command_start.sh )
for allowed_command in "${allowed_commands_array[@]}"
do
if [ "${allowed_command}" == "${function_selfname}" ]; then
if [ "${allowed_command}" == "${selfname}" ]; then
check_tmux.sh
fi
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 )
for allowed_command in "${allowed_commands_array[@]}"
do
if [ "${allowed_command}" == "${function_selfname}" ]; then
if [ "${allowed_command}" == "${selfname}" ]; then
check_config.sh
fi
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 )
for allowed_command in "${allowed_commands_array[@]}"
do
if [ "${allowed_command}" == "${function_selfname}" ]; then
if [ "${allowed_command}" == "${selfname}" ]; then
check_status.sh
fi
done

5
lgsm/functions/check_config.sh

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

14
lgsm/functions/check_deps.sh

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

8
lgsm/functions/check_glibc.sh

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

5
lgsm/functions/check_ip.sh

@ -5,8 +5,9 @@
# 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".
local modulename="Checking"
local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
local commandnane="CHECK"
local commandaction="Checking"
local selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
if [ "${gamename}" != "Teamspeak 3" ]; then
if [ ! -f "/bin/ip" ]; then

5
lgsm/functions/check_logs.sh

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

5
lgsm/functions/check_permissions.sh

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

5
lgsm/functions/check_root.sh

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

12
lgsm/functions/check_steamcmd.sh

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

5
lgsm/functions/check_system_dir.sh

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

5
lgsm/functions/check_tmux.sh

@ -4,8 +4,9 @@
# Website: https://gameservermanagers.com
# Description: Checks if tmux is installed as too many users do not RTFM or know how to use Google.
local modulename="Checking"
local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
local commandnane="CHECK"
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
:

5
lgsm/functions/command_backup.sh

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

5
lgsm/functions/command_console.sh

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

5
lgsm/functions/command_debug.sh

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

5
lgsm/functions/command_details.sh

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

5
lgsm/functions/command_dev_debug.sh

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

5
lgsm/functions/command_dev_detect_deps.sh

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

5
lgsm/functions/command_fastdl.sh

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

5
lgsm/functions/command_install.sh

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

5
lgsm/functions/command_monitor.sh

@ -5,8 +5,9 @@
# Description: Monitors server by checking for running proccesses
# then passes to monitor_gsquery.sh.
local modulename="Monitor"
local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
local commandnane="MONITOR"
local commandaction="Monitor"
local selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
fn_monitor_check_lockfile(){
# Monitor does not run it lockfile is not found

5
lgsm/functions/command_restart.sh

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

5
lgsm/functions/command_start.sh

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

5
lgsm/functions/command_stop.sh

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

5
lgsm/functions/command_test_alert.sh

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

5
lgsm/functions/command_ts3_server_pass.sh

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

5
lgsm/functions/command_update.sh

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

4
lgsm/functions/command_update_functions.sh

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

5
lgsm/functions/command_validate.sh

@ -4,8 +4,9 @@
# Website: https://gameservermanagers.com
# Description: Runs a server validation.
local modulename="Validate"
local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
local commandnane="VALIDATE"
local commandaction="Validate"
local selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
fn_validation(){
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
# Description: compresses unreal maps
local modulename="Unreal Map Compressor"
local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
local commandaction="Unreal Map Compressor"
local selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
check.sh
clear

4
lgsm/functions/compress_ut99_maps.sh

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

3
lgsm/functions/core_dl.sh

@ -16,7 +16,8 @@
# 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"
local modulename="Download"
local commandnane="DOWNLOAD"
local commandaction="Download"
local selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
fn_dl_md5(){

12
lgsm/functions/core_exit.sh

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

3
lgsm/functions/fix.sh

@ -5,7 +5,8 @@
# Description: Overall function for managing fixes.
# Runs functions that will fix an issue.
local modulename="Fix"
local commandnane="FIX"
local commandaction="Fix"
# Cannot have selfname as breaks if statements.
#local selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"

3
lgsm/functions/fix_arma3.sh

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

4
lgsm/functions/fix_csgo.sh

@ -4,6 +4,10 @@
# Website: https://gameservermanagers.com
# 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.
if [ ! -f "${filesdir}/steam_appid.txt" ]; then
fixname="730 steam_appid.txt"

3
lgsm/functions/fix_dst.sh

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

3
lgsm/functions/fix_kf.sh

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

3
lgsm/functions/fix_ro.sh

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

3
lgsm/functions/fix_steamcmd.sh

@ -4,7 +4,8 @@
# Website: https://gameservermanagers.com
# Description: Resolves various issues related to steamCMD.
local modulename="Fix"
local commandnane="FIX"
local commandaction="Fix"
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.

3
lgsm/functions/fix_ut2k4.sh

@ -4,7 +4,8 @@
# Website: https://gameservermanagers.com
# 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]}"))"
echo "applying WebAdmin ut2003.css fix."

3
lgsm/functions/fix_ut99.sh

@ -4,7 +4,8 @@
# Website: https://gameservermanagers.com
# 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]}"))"
echo "${servercfgfullpath}"

3
lgsm/functions/install_complete.sh

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

5
lgsm/functions/install_config.sh

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

5
lgsm/functions/install_gslt.sh

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

5
lgsm/functions/install_gsquery.sh

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

5
lgsm/functions/install_header.sh

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

5
lgsm/functions/install_logs.sh

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

5
lgsm/functions/install_retry.sh

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

5
lgsm/functions/install_server_dir.sh

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

5
lgsm/functions/install_server_files.sh

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

5
lgsm/functions/install_steamcmd.sh

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

5
lgsm/functions/install_ts3.sh

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

5
lgsm/functions/install_ts3db.sh

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

5
lgsm/functions/install_ut2k4_key.sh

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

8
lgsm/functions/logs.sh

@ -5,8 +5,10 @@
# Website: https://gameservermanagers.com
# Description: Acts as a log rotater, removing old logs.
local modulename="Log Manager"
local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
local commandnane="LOGS"
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
if [ -n "${consolelog}" ]; then
@ -16,7 +18,7 @@ if [ -n "${consolelog}" ]; then
fi
# 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
fn_print_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.
# Detects if the server has frozen with the proccess still running.
local modulename="Monitor"
local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
local commandnane="MONITOR"
local commandaction="Monitor"
local selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
# Forces legecy servers to use gsquery
if [ -z "${gsquery}" ]; then

5
lgsm/functions/update_check.sh

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

5
lgsm/functions/update_dl.sh

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

5
lgsm/functions/update_steamcmd.sh

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

3
lgsm/functions/update_ts3.sh

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

Loading…
Cancel
Save