Browse Source

Merge branch 'develop' into patch-2

pull/3114/head
Daniel Gibbs 5 years ago
parent
commit
ea4fb50e26
  1. 2
      .github/no-response.yml
  2. 9
      .github/workflows/git-sync.yml
  3. 2
      README.md
  4. 86
      lgsm/config-default/config-lgsm/pvrserver/_default.cfg
  5. 181
      lgsm/config-default/config-lgsm/ss3server/_default.cfg
  6. 3
      lgsm/data/serverlist.csv
  7. 23
      lgsm/functions/check_deps.sh
  8. 6
      lgsm/functions/check_status.sh
  9. 3
      lgsm/functions/check_system_requirements.sh
  10. 2
      lgsm/functions/command_console.sh
  11. 23
      lgsm/functions/command_mods_install.sh
  12. 31
      lgsm/functions/command_mods_remove.sh
  13. 6
      lgsm/functions/command_start.sh
  14. 2
      lgsm/functions/command_stop.sh
  15. 13
      lgsm/functions/command_wipe.sh
  16. 14
      lgsm/functions/core_dl.sh
  17. 12
      lgsm/functions/core_functions.sh
  18. 2
      lgsm/functions/core_getopt.sh
  19. 4
      lgsm/functions/fix.sh
  20. 10
      lgsm/functions/fix_ges.sh
  21. 2
      lgsm/functions/fix_squad.sh
  22. 23
      lgsm/functions/fix_ss3.sh
  23. 4
      lgsm/functions/fix_steamcmd.sh
  24. 96
      lgsm/functions/info_config.sh
  25. 2
      lgsm/functions/info_distro.sh
  26. 27
      lgsm/functions/info_messages.sh
  27. 30
      lgsm/functions/info_parms.sh
  28. 21
      lgsm/functions/install_config.sh
  29. 6
      lgsm/functions/install_server_files.sh
  30. 248
      lgsm/functions/mods_core.sh
  31. 87
      lgsm/functions/mods_list.sh
  32. 2
      lgsm/functions/query_gamedig.sh
  33. 1
      lgsm/functions/update_factorio.sh
  34. 1
      lgsm/functions/update_minecraft.sh
  35. 1
      lgsm/functions/update_minecraft_bedrock.sh
  36. 1
      lgsm/functions/update_mta.sh
  37. 1
      lgsm/functions/update_mumble.sh
  38. 1
      lgsm/functions/update_steamcmd.sh
  39. 1
      lgsm/functions/update_ts3.sh
  40. 5
      linuxgsm.sh
  41. 5
      tests/tests_fctrserver.sh
  42. 5
      tests/tests_jc2server.sh
  43. 5
      tests/tests_mcserver.sh
  44. 5
      tests/tests_ts3server.sh

2
.github/no-response.yml

@ -3,7 +3,7 @@
# Number of days of inactivity before an Issue is closed for lack of response
daysUntilClose: 60
# Label requiring a response
responseRequiredLabel: "status: waiting response"
responseRequiredLabel: "waiting response"
# Comment to post when closing an Issue for lack of response. Set to `false` to disable
closeComment: >
This issue has been automatically closed because there has been no response

9
.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: "[email protected]:GameServerManagers/linuxgsm.git"
destination_branch: "refs/heads/*"
ssh_private_key: ${{ secrets.BITBUCKET_SECRET }}

2
README.md

File diff suppressed because one or more lines are too long

86
lgsm/config-default/config-lgsm/gesserver/_default.cfg → lgsm/config-default/config-lgsm/pvrserver/_default.cfg

