Browse Source

Merge branch 'release/171014'

pull/1652/head 171014
Daniel Gibbs 8 years ago
parent
commit
d41727fbe3
  1. 26
      .travis.yml
  2. 19
      lgsm/config-default/config-lgsm/ricochetserver/_default.cfg
  3. 107
      lgsm/config-default/config-lgsm/sampserver/_default.cfg
  4. 1
      lgsm/data/serverlist.csv
  5. 2
      lgsm/functions/alert_email.sh
  6. 2
      lgsm/functions/alert_ifttt.sh
  7. 2
      lgsm/functions/alert_mailgun.sh
  8. 2
      lgsm/functions/alert_pushbullet.sh
  9. 2
      lgsm/functions/alert_pushover.sh
  10. 2
      lgsm/functions/alert_telegram.sh
  11. 4
      lgsm/functions/check_config.sh
  12. 13
      lgsm/functions/check_deps.sh
  13. 2
      lgsm/functions/check_executable.sh
  14. 2
      lgsm/functions/check_ip.sh
  15. 2
      lgsm/functions/check_logs.sh
  16. 2
      lgsm/functions/check_root.sh
  17. 2
      lgsm/functions/check_status.sh
  18. 2
      lgsm/functions/check_system_dir.sh
  19. 2
      lgsm/functions/check_system_requirements.sh
  20. 2
      lgsm/functions/command_backup.sh
  21. 2
      lgsm/functions/command_console.sh
  22. 2
      lgsm/functions/command_debug.sh
  23. 2
      lgsm/functions/command_details.sh
  24. 2
      lgsm/functions/command_dev_debug.sh
  25. 2
      lgsm/functions/command_dev_detect_deps.sh
  26. 2
      lgsm/functions/command_dev_detect_glibc.sh
  27. 12
      lgsm/functions/command_dev_detect_ldd.sh
  28. 2
      lgsm/functions/command_fastdl.sh
  29. 4
      lgsm/functions/command_install.sh
  30. 2
      lgsm/functions/command_install_resources_mta.sh
  31. 2
      lgsm/functions/command_mods_install.sh
  32. 2
      lgsm/functions/command_mods_remove.sh
  33. 2
      lgsm/functions/command_mods_update.sh
  34. 11
      lgsm/functions/command_monitor.sh
  35. 2
      lgsm/functions/command_postdetails.sh
  36. 2
      lgsm/functions/command_restart.sh
  37. 65
      lgsm/functions/command_start.sh
  38. 125
      lgsm/functions/command_stop.sh
  39. 2
      lgsm/functions/command_test_alert.sh
  40. 2
      lgsm/functions/command_ts3_server_pass.sh
  41. 2
      lgsm/functions/command_update.sh
  42. 2
      lgsm/functions/command_update_linuxgsm.sh
  43. 2
      lgsm/functions/command_validate.sh
  44. 2
      lgsm/functions/command_wipe.sh
  45. 2
      lgsm/functions/compress_unreal2_maps.sh
  46. 2
      lgsm/functions/compress_ut99_maps.sh
  47. 2
      lgsm/functions/core_dl.sh
  48. 5
      lgsm/functions/core_functions.sh
  49. 4
      lgsm/functions/core_getopt.sh
  50. 16
      lgsm/functions/fix.sh
  51. 2
      lgsm/functions/fix_arma3.sh
  52. 2
      lgsm/functions/fix_csgo.sh
  53. 2
      lgsm/functions/fix_dst.sh
  54. 2
      lgsm/functions/fix_glibc.sh
  55. 2
      lgsm/functions/fix_kf.sh
  56. 20
      lgsm/functions/fix_kf2.sh
  57. 2
      lgsm/functions/fix_mta.sh
  58. 2
      lgsm/functions/fix_ro.sh
  59. 2
      lgsm/functions/fix_steamcmd.sh
  60. 2
      lgsm/functions/fix_ut.sh
  61. 2
      lgsm/functions/fix_ut2k4.sh
  62. 2
      lgsm/functions/gsquery.py
  63. 33
      lgsm/functions/info_config.sh
  64. 6
      lgsm/functions/info_distro.sh
  65. 5
      lgsm/functions/info_glibc.sh
  66. 22
      lgsm/functions/info_messages.sh
  67. 2
      lgsm/functions/info_parms.sh
  68. 2
      lgsm/functions/install_complete.sh
  69. 24
      lgsm/functions/install_config.sh
  70. 2
      lgsm/functions/install_dst_token.sh
  71. 2
      lgsm/functions/install_gslt.sh
  72. 2
      lgsm/functions/install_header.sh
  73. 2
      lgsm/functions/install_logs.sh
  74. 2
      lgsm/functions/install_mta_resources.sh
  75. 2
      lgsm/functions/install_retry.sh
  76. 2
      lgsm/functions/install_server_dir.sh
  77. 4
      lgsm/functions/install_server_files.sh
  78. 2
      lgsm/functions/install_squad_license.sh
  79. 2
      lgsm/functions/install_ts3db.sh
  80. 2
      lgsm/functions/install_ut2k4_key.sh
  81. 2
      lgsm/functions/logs.sh
  82. 2
      lgsm/functions/mods_core.sh
  83. 2
      lgsm/functions/mods_list.sh
  84. 2
      lgsm/functions/monitor_gsquery.sh
  85. 2
      lgsm/functions/update_factorio.sh
  86. 2
      lgsm/functions/update_minecraft.sh
  87. 2
      lgsm/functions/update_mta.sh
  88. 2
      lgsm/functions/update_mumble.sh
  89. 4
      lgsm/functions/update_steamcmd.sh
  90. 2
      lgsm/functions/update_ts3.sh
  91. 8
      linuxgsm.sh
  92. 82
      tests/tests_jc2server.sh
  93. 83
      tests/tests_ts3server.sh

26
.travis.yml

@ -11,14 +11,26 @@ addons:
sources:
- ubuntu-toolchain-r-test
packages:
- tmux
- mailutils
- postfix
- lib32gcc1
- libstdc++6
- libstdc++6:i386
- telnet
- expect
- postfix
- curl
- wget
- file
- bzip2
- gzip
- unzip
- bsdmainutils
- python
- util-linux
- ca-certificates
- binutils
- bc
- tmux
- lib32gcc1
- libstdc++6
- libstdc++6:i386
- net-tools
- iproute2
script:

19
lgsm/config-default/config-lgsm/ricochetserver/_default.cfg

@ -20,25 +20,6 @@ fn_parms(){
parms="-game ricochet -strictportbind +ip ${ip} -port ${port} +clientport ${clientport} +map ${defaultmap} -maxplayers ${maxplayers}"
}
##########################
######## Settings ########
##########################
#### Server Settings ####
## Server Start Settings | https://github.com/GameServerManagers/LinuxGSM/wiki/Start-Parameters
ip="0.0.0.0"
## Optional: Game Server Login Token
# GSLT can be used for running a public server.
# More info: https://gameservermanagers.com/gslt
gslt=""
## Server Start Command | https://github.com/GameServerManagers/LinuxGSM/wiki/Start-Parameters#additional-parameters
fn_parms(){
parms=""
}
#### LinuxGSM Settings ####
## Notification Alerts

107
lgsm/config-default/config-lgsm/sampserver/_default.cfg

