From 0ff4305c39248178b6687295800c844f35fa2080 Mon Sep 17 00:00:00 2001 From: Christian Date: Wed, 7 Oct 2020 21:20:29 +0200 Subject: [PATCH 01/24] feat(mods): add Stripper:Source to the modlist (#3070) --- lgsm/functions/mods_list.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lgsm/functions/mods_list.sh b/lgsm/functions/mods_list.sh index 13ae3e268f..333601dcee 100755 --- a/lgsm/functions/mods_list.sh +++ b/lgsm/functions/mods_list.sh @@ -71,6 +71,7 @@ modseparator="MOD" mod_info_metamod=( MOD "metamod" "MetaMod" "${metamodurl}" "${metamodlatestfile}" "0" "LowercaseOff" "${systemdir}" "addons/metamod/metaplugins.ini;" "source;" "GAMES" "NOTGAMES" "https://www.sourcemm.net" "Plugins Framework" ) mod_info_sourcemod=( MOD "sourcemod" "SourceMod" "${sourcemodurl}" "${sourcemodlatestfile}" "0" "LowercaseOff" "${systemdir}" "cfg;addons/sourcemod/configs;" "source;" "GAMES" "NOTGAMES" "http://www.sourcemod.net" "Admin Features (requires MetaMod)" ) mod_info_steamworks=( MOD "steamworks" "SteamWorks" "${steamworksurl}" "${steamworkslatestfile}" "0" "LowercaseOff" "${systemdir}" "OVERWRITE" "ENGINES" "Counter-Strike: Global Offensive;" "NOTGAMES" "https://github.com/KyleSanderson/SteamWorks" "Exposing SteamWorks functions to SourcePawn" ) +mod_info_stripper=( MOD "stripper" "Stripper Source" "http://www.bailopan.net/stripper/snapshots/1.2/stripper-1.2.2-git129-linux.tar.gz" "stripper-1.2.2-git129-linux.tar.gz" "0" "LowercaseOff" "${systemdir}" "addons/stripper/maps;" "ENGINES" "Counter-Strike: Global Offensive;Counter-Strike: Source;Day of Defeat: Source;Half Life: Deathmatch;Half Life 2: Deathmatch;Insurgency;Left 4 Dead;Left 4 Dead 2;Nuclear Dawn;Team Fortress 2;" "NOTGAMES" "http://www.bailopan.net/stripper/" "Add or remove objects from map (requires MetaMod)") # CS:GO Mods mod_info_gokz=( MOD "gokz" "GOKZ" "https://bitbucket.org/kztimerglobalteam/gokz/downloads/GOKZ-latest.zip" "gokz-latest.zip" "0" "LowercaseOff" "${systemdir}" "cfg;addons/sourcemod/configs;" "ENGINES" "Counter-Strike: Global Offensive;" "NOTGAMES" "https://bitbucket.org/kztimerglobalteam/gokz/src/master/" "Implements the KZ game mode (requires SourceMod and MetaMod)" ) @@ -99,4 +100,4 @@ mod_info_hwoxide=( MOD "hwoxide" "Oxide for Hurtworld" "${oxidehurtworldlatestli mod_info_sdtdoxide=( MOD "sdtdoxide" "Oxide for 7 Days To Die" "${oxidesdtdlatestlink}" "Oxide.SevenDaysToDie.zip" "0" "LowercaseOff" "${systemdir}" "OVERWRITE" "ENGINES" "7 Days To Die;" "NOTGAMES" "https://umod.org/games/7-days-to-die" "Allows for the use of plugins" ) # REQUIRED: Set all mods info into the global array -mods_global_array=( "${mod_info_metamod[@]}" "${mod_info_sourcemod[@]}" "${mod_info_steamworks[@]}" "${mod_info_gokz[@]}" "${mod_info_ttt[@]}" "${mod_info_get5[@]}" "${mod_info_pug[@]}" "${mod_info_ulib[@]}" "${mod_info_ulx[@]}" "${mod_info_utime[@]}" "${mod_info_uclip[@]}" "${mod_info_acf[@]}" "${mod_info_acf_missiles[@]}" "${mod_info_acf_sweps[@]}" "${mod_info_advdupe2[@]}" "${mod_info_pac3[@]}" "${mod_info_wiremod[@]}" "${mod_info_wiremodextras[@]}" "${mod_info_darkrp[@]}" "${mod_info_darkrpmodification[@]}" "${mod_info_rustoxide[@]}" "${mod_info_hwoxide[@]}" "${mod_info_sdtdoxide[@]}" ) +mods_global_array=( "${mod_info_metamod[@]}" "${mod_info_sourcemod[@]}" "${mod_info_steamworks[@]}" "${mod_info_stripper[@]}" "${mod_info_gokz[@]}" "${mod_info_ttt[@]}" "${mod_info_get5[@]}" "${mod_info_pug[@]}" "${mod_info_ulib[@]}" "${mod_info_ulx[@]}" "${mod_info_utime[@]}" "${mod_info_uclip[@]}" "${mod_info_acf[@]}" "${mod_info_acf_missiles[@]}" "${mod_info_acf_sweps[@]}" "${mod_info_advdupe2[@]}" "${mod_info_pac3[@]}" "${mod_info_wiremod[@]}" "${mod_info_wiremodextras[@]}" "${mod_info_darkrp[@]}" "${mod_info_darkrpmodification[@]}" "${mod_info_rustoxide[@]}" "${mod_info_hwoxide[@]}" "${mod_info_sdtdoxide[@]}" ) From f0f0a561330a9cf51b7cb60a66cc8d8099ef81e8 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Fri, 9 Oct 2020 12:12:17 +0100 Subject: [PATCH 02/24] feat: remove support for Serious Sam 3 and Goldeneye: Source (#3078) --- .../config-lgsm/gesserver/_default.cfg | 183 ------------------ .../config-lgsm/ss3server/_default.cfg | 181 ----------------- lgsm/data/serverlist.csv | 2 - lgsm/functions/check_deps.sh | 6 - lgsm/functions/core_functions.sh | 10 - lgsm/functions/fix.sh | 4 - lgsm/functions/fix_ges.sh | 10 - lgsm/functions/fix_ss3.sh | 23 --- lgsm/functions/info_config.sh | 78 -------- lgsm/functions/info_messages.sh | 15 +- lgsm/functions/info_parms.sh | 23 --- lgsm/functions/install_config.sh | 14 -- lgsm/functions/install_server_files.sh | 4 +- 13 files changed, 2 insertions(+), 551 deletions(-) delete mode 100644 lgsm/config-default/config-lgsm/gesserver/_default.cfg delete mode 100644 lgsm/config-default/config-lgsm/ss3server/_default.cfg delete mode 100755 lgsm/functions/fix_ges.sh delete mode 100755 lgsm/functions/fix_ss3.sh diff --git a/lgsm/config-default/config-lgsm/gesserver/_default.cfg b/lgsm/config-default/config-lgsm/gesserver/_default.cfg deleted file mode 100644 index 24f5f65bfc..0000000000 --- a/lgsm/config-default/config-lgsm/gesserver/_default.cfg +++ /dev/null @@ -1,183 +0,0 @@ -################################## -######## Default Settings ######## -################################## -# DO NOT EDIT, ANY CHANGES 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. - -#### Game Server Settings #### - -## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters -ip="0.0.0.0" -port="27015" -clientport="27005" -sourcetvport="27020" -defaultmap="ge_archives" -maxplayers="16" - -## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters -fn_parms(){ -parms="-game gesource -strictportbind -ip ${ip} -port ${port} +clientport ${clientport} +tv_port ${sourcetvport} +map ${defaultmap} +servercfgfile ${servercfg} -maxplayers ${maxplayers}" -} - -#### LinuxGSM Settings #### - -## LinuxGSM Stats -# Send useful stats to LinuxGSM developers. -# https://docs.linuxgsm.com/configuration/linuxgsm-stats -# (on|off) -stats="off" - -## Notification Alerts -# (on|off) - -# Display IP | https://docs.linuxgsm.com/alerts#display-ip -displayip="" - -# More info | https://docs.linuxgsm.com/alerts#more-info -postalert="off" - -# Discord Alerts | https://docs.linuxgsm.com/alerts/discord -discordalert="off" -discordwebhook="webhook" - -# Email Alerts | https://docs.linuxgsm.com/alerts/email -emailalert="off" -email="email@example.com" -emailfrom="" - -# IFTTT Alerts | https://docs.linuxgsm.com/alerts/ifttt -iftttalert="off" -ifttttoken="accesstoken" -iftttevent="linuxgsm_alert" - -# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun -mailgunalert="off" -mailgunapiregion="us" -mailguntoken="accesstoken" -mailgundomain="example.com" -mailgunemailfrom="alert@example.com" -mailgunemail="email@myemail.com" - -# Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet -pushbulletalert="off" -pushbullettoken="accesstoken" -channeltag="" - -# Pushover Alerts | https://docs.linuxgsm.com/alerts/pushover -pushoveralert="off" -pushovertoken="accesstoken" -pushoveruserkey="userkey" - -# Rocket.Chat Alerts | https://docs.linuxgsm.com/alerts/rocket.chat -rocketchatalert="off" -rocketchatwebhook="webhook" -rocketchattoken="" - -# Slack Alerts | https://docs.linuxgsm.com/alerts/slack -slackalert="off" -slackwebhook="webhook" - -# Telegram Alerts | https://docs.linuxgsm.com/alerts/telegram -# You can add a custom cURL string eg proxy (useful in Russia) in "curlcustomstring". -# For example "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help". -telegramalert="off" -telegramtoken="accesstoken" -telegramchatid="" -curlcustomstring="" - -## Updating | https://docs.linuxgsm.com/commands/update -updateonstart="off" - -## Backup | https://docs.linuxgsm.com/commands/backup -maxbackups="4" -maxbackupdays="30" -stoponbackup="on" - -## Logging | https://docs.linuxgsm.com/features/logging -consolelogging="on" -logdays="7" - -## Monitor | https://docs.linuxgsm.com/commands/monitor -# Query delay time -querydelay="1" - -## ANSI Colors | https://docs.linuxgsm.com/features/ansi-colors -ansi="on" - -#### Advanced Settings #### - -## Message Display Time | https://docs.linuxgsm.com/features/message-display-time -sleeptime="0.5" - -## SteamCMD Settings | https://docs.linuxgsm.com/steamcmd -# Server appid -appid="310" # Source 2007 SDK -# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch -branch="" -betapassword="" -# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server -steammaster="true" - -## Stop Mode | https://docs.linuxgsm.com/features/stop-mode -# 1: tmux kill -# 2: CTRL+c -# 3: quit -# 4: quit 120s -# 5: stop -# 6: q -# 7: exit -# 8: 7 Days to Die -# 9: GoldSrc -# 10: Avorion -# 11: end -stopmode="3" - -## Query mode -# 1: session only -# 2: gamedig (gsquery fallback) -# 3: gamedig -# 4: gsquery -# 5: tcp -querymode="2" -querytype="protocol-valve" - -## Console type -consoleverbose="yes" -consoleinteract="yes" - -## Game Server Details -# Do not edit -gamename="GoldenEye: Source" -engine="source" -glibc="2.15" - -#### Directories #### -# Edit with care - -## Game Server Directories -systemdir="${serverfiles}/gesource" -executabledir="${serverfiles}" -executable="./srcds_run" -servercfgdir="${systemdir}/cfg" -servercfg="${selfname}.cfg" -servercfgdefault="server.cfg" -servercfgfullpath="${servercfgdir}/${servercfg}" - -## Backup Directory -backupdir="${lgsmdir}/backup" - -## Logging Directories -logdir="${rootdir}/log" -gamelogdir="${systemdir}/logs" -lgsmlogdir="${logdir}/script" -consolelogdir="${logdir}/console" -lgsmlog="${lgsmlogdir}/${selfname}-script.log" -consolelog="${consolelogdir}/${selfname}-console.log" -alertlog="${lgsmlogdir}/${selfname}-alert.log" -postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" - -## Logs Naming -lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" -consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" diff --git a/lgsm/config-default/config-lgsm/ss3server/_default.cfg b/lgsm/config-default/config-lgsm/ss3server/_default.cfg deleted file mode 100644 index 9cb3f56012..0000000000 --- a/lgsm/config-default/config-lgsm/ss3server/_default.cfg +++ /dev/null @@ -1,181 +0,0 @@ -################################## -######## Default Settings ######## -################################## -# DO NOT EDIT, ANY CHANGES 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. - -#### Game Server Settings #### - -## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters -ip="0.0.0.0" - -## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters -# Edit with care | https://raw.githubusercontent.com/GameServerManagers/Game-Server-Configs/master/SeriousSam3BFE/help/DedicatedServer_Readme.txt -fn_parms(){ -parms="+ip ${ip} +logfile ${gamelog} +exec ${servercfgfullpath}" -} - -#### LinuxGSM Settings #### - -## LinuxGSM Stats -# Send useful stats to LinuxGSM developers. -# https://docs.linuxgsm.com/configuration/linuxgsm-stats -# (on|off) -stats="off" - -## Notification Alerts -# (on|off) - -# Display IP | https://docs.linuxgsm.com/alerts#display-ip -displayip="" - -# More info | https://docs.linuxgsm.com/alerts#more-info -postalert="off" - -# Discord Alerts | https://docs.linuxgsm.com/alerts/discord -discordalert="off" -discordwebhook="webhook" - -# Email Alerts | https://docs.linuxgsm.com/alerts/email -emailalert="off" -email="email@example.com" -emailfrom="" - -# IFTTT Alerts | https://docs.linuxgsm.com/alerts/ifttt -iftttalert="off" -ifttttoken="accesstoken" -iftttevent="linuxgsm_alert" - -# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun -mailgunalert="off" -mailgunapiregion="us" -mailguntoken="accesstoken" -mailgundomain="example.com" -mailgunemailfrom="alert@example.com" -mailgunemail="email@myemail.com" - -# Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet -pushbulletalert="off" -pushbullettoken="accesstoken" -channeltag="" - -# Pushover Alerts | https://docs.linuxgsm.com/alerts/pushover -pushoveralert="off" -pushovertoken="accesstoken" -pushoveruserkey="userkey" - -# Rocket.Chat Alerts | https://docs.linuxgsm.com/alerts/rocket.chat -rocketchatalert="off" -rocketchatwebhook="webhook" -rocketchattoken="" - -# Slack Alerts | https://docs.linuxgsm.com/alerts/slack -slackalert="off" -slackwebhook="webhook" - -# Telegram Alerts | https://docs.linuxgsm.com/alerts/telegram -# You can add a custom cURL string eg proxy (useful in Russia) in "curlcustomstring". -# For example "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help". -telegramalert="off" -telegramtoken="accesstoken" -telegramchatid="" -curlcustomstring="" - -## Updating | https://docs.linuxgsm.com/commands/update -updateonstart="off" - -## Backup | https://docs.linuxgsm.com/commands/backup -maxbackups="4" -maxbackupdays="30" -stoponbackup="on" - -## Logging | https://docs.linuxgsm.com/features/logging -consolelogging="on" -logdays="7" - -## Monitor | https://docs.linuxgsm.com/commands/monitor -# Query delay time -querydelay="1" - -## ANSI Colors | https://docs.linuxgsm.com/features/ansi-colors -ansi="on" - -#### Advanced Settings #### - -## Message Display Time | https://docs.linuxgsm.com/features/message-display-time -sleeptime="0.5" - -## SteamCMD Settings | https://docs.linuxgsm.com/steamcmd -# Server appid -appid="41080" -# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch -branch="" -betapassword="" -# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server -steammaster="false" - -## Stop Mode | https://docs.linuxgsm.com/features/stop-mode -# 1: tmux kill -# 2: CTRL+c -# 3: quit -# 4: quit 120s -# 5: stop -# 6: q -# 7: exit -# 8: 7 Days to Die -# 9: GoldSrc -# 10: Avorion -# 11: end -stopmode="2" - -## Query mode -# 1: session only -# 2: gamedig (gsquery fallback) -# 3: gamedig -# 4: gsquery -# 5: tcp -querymode="2" -querytype="protocol-valve" - -## Console type -consoleverbose="" -consoleinteract="" - -## Game Server Details -# Do not edit -gamename="Serious Sam 3: BFE" -engine="seriousengine35" -glibc="2.13" - -#### Directories #### -# Edit with care - -## Game Server Directories -systemdir="${serverfiles}/Bin" -executabledir="${systemdir}" -executable="./runSam3_DedicatedServer.sh" -servercfgdir="${serverfiles}/Content/SeriousSam3/Config" -servercfg="${selfname}.ini" -servercfgdefault="server.ini" -servercfgfullpath="${servercfgdir}/${servercfg}" - -## Backup Directory -backupdir="${lgsmdir}/backup" - -## Logging Directories -logdir="${rootdir}/log" -gamelogdir="${logdir}/server" -lgsmlogdir="${logdir}/script" -consolelogdir="${logdir}/console" -gamelog="${gamelogdir}/${selfname}-game.log" -lgsmlog="${lgsmlogdir}/${selfname}-script.log" -consolelog="${consolelogdir}/${selfname}-console.log" -alertlog="${lgsmlogdir}/${selfname}-alert.log" -postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" - -## Logs Naming -lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" -consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" -gamelogdate="${gamelogdir}/${selfname}-game-$(date '+%Y-%m-%d-%H:%M:%S').log" diff --git a/lgsm/data/serverlist.csv b/lgsm/data/serverlist.csv index 8a71858fea..b871357f9b 100644 --- a/lgsm/data/serverlist.csv +++ b/lgsm/data/serverlist.csv @@ -37,7 +37,6 @@ em,emserver,Empires Mod etl,etlserver,ET: Legacy fctr,fctrserver,Factorio fof,fofserver,Fistful of Frags -ges,gesserver,GoldenEye: Source gmod,gmodserver,Garrys Mod hl2dm,hl2dmserver,Half-Life 2: Deathmatch hldm,hldmserver,Half-Life: Deathmatch @@ -88,7 +87,6 @@ sfc,sfcserver,SourceForts Classic sof2,sof2server,Soldier Of Fortune 2: Gold Edition sol,solserver,Soldat squad,squadserver,Squad -ss3,ss3server,Serious Sam 3: BFE st,stserver,Stationeers sven,svenserver,Sven Co-op terraria,terrariaserver,Terraria diff --git a/lgsm/functions/check_deps.sh b/lgsm/functions/check_deps.sh index 18548e156a..60fc30c726 100755 --- a/lgsm/functions/check_deps.sh +++ b/lgsm/functions/check_deps.sh @@ -425,9 +425,6 @@ fn_deps_build_debian(){ else array_deps_required+=( default-jre rng-tools ) fi - # GoldenEye: Source - elif [ "${shortname}" == "ges" ]; then - array_deps_required+=( zlib1g:i386 libldap-2.4-2:i386 ) # Sven Co-op elif [ "${shortname}" == "sven" ]; then array_deps_required+=( libssl1.1:i386 zlib1g:i386 ) @@ -534,9 +531,6 @@ fn_deps_build_redhat(){ else array_deps_required+=( java-11-openjdk rng-tools ) fi - # GoldenEye: Source - elif [ "${shortname}" == "ges" ]; then - array_deps_required+=( zlib.i686 openldap.i686 ) # Sven Co-op elif [ "${shortname}" == "sven" ]; then : # not compatible diff --git a/lgsm/functions/core_functions.sh b/lgsm/functions/core_functions.sh index 308e3bb681..21ef3cbd1e 100755 --- a/lgsm/functions/core_functions.sh +++ b/lgsm/functions/core_functions.sh @@ -340,11 +340,6 @@ functionfile="${FUNCNAME[0]}" fn_fetch_function } -fix_ges.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - fix_hw.sh(){ functionfile="${FUNCNAME[0]}" fn_fetch_function @@ -450,11 +445,6 @@ functionfile="${FUNCNAME[0]}" fn_fetch_function } -fix_ss3.sh(){ -functionfile="${FUNCNAME[0]}" -fn_fetch_function -} - fix_ts3.sh(){ functionfile="${FUNCNAME[0]}" fn_fetch_function diff --git a/lgsm/functions/fix.sh b/lgsm/functions/fix.sh index ad52097479..f92709f569 100755 --- a/lgsm/functions/fix.sh +++ b/lgsm/functions/fix.sh @@ -48,8 +48,6 @@ if [ "${commandname}" != "INSTALL" ]&&[ -z "${fixbypass}" ]; then fix_cmw.sh elif [ "${shortname}" == "dst" ]; then fix_dst.sh - elif [ "${shortname}" == "ges" ]; then - fix_ges.sh elif [ "${shortname}" == "hw" ]; then fix_hw.sh elif [ "${shortname}" == "ins" ]; then @@ -70,8 +68,6 @@ if [ "${commandname}" != "INSTALL" ]&&[ -z "${fixbypass}" ]; then fix_sof2.sh elif [ "${shortname}" == "squad" ]; then fix_squad.sh - elif [ "${shortname}" == "ss3" ]; then - fix_ss3.sh elif [ "${shortname}" == "st" ]; then fix_st.sh elif [ "${shortname}" == "tf2" ]; then diff --git a/lgsm/functions/fix_ges.sh b/lgsm/functions/fix_ges.sh deleted file mode 100755 index 6065f9ba80..0000000000 --- a/lgsm/functions/fix_ges.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/bash -# LinuxGSM fix_ges.sh function -# Author: Daniel Gibbs -# Website: https://linuxgsm.com -# Description: Resolves various issues with GoldenEye: Source. - -functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" - -# Fixes: MALLOC_CHECK_ needing to be set to 0. -export MALLOC_CHECK_=0 diff --git a/lgsm/functions/fix_ss3.sh b/lgsm/functions/fix_ss3.sh deleted file mode 100755 index b19ba6f17e..0000000000 --- a/lgsm/functions/fix_ss3.sh +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/bash -# LinuxGSM fix_ss3.sh function -# Author: Daniel Gibbs -# Website: https://linuxgsm.com -# Description: Resolves various issues with Serious Sam 3. - -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 - # delete old steamclient.so file - rm -f "${serverfiles}/Bin/steamclient.so" - fn_fix_steamclient_so "32" "${serverfiles}/Bin" -fi - -# Fixes: .steam/bin32/libsteam.so: cannot open shared object file: No such file or directory -if [ ! -f "${HOME}/.steam/bin32/libsteam.so" ]; then - fixname="libsteam.so" - fn_fix_msg_start - mkdir -p "${HOME}/.steam/bin32" - cp "${serverfiles}/Bin/libsteam.so" "${HOME}/.steam/bin32/libsteam.so" - fn_fix_msg_end -fi diff --git a/lgsm/functions/info_config.sh b/lgsm/functions/info_config.sh index 1ca69764db..d54fdba96d 100755 --- a/lgsm/functions/info_config.sh +++ b/lgsm/functions/info_config.sh @@ -827,29 +827,6 @@ fn_info_config_rtcw(){ fi } -fn_info_config_seriousengine35(){ - if [ ! -f "${servercfgfullpath}" ]; then - servername="${unavailable}" - rconpassword="${unavailable}" - gamemode="${unavailable}" - maxplayers="${zero}" - port="${zero}" - else - servername=$(grep "prj_strMultiplayerSessionName" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/prj_strMultiplayerSessionName//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - rconpassword=$(grep "rcts_strAdminPassword" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/rcts_strAdminPassword//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - gamemode=$(grep "gam_idGameMode" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/gam_idGameMode//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') - maxplayers=$(grep "gam_ctMaxPlayers" "${servercfgfullpath}" | grep -v "//" | tr -cd '[:digit:]') - port=$(grep "prj_uwPort" "${servercfgfullpath}" | grep -v "//" | tr -cd '[:digit:]') - - # Not Set - servername=${servername:-"NOT SET"} - rconpassword=${rconpassword:-"NOT SET"} - gamemode=${gamemode:-"NOT SET"} - maxplayers=${maxplayers:-"0"} - port=${port:-"0"} - fi -} - #StickyBots fn_info_config_sbots(){ if [ ! -f "${servercfgfullpath}" ]; then @@ -1534,162 +1511,108 @@ fn_info_config_soldat(){ fi } -# Assetto Corsa if [ "${shortname}" == "ac" ]; then fn_info_config_assettocorsa -# ARK: Survival Evolved elif [ "${shortname}" == "ark" ]; then fn_info_config_ark -# Avorion elif [ "${shortname}" == "av" ]; then fn_info_config_avorion -# Ballistic Overkill elif [ "${shortname}" == "bo" ]; then fn_info_config_ballistic_overkill -# Barotrauma elif [ "${shortname}" == "bt" ]; then fn_info_config_barotrauma -# Battalion 1944 elif [ "${shortname}" == "bt1944" ]; then fn_info_config_battalion1944 -# Battlefield: 1942 elif [ "${shortname}" == "bf1942" ]; then fn_info_config_bf1942 -# Battlefield: Vietnam elif [ "${shortname}" == "bfv" ]; then fn_info_config_bfv -# Chivalry: Medieval Warfare elif [ "${shortname}" == "cmw" ]; then fn_info_config_chivalry -# Call of Duty elif [ "${shortname}" == "cod" ]||[ "${shortname}" == "coduo" ]; then fn_info_config_cod -# Call of Duty 2 elif [ "${shortname}" == "cod2" ]; then fn_info_config_cod2 -# Call of Duty 4 elif [ "${shortname}" == "cod4" ]; then fn_info_config_cod4 -# Call of Duty: World at War elif [ "${shortname}" == "codwaw" ]; then fn_info_config_codwaw -# Dont Starve Together elif [ "${shortname}" == "dst" ]; then fn_info_config_dontstarve -# Eco elif [ "${shortname}" == "eco" ]; then fn_info_config_eco -# Factorio elif [ "${shortname}" == "fctr" ]; then fn_info_config_factorio -# Insurgency: Sandstorm elif [ "${shortname}" == "inss" ]; then fn_info_config_inss -# Just Cause 2 elif [ "${shortname}" == "jc2" ]; then fn_info_config_justcause2 -# Just Cause 3 elif [ "${shortname}" == "jc3" ]; then fn_info_config_justcause3 -# Killing Floor 2 elif [ "${shortname}" == "kf2" ]; then fn_info_config_kf2 -# Medal of Honor: Allied Assault elif [ "${shortname}" == "mohaa" ]; then fn_info_config_mohaa -# Memories of Mars elif [ "${shortname}" == "mofm" ]; then fn_info_config_mofm -# QuakeWorld elif [ "${shortname}" == "qw" ]; then fn_info_config_quakeworld -# Quake 2 elif [ "${shortname}" == "q2" ]; then fn_info_config_quake2 -# Quake 3 elif [ "${shortname}" == "q3" ]; then fn_info_config_quake3 -# Quake Live elif [ "${shortname}" == "ql" ]; then fn_info_config_quakelive -# Jedi Knight II: Jedi Outcast elif [ "${shortname}" == "jk2" ]; then fn_info_config_jk2 -# Minecraft elif [ "${shortname}" == "mc" ]; then fn_info_config_minecraft -# Minecraft Bedrock elif [ "${shortname}" == "mcb" ]; then fn_info_config_minecraft_bedrock -# Onset elif [ "${shortname}" == "onset" ]; then fn_info_config_onset -# Post Scriptum: The Bloody Seventh elif [ "${shortname}" == "pstbs" ]; then fn_info_config_pstbs -# Project Cars elif [ "${shortname}" == "pc" ]; then fn_info_config_projectcars -# Project Zomboid elif [ "${shortname}" == "pz" ]; then fn_info_config_projectzomboid -# ARMA 3 elif [ "${shortname}" == "arma3" ]; then fn_info_config_realvirtuality -# Return to Castle Wolfenstein elif [ "${shortname}" == "rtcw" ]; then fn_info_config_rtcw -# Rising World elif [ "${shortname}" == "rw" ]; then fn_info_config_risingworld -# Serious Sam -elif [ "${shortname}" == "ss3" ]; then - fn_info_config_seriousengine35 -# Soldat elif [ "${shortname}" == "sol" ]; then fn_info_config_soldat -# Soldier Of Fortune 2: Gold Edition elif [ "${shortname}" == "sof2" ]; then fn_info_config_sof2 -# Source Engine Games elif [ "${engine}" == "source" ]||[ "${engine}" == "goldsrc" ]; then fn_info_config_source -# Starbound elif [ "${shortname}" == "sb" ]; then fn_info_config_starbound -# Teamspeak 3 elif [ "${shortname}" == "ts3" ]; then fn_info_config_teamspeak3 -# Mumble elif [ "${shortname}" == "mumble" ]; then fn_info_config_mumble -# San Andreas Multiplayer elif [ "${shortname}" == "samp" ]; then fn_info_config_samp -# StickyBots elif [ "${shortname}" == "pstbs" ]; then fn_info_config_sbots -# Teeworlds elif [ "${shortname}" == "tw" ]; then fn_info_config_teeworlds -# Terraria elif [ "${shortname}" == "terraria" ]; then fn_info_config_terraria -# Tower Unite elif [ "${shortname}" == "tu" ]; then fn_info_config_towerunite -# Unreal engine elif [ "${engine}" == "unreal" ]; then fn_info_config_unreal -# Unreal 2 engine elif [ "${engine}" == "unreal2" ]; then fn_info_config_unreal2 -# Unreal 3 engine elif [ "${engine}" == "unreal3" ]; then fn_info_config_unreal3 elif [ "${shortname}" == "ut" ]; then fn_info_config_ut -# 7 Day To Die (unity3d) elif [ "${shortname}" == "sdtd" ]; then fn_info_config_sdtd elif [ "${shortname}" == "wet" ]; then @@ -1704,7 +1627,6 @@ elif [ "${shortname}" == "mta" ]; then fn_info_config_mta elif [ "${shortname}" == "squad" ]; then fn_info_config_squad -# Stationeers elif [ "${shortname}" == "st" ]; then fn_info_config_stationeers elif [ "${shortname}" == "mh" ]; then diff --git a/lgsm/functions/info_messages.sh b/lgsm/functions/info_messages.sh index 15fd7aa5b0..4e1863f3e7 100755 --- a/lgsm/functions/info_messages.sh +++ b/lgsm/functions/info_messages.sh @@ -572,7 +572,7 @@ fn_info_message_ports(){ parmslocation="${red}UNKNOWN${default}" # engines/games that require editing in the config file. - local ports_edit_array=( "avalanche2.0" "avalanche3.0" "Ballistic Overkill" "dontstarve" "Eco" "idtech2" "idtech3" "idtech3_ql" "lwjgl2" "Minecraft Bedrock" "Project Cars" "projectzomboid" "quake" "refractor" "realvirtuality" "renderware" "seriousengine35" "Stationeers" "teeworlds" "terraria" "unreal" "unreal2" "unreal3" "TeamSpeak 3" "Mumble" "7 Days To Die" "wurm") + local ports_edit_array=( "avalanche2.0" "avalanche3.0" "Ballistic Overkill" "dontstarve" "Eco" "idtech2" "idtech3" "idtech3_ql" "lwjgl2" "Minecraft Bedrock" "Project Cars" "projectzomboid" "quake" "refractor" "realvirtuality" "renderware" "Stationeers" "teeworlds" "terraria" "unreal" "unreal2" "unreal3" "TeamSpeak 3" "Mumble" "7 Days To Die" "wurm") for port_edit in "${ports_edit_array[@]}"; do if [ "${shortname}" == "ut3" ]; then parmslocation="${servercfgdir}/UTWeb.ini" @@ -1081,17 +1081,6 @@ fn_info_message_samp(){ } | column -s $'\t' -t } - -fn_info_message_ss3(){ - echo -e "netstat -atunp | grep Sam3_Ded" - echo -e "" - { - echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" - echo -e "> Game/RCON\tINBOUND\t${port}\ttcp" - echo -e "> Query\tINBOUND\t${queryport}\tudp" - } | column -s $'\t' -t -} - fn_info_message_sbots(){ echo -e "netstat -atunp | grep blank1" echo -e "" @@ -1530,8 +1519,6 @@ fn_info_message_select_engine(){ fn_info_message_starbound elif [ "${shortname}" == "sbots" ]; then fn_info_message_sbots - elif [ "${shortname}" == "ss3" ]; then - fn_info_message_ss3 elif [ "${shortname}" == "terraria" ]; then fn_info_message_terraria elif [ "${shortname}" == "ts3" ]; then diff --git a/lgsm/functions/info_parms.sh b/lgsm/functions/info_parms.sh index 93df0309fe..57ca438500 100755 --- a/lgsm/functions/info_parms.sh +++ b/lgsm/functions/info_parms.sh @@ -187,11 +187,6 @@ fn_info_parms_sof2(){ defaultmap=${defaultmap:-"NOT SET"} } -fn_info_parms_ss3(){ - port=${port:-"0"} - queryport=$((port + 1)) -} - fn_info_parms_towerunite(){ port=${port:-"0"} queryport=${queryport:-"0"} @@ -233,19 +228,14 @@ fn_info_parms_wf(){ webadminport=${webadminport:-"0"} } -# ARK: Survival Evolved if [ "${shortname}" == "ark" ]; then fn_info_parms_ark -# ARMA 3 elif [ "${shortname}" == "arma3" ]; then fn_info_parms_realvirtuality -# Barotrauma elif [ "${shortname}" == "bt" ]; then fn_info_parms_barotrauma -# Call of Duty elif [ "${shortname}" == "cod" ]||[ "${shortname}" == "coduo" ]||[ "${engine}" == "iw2.0" ]||[ "${engine}" == "iw3.0" ]; then fn_info_parms_cod -# Factorio elif [ "${shortname}" == "fctr" ]; then fn_info_parms_factorio elif [ "${shortname}" == "inss" ]; then @@ -256,10 +246,8 @@ elif [ "${shortname}" == "kf2" ]; then fn_info_parms_kf2 elif [ "${shortname}" == "mohaa" ]; then fn_info_parms_mohaa -#Memories of Mars elif [ "${shortname}" == "mom" ]; then fn_info_parms_mom -# Project Zomboid elif [ "${shortname}" == "pz" ]; then fn_info_parms_projectzomboid elif [ "${shortname}" == "qw" ]; then @@ -268,26 +256,18 @@ elif [ "${shortname}" == "q2" ]||[ "${shortname}" == "q3" ]; then fn_info_parms_quake2 elif [ "${shortname}" == "rtcw" ]; then fn_info_parms_rtcw -# Rust elif [ "${shortname}" == "rust" ]; then fn_info_parms_rust elif [ "${shortname}" == "samp" ]; then fn_info_parms_samp -# Rising World elif [ "${shortname}" == "rw" ]; then fn_info_parms_risingworld -# Soldier Of Fortune 2: Gold Edition elif [ "${shortname}" == "sof2" ]; then fn_info_parms_sof2 -# Sticky Bots elif [ "${shortname}" == "sbots" ]; then fn_info_parms_stickybots -# Serious Sam -elif [ "${shortname}" == "ss3" ]; then - fn_info_parms_ss3 elif [ "${engine}" == "source" ]||[ "${engine}" == "goldsrc" ]; then fn_info_parms_source -# Spark elif [ "${engine}" == "spark" ]; then fn_info_parms_spark elif [ "${shortname}" == "tu" ]; then @@ -298,17 +278,14 @@ elif [ "${shortname}" == "mh" ]; then fn_info_parms_mordhau elif [ "${shortname}" == "mta" ]; then fn_info_parms_mta -# Unreal/Unreal 2 engine elif [ "${engine}" == "unreal" ]||[ "${engine}" == "unreal2" ]; then fn_info_parms_unreal -# Unreal 3 engine elif [ "${engine}" == "unreal3" ]; then fn_info_parms_unreal3 elif [ "${shortname}" == "unt" ]; then fn_info_parms_unturned elif [ "${shortname}" == "ut" ]; then fn_info_parms_ut -# Warfork elif [ "${shortname}" == "wf" ]; then fn_info_parms_wf fi diff --git a/lgsm/functions/install_config.sh b/lgsm/functions/install_config.sh index 63589b81c1..543bd0a3d7 100755 --- a/lgsm/functions/install_config.sh +++ b/lgsm/functions/install_config.sh @@ -429,13 +429,6 @@ elif [ "${shortname}" == "gmod" ]; then fn_default_config_remote fn_set_config_vars fn_list_config_locations -elif [ "${shortname}" == "ges" ]; then - gamedirname="GoldenEyeSource" - array_configs+=( server.cfg ) - fn_fetch_default_config - fn_default_config_remote - fn_set_config_vars - fn_list_config_locations elif [ "${shortname}" == "hldm" ]; then gamedirname="HalfLifeDeathmatch" array_configs+=( server.cfg ) @@ -667,13 +660,6 @@ elif [ "${shortname}" == "samp" ]; then fn_default_config_remote fn_set_config_vars fn_list_config_locations -elif [ "${shortname}" == "ss3" ]; then - gamedirname="SeriousSam3BFE" - array_configs+=( server.ini ) - fn_fetch_default_config - fn_default_config_remote - fn_set_config_vars - fn_list_config_locations elif [ "${shortname}" == "sol" ]; then gamedirname="Soldat" array_configs+=( soldat.ini ) diff --git a/lgsm/functions/install_server_files.sh b/lgsm/functions/install_server_files.sh index 979a32805f..73f2dc2b11 100755 --- a/lgsm/functions/install_server_files.sh +++ b/lgsm/functions/install_server_files.sh @@ -27,8 +27,6 @@ fn_install_server_files(){ remote_fileurl="http://linuxgsm.download/CallOfDutyWorldAtWar/codwaw-lnxded-1.7-full.tar.xz"; local_filedir="${tmpdir}"; local_filename="codwaw-lnxded-1.7-full.tar.xz"; chmodx="nochmodx" run="norun"; force="noforce"; md5="2c6be1bb66ea631b9b2e7ae6216c6680" elif [ "${shortname}" == "etl" ]; then remote_fileurl="http://linuxgsm.download/WolfensteinEnemyTerritory/etlegacy-v2.76-i386-et-260b.tar.xz"; local_filedir="${tmpdir}"; local_filename="etlegacy-v2.75-i386-et-260b.tar.bz2"; chmodx="nochmodx" run="norun"; force="noforce"; md5="178a00233cec1e25b69d130107ce1a79" - elif [ "${shortname}" == "ges" ]; then - remote_fileurl="http://linuxgsm.download/GoldenEyeSource/GoldenEye_Source_v5.0.6_full_server.tar.xz"; local_filedir="${tmpdir}"; local_filename="GoldenEye_Source_v5.0.6_full_server.tar.xz"; chmodx="nochmodx" run="norun"; force="noforce"; md5="e31481f280eed40c9145816bd4f6dc45" elif [ "${shortname}" == "mohaa" ]; then remote_fileurl="http://linuxgsm.download/MedalofHonorAlliedAssault/moh_revival_v1.12_RC3.5.1.tar.xz"; local_filedir="${tmpdir}"; local_filename="moh_revival_v1.12_RC3.5.1.tar.xz"; chmodx="nochmodx" run="norun"; force="noforce"; md5="7c664538999252eeaf2b6d9949416480" elif [ "${shortname}" == "ns" ]; then @@ -93,7 +91,7 @@ elif [ "${shortname}" == "fctr" ]; then install_factorio_save.sh elif [ "${shortname}" == "jk2" ]; then update_jediknight2.sh -elif [ -z "${appid}" ]||[ "${shortname}" == "ahl" ]||[ "${shortname}" == "bd" ]||[ "${shortname}" == "bb" ]||[ "${shortname}" == "ges" ]||[ "${shortname}" == "ns" ]||[ "${shortname}" == "sfc" ]||[ "${shortname}" == "ts" ]||[ "${shortname}" == "vs" ]||[ "${shortname}" == "zmr" ]; then +elif [ -z "${appid}" ]||[ "${shortname}" == "ahl" ]||[ "${shortname}" == "bd" ]||[ "${shortname}" == "bb" ]||[ "${shortname}" == "ns" ]||[ "${shortname}" == "sfc" ]||[ "${shortname}" == "ts" ]||[ "${shortname}" == "vs" ]||[ "${shortname}" == "zmr" ]; then if [ "${shortname}" == "ut" ]; then install_eula.sh fi From a75ce429b52c8c5d57810ad007ece0eecf24b9af Mon Sep 17 00:00:00 2001 From: Max Vaessen Date: Sat, 10 Oct 2020 23:14:19 +0200 Subject: [PATCH 03/24] feat: allow forks to use master branch (#3073) The standard behaviour for master is that it uses the release/version number rather than the latest master. This is designed to prevent modules "version mixing" e.g alerts.sh being on v20.4.0 and alerts_discord.sh being v20.5.0. Version mixing can cause unpredictable behaviour and break installs. This solution will ensure that only the official the GameServerManagers repo uses this method. This allows forked repos to use custom code in master ignoring the release. --- README.md | 2 +- lgsm/functions/core_dl.sh | 14 +++++++++----- linuxgsm.sh | 3 ++- tests/tests_fctrserver.sh | 3 ++- tests/tests_jc2server.sh | 3 ++- tests/tests_mcserver.sh | 3 ++- tests/tests_ts3server.sh | 3 ++- 7 files changed, 20 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 7e8c789d30..6f6f41c6f4 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ LinuxGSM -[![LinuxGSM](https://img.shields.io/badge/-LinuxGSM-2b2b2b.svg?logo=data%3Aimage%2Fpng%3Bbase64%2CiVBORw0KGgoAAAANSUhEUgAAACsAAABACAYAAACDbo5ZAAAGD0lEQVR4AcWYa2wUVRvHz75c2vJ2disXoUBEVIioRAx%2BMIFA1IRwUS6KCCiIKBrvhEYiiGm5iBgk8QOGEgUUDYTttmVZWFr2UmwURS6iYAoCtmisElSsdHdbkT7%2BTzoNy%2BGc2dm54C%2F5Rdkz85x%2FZ86ZOXOYXYhIg3Phx%2FA4PAcv6f%2Btg5vhHJjP3EcZsgsshufJHH%2FAJbDztQ7aG35J1vgCXn%2BtgvrgEbLHYei9FmE3kDOUuh10OGwjZ7gEh7kZ9gNyllK3gnrg7%2BQs56DHjbCDyB0GuRF2ArnDeDfCziF3mO1G2FfJHRa4EXYpuUOxG2GXkzuUuBH2TXKH5W6ELSV3eM%2BNsOUk5yQcAY8p2uvgSPitor3MjbB1UOQXOFBvHwpbhPYWOExvL4SNUOQ7p4P2JTlzhOPmCu0vCu1PQpE2WOhk2MdJjk9y7HNwP1wEPUJbAcmZ6WTYrYolnifbxZBiibnFySHQCkUaLdY7C0V4%2FT5OhF1JcuIW6%2B0lOcvsBi2Ezao3j8Ov7Quwj52w60jNKIs1R5GatVaDDoEXSU4D7GSxbidYT3IuwjusFK0mNUVMwaZNNbl%2B%2F87hoVCom0HthaQmnG3QB0lNPcxlCvz%2B0GtlZTuorCxYYlA%2FDzbY%2FnrAgV3hCVLzCDMgEAi9wMMi9IIM%2FUwnNXWwi5mwRaSmmmXA798xq%2F3Khp420VeE1LyS6eQeBhttSXgzywCCToIUCOyYZvKLOWWwkdfd6ORVpGYJM0F5efDe9mEQHGty2BWTmhVGO4PNBmOoKzMBxmo%2FhD25dWvljSbD5hjMkb9gT9lJq63Mzi1bKkbjloc7xBWtwiRrDASCVRi%2FRxA8if%2BvrawMTzYI%2FACpeUv2KFFtDcUyTKilCHcis8G1Ga7wHpLzG8wVFs1K7jaeUKHZfIxmkj9%2FM4S9x9RGiMEudo0QbCVu9Xqn5PWEwLUk5%2FP0iaXac53I0kAH9Sau4m54lo%2FdTMfyekLYKQZ7ub34AbMMlmw5irC2VYTN0fuVMYMf8JHxJ7L7YYXAlSRnI2%2F8RtH4siTsDMz%2BZ5yS15OEXUxyDjGD1%2BvEq8MG16CDzY6JepKwT6geYbzxb0XjGMl7vwGSgzZIwo4nOa1M8Yr9Afb%2Fj8L21%2FsXaeaNZ2A6KTiEASph%2F0vF80cn4tokqu79fzfCUk2vfF4%2FFdFGEjGPHvg2yWrsDG%2F4%2BqpZB8jPOiXjWk0y5iXdM3XhKUvxBTA9UvHuvNPh%2Bzb%2BWj10z6nwuHWBbQFMvNCjKnn7qd1jS%2Fnx9VX3b6jC%2BbwOr5eMe3%2B83IcW4%2F3qgT%2BUTbA9srGaiHsn8AKiF6Ld%2FxF%2FOx6eeAJXabvK78MTTornNMd6XJTVR7%2Fj9bBjhFxV%2FMc1kJOAy2AeA%2FgrV4mFVDZFCqm8rEJ6qysCAWqK9iaztRJRbWXa4moFTELOav7jY%2FqAvoXp0Gc9NX7bIZl17%2FZl0rC1wRLeno0NvP%2B0CTcYNnS8wW6CtzNANaxzKqo9hRNOQ8rGo7tmSsMe2zWdt2frqVRcm5s2fofCgawDNHRNxnyfqgsYez4y4ADCjRM9H73hsNWafILTQdaFiSTj%2BQ%2FxA6yH7d%2BCmR8XbYr0a7VTF2N4siSsb5qdos3R6%2FjGxpULFfw7EfORnbrI9TAToX0sD40%2F2ylcGdh2Rdhg%2BSf2gka9jRTqK9%2BGwgHz7RTfVbHxirDhivdthYUvMRX8aYAD9lstvi%2B0aDL2DUZ0eCBUNNVG0IP65FLTWqPdiqdC0koHTVXe7iyNRG23QotBEy1RbTAzQyrmnYUT2rLsoA13JpcB4eVC2daBM1g2JGLekmwf5On7EJfngfZTNnVSce8bFjaTmQdvs%2FXmO%2FJVpoXdx3RSUe9O00Fj3nUdy0RLgRHiHXOPGW1h2uKZ07c9rG%2Bxyefp23pQeyBIEQoavYlakrG8fnrY5yHn2fbxXzAgw7m8bT5zkkSk4C7cpmOK21esB%2FXAQ5DzFfTo43%2BF%2FDzf0eZ4wZ3MDSjMcvD6nIeOahGgia%2FyU3HforTPkWkwnakdn0cI9jqfbPjD%2FuQLJr6644snlgX%2FApOMoyd1R5%2FxAAAAAElFTkSuQmCC)](https://linuxgsm.com) [![Build Status](https://travis-ci.com/GameServerManagers/LinuxGSM.svg?branch=master)](https://travis-ci.com/GameServerManagers/LinuxGSM) [![Codacy Badge](https://api.codacy.com/project/badge/Grade/3e98be27840043a090c3ab6e35db44b0)](https://app.codacy.com/app/GameServerManagers/LinuxGSM?utm_source=github.com&utm_medium=referral&utm_content=GameServerManagers/LinuxGSM&utm_campaign=Badge_Grade_Dashboard) [![Codacy Badge](https://api.codacy.com/project/badge/Coverage/9ef77095e98a43618ddd57381f86b4be)](https://www.codacy.com/manual/GameServerManagers/LinuxGSM?utm_source=github.com&utm_medium=referral&utm_content=GameServerManagers/LinuxGSM&utm_campaign=Badge_Coverage) [![Backup Repo](https://github.com/GameServerManagers/LinuxGSM/workflows/Backup%20Repo/badge.svg)](https://bitbucket.org/GameServerManagers/linuxgsm) [![Discord](https://discordapp.com/api/guilds/127498813903601664/widget.png?style=shield)](https://linuxgsm.com/discord) [![MIT Licence](https://badges.frapsoft.com/os/mit/mit.svg?v=103)](https://github.com/GameServerManagers/LinuxGSM/blob/master/LICENSE) [![made-with-bash](https://img.shields.io/badge/-Made%20with%20Bash-1f425f.svg?logo=image%2Fpng%3Bbase64%2CiVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyZpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw%2FeHBhY2tldCBiZWdpbj0i77u%2FIiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8%2BIDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTExIDc5LjE1ODMyNSwgMjAxNS8wOS8xMC0wMToxMDoyMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTUgKFdpbmRvd3MpIiB4bXBNTTpJbnN0YW5jZUlEPSJ4bXAuaWlkOkE3MDg2QTAyQUZCMzExRTVBMkQxRDMzMkJDMUQ4RDk3IiB4bXBNTTpEb2N1bWVudElEPSJ4bXAuZGlkOkE3MDg2QTAzQUZCMzExRTVBMkQxRDMzMkJDMUQ4RDk3Ij4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6QTcwODZBMDBBRkIzMTFFNUEyRDFEMzMyQkMxRDhEOTciIHN0UmVmOmRvY3VtZW50SUQ9InhtcC5kaWQ6QTcwODZBMDFBRkIzMTFFNUEyRDFEMzMyQkMxRDhEOTciLz4gPC9yZGY6RGVzY3JpcHRpb24%2BIDwvcmRmOlJERj4gPC94OnhtcG1ldGE%2BIDw%2FeHBhY2tldCBlbmQ9InIiPz6lm45hAAADkklEQVR42qyVa0yTVxzGn7d9Wy03MS2ii8s%2BeokYNQSVhCzOjXZOFNF4jx%2BMRmPUMEUEqVG36jo2thizLSQSMd4N8ZoQ8RKjJtooaCpK6ZoCtRXKpRempbTv5ey83bhkAUphz8fznvP8znn%2B%2F3NeEEJgNBoRRSmz0ub%2FfuxEacBg%2FDmYtiCjgo5NG2mBXq%2BH5I1ogMRk9Zbd%2BQU2e1ML6VPLOyf5tvBQ8yT1lG10imxsABm7SLs898GTpyYynEzP60hO3trHDKvMigUwdeaceacqzp7nOI4n0SSIIjl36ao4Z356OV07fSQAk6xJ3XGg%2BLCr1d1OYlVHp4eUHPnerU79ZA%2F1kuv1JQMAg%2BE4O2P23EumF3VkvHprsZKMzKwbRUXFEyTvSIEmTVbrysp%2BWr8wfQHGK6WChVa3bKUmdWou%2BjpArdGkzZ41c1zG%2Fu5uGH4swzd561F%2BuhIT4%2BLnSuPsv9%2BJKIpjNr9dXYOyk7%2FBZrcjIT4eCnoKgedJP4BEqhG77E3NKP31FO7cfQA5K0dSYuLgz2TwCWJSOBzG6crzKK%2BohNfni%2Bx6OMUMMNe%2Fgf7ocbw0v0acKg6J8Ql0q%2BT%2FAXR5PNi5dz9c71upuQqCKFAD%2BYhrZLEAmpodaHO3Qy6TI3NhBpbrshGtOWKOSMYwYGQM8nJzoFJNxP2HjyIQho4PewK6hBktoDcUwtIln4PjOWzflQ%2Be5yl0yCCYgYikTclGlxadio%2BBQCSiW1UXoVGrKYwH4RgMrjU1HAB4vR6LzWYfFUCKxfS8Ftk5qxHoCUQAUkRJaSEokkV6Y%2F%2BJUOC4hn6A39NVXVBYeNP8piH6HeA4fPbpdBQV5KOx0QaL1YppX3Jgk0TwH2Vg6S3u%2BdB91%2B%2FpuNYPYFl5uP5V7ZqvsrX7jxqMXR6ff3gCQSTzFI0a1TX3wIs8ul%2Bq4HuWAAiM39vhOuR1O1fQ2gT%2F26Z8Z5vrl2OHi9OXZn995nLV9aFfS6UC9JeJPfuK0NBohWpCHMSAAsFe74WWP%2BvT25wtP9Bpob6uGqqyDnOtaeumjRu%2ByFu36VntK%2FPA5umTJeUtPWZSU9BCgud661odVp3DZtkc7AnYR33RRC708PrVi1larW7XwZIjLnd7R6SgSqWSNjU1B3F72pz5TZbXmX5vV81Yb7Lg7XT%2FUXriu8XLVqw6c6XqWnBKiiYU%2BMt3wWF7u7i91XlSEITwSAZ%2FCzAAHsJVbwXYFFEAAAAASUVORK5CYII%3D)](https://www.gnu.org/software/bash/) +[![LinuxGSM](https://img.shields.io/badge/-LinuxGSM-2b2b2b.svg?logo=data%3Aimage%2Fpng%3Bbase64%2CiVBORw0KGgoAAAANSUhEUgAAACsAAABACAYAAACDbo5ZAAAGD0lEQVR4AcWYa2wUVRvHz75c2vJ2disXoUBEVIioRAx%2BMIFA1IRwUS6KCCiIKBrvhEYiiGm5iBgk8QOGEgUUDYTttmVZWFr2UmwURS6iYAoCtmisElSsdHdbkT7%2BTzoNy%2BGc2dm54C%2F5Rdkz85x%2FZ86ZOXOYXYhIg3Phx%2FA4PAcv6f%2Btg5vhHJjP3EcZsgsshufJHH%2FAJbDztQ7aG35J1vgCXn%2BtgvrgEbLHYei9FmE3kDOUuh10OGwjZ7gEh7kZ9gNyllK3gnrg7%2BQs56DHjbCDyB0GuRF2ArnDeDfCziF3mO1G2FfJHRa4EXYpuUOxG2GXkzuUuBH2TXKH5W6ELSV3eM%2BNsOUk5yQcAY8p2uvgSPitor3MjbB1UOQXOFBvHwpbhPYWOExvL4SNUOQ7p4P2JTlzhOPmCu0vCu1PQpE2WOhk2MdJjk9y7HNwP1wEPUJbAcmZ6WTYrYolnifbxZBiibnFySHQCkUaLdY7C0V4%2FT5OhF1JcuIW6%2B0lOcvsBi2Ezao3j8Ov7Quwj52w60jNKIs1R5GatVaDDoEXSU4D7GSxbidYT3IuwjusFK0mNUVMwaZNNbl%2B%2F87hoVCom0HthaQmnG3QB0lNPcxlCvz%2B0GtlZTuorCxYYlA%2FDzbY%2FnrAgV3hCVLzCDMgEAi9wMMi9IIM%2FUwnNXWwi5mwRaSmmmXA798xq%2F3Khp420VeE1LyS6eQeBhttSXgzywCCToIUCOyYZvKLOWWwkdfd6ORVpGYJM0F5efDe9mEQHGty2BWTmhVGO4PNBmOoKzMBxmo%2FhD25dWvljSbD5hjMkb9gT9lJq63Mzi1bKkbjloc7xBWtwiRrDASCVRi%2FRxA8if%2BvrawMTzYI%2FACpeUv2KFFtDcUyTKilCHcis8G1Ga7wHpLzG8wVFs1K7jaeUKHZfIxmkj9%2FM4S9x9RGiMEudo0QbCVu9Xqn5PWEwLUk5%2FP0iaXac53I0kAH9Sau4m54lo%2FdTMfyekLYKQZ7ub34AbMMlmw5irC2VYTN0fuVMYMf8JHxJ7L7YYXAlSRnI2%2F8RtH4siTsDMz%2BZ5yS15OEXUxyDjGD1%2BvEq8MG16CDzY6JepKwT6geYbzxb0XjGMl7vwGSgzZIwo4nOa1M8Yr9Afb%2Fj8L21%2FsXaeaNZ2A6KTiEASph%2F0vF80cn4tokqu79fzfCUk2vfF4%2FFdFGEjGPHvg2yWrsDG%2F4%2BqpZB8jPOiXjWk0y5iXdM3XhKUvxBTA9UvHuvNPh%2Bzb%2BWj10z6nwuHWBbQFMvNCjKnn7qd1jS%2Fnx9VX3b6jC%2BbwOr5eMe3%2B83IcW4%2F3qgT%2BUTbA9srGaiHsn8AKiF6Ld%2FxF%2FOx6eeAJXabvK78MTTornNMd6XJTVR7%2Fj9bBjhFxV%2FMc1kJOAy2AeA%2FgrV4mFVDZFCqm8rEJ6qysCAWqK9iaztRJRbWXa4moFTELOav7jY%2FqAvoXp0Gc9NX7bIZl17%2FZl0rC1wRLeno0NvP%2B0CTcYNnS8wW6CtzNANaxzKqo9hRNOQ8rGo7tmSsMe2zWdt2frqVRcm5s2fofCgawDNHRNxnyfqgsYez4y4ADCjRM9H73hsNWafILTQdaFiSTj%2BQ%2FxA6yH7d%2BCmR8XbYr0a7VTF2N4siSsb5qdos3R6%2FjGxpULFfw7EfORnbrI9TAToX0sD40%2F2ylcGdh2Rdhg%2BSf2gka9jRTqK9%2BGwgHz7RTfVbHxirDhivdthYUvMRX8aYAD9lstvi%2B0aDL2DUZ0eCBUNNVG0IP65FLTWqPdiqdC0koHTVXe7iyNRG23QotBEy1RbTAzQyrmnYUT2rLsoA13JpcB4eVC2daBM1g2JGLekmwf5On7EJfngfZTNnVSce8bFjaTmQdvs%2FXmO%2FJVpoXdx3RSUe9O00Fj3nUdy0RLgRHiHXOPGW1h2uKZ07c9rG%2Bxyefp23pQeyBIEQoavYlakrG8fnrY5yHn2fbxXzAgw7m8bT5zkkSk4C7cpmOK21esB%2FXAQ5DzFfTo43%2BF%2FDzf0eZ4wZ3MDSjMcvD6nIeOahGgia%2FyU3HforTPkWkwnakdn0cI9jqfbPjD%2FuQLJr6644snlgX%2FApOMoyd1R5%2FxAAAAAElFTkSuQmCC)](https://linuxgsm.com) [![Build Status](https://travis-ci.com/GameServerManagers/LinuxGSM.svg?branch=master)](https://travis-ci.com/GameServerManagers/LinuxGSM) [![Codacy Badge](https://app.codacy.com/project/badge/Grade/d19c5234dc3743d8a8a14093711ca52d)](https://www.codacy.com/gh/GameServerManagers/LinuxGSM/dashboard?utm_source=github.com&utm_medium=referral&utm_content=GameServerManagers/LinuxGSM&utm_campaign=Badge_Grade) [![Backup Repo](https://github.com/GameServerManagers/LinuxGSM/workflows/Backup%20Repo/badge.svg)](https://bitbucket.org/GameServerManagers/linuxgsm) [![Discord](https://discordapp.com/api/guilds/127498813903601664/widget.png?style=shield)](https://linuxgsm.com/discord) [![MIT Licence](https://badges.frapsoft.com/os/mit/mit.svg?v=103)](https://github.com/GameServerManagers/LinuxGSM/blob/master/LICENSE) [![made-with-bash](https://img.shields.io/badge/-Made%20with%20Bash-1f425f.svg?logo=image%2Fpng%3Bbase64%2CiVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyZpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw%2FeHBhY2tldCBiZWdpbj0i77u%2FIiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8%2BIDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTExIDc5LjE1ODMyNSwgMjAxNS8wOS8xMC0wMToxMDoyMCAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTUgKFdpbmRvd3MpIiB4bXBNTTpJbnN0YW5jZUlEPSJ4bXAuaWlkOkE3MDg2QTAyQUZCMzExRTVBMkQxRDMzMkJDMUQ4RDk3IiB4bXBNTTpEb2N1bWVudElEPSJ4bXAuZGlkOkE3MDg2QTAzQUZCMzExRTVBMkQxRDMzMkJDMUQ4RDk3Ij4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6QTcwODZBMDBBRkIzMTFFNUEyRDFEMzMyQkMxRDhEOTciIHN0UmVmOmRvY3VtZW50SUQ9InhtcC5kaWQ6QTcwODZBMDFBRkIzMTFFNUEyRDFEMzMyQkMxRDhEOTciLz4gPC9yZGY6RGVzY3JpcHRpb24%2BIDwvcmRmOlJERj4gPC94OnhtcG1ldGE%2BIDw%2FeHBhY2tldCBlbmQ9InIiPz6lm45hAAADkklEQVR42qyVa0yTVxzGn7d9Wy03MS2ii8s%2BeokYNQSVhCzOjXZOFNF4jx%2BMRmPUMEUEqVG36jo2thizLSQSMd4N8ZoQ8RKjJtooaCpK6ZoCtRXKpRempbTv5ey83bhkAUphz8fznvP8znn%2B%2F3NeEEJgNBoRRSmz0ub%2FfuxEacBg%2FDmYtiCjgo5NG2mBXq%2BH5I1ogMRk9Zbd%2BQU2e1ML6VPLOyf5tvBQ8yT1lG10imxsABm7SLs898GTpyYynEzP60hO3trHDKvMigUwdeaceacqzp7nOI4n0SSIIjl36ao4Z356OV07fSQAk6xJ3XGg%2BLCr1d1OYlVHp4eUHPnerU79ZA%2F1kuv1JQMAg%2BE4O2P23EumF3VkvHprsZKMzKwbRUXFEyTvSIEmTVbrysp%2BWr8wfQHGK6WChVa3bKUmdWou%2BjpArdGkzZ41c1zG%2Fu5uGH4swzd561F%2BuhIT4%2BLnSuPsv9%2BJKIpjNr9dXYOyk7%2FBZrcjIT4eCnoKgedJP4BEqhG77E3NKP31FO7cfQA5K0dSYuLgz2TwCWJSOBzG6crzKK%2BohNfni%2Bx6OMUMMNe%2Fgf7ocbw0v0acKg6J8Ql0q%2BT%2FAXR5PNi5dz9c71upuQqCKFAD%2BYhrZLEAmpodaHO3Qy6TI3NhBpbrshGtOWKOSMYwYGQM8nJzoFJNxP2HjyIQho4PewK6hBktoDcUwtIln4PjOWzflQ%2Be5yl0yCCYgYikTclGlxadio%2BBQCSiW1UXoVGrKYwH4RgMrjU1HAB4vR6LzWYfFUCKxfS8Ftk5qxHoCUQAUkRJaSEokkV6Y%2F%2BJUOC4hn6A39NVXVBYeNP8piH6HeA4fPbpdBQV5KOx0QaL1YppX3Jgk0TwH2Vg6S3u%2BdB91%2B%2FpuNYPYFl5uP5V7ZqvsrX7jxqMXR6ff3gCQSTzFI0a1TX3wIs8ul%2Bq4HuWAAiM39vhOuR1O1fQ2gT%2F26Z8Z5vrl2OHi9OXZn995nLV9aFfS6UC9JeJPfuK0NBohWpCHMSAAsFe74WWP%2BvT25wtP9Bpob6uGqqyDnOtaeumjRu%2ByFu36VntK%2FPA5umTJeUtPWZSU9BCgud661odVp3DZtkc7AnYR33RRC708PrVi1larW7XwZIjLnd7R6SgSqWSNjU1B3F72pz5TZbXmX5vV81Yb7Lg7XT%2FUXriu8XLVqw6c6XqWnBKiiYU%2BMt3wWF7u7i91XlSEITwSAZ%2FCzAAHsJVbwXYFFEAAAAASUVORK5CYII%3D)](https://www.gnu.org/software/bash/) [LinuxGSM](https://linuxgsm.com) is the command-line tool for quick, simple deployment and management of Linux dedicated game servers. diff --git a/lgsm/functions/core_dl.sh b/lgsm/functions/core_dl.sh index b8e1b2b862..b5c92b3c1c 100755 --- a/lgsm/functions/core_dl.sh +++ b/lgsm/functions/core_dl.sh @@ -349,11 +349,12 @@ fn_fetch_file(){ fn_fetch_file_github(){ github_file_url_dir="${1}" github_file_url_name="${2}" + # For legacy versions - code can be removed at a future date if [ "${legacymode}" == "1" ]; then - # For legacy versions - code can be removed at a future date remote_fileurl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" remote_fileurl_backup="https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/${github_file_url_dir}/${github_file_url_name}" - elif [ "${githubbranch}" == "master" ]&&[ "${commandname}" != "UPDATE-LGSM" ]; then + # If master branch will currently running LinuxGSM version to prevent "version mixing". This is ignored if a fork. + elif [ "${githubbranch}" == "master" ]&&[ "${githubuser}" == "GameServerManager" ]&&[ "${commandname}" != "UPDATE-LGSM" ]; then remote_fileurl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${version}/${github_file_url_dir}/${github_file_url_name}" remote_fileurl_backup="https://bitbucket.org/${githubuser}/${githubrepo}/raw/${version}/${github_file_url_dir}/${github_file_url_name}" else @@ -376,7 +377,8 @@ fn_fetch_file_github(){ fn_fetch_config(){ github_file_url_dir="${1}" github_file_url_name="${2}" - if [ "${githubbranch}" == "master" ]&&[ "${commandname}" != "UPDATE-LGSM" ]; then + # If master branch will currently running LinuxGSM version to prevent "version mixing". This is ignored if a fork. + if [ "${githubbranch}" == "master" ]&&[ "${githubuser}" == "GameServerManager" ]&&[ "${commandname}" != "UPDATE-LGSM" ]; then remote_fileurl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${version}/${github_file_url_dir}/${github_file_url_name}" remote_fileurl_backup="https://bitbucket.org/${githubuser}/${githubrepo}/raw/${version}/${github_file_url_dir}/${github_file_url_name}" else @@ -399,7 +401,8 @@ fn_fetch_config(){ fn_fetch_function(){ github_file_url_dir="lgsm/functions" github_file_url_name="${functionfile}" - if [ "${githubbranch}" == "master" ]&&[ "${commandname}" != "UPDATE-LGSM" ]; then + # If master branch will currently running LinuxGSM version to prevent "version mixing". This is ignored if a fork. + if [ "${githubbranch}" == "master" ]&&[ "${githubuser}" == "GameServerManager" ]&&[ "${commandname}" != "UPDATE-LGSM" ]; then remote_fileurl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${version}/${github_file_url_dir}/${github_file_url_name}" remote_fileurl_backup="https://bitbucket.org/${githubuser}/${githubrepo}/raw/${version}/${github_file_url_dir}/${github_file_url_name}" else @@ -422,7 +425,8 @@ fn_fetch_function(){ fn_update_function(){ github_file_url_dir="lgsm/functions" github_file_url_name="${functionfile}" - if [ "${githubbranch}" == "master" ]&&[ "${commandname}" != "UPDATE-LGSM" ]; then + # If master branch will currently running LinuxGSM version to prevent "version mixing". This is ignored if a fork. + if [ "${githubbranch}" == "master" ]&&[ "${githubuser}" == "GameServerManager" ]&&[ "${commandname}" != "UPDATE-LGSM" ]; then remote_fileurl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${version}/${github_file_url_dir}/${github_file_url_name}" remote_fileurl_backup="https://bitbucket.org/${githubuser}/${githubrepo}/raw/${version}/${github_file_url_dir}/${github_file_url_name}" else diff --git a/linuxgsm.sh b/linuxgsm.sh index 67f24da3ff..70a280a326 100755 --- a/linuxgsm.sh +++ b/linuxgsm.sh @@ -160,7 +160,8 @@ fn_bootstrap_fetch_file(){ fn_bootstrap_fetch_file_github(){ github_file_url_dir="${1}" github_file_url_name="${2}" - if [ "${githubbranch}" == "master" ]&&[ "${commandname}" != "UPDATE-LGSM" ]; then + # If master branch will currently running LinuxGSM version to prevent "version mixing". This is ignored if a fork. + if [ "${githubbranch}" == "master" ]&&[ "${githubuser}" == "GameServerManager" ]&&[ "${commandname}" != "UPDATE-LGSM" ]; then remote_fileurl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${version}/${github_file_url_dir}/${github_file_url_name}" remote_fileurl_backup="https://bitbucket.org/${githubuser}/${githubrepo}/raw/${version}/${github_file_url_dir}/${github_file_url_name}" else diff --git a/tests/tests_fctrserver.sh b/tests/tests_fctrserver.sh index 8856a63b98..afb2f8deda 100644 --- a/tests/tests_fctrserver.sh +++ b/tests/tests_fctrserver.sh @@ -167,7 +167,8 @@ fn_bootstrap_fetch_file(){ fn_bootstrap_fetch_file_github(){ github_file_url_dir="${1}" github_file_url_name="${2}" - if [ "${githubbranch}" == "master" ]&&[ "${commandname}" != "UPDATE-LGSM" ]; then + # If master branch will currently running LinuxGSM version to prevent "version mixing". This is ignored if a fork. + if [ "${githubbranch}" == "master" ]&&[ "${githubuser}" == "GameServerManager" ]&&[ "${commandname}" != "UPDATE-LGSM" ]; then remote_fileurl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${version}/${github_file_url_dir}/${github_file_url_name}" remote_fileurl_backup="https://bitbucket.org/${githubuser}/${githubrepo}/raw/${version}/${github_file_url_dir}/${github_file_url_name}" else diff --git a/tests/tests_jc2server.sh b/tests/tests_jc2server.sh index dca188aeff..34cea40e44 100644 --- a/tests/tests_jc2server.sh +++ b/tests/tests_jc2server.sh @@ -168,7 +168,8 @@ fn_bootstrap_fetch_file(){ fn_bootstrap_fetch_file_github(){ github_file_url_dir="${1}" github_file_url_name="${2}" - if [ "${githubbranch}" == "master" ]&&[ "${commandname}" != "UPDATE-LGSM" ]; then + # If master branch will currently running LinuxGSM version to prevent "version mixing". This is ignored if a fork. + if [ "${githubbranch}" == "master" ]&&[ "${githubuser}" == "GameServerManager" ]&&[ "${commandname}" != "UPDATE-LGSM" ]; then remote_fileurl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${version}/${github_file_url_dir}/${github_file_url_name}" remote_fileurl_backup="https://bitbucket.org/${githubuser}/${githubrepo}/raw/${version}/${github_file_url_dir}/${github_file_url_name}" else diff --git a/tests/tests_mcserver.sh b/tests/tests_mcserver.sh index 71b45f34a4..f253df31aa 100644 --- a/tests/tests_mcserver.sh +++ b/tests/tests_mcserver.sh @@ -168,7 +168,8 @@ fn_bootstrap_fetch_file(){ fn_bootstrap_fetch_file_github(){ github_file_url_dir="${1}" github_file_url_name="${2}" - if [ "${githubbranch}" == "master" ]&&[ "${commandname}" != "UPDATE-LGSM" ]; then + # If master branch will currently running LinuxGSM version to prevent "version mixing". This is ignored if a fork. + if [ "${githubbranch}" == "master" ]&&[ "${githubuser}" == "GameServerManager" ]&&[ "${commandname}" != "UPDATE-LGSM" ]; then remote_fileurl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${version}/${github_file_url_dir}/${github_file_url_name}" remote_fileurl_backup="https://bitbucket.org/${githubuser}/${githubrepo}/raw/${version}/${github_file_url_dir}/${github_file_url_name}" else diff --git a/tests/tests_ts3server.sh b/tests/tests_ts3server.sh index c9756c331f..cf5d5ebd12 100644 --- a/tests/tests_ts3server.sh +++ b/tests/tests_ts3server.sh @@ -168,7 +168,8 @@ fn_bootstrap_fetch_file(){ fn_bootstrap_fetch_file_github(){ github_file_url_dir="${1}" github_file_url_name="${2}" - if [ "${githubbranch}" == "master" ]&&[ "${commandname}" != "UPDATE-LGSM" ]; then + # If master branch will currently running LinuxGSM version to prevent "version mixing". This is ignored if a fork. + if [ "${githubbranch}" == "master" ]&&[ "${githubuser}" == "GameServerManager" ]&&[ "${commandname}" != "UPDATE-LGSM" ]; then remote_fileurl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${version}/${github_file_url_dir}/${github_file_url_name}" remote_fileurl_backup="https://bitbucket.org/${githubuser}/${githubrepo}/raw/${version}/${github_file_url_dir}/${github_file_url_name}" else From 990edfd775ec0b3dcd091b3017d94cdb2b88ce6b Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sun, 11 Oct 2020 00:48:11 +0100 Subject: [PATCH 04/24] feat: improve uniqueness tmux session name (#3081) * Fixed uniqueness constraint on session names by adding port to tmux sesssions. Removed content constraint from session name by avoiding grep regex Co-authored-by: jason <1569551+j4s0n@users.noreply.github.com> --- lgsm/functions/check_status.sh | 6 +++++- lgsm/functions/command_console.sh | 2 +- lgsm/functions/command_start.sh | 6 +++--- lgsm/functions/command_stop.sh | 2 +- lgsm/functions/info_distro.sh | 2 +- 5 files changed, 11 insertions(+), 7 deletions(-) diff --git a/lgsm/functions/check_status.sh b/lgsm/functions/check_status.sh index 178adcf6b5..1abd2990b3 100755 --- a/lgsm/functions/check_status.sh +++ b/lgsm/functions/check_status.sh @@ -7,4 +7,8 @@ functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" -status=$(tmux list-sessions -F "#{session_name}" 2>/dev/null | grep -Ecx "^${sessionname}") +if [ "$(tmux list-sessions -F "#{session_name}" 2>/dev/null)" == "${sessionname}${port}" ]; then + status=1; +else + status=0; +fi diff --git a/lgsm/functions/command_console.sh b/lgsm/functions/command_console.sh index 0de924ea61..36ca7e0921 100755 --- a/lgsm/functions/command_console.sh +++ b/lgsm/functions/command_console.sh @@ -41,7 +41,7 @@ check_status.sh if [ "${status}" != "0" ]; then fn_print_ok_nl "Accessing console" fn_script_log_pass "Console accessed" - tmux attach-session -t "${sessionname}" + tmux attach-session -t "${sessionname}${port}" fn_print_ok_nl "Closing console" fn_script_log_pass "Console closed" else diff --git a/lgsm/functions/command_start.sh b/lgsm/functions/command_start.sh index 62160e1879..3ebbc8871b 100755 --- a/lgsm/functions/command_start.sh +++ b/lgsm/functions/command_start.sh @@ -36,7 +36,7 @@ fn_start_teamspeak3(){ # Used to allow update to detect JK2MV server version. fn_start_jk2(){ fn_start_tmux - tmux send -t "${sessionname}" version ENTER > /dev/null 2>&1 + tmux send -t "${sessionname}${port}" version ENTER > /dev/null 2>&1 } fn_start_tmux(){ @@ -72,7 +72,7 @@ fn_start_tmux(){ # Create lockfile date '+%s' > "${lockdir}/${selfname}.lock" cd "${executabledir}" || exit - tmux new-session -d -x "${sessionwidth}" -y "${sessionheight}" -s "${sessionname}" "${executable} ${parms}" 2> "${lgsmlogdir}/.${selfname}-tmux-error.tmp" + tmux new-session -d -x "${sessionwidth}" -y "${sessionheight}" -s "${sessionname}${port}" "${executable} ${parms}" 2> "${lgsmlogdir}/.${selfname}-tmux-error.tmp" # Create logfile. touch "${consolelog}" @@ -130,7 +130,7 @@ fn_start_tmux(){ echo -e "" echo -e "Command" echo -e "=================================" - echo -e "tmux new-session -d -s \"${sessionname}\" \"${executable} ${parms}\"" | tee -a "${lgsmlog}" + echo -e "tmux new-session -d -s \"${sessionname} ${port}\" \"${executable} ${parms}\"" | tee -a "${lgsmlog}" echo -e "" echo -e "Error" echo -e "=================================" diff --git a/lgsm/functions/command_stop.sh b/lgsm/functions/command_stop.sh index 439967fd0e..bde89dd13e 100644 --- a/lgsm/functions/command_stop.sh +++ b/lgsm/functions/command_stop.sh @@ -15,7 +15,7 @@ fn_stop_graceful_ctrlc(){ fn_print_dots "Graceful: CTRL+c" fn_script_log_info "Graceful: CTRL+c" # Sends quit. - tmux send-keys -t "${sessionname}" C-c > /dev/null 2>&1 + tmux send-keys -t "${sessionname}${port}" C-c > /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 diff --git a/lgsm/functions/info_distro.sh b/lgsm/functions/info_distro.sh index 8962426af9..7257483116 100755 --- a/lgsm/functions/info_distro.sh +++ b/lgsm/functions/info_distro.sh @@ -9,7 +9,7 @@ functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" ### Game Server pid if [ "${status}" == "1" ]; then - gameserverpid=$(tmux list-sessions -F "#{session_name} #{pane_pid}" | grep "^${sessionname} " | awk '{print $NF}') + gameserverpid=$(tmux list-sessions -F "#{session_name} #{pane_pid}" | grep "^${sessionname}${port}" | awk '{print $NF}') fi ### Distro information From 5d7ff92d9b48971d9b38e7919f4303714be63f72 Mon Sep 17 00:00:00 2001 From: Christian Date: Sun, 11 Oct 2020 14:32:48 +0200 Subject: [PATCH 05/24] fix(details): Barotrauma will show as needing to be edited in game config (#3085) --- lgsm/functions/info_messages.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lgsm/functions/info_messages.sh b/lgsm/functions/info_messages.sh index 4e1863f3e7..6eb97f241e 100755 --- a/lgsm/functions/info_messages.sh +++ b/lgsm/functions/info_messages.sh @@ -572,7 +572,7 @@ fn_info_message_ports(){ parmslocation="${red}UNKNOWN${default}" # engines/games that require editing in the config file. - local ports_edit_array=( "avalanche2.0" "avalanche3.0" "Ballistic Overkill" "dontstarve" "Eco" "idtech2" "idtech3" "idtech3_ql" "lwjgl2" "Minecraft Bedrock" "Project Cars" "projectzomboid" "quake" "refractor" "realvirtuality" "renderware" "Stationeers" "teeworlds" "terraria" "unreal" "unreal2" "unreal3" "TeamSpeak 3" "Mumble" "7 Days To Die" "wurm") + local ports_edit_array=( "avalanche2.0" "avalanche3.0" "Ballistic Overkill" "Barotrauma" "dontstarve" "Eco" "idtech2" "idtech3" "idtech3_ql" "lwjgl2" "Minecraft Bedrock" "Project Cars" "projectzomboid" "quake" "refractor" "realvirtuality" "renderware" "Stationeers" "teeworlds" "terraria" "unreal" "unreal2" "unreal3" "TeamSpeak 3" "Mumble" "7 Days To Die" "wurm") for port_edit in "${ports_edit_array[@]}"; do if [ "${shortname}" == "ut3" ]; then parmslocation="${servercfgdir}/UTWeb.ini" From 27fe4a65290a8838667b3b8044c307ce14c2637a Mon Sep 17 00:00:00 2001 From: H3o66 Date: Sun, 11 Oct 2020 11:38:38 +0200 Subject: [PATCH 06/24] fix(btserver): add dependency check for libicu --- lgsm/functions/check_deps.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lgsm/functions/check_deps.sh b/lgsm/functions/check_deps.sh index 60fc30c726..d8e73ec894 100755 --- a/lgsm/functions/check_deps.sh +++ b/lgsm/functions/check_deps.sh @@ -395,6 +395,9 @@ fn_deps_build_debian(){ # Call of Duty & Medal of Honor: Allied Assault elif [ "${shortname}" == "cod" ]||[ "${shortname}" == "coduo" ]||[ "${shortname}" == "cod2" ]||[ "${shortname}" == "mohaa" ]; then array_deps_required+=( libstdc++5:i386 ) + # Barotrauma + elif [ "${shortname}" == "bt" ]; then + array_deps_required+=( libicu-dev ) # Ecoserver elif [ "${shortname}" == "eco" ]; then array_deps_required+=( libgdiplus ) @@ -489,6 +492,9 @@ fn_deps_build_redhat(){ # 7 Days to Die elif [ "${shortname}" == "sdtd" ]; then array_deps_required+=( telnet expect ) + # Barotrauma + elif [ "${shortname}" == "bt" ]; then + array_deps_required+=( libicu ) # Battlefield: Vietnam elif [ "${shortname}" == "bfv" ]; then array_deps_required+=( compat-libstdc++-33.i686 glibc.i686 ) From e8a71183b8c1931606c8b15522c14d61d3773b29 Mon Sep 17 00:00:00 2001 From: Christian Date: Fri, 13 Nov 2020 22:47:48 +0100 Subject: [PATCH 07/24] fix(bf1942): add missing dependency to checks for libncurses5:i386 (#3098) --- lgsm/functions/check_deps.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lgsm/functions/check_deps.sh b/lgsm/functions/check_deps.sh index d8e73ec894..25c767ae03 100755 --- a/lgsm/functions/check_deps.sh +++ b/lgsm/functions/check_deps.sh @@ -382,8 +382,11 @@ fn_deps_build_debian(){ # Battlefield: Vietnam elif [ "${shortname}" == "bfv" ]; then array_deps_required+=( libncurses5:i386 libstdc++5:i386 ) - # Battlefield 1942, Counter-Strike: Source, Garry's Mod, No More Room in Hell, Source Forts Classic, Zombie Master Reborn and Zombie Panic: Source - elif [ "${shortname}" == "bf1942" ]||[ "${shortname}" == "css" ]||[ "${shortname}" == "gmod" ]||[ "${shortname}" == "nmrih" ]||[ "${shortname}" == "sfc" ]||[ "${shortname}" == "zmr" ]||[ "${shortname}" == "zps" ]; then + # Battlefield 1942 + elif [ "${shortname}" == "bf1942" ]; then + array_deps_required+=( libncurses5:i386 libtinfo5:i386 ) + # Counter-Strike: Source, Garry's Mod, No More Room in Hell, Source Forts Classic, Zombie Master Reborn and Zombie Panic: Source + elif [ "${shortname}" == "css" ]||[ "${shortname}" == "gmod" ]||[ "${shortname}" == "nmrih" ]||[ "${shortname}" == "sfc" ]||[ "${shortname}" == "zmr" ]||[ "${shortname}" == "zps" ]; then if [ "${arch}" == "x86_64" ]; then array_deps_required+=( libtinfo5:i386 ) else From bb78ee3655e29a04056bfa87145436c89394f2f8 Mon Sep 17 00:00:00 2001 From: Christian Date: Fri, 13 Nov 2020 22:47:58 +0100 Subject: [PATCH 08/24] fix(bf1942): servername parsing (#3096) --- lgsm/functions/info_config.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lgsm/functions/info_config.sh b/lgsm/functions/info_config.sh index d54fdba96d..ec0d2eb4a3 100755 --- a/lgsm/functions/info_config.sh +++ b/lgsm/functions/info_config.sh @@ -188,7 +188,7 @@ fn_info_config_bf1942(){ queryport="${zero}" else - servername=$(grep "game.serverName" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^--/d' -e 's/game.serverName //g' | tr -d '=\";,:' | xargs) + servername=$(grep -E "^game.serverName " "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^--/d' -e 's/game.serverName //g' | tr -d '=\";,:' | xargs) serverpassword=$(grep "game.serverPassword" "${servercfgfullpath}" | sed -e 's/^ *//g' -e '/^--/d' -e 's/game.serverPassword//g' | tr -d '=\";,:' | xargs) maxplayers=$(grep "game.serverMaxPlayers" "${servercfgfullpath}" | grep -v "\--" | tr -cd '[:digit:]') port=$(grep "game.serverPort" "${servercfgfullpath}" | grep -v "\--" | tr -cd '[:digit:]') From 5add746d00503e15eb9cc5aa5bcaf5e3ad4ff611 Mon Sep 17 00:00:00 2001 From: Christian Date: Sat, 14 Nov 2020 22:12:01 +0100 Subject: [PATCH 09/24] fix(deps): change ubuntu 20.10 to use lib32gcc-s1 (#3094) --- lgsm/functions/check_deps.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lgsm/functions/check_deps.sh b/lgsm/functions/check_deps.sh index 25c767ae03..7a43e2f3a1 100755 --- a/lgsm/functions/check_deps.sh +++ b/lgsm/functions/check_deps.sh @@ -185,7 +185,7 @@ if [ "${javacheck}" == "1" ]; then # Define required dependencies for SteamCMD. if [ "${appid}" ]; then # lib32gcc1 is now called lib32gcc-s1 in debian 11 - if [ "${distroid}" == "debian" ]&&[ "${distroversion}" == "11" ]; then + if { [ "${distroid}" == "debian" ]&&[ "${distroversion}" == "11" ]; }||{ [ "${distroid}" == "ubuntu" ]&&[ "${distroversion}" == "20.10" ]; }; then if [ "${deptocheck}" == "glibc.i686" ]||[ "${deptocheck}" == "libstdc++64.i686" ]||[ "${deptocheck}" == "lib32gcc-s1" ]||[ "${deptocheck}" == "lib32stdc++6" ]; then steamcmdfail=1 fi @@ -349,7 +349,7 @@ fn_deps_build_debian(){ if [ "${shortname}" != "ts3" ]&&[ "${shortname}" != "mumble" ]&&[ "${shortname}" != "mc" ]&&[ "${engine}" != "renderware" ]; then if [ "${arch}" == "x86_64" ]; then # lib32gcc1 is now called lib32gcc-s1 in debian 11 - if [ "${distroid}" == "debian" ]&&[ "${distroversion}" == "11" ]; then + if { [ "${distroid}" == "debian" ]&&[ "${distroversion}" == "11" ]; }|| { [ "${distroid}" == "ubuntu" ]&&[ "${distroversion}" == "20.10" ]; }; then array_deps_required+=( lib32gcc-s1 lib32stdc++6 ) else array_deps_required+=( lib32gcc1 lib32stdc++6 ) From a62d9236a3561cc2ac7a25af5cbd5c838ad9384a Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sat, 14 Nov 2020 21:25:42 +0000 Subject: [PATCH 10/24] code tidy --- lgsm/functions/check_status.sh | 4 ++-- lgsm/functions/fix_squad.sh | 2 +- lgsm/functions/query_gamedig.sh | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lgsm/functions/check_status.sh b/lgsm/functions/check_status.sh index 1abd2990b3..a473aff73c 100755 --- a/lgsm/functions/check_status.sh +++ b/lgsm/functions/check_status.sh @@ -8,7 +8,7 @@ functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" if [ "$(tmux list-sessions -F "#{session_name}" 2>/dev/null)" == "${sessionname}${port}" ]; then - status=1; + status=1; else - status=0; + status=0; fi diff --git a/lgsm/functions/fix_squad.sh b/lgsm/functions/fix_squad.sh index 28d0e30f0a..8ec84a86fe 100644 --- a/lgsm/functions/fix_squad.sh +++ b/lgsm/functions/fix_squad.sh @@ -6,7 +6,7 @@ # As the server base dir changed for the game, we need to migrate the default config from the old to the new location oldservercfg="${serverfiles}/Squad/ServerConfig/${servercfg}" -if [ -f "${oldservercfg}" ] && [ -f "${servercfgfullpath}" ]; then +if [ -f "${oldservercfg}" ]&&[ -f "${servercfgfullpath}" ]; then # diff old and new config - if it is different move the old config over the new one if [ "$(diff -c "${oldservercfg}" "${servercfgfullpath}" | wc -l)" -gt 0 ]; then fixname="Migrate server config to new Game folder" diff --git a/lgsm/functions/query_gamedig.sh b/lgsm/functions/query_gamedig.sh index 3c5ff38bfd..2443c6e990 100755 --- a/lgsm/functions/query_gamedig.sh +++ b/lgsm/functions/query_gamedig.sh @@ -38,7 +38,7 @@ if [ "$(command -v gamedig 2>/dev/null)" ]&&[ "$(command -v jq 2>/dev/null)" ]; fi if [ "${gdplayers}" == "null" ]; then unset gdplayers - elif [ "${gdplayers}" == "[]" ] || [ "${gdplayers}" == "-1" ]; then + elif [ "${gdplayers}" == "[]" ]||[ "${gdplayers}" == "-1" ]; then gdplayers=0 fi From afe2b70cae47bd1c4f37ad4380a4ef07954601c1 Mon Sep 17 00:00:00 2001 From: Christian Date: Wed, 18 Nov 2020 23:46:43 +0100 Subject: [PATCH 11/24] feat(new server): pvrserver (#2384) --- .../config-lgsm/pvrserver/_default.cfg | 173 ++++++++++++++++++ lgsm/data/serverlist.csv | 1 + lgsm/functions/check_system_requirements.sh | 3 + lgsm/functions/fix_steamcmd.sh | 2 + lgsm/functions/info_config.sh | 16 ++ lgsm/functions/info_messages.sh | 12 ++ lgsm/functions/info_parms.sh | 7 + lgsm/functions/install_config.sh | 7 + 8 files changed, 221 insertions(+) create mode 100644 lgsm/config-default/config-lgsm/pvrserver/_default.cfg diff --git a/lgsm/config-default/config-lgsm/pvrserver/_default.cfg b/lgsm/config-default/config-lgsm/pvrserver/_default.cfg new file mode 100644 index 0000000000..f51bd9ea41 --- /dev/null +++ b/lgsm/config-default/config-lgsm/pvrserver/_default.cfg @@ -0,0 +1,173 @@ +################################## +######## 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://docs.linuxgsm.com/configuration/start-parameters +ip="0.0.0.0" +port="7777" + +# Maps: bridge, datacenter, sand +defaultmap="datacenter" + +## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +fn_parms(){ +parms="${defaultmap} -log -MultiHome=${ip} -Port=${port}" +} + +#### LinuxGSM Settings #### + +## Notification Alerts +# (on|off) + +# Display IP | https://docs.linuxgsm.com/alerts#display-ip +displayip="" + +# More info | https://docs.linuxgsm.com/alerts#more-info +postalert="off" +postdays="7" +posttarget="https://hastebin.com" + +# Discord Alerts | https://docs.linuxgsm.com/alerts/discord +discordalert="off" +discordwebhook="webhook" + +# Email Alerts | https://docs.linuxgsm.com/alerts/email +emailalert="off" +email="email@example.com" +emailfrom="" + +# IFTTT Alerts | https://docs.linuxgsm.com/alerts/ifttt +iftttalert="off" +ifttttoken="accesstoken" +iftttevent="linuxgsm_alert" + +# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun +mailgunalert="off" +mailgunapiregion="us" +mailguntoken="accesstoken" +mailgundomain="example.com" +mailgunemailfrom="alert@example.com" +mailgunemail="email@myemail.com" + +# Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet +pushbulletalert="off" +pushbullettoken="accesstoken" +channeltag="" + +# Pushover Alerts | https://docs.linuxgsm.com/alerts/pushover +pushoveralert="off" +pushovertoken="accesstoken" + +# Rocket.Chat Alerts | https://docs.linuxgsm.com/alerts/rocket.chat +rocketchatalert="off" +rocketchatwebhook="webhook" +rocketchattoken="" + +# Slack Alerts | https://docs.linuxgsm.com/alerts/slack +slackalert="off" +slackwebhook="webhook" + +# Telegram Alerts | https://docs.linuxgsm.com/alerts/telegram +# You can add a custom cURL string eg proxy (useful in Russia) or else in "curlcustomstring". +# like a "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help", if you not need +telegramalert="off" +telegramtoken="accesstoken" +telegramchatid="" +curlcustomstring="" + +## Updating | https://docs.linuxgsm.com/commands/update +updateonstart="off" + +## Backup | https://docs.linuxgsm.com/commands/backup +maxbackups="4" +maxbackupdays="30" +stoponbackup="on" + +## Logging | https://docs.linuxgsm.com/features/logging +consolelogging="on" +logdays="7" + +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + +#### LinuxGSM Advanced Settings #### + +# ANSI Colors +ansi="on" + +# Message Display Time +sleeptime="0.5" + +## SteamCMD Settings | https://docs.linuxgsm.com/steamcmd +# Server appid +appid="622970" +# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch +branch="" +betapassword="" +# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server +steammaster="false" + +## Stop Mode | https://docs.linuxgsm.com/features/stop-mode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: GoldSrc +# 10: Avorion +# 11: end +stopmode="2" + +## Query mode +# 1: session only +# 2: gamedig + gsquery +# 3: gamedig +# 4: gsquery +# 5: tcp +querymode="1" +querytype="" + +## LinuxGSM Server Details +# Do not edit +gamename="Pavlov VR" +engine="unreal4" +glibc="2.17" + +#### Directories #### +# Edit with care + +## Server Specific Directories +systemdir="${serverfiles}/Pavlov" +executabledir="${systemdir}/Binaries/Linux" +executable="./PavlovServer" +servercfgdir="${systemdir}/Saved/Config/LinuxServer" +servercfg="Game.ini" +servercfgdefault="Game.ini" +servercfgfullpath="${servercfgdir}/${servercfg}" + +## Backup Directory +backupdir="${lgsmdir}/backup" + +## Logging Directories +logdir="${rootdir}/log" +gamelogdir="${systemdir}/Saved/Logs" +lgsmlogdir="${logdir}/script" +consolelogdir="${logdir}/console" +lgsmlog="${lgsmlogdir}/${selfname}-script.log" +consolelog="${consolelogdir}/${selfname}-console.log" +alertlog="${lgsmlogdir}/${selfname}-alert.log" +postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" + +## Logs Naming +lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" +consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" diff --git a/lgsm/data/serverlist.csv b/lgsm/data/serverlist.csv index b871357f9b..ad3bc9a199 100644 --- a/lgsm/data/serverlist.csv +++ b/lgsm/data/serverlist.csv @@ -69,6 +69,7 @@ opfor,opforserver,Opposing Force pc,pcserver,Project Cars pstbs,pstbsserver,Post Scriptum: The Bloody Seventh pvkii,pvkiiserver,Pirates Vikings & Knights II +pvr,pvrserver,Pavlov VR pz,pzserver,Project Zomboid q2,q2server,Quake 2 q3,q3server,Quake 3: Arena diff --git a/lgsm/functions/check_system_requirements.sh b/lgsm/functions/check_system_requirements.sh index 8b7db5a3c7..7a8b73de58 100755 --- a/lgsm/functions/check_system_requirements.sh +++ b/lgsm/functions/check_system_requirements.sh @@ -38,6 +38,9 @@ elif [ "${shortname}" == "ns2" ]||[ "${shortname}" == "ns2c" ]; then elif [ "${shortname}" == "st" ]; then ramrequirementmb="1000" ramrequirementgb="1" +elif [ "${shortname}" == "pvr" ];then + ramrequirementmb="2000" + ramrequirementgb="2" fi # If the game or engine has a minimum RAM Requirement, compare it to system's available RAM. diff --git a/lgsm/functions/fix_steamcmd.sh b/lgsm/functions/fix_steamcmd.sh index 3fe106c386..41d31e2636 100755 --- a/lgsm/functions/fix_steamcmd.sh +++ b/lgsm/functions/fix_steamcmd.sh @@ -84,6 +84,8 @@ elif [ "${shortname}" == "ins" ]; then elif [ "${shortname}" == "pz" ]; then fn_fix_steamclient_so "32" "${serverfiles}/linux32" fn_fix_steamclient_so "64" "${serverfiles}/linux64" +elif [ "${shortname}" == "pvr" ]; then + fn_fix_steamclient_so "64" "${executabledir}" elif [ "${shortname}" == "ss3" ]; then fn_fix_steamclient_so "32" "${serverfiles}/Bin" elif [ "${shortname}" == "tu" ];then diff --git a/lgsm/functions/info_config.sh b/lgsm/functions/info_config.sh index ec0d2eb4a3..d13e000d99 100755 --- a/lgsm/functions/info_config.sh +++ b/lgsm/functions/info_config.sh @@ -1511,6 +1511,20 @@ fn_info_config_soldat(){ fi } +fn_info_config_pavlovvr(){ + if [ ! -f "${servercfgfullpath}" ]; then + servername="${unavailable}" + maxplayers="${unavailable}" + else + servername=$(grep "ServerName" "${servercfgfullpath}" | awk -F '=' '{print $2}') + maxplayers=$(grep "MaxPlayers" "${servercfgfullpath}" | awk -F '=' '{print $2}') + + # Not set + servername=${servername:-"NOT SET"} + maxplayers=${maxplayers:-"0"} + fi +} + if [ "${shortname}" == "ac" ]; then fn_info_config_assettocorsa elif [ "${shortname}" == "ark" ]; then @@ -1631,4 +1645,6 @@ elif [ "${shortname}" == "st" ]; then fn_info_config_stationeers elif [ "${shortname}" == "mh" ]; then fn_info_config_mordhau +elif [ "${shortname}" == "pvr" ];then + fn_info_config_pavlovvr fi diff --git a/lgsm/functions/info_messages.sh b/lgsm/functions/info_messages.sh index 6eb97f241e..dde3a25854 100755 --- a/lgsm/functions/info_messages.sh +++ b/lgsm/functions/info_messages.sh @@ -1435,6 +1435,16 @@ fn_info_message_warfork(){ } | column -s $'\t' -t } +fn_info_message_pavlovvr(){ + echo "netstat -atunp | grep Pavlov" + echo -e "" + { + echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL" + echo -e "> Game\tINBOUND\t${port}\tudp" + echo -e "> Game\tINBOUND\t$((port+400))\tudp" + } | column -s $'\t' -t +} + fn_info_message_select_engine(){ # Display details depending on game or engine. if [ "${shortname}" == "ac" ]; then @@ -1547,6 +1557,8 @@ fn_info_message_select_engine(){ fn_info_message_bfv elif [ "${shortname}" == "rtcw" ]; then fn_info_message_rtcw + elif [ "${shortname}" == "pvr" ]; then + fn_info_message_pavlovvr elif [ "${shortname}" == "rust" ]; then fn_info_message_rust elif [ "${shortname}" == "wf" ]; then diff --git a/lgsm/functions/info_parms.sh b/lgsm/functions/info_parms.sh index 57ca438500..74c29b9df6 100755 --- a/lgsm/functions/info_parms.sh +++ b/lgsm/functions/info_parms.sh @@ -196,6 +196,11 @@ fn_info_parms_teeworlds(){ queryport=${port:-"0"} } +fn_info_parms_pavlovvr(){ + port=${port:-"0"} + queryport=${queryport:-"0"} +} + fn_info_parms_unreal(){ defaultmap=${defaultmap:-"NOT SET"} queryport=$((port + 1)) @@ -250,6 +255,8 @@ elif [ "${shortname}" == "mom" ]; then fn_info_parms_mom elif [ "${shortname}" == "pz" ]; then fn_info_parms_projectzomboid +elif [ "${shortname}" == "pvr" ]; then + fn_info_parms_pavlovvr elif [ "${shortname}" == "qw" ]; then fn_info_parms_quakeworld elif [ "${shortname}" == "q2" ]||[ "${shortname}" == "q3" ]; then diff --git a/lgsm/functions/install_config.sh b/lgsm/functions/install_config.sh index 543bd0a3d7..d512f5b688 100755 --- a/lgsm/functions/install_config.sh +++ b/lgsm/functions/install_config.sh @@ -576,6 +576,13 @@ elif [ "${shortname}" == "mumble" ]; then fn_fetch_default_config fn_default_config_remote fn_list_config_locations +elif [ "${gamename}" == "Pavlov VR" ]; then + gamedirname="PavlovVR" + fn_check_cfgdir + array_configs+=( Game.ini ) + fn_fetch_default_config + fn_default_config_remote + fn_set_config_vars elif [ "${shortname}" == "pvkii" ]; then gamedirname="PiratesVikingandKnightsII" array_configs+=( server.cfg ) From 26d750133b453404b141f335b54689fc5baddd93 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Wed, 18 Nov 2020 23:05:27 +0000 Subject: [PATCH 12/24] Update ssh-agent to 0.4.1 --- .github/workflows/git-sync.yml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/git-sync.yml b/.github/workflows/git-sync.yml index 9fc886b4e9..c058b6d240 100644 --- a/.github/workflows/git-sync.yml +++ b/.github/workflows/git-sync.yml @@ -11,17 +11,16 @@ jobs: repo-sync: runs-on: ubuntu-latest steps: - - name: ssh - uses: webfactory/ssh-agent@v0.2.0 + - name: webfactory/ssh-agent + uses: webfactory/ssh-agent@v0.4.1 with: ssh-private-key: ${{ secrets.BITBUCKET_SECRET }} - ssh_private_key: ${{ secrets.BITBUCKET_SECRET }} - name: repo-sync - uses: wei/git-sync@v2 + uses: wei/git-sync@v2.1.0 with: + ssh_private_key: ${{ secrets.BITBUCKET_SECRET }} source_repo: "https://github.com/GameServerManagers/LinuxGSM" source_branch: "refs/heads/*" destination_repo: "git@bitbucket.org:GameServerManagers/linuxgsm.git" destination_branch: "refs/heads/*" - ssh_private_key: ${{ secrets.BITBUCKET_SECRET }} From 097bb991ab93705cfe3851fadfb3d0d135ead715 Mon Sep 17 00:00:00 2001 From: tkrn Date: Thu, 19 Nov 2020 17:03:04 -0500 Subject: [PATCH 13/24] feat(mods): metamod/amxmodx for goldsrc engines (#3104) --- lgsm/functions/command_mods_install.sh | 23 +++ lgsm/functions/command_mods_remove.sh | 31 +++- lgsm/functions/core_getopt.sh | 2 +- lgsm/functions/mods_core.sh | 248 +++++++++++++++++++++++++ lgsm/functions/mods_list.sh | 86 +++++++-- 5 files changed, 370 insertions(+), 20 deletions(-) diff --git a/lgsm/functions/command_mods_install.sh b/lgsm/functions/command_mods_install.sh index 369f5f9678..d644e0cf04 100755 --- a/lgsm/functions/command_mods_install.sh +++ b/lgsm/functions/command_mods_install.sh @@ -95,6 +95,18 @@ if [ -f "${modsinstalledlistfullpath}" ]; then fi ## Installation. +# If amxmodx check if metamod exists first +if [ "${modcommand}" == "amxmodx" ]; then + fn_mod_exist "metamod" +fi + +if [ "${modcommand}" == "amxmodxcs" ] || + [ "${modcommand}" == "amxmodxdod" ] || + [ "${modcommand}" == "amxmodxtfc" ] || + [ "${modcommand}" == "amxmodxns" ] || + [ "${modcommand}" == "amxmodxts" ]; then + fn_mod_exist "amxmodx" +fi fn_create_mods_dir fn_mods_clear_tmp_dir @@ -106,6 +118,17 @@ fn_mod_copy_destination fn_mod_add_list fn_mod_tidy_files_list fn_mods_clear_tmp_dir + +# Create/modify existing liblist.gam file for Metamod +if [ "${modcommand}" == "metamod" ]; then + fn_mod_install_liblist_gam_file +fi + +# Create/modify plugins.ini file for Metamod +if [ "${modcommand}" == "amxmodx" ]; then + fn_mod_install_amxmodx_file +fi + echo -e "${modprettyname} installed" fn_script_log_pass "${modprettyname} installed." diff --git a/lgsm/functions/command_mods_remove.sh b/lgsm/functions/command_mods_remove.sh index 7cbba8a714..507251e875 100755 --- a/lgsm/functions/command_mods_remove.sh +++ b/lgsm/functions/command_mods_remove.sh @@ -37,7 +37,7 @@ while [[ ! " ${installedmodslist[@]} " =~ " ${usermodselect} " ]]; do read -r usermodselect # Exit if user says exit or abort. if [ "${usermodselect}" == "exit" ]||[ "${usermodselect}" == "abort" ]; then - core_exit.sh + core_exit.sh # Supplementary output upon invalid user input. elif [[ ! " ${availablemodscommands[@]} " =~ " ${usermodselect} " ]]; then fn_print_error2_nl "${usermodselect} is not a valid addon/mod." @@ -82,17 +82,25 @@ while [ "${modfileline}" -le "${modsfilelistsize}" ]; do echo -e "removing ${modprettyname} ${modfileline} / ${modsfilelistsize} : ${currentfileremove}..." ((modfileline++)) done -if [ "${exitcode}" != 0 ]; then - fn_print_fail_eol_nl - core_exit.sh + +# Added logic not to fail since removing game specific mods (amxmodxcs) removes files that will +# not be found when removing the base (amxmodx) mod +if [ "${modcommand}" != "amxmodx" ]; then + if [ "${exitcode}" != 0 ]; then + fn_print_fail_eol_nl + core_exit.sh + else + fn_print_ok_eol_nl + fi else fn_print_ok_eol_nl fi + # Remove file list. echo -en "removing ${modcommand}-files.txt..." fn_sleep_time rm -rf "${modsdir:?}/${modcommand}-files.txt" -local exitcode=$? +exitcode=$? if [ "${exitcode}" != 0 ]; then fn_script_log_fatal "Removing ${modsdir}/${modcommand}-files.txt" fn_print_fail_eol_nl @@ -107,7 +115,7 @@ echo -en "removing ${modcommand} from ${modsinstalledlist}..." fn_sleep_time sed -i "/^${modcommand}$/d" "${modsinstalledlistfullpath}" -local exitcode=$? +exitcode=$? if [ "${exitcode}" != 0 ]; then fn_script_log_fatal "Removing ${modcommand} from ${modsinstalledlist}" fn_print_fail_eol_nl @@ -127,6 +135,17 @@ if [ "${engine}" == "unity3d" ]&&[[ "${modprettyname}" == *"Oxide"* ]]; then fn_firstcommand_reset unset exitbypass fi + +# Remove/modify existing liblist.gam file for Metamod +if [ "${modcommand}" == "metamod" ]; then + fn_mod_remove_liblist_gam_file +fi + +# Remove/modify plugins.ini file for AMX Mod X +if [ "${modcommand}" == "amxmodx" ]; then + fn_mod_remove_amxmodx_file +fi + echo -e "${modprettyname} removed" fn_script_log "${modprettyname} removed" diff --git a/lgsm/functions/core_getopt.sh b/lgsm/functions/core_getopt.sh index 82eb776918..e20b32b570 100755 --- a/lgsm/functions/core_getopt.sh +++ b/lgsm/functions/core_getopt.sh @@ -125,7 +125,7 @@ if [ "${shortname}" == "squad" ]; then fi ## Mods commands. -if [ "${engine}" == "source" ]||[ "${shortname}" == "rust" ]||[ "${shortname}" == "hq" ]||[ "${shortname}" == "sdtd" ]; then +if [ "${engine}" == "source" ]||[ "${shortname}" == "rust" ]||[ "${shortname}" == "hq" ]||[ "${shortname}" == "sdtd" ]||[ "${shortname}" == "cs" ]||[ "${shortname}" == "dod" ]||[ "${shortname}" == "tfc" ]||[ "${shortname}" == "ns" ]||[ "${shortname}" == "ts" ]||[ "${shortname}" == "hldm" ]; then currentopt+=( "${cmd_mods_install[@]}" "${cmd_mods_remove[@]}" "${cmd_mods_update[@]}" ) fi diff --git a/lgsm/functions/mods_core.sh b/lgsm/functions/mods_core.sh index bd6b6275c9..5357034308 100755 --- a/lgsm/functions/mods_core.sh +++ b/lgsm/functions/mods_core.sh @@ -495,6 +495,254 @@ fn_check_mod_files_list(){ fi } +fn_mod_exist(){ + modreq=$1 + # requires one parameter, the mod + if [ -f "${modsdir}/${modreq}-files.txt" ]; then + # how many lines is the file list + modsfilelistsize=$(wc -l < "${modsdir}/${modreq}-files.txt") + # if file list is empty + if [ "${modsfilelistsize}" -eq 0 ]; then + fn_mod_required_fail_exist "${modreq}" + fi + else + fn_mod_required_fail_exist "${modreq}" + fi +} + +fn_mod_required_fail_exist(){ + modreq=$1 + # requires one parameter, the mod + fn_script_log_fatal "${modreq}-files.txt is empty: unable to find ${modreq} installed" + echo -en "* Unable to find '${modreq}' which is required prior to installing this mod..." + fn_print_fail_eol_nl + core_exit.sh +} + +fn_mod_liblist_gam_filenames(){ + # clear variables just in case + moddll="" + modso="" + moddylib="" + + # default libraries + case ${gamename} in + "Counter-Strike 1.6") + moddll="mp.dll" + modso="cs.so" + moddylib="cs.dylib" + ;; + "Day of Defeat") + moddll="dod.dll" + modso="dod.so" + moddylib="dod.dylib" + ;; + "Team Fortress Classic") + moddll="tfc.dll" + modso="tfc.so" + moddylib="tfc.dylib" + ;; + "Natural Selection") + moddll="ns.dll" + modso="ns_i386.so" + moddylib="" + ;; + "The Specialists") + moddll="mp.dll" + modso="ts_i386.so" + moddylib="" + ;; + "Half-Life: Deathmatch") + moddll="hl.dll" + modso="hl.so" + moddylib="hl.dylib" + ;; + esac +} + +# modifers for liblist.gam to add/remote metamod binaries +fn_mod_install_liblist_gam_file(){ + + fn_mod_liblist_gam_filenames + + if [ -f "${modinstalldir}/liblist.gam" ]; then + # modify the liblist.gam file to initialize Metamod + logentry="sed replace (dlls\\${moddll}) ${modinstalldir}/liblist.gam" + echo -en "modifying gamedll in liblist.gam..." + rpldll="s/dlls\\\\${moddll}/addons\/metamod\/dlls\/metamod.dll/g" + sed -i $rpldll ${modinstalldir}/liblist.gam + grep -q "addons/metamod/dlls/metamod.dll" ${modinstalldir}/liblist.gam + exitcode=$? + # if replacement back didn't happen, error out. + if [ "${exitcode}" != 0 ]; then + fn_script_log_fatal $logentry + fn_print_fail_eol_nl + else + fn_script_log_pass $logentry + fn_print_ok_eol_nl + fi + + # modify the liblist.gam file to initialize metamod + logentry="sed replace (dlls\\${modso}) ${modinstalldir}/liblist.gam" + echo -en "modifying gamedll_linux in liblist.gam..." + rplso="s/dlls\/${modso}/addons\/metamod\/dlls\/metamod.so/g" + sed -i $rplso ${modinstalldir}/liblist.gam + grep -q "addons/metamod/dlls/metamod.so" ${modinstalldir}/liblist.gam + exitcode=$? + # if replacement back didn't happen, error out + if [ "${exitcode}" != 0 ]; then + fn_script_log_fatal $logentry + fn_print_fail_eol_nl + else + fn_script_log_pass $logentry + fn_print_ok_eol_nl + fi + + # mac os needs to be checked not all mods support mac os + if [ -n "${moddylib}" ]; then + # modify the liblist.gam file to initialize metamod + logentry="sed replace (dlls\\${moddylib}) ${modinstalldir}/liblist.gam" + echo -en "modifying gamedll_osx in liblist.gam..." + rpldylib="s/dlls\/${moddylib}/addons\/metamod\/dlls\/metamod.dylib/g" + sed -i $rpldylib ${modinstalldir}/liblist.gam + grep -q "addons/metamod/dlls/metamod.dylib" ${modinstalldir}/liblist.gam + exitcode=$? + # if replacement back didn't happen, error out. + if [ "${exitcode}" != 0 ]; then + fn_script_log_fatal $logentry + fn_print_fail_eol_nl + else + fn_script_log_pass $logentry + fn_print_ok_eol_nl + fi + fi + fi +} + +fn_mod_remove_liblist_gam_file(){ + + fn_mod_liblist_gam_filenames + + if [ -f "${modinstalldir}/liblist.gam" ]; then + # modify the liblist.gam file back to defaults + logentry="sed replace (addons/metamod/dlls/metamod.dll) ${modinstalldir}/liblist.gam" + echo -en "modifying gamedll in liblist.gam..." + rpldll="s/addons\/metamod\/dlls\/metamod.dll/dlls\\\\${moddll}/g" + sed -i $rpldll ${modinstalldir}/liblist.gam + grep -q "${moddll}" ${modinstalldir}/liblist.gam + exitcode=$? + # if replacement back didn't happen, error out. + if [ "${exitcode}" != 0 ]; then + fn_script_log_fatal $logentry + fn_print_fail_eol_nl + else + fn_script_log_pass $logentry + fn_print_ok_eol_nl + fi + + # modify the liblist.gam file back to defaults + logentry="sed replace (addons/metamod/dlls/metamod.so) ${modinstalldir}/liblist.gam" + echo -en "modifying gamedll_linux in liblist.gam..." + rplso="s/addons\/metamod\/dlls\/metamod.so/dlls\/${modso}/g" + sed -i $rplso ${modinstalldir}/liblist.gam + grep -q "${modso}" ${modinstalldir}/liblist.gam + exitcode=$? + # if replacement back didn't happen, error out + if [ "${exitcode}" != 0 ]; then + fn_script_log_fatal $logentry + fn_print_fail_eol_nl + else + fn_script_log_pass $logentry + fn_print_ok_eol_nl + fi + + # mac os needs to be checked not all mods support mac os + if [ -n "${moddylib}" ]; then + # modify the liblist.gam file back to defaults + logentry="sed replace (addons/metamod/dlls/metamod.dylib) ${modinstalldir}/liblist.gam" + echo -en "modifying gamedll_osx in liblist.gam..." + rpldylib="s/addons\/metamod\/dlls\/metamod.dylib/dlls\/${moddylib}/g" + sed -i $rpldylib ${modinstalldir}/liblist.gam + grep -q "${moddylib}" ${modinstalldir}/liblist.gam + # if replacement back didn't happen, error out. + exitcode=$? + if [ "${exitcode}" != 0 ]; then + fn_script_log_fatal $logentry + fn_print_fail_eol_nl + else + fn_script_log_pass $logentry + fn_print_ok_eol_nl + fi + fi + fi +} + +fn_mod_install_amxmodx_file(){ + # does plugins.ini exist? + if [ -f "${modinstalldir}/addons/metamod/plugins.ini" ]; then + # since it does exist, is the entry already in plugins.ini + logentry="line (linux addons/amxmodx/dlls/amxmodx_mm_i386.so) inserted into ${modinstalldir}/addons/metamod/plugins.ini" + echo -en "adding amxmodx_mm_i386.so in plugins.ini..." + grep -q "amxmodx_mm_i386.so" ${modinstalldir}/addons/metamod/plugins.ini + exitcode=$? + if [ "${exitcode}" != 0 ]; then + # file exists but the entry does not, let's add it + echo "linux addons/amxmodx/dlls/amxmodx_mm_i386.so" >> ${modinstalldir}/addons/metamod/plugins.ini + exitcode=$? + if [ "${exitcode}" != 0 ]; then + fn_script_log_fatal $logentry + fn_print_fail_eol_nl + else + fn_script_log_pass $logentry + fn_print_ok_eol_nl + fi + fi + else + # create new file and add the mod to it + echo "linux addons/amxmodx/dlls/amxmodx_mm_i386.so" > ${modinstalldir}/addons/metamod/plugins.ini + exitcode=$? + if [ "${exitcode}" != 0 ]; then + fn_script_log_fatal $logentry + fn_print_fail_eol_nl + core_exit.sh + else + fn_script_log_pass $logentry + fn_print_ok_eol_nl + fi + fi +} + +fn_mod_remove_amxmodx_file(){ + if [ -f "${modinstalldir}/addons/metamod/plugins.ini" ]; then + # since it does exist, is the entry already in plugins.ini + logentry="line (linux addons/amxmodx/dlls/amxmodx_mm_i386.so) removed from ${modinstalldir}/addons/metamod/plugins.ini" + echo -en "removing amxmodx_mm_i386.so in plugins.ini..." + grep -q "linux addons/amxmodx/dlls/amxmodx_mm_i386.so" ${modinstalldir}/addons/metamod/plugins.ini + # iIs it found? If so remove it and clean up + exitcode=$? + if [ "${exitcode}" == 0 ]; then + # delete the line we inserted + sed -i '/linux addons\/amxmodx\/dlls\/amxmodx_mm_i386.so/d' ${modinstalldir}/addons/metamod/plugins.ini + # remove empty lines + sed -i '/^$/d' ${modinstalldir}/addons/metamod/plugins.ini + exitcode=$? + if [ "${exitcode}" != 0 ]; then + fn_script_log_fatal $logentry + fn_print_fail_eol_nl + else + fn_script_log_pass $logentry + fn_print_ok_eol_nl + fi + + # if file is empty, remove it. + if [ -f "${modinstalldir}/addons/metamod/plugins.ini" ]; then + rm ${modinstalldir}/addons/metamod/plugins.ini + fn_script_log_pass "file removed ${modinstalldir}/addons/metamod/plugins.ini because it was empty" + fi + fi + fi +} + ## Database initialisation. mods_list.sh diff --git a/lgsm/functions/mods_list.sh b/lgsm/functions/mods_list.sh index 333601dcee..2e7e35cb2b 100755 --- a/lgsm/functions/mods_list.sh +++ b/lgsm/functions/mods_list.sh @@ -12,17 +12,59 @@ functionselfname="$(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" -# Metamod -metamodmversion="1.10" -metamodscrapeurl="https://mms.alliedmods.net/mmsdrop/${metamodmversion}/mmsource-latest-linux" -metamodlatestfile=$(wget "${metamodscrapeurl}" -q -O -) -metamoddownloadurl="https://www.metamodsource.net/latest.php?os=linux&version=${metamodmversion}" + +# Metamod (Half-life 1 Classic Engine) +metamodversion="1.21.1-am" +metamodlatestfile="metamod-${metamodversion}.zip" +metamoddownloadurl="https://www.amxmodx.org/release/${metamodlatestfile}" metamodurl="${metamoddownloadurl}" +# AMX Mod X: Base +amxxbaseversion="1.8.2" +amxxbasemod="base" +amxxbaselatestfile="amxmodx-${amxxbaseversion}-${amxxbasemod}-linux.tar.gz" +amxxbasedownloadurl="https://www.amxmodx.org/release/${amxxbaselatestfile}" +amxxbaseurl="${amxxbasedownloadurl}" +# AMX Mod X: Counter-Strike +amxxcsversion="1.8.2" +amxxcsmod="cstrike" +amxxcslatestfile="amxmodx-${amxxbaseversion}-${amxxcsmod}-linux.tar.gz" +amxxcsdownloadurl="https://www.amxmodx.org/release/${amxxcslatestfile}" +amxxcsurl="${amxxcsdownloadurl}" +# AMX Mod X: Day of Defeat +amxxdodversion="1.8.2" +amxxdodmod="dod" +amxxdodlatestfile="amxmodx-${amxxdodversion}-${amxxdodmod}-linux.tar.gz" +amxxdoddownloadurl="https://www.amxmodx.org/release/${amxxdodlatestfile}" +amxxdodurl="${amxxdoddownloadurl}" +# AMX Mod X: Team Fortress Classic +amxxtfcversion="1.8.2" +amxxtfcmod="tfc" +amxxtfclatestfile="amxmodx-${amxxtfcversion}-${amxxtfcmod}-linux.tar.gz" +amxxtfcdownloadurl="https://www.amxmodx.org/release/${amxxtfclatestfile}" +amxxtfcurl="${amxxtfcdownloadurl}" +# AMX Mod X: Natural Selection +amxxnsversion="1.8.2" +amxxnsmod="ns" +amxxnslatestfile="amxmodx-${amxxnsversion}-${amxxnsmod}-linux.tar.gz" +amxxnsdownloadurl="https://www.amxmodx.org/release/${amxxnslatestfile}" +amxxnsurl="${amxxnsdownloadurl}" +# AMX Mod X: The Specialists +amxxtsversion="1.8.2" +amxxtsmod="ts" +amxxtslatestfile="amxmodx-${amxxtsversion}-${amxxtsmod}-linux.tar.gz" +amxxtsdownloadurl="https://www.amxmodx.org/release/${amxxtslatestfile}" +amxxtsurl="${amxxtsdownloadurl}" +# Metamod:Source +metamodsourceversion="1.10" +metamodsourcescrapeurl="https://mms.alliedmods.net/mmsdrop/${metamodsourceversion}/mmsource-latest-linux" +metamodsourcelatestfile=$(wget "${metamodsourcescrapeurl}" -q -O -) +metamodsourcedownloadurl="https://www.metamodsource.net/latest.php?os=linux&version=${metamodsourceversion}" +metamodsourceurl="${metamodsourcedownloadurl}" # Sourcemod -sourcemodmversion="1.10" -sourcemodscrapeurl="https://sm.alliedmods.net/smdrop/${sourcemodmversion}/sourcemod-latest-linux" +sourcemodversion="1.10" +sourcemodscrapeurl="https://sm.alliedmods.net/smdrop/${sourcemodversion}/sourcemod-latest-linux" sourcemodlatestfile=$(wget "${sourcemodscrapeurl}" -q -O -) -sourcemoddownloadurl="https://www.sourcemod.net/latest.php?os=linux&version=${sourcemodmversion}" +sourcemoddownloadurl="https://www.sourcemod.net/latest.php?os=linux&version=${sourcemodversion}" sourcemodurl="${sourcemoddownloadurl}" # Steamworks steamworksscrapeurl="https://users.alliedmods.net/~kyles/builds/SteamWorks" @@ -67,15 +109,34 @@ modseparator="MOD" # [12] | "AUTHOR_URL" is the author's website, displayed to the user when chosing mods to install # [13] | "Short Description" a description showed to the user upon installation/removal +# Half-life 1 Engine Mods +mod_info_metamod=( MOD "metamod" "Metamod" "${metamodurl}" "${metamodlatestfile}" "0" "LowercaseOff" "${systemdir}" "addons/metamod/plugins.ini;" "ENGINES" "Counter-Strike 1.6;Day of Defeat;Team Fortress Classic;Natural Selection;The Specialists;Half-Life: Deathmatch;" "NOTGAMES" "https://github.com/alliedmodders/metamod-hl1" "Plugins Framework" ) +mod_info_base_amxx=( MOD "amxmodx" "AMX Mod X: Base" "${amxxbaseurl}" "${amxxbaselatestfile}" "0" "LowercaseOff" "${systemdir}" "addons/amxmodx/configs;" "ENGINES" "Counter-Strike 1.6;Day of Defeat;Team Fortress Classic;Natural Selection;The Specialists;Half-Life: Deathmatch;" "NOTGAMES" "https://www.amxmodx.org" "Admin Features (requires Metamod)" ) + +# CS 1.6 (HL1) Engine Mods +mod_info_cs_amxx=( MOD "amxmodxcs" "AMX Mod X: Counter-Strike" "${amxxcsurl}" "${amxxcslatestfile}" "0" "LowercaseOff" "${systemdir}" "addons/amxmodx/configs;" "ENGINES" "Counter-Strike 1.6;" "NOTGAMES" "https://www.amxmodx.org" "Admin Features (requires Metamod & AMX Mod X: Base)" ) + +# DOD (HL1) Engine Mods +mod_info_dod_amxx=( MOD "amxmodxdod" "AMX Mod X: Day of Defeat" "${amxxdodurl}" "${amxxdodlatestfile}" "0" "LowercaseOff" "${systemdir}" "addons/amxmodx/configs;" "ENGINES" "Day of Defeat;" "NOTGAMES" "https://www.amxmodx.org" "Admin Features (requires Metamod & AMX Mod X: Base)" ) + +# TFC (HL1) Engine Mods +mod_info_tfc_amxx=( MOD "amxmodxtfc" "AMX Mod X: Team Fortress Classic" "${amxxtfcurl}" "${amxxtfclatestfile}" "0" "LowercaseOff" "${systemdir}" "addons/amxmodx/configs;" "ENGINES" "Team Fortress Classic;" "NOTGAMES" "https://www.amxmodx.org" "Admin Features (requires Metamod & AMX Mod X: Base)" ) + +# NS (Natural Selection) (HL1) Engine Mods +mod_info_ns_amxx=( MOD "amxmodxns" "AMX Mod X: Natural Selection" "${amxxnsurl}" "${amxxnslatestfile}" "0" "LowercaseOff" "${systemdir}" "addons/amxmodx/configs;" "ENGINES" "Natural Selection;" "NOTGAMES" "https://www.amxmodx.org" "Admin Features (requires Metamod & AMX Mod X: Base)" ) + +# TS (The Specialists) (HL1) Engine Mods +mod_info_ts_amxx=( MOD "amxmodxts" "AMX Mod X: The Specialists" "${amxxtsurl}" "${amxxtslatestfile}" "0" "LowercaseOff" "${systemdir}" "addons/amxmodx/configs;" "ENGINES" "The Specialists;" "NOTGAMES" "https://www.amxmodx.org" "Admin Features (requires Metamod & AMX Mod X: Base)" ) + # Source mods -mod_info_metamod=( MOD "metamod" "MetaMod" "${metamodurl}" "${metamodlatestfile}" "0" "LowercaseOff" "${systemdir}" "addons/metamod/metaplugins.ini;" "source;" "GAMES" "NOTGAMES" "https://www.sourcemm.net" "Plugins Framework" ) -mod_info_sourcemod=( MOD "sourcemod" "SourceMod" "${sourcemodurl}" "${sourcemodlatestfile}" "0" "LowercaseOff" "${systemdir}" "cfg;addons/sourcemod/configs;" "source;" "GAMES" "NOTGAMES" "http://www.sourcemod.net" "Admin Features (requires MetaMod)" ) +mod_info_metamodsource=( MOD "metamodsource" "Metamod: Source" "${metamodsourceurl}" "${metamodsourcelatestfile}" "0" "LowercaseOff" "${systemdir}" "addons/metamod/metaplugins.ini;" "source;" "GAMES" "NOTGAMES" "https://www.sourcemm.net" "Plugins Framework" ) +mod_info_sourcemod=( MOD "sourcemod" "SourceMod" "${sourcemodurl}" "${sourcemodlatestfile}" "0" "LowercaseOff" "${systemdir}" "cfg;addons/sourcemod/configs;" "source;" "GAMES" "NOTGAMES" "http://www.sourcemod.net" "Admin Features (requires Metamod: Source)" ) mod_info_steamworks=( MOD "steamworks" "SteamWorks" "${steamworksurl}" "${steamworkslatestfile}" "0" "LowercaseOff" "${systemdir}" "OVERWRITE" "ENGINES" "Counter-Strike: Global Offensive;" "NOTGAMES" "https://github.com/KyleSanderson/SteamWorks" "Exposing SteamWorks functions to SourcePawn" ) mod_info_stripper=( MOD "stripper" "Stripper Source" "http://www.bailopan.net/stripper/snapshots/1.2/stripper-1.2.2-git129-linux.tar.gz" "stripper-1.2.2-git129-linux.tar.gz" "0" "LowercaseOff" "${systemdir}" "addons/stripper/maps;" "ENGINES" "Counter-Strike: Global Offensive;Counter-Strike: Source;Day of Defeat: Source;Half Life: Deathmatch;Half Life 2: Deathmatch;Insurgency;Left 4 Dead;Left 4 Dead 2;Nuclear Dawn;Team Fortress 2;" "NOTGAMES" "http://www.bailopan.net/stripper/" "Add or remove objects from map (requires MetaMod)") # CS:GO Mods mod_info_gokz=( MOD "gokz" "GOKZ" "https://bitbucket.org/kztimerglobalteam/gokz/downloads/GOKZ-latest.zip" "gokz-latest.zip" "0" "LowercaseOff" "${systemdir}" "cfg;addons/sourcemod/configs;" "ENGINES" "Counter-Strike: Global Offensive;" "NOTGAMES" "https://bitbucket.org/kztimerglobalteam/gokz/src/master/" "Implements the KZ game mode (requires SourceMod and MetaMod)" ) -mod_info_ttt=( MOD "ttt" "Trouble in Terrorist Town" "https://csgottt.com/downloads/ttt-latest-dev-${sourcemodmversion}.zip" "ttt-latest.zip" "0" "LowercaseOff" "${systemdir}" "cfg;addons/sourcemod/configs;" "ENGINES" "Counter-Strike: Global Offensive;" "NOTGAMES" "https://github.com/Bara/TroubleinTerroristTown" "Implements the TTT game mode (requires SourceMod and MetaMod)" ) +mod_info_ttt=( MOD "ttt" "Trouble in Terrorist Town" "https://csgottt.com/downloads/ttt-latest-dev-${sourcemodversion}.zip" "ttt-latest.zip" "0" "LowercaseOff" "${systemdir}" "cfg;addons/sourcemod/configs;" "ENGINES" "Counter-Strike: Global Offensive;" "NOTGAMES" "https://github.com/Bara/TroubleinTerroristTown" "Implements the TTT game mode (requires SourceMod and MetaMod)" ) mod_info_get5=( MOD "get5" "Get 5" "${get5url}" "${get5latestfile}" "0" "LowercaseOff" "${systemdir}" "cfg;addons/sourcemod/configs;" "ENGINES" "Counter-Strike: Global Offensive;" "NOTGAMES" "https://github.com/splewis/get5" "Plugin for competitive matches/scrims (requires SourceMod and MetaMod)" ) mod_info_pug=( MOD "pug" "PUG" "${csgopuglatestlink}" "${csgopuglatestfile}" "0" "LowercaseOff" "${systemdir}" "cfg;addons/sourcemod/configs;" "ENGINES" "Counter-Strike: Global Offensive;" "NOTGAMES" "https://github.com/splewis/csgo-pug-setup" "plugin for setting up private pug/10man games" ) @@ -93,11 +154,10 @@ mod_info_wiremodextras=( MOD "wiremod-extras" "Wiremod Extras" "https://github.c mod_info_darkrp=( MOD "darkrp" "DarkRP" "https://github.com/FPtje/DarkRP/archive/master.zip" "darkrp-master.zip" "0" "LowercaseOn" "${systemdir}/gamemodes" "OVERWRITE" "ENGINES" "Garry's Mod;" "NOTGAMES" "http://darkrp.com" "Most popular gamemode" ) mod_info_darkrpmodification=( MOD "darkrpmodification" "DarkRP Modification" "https://github.com/FPtje/darkrpmodification/archive/master.zip" "darkrpmodification-master.zip" "0" "LowercaseOff" "${systemdir}/addons" "NOUPDATE" "ENGINES" "Garry's Mod;" "NOTGAMES" "http://darkrp.com" "Customize DarkRP settings" ) - # Oxidemod mod_info_rustoxide=( MOD "rustoxide" "Oxide for Rust" "${oxiderustlatestlink}" "Oxide.Rust-linux.zip" "0" "LowercaseOff" "${systemdir}" "OVERWRITE" "ENGINES" "Rust;" "NOTGAMES" "https://umod.org/games/rust" "Allows for the use of plugins" ) mod_info_hwoxide=( MOD "hwoxide" "Oxide for Hurtworld" "${oxidehurtworldlatestlink}" "Oxide.Hurtworld.zip" "0" "LowercaseOff" "${systemdir}" "OVERWRITE" "ENGINES" "Hurtworld;" "NOTGAMES" "https://umod.org/games/hurtworld" "Allows for the use of plugins" ) mod_info_sdtdoxide=( MOD "sdtdoxide" "Oxide for 7 Days To Die" "${oxidesdtdlatestlink}" "Oxide.SevenDaysToDie.zip" "0" "LowercaseOff" "${systemdir}" "OVERWRITE" "ENGINES" "7 Days To Die;" "NOTGAMES" "https://umod.org/games/7-days-to-die" "Allows for the use of plugins" ) # REQUIRED: Set all mods info into the global array -mods_global_array=( "${mod_info_metamod[@]}" "${mod_info_sourcemod[@]}" "${mod_info_steamworks[@]}" "${mod_info_stripper[@]}" "${mod_info_gokz[@]}" "${mod_info_ttt[@]}" "${mod_info_get5[@]}" "${mod_info_pug[@]}" "${mod_info_ulib[@]}" "${mod_info_ulx[@]}" "${mod_info_utime[@]}" "${mod_info_uclip[@]}" "${mod_info_acf[@]}" "${mod_info_acf_missiles[@]}" "${mod_info_acf_sweps[@]}" "${mod_info_advdupe2[@]}" "${mod_info_pac3[@]}" "${mod_info_wiremod[@]}" "${mod_info_wiremodextras[@]}" "${mod_info_darkrp[@]}" "${mod_info_darkrpmodification[@]}" "${mod_info_rustoxide[@]}" "${mod_info_hwoxide[@]}" "${mod_info_sdtdoxide[@]}" ) +mods_global_array=( "${mod_info_metamod[@]}" "${mod_info_base_amxx[@]}" "${mod_info_cs_amxx[@]}" "${mod_info_dod_amxx[@]}" "${mod_info_tfc_amxx[@]}" "${mod_info_ns_amxx[@]}" "${mod_info_ts_amxx[@]}" "${mod_info_metamodsource[@]}" "${mod_info_sourcemod[@]}" "${mod_info_steamworks[@]}" "${mod_info_gokz[@]}" "${mod_info_ttt[@]}" "${mod_info_get5[@]}" "${mod_info_pug[@]}" "${mod_info_ulib[@]}" "${mod_info_ulx[@]}" "${mod_info_utime[@]}" "${mod_info_uclip[@]}" "${mod_info_acf[@]}" "${mod_info_acf_missiles[@]}" "${mod_info_acf_sweps[@]}" "${mod_info_advdupe2[@]}" "${mod_info_pac3[@]}" "${mod_info_wiremod[@]}" "${mod_info_wiremodextras[@]}" "${mod_info_darkrp[@]}" "${mod_info_darkrpmodification[@]}" "${mod_info_rustoxide[@]}" "${mod_info_hwoxide[@]}" "${mod_info_sdtdoxide[@]}" ) \ No newline at end of file From 6eabed9565f68b620d65df12fadcd62cd09cae0a Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sun, 22 Nov 2020 19:00:44 +0000 Subject: [PATCH 14/24] feat(ut99server): update UT99 to version 469a (OldUnreal patch) (#3110) --- lgsm/functions/install_server_files.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lgsm/functions/install_server_files.sh b/lgsm/functions/install_server_files.sh index 73f2dc2b11..f8b6be4f06 100755 --- a/lgsm/functions/install_server_files.sh +++ b/lgsm/functions/install_server_files.sh @@ -48,7 +48,7 @@ fn_install_server_files(){ elif [ "${shortname}" == "ut2k4" ]; then remote_fileurl="http://linuxgsm.download/UnrealTournament2004/ut2004-server-3369-3-ultimate-linux.tar.xz"; local_filedir="${tmpdir}"; local_filename="ut2004-server-3369-3-ultimate-linux.tar.xz"; chmodx="nochmodx" run="norun"; force="noforce"; md5="9fceaab68554749f4b45be66613b9a15" elif [ "${shortname}" == "ut99" ]; then - remote_fileurl="http://linuxgsm.download/UnrealTournament99/ut99-server-451-ultimate-linux.tar.xz"; local_filedir="${tmpdir}"; local_filename="ut99-server-451-ultimate-linux.tar.xz"; chmodx="nochmodx" run="norun"; force="noforce"; md5="42c6839f8cb95907eeef71a1838aa1f7" + remote_fileurl="http://linuxgsm.download/UnrealTournament99/ut99-server-469a-ultimate-linux.tar.xz"; local_filedir="${tmpdir}"; local_filename="ut99-server-469a-ultimate-linux.tar.xz"; chmodx="nochmodx" run="norun"; force="noforce"; md5="e3f2ffaab8e23b98d9e825d0244e8b9d" elif [ "${shortname}" == "ut" ]; then remote_fileurl="http://linuxgsm.download/UnrealTournament/UnrealTournament-Server-XAN-3525360-Linux.tar.xz"; local_filedir="${tmpdir}"; local_filename="UnrealTournament-Server-XAN-3525360-Linux.tar.xz"; chmodx="noexecute" run="norun"; force="noforce"; md5="41dd92015713a78211eaccf503b72393" elif [ "${shortname}" == "ut3" ]; then From d7b4ac6b46169368ea0568bc0e7e636a1094bf23 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sat, 28 Nov 2020 22:17:47 +0000 Subject: [PATCH 15/24] feat(mcserver): select Minecraft release or snapshot (#3114) Select either release or snapshot branch. Also, have the option to select either latest or specific release/snapshot. A new more efficient way to get the local release that extracts the jar file and parses json file with version number Co-authored-by: Josh Bryans --- .../config-lgsm/mcserver/_default.cfg | 5 +- lgsm/functions/update_minecraft.sh | 65 ++++++------------- 2 files changed, 24 insertions(+), 46 deletions(-) diff --git a/lgsm/config-default/config-lgsm/mcserver/_default.cfg b/lgsm/config-default/config-lgsm/mcserver/_default.cfg index 92f25294cb..b78195e3e1 100644 --- a/lgsm/config-default/config-lgsm/mcserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/mcserver/_default.cfg @@ -16,8 +16,11 @@ fn_parms(){ parms="nogui" } -## Branch, "snapshot" include snapshot and pre-release versions. | (release|snapshot) +## Release Settings | https://docs.linuxgsm.com/game-servers/minecraft#release-settings +# Branch (release|snapshot) branch="release" +# Version (latest|1.16) +mcversion="latest" #### LinuxGSM Settings #### diff --git a/lgsm/functions/update_minecraft.sh b/lgsm/functions/update_minecraft.sh index 98889ed640..e33840f3ee 100755 --- a/lgsm/functions/update_minecraft.sh +++ b/lgsm/functions/update_minecraft.sh @@ -7,14 +7,12 @@ functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_update_minecraft_dl(){ - if [ "${branch}" == "release" ]; then - latestmcreleaselink=$(curl -s "https://launchermeta.${remotelocation}/mc/game/version_manifest.json" | jq -r '.latest.release as $latest | .versions[] | select(.id == $latest) | .url') - else - latestmcreleaselink=$(curl -s "https://launchermeta.${remotelocation}/mc/game/version_manifest.json" | jq -r '.versions[0].url') - fi + # Generate link to version manifest json. + remotebuildlink=$(curl -s "https://launchermeta.${remotelocation}/mc/game/version_manifest.json" | jq -r --arg branch ${branch} --arg mcversion ${remotebuild} '.versions | .[] | select(.type==$branch and .id==$mcversion) | .url') + # Generate link to server.jar + remotebuildurl=$(curl -s "${remotebuildlink}" | jq -r '.downloads.server.url') - latestmcbuildurl=$(curl -s "${latestmcreleaselink}" | jq -r '.downloads.server.url') - fn_fetch_file "${latestmcbuildurl}" "" "" "" "${tmpdir}" "minecraft_server.${remotebuild}.jar" "" "norun" "noforce" "nomd5" + fn_fetch_file "${remotebuildurl}" "" "" "" "${tmpdir}" "minecraft_server.${remotebuild}.jar" "" "norun" "noforce" "nomd5" echo -e "copying to ${serverfiles}...\c" cp "${tmpdir}/minecraft_server.${remotebuild}.jar" "${serverfiles}/minecraft_server.jar" local exitcode=$? @@ -34,53 +32,30 @@ fn_update_minecraft_dl(){ fn_update_minecraft_localbuild(){ # Gets local build info. fn_print_dots "Checking local build: ${remotelocation}" - # Uses log file to gather info. - localbuild=$(grep -i version "${consolelogdir}"/* | tail -1 | sed 's/.*[Vv]ersion //' | sed 's/\r//g' 2>/dev/null) - if [ -z "${localbuild}" ]; then - fn_print_error "Checking local build: ${remotelocation}" - fn_print_error_nl "Checking local build: ${remotelocation}: no log files containing version info" - fn_print_info_nl "Checking local build: ${remotelocation}: forcing server restart" - fn_script_log_error "No log files containing version info" - fn_script_log_info "Forcing server restart" - exitbypass=1 - command_stop.sh - fn_firstcommand_reset - exitbypass=1 - command_start.sh - fn_firstcommand_reset - totalseconds=0 - localbuild=$(grep -i version "${consolelogdir}"/* | tail -1 | sed 's/.*[Vv]ersion //' | sed 's/\r//g' 2>/dev/null) - while [ -z "${localbuild}" ]; do - sleep 1 - fn_print_info "Checking local build: ${remotelocation}: waiting for log file: ${totalseconds}" - if [ -v "${loopignore}" ]; then - loopignore=1 - fn_script_log_info "Waiting for log file to generate" - fi - - localbuild=$(grep -i version "${consolelogdir}"/* | tail -1 | sed 's/.*[Vv]ersion //' | sed 's/\r//g' 2>/dev/null) - if [ "${totalseconds}" -gt "120" ]; then - localbuild="0" - fn_print_error "Checking local build: ${remotelocation}: waiting for log file" - fn_script_log_error "Local build did not generate" - fn_script_log_error "Required log file may be missing" - fn_script_log_error "Local build set to 0" - fi - totalseconds=$((totalseconds + 1)) - done - fi - if [ "${localbuild}" != "0" ]; then + # Uses executable to find local build. + cd "${executabledir}" || exit + if [ -f "minecraft_server.jar" ]; then + localbuild=$(unzip -p "minecraft_server.jar" version.json | jq -r '.id') fn_print_ok "Checking local build: ${remotelocation}" fn_script_log_pass "Checking local build" + else + localbuild="0" + fn_print_error "Checking local build: ${remotelocation}" + fn_script_log_error "Checking local build" fi } fn_update_minecraft_remotebuild(){ # Gets remote build info. - if [ "${branch}" == "release" ]; then + # Latest release. + if [ "${branch}" == "release" ] && [ "${mcversion}" == "latest" ]; then remotebuild=$(curl -s "https://launchermeta.${remotelocation}/mc/game/version_manifest.json" | jq -r '.latest.release') + # Latest snapshot. + elif [ "${branch}" == "snapshot" ] && [ "${mcversion}" == "latest" ]; then + remotebuild=$(curl -s "https://launchermeta.${remotelocation}/mc/game/version_manifest.json" | jq -r '.latest.snapshot') + # Specific release/snapshot. else - remotebuild=$(curl -s "https://launchermeta.${remotelocation}/mc/game/version_manifest.json" | jq -r '.versions[0].id') + remotebuild=$(curl -s "https://launchermeta.${remotelocation}/mc/game/version_manifest.json" | jq -r --arg branch ${branch} --arg mcversion ${mcversion} '.versions | .[] | select(.type==$branch and .id==$mcversion) | .id') fi if [ "${firstcommandname}" != "INSTALL" ]; then From 269bf6e491fba066f22318668c90d5bbe0692fdc Mon Sep 17 00:00:00 2001 From: Christian Date: Sun, 29 Nov 2020 14:20:56 +0100 Subject: [PATCH 16/24] fix: add connect timeout to core curl functions (#3117) --- lgsm/functions/alert_discord.sh | 2 +- lgsm/functions/alert_ifttt.sh | 2 +- lgsm/functions/alert_mailgun.sh | 2 +- lgsm/functions/alert_pushbullet.sh | 2 +- lgsm/functions/alert_pushover.sh | 2 +- lgsm/functions/alert_rocketchat.sh | 2 +- lgsm/functions/alert_slack.sh | 2 +- lgsm/functions/alert_telegram.sh | 2 +- lgsm/functions/command_update_linuxgsm.sh | 28 +++++++++++------------ lgsm/functions/core_dl.sh | 4 ++-- lgsm/functions/info_distro.sh | 6 ++--- lgsm/functions/mods_list.sh | 14 ++++++------ linuxgsm.sh | 2 +- 13 files changed, 35 insertions(+), 35 deletions(-) diff --git a/lgsm/functions/alert_discord.sh b/lgsm/functions/alert_discord.sh index b9512bbe7c..a8ce373f0e 100755 --- a/lgsm/functions/alert_discord.sh +++ b/lgsm/functions/alert_discord.sh @@ -52,7 +52,7 @@ EOF fn_print_dots "Sending Discord alert" -discordsend=$(curl -sSL -H "Content-Type: application/json" -X POST -d "$(echo -n "$json" | jq -c .)" "${discordwebhook}") +discordsend=$(curl --connect-timeout 10 -sSL -H "Content-Type: application/json" -X POST -d "$(echo -n "$json" | jq -c .)" "${discordwebhook}") if [ -n "${discordsend}" ]; then fn_print_fail_nl "Sending Discord alert: ${discordsend}" diff --git a/lgsm/functions/alert_ifttt.sh b/lgsm/functions/alert_ifttt.sh index 7a75050a4b..faef505a55 100755 --- a/lgsm/functions/alert_ifttt.sh +++ b/lgsm/functions/alert_ifttt.sh @@ -16,7 +16,7 @@ EOF ) fn_print_dots "Sending IFTTT alert" -iftttsend=$(curl -sSL -H "Content-Type: application/json" -X POST -d """${json}""" "https://maker.ifttt.com/trigger/${iftttevent}/with/key/${ifttttoken}" | grep "Bad Request") +iftttsend=$(curl --connect-timeout 10 -sSL -H "Content-Type: application/json" -X POST -d """${json}""" "https://maker.ifttt.com/trigger/${iftttevent}/with/key/${ifttttoken}" | grep "Bad Request") if [ -n "${iftttsend}" ]; then fn_print_fail_nl "Sending IFTTT alert: ${pushbulletsend}" diff --git a/lgsm/functions/alert_mailgun.sh b/lgsm/functions/alert_mailgun.sh index 0c5aef4b64..5694bd595e 100755 --- a/lgsm/functions/alert_mailgun.sh +++ b/lgsm/functions/alert_mailgun.sh @@ -14,7 +14,7 @@ fi fn_print_dots "Sending Email alert: Mailgun: ${email}" -mailgunsend=$(curl -s --user "api:${mailguntoken}" \ +mailgunsend=$(curl --connect-timeout 10 -s --user "api:${mailguntoken}" \ -F from="LinuxGSM <${mailgunemailfrom}>" \ -F to="LinuxGSM Admin <${mailgunemail}>" \ -F subject="${alertemoji} ${alertsubject} ${alertemoji}" \ diff --git a/lgsm/functions/alert_pushbullet.sh b/lgsm/functions/alert_pushbullet.sh index 7a0117a0a4..42a9b7d5d1 100755 --- a/lgsm/functions/alert_pushbullet.sh +++ b/lgsm/functions/alert_pushbullet.sh @@ -17,7 +17,7 @@ EOF ) fn_print_dots "Sending Pushbullet alert" -pushbulletsend=$(curl -sSL -u """${pushbullettoken}"":" -H "Content-Type: application/json" -X POST -d """${json}""" "https://api.pushbullet.com/v2/pushes" | grep "error_code") +pushbulletsend=$(curl --connect-timeout 10 -sSL -u """${pushbullettoken}"":" -H "Content-Type: application/json" -X POST -d """${json}""" "https://api.pushbullet.com/v2/pushes" | grep "error_code") if [ -n "${pushbulletsend}" ]; then fn_print_fail_nl "Sending Pushbullet alert: ${pushbulletsend}" diff --git a/lgsm/functions/alert_pushover.sh b/lgsm/functions/alert_pushover.sh index 82ba0af053..848a2eea5a 100755 --- a/lgsm/functions/alert_pushover.sh +++ b/lgsm/functions/alert_pushover.sh @@ -21,7 +21,7 @@ else alertpriority="0" fi -pushoversend=$(curl -sS -F token="${pushovertoken}" -F user="${pushoveruserkey}" -F html="1" -F sound="${alertsound}" -F priority="${alertpriority}" -F title="${alertemoji} ${alertsubject} ${alertemoji}" -F message=" Server name
${servername}

Message
${alertbody}

Game
${gamename}

Server IP
${alertip}:${port}

Hostname
${HOSTNAME}

More info
${alerturl}" "https://api.pushover.net/1/messages.json" | grep errors) +pushoversend=$(curl --connect-timeout 10 -sS -F token="${pushovertoken}" -F user="${pushoveruserkey}" -F html="1" -F sound="${alertsound}" -F priority="${alertpriority}" -F title="${alertemoji} ${alertsubject} ${alertemoji}" -F message=" Server name
${servername}

Message
${alertbody}

Game
${gamename}

Server IP
${alertip}:${port}

Hostname
${HOSTNAME}

More info
${alerturl}" "https://api.pushover.net/1/messages.json" | grep errors) if [ -n "${pushoversend}" ]; then fn_print_fail_nl "Sending Pushover alert: ${pushoversend}" diff --git a/lgsm/functions/alert_rocketchat.sh b/lgsm/functions/alert_rocketchat.sh index 505113918b..e6d4cf5ce7 100755 --- a/lgsm/functions/alert_rocketchat.sh +++ b/lgsm/functions/alert_rocketchat.sh @@ -42,7 +42,7 @@ EOF fn_print_dots "Sending Rocketchat alert" -rocketchatsend=$(curl -sSL -H "Content-Type:application/json" -X POST -d "$(echo -n "$json" | jq -c .)" "${rocketchatwebhook}") +rocketchatsend=$(curl --connect-timeout 10 -sSL -H "Content-Type:application/json" -X POST -d "$(echo -n "$json" | jq -c .)" "${rocketchatwebhook}") if [ -n "${rocketchatsend}" ]; then fn_print_ok_nl "Sending Rocketchat alert" diff --git a/lgsm/functions/alert_slack.sh b/lgsm/functions/alert_slack.sh index 0ea5a41f85..c3a82d529a 100755 --- a/lgsm/functions/alert_slack.sh +++ b/lgsm/functions/alert_slack.sh @@ -67,7 +67,7 @@ EOF fn_print_dots "Sending Slack alert" -slacksend=$(curl -sSL -H "Content-Type: application/json" -X POST -d "$(echo -n "$json" | jq -c .)" "${slackwebhook}") +slacksend=$(curl --connect-timeout 10 -sSL -H "Content-Type: application/json" -X POST -d "$(echo -n "$json" | jq -c .)" "${slackwebhook}") if [ "${slacksend}" == "ok" ]; then fn_print_ok_nl "Sending Slack alert" diff --git a/lgsm/functions/alert_telegram.sh b/lgsm/functions/alert_telegram.sh index 64e5fcbb32..7b812246cd 100755 --- a/lgsm/functions/alert_telegram.sh +++ b/lgsm/functions/alert_telegram.sh @@ -16,7 +16,7 @@ EOF ) fn_print_dots "Sending Telegram alert" -telegramsend=$(curl -sSL -H "Content-Type: application/json" -X POST -d """${json}""" ${curlcustomstring} "https://api.telegram.org/bot${telegramtoken}/sendMessage" | grep "error_code") +telegramsend=$(curl --connect-timeout 10 -sSL -H "Content-Type: application/json" -X POST -d """${json}""" ${curlcustomstring} "https://api.telegram.org/bot${telegramtoken}/sendMessage" | grep "error_code") if [ -n "${telegramsend}" ]; then fn_print_fail_nl "Sending Telegram alert: ${telegramsend}" diff --git a/lgsm/functions/command_update_linuxgsm.sh b/lgsm/functions/command_update_linuxgsm.sh index 37918be2d2..7e0ec57b68 100755 --- a/lgsm/functions/command_update_linuxgsm.sh +++ b/lgsm/functions/command_update_linuxgsm.sh @@ -17,9 +17,9 @@ fn_script_log_info "Updating LinuxGSM" fn_print_dots "Selecting repo" fn_script_log_info "Selecting repo" # Select remotereponame -curl -IsfL "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/linuxgsm.sh" 1>/dev/null +curl --connect-timeout 10 -IsfL "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/linuxgsm.sh" 1>/dev/null if [ $? != "0" ]; then - curl -IsfL "https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/linuxgsm.sh" 1>/dev/null + curl --connect-timeout 10 -IsfL "https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/linuxgsm.sh" 1>/dev/null if [ $? != "0" ]; then fn_print_fail_nl "Selecting repo: Unable to to access GitHub or Bitbucket repositories" fn_script_log_fatal "Selecting repo: Unable to to access GitHub or Bitbucket repositories" @@ -36,9 +36,9 @@ fi # Check linuxsm.sh echo -en "checking ${remotereponame} linuxgsm.sh...\c" if [ "${remotereponame}" == "GitHub" ]; then - curl -IsfL "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/linuxgsm.sh" 1>/dev/null + curl --connect-timeout 10 -IsfL "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/linuxgsm.sh" 1>/dev/null else - curl -IsfL "https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/linuxgsm.sh" 1>/dev/null + curl --connect-timeout 10 -IsfL "https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/linuxgsm.sh" 1>/dev/null fi if [ $? != "0" ]; then fn_print_fail_eol_nl @@ -48,9 +48,9 @@ if [ $? != "0" ]; then fi if [ "${remotereponame}" == "GitHub" ]; then - tmp_script_diff=$(diff "${tmpdir}/linuxgsm.sh" <(curl -s "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/linuxgsm.sh")) + tmp_script_diff=$(diff "${tmpdir}/linuxgsm.sh" <(curl --connect-timeout 10 -s "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/linuxgsm.sh")) else - tmp_script_diff=$(diff "${tmpdir}/linuxgsm.sh" <(curl -s "https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/linuxgsm.sh")) + tmp_script_diff=$(diff "${tmpdir}/linuxgsm.sh" <(curl --connect-timeout 10 -s "https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/linuxgsm.sh")) fi if [ "${tmp_script_diff}" != "" ]; then @@ -116,9 +116,9 @@ fi echo -en "checking ${remotereponame} config _default.cfg...\c" fn_script_log_info "Checking ${remotereponame} config _default.cfg" if [ "${remotereponame}" == "GitHub" ]; then - curl -IsfL "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/lgsm/config-default/config-lgsm/${gameservername}/_default.cfg" 1>/dev/null + curl --connect-timeout 10 -IsfL "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/lgsm/config-default/config-lgsm/${gameservername}/_default.cfg" 1>/dev/null else - curl -IsfL "https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/lgsm/config-default/config-lgsm/${gameservername}/_default.cfg" 1>/dev/null + curl --connect-timeout 10 -IsfL "https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/lgsm/config-default/config-lgsm/${gameservername}/_default.cfg" 1>/dev/null fi if [ $? != "0" ]; then fn_print_fail_eol_nl @@ -128,9 +128,9 @@ if [ $? != "0" ]; then fi if [ "${remotereponame}" == "GitHub" ]; then - config_file_diff=$(diff "${configdirdefault}/config-lgsm/${gameservername}/_default.cfg" <(curl -s "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/lgsm/config-default/config-lgsm/${gameservername}/_default.cfg")) + config_file_diff=$(diff "${configdirdefault}/config-lgsm/${gameservername}/_default.cfg" <(curl --connect-timeout 10 -s "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/lgsm/config-default/config-lgsm/${gameservername}/_default.cfg")) else - config_file_diff=$(diff "${configdirdefault}/config-lgsm/${gameservername}/_default.cfg" <(curl -s "https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/lgsm/config-default/config-lgsm/${gameservername}/_default.cfg")) + config_file_diff=$(diff "${configdirdefault}/config-lgsm/${gameservername}/_default.cfg" <(curl --connect-timeout 10 -s "https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/lgsm/config-default/config-lgsm/${gameservername}/_default.cfg")) fi if [ "${config_file_diff}" != "" ]; then @@ -155,9 +155,9 @@ if [ -n "${functionsdir}" ]; then echo -en "checking ${remotereponame} module ${functionfile}...\c" github_file_url_dir="lgsm/functions" if [ "${remotereponame}" == "GitHub" ]; then - curl -IsfL "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${functionfile}" 1>/dev/null + curl --connect-timeout 10 -IsfL "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${functionfile}" 1>/dev/null else - curl -IsfL "https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/${github_file_url_dir}/${functionfile}" 1>/dev/null + curl --connect-timeout 10 -IsfL "https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/${github_file_url_dir}/${functionfile}" 1>/dev/null fi if [ $? != 0 ]; then fn_print_error_eol_nl @@ -174,9 +174,9 @@ if [ -n "${functionsdir}" ]; then else # compare file if [ "${remotereponame}" == "GitHub" ]; then - function_file_diff=$(diff "${functionsdir}/${functionfile}" <(curl -s "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${functionfile}")) + function_file_diff=$(diff "${functionsdir}/${functionfile}" <(curl --connect-timeout 10 -s "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${functionfile}")) else - function_file_diff=$(diff "${functionsdir}/${functionfile}" <(curl -s "https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/${github_file_url_dir}/${functionfile}")) + function_file_diff=$(diff "${functionsdir}/${functionfile}" <(curl --connect-timeout 10 -s "https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/${github_file_url_dir}/${functionfile}")) fi # results diff --git a/lgsm/functions/core_dl.sh b/lgsm/functions/core_dl.sh index b5c92b3c1c..ea20002a8f 100755 --- a/lgsm/functions/core_dl.sh +++ b/lgsm/functions/core_dl.sh @@ -267,11 +267,11 @@ fn_fetch_file(){ echo -en "downloading ${local_filename}..." fn_sleep_time echo -en "\033[1K" - curlcmd=$(curl --progress-bar --fail -L -o "${local_filedir}/${local_filename}" "${fileurl}") + curlcmd=$(curl --connect-timeout 10 --progress-bar --fail -L -o "${local_filedir}/${local_filename}" "${fileurl}") echo -en "downloading ${local_filename}..." else echo -en "fetching ${fileurl_name} ${local_filename}...\c" - curlcmd=$(curl -s --fail -L -o "${local_filedir}/${local_filename}" "${fileurl}" 2>&1) + curlcmd=$(curl --connect-timeout 10 -s --fail -L -o "${local_filedir}/${local_filename}" "${fileurl}" 2>&1) fi local exitcode=$? diff --git a/lgsm/functions/info_distro.sh b/lgsm/functions/info_distro.sh index 7257483116..53e8f49439 100755 --- a/lgsm/functions/info_distro.sh +++ b/lgsm/functions/info_distro.sh @@ -227,7 +227,7 @@ netlink=$(ethtool "${netint}" 2>/dev/null| grep Speed | awk '{print $2}') # External IP address if [ -z "${extip}" ]; then - extip=$(curl -s https://api.ipify.org 2>/dev/null) + extip=$(curl --connect-timeout 10 -s https://api.ipify.org 2>/dev/null) exitcode=$? # Should ifconfig.co return an error will use last known IP. if [ ${exitcode} -eq 0 ]; then @@ -264,11 +264,11 @@ if [ "$(command -v jq 2>/dev/null)" ]; then if [ "${steammaster}" == "true" ]; then # Will query server IP addresses first. for queryip in "${queryips[@]}"; do - masterserver="$(curl -m 3 -s 'https://api.steampowered.com/ISteamApps/GetServersAtAddress/v0001?addr='${queryip}':'${port}'&format=json' | jq '.response.servers[]|.addr' | wc -l 2>/dev/null)" + masterserver="$(curl --connect-timeout 10 -m 3 -s 'https://api.steampowered.com/ISteamApps/GetServersAtAddress/v0001?addr='${queryip}':'${port}'&format=json' | jq '.response.servers[]|.addr' | wc -l 2>/dev/null)" done # Should that not work it will try the external IP. if [ "${masterserver}" == "0" ]; then - masterserver="$(curl -m 3 -s 'https://api.steampowered.com/ISteamApps/GetServersAtAddress/v0001?addr='${extip}':'${port}'&format=json' | jq '.response.servers[]|.addr' | wc -l 2>/dev/null)" + masterserver="$(curl --connect-timeout 10 -m 3 -s 'https://api.steampowered.com/ISteamApps/GetServersAtAddress/v0001?addr='${extip}':'${port}'&format=json' | jq '.response.servers[]|.addr' | wc -l 2>/dev/null)" fi if [ "${masterserver}" == "0" ]; then displaymasterserver="false" diff --git a/lgsm/functions/mods_list.sh b/lgsm/functions/mods_list.sh index 2e7e35cb2b..f60d9b30f7 100755 --- a/lgsm/functions/mods_list.sh +++ b/lgsm/functions/mods_list.sh @@ -68,21 +68,21 @@ sourcemoddownloadurl="https://www.sourcemod.net/latest.php?os=linux&version=${so sourcemodurl="${sourcemoddownloadurl}" # Steamworks steamworksscrapeurl="https://users.alliedmods.net/~kyles/builds/SteamWorks" -steamworkslatestfile=$(curl -sL ${steamworksscrapeurl} | grep -m 1 linux | cut -d '"' -f 4) +steamworkslatestfile=$(curl --connect-timeout 10 -sL ${steamworksscrapeurl} | grep -m 1 linux | cut -d '"' -f 4) steamworksdownloadurl="${steamworksscrapeurl}/${steamworkslatestfile}" steamworksurl="${steamworksdownloadurl}" # CS:GO Mods -get5lastbuild=$(curl -sL https://ci.splewis.net/job/get5/lastSuccessfulBuild/api/json | jq -r '.artifacts[]') +get5lastbuild=$(curl --connect-timeout 10 -sL https://ci.splewis.net/job/get5/lastSuccessfulBuild/api/json | jq -r '.artifacts[]') get5latestfile=$(echo -e "${get5lastbuild}" | jq -r '.fileName') get5latestfilepath=$(echo -e "${get5lastbuild}" | jq -r '.relativePath') get5url="https://ci.splewis.net/job/get5/lastSuccessfulBuild/artifact/${get5latestfilepath}" -csgopuglatest=$(curl -sL https://api.github.com/repos/splewis/csgo-pug-setup/releases/latest | jq '.assets[]') +csgopuglatest=$(curl --connect-timeout 10 -sL https://api.github.com/repos/splewis/csgo-pug-setup/releases/latest | jq '.assets[]') csgopuglatestfile=$(echo -e "${csgopuglatest}" | jq -r '.name') csgopuglatestlink=$(echo -e "${csgopuglatest}" | jq -r '.browser_download_url') # Oxide -oxiderustlatestlink=$(curl -sL https://api.github.com/repos/OxideMod/Oxide.Rust/releases/latest | jq -r '.assets[]|select(.browser_download_url | contains("linux")) | .browser_download_url') -oxidehurtworldlatestlink=$(curl -sL https://api.github.com/repos/OxideMod/Oxide.Hurtworld/releases/latest | jq -r '.assets[].browser_download_url') -oxidesdtdlatestlink=$(curl -sL https://api.github.com/repos/OxideMod/Oxide.SevenDaysToDie/releases/latest | jq -r '.assets[]|select(.browser_download_url | contains("linux")) | .browser_download_url' ) +oxiderustlatestlink=$(curl --connect-timeout 10 -sL https://api.github.com/repos/OxideMod/Oxide.Rust/releases/latest | jq -r '.assets[]|select(.browser_download_url | contains("linux")) | .browser_download_url') +oxidehurtworldlatestlink=$(curl --connect-timeout 10 -sL https://api.github.com/repos/OxideMod/Oxide.Hurtworld/releases/latest | jq -r '.assets[].browser_download_url') +oxidesdtdlatestlink=$(curl --connect-timeout 10 -sL https://api.github.com/repos/OxideMod/Oxide.SevenDaysToDie/releases/latest | jq -r '.assets[]|select(.browser_download_url | contains("linux")) | .browser_download_url' ) # Define mods information (required) @@ -160,4 +160,4 @@ mod_info_hwoxide=( MOD "hwoxide" "Oxide for Hurtworld" "${oxidehurtworldlatestli mod_info_sdtdoxide=( MOD "sdtdoxide" "Oxide for 7 Days To Die" "${oxidesdtdlatestlink}" "Oxide.SevenDaysToDie.zip" "0" "LowercaseOff" "${systemdir}" "OVERWRITE" "ENGINES" "7 Days To Die;" "NOTGAMES" "https://umod.org/games/7-days-to-die" "Allows for the use of plugins" ) # REQUIRED: Set all mods info into the global array -mods_global_array=( "${mod_info_metamod[@]}" "${mod_info_base_amxx[@]}" "${mod_info_cs_amxx[@]}" "${mod_info_dod_amxx[@]}" "${mod_info_tfc_amxx[@]}" "${mod_info_ns_amxx[@]}" "${mod_info_ts_amxx[@]}" "${mod_info_metamodsource[@]}" "${mod_info_sourcemod[@]}" "${mod_info_steamworks[@]}" "${mod_info_gokz[@]}" "${mod_info_ttt[@]}" "${mod_info_get5[@]}" "${mod_info_pug[@]}" "${mod_info_ulib[@]}" "${mod_info_ulx[@]}" "${mod_info_utime[@]}" "${mod_info_uclip[@]}" "${mod_info_acf[@]}" "${mod_info_acf_missiles[@]}" "${mod_info_acf_sweps[@]}" "${mod_info_advdupe2[@]}" "${mod_info_pac3[@]}" "${mod_info_wiremod[@]}" "${mod_info_wiremodextras[@]}" "${mod_info_darkrp[@]}" "${mod_info_darkrpmodification[@]}" "${mod_info_rustoxide[@]}" "${mod_info_hwoxide[@]}" "${mod_info_sdtdoxide[@]}" ) \ No newline at end of file +mods_global_array=( "${mod_info_metamod[@]}" "${mod_info_base_amxx[@]}" "${mod_info_cs_amxx[@]}" "${mod_info_dod_amxx[@]}" "${mod_info_tfc_amxx[@]}" "${mod_info_ns_amxx[@]}" "${mod_info_ts_amxx[@]}" "${mod_info_metamodsource[@]}" "${mod_info_sourcemod[@]}" "${mod_info_steamworks[@]}" "${mod_info_gokz[@]}" "${mod_info_ttt[@]}" "${mod_info_get5[@]}" "${mod_info_pug[@]}" "${mod_info_ulib[@]}" "${mod_info_ulx[@]}" "${mod_info_utime[@]}" "${mod_info_uclip[@]}" "${mod_info_acf[@]}" "${mod_info_acf_missiles[@]}" "${mod_info_acf_sweps[@]}" "${mod_info_advdupe2[@]}" "${mod_info_pac3[@]}" "${mod_info_wiremod[@]}" "${mod_info_wiremodextras[@]}" "${mod_info_darkrp[@]}" "${mod_info_darkrpmodification[@]}" "${mod_info_rustoxide[@]}" "${mod_info_hwoxide[@]}" "${mod_info_sdtdoxide[@]}" ) diff --git a/linuxgsm.sh b/linuxgsm.sh index 70a280a326..6c63b1244e 100755 --- a/linuxgsm.sh +++ b/linuxgsm.sh @@ -99,7 +99,7 @@ fn_bootstrap_fetch_file(){ # Larger files show a progress bar. echo -en "fetching ${fileurl_name} ${local_filename}...\c" - curlcmd=$(curl -s --fail -L -o "${local_filedir}/${local_filename}" "${fileurl}" 2>&1) + curlcmd=$(curl --connect-timeout 10 -s --fail -L -o "${local_filedir}/${local_filename}" "${fileurl}" 2>&1) local exitcode=$? From b1d866d02371555731461558e10b581958150874 Mon Sep 17 00:00:00 2001 From: Christian Date: Mon, 30 Nov 2020 21:40:14 +0100 Subject: [PATCH 17/24] fix(samp): fix config change after installation (#3119) --- lgsm/functions/core_functions.sh | 5 +++++ lgsm/functions/fix.sh | 4 +++- lgsm/functions/fix_samp.sh | 33 ++++++++++++++++++++++++++++++++ lgsm/functions/install_config.sh | 7 ------- 4 files changed, 41 insertions(+), 8 deletions(-) create mode 100644 lgsm/functions/fix_samp.sh diff --git a/lgsm/functions/core_functions.sh b/lgsm/functions/core_functions.sh index 21ef3cbd1e..2fc75f02fa 100755 --- a/lgsm/functions/core_functions.sh +++ b/lgsm/functions/core_functions.sh @@ -430,6 +430,11 @@ functionfile="${FUNCNAME[0]}" fn_fetch_function } +fix_samp.sh(){ +functionfile="${FUNCNAME[0]}" +fn_fetch_function +} + fix_sdtd.sh(){ functionfile="${FUNCNAME[0]}" fn_fetch_function diff --git a/lgsm/functions/fix.sh b/lgsm/functions/fix.sh index f92709f569..2e2931e414 100755 --- a/lgsm/functions/fix.sh +++ b/lgsm/functions/fix.sh @@ -91,7 +91,7 @@ fi # Fixes that are run on install only. if [ "${commandname}" == "INSTALL" ]; then - if [ "${shortname}" == "av" ]||[ "${shortname}" == "cmw" ]||[ "${shortname}" == "kf" ]||[ "${shortname}" == "kf2" ]||[ "${shortname}" == "onset" ]||[ "${shortname}" == "ro" ]||[ "${shortname}" == "ut2k4" ]||[ "${shortname}" == "ut" ]||[ "${shortname}" == "ut3" ]; then + if [ "${shortname}" == "av" ]||[ "${shortname}" == "cmw" ]||[ "${shortname}" == "kf" ]||[ "${shortname}" == "kf2" ]||[ "${shortname}" == "onset" ]||[ "${shortname}" == "ro" ]||[ "${shortname}" == "samp" ]||[ "${shortname}" == "ut2k4" ]||[ "${shortname}" == "ut" ]||[ "${shortname}" == "ut3" ]; then echo -e "" echo -e "Applying Post-Install Fixes" echo -e "=================================" @@ -105,6 +105,8 @@ if [ "${commandname}" == "INSTALL" ]; then fix_kf2.sh elif [ "${shortname}" == "ro" ]; then fix_ro.sh + elif [ "${shortname}" == "samp" ]; then + fix_samp.sh elif [ "${shortname}" == "ut2k4" ]; then fix_ut2k4.sh elif [ "${shortname}" == "ut" ]; then diff --git a/lgsm/functions/fix_samp.sh b/lgsm/functions/fix_samp.sh new file mode 100644 index 0000000000..b69779019b --- /dev/null +++ b/lgsm/functions/fix_samp.sh @@ -0,0 +1,33 @@ +#!/bin/bash +# LinuxGSM fix_sfc.sh function +# Author: Christian Birk +# Website: https://linuxgsm.com +# Description: Resolves issue that the default rcon password is not changed + +functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +if [ -f "${servercfgfullpath}" ]; then + # check if default password is set "changeme" + currentpass=$(grep -E "^rcon_password" "${servercfgfullpath}" | sed 's/^rcon_password //' ) + defaultpass="changeme" + # check if default password is set + if [ "${currentpass}" == "${defaultpass}" ]; then + fixname="change default rcon password" + fn_fix_msg_start + fn_script_log_info "changing rcon/admin password." + random=$(tr -dc A-Za-z0-9_ < /dev/urandom | head -c 8 | xargs) + rconpass="admin${random}" + sed -i "s/rcon_password changeme/rcon_password ${rconpass}/g" "${servercfgfullpath}" + fn_fix_msg_end + fi + # check if the hostname is the default name + currenthostname=$(grep -E "^hostname" "${servercfgfullpath}" | sed 's/^hostname //') + defaulthostname="SA-MP 0.3 Server" + if [ "${currenthostname}" == "${defaulthostname}" ]; then + fixname="change default hostname" + fn_fix_msg_start + fn_script_log_info "changing default hostname to LinuxGSM" + sed -i "s/hostname ${defaulthostname}/hostname LinuxGSM/g" "${servercfgfullpath}" + fn_fix_msg_end + fi +fi diff --git a/lgsm/functions/install_config.sh b/lgsm/functions/install_config.sh index d512f5b688..bf701ebf15 100755 --- a/lgsm/functions/install_config.sh +++ b/lgsm/functions/install_config.sh @@ -660,13 +660,6 @@ elif [ "${shortname}" == "rust" ]; then fn_fetch_default_config fn_default_config_remote fn_list_config_locations -elif [ "${shortname}" == "samp" ]; then - gamedirname="SanAndreasMultiplayer" - array_configs+=( server.cfg ) - fn_fetch_default_config - fn_default_config_remote - fn_set_config_vars - fn_list_config_locations elif [ "${shortname}" == "sol" ]; then gamedirname="Soldat" array_configs+=( soldat.ini ) From b513e8c8b81f7522bc568cfb425a9fdd23c428f6 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Tue, 1 Dec 2020 20:13:28 +0000 Subject: [PATCH 18/24] codacy changes --- lgsm/functions/mods_core.sh | 94 ++++++++++++++++++------------------- 1 file changed, 47 insertions(+), 47 deletions(-) diff --git a/lgsm/functions/mods_core.sh b/lgsm/functions/mods_core.sh index 5357034308..66cc71d71c 100755 --- a/lgsm/functions/mods_core.sh +++ b/lgsm/functions/mods_core.sh @@ -512,10 +512,10 @@ fn_mod_exist(){ fn_mod_required_fail_exist(){ modreq=$1 - # requires one parameter, the mod + # requires one parameter, the mod fn_script_log_fatal "${modreq}-files.txt is empty: unable to find ${modreq} installed" echo -en "* Unable to find '${modreq}' which is required prior to installing this mod..." - fn_print_fail_eol_nl + fn_print_fail_eol_nl core_exit.sh } @@ -527,32 +527,32 @@ fn_mod_liblist_gam_filenames(){ # default libraries case ${gamename} in - "Counter-Strike 1.6") + "Counter-Strike 1.6") moddll="mp.dll" modso="cs.so" moddylib="cs.dylib" ;; - "Day of Defeat") + "Day of Defeat") moddll="dod.dll" modso="dod.so" moddylib="dod.dylib" ;; - "Team Fortress Classic") + "Team Fortress Classic") moddll="tfc.dll" modso="tfc.so" moddylib="tfc.dylib" ;; - "Natural Selection") + "Natural Selection") moddll="ns.dll" modso="ns_i386.so" moddylib="" ;; - "The Specialists") + "The Specialists") moddll="mp.dll" modso="ts_i386.so" moddylib="" ;; - "Half-Life: Deathmatch") + "Half-Life: Deathmatch") moddll="hl.dll" modso="hl.so" moddylib="hl.dylib" @@ -570,32 +570,32 @@ fn_mod_install_liblist_gam_file(){ logentry="sed replace (dlls\\${moddll}) ${modinstalldir}/liblist.gam" echo -en "modifying gamedll in liblist.gam..." rpldll="s/dlls\\\\${moddll}/addons\/metamod\/dlls\/metamod.dll/g" - sed -i $rpldll ${modinstalldir}/liblist.gam - grep -q "addons/metamod/dlls/metamod.dll" ${modinstalldir}/liblist.gam + sed -i $rpldll "${modinstalldir}/liblist.gam" + grep -q "addons/metamod/dlls/metamod.dll" "${modinstalldir}/liblist.gam" exitcode=$? # if replacement back didn't happen, error out. if [ "${exitcode}" != 0 ]; then - fn_script_log_fatal $logentry + fn_script_log_fatal ${logentry} fn_print_fail_eol_nl else - fn_script_log_pass $logentry - fn_print_ok_eol_nl + fn_script_log_pass ${logentry} + fn_print_ok_eol_nl fi # modify the liblist.gam file to initialize metamod logentry="sed replace (dlls\\${modso}) ${modinstalldir}/liblist.gam" echo -en "modifying gamedll_linux in liblist.gam..." rplso="s/dlls\/${modso}/addons\/metamod\/dlls\/metamod.so/g" - sed -i $rplso ${modinstalldir}/liblist.gam - grep -q "addons/metamod/dlls/metamod.so" ${modinstalldir}/liblist.gam + sed -i $rplso "${modinstalldir}/liblist.gam" + grep -q "addons/metamod/dlls/metamod.so" "${modinstalldir}/liblist.gam" exitcode=$? # if replacement back didn't happen, error out if [ "${exitcode}" != 0 ]; then - fn_script_log_fatal $logentry + fn_script_log_fatal ${logentry} fn_print_fail_eol_nl else - fn_script_log_pass $logentry - fn_print_ok_eol_nl + fn_script_log_pass ${logentry} + fn_print_ok_eol_nl fi # mac os needs to be checked not all mods support mac os @@ -605,14 +605,14 @@ fn_mod_install_liblist_gam_file(){ echo -en "modifying gamedll_osx in liblist.gam..." rpldylib="s/dlls\/${moddylib}/addons\/metamod\/dlls\/metamod.dylib/g" sed -i $rpldylib ${modinstalldir}/liblist.gam - grep -q "addons/metamod/dlls/metamod.dylib" ${modinstalldir}/liblist.gam + grep -q "addons/metamod/dlls/metamod.dylib" "${modinstalldir}/liblist.gam" exitcode=$? # if replacement back didn't happen, error out. if [ "${exitcode}" != 0 ]; then - fn_script_log_fatal $logentry + fn_script_log_fatal ${logentry} fn_print_fail_eol_nl else - fn_script_log_pass $logentry + fn_script_log_pass ${logentry} fn_print_ok_eol_nl fi fi @@ -628,15 +628,15 @@ fn_mod_remove_liblist_gam_file(){ logentry="sed replace (addons/metamod/dlls/metamod.dll) ${modinstalldir}/liblist.gam" echo -en "modifying gamedll in liblist.gam..." rpldll="s/addons\/metamod\/dlls\/metamod.dll/dlls\\\\${moddll}/g" - sed -i $rpldll ${modinstalldir}/liblist.gam - grep -q "${moddll}" ${modinstalldir}/liblist.gam + sed -i $rpldll "${modinstalldir}/liblist.gam" + grep -q "${moddll}" "${modinstalldir}/liblist.gam" exitcode=$? # if replacement back didn't happen, error out. if [ "${exitcode}" != 0 ]; then - fn_script_log_fatal $logentry + fn_script_log_fatal ${logentry} fn_print_fail_eol_nl else - fn_script_log_pass $logentry + fn_script_log_pass ${logentry} fn_print_ok_eol_nl fi @@ -644,15 +644,15 @@ fn_mod_remove_liblist_gam_file(){ logentry="sed replace (addons/metamod/dlls/metamod.so) ${modinstalldir}/liblist.gam" echo -en "modifying gamedll_linux in liblist.gam..." rplso="s/addons\/metamod\/dlls\/metamod.so/dlls\/${modso}/g" - sed -i $rplso ${modinstalldir}/liblist.gam - grep -q "${modso}" ${modinstalldir}/liblist.gam + sed -i $rplso "${modinstalldir}/liblist.gam" + grep -q "${modso}" "${modinstalldir}/liblist.gam" exitcode=$? # if replacement back didn't happen, error out if [ "${exitcode}" != 0 ]; then - fn_script_log_fatal $logentry + fn_script_log_fatal ${logentry} fn_print_fail_eol_nl else - fn_script_log_pass $logentry + fn_script_log_pass ${logentry} fn_print_ok_eol_nl fi @@ -662,15 +662,15 @@ fn_mod_remove_liblist_gam_file(){ logentry="sed replace (addons/metamod/dlls/metamod.dylib) ${modinstalldir}/liblist.gam" echo -en "modifying gamedll_osx in liblist.gam..." rpldylib="s/addons\/metamod\/dlls\/metamod.dylib/dlls\/${moddylib}/g" - sed -i $rpldylib ${modinstalldir}/liblist.gam - grep -q "${moddylib}" ${modinstalldir}/liblist.gam + sed -i $rpldylib "${modinstalldir}/liblist.gam" + grep -q "${moddylib}" "${modinstalldir}/liblist.gam" # if replacement back didn't happen, error out. exitcode=$? if [ "${exitcode}" != 0 ]; then - fn_script_log_fatal $logentry + fn_script_log_fatal ${logentry} fn_print_fail_eol_nl else - fn_script_log_pass $logentry + fn_script_log_pass ${logentry} fn_print_ok_eol_nl fi fi @@ -683,30 +683,30 @@ fn_mod_install_amxmodx_file(){ # since it does exist, is the entry already in plugins.ini logentry="line (linux addons/amxmodx/dlls/amxmodx_mm_i386.so) inserted into ${modinstalldir}/addons/metamod/plugins.ini" echo -en "adding amxmodx_mm_i386.so in plugins.ini..." - grep -q "amxmodx_mm_i386.so" ${modinstalldir}/addons/metamod/plugins.ini + grep -q "amxmodx_mm_i386.so" "${modinstalldir}/addons/metamod/plugins.ini" exitcode=$? if [ "${exitcode}" != 0 ]; then # file exists but the entry does not, let's add it - echo "linux addons/amxmodx/dlls/amxmodx_mm_i386.so" >> ${modinstalldir}/addons/metamod/plugins.ini + echo "linux addons/amxmodx/dlls/amxmodx_mm_i386.so" >> "${modinstalldir}/addons/metamod/plugins.ini" exitcode=$? if [ "${exitcode}" != 0 ]; then - fn_script_log_fatal $logentry + fn_script_log_fatal ${logentry} fn_print_fail_eol_nl else - fn_script_log_pass $logentry + fn_script_log_pass ${logentry} fn_print_ok_eol_nl fi fi - else + else # create new file and add the mod to it - echo "linux addons/amxmodx/dlls/amxmodx_mm_i386.so" > ${modinstalldir}/addons/metamod/plugins.ini + echo "linux addons/amxmodx/dlls/amxmodx_mm_i386.so" > "${modinstalldir}/addons/metamod/plugins.ini" exitcode=$? if [ "${exitcode}" != 0 ]; then - fn_script_log_fatal $logentry + fn_script_log_fatal ${logentry} fn_print_fail_eol_nl core_exit.sh else - fn_script_log_pass $logentry + fn_script_log_pass ${logentry} fn_print_ok_eol_nl fi fi @@ -717,26 +717,26 @@ fn_mod_remove_amxmodx_file(){ # since it does exist, is the entry already in plugins.ini logentry="line (linux addons/amxmodx/dlls/amxmodx_mm_i386.so) removed from ${modinstalldir}/addons/metamod/plugins.ini" echo -en "removing amxmodx_mm_i386.so in plugins.ini..." - grep -q "linux addons/amxmodx/dlls/amxmodx_mm_i386.so" ${modinstalldir}/addons/metamod/plugins.ini + grep -q "linux addons/amxmodx/dlls/amxmodx_mm_i386.so" "${modinstalldir}/addons/metamod/plugins.ini" # iIs it found? If so remove it and clean up exitcode=$? if [ "${exitcode}" == 0 ]; then # delete the line we inserted - sed -i '/linux addons\/amxmodx\/dlls\/amxmodx_mm_i386.so/d' ${modinstalldir}/addons/metamod/plugins.ini + sed -i '/linux addons\/amxmodx\/dlls\/amxmodx_mm_i386.so/d' "${modinstalldir}/addons/metamod/plugins.ini" # remove empty lines - sed -i '/^$/d' ${modinstalldir}/addons/metamod/plugins.ini + sed -i '/^$/d' "${modinstalldir}/addons/metamod/plugins.ini" exitcode=$? if [ "${exitcode}" != 0 ]; then - fn_script_log_fatal $logentry + fn_script_log_fatal ${logentry} fn_print_fail_eol_nl else - fn_script_log_pass $logentry + fn_script_log_pass ${logentry} fn_print_ok_eol_nl fi # if file is empty, remove it. if [ -f "${modinstalldir}/addons/metamod/plugins.ini" ]; then - rm ${modinstalldir}/addons/metamod/plugins.ini + rm "${modinstalldir}/addons/metamod/plugins.ini" fn_script_log_pass "file removed ${modinstalldir}/addons/metamod/plugins.ini because it was empty" fi fi From b19c9a0a4a29eda2db27546519d53b7ade15048e Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Fri, 4 Dec 2020 13:33:45 +0000 Subject: [PATCH 19/24] Revert "feat: improve uniqueness tmux session name (#3081)" This reverts commit 990edfd775ec0b3dcd091b3017d94cdb2b88ce6b. --- lgsm/functions/check_status.sh | 6 +----- lgsm/functions/command_console.sh | 2 +- lgsm/functions/command_start.sh | 6 +++--- lgsm/functions/command_stop.sh | 2 +- lgsm/functions/info_distro.sh | 2 +- 5 files changed, 7 insertions(+), 11 deletions(-) diff --git a/lgsm/functions/check_status.sh b/lgsm/functions/check_status.sh index a473aff73c..178adcf6b5 100755 --- a/lgsm/functions/check_status.sh +++ b/lgsm/functions/check_status.sh @@ -7,8 +7,4 @@ functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" -if [ "$(tmux list-sessions -F "#{session_name}" 2>/dev/null)" == "${sessionname}${port}" ]; then - status=1; -else - status=0; -fi +status=$(tmux list-sessions -F "#{session_name}" 2>/dev/null | grep -Ecx "^${sessionname}") diff --git a/lgsm/functions/command_console.sh b/lgsm/functions/command_console.sh index 36ca7e0921..0de924ea61 100755 --- a/lgsm/functions/command_console.sh +++ b/lgsm/functions/command_console.sh @@ -41,7 +41,7 @@ check_status.sh if [ "${status}" != "0" ]; then fn_print_ok_nl "Accessing console" fn_script_log_pass "Console accessed" - tmux attach-session -t "${sessionname}${port}" + tmux attach-session -t "${sessionname}" fn_print_ok_nl "Closing console" fn_script_log_pass "Console closed" else diff --git a/lgsm/functions/command_start.sh b/lgsm/functions/command_start.sh index 3ebbc8871b..62160e1879 100755 --- a/lgsm/functions/command_start.sh +++ b/lgsm/functions/command_start.sh @@ -36,7 +36,7 @@ fn_start_teamspeak3(){ # Used to allow update to detect JK2MV server version. fn_start_jk2(){ fn_start_tmux - tmux send -t "${sessionname}${port}" version ENTER > /dev/null 2>&1 + tmux send -t "${sessionname}" version ENTER > /dev/null 2>&1 } fn_start_tmux(){ @@ -72,7 +72,7 @@ fn_start_tmux(){ # Create lockfile date '+%s' > "${lockdir}/${selfname}.lock" cd "${executabledir}" || exit - tmux new-session -d -x "${sessionwidth}" -y "${sessionheight}" -s "${sessionname}${port}" "${executable} ${parms}" 2> "${lgsmlogdir}/.${selfname}-tmux-error.tmp" + tmux new-session -d -x "${sessionwidth}" -y "${sessionheight}" -s "${sessionname}" "${executable} ${parms}" 2> "${lgsmlogdir}/.${selfname}-tmux-error.tmp" # Create logfile. touch "${consolelog}" @@ -130,7 +130,7 @@ fn_start_tmux(){ echo -e "" echo -e "Command" echo -e "=================================" - echo -e "tmux new-session -d -s \"${sessionname} ${port}\" \"${executable} ${parms}\"" | tee -a "${lgsmlog}" + echo -e "tmux new-session -d -s \"${sessionname}\" \"${executable} ${parms}\"" | tee -a "${lgsmlog}" echo -e "" echo -e "Error" echo -e "=================================" diff --git a/lgsm/functions/command_stop.sh b/lgsm/functions/command_stop.sh index bde89dd13e..439967fd0e 100644 --- a/lgsm/functions/command_stop.sh +++ b/lgsm/functions/command_stop.sh @@ -15,7 +15,7 @@ fn_stop_graceful_ctrlc(){ fn_print_dots "Graceful: CTRL+c" fn_script_log_info "Graceful: CTRL+c" # Sends quit. - tmux send-keys -t "${sessionname}${port}" C-c > /dev/null 2>&1 + tmux send-keys -t "${sessionname}" C-c > /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 diff --git a/lgsm/functions/info_distro.sh b/lgsm/functions/info_distro.sh index 53e8f49439..11da3cc638 100755 --- a/lgsm/functions/info_distro.sh +++ b/lgsm/functions/info_distro.sh @@ -9,7 +9,7 @@ functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" ### Game Server pid if [ "${status}" == "1" ]; then - gameserverpid=$(tmux list-sessions -F "#{session_name} #{pane_pid}" | grep "^${sessionname}${port}" | awk '{print $NF}') + gameserverpid=$(tmux list-sessions -F "#{session_name} #{pane_pid}" | grep "^${sessionname} " | awk '{print $NF}') fi ### Distro information From 4659f9894170887bb72b2c5ff6a76c14210eefaf Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Fri, 4 Dec 2020 14:01:56 +0000 Subject: [PATCH 20/24] codacy codacy --- lgsm/functions/mods_core.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lgsm/functions/mods_core.sh b/lgsm/functions/mods_core.sh index 66cc71d71c..47dac4b78d 100755 --- a/lgsm/functions/mods_core.sh +++ b/lgsm/functions/mods_core.sh @@ -575,10 +575,10 @@ fn_mod_install_liblist_gam_file(){ exitcode=$? # if replacement back didn't happen, error out. if [ "${exitcode}" != 0 ]; then - fn_script_log_fatal ${logentry} + fn_script_log_fatal "${logentry}" fn_print_fail_eol_nl else - fn_script_log_pass ${logentry} + fn_script_log_pass "${logentry}" fn_print_ok_eol_nl fi @@ -591,10 +591,10 @@ fn_mod_install_liblist_gam_file(){ exitcode=$? # if replacement back didn't happen, error out if [ "${exitcode}" != 0 ]; then - fn_script_log_fatal ${logentry} + fn_script_log_fatal "${logentry}" fn_print_fail_eol_nl else - fn_script_log_pass ${logentry} + fn_script_log_pass "${logentry}" fn_print_ok_eol_nl fi @@ -604,7 +604,7 @@ fn_mod_install_liblist_gam_file(){ logentry="sed replace (dlls\\${moddylib}) ${modinstalldir}/liblist.gam" echo -en "modifying gamedll_osx in liblist.gam..." rpldylib="s/dlls\/${moddylib}/addons\/metamod\/dlls\/metamod.dylib/g" - sed -i $rpldylib ${modinstalldir}/liblist.gam + sed -i $rpldylib "${modinstalldir}/liblist.gam" grep -q "addons/metamod/dlls/metamod.dylib" "${modinstalldir}/liblist.gam" exitcode=$? # if replacement back didn't happen, error out. From b7c8f9e5485fdafa6828ee1340ac469785dc4071 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Fri, 4 Dec 2020 14:21:06 +0000 Subject: [PATCH 21/24] v20.6.0 --- lgsm/functions/core_functions.sh | 2 +- linuxgsm.sh | 2 +- tests/tests_fctrserver.sh | 2 +- tests/tests_jc2server.sh | 2 +- tests/tests_mcserver.sh | 2 +- tests/tests_ts3server.sh | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lgsm/functions/core_functions.sh b/lgsm/functions/core_functions.sh index 2fc75f02fa..5250e7080c 100755 --- a/lgsm/functions/core_functions.sh +++ b/lgsm/functions/core_functions.sh @@ -7,7 +7,7 @@ functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" -modulesversion="v20.5.1" +modulesversion="v20.6.0" # Core diff --git a/linuxgsm.sh b/linuxgsm.sh index 6c63b1244e..3c105f4a54 100755 --- a/linuxgsm.sh +++ b/linuxgsm.sh @@ -20,7 +20,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="v20.5.1" +version="v20.6.0" shortname="core" gameservername="core" commandname="CORE" diff --git a/tests/tests_fctrserver.sh b/tests/tests_fctrserver.sh index afb2f8deda..450c2bcf73 100644 --- a/tests/tests_fctrserver.sh +++ b/tests/tests_fctrserver.sh @@ -20,7 +20,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="v20.5.1" +version="v20.6.0" shortname="fctr" gameservername="fctrserver" commandname="CORE" diff --git a/tests/tests_jc2server.sh b/tests/tests_jc2server.sh index 34cea40e44..15261bf331 100644 --- a/tests/tests_jc2server.sh +++ b/tests/tests_jc2server.sh @@ -20,7 +20,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="v20.5.1" +version="v20.6.0" shortname="jc2" gameservername="jc2server" commandname="CORE" diff --git a/tests/tests_mcserver.sh b/tests/tests_mcserver.sh index f253df31aa..e501772fbf 100644 --- a/tests/tests_mcserver.sh +++ b/tests/tests_mcserver.sh @@ -20,7 +20,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="v20.5.1" +version="v20.6.0" shortname="mc" gameservername="mcserver" commandname="CORE" diff --git a/tests/tests_ts3server.sh b/tests/tests_ts3server.sh index cf5d5ebd12..0243bf5808 100644 --- a/tests/tests_ts3server.sh +++ b/tests/tests_ts3server.sh @@ -20,7 +20,7 @@ if [ -f ".dev-debug" ]; then set -x fi -version="v20.5.1" +version="v20.6.0" shortname="ts3" gameservername="ts3server" commandname="CORE" From 0b38915f03eb6284654bf360fcc3a19ee10310dd Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Fri, 4 Dec 2020 14:28:25 +0000 Subject: [PATCH 22/24] feat:add version and port details to lockfile --- lgsm/functions/command_debug.sh | 2 ++ lgsm/functions/command_monitor.sh | 6 ++++-- lgsm/functions/command_start.sh | 2 ++ tests/tests_fctrserver.sh | 2 ++ tests/tests_jc2server.sh | 2 ++ tests/tests_mcserver.sh | 2 ++ tests/tests_ts3server.sh | 2 ++ 7 files changed, 16 insertions(+), 2 deletions(-) diff --git a/lgsm/functions/command_debug.sh b/lgsm/functions/command_debug.sh index 059cf539a5..fe2e8a38e0 100755 --- a/lgsm/functions/command_debug.sh +++ b/lgsm/functions/command_debug.sh @@ -95,6 +95,8 @@ fn_print_ok_nl "Starting debug" # Create lockfile. date '+%s' > "${lockdir}/${selfname}.lock" +echo "${version}" >> "${lockdir}/${selfname}.lock" +echo "${port}" >> "${lockdir}/${selfname}.lock" fn_script_log_info "Lockfile generated" fn_script_log_info "${lockdir}/${selfname}.lock" diff --git a/lgsm/functions/command_monitor.sh b/lgsm/functions/command_monitor.sh index 80d3f43f01..28cc70fabb 100755 --- a/lgsm/functions/command_monitor.sh +++ b/lgsm/functions/command_monitor.sh @@ -25,8 +25,10 @@ fn_monitor_check_lockfile(){ fi # Fix if lockfile is not unix time or contains letters - if [ -f "${lockdir}/${selfname}.lock" ]&&[[ "$(cat "${lockdir}/${selfname}.lock")" =~ [A-Za-z] ]]; then - date '+%s' > "${lockdir}/${selfname}.lock" + if [ -f "${lockdir}/${selfname}.lock" ]&&[[ "$(head -n 1 "${lockdir}/${selfname}.lock")" =~ [A-Za-z] ]]; then + date '+%s' > "${lockdir}/${selfname}.lock" + echo "${version}" >> "${lockdir}/${selfname}.lock" + echo "${port}" >> "${lockdir}/${selfname}.lock" fi } diff --git a/lgsm/functions/command_start.sh b/lgsm/functions/command_start.sh index 62160e1879..897cc90aac 100755 --- a/lgsm/functions/command_start.sh +++ b/lgsm/functions/command_start.sh @@ -71,6 +71,8 @@ fn_start_tmux(){ # Create lockfile date '+%s' > "${lockdir}/${selfname}.lock" + echo "${version}" >> "${lockdir}/${selfname}.lock" + echo "${port}" >> "${lockdir}/${selfname}.lock" cd "${executabledir}" || exit tmux new-session -d -x "${sessionwidth}" -y "${sessionheight}" -s "${sessionname}" "${executable} ${parms}" 2> "${lgsmlogdir}/.${selfname}-tmux-error.tmp" diff --git a/tests/tests_fctrserver.sh b/tests/tests_fctrserver.sh index 450c2bcf73..2c08922c23 100644 --- a/tests/tests_fctrserver.sh +++ b/tests/tests_fctrserver.sh @@ -938,6 +938,8 @@ requiredstatus="OFFLINE" fn_setstatus fn_print_info_nl "creating lockfile." date '+%s' > "${lockdir}/${selfname}.lock" +echo "${version}" >> "${lockdir}/${selfname}.lock" +echo "${port}" >> "${lockdir}/${selfname}.lock" ( exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" BASH_XTRACEFD="5" diff --git a/tests/tests_jc2server.sh b/tests/tests_jc2server.sh index 15261bf331..39746de577 100644 --- a/tests/tests_jc2server.sh +++ b/tests/tests_jc2server.sh @@ -1097,6 +1097,8 @@ requiredstatus="OFFLINE" fn_setstatus fn_print_info_nl "creating lockfile." date '+%s' > "${lockdir}/${selfname}.lock" +echo "${version}" >> "${lockdir}/${selfname}.lock" +echo "${port}" >> "${lockdir}/${selfname}.lock" ( exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" BASH_XTRACEFD="5" diff --git a/tests/tests_mcserver.sh b/tests/tests_mcserver.sh index e501772fbf..221e118563 100644 --- a/tests/tests_mcserver.sh +++ b/tests/tests_mcserver.sh @@ -970,6 +970,8 @@ requiredstatus="OFFLINE" fn_setstatus fn_print_info_nl "creating lockfile." date '+%s' > "${lockdir}/${selfname}.lock" +echo "${version}" >> "${lockdir}/${selfname}.lock" +echo "${port}" >> "${lockdir}/${selfname}.lock" ( exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" BASH_XTRACEFD="5" diff --git a/tests/tests_ts3server.sh b/tests/tests_ts3server.sh index 0243bf5808..be72227f17 100644 --- a/tests/tests_ts3server.sh +++ b/tests/tests_ts3server.sh @@ -937,6 +937,8 @@ requiredstatus="OFFLINE" fn_setstatus fn_print_info_nl "creating lockfile." date '+%s' > "${lockdir}/${selfname}.lock" +echo "${version}" >> "${lockdir}/${selfname}.lock" +echo "${port}" >> "${lockdir}/${selfname}.lock" ( exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" BASH_XTRACEFD="5" From e405e84b0f6e90a11b3ee8e00a2559a13177d401 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Fri, 4 Dec 2020 20:56:14 +0000 Subject: [PATCH 23/24] updated PVR _default.cfg --- .../config-lgsm/pvrserver/_default.cfg | 45 +++++++++++-------- 1 file changed, 27 insertions(+), 18 deletions(-) diff --git a/lgsm/config-default/config-lgsm/pvrserver/_default.cfg b/lgsm/config-default/config-lgsm/pvrserver/_default.cfg index f51bd9ea41..0177b2a95c 100644 --- a/lgsm/config-default/config-lgsm/pvrserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/pvrserver/_default.cfg @@ -1,27 +1,33 @@ ################################## ######## 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 +# DO NOT EDIT, ANY CHANGES 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 #### +#### Game Server Settings #### -## Server Start Settings | https://docs.linuxgsm.com/configuration/start-parameters +## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters ip="0.0.0.0" port="7777" # Maps: bridge, datacenter, sand defaultmap="datacenter" -## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters fn_parms(){ parms="${defaultmap} -log -MultiHome=${ip} -Port=${port}" } #### LinuxGSM Settings #### +## LinuxGSM Stats +# Send useful stats to LinuxGSM developers. +# https://docs.linuxgsm.com/configuration/linuxgsm-stats +# (on|off) +stats="off" + ## Notification Alerts # (on|off) @@ -30,8 +36,6 @@ displayip="" # More info | https://docs.linuxgsm.com/alerts#more-info postalert="off" -postdays="7" -posttarget="https://hastebin.com" # Discord Alerts | https://docs.linuxgsm.com/alerts/discord discordalert="off" @@ -63,6 +67,7 @@ channeltag="" # Pushover Alerts | https://docs.linuxgsm.com/alerts/pushover pushoveralert="off" pushovertoken="accesstoken" +pushoveruserkey="userkey" # Rocket.Chat Alerts | https://docs.linuxgsm.com/alerts/rocket.chat rocketchatalert="off" @@ -74,8 +79,8 @@ slackalert="off" slackwebhook="webhook" # Telegram Alerts | https://docs.linuxgsm.com/alerts/telegram -# You can add a custom cURL string eg proxy (useful in Russia) or else in "curlcustomstring". -# like a "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help", if you not need +# You can add a custom cURL string eg proxy (useful in Russia) in "curlcustomstring". +# For example "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help". telegramalert="off" telegramtoken="accesstoken" telegramchatid="" @@ -97,12 +102,12 @@ logdays="7" # Query delay time querydelay="1" -#### LinuxGSM Advanced Settings #### - -# ANSI Colors +## ANSI Colors | https://docs.linuxgsm.com/features/ansi-colors ansi="on" -# Message Display Time +#### Advanced Settings #### + +## Message Display Time | https://docs.linuxgsm.com/features/message-display-time sleeptime="0.5" ## SteamCMD Settings | https://docs.linuxgsm.com/steamcmd @@ -130,14 +135,18 @@ stopmode="2" ## Query mode # 1: session only -# 2: gamedig + gsquery +# 2: gamedig (gsquery fallback) # 3: gamedig # 4: gsquery # 5: tcp querymode="1" querytype="" -## LinuxGSM Server Details +## Console type +consoleverbose="no" +consoleinteract="no" + +## Game Server Details # Do not edit gamename="Pavlov VR" engine="unreal4" @@ -146,7 +155,7 @@ glibc="2.17" #### Directories #### # Edit with care -## Server Specific Directories +## Game Server Directories systemdir="${serverfiles}/Pavlov" executabledir="${systemdir}/Binaries/Linux" executable="./PavlovServer" From 6bf2351a77953dd7b9730419e2a7128cb514da35 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Fri, 4 Dec 2020 21:24:01 +0000 Subject: [PATCH 24/24] code tidy codacy --- lgsm/functions/core_dl.sh | 4 ++-- lgsm/functions/install_config.sh | 2 +- lgsm/functions/mods_core.sh | 14 +++++++------- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/lgsm/functions/core_dl.sh b/lgsm/functions/core_dl.sh index ea20002a8f..03ff543832 100755 --- a/lgsm/functions/core_dl.sh +++ b/lgsm/functions/core_dl.sh @@ -377,7 +377,7 @@ fn_fetch_file_github(){ fn_fetch_config(){ github_file_url_dir="${1}" github_file_url_name="${2}" - # If master branch will currently running LinuxGSM version to prevent "version mixing". This is ignored if a fork. + # If master branch will currently running LinuxGSM version to prevent "version mixing". This is ignored if a fork. if [ "${githubbranch}" == "master" ]&&[ "${githubuser}" == "GameServerManager" ]&&[ "${commandname}" != "UPDATE-LGSM" ]; then remote_fileurl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${version}/${github_file_url_dir}/${github_file_url_name}" remote_fileurl_backup="https://bitbucket.org/${githubuser}/${githubrepo}/raw/${version}/${github_file_url_dir}/${github_file_url_name}" @@ -425,7 +425,7 @@ fn_fetch_function(){ fn_update_function(){ github_file_url_dir="lgsm/functions" github_file_url_name="${functionfile}" - # If master branch will currently running LinuxGSM version to prevent "version mixing". This is ignored if a fork. + # If master branch will currently running LinuxGSM version to prevent "version mixing". This is ignored if a fork. if [ "${githubbranch}" == "master" ]&&[ "${githubuser}" == "GameServerManager" ]&&[ "${commandname}" != "UPDATE-LGSM" ]; then remote_fileurl="https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${version}/${github_file_url_dir}/${github_file_url_name}" remote_fileurl_backup="https://bitbucket.org/${githubuser}/${githubrepo}/raw/${version}/${github_file_url_dir}/${github_file_url_name}" diff --git a/lgsm/functions/install_config.sh b/lgsm/functions/install_config.sh index bf701ebf15..fbff9dbbbf 100755 --- a/lgsm/functions/install_config.sh +++ b/lgsm/functions/install_config.sh @@ -576,7 +576,7 @@ elif [ "${shortname}" == "mumble" ]; then fn_fetch_default_config fn_default_config_remote fn_list_config_locations -elif [ "${gamename}" == "Pavlov VR" ]; then +elif [ "${shortname}" == "pvr" ]; then gamedirname="PavlovVR" fn_check_cfgdir array_configs+=( Game.ini ) diff --git a/lgsm/functions/mods_core.sh b/lgsm/functions/mods_core.sh index 47dac4b78d..010ff109e0 100755 --- a/lgsm/functions/mods_core.sh +++ b/lgsm/functions/mods_core.sh @@ -609,7 +609,7 @@ fn_mod_install_liblist_gam_file(){ exitcode=$? # if replacement back didn't happen, error out. if [ "${exitcode}" != 0 ]; then - fn_script_log_fatal ${logentry} + fn_script_log_fatal "${logentry}" fn_print_fail_eol_nl else fn_script_log_pass ${logentry} @@ -633,7 +633,7 @@ fn_mod_remove_liblist_gam_file(){ exitcode=$? # if replacement back didn't happen, error out. if [ "${exitcode}" != 0 ]; then - fn_script_log_fatal ${logentry} + fn_script_log_fatal "${logentry}" fn_print_fail_eol_nl else fn_script_log_pass ${logentry} @@ -649,7 +649,7 @@ fn_mod_remove_liblist_gam_file(){ exitcode=$? # if replacement back didn't happen, error out if [ "${exitcode}" != 0 ]; then - fn_script_log_fatal ${logentry} + fn_script_log_fatal "${logentry}" fn_print_fail_eol_nl else fn_script_log_pass ${logentry} @@ -667,7 +667,7 @@ fn_mod_remove_liblist_gam_file(){ # if replacement back didn't happen, error out. exitcode=$? if [ "${exitcode}" != 0 ]; then - fn_script_log_fatal ${logentry} + fn_script_log_fatal "${logentry}" fn_print_fail_eol_nl else fn_script_log_pass ${logentry} @@ -690,7 +690,7 @@ fn_mod_install_amxmodx_file(){ echo "linux addons/amxmodx/dlls/amxmodx_mm_i386.so" >> "${modinstalldir}/addons/metamod/plugins.ini" exitcode=$? if [ "${exitcode}" != 0 ]; then - fn_script_log_fatal ${logentry} + fn_script_log_fatal "${logentry}" fn_print_fail_eol_nl else fn_script_log_pass ${logentry} @@ -702,7 +702,7 @@ fn_mod_install_amxmodx_file(){ echo "linux addons/amxmodx/dlls/amxmodx_mm_i386.so" > "${modinstalldir}/addons/metamod/plugins.ini" exitcode=$? if [ "${exitcode}" != 0 ]; then - fn_script_log_fatal ${logentry} + fn_script_log_fatal "${logentry}" fn_print_fail_eol_nl core_exit.sh else @@ -727,7 +727,7 @@ fn_mod_remove_amxmodx_file(){ sed -i '/^$/d' "${modinstalldir}/addons/metamod/plugins.ini" exitcode=$? if [ "${exitcode}" != 0 ]; then - fn_script_log_fatal ${logentry} + fn_script_log_fatal "${logentry}" fn_print_fail_eol_nl else fn_script_log_pass ${logentry}