@ -1,34 +1,27 @@
##################################
######## 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.
# 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
#### Game Server Settings ####
#### Server Settings ####
## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters
## Server Start Settings | https://docs.linuxgsm.com/configuration/start-parameters
ip="0.0.0.0"
port="27015"
clientport="27005"
sourcetvport="27020"
defaultmap="ge_archives"
maxplayers="16"
port="7777"
## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters
# Maps: bridge, datacenter, sand
defaultmap="datacenter"
## Server Start Command | 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}"
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)
@ -37,6 +30,8 @@ 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"
@ -68,7 +63,6 @@ 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"
@ -80,8 +74,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) in "curlcustomstring".
# For example "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help".
# 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=""
@ -103,22 +97,22 @@ logdays="7"
# Query delay time
querydelay="1"
## ANSI Colors | https://docs.linuxgsm.com/features/ansi-colors
ansi="on"
#### LinuxGSM Advanced Settings ####
#### Advanced Settings ####
# ANSI Colors
ansi="on"
## Message Display Time | https://docs.linuxgsm.com/features/message-display-time
# Message Display Time
sleeptime="0.5"
## SteamCMD Settings | https://docs.linuxgsm.com/steamcmd
# Server appid
appid="310" # Source 2007 SDK
appid="622970"
# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch
branch=""
betapassword=""
# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server
steammaster="true"
steammaster="false"
## Stop Mode | https://docs.linuxgsm.com/features/stop-mode
# 1: tmux kill
@ -132,37 +126,33 @@ steammaster="true"
# 9: GoldSrc
# 10: Avorion
# 11: end
stopmode="3"
stopmode="2"
## Query mode
# 1: session only
# 2: gamedig (gsquery fallback)
# 2: gamedig + gsquery
# 3: gamedig
# 4: gsquery
# 5: tcp
querymode="2"
querytype="protocol-valve"
## Console type
consoleverbose="yes"
consoleinteract="yes"
querymode="1"
querytype=""
## Game Server Details
## LinuxGSM Server Details
# Do not edit
gamename="GoldenEye: Source"
engine="source"
glibc="2.15"
gamename="Pavlov VR"
engine="unreal4"
glibc="2.17"
#### Directories ####
# Edit with care
## Game Server Directories
systemdir="${serverfiles}/gesource"
executabledir="${serverfiles}"
executable="./srcds_run"
servercfgdir="${systemdir}/cfg"
servercfg="${selfname}.cfg"
servercfgdefault="server.cfg"
## 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
@ -170,7 +160,7 @@ backupdir="${lgsmdir}/backup"
## Logging Directories
logdir="${rootdir}/log"
gamelogdir="${systemdir}/logs"
gamelogdir="${systemdir}/Saved/Logs"
lgsmlogdir="${logdir}/script"
consolelogdir="${logdir}/console"
lgsmlog="${lgsmlogdir}/${selfname}-script.log"

181
lgsm/config-default/config-lgsm/ss3server/_default.cfg

@ -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 protected]"
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="[email protected]"
mailgunemail="[email protected]"
# 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"

3
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
@ -70,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
@ -88,7 +88,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

Can't render this file because it has a wrong number of fields in line 66.

23
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 )
@ -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
@ -395,6 +398,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 )
@ -425,9 +431,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 )
@ -492,6 +495,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 )
@ -534,9 +540,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

6
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

3
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.

2
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

23
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."

31
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"

6
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 "================================="

2
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

13
lgsm/functions/command_wipe.sh

@ -146,6 +146,19 @@ fn_wipe_server_files(){
fn_sleep_time
fn_script_log_pass "No player death to remove"
fi
# Wipe player states files
if [ -n "$(find "${serveridentitydir}" -type f -name "player.states.*.db")" ]; then
echo -en "removing player states player.states.*.db file(s)..."
fn_sleep_time
fn_script_log_info "Removing player states: ${serveridentitydir}/player.states.*.db"
find "${serveridentitydir:?}" -type f -name "player.states.*.db" -delete | tee -a "${lgsmlog}"
fn_wipe_exit_code
fn_sleep_time
else
echo -e "no player states to remove"
fn_sleep_time
fn_script_log_pass "No player states to remove"
fi
# Wipe blueprints only if full-wipe command was used.
if [ "${fullwipe}" == "1" ]; then
if [ -n "$(find "${serveridentitydir}" -type f -name "player.blueprints.*.db")" ]; then

14
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

12
lgsm/functions/core_functions.sh

@ -7,7 +7,7 @@
functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
modulesversion="v20.5.0"
modulesversion="v20.5.1"
# Core
@ -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

2
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

4
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

10
lgsm/functions/fix_ges.sh

@ -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

2
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"

23
lgsm/functions/fix_ss3.sh

@ -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

4
lgsm/functions/fix_steamcmd.sh

@ -79,9 +79,13 @@ elif [ "${shortname}" == "cmw" ]; then
fn_fix_steamclient_so "32" "${executabledir}/lib"
elif [ "${shortname}" == "cs" ]; then
fn_fix_steamclient_so "32" "${serverfiles}"
elif [ "${shortname}" == "ins" ]; then
fn_fix_steamclient_so "32" "${serverfiles}/bin"
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

96
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:]')
@ -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,122 @@ fn_info_config_soldat(){
fi
}
# Assetto Corsa
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
# 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,9 +1641,10 @@ 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
fn_info_config_mordhau
elif [ "${shortname}" == "pvr" ];then
fn_info_config_pavlovvr
fi