@ -0,0 +1,107 @@
##################################
######## Default Settings ########
##################################
# DO NOT EDIT WILL BE OVERWRITTEN!
# Copy settings from here and use them in either
# common.cfg - applies settings to every instance
# [instance].cfg - applies settings to a specific instance
#### Server Settings ####
## Server Start Settings | https://github.com/GameServerManagers/LinuxGSM/wiki/Start-Parameters
ip="0.0.0.0"
port="7777"
## Server Start Command | https://github.com/GameServerManagers/LinuxGSM/wiki/Start-Parameters#additional-parameters
fn_parms(){
parms=""
}
#### LinuxGSM Settings ####
## Notification Alerts
# (on|off)
# More info | https://github.com/GameServerManagers/LinuxGSM/wiki/Alerts#more-info
postalert="off"
postdays="7"
posttarget="https://hastebin.com"
# Discord Alerts | https://github.com/GameServerManagers/LinuxGSM/wiki/Discord
discordalert="off"
discordwebhook="webhook"
# Email Alerts | https://github.com/GameServerManagers/LinuxGSM/wiki/Email
emailalert="off"
email="[email protected]"
emailfrom=""
# IFTTT Alerts | https://github.com/GameServerManagers/LinuxGSM/wiki/IFTTT
iftttalert="off"
ifttttoken="accesstoken"
iftttevent="linuxgsm_alert"
# Mailgun Email Alerts | https://github.com/GameServerManagers/LinuxGSM/wiki/mailgun
mailgunalert="off"
mailguntoken="accesstoken"
mailgundomain="example.com"
mailgunemailfrom="[email protected]"
mailgunemail="[email protected]"
# Pushbullet Alerts | https://github.com/GameServerManagers/LinuxGSM/wiki/Pushbullet
pushbulletalert="off"
pushbullettoken="accesstoken"
channeltag=""
# Pushover Alerts | https://github.com/GameServerManagers/LinuxGSM/wiki/Pushover
pushoveralert="off"
pushovertoken="accesstoken"
# Telegram Alerts | https://github.com/GameServerManagers/LinuxGSM/wiki/Telegram
telegramalert="off"
telegramtoken="accesstoken"
telegramchatid=""
## Backup | https://github.com/GameServerManagers/LinuxGSM/wiki/Backup
maxbackups="4"
maxbackupdays="30"
stoponbackup="on"
## Logging | https://github.com/GameServerManagers/LinuxGSM/wiki/Logging
consolelogging="on"
logdays="7"
#### LinuxGSM Advanced Settings ####
## LinuxGSM Server Details
# Do not edit
gamename="San Andreas Multiplayer"
engine="renderware"
#### Directories ####
# Edit with care
## Server Specific Directories
systemdir="${serverfiles}"
executabledir="${systemdir}/samp03"
executable="./samp03svr"
servercfg="server.cfg"
servercfgdir="${systemdir}/samp03"
servercfgfullpath="${servercfgdir}/${servercfg}"
## Backup Directory
backupdir="${rootdir}/backups"
## Logging Directories
logdir="${rootdir}/log"
gamelogdir="${serverfiles}/samp03"
lgsmlogdir="${logdir}/script"
consolelogdir="${logdir}/console"
lgsmlog="${lgsmlogdir}/${servicename}-script.log"
consolelog="${consolelogdir}/${servicename}-console.log"
alertlog="${lgsmlogdir}/${servicename}-alert.log"
postdetailslog="${lgsmlogdir}/${servicename}-postdetails.log"
## Logs Naming
lgsmlogdate="${lgsmlogdir}/${servicename}-script-$(date '+%Y-%m-%d-%H:%M:%S').log"
consolelogdate="${consolelogdir}/${servicename}-console-$(date '+%Y-%m-%d-%H:%M:%S').log"

1
lgsm/data/serverlist.csv

@ -54,6 +54,7 @@ qw,qwserver,Quake World
ro,roserver,Red Orchestra: Ostfront 41-45
ricochet,ricochetserver,Ricochet
rust,rustserver,Rust
samp,sampserver,San Andreas Multiplayer
ss3,ss3server,Serious Sam 3: BFE
sb,sbserver,Starbound
squad,squadserver,Squad

1 arma3 arma3server ARMA 3
54 ro roserver Red Orchestra: Ostfront 41-45
55 ricochet ricochetserver Ricochet
56 rust rustserver Rust
57 samp sampserver San Andreas Multiplayer
58 ss3 ss3server Serious Sam 3: BFE
59 sb sbserver Starbound
60 squad squadserver Squad

2
lgsm/functions/alert_email.sh

@ -6,7 +6,7 @@
local commandname="ALERT"
local commandaction="Alert"
local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
fn_print_dots "Sending Email alert: ${email}"
sleep 0.5

2
lgsm/functions/alert_ifttt.sh

