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

* standardise module identifiers
* renamed logs.sh to core_logs.sh
* improve stats log
* remove local
* functionselfname rename
This commit is contained in:
Daniel Gibbs 2020-05-03 00:02:21 +01:00 committed by GitHub
parent 0af223d436
commit 66bf5e059e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
128 changed files with 322 additions and 427 deletions

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -4,11 +4,10 @@
# Website: https://linuxgsm.com
# Description: Checks if the user tried to run the script as root.
local modulename="CHECK"
local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
if [ "$(whoami)" = "root" ]; then
if [ "${function_selfname}" != "command_install.sh" ]; then
if [ "${commandname}" != "INSTALL" ]; then
fn_print_fail_nl "Do NOT run this script as root!"
if [ -d "${lgsmlogdir}" ]; then
fn_script_log_fatal "${selfname} attempted to run as root."

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -4,9 +4,7 @@
# Website: https://linuxgsm.com
# Description: Resolves various issues with Don't Starve Together.
local modulename="FIX"
local commandaction="Fix"
local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
functionselfname="$(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).
# Issue only occures on CentOS as libcurl-gnutls.so.4 is called libcurl.so.4 on CentOS.

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -5,9 +5,7 @@
# Website: https://linuxgsm.com
# Description: Installs the libmysqlclient for database functions on the server.
local modulename="FIX"
local commandaction="Fix"
local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
if [ ! -f "${lgsmdir}/lib/libmysqlclient.so.16" ]; then
fixname="libmysqlclient16"

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -4,9 +4,7 @@
# Website: https://linuxgsm.com
# Description: Resolves various issues with Unreal Tournament 3.
local modulename="FIX"
local commandaction="Fix"
local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
fn_parms(){
parms="server VCTF-Suspense?Game=UTGameContent.UTVehicleCTFGame_Content?bIsDedicated=true?bIsLanMatch=false?bUsesStats=false?bShouldAdvertise=false?PureServer=1?bAllowJoinInProgress=true?ConfigSubDir=${selfname} -port=${port} -queryport=${queryport} -multihome=${ip} -nohomedir -unattended -log=${gamelog}"

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

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