2
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

27
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" "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"
@ -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 ""
@ -1446,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
@ -1530,8 +1529,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
@ -1560,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

30
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"}
@ -201,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))
@ -233,19 +233,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,38 +251,30 @@ 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}" == "pvr" ]; then
fn_info_parms_pavlovvr
elif [ "${shortname}" == "qw" ]; then
fn_info_parms_quakeworld
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 +285,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

21
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 )
@ -583,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 )
@ -667,13 +667,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 )

6
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
@ -50,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
@ -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

248
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

87
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,14 +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" )
@ -92,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_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[@]}" )

2
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

1
lgsm/functions/update_factorio.sh

@ -112,6 +112,7 @@ fn_update_factorio_compare(){
command_start.sh
fn_firstcommand_reset
fi
unset exitbypass
date +%s > "${lockdir}/lastupdate.lock"
alert="update"
alert.sh

1
lgsm/functions/update_minecraft.sh

@ -120,6 +120,7 @@ fn_update_minecraft_compare(){
command_start.sh
fn_firstcommand_reset
fi
unset exitbypass
date +%s > "${lockdir}/lastupdate.lock"
alert="update"
alert.sh

1
lgsm/functions/update_minecraft_bedrock.sh

@ -139,6 +139,7 @@ fn_update_minecraft_compare(){
command_start.sh
fn_firstcommand_reset
fi
unset exitbypass
date +%s > "${lockdir}/lastupdate.lock"
alert="update"
alert.sh

1
lgsm/functions/update_mta.sh

@ -168,6 +168,7 @@ fn_update_mta_compare(){
command_start.sh
fn_firstcommand_reset
fi
unset exitbypass
date +%s > "${lockdir}/lastupdate.lock"
alert="update"
alert.sh

1
lgsm/functions/update_mumble.sh

@ -104,6 +104,7 @@ fn_update_mumble_compare(){
command_start.sh
fn_firstcommand_reset
fi
unset exitbypass
date +%s > "${lockdir}/lastupdate.lock"
alert="update"
alert.sh

1
lgsm/functions/update_steamcmd.sh

@ -113,6 +113,7 @@ fn_update_steamcmd_compare(){
command_start.sh
fn_firstcommand_reset
fi
unset exitbypass
date +%s > "${lockdir}/lastupdate.lock"
alert="update"
alert.sh

1
lgsm/functions/update_ts3.sh

@ -166,6 +166,7 @@ fn_update_ts3_compare(){
command_start.sh
fn_firstcommand_reset
fi
unset exitbypass
date +%s > "${lockdir}/lastupdate.lock"
alert="update"
alert.sh

5
linuxgsm.sh

@ -20,7 +20,7 @@ if [ -f ".dev-debug" ]; then
set -x
fi
version="v20.5.0"
version="v20.5.1"
shortname="core"
gameservername="core"
commandname="CORE"
@ -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

5
tests/tests_fctrserver.sh

@ -20,7 +20,7 @@ if [ -f ".dev-debug" ]; then
set -x
fi
version="v20.5.0"
version="v20.5.1"
shortname="fctr"
gameservername="fctrserver"
commandname="CORE"
@ -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

5
tests/tests_jc2server.sh

@ -20,7 +20,7 @@ if [ -f ".dev-debug" ]; then
set -x
fi
version="v20.5.0"
version="v20.5.1"
shortname="jc2"
gameservername="jc2server"
commandname="CORE"
@ -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

5
tests/tests_mcserver.sh

@ -20,7 +20,7 @@ if [ -f ".dev-debug" ]; then
set -x
fi
version="v20.5.0"
version="v20.5.1"
shortname="mc"
gameservername="mcserver"
commandname="CORE"
@ -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

5
tests/tests_ts3server.sh

@ -20,7 +20,7 @@ if [ -f ".dev-debug" ]; then
set -x
fi
version="v20.5.0"
version="v20.5.1"
shortname="ts3"
gameservername="ts3server"
commandname="CORE"
@ -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

Loading…
Cancel
Save