@ -6,7 +6,7 @@
local commandname="ALERT"
local commandaction="Alert"
local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
json=$(cat <<EOF
{

2
lgsm/functions/alert_mailgun.sh

@ -6,7 +6,7 @@
local commandname="ALERT"
local commandaction="Alert"
local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
fn_print_dots "Sending Email alert: Mailgun: ${email}"
sleep 0.5

2
lgsm/functions/alert_pushbullet.sh

@ -6,7 +6,7 @@
local commandname="ALERT"
local commandaction="Alert"
local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
json=$(cat <<EOF
{

2
lgsm/functions/alert_pushover.sh

@ -6,7 +6,7 @@
local commandname="ALERT"
local commandaction="Alert"
local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
fn_print_dots "Sending Pushover alert"
sleep 0.5

2
lgsm/functions/alert_telegram.sh

@ -6,7 +6,7 @@
local commandname="ALERT"
local commandaction="Alert"
local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
json=$(cat <<EOF
{

4
lgsm/functions/check_config.sh

@ -5,10 +5,10 @@
# Description: Checks if the server config is missing and warns the user if needed.
local commandname="CHECK"
local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
if [ ! -e "${servercfgfullpath}" ]; then
if [ "${gamename}" != "Hurtworld" ]||[ "${shortname}" != "ut3" ]||[ "${shortname}" != "kf2" ]; then
if [ "${gamename}" != "Hurtworld" ]&&[ "${shortname}" != "ut3" ]&&[ "${shortname}" != "kf2" ]; then
fn_print_dots ""
sleep 0.5
fn_print_warn_nl "Configuration file missing!"

13
lgsm/functions/check_deps.sh

@ -19,7 +19,7 @@ fn_deps_detector(){
deptocheck="${javaversion}"
unset javacheck
elif [ -n "$(command -v apt-get 2>/dev/null)" ]; then
dpkg-query -W -f='${Status}' ${deptocheck} 2>/dev/null | grep -q -P '^install ok installed$'
dpkg-query -W -f='${Status}' ${deptocheck} 2>/dev/null | grep -q -P '^install ok installed'
depstatus=$?
elif [ -n "$(command -v yum 2>/dev/null)" ]; then
yum -q list installed ${deptocheck} > /dev/null 2>&1
@ -145,7 +145,7 @@ if [ -n "$(command -v dpkg-query 2>/dev/null)" ]; then
array_deps_missing=()
# LinuxGSM requirements
array_deps_required=( curl wget ca-certificates file bsdmainutils util-linux python bzip2 gzip unzip binutils )
array_deps_required=( curl wget ca-certificates file bsdmainutils util-linux python bzip2 gzip unzip binutils bc )
# All servers except ts3 require tmux
if [ "${gamename}" != "TeamSpeak 3" ]; then
@ -195,6 +195,9 @@ if [ -n "$(command -v dpkg-query 2>/dev/null)" ]; then
# Factorio
elif [ "${gamename}" == "Factorio" ]; then
array_deps_required+=( xz-utils )
# Hurtword/Rust
elif [ "${gamename}" == "Hurtword" ]||[ "${gamename}" == "Rust" ]; then
array_deps_required+=( lib32z1 )
# Project Zomboid and Minecraft
elif [ "${engine}" == "projectzomboid" ]||[ "${engine}" == "lwjgl2" ]; then
javaversion=$(java -version 2>&1 | grep "version")
@ -231,9 +234,9 @@ elif [ -n "$(command -v yum 2>/dev/null)" ]; then
# LinuxGSM requirements
if [ "${distroversion}" == "6" ]; then
array_deps_required=( curl wget util-linux-ng python file gzip bzip2 unzip )
array_deps_required=( curl wget util-linux-ng python file gzip bzip2 unzip binutils bc )
else
array_deps_required=( curl wget util-linux python file gzip bzip2 unzip )
array_deps_required=( curl wget util-linux python file gzip bzip2 unzip binutils bc )
fi
# All servers except ts3 require tmux
@ -276,6 +279,8 @@ elif [ -n "$(command -v yum 2>/dev/null)" ]; then
# Factorio
elif [ "${gamename}" == "Factorio" ]; then
array_deps_required+=( xz )
elif [ "${gamename}" == "Hurtword" ]||[ "${gamename}" == "Rust" ]; then
array_deps_required+=( zlib-devel )
# Project Zomboid and Minecraft
elif [ "${engine}" == "projectzomboid" ]||[ "${engine}" == "lwjgl2" ]; then
javaversion=$(java -version 2>&1 | grep "version")

2
lgsm/functions/check_executable.sh

@ -5,7 +5,7 @@
# Description: Checks if executable exists.
local commandname="CHECK"
local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
# Check if executable exists
if [ ! -f "${executabledir}/${execname}" ]; then

2
lgsm/functions/check_ip.sh

@ -6,7 +6,7 @@
# If multiple interfaces are detected the user will need to manually set using ip="0.0.0.0".
local commandname="CHECK"
local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
if [ "${gamename}" != "TeamSpeak 3" ]&&[ "${gamename}" != "Mumble" ]&&[ "${travistest}" != "1" ]; then
if [ ! -f "/bin/ip" ]; then

2
lgsm/functions/check_logs.sh

@ -5,7 +5,7 @@
# Description: Checks if log files exist.
local commandname="CHECK"
local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
fn_check_logs(){
fn_print_dots "Checking for log files"

2
lgsm/functions/check_root.sh

@ -5,7 +5,7 @@
# Description: Checks if the user tried to run the script as root.
local commandname="CHECK"
local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
if [ $(whoami) = "root" ]; then
fn_print_fail_nl "Do NOT run this script as root!"

2
lgsm/functions/check_status.sh

@ -6,7 +6,7 @@
# Description: Checks the process status of the server. Either online or offline.
local commandname="CHECK"
local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
if [ "${gamename}" == "TeamSpeak 3" ]; then
# 1: Server is running

2
lgsm/functions/check_system_dir.sh

@ -5,7 +5,7 @@
# Description: Checks if systemdir/serverfiles is accessible.
local commandname="CHECK"
local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
if [ "${function_selfname}" != "command_validate.sh" ]; then
checkdir="${serverfiles}"

2
lgsm/functions/check_system_requirements.sh

@ -6,7 +6,7 @@
# Description: Checks RAM requirements
local commandname="CHECK"
local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
info_distro.sh

2
lgsm/functions/command_backup.sh

@ -7,7 +7,7 @@
local commandname="BACKUP"
local commandaction="Backup"
local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
check.sh

2
lgsm/functions/command_console.sh

@ -6,7 +6,7 @@
local commandname="CONSOLE"
local commandaction="Console"
local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
check.sh
fn_print_header

2
lgsm/functions/command_debug.sh

@ -6,7 +6,7 @@
local commandname="DEBUG"
local commandaction="Debug"
local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
# Trap to remove lockfile on quit.
fn_lockfile_trap(){

2
lgsm/functions/command_details.sh

@ -7,7 +7,7 @@
local commandname="DETAILS"
local commandaction="Details"
local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
# Run checks and gathers details to display.
check.sh

2
lgsm/functions/command_dev_debug.sh

@ -6,7 +6,7 @@
local commandname="DEV-DEBUG"
local commandaction="Dev-Debug"
local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
if [ -f "${rootdir}/.dev-debug" ]; then
rm "${rootdir}/.dev-debug"

2
lgsm/functions/command_dev_detect_deps.sh

@ -6,7 +6,7 @@
local commandname="DEPS-DETECT"
local commandaction="Deps-Detect"
local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
echo "================================="
echo "Dependencies Checker"

2
lgsm/functions/command_dev_detect_glibc.sh

@ -16,7 +16,7 @@ if [ -z "$(command -v objdump)" ]; then
fi
if [ -z "${serverfiles}" ]; then
dir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))"
dir="$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")"
fi
if [ -d "${serverfiles}" ]; then

12
lgsm/functions/command_dev_detect_ldd.sh

@ -10,7 +10,7 @@ echo "Shared Object dependencies Checker"
echo "================================="
if [ -z "${serverfiles}" ]; then
dir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))"
dir="$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")"
fi
if [ -d "${serverfiles}" ]; then
@ -26,13 +26,13 @@ files=$(find "${serverfiles}" | wc -l)
find "${serverfiles}" -type f -print0 |
while IFS= read -r -d $'\0' line; do
#ldd -v $line 2>/dev/null|grep "=>" >>"${tmpdir}/detect_ldd.tmp"
if [ -n "$(ldd $line 2>/dev/null |grep -v "not a dynamic executable")" ]; then
echo "$line" >> "${tmpdir}/detect_ldd.tmp"
ldd $line 2>/dev/null |grep -v "not a dynamic executable" >> "${tmpdir}/detect_ldd.tmp"
if [ -n "$(ldd ${line} 2>/dev/null |grep -v "not a dynamic executable")" ]; then
echo "${line}" >> "${tmpdir}/detect_ldd.tmp"
ldd "${line}" 2>/dev/null |grep -v "not a dynamic executable" >> "${tmpdir}/detect_ldd.tmp"
if [ -n "$(ldd $line 2>/dev/null |grep -v "not a dynamic executable"|grep "not found")" ]; then
echo "$line" >> "${tmpdir}/detect_ldd_not_found.tmp"
ldd $line 2>/dev/null |grep -v "not a dynamic executable"|grep "not found" >> "${tmpdir}/detect_ldd_not_found.tmp"
echo "${line}" >> "${tmpdir}/detect_ldd_not_found.tmp"
ldd "${line}" 2>/dev/null |grep -v "not a dynamic executable"|grep "not found" >> "${tmpdir}/detect_ldd_not_found.tmp"
fi
fi
echo -n "$i / $files" $'\r'

2
lgsm/functions/command_fastdl.sh

@ -7,7 +7,7 @@
local commandname="FASTDL"
local commandaction="FastDL"
local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
check.sh

4
lgsm/functions/command_install.sh

@ -7,7 +7,7 @@
local commandname="INSTALL"
local commandaction="Install"
local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
check.sh
install_header.sh
@ -19,7 +19,7 @@ installflag=1
if [ "${gamename}" == "Unreal Tournament 2004" ]; then
install_server_files.sh
install_ut2k4_key.sh
elif [ "${gamename}" == "Battlefield: 1942" ]||[ "${gamename}" == "Call of Duty" ]||[ "${gamename}" == "Call of Duty: United Offensive" ]||[ "${gamename}" == "Call of Duty 2" ]||[ "${gamename}" == "Call of Duty 4" ]||[ "${gamename}" == "Call of Duty: World at War" ]||[ "${gamename}" == "Factorio" ]||[ "${gamename}" == "Minecraft" ]||[ "${gamename}" == "Multi Theft Auto" ]||[ "${gamename}" == "Quake 2" ]||[ "${gamename}" == "Quake 3: Arena" ]||[ "${gamename}" == "QuakeWorld" ]||[ "${gamename}" == "Unreal Tournament 99" ]||[ "${gamename}" == "Unreal Tournament" ]||[ "${gamename}" == "Unreal Tournament 3" ]||[ "${gamename}" == "TeamSpeak 3" ]||[ "${gamename}" == "Mumble" ]||[ "${gamename}" == "Wolfenstein: Enemy Territory" ]; then
elif [ -z "${appid}" ]; then
installer=1
install_server_files.sh
elif [ -n "${appid}" ]; then

2
lgsm/functions/command_install_resources_mta.sh

@ -6,7 +6,7 @@
local commandname="DEFAULT_RESOURCES"
local commandaction="Default Resources"
local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
fn_install_resources(){
echo ""

2
lgsm/functions/command_mods_install.sh

@ -7,7 +7,7 @@
local commandname="MODS"
local commandaction="addons/mods"
local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
check.sh
mods_core.sh

2
lgsm/functions/command_mods_remove.sh

@ -7,7 +7,7 @@
local commandname="MODS"
local commandaction="addons/mods"
local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
check.sh
mods_core.sh

2
lgsm/functions/command_mods_update.sh

@ -7,7 +7,7 @@
local commandname="MODS"
local commandaction="Mods Update"
local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
check.sh
mods_core.sh

11
lgsm/functions/command_monitor.sh

@ -8,7 +8,7 @@
local commandname="MONITOR"
local commandaction="Monitor"
local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
fn_monitor_check_lockfile(){
# Monitor does not run it lockfile is not found
@ -79,10 +79,15 @@ fn_monitor_tmux(){
fn_print_ok_eol_nl
fn_script_log_pass "Checking session: OK"
# runs gsquery check on game with specific engines.
local allowed_engines_array=( avalanche goldsource idtech3 idtech3_ql iw2.0 iw3.0 madness quake refractor realvirtuality source spark unity3d unreal unreal2 )
local allowed_engines_array=( avalanche goldsource idtech3 idtech3_ql iw2.0 iw3.0 madness quake refractor realvirtuality source spark starbound unity3d unreal unreal2 )
for allowed_engine in "${allowed_engines_array[@]}"
do
if [ "${allowed_engine}" == "${engine}" ]; then
if [ "${allowed_engine}" == "starbound" ]; then
info_config.sh
if [ "${queryenabled}" == "true" ]; then
monitor_gsquery.sh
fi
elif [ "${allowed_engine}" == "${engine}" ]; then
monitor_gsquery.sh
fi
done

2
lgsm/functions/command_postdetails.sh

@ -7,7 +7,7 @@
local commandname="postdetails"
local commandaction="Postdetails"
local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
# Set posttarget to the appropriately-defined post destination.

2
lgsm/functions/command_restart.sh

@ -6,7 +6,7 @@
local commandname="RESTART"
local commandaction="Restarting"
local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
info_config.sh
exitbypass=1

65
lgsm/functions/command_start.sh

@ -7,7 +7,7 @@
local commandname="START"
local commandaction="Starting"
local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
fn_start_teamspeak3(){
if [ ! -e "${servercfgfullpath}" ]; then
@ -100,30 +100,47 @@ fn_start_tmux(){
cd "${executabledir}"
tmux new-session -d -x "${sessionheight}" -y "${sessionwidth}" -s "${servicename}" "${executable} ${parms}" 2> "${lgsmlogdir}/.${servicename}-tmux-error.tmp"
# tmux pipe-pane not supported in tmux versions < 1.6
if [ "$(tmux -V|sed "s/tmux //"|sed -n '1 p'|tr -cd '[:digit:]')" -lt "16" ] 2>/dev/null; then # Tmux compiled from source will not return a number, therefore bypass this check and trash the error
echo "Console logging disabled: Tmux => 1.6 required
https://gameservermanagers.com/tmux-upgrade
Currently installed: $(tmux -V)" > "${consolelog}"
# Console logging disabled: Bug in tmux 1.8 breaks logging
elif [ "$(tmux -V|sed "s/tmux //"|sed -n '1 p'|tr -cd '[:digit:]')" -eq "18" ] 2>/dev/null; then
echo "Console logging disabled: Bug in tmux 1.8 breaks logging
https://gameservermanagers.com/tmux-upgrade
Currently installed: $(tmux -V)" > "${consolelog}"
# Console logging enable or not set
elif [ "${consolelogging}" == "on" ]||[ -z "${consolelogging}" ]; then
touch "${consolelog}"
tmux pipe-pane -o -t "${servicename}" "exec cat >> '${consolelog}'"
# Console logging disabled
elif [ "${consolelogging}" == "off" ]; then
touch "${consolelog}"
cat "Console logging disabled by user" >> "{consolelog}"
fn_script_log_info "Console logging disabled by user"
# Create logfile
touch "${consolelog}"
# Get tmux version
tmuxversion="$(tmux -V|sed "s/tmux //"|sed -n '1 p')"
# Tmux compiled from source will return "master", therefore ignore it
if [ "$(tmux -V|sed "s/tmux //"|sed -n '1 p')" == "master" ]; then
fn_script_log "Tmux version: master (user compiled)"
echo "Tmux version: master (user compiled)" >> "${consolelog}"
if [ "${consolelogging}" == "on" ]||[ -z "${consolelogging}" ]; then
tmux pipe-pane -o -t "${servicename}" "exec cat >> '${consolelog}'"
fi
elif [ -n "${tmuxversion}" ]; then
# Get the digit version of tmux
tmuxversion="$(tmux -V|sed "s/tmux //"|sed -n '1 p'|tr -cd '[:digit:]')"
# tmux pipe-pane not supported in tmux versions < 1.6
if [ "${tmuxversion}" -lt "16" ]; then
echo "Console logging disabled: Tmux => 1.6 required
https://gameservermanagers.com/tmux-upgrade
Currently installed: $(tmux -V)" > "${consolelog}"
# Console logging disabled: Bug in tmux 1.8 breaks logging
elif [ "${tmuxversion}" -eq "18" ]; then
echo "Console logging disabled: Bug in tmux 1.8 breaks logging
https://gameservermanagers.com/tmux-upgrade
Currently installed: $(tmux -V)" > "${consolelog}"
# Console logging enable or not set
elif [ "${consolelogging}" == "on" ]||[ -z "${consolelogging}" ]; then
tmux pipe-pane -o -t "${servicename}" "exec cat >> '${consolelog}'"
fi
else
echo "Unable to detect tmux version" >> "${consolelog}"
fn_script_log_warn "Unable to detect tmux version"
fi
sleep 1
# Console logging disabled
if [ "${consolelogging}" == "off" ]; then
echo "Console logging disabled by user" >> "${consolelog}"
fn_script_log_info "Console logging disabled by user"
fi
sleep 1
# If the server fails to start
check_status.sh

125
lgsm/functions/command_stop.sh

@ -7,7 +7,7 @@
local commandname="STOP"
local commandaction="Stopping"
local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
# Attempts graceful shutdown by sending the 'CTRL+c'.
fn_stop_graceful_ctrlc(){
@ -37,29 +37,31 @@ fn_stop_graceful_ctrlc(){
fn_stop_tmux
}
# Attempts graceful shutdown by sending the 'quit' command.
fn_stop_graceful_quit(){
fn_print_dots "Graceful: sending \"quit\""
fn_script_log_info "Graceful: sending \"quit\""
# sends quit
tmux send -t "${servicename}" quit ENTER > /dev/null 2>&1
# waits up to 30 seconds giving the server time to shutdown gracefuly
for seconds in {1..30}; do
# Attempts graceful shutdown by sending a specified command.
# Usage: fn_stop_graceful_cmd "console_command" "timeout_in_seconds"
# e.g.: fn_stop_graceful_cmd "quit" "30"
fn_stop_graceful_cmd(){
fn_print_dots "Graceful: sending \"${1}\""
fn_script_log_info "Graceful: sending \"${1}\""
# sends specific stop command
tmux send -t "${servicename}" ${1} ENTER > /dev/null 2>&1
# waits up to given seconds giving the server time to shutdown gracefully
for ((seconds=1; seconds<=${2}; seconds++)); do
check_status.sh
if [ "${status}" == "0" ]; then
fn_print_ok "Graceful: sending \"quit\": ${seconds}: "
fn_print_ok "Graceful: sending \"${1}\": ${seconds}: "
fn_print_ok_eol_nl
fn_script_log_pass "Graceful: sending \"quit\": OK: ${seconds} seconds"
fn_script_log_pass "Graceful: sending \"${1}\": OK: ${seconds} seconds"
break
fi
sleep 1
fn_print_dots "Graceful: sending \"quit\": ${seconds}"
fn_print_dots "Graceful: sending \"${1}\": ${seconds}"
done
check_status.sh
if [ "${status}" != "0" ]; then
fn_print_error "Graceful: sending \"quit\": "
fn_print_error "Graceful: sending \"${1}\": "
fn_print_fail_eol_nl
fn_script_log_error "Graceful: sending \"quit\": FAIL"
fn_script_log_error "Graceful: sending \"${1}\": FAIL"
fi
sleep 1
fn_stop_tmux
@ -175,105 +177,22 @@ fn_stop_graceful_sdtd(){
fn_stop_tmux
}
# Attempts graceful of Minecraft using rcon 'stop' command.
fn_stop_graceful_minecraft(){
fn_print_dots "Graceful: sending \"stop\""
fn_script_log_info "Graceful: sending \"stop\""
# sends quit
tmux send -t "${servicename}" stop ENTER > /dev/null 2>&1
# waits up to 30 seconds giving the server time to shutdown gracefuly
for seconds in {1..30}; do
check_status.sh
if [ "${status}" == "0" ]; then
fn_print_ok "Graceful: sending \"stop\": ${seconds}: "
fn_print_ok_eol_nl
fn_script_log_pass "Graceful: sending \"stop\": OK: ${seconds} seconds"
break
fi
sleep 1
fn_print_dots "Graceful: sending \"stop\": ${seconds}"
done
check_status.sh
if [ "${status}" != "0" ]; then
fn_print_error "Graceful: sending \"stop\": "
fn_print_fail_eol_nl
fn_script_log_error "Graceful: sending \"stop\": FAIL"
fi
sleep 1
fn_stop_tmux
}
# Attempts graceful of mta using rcon 'quit' command.
fn_stop_graceful_mta(){
fn_print_dots "Graceful: sending \"quit\""
fn_script_log_info "Graceful: sending \"quit\""
# sends quit
tmux send -t "${servicename}" quit ENTER > /dev/null 2>&1
# waits up to 120 seconds giving the server time to shutdown gracefuly, we need a long wait time here as resources are stopped individually and process their own shutdowns
for seconds in {1..120}; do
check_status.sh
if [ "${status}" == "0" ]; then
fn_print_ok "Graceful: sending \"quit\": ${seconds}: "
fn_print_ok_eol_nl
fn_script_log_pass "Graceful: sending \"quit\": OK: ${seconds} seconds"
break
fi
sleep 1
fn_print_dots "Graceful: sending \"quit\": ${seconds}"
done
check_status.sh
if [ "${status}" != "0" ]; then
fn_print_error "Graceful: sending \"quit\": "
fn_print_fail_eol_nl
fn_script_log_error "Graceful: sending \"quit\": FAIL"
fi
sleep 1
fn_stop_tmux
}
# Attempts graceful of Terraria using 'exit' console command.
fn_stop_graceful_terraria(){
fn_print_dots "Graceful: sending \"exit\""
fn_script_log_info "Graceful: sending \"exit\""
# sends exit
tmux send -t "${servicename}" exit ENTER > /dev/null 2>&1
# waits up to 30 seconds giving the server time to shutdown gracefuly
for seconds in {1..30}; do
check_status.sh
if [ "${status}" == "0" ]; then
fn_print_ok "Graceful: sending \"exit\": ${seconds}: "
fn_print_ok_eol_nl
fn_script_log_pass "Graceful: sending \"exit\": OK: ${seconds} seconds"
break
fi
sleep 1
fn_print_dots "Graceful: sending \"exit\": ${seconds}"
done
check_status.sh
if [ "${status}" != "0" ]; then
fn_print_error "Graceful: sending \"exit\": "
fn_print_fail_eol_nl
fn_script_log_error "Graceful: sending \"exit\": FAIL"
fi
sleep 1
fn_stop_tmux
}
fn_stop_graceful_select(){
if [ "${gamename}" == "7 Days To Die" ]; then
fn_stop_graceful_sdtd
elif [ "${gamename}" == "Terraria" ]; then
fn_stop_graceful_terraria
fn_stop_graceful_cmd "exit" 30
elif [ "${gamename}" == "Minecraft" ]; then
fn_stop_graceful_minecraft
fn_stop_graceful_cmd "stop" 30
elif [ "${gamename}" == "Multi Theft Auto" ]; then
fn_stop_graceful_mta
# we need a long wait time here as resources are stopped individually and process their own shutdowns
fn_stop_graceful_cmd "quit" 120
elif [ "${engine}" == "goldsource" ]; then
fn_stop_graceful_goldsource
elif [ "${gamename}" == "Factorio" ]||[ "${engine}" == "unity3d" ]||[ "${engine}" == "unreal4" ]||[ "${engine}" == "unreal3" ]||[ "${engine}" == "unreal2" ]||[ "${engine}" == "unreal" ]||[ "${gamename}" == "Mumble" ]; then
fn_stop_graceful_ctrlc
elif [ "${engine}" == "source" ]||[ "${engine}" == "quake" ]||[ "${engine}" == "idtech2" ]||[ "${engine}" == "idtech3" ]||[ "${engine}" == "idtech3_ql" ]||[ "${engine}" == "Just Cause 2" ]; then
fn_stop_graceful_quit
elif [ "${engine}" == "source" ]||[ "${engine}" == "quake" ]||[ "${engine}" == "idtech2" ]||[ "${engine}" == "idtech3" ]||[ "${engine}" == "idtech3_ql" ]||[ "${engine}" == "Just Cause 2" ]||[ "${engine}" == "projectzomboid" ]; then
fn_stop_graceful_cmd "quit" 30
else
fn_stop_tmux
fi

2
lgsm/functions/command_test_alert.sh

@ -6,7 +6,7 @@
local commandname="ALERT"
local commandaction="Alert"
local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
fn_print_dots "${servername}"
sleep 1

2
lgsm/functions/command_ts3_server_pass.sh

@ -7,7 +7,7 @@
local commandname="TS3-CHANGE-PASS"
local commandaction="ServerAdmin Password Change"
local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
fn_serveradmin_password_prompt(){
fn_print_header

2
lgsm/functions/command_update.sh

@ -6,7 +6,7 @@
local commandname="UPDATE"
local commandaction="Update"
local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
fn_print_dots ""
sleep 0.5

2
lgsm/functions/command_update_linuxgsm.sh

@ -6,7 +6,7 @@
local commandname="UPDATE LinuxGSM"
local commandaction="Update LinuxGSM"
local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
fn_print_dots "Updating LinuxGSM"
sleep 1

2
lgsm/functions/command_validate.sh

@ -6,7 +6,7 @@
local commandname="VALIDATE"
local commandaction="Validate"
local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
fn_validation(){
appid="${1}"

2
lgsm/functions/command_wipe.sh

@ -7,7 +7,7 @@
local commandname="WIPE"
local commandaction="data wipe"
local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
check.sh
fn_print_header

2
lgsm/functions/compress_unreal2_maps.sh

@ -5,7 +5,7 @@
# Description: Compresses unreal maps.
local commandaction="Unreal Map Compressor"
local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
check.sh
fn_print_header

2
lgsm/functions/compress_ut99_maps.sh

@ -5,7 +5,7 @@
# Description: Compresses unreal maps.
local commandaction="Unreal Map Compressor"
local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
check.sh
fn_print_header

2
lgsm/functions/core_dl.sh

@ -19,7 +19,7 @@
local commandname="DOWNLOAD"
local commandaction="Download"
local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
fn_dl_md5(){
# Runs MD5 Check if available

5
lgsm/functions/core_functions.sh

@ -326,6 +326,11 @@ functionfile="${FUNCNAME}"
fn_fetch_function
}
fix_kf2.sh(){
functionfile="${FUNCNAME}"
fn_fetch_function
}
fix_ut2k4.sh(){
functionfile="${FUNCNAME}"
fn_fetch_function

4
lgsm/functions/core_getopt.sh

@ -4,7 +4,7 @@
# Website: https://gameservermanagers.com
# Description: getopt arguments.
local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
### Define all commands here ###
## User commands | Trigger commands | Description
@ -56,7 +56,7 @@ currentopt=( "${cmd_start[@]}" "${cmd_stop[@]}" "${cmd_restart[@]}" "${cmd_monit
currentopt+=( "${cmd_update_linuxgsm[@]}" )
# Exclude noupdate games here
if [ "${gamename}" != "Battlefield: 1942" ]&&[ "${engine}" != "quake" ]&&[ "${engine}" != "idtech2" ]&&[ "${engine}" != "idtech3" ]&&[ "${engine}" != "iw2.0" ]&&[ "${engine}" != "iw3.0" ]; then
if [ "${gamename}" != "Battlefield: 1942" ]&&[ "${engine}" != "quake" ]&&[ "${engine}" != "idtech2" ]&&[ "${engine}" != "idtech3" ]&&[ "${engine}" != "iw2.0" ]&&[ "${engine}" != "iw3.0" ]&&[ "${gamename}" != "San Andreas Multiplayer" ]; then
currentopt+=( "${cmd_update[@]}" )
# force update for SteamCMD only or MTA
if [ -n "${appid}" ] || [ "${gamename}" == "Multi Theft Auto" ]; then

16
lgsm/functions/fix.sh

@ -63,29 +63,19 @@ fi
# Fixes that are run on install only.
if [ "${function_selfname}" == "command_install.sh" ]; then
if [ "${gamename}" == "Killing Floor" ]; then
echo ""
echo "Applying ${gamename} Server Fixes"
echo "================================="
sleep 1
if [ "${gamename}" == "Killing Floor" ]; then
fix_kf.sh
elif [ "${gamename}" == "Killing Floor 2" ]; then
fix_kf2.sh
elif [ "${gamename}" == "Red Orchestra: Ostfront 41-45" ]; then
echo ""
echo "Applying ${gamename} Server Fixes"
echo "================================="
sleep 1
fix_ro.sh
elif [ "${gamename}" == "Unreal Tournament 2004" ]; then
echo ""
echo "Applying ${gamename} Server Fixes"
echo "================================="
sleep 1
fix_ut2k4.sh
elif [ "${gamename}" == "Unreal Tournament" ]; then
echo ""
echo "Applying ${gamename} Server Fixes"
echo "================================="
sleep 1
fix_ut.sh
fi
fi

2
lgsm/functions/fix_arma3.sh

@ -6,7 +6,7 @@
local commandname="FIX"
local commandaction="Fix"
local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
# Fixes: 20150 Segmentation fault (core dumped) error.
if [ ! -d "${HOME}/.local/share/Arma 3" ]||[ ! -d "${HOME}/.local/share/Arma 3 - Other Profiles" ]; then

2
lgsm/functions/fix_csgo.sh

@ -6,7 +6,7 @@
local commandname="FIX"
local commandaction="Fix"
local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
# Fixes: server not always creating steam_appid.txt file.
if [ ! -f "${serverfiles}/steam_appid.txt" ]; then

2
lgsm/functions/fix_dst.sh

@ -6,7 +6,7 @@
local commandname="FIX"
local commandaction="Fix"
local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
local function_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)
# Issue only occures on CentOS as libcurl-gnutls.so.4 is called libcurl.so.4 on CentOS.

2
lgsm/functions/fix_glibc.sh

@ -6,7 +6,7 @@
local commandname="FIX"
local commandaction="Fix"
local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
## i386

2
lgsm/functions/fix_kf.sh

@ -6,7 +6,7 @@
local commandname="FIX"
local commandaction="Fix"
local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
echo "Applying WebAdmin ROOst.css fix."
echo "http://forums.tripwireinteractive.com/showpost.php?p=585435&postcount=13"

20
lgsm/functions/fix_kf2.sh

@ -0,0 +1,20 @@
#!/bin/bash
# LinuxGSM fix_kf3.sh function
# Author: Daniel Gibbs
# Website: https://gameservermanagers.com
# Description: Resolves various issues with Killing Floor 2.
local commandname="FIX"
local commandaction="Fix"
local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
fn_parms(){
parms="\"${defaultmap}?Game=KFGameContent.KFGameInfo_VersusSurvival\""
}
fn_print_information "starting Killing Floor 2 server to generate configs."
sleep 1
exitbypass=1
command_start.sh
sleep 10
command_stop.sh

2
lgsm/functions/fix_mta.sh

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

2
lgsm/functions/fix_ro.sh

@ -6,7 +6,7 @@
local commandname="FIX"
local commandaction="Fix"
local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
echo "Applying WebAdmin ROOst.css fix."
echo "http://forums.tripwireinteractive.com/showpost.php?p=585435&postcount=13"

2
lgsm/functions/fix_steamcmd.sh

@ -6,7 +6,7 @@
local commandname="FIX"
local commandaction="Fix"
local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
local function_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.
if [ ! -f "${HOME}/.steam/sdk32/steamclient.so" ]; then

2
lgsm/functions/fix_ut.sh

@ -6,7 +6,7 @@
local commandname="FIX"
local commandaction="Fix"
local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
#Set Binary Executable
echo "chmod +x ${executabledir}/${executable}"

2
lgsm/functions/fix_ut2k4.sh

@ -6,7 +6,7 @@
local commandname="FIX"
local commandaction="Fix"
local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
echo "applying WebAdmin ut2003.css fix."
echo "http://forums.tripwireinteractive.com/showpost.php?p=585435&postcount=13"

2
lgsm/functions/gsquery.py

@ -17,7 +17,7 @@ class PythonGSQ:
self.server_response_timeout = 5
self.default_buffer_length = 1024
#
sourcequery=['madness','quakelive','realvirtuality','refractor','source','goldsource','spark','unity3d']
sourcequery=['madness','quakelive','realvirtuality','refractor','source','goldsource','spark','starbound','unity3d']
idtech2query=['idtech3','quake','iw3.0']
idtech3query=['idtech2','iw2.0']
if self.option.engine in sourcequery:

33
lgsm/functions/info_config.sh

@ -5,7 +5,7 @@
# Website: https://gameservermanagers.com
# Description: Gets specific details from config files.
local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
## Examples of filtering to get info from config files
# sed 's/foo//g' - remove foo
@ -455,6 +455,8 @@ fn_info_config_source(){
fn_info_config_starbound(){
if [ ! -f "${servercfgfullpath}" ]; then
servername="${unavailable}"
queryenabled="${unavailable}"
rconenabled="${unavailable}"
rconpassword="${unavailable}"
port="21025"
queryport="21025"
@ -462,6 +464,8 @@ fn_info_config_starbound(){
maxplayers="8"
else
servername=$(grep "serverName" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e 's/serverName//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//')
queryenabled=$(grep "runQueryServer" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e 's/runQueryServer//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//')
rconenabled=$(grep "runRconServer" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e 's/runRconServer//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//')
rconpassword=$(grep "rconServerPassword" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e 's/rconServerPassword//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//')
port=$(grep "gameServerPort" "${servercfgfullpath}" | tr -cd '[:digit:]')
queryport=$(grep "queryServerPort" "${servercfgfullpath}" | tr -cd '[:digit:]')
@ -470,6 +474,8 @@ fn_info_config_starbound(){
# Not Set
servername=${servername:-"NOT SET"}
queryenabled=${queryenabled:-"NOT SET"}
rconenabled==${rconenabled:-"NOT SET"}
rconpassword=${rconpassword:-"NOT SET"}
port=${port:-"21025"}
queryport=${queryport:-"21025"}
@ -521,6 +527,27 @@ fn_info_config_mumble(){
fi
}
fn_info_config_samp(){
if [ ! -f "${servercfgfullpath}" ]; then
servername="unnamed server"
serverpassword="${unavailable}"
rconpassword="${unavailable}"
port="7777"
maxplayers="50"
else
servername=$(grep "hostname" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/hostname//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//')
rconpassword=$(grep "rcon_password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/^rcon_password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//')
port=$(grep "port" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]')
maxplayers=$(grep "maxplayers" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]')
# Not Set
servername=${servername:-"NOT SET"}
rconpassword=${rconpassword:-"NOT SET"}
port=${port:-"8303"}
maxplayers=${maxplayers:-"12"}
fi
}
fn_info_config_teeworlds(){
if [ ! -f "${servercfgfullpath}" ]; then
servername="unnamed server"
@ -895,8 +922,12 @@ elif [ "${engine}" == "starbound" ]; then
# TeamSpeak 3
elif [ "${gamename}" == "TeamSpeak 3" ]; then
fn_info_config_teamspeak3
# Mumble
elif [ "${gamename}" == "Mumble" ]; then
fn_info_config_mumble
# San Andreas Multiplayer
elif [ "${gamename}" == "San Andreas Multiplayer" ]; then
fn_info_config_samp
# Teeworlds
elif [ "${engine}" == "teeworlds" ]; then
fn_info_config_teeworlds

6
lgsm/functions/info_distro.sh

@ -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]}"))"
local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
### Distro information
@ -135,4 +135,6 @@ if [ -d "${backupdir}" ]; then
fi
# External IP address
extip=$(curl -m 3 ifconfig.co 2>/dev/null)
if [ -z "${extip}" ];then
extip=$(curl -m 3 ifconfig.co 2>/dev/null)
fi

5
lgsm/functions/info_glibc.sh

@ -4,7 +4,7 @@
# Website: https://gameservermanagers.com
# Description: Stores details on servers Glibc requirements.
local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
if [ "${gamename}" == "ARK: Survival Evolved" ]; then
glibcrequired="2.15"
@ -89,6 +89,9 @@ elif [ "${gamename}" == "Quake 3: Arena" ]; then
elif [ "${gamename}" == "Quake Live" ]; then
glibcrequired="2.15"
glibcfix="no"
elif [ "${gamename}" == "San Andreas Multiplayer" ]; then
glibcrequired="2.3"
glibcfix="no"
elif [ "${gamename}" == "Squad" ]; then
glibcrequired="2.17"
glibcfix="no"

22
lgsm/functions/info_messages.sh

@ -146,6 +146,16 @@ fn_info_message_gameserver(){
echo -e "${blue}Server password:\t${default}${serverpassword}"
fi
# Query enabled (Starbound)
if [ -n "${queryenabled}" ]; then
echo -e "${blue}Query enabled:\t${default}${rconpassword}"
fi
# RCON enabled (Starbound)
if [ -n "${rconenabled}" ]; then
echo -e "${blue}RCON enabled:\t${default}${rconpassword}"
fi
# RCON password
if [ -n "${rconpassword}" ]; then
echo -e "${blue}RCON password:\t${default}${rconpassword}"
@ -707,6 +717,16 @@ fn_info_message_rust(){
} | column -s $'\t' -t
}
fn_info_message_samp(){
echo -e "netstat -atunp | grep samp03svr"
echo -e ""
{
echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
echo -e "> Game/RCON\tINBOUND\t${port}\ttcp/udp"
} | column -s $'\t' -t
}
fn_info_message_seriousengine35(){
echo -e "netstat -atunp | grep Sam3_Dedicate"
echo -e ""
@ -977,6 +997,8 @@ fn_info_message_select_engine(){
fn_info_message_quake3
elif [ "${gamename}" == "Quake Live" ]; then
fn_info_message_quakelive
elif [ "${gamename}" == "San Andreas Multiplayer" ]; then
fn_info_message_samp
elif [ "${gamename}" == "Squad" ]; then
fn_info_message_squad
elif [ "${gamename}" == "TeamSpeak 3" ]; then

2
lgsm/functions/info_parms.sh

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

2
lgsm/functions/install_complete.sh

@ -6,7 +6,7 @@
local commandname="INSTALL"
local commandaction="Install"
local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
echo "================================="
echo "Install Complete!"

24
lgsm/functions/install_config.sh

@ -6,7 +6,7 @@
local commandname="INSTALL"
local commandaction="Install"
local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
# Checks if server cfg dir exists, creates it if it doesn't
fn_check_cfgdir(){
@ -19,6 +19,11 @@ fn_check_cfgdir(){
# Downloads default configs from Game-Server-Configs repo to lgsm/config-default
fn_fetch_default_config(){
echo ""
echo "Downloading ${gamename} Configs"
echo "================================="
echo "default configs from https://github.com/GameServerManagers/Game-Server-Configs"
sleep 1
mkdir -p "${lgsmdir}/config-default/config-game"
githuburl="https://raw.githubusercontent.com/GameServerManagers/Game-Server-Configs/master"
for config in "${array_configs[@]}"; do
@ -118,11 +123,6 @@ fn_set_dst_config_vars(){
echo ""
}
echo ""
echo "Downloading ${gamename} Config"
echo "================================="
echo "default configs from https://github.com/GameServerManagers/Game-Server-Configs"
sleep 2
if [ "${gamename}" == "7 Days To Die" ]; then
gamedirname="7DaysToDie"
array_configs+=( serverconfig.xml )
@ -383,10 +383,6 @@ elif [ "${gamename}" == "Mumble" ]; then
array_configs+=( murmur.ini )
fn_fetch_default_config
fn_default_config_remote
elif [ "${gamename}" == "Natural Selection 2" ]; then
:
elif [ "${gamename}" == "NS2: Combat" ]; then
:
elif [ "${gamename}" == "Pirates, Vikings, and Knights II" ]; then
gamedirname="PiratesVikingandKnightsII"
array_configs+=( server.cfg )
@ -430,8 +426,6 @@ elif [ "${gamename}" == "QuakeWorld" ]; then
fn_fetch_default_config
fn_default_config_remote
fn_set_config_vars
elif [ "${gamename}" == "Red Orchestra: Ostfront 41-45" ]; then
:
elif [ "${gamename}" == "Ricochet" ]; then
gamedirname="Ricochet"
array_configs+=( server.cfg )
@ -462,6 +456,12 @@ elif [ "${gamename}" == "Starbound" ]; then
fn_fetch_default_config
fn_default_config_remote
fn_set_config_vars
elif [ "${gamename}" == "San Andreas Multiplayer" ]; then
gamedirname="SanAndreasMultiplayer"
array_configs+=( server.cfg )
fn_fetch_default_config
fn_default_config_remote
fn_set_config_vars
elif [ "${gamename}" == "Sven Co-op" ]; then
gamedirname="SvenCoop"
array_configs+=( server.cfg )

2
lgsm/functions/install_dst_token.sh

@ -6,7 +6,7 @@
local commandname="INSTALL"
local commandaction="Install"
local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
echo ""
echo "Enter ${gamename} Cluster Token"

2
lgsm/functions/install_gslt.sh

@ -6,7 +6,7 @@
local commandname="INSTALL"
local commandaction="Install"
local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
echo ""
echo "Game Server Login Token"

2
lgsm/functions/install_header.sh

@ -6,7 +6,7 @@
local commandname="INSTALL"
local commandaction="Install"
local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
clear
echo "================================="

2
lgsm/functions/install_logs.sh

@ -6,7 +6,7 @@
local commandname="INSTALL"
local commandaction="Install"
local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
if [ "${checklogs}" != "1" ]; then
echo ""

2
lgsm/functions/install_mta_resources.sh

@ -7,7 +7,7 @@
local commandname="INSTALL"
local commandaction="Install"
local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
fn_print_information_nl "${gamename} will not function without resources!"
echo " * install default resources using ./${selfname} install-default-resources"

2
lgsm/functions/install_retry.sh

@ -6,7 +6,7 @@
local commandname="INSTALL"
local commandaction="Install"
local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
if fn_prompt_yn "Retry install?" Y; then
command_install.sh; exit

2
lgsm/functions/install_server_dir.sh

@ -6,7 +6,7 @@
local commandname="INSTALL"
local commandaction="Install"
local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
echo ""
echo "Server Directory"

4
lgsm/functions/install_server_files.sh

@ -6,7 +6,7 @@
local commandname="INSTALL"
local commandaction="Install"
local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
fn_install_server_files(){
if [ "${gamename}" == "Battlefield: 1942" ]; then
@ -39,6 +39,8 @@ fn_install_server_files(){
remote_fileurl="http://files.gameservermanagers.com/UnrealTournament3/UT3-linux-server-2.1.tar.bz2"; local_filedir="${tmpdir}"; local_filename="UT3-linux-server-2.1.tar.bz2"; chmodx="nochmodx" run="norun"; force="noforce"; md5="2527437b46f1b47f20228d27d72395a6"
elif [ "${gamename}" == "Wolfenstein: Enemy Territory" ]; then
remote_fileurl="http://files.gameservermanagers.com/WolfensteinEnemyTerritory/enemy-territory.260b.tar.bz2"; local_filedir="${tmpdir}"; local_filename="enemy-territory.260b.tar.bz2"; chmodx="nochmodx" run="norun"; force="noforce"; md5="f833f514bfcdd46b42c111f83350c5a7"
elif [ "${gamename}" == "San Andreas Multiplayer" ]; then
remote_fileurl="http://files.sa-mp.com/samp037svr_R2-1.tar.gz"; local_filedir="${tmpdir}"; local_filename="samp037svr_R2-1.tar.gz"; chmodx="nochmodx" run="norun"; force="noforce"; md5="93705e165550c97484678236749198a4"
fi
fn_fetch_file "${remote_fileurl}" "${local_filedir}" "${local_filename}" "${chmodx}" "${run}" "${forcedl}" "${md5}"
fn_dl_extract "${local_filedir}" "${local_filename}" "${serverfiles}"

2
lgsm/functions/install_squad_license.sh

@ -6,7 +6,7 @@
local commandname="INSTALL"
local commandaction="Install"
local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
echo ""
echo "Squad Server License"

2
lgsm/functions/install_ts3db.sh

@ -7,7 +7,7 @@
local commandname="INSTALL"
local commandaction="Install"
local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
fn_install_ts3db_mariadb(){
echo ""

2
lgsm/functions/install_ut2k4_key.sh

@ -6,7 +6,7 @@
local commandname="INSTALL"
local commandaction="Install"
local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
echo ""
echo "Enter ${gamename} CD Key"

2
lgsm/functions/logs.sh

@ -67,7 +67,7 @@ if [ $(find "${lgsmlogdir}"/ -type f -mtime +"${logdays}"|wc -l) -ne "0" ]; then
smcount=$(find "${commonlogs}"/ -type f -mtime +"${logdays}"|wc -l)
find "${commonlogs}"/ -mtime +"${logdays}" -type f -exec rm -f {} \;
fi
if [ -d ${commonsourcelogs} ]; then
if [ -d "${commonsourcelogs}" ]; then
find "${commonsourcelogs}"/* -type f -mtime +"${logdays}"| tee >> "${lgsmlog}"
smcount=$(find "${commonsourcelogs}"/* -type f -mtime +"${logdays}"|wc -l)
find "${commonsourcelogs}"/* -mtime +"${logdays}" -type f -exec rm -f {} \;

2
lgsm/functions/mods_core.sh

@ -7,7 +7,7 @@
local commandname="MODS"
local commandaction="addons/mods"
local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
# Files and Directories
modsdir="${lgsmdir}/mods"

2
lgsm/functions/mods_list.sh

@ -10,7 +10,7 @@
local commandname="MODS"
local commandaction="List Mods"
local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
# Get a proper URL for mods that don't provide a good one (optional)
fn_script_log_info "Retrieving latest mods URLs"

2
lgsm/functions/monitor_gsquery.sh

@ -7,7 +7,7 @@
local commandname="MONITOR"
local commandaction="Monitor"
local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
# Downloads gsquery.py if missing
if [ ! -f "${functionsdir}/gsquery.py" ]; then

2
lgsm/functions/update_factorio.sh

@ -7,7 +7,7 @@
local commandname="UPDATE"
local commandaction="Update"
local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
fn_update_factorio_dl(){
fn_fetch_file "https://www.factorio.com/get-download/${availablebuild}/headless/${factorioarch}" "${tmpdir}" "factorio_headless_${factorioarch}-${availablebuild}.tar.gz"

2
lgsm/functions/update_minecraft.sh

@ -6,7 +6,7 @@
local commandname="UPDATE"
local commandaction="Update"
local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
fn_update_dl(){
fn_fetch_file "https://s3.amazonaws.com/Minecraft.Download/versions/${availablebuild}/minecraft_server.${availablebuild}.jar" "${tmpdir}" "minecraft_server.${availablebuild}.jar"

2
lgsm/functions/update_mta.sh

@ -6,7 +6,7 @@
local commandname="UPDATE"
local commandaction="Update"
local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
fn_update_mta_dl(){
fn_fetch_file "http://linux.mtasa.com/dl/${numversion}/multitheftauto_linux_x64-${fullversion}.tar.gz" "${tmpdir}" "multitheftauto_linux_x64-${fullversion}.tar.gz"

2
lgsm/functions/update_mumble.sh

@ -7,7 +7,7 @@
local commandname="UPDATE"
local commandaction="Update"
local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
fn_update_mumble_dl(){
fn_fetch_file "https://github.com/mumble-voip/mumble/releases/download/${availablebuild}/murmur-static_${mumblearch}-${availablebuild}.tar.bz2" "${tmpdir}" "murmur-static_${mumblearch}-${availablebuild}.tar.bz2"

4
lgsm/functions/update_steamcmd.sh

@ -6,7 +6,7 @@
local commandname="UPDATE"
local commandaction="Update"
local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
check.sh
@ -102,7 +102,7 @@ fn_update_request_log(){
fn_print_dots "Checking for update: Server logs"
fn_script_log_info "Checking for update: Server logs"
sleep 1
if [ -f ${consolelog} ]; then
if [ -f "${consolelog}" ]; then
requestrestart=$(grep -Ec "MasterRequestRestart" "${consolelog}")
else
requestrestart="0"

2
lgsm/functions/update_ts3.sh

@ -6,7 +6,7 @@
local commandname="UPDATE"
local commandaction="Update"
local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
fn_update_ts3_dl(){
fn_fetch_file "http://dl.4players.de/ts/releases/${ts3_version_number}/teamspeak3-server_linux_${ts3arch}-${ts3_version_number}.tar.bz2" "${tmpdir}" "teamspeak3-server_linux_${ts3arch}-${ts3_version_number}.tar.bz2"

8
linuxgsm.sh

@ -20,11 +20,11 @@ if [ -f ".dev-debug" ]; then
set -x
fi
version="170926"
version="171014"
shortname="core"
gameservername="core"
rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))"
selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
rootdir="$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")"
selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
servicename="${selfname}"
lockselfname=".${servicename}.lock"
lgsmdir="${rootdir}/lgsm"
@ -337,7 +337,7 @@ else
echo -e "\e[0;32mOK\e[0m"
fi
else
function_file_diff=$(diff -q ${configdirdefault}/config-lgsm/${gameservername}/_default.cfg ${configdirserver}/_default.cfg)
function_file_diff=$(diff -q "${configdirdefault}/config-lgsm/${gameservername}/_default.cfg" "${configdirserver}/_default.cfg")
if [ "${function_file_diff}" != "" ]; then
fn_print_warn_nl "_default.cfg has been altered. reloading config."
echo -ne " copying _default.cfg...\c"

82
tests/tests_jc2server.sh

@ -16,10 +16,10 @@ if [ -f ".dev-debug" ]; then
set -x
fi
version="170619"
version="171014"
shortname="jc2"
gameservername="jc2server"
rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))"
rootdir="$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")"
selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
servicename="${selfname}"
lockselfname=".${servicename}.lock"
@ -423,7 +423,7 @@ fn_setstatus(){
# End of every test will expect the result to either pass or fail
# If the script does not do as intended the whole test will fail
# if excpecting a pass
# if expecting a pass
fn_test_result_pass(){
if [ $? != 0 ]; then
echo "================================="
@ -441,7 +441,7 @@ fn_test_result_pass(){
fi
}
# if excpecting a fail
# if expecting a fail
fn_test_result_fail(){
if [ $? == 0 ]; then
echo "================================="
@ -528,7 +528,6 @@ echo "Command: ./jc2server auto-install"
(fn_autoinstall)
fn_test_result_pass
echo ""
echo "3.1 - start"
echo "================================="
@ -701,16 +700,14 @@ fn_setstatus
fn_test_result_pass
echo ""
echo "4.9 - update-functions"
echo "Inserting IP address"
echo "================================="
echo "Description:"
echo "runs update-functions."
echo ""
echo "Command: ./jc2server update-functions"
requiredstatus="OFFLINE"
fn_setstatus
(command_update_functions.sh)
fn_test_result_pass
echo "Inserting Travis IP in to config."
echo "Allows monitor to work"
travisip=$(ip -o -4 addr|grep eth0|awk '{print $4}'|grep -oe '\([0-9]\{1,3\}\.\?\)\{4\}'|grep -v 127.0.0)
sed -i "/BindIP/c\BindIP = \"${travisip}\"," "${serverfiles}/config.lua"
echo "IP: ${travisip}"
echo ""
echo "5.1 - monitor - online"
@ -723,7 +720,6 @@ fn_setstatus
(command_monitor.sh)
fn_test_result_pass
echo ""
echo "5.2 - monitor - offline - with lockfile"
echo "================================="
@ -737,7 +733,6 @@ date > "${rootdir}/${lockselfname}"
(command_monitor.sh)
fn_test_result_pass
echo ""
echo "5.3 - monitor - offline - no lockfile"
echo "================================="
@ -777,6 +772,61 @@ fn_setstatus
(command_details.sh)
fn_test_result_pass
echo ""
echo "6.1 - post details"
echo "================================="
echo "Description:"
echo "post details."
echo "Command: ./jc2server postdetails"
requiredstatus="ONLINE"
fn_setstatus
(command_postdetails.sh)
fn_test_result_pass
echo ""
echo "7.0 - backup"
echo "================================="
echo "Description:"
echo "run a backup."
echo "Command: ./jc2server backup"
requiredstatus="ONLINE"
fn_setstatus
(command_backup.sh)
fn_test_result_pass
echo ""
echo "8.0 - dev - detect glibc"
echo "================================="
echo "Description:"
echo "detect glibc."
echo "Command: ./jc2server detect-glibc"
requiredstatus="ONLINE"
fn_setstatus
(command_dev_detect_glibc.sh)
fn_test_result_pass
echo ""
echo "8.1 - dev - detect ldd"
echo "================================="
echo "Description:"
echo "detect ldd."
echo "Command: ./jc2server detect-ldd"
requiredstatus="ONLINE"
fn_setstatus
(command_dev_detect_ldd.sh)
fn_test_result_pass
echo ""
echo "8.2 - dev - detect deps"
echo "================================="
echo "Description:"
echo "detect dependencies."
echo "Command: ./jc2server detect-deps"
requiredstatus="ONLINE"
fn_setstatus
(command_dev_detect_deps.sh)
fn_test_result_pass
echo ""
echo "================================="
echo "Server Tests - Complete!"
@ -784,8 +834,6 @@ echo "Using: ${gamename}"
echo "================================="
requiredstatus="OFFLINE"
fn_setstatus
sleep 1
fn_print_info "Tidying up directories."
sleep 1
rm -rfv "${serverfiles}"
core_exit.sh

83
tests/tests_ts3server.sh

@ -16,10 +16,10 @@ if [ -f ".dev-debug" ]; then
set -x
fi
version="170619"
version="171014"
shortname="ts3"
gameservername="ts3server"
rootdir="$(dirname $(readlink -f "${BASH_SOURCE[0]}"))"
rootdir="$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")"
selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
servicename="${selfname}"
lockselfname=".${servicename}.lock"
@ -423,7 +423,7 @@ fn_setstatus(){
# End of every test will expect the result to either pass or fail
# If the script does not do as intended the whole test will fail
# if excpecting a pass
# if expecting a pass
fn_test_result_pass(){
if [ $? != 0 ]; then
echo "================================="
@ -441,7 +441,7 @@ fn_test_result_pass(){
fi
}
# if excpecting a fail
# if expecting a fail
fn_test_result_fail(){
if [ $? == 0 ]; then
echo "================================="
@ -528,7 +528,6 @@ echo "Command: ./ts3server auto-install"
(fn_autoinstall)
fn_test_result_pass
echo ""
echo "3.1 - start"
echo "================================="
@ -606,29 +605,16 @@ fn_setstatus
(command_restart.sh)
fn_test_result_pass
echo ""
echo "4.1 - update"
echo "================================="
echo "Description:"
echo "check for updates."
echo "Command: ./jc2server update"
echo "Command: ./ts3server update"
requiredstatus="OFFLINE"
fn_setstatus
(command_update.sh)
fn_test_result_pass
echo ""
echo "4.2 - update-functions"
echo "================================="
echo "Description:"
echo "runs update-functions."
echo ""
echo "Command: ./jc2server update-functions"
requiredstatus="OFFLINE"
fn_setstatus
(command_update_functions.sh)
fn_test_result_pass
echo ""
echo "5.1 - monitor - online"
echo "================================="
@ -640,7 +626,6 @@ fn_setstatus
(command_monitor.sh)
fn_test_result_pass
echo ""
echo "5.2 - monitor - offline - with lockfile"
echo "================================="
@ -654,7 +639,6 @@ date > "${rootdir}/${lockselfname}"
(command_monitor.sh)
fn_test_result_pass
echo ""
echo "5.3 - monitor - offline - no lockfile"
echo "================================="
@ -677,6 +661,61 @@ fn_setstatus
(command_details.sh)
fn_test_result_pass
echo ""
echo "6.1 - post details"
echo "================================="
echo "Description:"
echo "post details."
echo "Command: ./jc2server postdetails"
requiredstatus="ONLINE"
fn_setstatus
(command_postdetails.sh)
fn_test_result_pass
echo ""
echo "7.0 - backup"
echo "================================="
echo "Description:"
echo "run a backup."
echo "Command: ./jc2server backup"
requiredstatus="ONLINE"
fn_setstatus
(command_backup.sh)
fn_test_result_pass
echo ""
echo "8.0 - dev - detect glibc"
echo "================================="
echo "Description:"
echo "detect glibc."
echo "Command: ./jc2server detect-glibc"
requiredstatus="ONLINE"
fn_setstatus
(command_dev_detect_glibc.sh)
fn_test_result_pass
echo ""
echo "8.1 - dev - detect ldd"
echo "================================="
echo "Description:"
echo "detect ldd."
echo "Command: ./jc2server detect-ldd"
requiredstatus="ONLINE"
fn_setstatus
(command_dev_detect_ldd.sh)
fn_test_result_pass
echo ""
echo "8.2 - dev - detect deps"
echo "================================="
echo "Description:"
echo "detect dependencies."
echo "Command: ./jc2server detect-deps"
requiredstatus="ONLINE"
fn_setstatus
(command_dev_detect_deps.sh)
fn_test_result_pass
echo ""
echo "================================="
echo "Server Tests - Complete!"
@ -684,8 +723,6 @@ echo "Using: ${gamename}"
echo "================================="
requiredstatus="OFFLINE"
fn_setstatus
sleep 1
fn_print_info "Tidying up directories."
sleep 1
rm -rfv "${serverfiles}"
core_exit.sh
Loading…
Cancel
Save