Browse Source

Merge branch 'release/v25.1.0'

hotfix/v25.1.1
Daniel Gibbs 2 months ago
parent
commit
65e9eb520d
  1. 2
      .github/workflows/serverlist-validate-game-icons.sh
  2. 4
      .github/workflows/serverlist-validate.sh
  3. 2
      LICENSE.md
  4. 2
      README.md
  5. 4
      lgsm/config-default/config-lgsm/bfvserver/_default.cfg
  6. 5
      lgsm/config-default/config-lgsm/cs2server/_default.cfg
  7. 2
      lgsm/config-default/config-lgsm/jc2server/_default.cfg
  8. 2
      lgsm/config-default/config-lgsm/sof2server/_default.cfg
  9. 0
      lgsm/config-default/config-lgsm/squad44server/_default.cfg
  10. 4
      lgsm/config-default/config-lgsm/stserver/_default.cfg
  11. 2
      lgsm/config-default/config-lgsm/ts3server/_default.cfg
  12. 2
      lgsm/data/debian-10.csv
  13. 2
      lgsm/data/debian-11.csv
  14. 2
      lgsm/data/debian-12.csv
  15. 2
      lgsm/data/debian-13.csv
  16. 2
      lgsm/data/debian-9.csv
  17. 268
      lgsm/data/serverlist.csv
  18. 2
      lgsm/data/ubuntu-16.04.csv
  19. 2
      lgsm/data/ubuntu-18.04.csv
  20. 2
      lgsm/data/ubuntu-20.04.csv
  21. 2
      lgsm/data/ubuntu-22.04.csv
  22. 2
      lgsm/data/ubuntu-23.04.csv
  23. 2
      lgsm/data/ubuntu-23.10.csv
  24. 2
      lgsm/data/ubuntu-24.04.csv
  25. 104
      lgsm/modules/alert_discord.sh
  26. 2
      lgsm/modules/alert_email.sh
  27. 36
      lgsm/modules/alert_gotify.sh
  28. 34
      lgsm/modules/alert_ifttt.sh
  29. 35
      lgsm/modules/alert_pushbullet.sh
  30. 24
      lgsm/modules/alert_pushover.sh
  31. 34
      lgsm/modules/alert_rocketchat.sh
  32. 38
      lgsm/modules/alert_slack.sh
  33. 37
      lgsm/modules/alert_telegram.sh
  34. 2
      lgsm/modules/check.sh
  35. 20
      lgsm/modules/check_deps.sh
  36. 2
      lgsm/modules/check_gamedig.sh
  37. 2
      lgsm/modules/check_logs.sh
  38. 4
      lgsm/modules/check_permissions.sh
  39. 13
      lgsm/modules/check_system_requirements.sh
  40. 14
      lgsm/modules/command_backup.sh
  41. 11
      lgsm/modules/command_console.sh
  42. 13
      lgsm/modules/command_debug.sh
  43. 2
      lgsm/modules/command_details.sh
  44. 2
      lgsm/modules/command_dev_clear_modules.sh
  45. 2
      lgsm/modules/command_dev_debug.sh
  46. 8
      lgsm/modules/command_dev_detect_deps.sh
  47. 14
      lgsm/modules/command_dev_detect_glibc.sh
  48. 10
      lgsm/modules/command_dev_detect_ldd.sh
  49. 7
      lgsm/modules/command_dev_parse_distro_details.sh
  50. 7
      lgsm/modules/command_dev_parse_game_details.sh
  51. 91
      lgsm/modules/command_dev_query_raw.sh
  52. 110
      lgsm/modules/command_dev_ui.sh
  53. 110
      lgsm/modules/command_fastdl.sh
  54. 2
      lgsm/modules/command_install_resources_mta.sh
  55. 2
      lgsm/modules/command_mods_install.sh
  56. 12
      lgsm/modules/command_mods_remove.sh
  57. 2
      lgsm/modules/command_mods_update.sh
  58. 79
      lgsm/modules/command_monitor.sh
  59. 12
      lgsm/modules/command_postdetails.sh
  60. 2
      lgsm/modules/command_send.sh
  61. 2
      lgsm/modules/command_skeleton.sh
  62. 2
      lgsm/modules/command_sponsor.sh
  63. 6
      lgsm/modules/command_start.sh
  64. 10
      lgsm/modules/command_stop.sh
  65. 2
      lgsm/modules/command_ts3_server_pass.sh
  66. 77
      lgsm/modules/command_update_linuxgsm.sh
  67. 6
      lgsm/modules/command_validate.sh
  68. 31
      lgsm/modules/command_wipe.sh
  69. 2
      lgsm/modules/compress_unreal2_maps.sh
  70. 2
      lgsm/modules/compress_ut99_maps.sh
  71. 49
      lgsm/modules/core_dl.sh
  72. 10
      lgsm/modules/core_exit.sh
  73. 17
      lgsm/modules/core_getopt.sh
  74. 6
      lgsm/modules/core_legacy.sh
  75. 306
      lgsm/modules/core_messages.sh
  76. 12
      lgsm/modules/core_modules.sh
  77. 139
      lgsm/modules/core_steamcmd.sh
  78. 5
      lgsm/modules/fix.sh
  79. 2
      lgsm/modules/fix_bt.sh
  80. 2
      lgsm/modules/fix_rust.sh
  81. 9
      lgsm/modules/info_distro.sh
  82. 12
      lgsm/modules/info_game.sh
  83. 80
      lgsm/modules/info_messages.sh
  84. 15
      lgsm/modules/install_complete.sh
  85. 260
      lgsm/modules/install_config.sh
  86. 2
      lgsm/modules/install_dst_token.sh
  87. 4
      lgsm/modules/install_eula.sh
  88. 20
      lgsm/modules/install_gslt.sh
  89. 98
      lgsm/modules/install_logs.sh
  90. 12
      lgsm/modules/install_server_dir.sh
  91. 7
      lgsm/modules/install_server_files.sh
  92. 2
      lgsm/modules/install_squad_license.sh
  93. 4
      lgsm/modules/install_stats.sh
  94. 4
      lgsm/modules/install_ts3db.sh
  95. 2
      lgsm/modules/install_ut2k4_key.sh
  96. 62
      lgsm/modules/mods_core.sh
  97. 4
      lgsm/modules/query_gamedig.sh
  98. 14
      lgsm/modules/query_gsquery.py
  99. 6
      lgsm/modules/update_jk2.sh
  100. 6
      lgsm/modules/update_mc.sh

2
.github/workflows/serverlist-validate-game-icons.sh

@ -1,6 +1,6 @@
#!/bin/bash
cd "lgsm/data" || exit
cd "${datadir}" || exit
echo ""
echo "Checking that all the game servers listed in serverlist.csv have a shortname-icon.png file"

4
.github/workflows/serverlist-validate.sh

@ -2,7 +2,7 @@
echo "Checking that all the game servers are listed in all csv files"
echo "this check will ensure serverlist.csv has the same number of lines (-2 lines) as the other csv files"
# count the number of lines in the serverlist.csv
cd "lgsm/data" || exit
cd "${datadir}" || exit
serverlistcount="$(tail -n +2 serverlist.csv | wc -l)"
echo "serverlistcount: $serverlistcount"
# get list of all csv files starting with ubunutu debian centos
@ -19,7 +19,7 @@ for csv in $csvlist; do
fi
done
# Compare all game servers listed in serverlist.csv to $shortname-icon.png files in lgsm/data/gameicons
# Compare all game servers listed in serverlist.csv to $shortname-icon.png files in ${datadir}/gameicons
# if the game server is listed in serverlist.csv then it will have a $shortname-icon.png file
# loop though shortname in serverlist.csv

2
LICENSE.md

@ -1,6 +1,6 @@
# The MIT License (MIT)
Copyright (c) 2012-2024 Daniel Gibbs
Copyright (c) 2012-2025 Daniel Gibbs
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal

2
README.md

@ -4,7 +4,7 @@
<a href="https://bitbucket.org/GameServerManagers/linuxgsm"><img alt="GitHub Workflow Status" src="https://img.shields.io/github/actions/workflow/status/GameServerManagers/LinuxGSM/git-sync.yml?color=0052CC&logo=bitbucket&style=flat-square"></a>
<a href="https://linuxgsm.com/discord"><img alt="Discord" src="https://img.shields.io/discord/127498813903601664?color=5865F2&label=%20&logo=discord&logoColor=ffffff&style=flat-square"></a>
<a href="https://developer.valvesoftware.com/wiki/SteamCMD"><img src="https://img.shields.io/badge/SteamCMD-000000?style=flat-square&amp;logo=Steam&amp;logoColor=white" alt="SteamCMD"></a>
<a href="https://github.com/GameServerManagers/LinuxGSM/blob/main/LICENSE"><img src="https://img.shields.io/github/license/gameservermanagers/LinuxGSM?style=flat-square" alt="MIT License"></a>
<a href="https://github.com/GameServerManagers/LinuxGSM/blob/master/LICENSE.md"><img src="https://img.shields.io/github/license/gameservermanagers/LinuxGSM?style=flat-square" alt="MIT License"></a>
</p>
[LinuxGSM](https://linuxgsm.com) is the command-line tool for quick, simple deployment and management of Linux dedicated game servers.

4
lgsm/config-default/config-lgsm/bfvserver/_default.cfg

@ -123,8 +123,8 @@ stopmode="3"
# 3: gamedig
# 4: gsquery
# 5: tcp
querymode="1"
querytype=""
querymode="3"
querytype="protocol-gamespy2"
## Console type
consoleverbose="yes"

5
lgsm/config-default/config-lgsm/cs2server/_default.cfg

@ -15,6 +15,11 @@ port="27015"
maxplayers="16"
wsapikey=""
## Game Server Login Token (GSLT): Required
# GSLT is required for running a public server.
# More info: https://docs.linuxgsm.com/steamcmd/gslt
gslt=""
## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters
startparameters="-dedicated -ip ${ip} -port ${port} -maxplayers ${maxplayers} -authkey ${wsapikey} +exec ${selfname}.cfg"

2
lgsm/config-default/config-lgsm/jc2server/_default.cfg

@ -134,7 +134,7 @@ stopmode="2"
# 4: gsquery
# 5: tcp
querymode="2"
querytype="jc2m"
querytype="jc2mp"
## Console type
consoleverbose="yes"

2
lgsm/config-default/config-lgsm/sof2server/_default.cfg

@ -142,7 +142,7 @@ glibc="2.1"
# Edit with care
## Game Server Directories
systemdir="${serverfiles}/main"
systemdir="${serverfiles}/base"
executabledir="${serverfiles}"
executable="./sof2ded"
servercfgdir="${systemdir}"

0
lgsm/config-default/config-lgsm/psserver/_default.cfg → lgsm/config-default/config-lgsm/squad44server/_default.cfg

4
lgsm/config-default/config-lgsm/stserver/_default.cfg

@ -9,11 +9,11 @@
#### Game Server Settings ####
## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters
worldname="moon_save"
worldsave="moon_save"
worldtype="Moon"
## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters
startparameters="-LOADLATEST ${worldname} ${worldtype}"
startparameters="-LOAD ${worldsave} ${worldtype}"
#### LinuxGSM Settings ####

2
lgsm/config-default/config-lgsm/ts3server/_default.cfg

@ -133,7 +133,7 @@ consoleinteract="no"
## Game Server Details
# Do not edit
gamename="TeamSpeak 3"
servername="TeamSpeak 3 Server"
servername="LinuxGSM"
engine="null"
glibc="2.17"

2
lgsm/data/debian-10.csv

@ -81,7 +81,7 @@ opfor
pc
pc2
pmc,openjdk-11-jre
ps,libgconf-2-4
squad44
pvkii
pvr,libc++1
pw

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

2
lgsm/data/debian-11.csv

@ -82,7 +82,7 @@ opfor
pc
pc2
pmc,openjdk-17-jre
ps,libgconf-2-4
squad44
pvkii
pvr,libc++1
pw

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

2
lgsm/data/debian-12.csv

@ -82,7 +82,7 @@ opfor
pc
pc2
pmc,openjdk-17-jre
ps,libgconf-2-4
squad44
pvkii
pvr,libc++1
pw

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

2
lgsm/data/debian-13.csv

@ -82,7 +82,7 @@ opfor
pc
pc2
pmc,openjdk-22-jre
ps,libgconf-2-4
squad44
pvkii
pvr,libc++1
pw

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

2
lgsm/data/debian-9.csv

@ -82,7 +82,7 @@ opfor
pc
pc2
pmc,openjdk-8-jre
ps,libgconf-2-4
squad44
pvkii
pvr,libc++1
pw

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

268
lgsm/data/serverlist.csv

@ -1,138 +1,138 @@
shortname,gameservername,gamename,os
ac,acserver,Assetto Corsa,ubuntu-22.04
ahl,ahlserver,Action Half-Life,ubuntu-22.04
ahl2,ahl2server,Action: Source,ubuntu-20.04
ark,arkserver,ARK: Survival Evolved,ubuntu-22.04
arma3,arma3server,ARMA 3,ubuntu-22.04
armar,armarserver,Arma Reforger,ubuntu-20.04
ats,atsserver,American Truck Simulator,ubuntu-22.04
av,avserver,Avorion,ubuntu-22.04
bb,bbserver,BrainBread,ubuntu-22.04
bb2,bb2server,BrainBread 2,ubuntu-22.04
bd,bdserver,Base Defense,ubuntu-22.04
bf1942,bf1942server,Battlefield 1942,ubuntu-22.04
bfv,bfvserver,Battlefield: Vietnam,ubuntu-22.04
bmdm,bmdmserver,Black Mesa: Deathmatch,ubuntu-22.04
bo,boserver,Ballistic Overkill,ubuntu-22.04
bs,bsserver,Blade Symphony,ubuntu-22.04
bt,btserver,Barotrauma,ubuntu-22.04
ac,acserver,Assetto Corsa,ubuntu-24.04
ahl,ahlserver,Action Half-Life,ubuntu-24.04
ahl2,ahl2server,Action: Source,ubuntu-24.04
ark,arkserver,ARK: Survival Evolved,ubuntu-24.04
arma3,arma3server,ARMA 3,ubuntu-24.04
armar,armarserver,Arma Reforger,ubuntu-24.04
ats,atsserver,American Truck Simulator,ubuntu-24.04
av,avserver,Avorion,ubuntu-24.04
bb,bbserver,BrainBread,ubuntu-24.04
bb2,bb2server,BrainBread 2,ubuntu-24.04
bd,bdserver,Base Defense,ubuntu-24.04
bf1942,bf1942server,Battlefield 1942,ubuntu-24.04
bfv,bfvserver,Battlefield: Vietnam,ubuntu-24.04
bmdm,bmdmserver,Black Mesa: Deathmatch,ubuntu-24.04
bo,boserver,Ballistic Overkill,ubuntu-24.04
bs,bsserver,Blade Symphony,ubuntu-24.04
bt,btserver,Barotrauma,ubuntu-24.04
btl,btlserver,BATTALION: Legacy,ubuntu-20.04
cc,ccserver,Codename CURE,ubuntu-22.04
ck,ckserver,Core Keeper,ubuntu-22.04
cmw,cmwserver,Chivalry: Medieval Warfare,ubuntu-22.04
cod,codserver,Call of Duty,ubuntu-22.04
cod2,cod2server,Call of Duty 2,ubuntu-22.04
cod4,cod4server,Call of Duty 4,ubuntu-22.04
coduo,coduoserver,Call of Duty: United Offensive,ubuntu-22.04
codwaw,codwawserver,Call of Duty: World at War,ubuntu-22.04
col,colserver,Colony Survival,ubuntu-22.04
cs,csserver,Counter-Strike 1.6,ubuntu-22.04
cs2,cs2server,Counter-Strike 2,ubuntu-22.04
cscz,csczserver,Counter-Strike: Condition Zero,ubuntu-22.04
csgo,csgoserver,Counter-Strike: Global Offensive,ubuntu-22.04
css,cssserver,Counter-Strike: Source,ubuntu-22.04
ct,ctserver,Craftopia,ubuntu-22.04
dab,dabserver,Double Action: Boogaloo,ubuntu-22.04
dayz,dayzserver,DayZ,ubuntu-22.04
dmc,dmcserver,Deathmatch Classic,ubuntu-22.04
dod,dodserver,Day of Defeat,ubuntu-22.04
dodr,dodrserver,Day of Dragons,ubuntu-22.04
dods,dodsserver,Day of Defeat: Source,ubuntu-22.04
doi,doiserver,Day of Infamy,ubuntu-22.04
dst,dstserver,Don't Starve Together,ubuntu-22.04
dys,dysserver,Dystopia,ubuntu-22.04
eco,ecoserver,Eco,ubuntu-22.04
em,emserver,Empires Mod,ubuntu-22.04
etl,etlserver,ET: Legacy,ubuntu-22.04
ets2,ets2server,Euro Truck Simulator 2,ubuntu-22.04
fctr,fctrserver,Factorio,ubuntu-22.04
fof,fofserver,Fistful of Frags,ubuntu-22.04
gmod,gmodserver,Garrys Mod,ubuntu-22.04
hcu,hcuserver,HYPERCHARGE: Unboxed,ubuntu-22.04
hl2dm,hl2dmserver,Half-Life 2: Deathmatch,ubuntu-22.04
hldm,hldmserver,Half-Life: Deathmatch,ubuntu-22.04
hldms,hldmsserver,Half-Life Deathmatch: Source,ubuntu-22.04
hw,hwserver,Hurtworld,ubuntu-22.04
hz,hzserver,Humanitz,ubuntu-22.04
ins,insserver,Insurgency,ubuntu-22.04
inss,inssserver,Insurgency: Sandstorm,ubuntu-22.04
ios,iosserver,IOSoccer,ubuntu-22.04
jc2,jc2server,Just Cause 2,ubuntu-22.04
jc3,jc3server,Just Cause 3,ubuntu-22.04
jk2,jk2server,Jedi Knight II: Jedi Outcast,ubuntu-22.04
kf,kfserver,Killing Floor,ubuntu-22.04
kf2,kf2server,Killing Floor 2,ubuntu-22.04
l4d,l4dserver,Left 4 Dead,ubuntu-22.04
l4d2,l4d2server,Left 4 Dead 2,ubuntu-22.04
mc,mcserver,Minecraft,ubuntu-22.04
mcb,mcbserver,Minecraft Bedrock,ubuntu-22.04
mh,mhserver,MORDHAU,ubuntu-22.04
mohaa,mohaaserver,Medal of Honor: Allied Assault,ubuntu-22.04
mta,mtaserver,Multi Theft Auto,ubuntu-22.04
nd,ndserver,Nuclear Dawn,ubuntu-22.04
nec,necserver,Necesse,ubuntu-22.04
nmrih,nmrihserver,No More Room in Hell,ubuntu-22.04
ns,nsserver,Natural Selection,ubuntu-22.04
ns2,ns2server,Natural Selection 2,ubuntu-22.04
ns2c,ns2cserver,NS2: Combat,ubuntu-22.04
ohd,ohdserver,Operation: Harsh Doorstop,ubuntu-22.04
cc,ccserver,Codename CURE,ubuntu-24.04
ck,ckserver,Core Keeper,ubuntu-24.04
cmw,cmwserver,Chivalry: Medieval Warfare,ubuntu-24.04
cod,codserver,Call of Duty,ubuntu-24.04
cod2,cod2server,Call of Duty 2,ubuntu-24.04
cod4,cod4server,Call of Duty 4,ubuntu-24.04
coduo,coduoserver,Call of Duty: United Offensive,ubuntu-24.04
codwaw,codwawserver,Call of Duty: World at War,ubuntu-24.04
col,colserver,Colony Survival,ubuntu-24.04
cs,csserver,Counter-Strike 1.6,ubuntu-24.04
cs2,cs2server,Counter-Strike 2,ubuntu-24.04
cscz,csczserver,Counter-Strike: Condition Zero,ubuntu-24.04
csgo,csgoserver,Counter-Strike: Global Offensive,ubuntu-24.04
css,cssserver,Counter-Strike: Source,ubuntu-24.04
ct,ctserver,Craftopia,ubuntu-24.04
dab,dabserver,Double Action: Boogaloo,ubuntu-24.04
dayz,dayzserver,DayZ,ubuntu-24.04
dmc,dmcserver,Deathmatch Classic,ubuntu-24.04
dod,dodserver,Day of Defeat,ubuntu-24.04
dodr,dodrserver,Day of Dragons,ubuntu-24.04
dods,dodsserver,Day of Defeat: Source,ubuntu-24.04
doi,doiserver,Day of Infamy,ubuntu-24.04
dst,dstserver,Don't Starve Together,ubuntu-24.04
dys,dysserver,Dystopia,ubuntu-24.04
eco,ecoserver,Eco,ubuntu-24.04
em,emserver,Empires Mod,ubuntu-24.04
etl,etlserver,ET: Legacy,ubuntu-24.04
ets2,ets2server,Euro Truck Simulator 2,ubuntu-24.04
fctr,fctrserver,Factorio,ubuntu-24.04
fof,fofserver,Fistful of Frags,ubuntu-24.04
gmod,gmodserver,Garrys Mod,ubuntu-24.04
hcu,hcuserver,HYPERCHARGE: Unboxed,ubuntu-24.04
hl2dm,hl2dmserver,Half-Life 2: Deathmatch,ubuntu-24.04
hldm,hldmserver,Half-Life: Deathmatch,ubuntu-24.04
hldms,hldmsserver,Half-Life Deathmatch: Source,ubuntu-24.04
hw,hwserver,Hurtworld,ubuntu-24.04
hz,hzserver,Humanitz,ubuntu-24.04
ins,insserver,Insurgency,ubuntu-24.04
inss,inssserver,Insurgency: Sandstorm,ubuntu-24.04
ios,iosserver,IOSoccer,ubuntu-24.04
jc2,jc2server,Just Cause 2,ubuntu-24.04
jc3,jc3server,Just Cause 3,ubuntu-24.04
jk2,jk2server,Jedi Knight II: Jedi Outcast,ubuntu-24.04
kf,kfserver,Killing Floor,ubuntu-24.04
kf2,kf2server,Killing Floor 2,ubuntu-24.04
l4d,l4dserver,Left 4 Dead,ubuntu-24.04
l4d2,l4d2server,Left 4 Dead 2,ubuntu-24.04
mc,mcserver,Minecraft,ubuntu-24.04
mcb,mcbserver,Minecraft Bedrock,ubuntu-24.04
mh,mhserver,MORDHAU,ubuntu-24.04
mohaa,mohaaserver,Medal of Honor: Allied Assault,ubuntu-24.04
mta,mtaserver,Multi Theft Auto,ubuntu-24.04
nd,ndserver,Nuclear Dawn,ubuntu-24.04
nec,necserver,Necesse,ubuntu-24.04
nmrih,nmrihserver,No More Room in Hell,ubuntu-24.04
ns,nsserver,Natural Selection,ubuntu-24.04
ns2,ns2server,Natural Selection 2,ubuntu-24.04
ns2c,ns2cserver,NS2: Combat,ubuntu-24.04
ohd,ohdserver,Operation: Harsh Doorstop,ubuntu-24.04
onset,onsetserver,Onset,ubuntu-20.04
opfor,opforserver,Opposing Force,ubuntu-22.04
pc,pcserver,Project Cars,ubuntu-22.04
pc2,pc2server,Project Cars 2,ubuntu-22.04
pmc,pmcserver,PaperMC,ubuntu-22.04
ps,psserver,Post Scriptum,ubuntu-22.04
pvkii,pvkiiserver,Pirates Vikings & Knights II,ubuntu-22.04
pvr,pvrserver,Pavlov VR,ubuntu-22.04
pw,pwserver,Palworld,ubuntu-22.04
pz,pzserver,Project Zomboid,ubuntu-22.04
q2,q2server,Quake 2,ubuntu-22.04
q3,q3server,Quake 3: Arena,ubuntu-22.04
q4,q4server,Quake 4,ubuntu-22.04
ql,qlserver,Quake Live,ubuntu-22.04
qw,qwserver,Quake World,ubuntu-22.04
ricochet,ricochetserver,Ricochet,ubuntu-22.04
ro,roserver,Red Orchestra: Ostfront 41-45,ubuntu-22.04
rtcw,rtcwserver,Return to Castle Wolfenstein,ubuntu-22.04
rust,rustserver,Rust,ubuntu-22.04
rw,rwserver,Rising World,ubuntu-22.04
samp,sampserver,San Andreas Multiplayer,ubuntu-22.04
sb,sbserver,Starbound,ubuntu-22.04
sbots,sbotsserver,StickyBots,ubuntu-22.04
scpsl,scpslserver,SCP: Secret Laboratory,ubuntu-22.04
scpslsm,scpslsmserver,SCP: Secret Laboratory ServerMod,ubuntu-22.04
sdtd,sdtdserver,7 Days to Die,ubuntu-22.04
sf,sfserver,Satisfactory,ubuntu-22.04
sfc,sfcserver,SourceForts Classic,ubuntu-22.04
sm,smserver,Soulmask,ubuntu-22.04
sof2,sof2server,Soldier Of Fortune 2: Gold Edition,ubuntu-22.04
sol,solserver,Soldat,ubuntu-22.04
squad,squadserver,Squad,ubuntu-22.04
st,stserver,Stationeers,ubuntu-22.04
stn,stnserver,Survive the Nights,ubuntu-22.04
opfor,opforserver,Opposing Force,ubuntu-24.04
pc,pcserver,Project Cars,ubuntu-24.04
pc2,pc2server,Project Cars 2,ubuntu-24.04
pmc,pmcserver,PaperMC,ubuntu-24.04
pvkii,pvkiiserver,Pirates Vikings & Knights II,ubuntu-24.04
pvr,pvrserver,Pavlov VR,ubuntu-24.04
pw,pwserver,Palworld,ubuntu-24.04
pz,pzserver,Project Zomboid,ubuntu-24.04
q2,q2server,Quake 2,ubuntu-24.04
q3,q3server,Quake 3: Arena,ubuntu-24.04
q4,q4server,Quake 4,ubuntu-24.04
ql,qlserver,Quake Live,ubuntu-24.04
qw,qwserver,Quake World,ubuntu-24.04
ricochet,ricochetserver,Ricochet,ubuntu-24.04
ro,roserver,Red Orchestra: Ostfront 41-45,ubuntu-24.04
rtcw,rtcwserver,Return to Castle Wolfenstein,ubuntu-24.04
rust,rustserver,Rust,ubuntu-24.04
rw,rwserver,Rising World,ubuntu-24.04
samp,sampserver,San Andreas Multiplayer,ubuntu-24.04
sb,sbserver,Starbound,ubuntu-24.04
sbots,sbotsserver,StickyBots,ubuntu-24.04
scpsl,scpslserver,SCP: Secret Laboratory,ubuntu-24.04
scpslsm,scpslsmserver,SCP: Secret Laboratory ServerMod,ubuntu-24.04
sdtd,sdtdserver,7 Days to Die,ubuntu-24.04
sf,sfserver,Satisfactory,ubuntu-24.04
sfc,sfcserver,SourceForts Classic,ubuntu-24.04
sm,smserver,Soulmask,ubuntu-24.04
sof2,sof2server,Soldier Of Fortune 2: Gold Edition,ubuntu-24.04
sol,solserver,Soldat,ubuntu-24.04
squad,squadserver,Squad,ubuntu-24.04
squad44,squad44server,Squad 44,ubuntu-24.04
st,stserver,Stationeers,ubuntu-24.04
stn,stnserver,Survive the Nights,ubuntu-24.04
sven,svenserver,Sven Co-op,ubuntu-20.04
terraria,terrariaserver,Terraria,ubuntu-22.04
tf,tfserver,The Front,ubuntu-22.04
tf2,tf2server,Team Fortress 2,ubuntu-22.04
tfc,tfcserver,Team Fortress Classic,ubuntu-22.04
ti,tiserver,The Isle,ubuntu-22.04
ts,tsserver,The Specialists,ubuntu-22.04
ts3,ts3server,Teamspeak 3,ubuntu-22.04
tu,tuserver,Tower Unite,ubuntu-22.04
tw,twserver,Teeworlds,ubuntu-22.04
unt,untserver,Unturned,ubuntu-22.04
ut,utserver,Unreal Tournament,ubuntu-22.04
ut2k4,ut2k4server,Unreal Tournament 2004,ubuntu-22.04
ut3,ut3server,Unreal Tournament 3,ubuntu-22.04
ut99,ut99server,Unreal Tournament 99,ubuntu-22.04
vh,vhserver,Valheim,ubuntu-22.04
vints,vintsserver,Vintage Story,ubuntu-22.04
vpmc,vpmcserver,Velocity Proxy MC,ubuntu-22.04
vs,vsserver,Vampire Slayer,ubuntu-22.04
wet,wetserver,Wolfenstein: Enemy Territory,ubuntu-22.04
wf,wfserver,Warfork,ubuntu-22.04
wmc,wmcserver,WaterfallMC,ubuntu-22.04
wurm,wurmserver,Wurm Unlimited,ubuntu-22.04
xnt,xntserver,Xonotic,ubuntu-22.04
zmr,zmrserver,Zombie Master: Reborn,ubuntu-22.04
zps,zpsserver,Zombie Panic! Source,ubuntu-22.04
terraria,terrariaserver,Terraria,ubuntu-24.04
tf,tfserver,The Front,ubuntu-24.04
tf2,tf2server,Team Fortress 2,ubuntu-24.04
tfc,tfcserver,Team Fortress Classic,ubuntu-24.04
ti,tiserver,The Isle,ubuntu-24.04
ts,tsserver,The Specialists,ubuntu-24.04
ts3,ts3server,Teamspeak 3,ubuntu-24.04
tu,tuserver,Tower Unite,ubuntu-24.04
tw,twserver,Teeworlds,ubuntu-24.04
unt,untserver,Unturned,ubuntu-24.04
ut,utserver,Unreal Tournament,ubuntu-24.04
ut2k4,ut2k4server,Unreal Tournament 2004,ubuntu-24.04
ut3,ut3server,Unreal Tournament 3,ubuntu-24.04
ut99,ut99server,Unreal Tournament 99,ubuntu-24.04
vh,vhserver,Valheim,ubuntu-24.04
vints,vintsserver,Vintage Story,ubuntu-24.04
vpmc,vpmcserver,Velocity Proxy MC,ubuntu-24.04
vs,vsserver,Vampire Slayer,ubuntu-24.04
wet,wetserver,Wolfenstein: Enemy Territory,ubuntu-24.04
wf,wfserver,Warfork,ubuntu-24.04
wmc,wmcserver,WaterfallMC,ubuntu-24.04
wurm,wurmserver,Wurm Unlimited,ubuntu-24.04
xnt,xntserver,Xonotic,ubuntu-24.04
zmr,zmrserver,Zombie Master: Reborn,ubuntu-24.04
zps,zpsserver,Zombie Panic! Source,ubuntu-24.04

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

2
lgsm/data/ubuntu-16.04.csv

@ -83,7 +83,7 @@ opfor
pc
pc2
pmc,openjdk-8-jre
ps,libgconf-2-4
squad44
pvkii
pvr,libc++1
pz,openjdk-8-jre,rng-tools

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

2
lgsm/data/ubuntu-18.04.csv

@ -83,7 +83,7 @@ opfor
pc
pc2
pmc,openjdk-11-jre
ps,libgconf-2-4
squad44
pvkii
pvr,libc++1
pz,openjdk-11-jre,rng-tools

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

2
lgsm/data/ubuntu-20.04.csv

@ -82,7 +82,7 @@ opfor
pc
pc2
pmc,openjdk-21-jre
ps,libgconf-2-4
squad44
pvkii
pvr,libc++1
pw

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

2
lgsm/data/ubuntu-22.04.csv

@ -82,7 +82,7 @@ opfor
pc
pc2
pmc,openjdk-21-jre
ps,libgconf-2-4
squad44
pvkii
pvr,libc++1
pw

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

2
lgsm/data/ubuntu-23.04.csv

@ -82,7 +82,7 @@ opfor
pc
pc2
pmc,openjdk-21-jre
ps,libgconf-2-4
squad44
pvkii
pvr,libc++1
pw

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

2
lgsm/data/ubuntu-23.10.csv

@ -82,7 +82,7 @@ opfor
pc
pc2
pmc,openjdk-21-jre
ps,libgconf-2-4
squad44
pvkii
pvr,libc++1
pw

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

2
lgsm/data/ubuntu-24.04.csv

@ -82,7 +82,7 @@ opfor
pc
pc2
pmc,openjdk-21-jre
ps,libgconf-2-4
ps
pvkii
pvr,libc++1
pw

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

104
lgsm/modules/alert_discord.sh

@ -7,7 +7,7 @@
moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
jsoninfo=$(
json=$(
cat << EOF
{
"username": "LinuxGSM",
@ -29,103 +29,45 @@ jsoninfo=$(
"url": "${alerticon}"
},
"fields": [
{
"name": "Server Name",
"value": "${servername}"
},
{
"name": "Information",
"value": "${alertmessage}"
},
{
"name": "Game",
"value": "${gamename}",
"inline": true
"name": "Server Name",
"value": "${servername}"
},
{
"name": "Server IP",
"value": "\`${alertip}:${port}\`",
"inline": true
"name": "Information",
"value": "${alertmessage}"
},
{
"name": "Hostname",
"value": "${HOSTNAME}",
"name": "Game",
"value": "${gamename}",
"inline": true
},
{
"name": "More info",
"value": "${alerturl}",
"inline": true
},
{
"name": "Server Time",
"value": "$(date)",
"inline": true
}
],
"footer": {
"icon_url": "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/lgsm/data/alert_discord_logo.jpg",
"text": "Sent by LinuxGSM ${version}"
}
}
]
}
EOF
)
jsonnoinfo=$(
cat << EOF
{
"username": "LinuxGSM",
"avatar_url": "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/lgsm/data/alert_discord_logo.jpg",
"file": "content",
"embeds": [
{
"author": {
"name": "LinuxGSM Alert",
"url": "",
"icon_url": "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/lgsm/data/alert_discord_logo.jpg"
},
"title": "${alerttitle}",
"url": "",
"description": "",
"color": "${alertcolourdec}",
"type": "content",
"thumbnail": {
"url": "${alerticon}"
},
"fields": [
{
"name": "Server Name",
"value": "${servername}"
},
{
"name": "Information",
"value": "${alertmessage}"
},
if [ -n "${querytype}" ]; then
json+=$(
cat << EOF
,
{
"name": "Game",
"value": "${gamename}",
"inline": true
},
{
"name": "Server IP",
"value": "\`${alertip}:${port}\`",
"inline": true
},
{
"name": "Hostname",
"value": "${HOSTNAME}",
"inline": true
},
{
"name": "Server Time",
"value": "$(date)",
"name": "Is my Game Server Online?",
"value": "https://ismygameserver.online/${imgsoquerytype}/${alertip}:${queryport}",
"inline": true
}
EOF
)
fi
json+=$(
cat << EOF
],
"footer": {
"icon_url": "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/lgsm/data/alert_discord_logo.jpg",
"icon_url": "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/lgsm/data/alert_discord_logo.jpg",
"text": "Sent by LinuxGSM ${version}"
}
}
@ -136,12 +78,6 @@ EOF
fn_print_dots "Sending Discord alert"
if [ -z "${alerturl}" ]; then
json="${jsonnoinfo}"
else
json="${jsoninfo}"
fi
discordsend=$(curl --connect-timeout 3 -sSL -H "Content-Type: application/json" -X POST -d "$(echo -n "${json}" | jq -c .)" "${discordwebhook}")
if [ -n "${discordsend}" ]; then

2
lgsm/modules/alert_email.sh

@ -15,7 +15,7 @@ else
mail -s "${alerttitle}" "${email}" < "${alertlog}"
fi
exitcode=$?
if [ "${exitcode}" == "0" ]; then
if [ "${exitcode}" -ne 0 ]; then
fn_print_ok_nl "Sending Email alert: ${email}"
fn_script_log_pass "Sending Email alert: ${email}"
else

36
lgsm/modules/alert_gotify.sh

@ -5,34 +5,40 @@
# Website: https://linuxgsm.com
# Description: Sends Gotify alert.
module_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
jsoninfo=$(
json=$(
cat << EOF
{
"title": "${alerttitle}",
"message": "Server Name\n${servername}\n\nInformation\n${alertmessage}\n\nGame\n${gamename}\n\nServer IP\n${alertip}:${port}\n\nHostname\n${HOSTNAME}\n\nMore info\n${alerturl}\n\nServer Time\n$(date)",
"priority": 5
}
"message": "Server Name\n${servername}\n\nInformation\n${alertmessage}\n\nGame\n${gamename}\n\nServer IP\n${alertip}:${port}\n\nHostname\n${HOSTNAME}\n\n
EOF
)
jsonnoinfo=$(
if [ -n "${querytype}" ]; then
json+=$(
cat << EOF
Is my Game Server Online?\nhttps://ismygameserver.online/${imgsoquerytype}/${alertip}:${queryport}\n\n
EOF
)
fi
if [ -n "${alerturl}" ]; then
json+=$(
cat << EOF
More info\n${alerturl}\n\n
EOF
)
fi
json+=$(
cat << EOF
{
"title": "${alerttitle}",
"message": "Server Name\n${servername}\n\nInformation\n${alertmessage}\n\nGame\n${gamename}\n\nServer IP\n${alertip}:${port}\n\nHostname\n${HOSTNAME}\n\nServer Time\n$(date)",
Server Time\n$(date)",
"priority": 5
}
EOF
)
if [ -z "${alerturl}" ]; then
json="${jsonnoinfo}"
else
json="${jsoninfo}"
fi
fn_print_dots "Sending Gotify alert"
gotifysend=$(curl --connect-timeout 3 -sSL "${gotifywebhook}/message"?token="${gotifytoken}" -H "Content-Type: application/json" -X POST -d "$(echo -n "${json}" | jq -c .)")

34
lgsm/modules/alert_ifttt.sh

@ -7,32 +7,38 @@
moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
jsoninfo=$(
json=$(
cat << EOF
{
"value1": "${selfname}",
"value2": "${alerttitle}",
"value3": "Server Name\n${servername}\n\nInformation\n${alertmessage}\n\nGame\n${gamename}\n\nServer IP\n${alertip}:${port}\n\nHostname\n${HOSTNAME}\n\nMore info\n${alerturl}\n\nServer Time\n$(date)"
}
"value3": "Server Name\n${servername}\n\nInformation\n${alertmessage}\n\nGame\n${gamename}\n\nServer IP\n${alertip}:${port}\n\nHostname\n${HOSTNAME}\n\n
EOF
)
jsonnoinfo=$(
if [ -n "${querytype}" ]; then
json+=$(
cat << EOF
Is my Game Server Online?\nhttps://ismygameserver.online/${imgsoquerytype}/${alertip}:${queryport}\n\n
EOF
)
fi
if [ -n "${alerturl}" ]; then
json+=$(
cat << EOF
More info\n${alerturl}\n\n
EOF
)
fi
json+=$(
cat << EOF
{
"value1": "${selfname}",
"value2": "${alerttitle}",
"value3": "Server Name\n${servername}\n\nInformation\n${alertmessage}\n\nGame\n${gamename}\n\nServer IP\n${alertip}:${port}\n\nHostname\n${HOSTNAME}\n\nServer Time\n$(date)"
Server Time\n$(date)"
}
EOF
)
if [ -z "${alerturl}" ]; then
json="${jsonnoinfo}"
else
json="${jsoninfo}"
fi
fn_print_dots "Sending IFTTT alert"
iftttsend=$(curl --connect-timeout 3 -sSL -H "Content-Type: application/json" -X POST -d "$(echo -n "${json}" | jq -c .)" "https://maker.ifttt.com/trigger/${iftttevent}/with/key/${ifttttoken}" | grep "Bad Request")

35
lgsm/modules/alert_pushbullet.sh

@ -7,34 +7,39 @@
moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
jsoninfo=$(
json=$(
cat << EOF
{
"channel_tag": "${channeltag}",
"type": "note",
"title": "${alerttitle}",
"body": "Server Name\n${servername}\n\nInformation\n${alertmessage}\n\nGame\n${gamename}\n\nServer IP\n${alertip}:${port}\n\nHostname\n${HOSTNAME}\n\nMore info\n${alerturl}\n\nServer Time\n$(date)"
}
"body": "Server Name\n${servername}\n\nInformation\n${alertmessage}\n\nGame\n${gamename}\n\nServer IP\n${alertip}:${port}\n\nHostname\n${HOSTNAME}\n\n
EOF
)
jsonnoinfo=$(
if [ -n "${querytype}" ]; then
json+=$(
cat << EOF
Is my Game Server Online?\nhttps://ismygameserver.online/${imgsoquerytype}/${alertip}:${queryport}\n\n
EOF
)
fi
if [ -n "${alerturl}" ]; then
json+=$(
cat << EOF
More info\n${alerturl}\n\n
EOF
)
fi
json+=$(
cat << EOF
{
"channel_tag": "${channeltag}",
"type": "note",
"title": "${alerttitle}",
"body": "Server Name\n${servername}\n\nInformation\n${alertmessage}\n\nGame\n${gamename}\n\nServer IP\n${alertip}:${port}\n\nHostname\n${HOSTNAME}\n\nServer Time\n$(date)"
Server Time\n$(date)"
}
EOF
)
if [ -z "${alerturl}" ]; then
json="${jsonnoinfo}"
else
json="${jsoninfo}"
fi
fn_print_dots "Sending Pushbullet alert"
pushbulletsend=$(curl --connect-timeout 3 -sSL -H "Access-Token: ${pushbullettoken}" -H "Content-Type: application/json" -X POST -d "$(echo -n "${json}" | jq -c .)" "https://api.pushbullet.com/v2/pushes" | grep "error_code")

24
lgsm/modules/alert_pushover.sh

@ -22,12 +22,28 @@ else
alertpriority="0"
fi
if [ -z "${alerturl}" ]; then
pushoversend=$(curl --connect-timeout 3 -sS -F token="${pushovertoken}" -F user="${pushoveruserkey}" -F html="1" -F sound="${alertsound}" -F priority="${alertpriority}" -F title="${alerttitle}" -F message=" <b>Server name</b><br>${servername}<br><br><b>Information</b><br>${alertmessage}<br><br><b>Game</b><br>${gamename}<br><br><b>Server IP</b><br>${alertip}:${port}<br><br><b>Hostname</b><br>${HOSTNAME}<br><br>Server Time<br>$(date)" "https://api.pushover.net/1/messages.json" | grep errors)
else
pushoversend=$(curl --connect-timeout 3 -sS -F token="${pushovertoken}" -F user="${pushoveruserkey}" -F html="1" -F sound="${alertsound}" -F priority="${alertpriority}" -F title="${alerttitle}" -F message=" <b>Server name</b><br>${servername}<br><br><b>Information</b><br>${alertmessage}<br><br><b>Game</b><br>${gamename}<br><br><b>Server IP</b><br>${alertip}:${port}<br><br><b>Hostname</b><br>${HOSTNAME}<br><br><b>More info</b><br><a href='${alerturl}'>${alerturl}</a><br><br>Server Time<br>$(date)" "https://api.pushover.net/1/messages.json" | grep errors)
message=" <b>Server name</b><br>${servername}<br><br><b>Information</b><br>${alertmessage}<br><br><b>Game</b><br>${gamename}<br><br><b>Server IP</b><br>${alertip}:${port}<br><br><b>Hostname</b><br>${HOSTNAME}<br><br>"
if [ -n "${querytype}" ]; then
message+="<b>Is my Game Server Online?</b><br><a href='https://ismygameserver.online/${imgsoquerytype}/${alertip}:${queryport}'>Check here</a><br><br>"
fi
if [ -n "${alerturl}" ]; then
message+="<b>More info</b><br><a href='${alerturl}'>${alerturl}</a><br><br>"
fi
message+="Server Time<br>$(date)"
pushoversend=$(curl --connect-timeout 3 -sS \
-F token="${pushovertoken}" \
-F user="${pushoveruserkey}" \
-F html="1" \
-F sound="${alertsound}" \
-F priority="${alertpriority}" \
-F title="${alerttitle}" \
-F message="${message}" \
"https://api.pushover.net/1/messages.json" | grep errors)
if [ -n "${pushoversend}" ]; then
fn_print_fail_nl "Sending Pushover alert: ${pushoversend}"
fn_script_log_fail "Sending Pushover alert: ${pushoversend}"

34
lgsm/modules/alert_rocketchat.sh

@ -7,7 +7,7 @@
moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
jsoninfo=$(
json=$(
cat << EOF
{
"alias": "LinuxGSM",
@ -64,7 +64,31 @@ jsoninfo=$(
EOF
)
jsonnoinfo=$(
if [ -n "${querytype}" ]; then
json+=$(
cat << EOF
{
"short": false,
"title": "Is my Game Server Online?",
"value": "<https://ismygameserver.online/${imgsoquerytype}/${alertip}:${queryport}|Check here>"
},
EOF
)
fi
if [ -n "${alerturl}" ]; then
json+=$(
cat << EOF
{
"short": false,
"title": "More info",
"value": "${alerturl}"
},
EOF
)
fi
json+=$(
cat << EOF
{
"alias": "LinuxGSM",
@ -116,12 +140,6 @@ jsonnoinfo=$(
EOF
)
if [ -z "${alerturl}" ]; then
json="${jsonnoinfo}"
else
json="${jsoninfo}"
fi
fn_print_dots "Sending Rocketchat alert"
rocketchatsend=$(curl --connect-timeout 3 -sSL -H "Content-Type: application/json" -X POST -d "$(echo -n "${json}" | jq -c .)" "${rocketchatwebhook}")

38
lgsm/modules/alert_slack.sh

@ -7,7 +7,7 @@
moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
jsonnoinfo=$(
json=$(
cat << EOF
{
"attachments": [
@ -87,7 +87,35 @@ jsonnoinfo=$(
EOF
)
jsoninfo=$(
if [ -n "${querytype}" ]; then
json+=$(
cat << EOF
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "*Is my Game Server Online?*\n<https://ismygameserver.online/${imgsoquerytype}/${alertip}:${queryport}|Check here>"
}
},
EOF
)
fi
if [ -n "${alerturl}" ]; then
json+=$(
cat << EOF
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "*More info*\n<${alerturl}|${alerturl}>"
}
},
EOF
)
fi
json+=$(
cat << EOF
{
"attachments": [
@ -174,12 +202,6 @@ jsoninfo=$(
EOF
)
if [ -z "${alerturl}" ]; then
json="${jsonnoinfo}"
else
json="${jsoninfo}"
fi
fn_print_dots "Sending Slack alert"
slacksend=$(curl --connect-timeout 3 -sSL -H "Content-Type: application/json" -X POST -d "$(echo -n "${json}" | jq -c .)" "${slackwebhook}")

37
lgsm/modules/alert_telegram.sh

@ -7,38 +7,41 @@
moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
jsoninfo=$(
json=$(
cat << EOF
{
"chat_id": "${telegramchatid}",
"message_thread_id": "${telegramthreadid}",
"parse_mode": "HTML",
"disable_notification": "${telegramdisablenotification}",
"text": "<b>${alerttitle}</b>\n\n<b>Server name</b>\n${servername}\n\n<b>Information</b>\n${alertmessage}\n\n<b>Game</b>\n${gamename}\n\n<b>Server IP</b>\n${alertip}:${port}\n\n<b>Hostname</b>\n${HOSTNAME}\n\n<b>More info</b>\n<a href='${alerturl}'>${alerturl}</a>\n\n<b>Server Time</b>\n$(date)",
"disable_web_page_preview": "yes"
}
"text": "<b>${alerttitle}</b>\n\n<b>Server name</b>\n${servername}\n\n<b>Information</b>\n${alertmessage}\n\n<b>Game</b>\n${gamename}\n\n<b>Server IP</b>\n${alertip}:${port}\n\n<b>Hostname</b>\n${HOSTNAME}\n\n
EOF
)
jsonnoinfo=$(
if [ -n "${querytype}" ]; then
json+=$(
cat << EOF
<b>Is my Game Server Online?</b>\n<a href='https://ismygameserver.online/${imgsoquerytype}/${alertip}:${queryport}'>Check here</a>\n\n
EOF
)
fi
if [ -n "${alerturl}" ]; then
json+=$(
cat << EOF
<b>More info</b>\n<a href='${alerturl}'>${alerturl}</a>\n\n
EOF
)
fi
json+=$(
cat << EOF
{
"chat_id": "${telegramchatid}",
"message_thread_id": "${telegramthreadid}",
"parse_mode": "HTML",
"disable_notification": "${telegramdisablenotification}",
"text": "<b>${alerttitle}</b>\n\n<b>Server name</b>\n${servername}\n\n<b>Information</b>\n${alertmessage}\n\n<b>Game</b>\n${gamename}\n\n<b>Server IP</b>\n${alertip}:${port}\n\n<b>Hostname</b>\n${HOSTNAME}\n\n<b>Server Time</b>\n$(date)",
<b>Server Time</b>\n$(date)",
"disable_web_page_preview": "yes"
}
EOF
)
if [ -z "${alerturl}" ]; then
json="${jsonnoinfo}"
else
json="${jsoninfo}"
fi
fn_print_dots "Sending Telegram alert"
telegramsend=$(curl --connect-timeout 3 -sSL -H "Content-Type: application/json" -X POST -d "$(echo -n "${json}" | jq -c .)" ${curlcustomstring} "https://${telegramapi}/bot${telegramtoken}/sendMessage" | grep "error_code")

2
lgsm/modules/check.sh

@ -54,7 +54,7 @@ for allowed_command in "${allowed_commands_array[@]}"; do
fi
done
allowed_commands_array=(BACKUP DEBUG START)
allowed_commands_array=(BACKUP DEBUG DETAILS START UPDATE)
for allowed_command in "${allowed_commands_array[@]}"; do
if [ "${allowed_command}" == "${commandname}" ]; then
check_deps.sh

20
lgsm/modules/check_deps.sh

@ -78,11 +78,12 @@ fn_install_mono_repo() {
# Did Mono repo install correctly?
if [ "${monoautoinstall}" != "1" ]; then
if [ $? != 0 ]; then
exitcode=$?
if [ "${exitcode}" -ne 0 ]; then
fn_print_failure_nl "Unable to install Mono repository."
fn_script_log_fail "Unable to install Mono repository."
else
fn_print_complete_nl "Installing Mono repository completed."
fn_print_success_nl "Installing Mono repository completed."
fn_script_log_pass "Installing Mono repository completed."
fi
fi
@ -113,13 +114,13 @@ fn_deps_email() {
elif [ -d /etc/sendmail ]; then
array_deps_required+=(sendmail)
elif [ "$(command -v yum 2> /dev/null)" ] || [ "$(command -v dnf 2> /dev/null)" ]; then
array_deps_required+=(mailx postfix)
array_deps_required+=(s-nail postfix)
elif [ "$(command -v apt 2> /dev/null)" ]; then
array_deps_required+=(mailutils postfix)
fi
else
if [ "$(command -v yum 2> /dev/null)" ] || [ "$(command -v dnf 2> /dev/null)" ]; then
array_deps_required+=(mailx postfix)
array_deps_required+=(s-nail postfix)
elif [ "$(command -v apt 2> /dev/null)" ]; then
array_deps_required+=(mailutils postfix)
fi
@ -195,9 +196,10 @@ fn_install_missing_deps() {
fi
autodepinstall="$?"
# If auto install passes remove steamcmd install failure.
# If auto install passes, remove steamcmd install failure and set exit code to 0.
if [ "${autodepinstall}" == "0" ]; then
unset steamcmdfail
exitcode=0
fi
fi
@ -225,7 +227,7 @@ fn_install_missing_deps() {
else
if [ "${commandname}" == "INSTALL" ]; then
fn_print_information_nl "Required dependencies already installed."
fn_print_skip2_nl "Required dependencies already installed."
fn_script_log_info "Required dependencies already installed."
fi
fi
@ -233,7 +235,7 @@ fn_install_missing_deps() {
fn_check_loop() {
# Loop though required depenencies checking if they are installed.
for deptocheck in ${array_deps_required[*]}; do
for deptocheck in "${array_deps_required[@]}"; do
fn_deps_detector
done
@ -317,7 +319,7 @@ fn_deps_detector() {
fi
# If SteamCMD requirements are not met install will fail.
if [ -n "${appid}" ]; then
for steamcmddeptocheck in ${array_deps_required_steamcmd[*]}; do
for steamcmddeptocheck in "${array_deps_required_steamcmd[@]}"; do
if [ "${deptocheck}" != "steamcmd" ] && [ "${deptocheck}" == "${steamcmddeptocheck}" ]; then
steamcmdfail=1
fi
@ -360,7 +362,7 @@ if [ ! -f "${tmpdir}/dependency-no-check.tmp" ] && [ ! -f "${datadir}/${distroid
# Check that the distro dependency csv file exists.
fn_check_file_github "lgsm/data" "${distroid}-${distroversioncsv}.csv"
if [ -n "${checkflag}" ] && [ "${checkflag}" == "0" ]; then
fn_fetch_file_github "lgsm/data" "${distroid}-${distroversioncsv}.csv" "lgsm/data" "chmodx" "norun" "noforce" "nohash"
fn_fetch_file_github "lgsm/data" "${distroid}-${distroversioncsv}.csv" "${datadir}" "chmodx" "norun" "noforce" "nohash"
fi
fi

2
lgsm/modules/check_gamedig.sh

@ -5,6 +5,8 @@
# Website: https://linuxgsm.com
# Description: Installs nodejs and gamedig
moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
if [ "$(command -v node)" ] && [ "$(command -v npm)" ] && [ "$(node -v | cut -d 'v' -f 2 | cut -d '.' -f 1)" -ge 16 ] && [ ! -f "${lgsmdir}/node_modules/gamedig/bin/gamedig.js" ]; then
echo -e ""
echo -e "${bold}${lightyellow}Installing Gamedig${default}"

2
lgsm/modules/check_logs.sh

@ -10,7 +10,7 @@ moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
fn_check_logs() {
fn_print_dots "Checking for log files"
fn_print_info_nl "Checking for log files: Creating log files"
checklogs=1
checklogs=true
install_logs.sh
}

4
lgsm/modules/check_permissions.sh

@ -63,8 +63,8 @@ fn_check_permissions() {
findnotexecutable="$(find "${modulesdir}" -type f -not -executable)"
findnotexecutablewc="$(find "${modulesdir}" -type f -not -executable | wc -l)"
if [ "${findnotexecutablewc}" -ne "0" ]; then
fn_print_fail_nl "Permissions issues found"
fn_script_log_fail "Permissions issues found"
fn_print_error_nl "Permissions issues found"
fn_script_log_error "Permissions issues found"
fn_print_information_nl "The following files are not executable:"
fn_script_log_info "The following files are not executable:"
{

13
lgsm/modules/check_system_requirements.sh

@ -9,7 +9,11 @@ moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
info_distro.sh
# RAM requirements in gigabytes for each game or engine.
if [[ "${arch}" != "x86_64" && "${arch}" != "i386" && "${arch}" != "i686" ]]; then
echo -e "${red}Error: Only x86 type architectures are supported. Detected architecture: ${arch}${default}"
fn_script_log_error "Only x86 type architectures are supported. Detected architecture: ${arch}"
core_exit.sh
fi
if [ "${shortname}" == "ark" ]; then
ramrequirementgb="7"
@ -35,7 +39,7 @@ elif [ "${shortname}" == "mh" ]; then
ramrequirementgb="4"
elif [ "${shortname}" == "ns2" ] || [ "${shortname}" == "ns2c" ]; then
ramrequirementgb="1"
elif [ "${shortname}" == "ps" ]; then
elif [ "${shortname}" == "squad44" ]; then
ramrequirementgb="2"
elif [ "${shortname}" == "pvr" ]; then
ramrequirementgb="1"
@ -67,8 +71,9 @@ fi
if [ "${ramrequirementgb}" ]; then
if (($(echo "${physmemtotalgb} < ${ramrequirementgb}" | bc -l))); then
fn_print_dots "Checking RAM"
fn_print_warn_nl "Checking RAM: ${ramrequirementgb}G required, ${physmemtotal} available"
echo "* ${gamename} server may fail to run or experience poor performance."
fn_print_warn_nl "Checking RAM: Minumum RAM requirements not met"
fn_print_nl "* ${ramrequirementgb}G is required, but only ${physmemtotal} is available."
fn_print_nl "* ${gamename} server may fail to run or experience poor performance."
fn_sleep_time_5
fi
fi

14
lgsm/modules/command_backup.sh

@ -6,7 +6,7 @@
# Description: Creates a .tar.gz file in the backup directory.
commandname="BACKUP"
commandaction="Backing up"
commandaction="Backup"
moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
fn_firstcommand_set
@ -115,7 +115,7 @@ fn_backup_compression() {
# Tells how much will be compressed using rootdirduexbackup value from info_distro and prompt for continue.
fn_print_info "A total of ${rootdirduexbackup} will be compressed."
fn_script_log_info "A total of ${rootdirduexbackup} will be compressed: ${backupdir}/${backupname}.tar.gz"
fn_print_dots "Backup (${rootdirduexbackup}) ${backupname}.tar.gz, in progress..."
fn_print_dots "Backup (${rootdirduexbackup}) ${backupname}.tar.gz, in progress ..."
fn_script_log_info "Backup ${rootdirduexbackup} ${backupname}.tar.gz, in progress"
excludedir=$(fn_backup_relpath)
@ -127,8 +127,8 @@ fn_backup_compression() {
fi
tar --use-compress-program=pigz -cf "${backupdir}/${backupname}.tar.gz" -C "${rootdir}" --exclude "${excludedir}" --exclude "${lockdir}" --exclude "${tmpdir}" ./.
local exitcode=$?
if [ "${exitcode}" != 0 ]; then
exitcode=$?
if [ "${exitcode}" -ne 0 ]; then
fn_print_fail_eol
fn_script_log_fail "Backup in progress: FAIL"
echo -e "${extractcmd}" | tee -a "${lgsmlog}"
@ -136,7 +136,7 @@ fn_backup_compression() {
fn_script_log_fail "Starting backup"
else
fn_print_ok_eol
fn_print_ok_nl "Completed: ${backupname}.tar.gz, total size $(du -sh "${backupdir}/${backupname}.tar.gz" | awk '{print $1}')"
fn_print_ok_nl "Completed: ${italic}${backupname}.tar.gz${default}, total size $(du -sh "${backupdir}/${backupname}.tar.gz" | awk '{print $1}')"
fn_script_log_pass "Backup created: ${backupname}.tar.gz, total size $(du -sh "${backupdir}/${backupname}.tar.gz" | awk '{print $1}')"
alert="backup"
alert.sh
@ -190,7 +190,7 @@ fn_backup_prune() {
fn_backup_relpath() {
# Written by CedarLUG as a "realpath --relative-to" alternative in bash.
# Populate an array of tokens initialized from the rootdir components.
declare -a rdirtoks=($(readlink -f "${rootdir}" | sed "s/\// /g"))
mapfile -t rdirtoks < <(readlink -f "${rootdir}" | sed "s/\// /g")
if [ ${#rdirtoks[@]} -eq 0 ]; then
fn_print_fail_nl "Problem assessing rootdir during relative path assessment"
fn_script_log_fail "Problem assessing rootdir during relative path assessment: ${rootdir}"
@ -198,7 +198,7 @@ fn_backup_relpath() {
fi
# Populate an array of tokens initialized from the backupdir components.
declare -a bdirtoks=($(readlink -f "${backupdir}" | sed "s/\// /g"))
mapfile -t bdirtoks < <(readlink -f "${backupdir}" | sed "s/\// /g")
if [ ${#bdirtoks[@]} -eq 0 ]; then
fn_print_fail_nl "Problem assessing backupdir during relative path assessment"
fn_script_log_fail "Problem assessing backupdir during relative path assessment: ${rootdir}"

11
lgsm/modules/command_console.sh

@ -6,13 +6,14 @@
# Description: Gives access to the server tmux console.
commandname="CONSOLE"
commandaction="Access console"
commandaction="Access Console"
moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
fn_firstcommand_set
check.sh
fn_print_header
check.sh
if [ "${consoleverbose}" == "yes" ]; then
echo -e "* Verbose output: ${lightgreen}yes${default}"
elif [ "${consoleverbose}" == "no" ]; then
@ -29,10 +30,10 @@ else
echo -e "* Interactive output: ${red}unknown${default}"
fi
echo ""
fn_print_information_nl "Press \"CTRL+b\" then \"d\" to exit console."
fn_print_warning_nl "Do NOT press CTRL+c to exit."
echo -e "* https://docs.linuxgsm.com/commands/console"
fn_print_information_nl "Press ${italic}\"CTRL+b\"${default} then ${italic}\"d\"${default} to exit console."
fn_print_warning_nl "Do ${underline}NOT${default} press CTRL+c to exit."
echo -e ""
echo -e "${italic}https://docs.linuxgsm.com/commands/console${default}"
if ! fn_prompt_yn "Continue?" Y; then
exitcode=0
core_exit.sh

13
lgsm/modules/command_debug.sh

@ -6,7 +6,7 @@
# Description: Runs the server without tmux and directly from the terminal.
commandname="DEBUG"
commandaction="Debuging"
commandaction="Debugging"
moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
fn_firstcommand_set
@ -24,11 +24,13 @@ fn_lockfile_trap() {
core_exit.sh
}
fn_print_header
check.sh
fix.sh
info_distro.sh
info_game.sh
fn_print_header
{
echo -e "${lightblue}Distro:\t\t${default}${distroname}"
echo -e "${lightblue}Architecture:\t\t${default}${arch}"
@ -121,9 +123,10 @@ else
eval "${preexecutable} ${executable} ${startparameters}"
fi
if [ $? -ne 0 ]; then
fn_print_error_nl "Server has stopped: exit code: $?"
fn_script_log_error "Server has stopped: exit code: $?"
exitcode=$?
if [ "${exitcode}" -ne 0 ]; then
fn_print_error_nl "Server has stopped: exit code: ${exitcode}"
fn_script_log_error "Server has stopped: exit code: ${exitcode}"
fn_print_error_nl "Press ENTER to exit debug mode"
read -r
else

2
lgsm/modules/command_details.sh

@ -6,7 +6,7 @@
# Description: Displays server information.
commandname="DETAILS"
commandaction="Viewing details"
commandaction="Display Details"
moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
fn_firstcommand_set

2
lgsm/modules/command_dev_clear_modules.sh

@ -6,7 +6,7 @@
# Description: Deletes the contents of the modules dir.
commandname="DEV-CLEAR-MODULES"
commandaction="Clearing modules"
commandaction="Clear Modules"
moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
fn_firstcommand_set

2
lgsm/modules/command_dev_debug.sh

@ -6,7 +6,7 @@
# Description: Dev only: Enables debugging log to be saved to dev-debug.log.
commandname="DEV-DEBUG"
commandaction="Developer debug"
commandaction="Developer Debug"
moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
fn_firstcommand_reset

8
lgsm/modules/command_dev_detect_deps.sh

@ -6,13 +6,11 @@
# Description: Detects dependencies the server binary requires.
commandname="DEV-DETECT-DEPS"
commandaction="Developer detect deps"
commandaction="Dependency Checker"
moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
fn_firstcommand_set
echo -e ""
echo -e "${bold}Dependencies Checker${default}"
fn_messages_separator
fn_print_header
echo -e "Checking directory: "
echo -e "${serverfiles}"
if [ "$(command -v eu-readelf 2> /dev/null)" ]; then
@ -186,7 +184,7 @@ echo -e "${bold}Required Dependencies${default}"
fn_messages_separator
echo -e "${executable}"
echo -e ""
echo -e "CentOS"
echo -e "${bold}CentOS"
fn_messages_separator
cat "${tmpdir}/.depdetect_centos_line"
echo -e ""

14
lgsm/modules/command_dev_detect_glibc.sh

@ -7,13 +7,11 @@
# Can check a file or directory recursively.
commandname="DEV-DETECT-GLIBC"
commandaction="Developer detect glibc"
commandaction="Detect Glibc Requirements"
moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
fn_firstcommand_set
fn_messages_separator
echo -e "glibc Requirements Checker"
fn_messages_separator
fn_print_header
if [ ! "$(command -v objdump 2> /dev/null)" ]; then
fn_print_failure_nl "objdump is missing"
@ -48,17 +46,17 @@ for glibc_check_var in "${glibc_check_dir_array[@]}"; do
glibc_check_files=$(find "${glibc_check_dir}" | wc -l)
find "${glibc_check_dir}" -type f -print0 \
| while IFS= read -r -d $'\0' line; do
glibcversion=$(objdump -T "${line}" 2> /dev/null | grep -oP "GLIBC[^ ]+" | grep -v GLIBCXX | sort | uniq | sort -r --version-sort | head -n 1)
glibcversion=$(objdump -T "${line}" 2> /dev/null | grep -oP "GLIBC[^ ]+" | grep -v GLIBCXX | sort | uniq | sort -r --version-sort | head -n 1 | sed 's/)$//')
if [ "${glibcversion}" ]; then
echo -e "${glibcversion}: ${line}" >> "${tmpdir}/detect_glibc_files_${glibc_check_var}.tmp"
fi
objdump -T "${line}" 2> /dev/null | grep -oP "GLIBC[^ ]+" >> "${tmpdir}/detect_glibc_${glibc_check_var}.tmp"
objdump -T "${line}" 2> /dev/null | grep -oP "GLIBC[^ ]+" | sed 's/)$//' >> "${tmpdir}/detect_glibc_${glibc_check_var}.tmp"
echo -n "${i} / ${glibc_check_files}" $'\r'
((i++))
done
echo -e ""
echo -e ""
echo -e "${glibc_check_name} glibc Requirements"
fn_print_nl "${bold}${lightyellow}${glibc_check_name} glibc Requirements"
fn_messages_separator
if [ -f "${tmpdir}/detect_glibc_files_${glibc_check_var}.tmp" ]; then
echo -e "Required glibc"
@ -80,7 +78,7 @@ for glibc_check_var in "${glibc_check_dir_array[@]}"; do
fi
done
echo -e ""
echo -e "Final glibc Requirement"
fn_print_nl "${bold}${lightyellow}Final glibc Requirement"
fn_messages_separator
if [ -f "${tmpdir}/detect_glibc_highest.tmp" ]; then
cat "${tmpdir}/detect_glibc_highest.tmp" | sort | uniq | sort -r --version-sort | head -1

10
lgsm/modules/command_dev_detect_ldd.sh

@ -7,13 +7,11 @@
# Can check a file or directory recursively.
commandname="DEV-DETECT-LDD"
commandaction="Developer detect ldd"
commandaction="Shared Object Dependencies Checker"
moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
fn_firstcommand_set
fn_messages_separator
echo -e "Shared Object dependencies Checker"
fn_messages_separator
fn_print_header
if [ -z "${serverfiles}" ]; then
dir=$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")
@ -46,12 +44,12 @@ find "${serverfiles}" -type f -print0 \
done
echo -e ""
echo -e ""
echo -e "All"
fn_print_nl "${bold}${lightyellow}All${default}"
fn_messages_separator
cat "${tmpdir}/detect_ldd.tmp"
echo -e ""
echo -e "Not Found"
fn_print_nl "${bold}${lightyellow}Not Found${default}"
fn_messages_separator
cat "${tmpdir}/detect_ldd_not_found.tmp"

7
lgsm/modules/command_dev_parse_distro_details.sh

@ -5,6 +5,13 @@
# Website: https://linuxgsm.com
# Description: Display parsed distro details.
commandname="DEV-PARSE-DISTRO-DETAILS"
commandaction="Parse Distro Details"
moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
fn_firstcommand_set
fn_print_header
check_ip.sh
check_status.sh
info_distro.sh

7
lgsm/modules/command_dev_parse_game_details.sh

@ -5,6 +5,13 @@
# Website: https://linuxgsm.com
# Description: Display parsed gameserver details.
commandname="DEV-PARSE-GAME-DETAILS"
commandaction="Parse Game Details"
moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
fn_firstcommand_set
fn_print_header
if [ -f "config" ]; then
servercfgfullpath="config"
fi

91
lgsm/modules/command_dev_query_raw.sh

@ -6,10 +6,12 @@
# Description: Raw gamedig output of the server.
commandname="DEV-QUERY-RAW"
commandaction="Developer query raw"
commandaction="Developer Query Raw"
moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
fn_firstcommand_set
fn_print_header
check.sh
info_game.sh
info_distro.sh
@ -26,24 +28,24 @@ echo -e "Telnet IP: ${telnetip}"
echo -e "Display IP: ${displayip}"
echo -e ""
echo -e "${lightgreen}Query IP Addresses${default}"
echo -e "${bold}${lightyellow}Query IP Addresses${default}"
fn_messages_separator
echo -e ""
for queryip in "${queryips[@]}"; do
echo -e "${queryip}"
done
echo -e ""
echo -e "${lightgreen}Game Server Ports${default}"
echo -e "${bold}${lightyellow}Game Server Ports${default}"
fn_messages_separator
{
echo -e "${lightblue}Port Name \tPort Number \tStatus \tTCP \tUDP${default}"
if [ -v port ]; then
if [ -n "${port}" ]; then
echo -e "Game: \t${port} \t$(ss -tupl | grep -c "${port}") \t$(ss -tupl | grep "${port}" | grep tcp | awk '{ print $2 }') \t$(ss -tupl | grep "${port}" | grep udp | awk '{ print $2 }')"
else
echo -e "Game:"
fi
if [ "${shortname}" == "pvr" ]; then
if [ -v port401 ]; then
if [ -n "${port401}" ]; then
echo -e "Game+400: \t${port401} \t$(ss -tupl | grep -c "${port401}") \t$(ss -tupl | grep "${port401}" | grep tcp | awk '{ print $2 }') \t$(ss -tupl | grep "${port401}" | grep udp | awk '{ print $2 }')"
else
echo -e "Game+400:"
@ -51,140 +53,140 @@ fn_messages_separator
fi
if [ "${shortname}" == "mcb" ]; then
if [ -v portipv6 ]; then
if [ -n "${portipv6}" ]; then
echo -e "Game ipv6: \t${portipv6} \t$(ss -tupl | grep -c "${portipv6}") \t$(ss -tupl | grep "${portipv6}" | grep tcp | awk '{ print $2 }') \t$(ss -tupl | grep "${portipv6}" | grep udp | awk '{ print $2 }')"
else
echo -e "Game ipv6:"
fi
fi
if [ -v queryport ]; then
if [ -n "${queryport}" ]; then
echo -e "Query: \t${queryport} \t$(ss -tupl | grep -c "${queryport}") \t$(ss -tupl | grep "${queryport}" | grep tcp | awk '{ print $2 }') \t$(ss -tupl | grep "${queryport}" | grep udp | awk '{ print $2 }')"
else
echo -e "Query:"
fi
if [ -v apiport ]; then
if [ -n "${apiport}" ]; then
echo -e "Game: \t${apiport} \t$(ss -tupl | grep -c "${apiport}") \t$(ss -tupl | grep "${apiport}" | grep tcp | awk '{ print $2 }') \t$(ss -tupl | grep "${apiport}" | grep udp | awk '{ print $2 }')"
else
echo -e "API:"
fi
if [ -v appport ]; then
if [ -n "${appport}" ]; then
echo -e "App: \t${appport} \t$(ss -tupl | grep -c "${appport}") \t$(ss -tupl | grep "${appport}" | grep tcp | awk '{ print $2 }') \t$(ss -tupl | grep "${appport}" | grep udp | awk '{ print $2 }')"
else
echo -e "App:"
fi
if [ -v battleeyeport ]; then
if [ -n "${battleeyeport}" ]; then
echo -e "BattleEye: \t${battleeyeport} \t$(ss -tupl | grep -c "${battleeyeport}") \t$(ss -tupl | grep "${battleeyeport}" | grep tcp | awk '{ print $2 }') \t$(ss -tupl | grep "${battleeyeport}" | grep udp | awk '{ print $2 }')"
else
echo -e "BattleEye:"
fi
if [ -v beaconport ]; then
if [ -n "${beaconport}" ]; then
echo -e "Beacon: \t${beaconport} \t$(ss -tupl | grep -c "${beaconport}") \t$(ss -tupl | grep "${beaconport}" | grep tcp | awk '{ print $2 }') \t$(ss -tupl | grep "${beaconport}" | grep udp | awk '{ print $2 }')"
else
echo -e "Beacon:"
fi
if [ -v clientport ]; then
if [ -n "${clientport}" ]; then
echo -e "Client: \t${clientport} \t$(ss -tupl | grep -c "${clientport}") \t$(ss -tupl | grep "${clientport}" | grep tcp | awk '{ print $2 }') \t$(ss -tupl | grep "${clientport}" | grep udp | awk '{ print $2 }')"
else
echo -e "Client:"
fi
if [ -v fileport ]; then
if [ -n "${fileport}" ]; then
echo -e "File: \t${fileport} \t$(ss -tupl | grep -c "${fileport}") \t$(ss -tupl | grep "${fileport}" | grep tcp | awk '{ print $2 }') \t$(ss -tupl | grep "${fileport}" | grep udp | awk '{ print $2 }')"
else
echo -e "File:"
fi
if [ -v httpport ]; then
if [ -n "${httpport}" ]; then
echo -e "HTTP: \t${httpport} \t$(ss -tupl | grep -c "${httpport}") \t$(ss -tupl | grep "${httpport}" | grep tcp | awk '{ print $2 }') \t$(ss -tupl | grep "${httpport}" | grep udp | awk '{ print $2 }')"
else
echo -e "HTTP:"
fi
if [ -v httpqueryport ]; then
if [ -n "${httpqueryport}" ]; then
echo -e "HTTP Query: \t${httpqueryport} \t$(ss -tupl | grep -c "${httpqueryport}") \t$(ss -tupl | grep" ${httpqueryport}" | grep tcp | awk '{ print $2 }') \t$(ss -tupl | grep "${httpqueryport}" | grep udp | awk '{ print $2 }')"
else
echo -e "HTTP Query:"
fi
if [ -v httpport ]; then
if [ -n "${httpport}" ]; then
echo -e "Web Interface: \t${httpport} \t$(ss -tupl | grep -c "${httpport}") \t$(ss -tupl | grep "${httpport}" | grep tcp | awk '{ print $2 }') \t$(ss -tupl | grep "${httpport}" | grep udp | awk '{ print $2 }')"
else
echo -e "Web Interface:"
fi
if [ -v masterport ]; then
if [ -n "${masterport}" ]; then
echo -e "Game: Master: \t${masterport} \t$(ss -tupl | grep -c "${masterport}") \t$(ss -tupl | grep "${masterport}" | grep tcp | awk '{ print $2 }') \t$(ss -tupl | grep "${masterport}" | grep udp | awk '{ print $2 }')"
else
echo -e "Game: Master:"
fi
if [ -v rawport ]; then
if [ -n "${rawport}" ]; then
echo -e "RAW UDP Socket: \t${rawport} \t$(ss -tupl | grep -c "${rawport}") \t$(ss -tupl | grep "${rawport}" | grep tcp | awk '{ print $2 }') \t$(ss -tupl | grep "${rawport}" | grep udp | awk '{ print $2 }')"
else
echo -e "RAW UDP Socket:"
fi
if [ -v rconport ]; then
if [ -n "${rconport}" ]; then
echo -e "RCON: \t${rconport} \t$(ss -tupl | grep -c "${rconport}") \t$(ss -tupl | grep "${rconport}" | grep tcp | awk '{ print $2 }') \t$(ss -tupl | grep "${rconport}" | grep udp | awk '{ print $2 }')"
else
echo -e "RCON:"
fi
if [ -v steamport ]; then
if [ -n "${steamport}" ]; then
echo -e "Steam: \t${steamport} \t$(ss -tupl | grep -c "${steamport}") \t$(ss -tupl | grep "${steamport}" | grep tcp | awk '{ print $2 }') \t$(ss -tupl | grep "${steamport}" | grep udp | awk '{ print $2 }')"
else
echo -e "Steam:"
fi
if [ -v steamworksport ]; then
if [ -n "${steamworksport}" ]; then
echo -e "Steamworks P2P: \t${steamworksport} \t$(ss -tupl | grep -c "${steamworksport}") \t$(ss -tupl | grep "${steamworksport}" | grep tcp | awk '{ print $2 }') \t$(ss -tupl | grep "${steamworksport}" | grep udp | awk '{ print $2 }')"
else
echo -e "Steamworks P2P:"
fi
if [ -v steamauthport ]; then
if [ -n "${steamauthport}" ]; then
echo -e "Steam: Auth: \t${steamauthport} \t$(ss -tupl | grep -c "${steamauthport}") \t$(ss -tupl | grep "${steamauthport}" | grep tcp | awk '{ print $2 }') \t$(ss -tupl | grep "${steamauthport}" | grep udp | awk '{ print $2 }')"
else
echo -e "Steam: Auth:"
fi
if [ -v telnetport ]; then
if [ -n "${telnetport}" ]; then
echo -e "Telnet: \t${telnetport} \t$(ss -tupl | grep -c "${telnetport}") \t$(ss -tupl | grep "${telnetport}" | grep tcp | awk '{ print $2 }') \t$(ss -tupl | grep "${telnetport}" | grep udp | awk '{ print $2 }')"
else
echo -e "Telnet:"
fi
if [ -v statsport ]; then
if [ -n "${statsport}" ]; then
echo -e "Stats: \t${battleeyeport} \t$(ss -tupl | grep -c "${statsport}") \t$(ss -tupl | grep "${statsport}" | grep tcp | awk '{ print $2 }') \t$(ss -tupl | grep "${statsport}" | grep udp | awk '{ print $2 }')"
else
echo -e "Stats:"
fi
if [ -v sourcetvport ]; then
if [ -n "${sourcetvport}" ]; then
echo -e "SourceTV: \t${sourcetvport} \t$(ss -tupl | grep -c "${sourcetvport}") \t$(ss -tupl | grep "${sourcetvport}" | grep tcp | awk '{ print $2 }') \t$(ss -tupl | grep "${sourcetvport}" | grep udp | awk '{ print $2 }')"
else
echo -e "SourceTV:"
fi
if [ -v udplinkport ]; then
if [ -n "${udplinkport}" ]; then
echo -e "UDP Link: \t${udplinkport} \t$(ss -tupl | grep -c "${udplinkport}") \t$(ss -tupl | grep "${udplinkport}" | grep tcp | awk '{ print $2 }') \t$(ss -tupl | grep "${udplinkport}" | grep udp | awk '{ print $2 }')"
else
echo -e "UDP Link:"
fi
if [ -v voiceport ]; then
if [ -n "${voiceport}" ]; then
echo -e "Voice: \t${voiceport} \t$(ss -tupl | grep -c "${voiceport}") \t$(ss -tupl | grep "${voiceport}" | grep tcp | awk '{ print $2 }') \t$(ss -tupl | grep "${voiceport}" | grep udp | awk '{ print $2 }')"
else
echo -e "Voice:"
fi
if [ -v voiceunusedport ]; then
if [ -n "${voiceunusedport}" ]; then
echo -e "Voice (Unused): \t${voiceunusedport} \t$(ss -tupl | grep -c "${voiceunusedport}") \t$(ss -tupl | grep "${voiceunusedport}" | grep tcp | awk '{ print $2 }') \t$(ss -tupl | grep "${voiceunusedport}" | grep udp | awk '{ print $2 }')"
else
echo -e "Voice (Unused):"
@ -192,51 +194,56 @@ fn_messages_separator
} \
| column -s $'\t' -t
echo -e ""
echo -e "${lightgreen}SS Output${default}"
echo -e "${bold}${lightyellow}SS Output${default}"
fn_messages_separator
fn_info_messages_ports
eval "${portcommand}"
echo -e ""
echo -e "${lightgreen}Query Port - Raw Output${default}"
echo -e "${bold}${lightyellow}Query Port (${queryport}) - Gamedig Output${default}"
fn_messages_separator
echo -e ""
echo -e "PORT: ${port}"
echo -e "QUERY PORT: ${queryport}"
echo -e ""
echo -e "${lightgreen}Is My Game Server Online?${default}"
fn_messages_separator
echo -e "Game server status: https://ismygameserver.online/${imgsoquerytype}/${queryip}:${queryport}"
echo -e ""
echo -e "${lightgreen}Gamedig Raw Output${default}"
fn_messages_separator
echo -e ""
if [ ! "$(command -v gamedig 2> /dev/null)" ] && [ ! -f "${lgsmdir}/node_modules/gamedig/bin/gamedig.js" ]; then
fn_print_failure_nl "gamedig not installed"
fi
if [ ! "$(command -v jq 2> /dev/null)" ]; then
fn_print_failure_nl "jq not installed"
fi
for queryip in "${queryips[@]}"; do
query_gamedig.sh
echo -e "${gamedigcmd}"
echo -e "${italic}${gamedigcmd}${default}"
echo""
echo "${gamedigraw}" | jq
done
echo -e ""
echo -e "${lightgreen}gsquery Raw Output${default}"
echo -e "${bold}${lightyellow}Query Port (${queryport}) - gsquery Output${default}"
fn_messages_separator
echo -e ""
for queryip in "${queryips[@]}"; do
echo -e "./query_gsquery.py -a \"${queryip}\" -p \"${queryport}\" -e \"${querytype}\""
echo -e "${italic}./query_gsquery.py -a \"${queryip}\" -p \"${queryport}\" -e \"${querytype}\"${default}"
echo -e ""
if [ ! -f "${modulesdir}/query_gsquery.py" ]; then
fn_fetch_file_github "lgsm/modules" "query_gsquery.py" "${modulesdir}" "chmodx" "norun" "noforce" "nohash"
fi
"${modulesdir}"/query_gsquery.py -a "${queryip}" -p "${queryport}" -e "${querytype}"
done
echo -e ""
echo -e "${lightgreen}TCP Raw Output${default}"
echo -e "${bold}${lightyellow}Query Port (${queryport}) - TCP Output${default}"
fn_messages_separator
echo -e ""
for queryip in "${queryips[@]}"; do
echo -e "bash -c 'exec 3<> /dev/tcp/'${queryip}'/'${queryport}''"
echo -e "${italic}bash -c 'exec 3<> /dev/tcp/'${queryip}'/'${queryport}''${default}"
echo -e ""
timeout 3 bash -c 'exec 3<> /dev/tcp/'${queryip}'/'${queryport}''
querystatus="$?"
@ -248,14 +255,14 @@ for queryip in "${queryips[@]}"; do
fi
done
echo -e ""
echo -e "${lightgreen}Game Port - Raw Output${default}"
echo -e "${bold}${lightyellow}Game Port (${port}) - TCP Output${default}"
fn_messages_separator
echo -e ""
echo -e "${lightgreen}TCP Raw Output${default}"
fn_messages_separator
echo -e ""
for queryip in "${queryips[@]}"; do
echo -e "bash -c 'exec 3<> /dev/tcp/'${queryip}'/'${port}''"
echo -e "${italic}bash -c 'exec 3<> /dev/tcp/'${queryip}'/'${port}''${default}"
echo -e ""
timeout 3 bash -c 'exec 3<> /dev/tcp/'${queryip}'/'${port}''
querystatus="$?"
@ -267,10 +274,10 @@ for queryip in "${queryips[@]}"; do
fi
done
echo -e ""
echo -e "${lightgreen}Steam Master Server Response${default}"
echo -e "${bold}${lightyellow}Steam Master Server Response${default}"
fn_messages_separator
echo -e ""
echo -e "curl -m 3 -s https://api.steampowered.com/ISteamApps/GetServersAtAddress/v0001?addr=${publicip}"
echo -e "${italic}curl -m 3 -s https://api.steampowered.com/ISteamApps/GetServersAtAddress/v0001?addr=${publicip}${default}"
echo -e ""
echo -e "Response: ${displaymasterserver}"
echo -e ""

110
lgsm/modules/command_dev_ui.sh

@ -0,0 +1,110 @@
#!/bin/bash
# LinuxGSM command_dev_ui.sh module
# Author: Daniel Gibbs
# Contributors: https://linuxgsm.com/contrib
# Website: https://linuxgsm.com
# Description: Dev only: Assist with UI development.
commandname="DEV-DEBUG"
commandaction="Developer UI"
moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
fn_firstcommand_set
fn_print_header
# Load ANSI colors
fn_ansi_loader
fn_print_nl ""
fn_print_nl "${lightgreen}Colours${default}"
fn_messages_separator
# Print supported colors
fn_print_nl "${default}default"
fn_print_nl "${black}black${default}"
fn_print_nl "${red}red${default}"
fn_print_nl "${lightred}lightred${default}"
fn_print_nl "${green}green${default}"
fn_print_nl "${lightgreen}lightgreen${default}"
fn_print_nl "${yellow}yellow${default}"
fn_print_nl "${lightyellow}lightyellow${default}"
fn_print_nl "${blue}blue${default}"
fn_print_nl "${lightblue}lightblue${default}"
fn_print_nl "${magenta}magenta${default}"
fn_print_nl "${lightmagenta}lightmagenta${default}"
fn_print_nl "${cyan}cyan${default}"
fn_print_nl "${lightcyan}lightcyan${default}"
fn_print_nl "${darkgrey}darkgrey${default}"
fn_print_nl "${lightgrey}lightgrey${default}"
fn_print_nl "${white}white${default}"
fn_print_nl "${bold}bold${default}"
fn_print_nl "${dim}dim${default}"
fn_print_nl "${italic}italic${default}"
fn_print_nl "${underline}underline${default}"
fn_print_nl "${reverse}reverse${default}"
fn_print_nl ""
fn_print_nl "${lightgreen}Non Interactive UI Status Messages${default}"
fn_messages_separator
fn_print_nl ""
fn_print_nl "Print Message"
fn_print_nl ""
fn_print_nl "${lightgreen}Status Messages${default}"
fn_messages_separator
fn_print_dots_nl "Dots"
fn_print_ok_nl "OK"
fn_print_fail_nl "Fail"
fn_print_error_nl "Error"
fn_print_warn_nl "Warn"
fn_print_info_nl "Info"
fn_print_start_nl "Start"
fn_print_nl ""
fn_print_nl "${lightgreen}Interactive UI Status Messages${default}"
fn_messages_separator
fn_print_success_nl
fn_print_failure_nl
fn_print_error2_nl
fn_print_warning_nl
fn_print_information_nl
fn_print_nl ""
fn_print_nl "${lightgreen}EOL Status Messages${default}"
fn_messages_separator
fn_print "Print yes message with eol"
fn_print_yes_eol_nl
fn_print "Print no message with eol"
fn_print_no_eol_nl
fn_print "Print ok message with eol"
fn_print_ok_eol_nl
fn_print "Print fail message with eol"
fn_print_fail_eol_nl
fn_print "Print error message with eol"
fn_print_error_eol_nl
fn_print "Print warn message with eol"
fn_print_wait_eol_nl
fn_print "Print info message with eol"
fn_print_warn_eol_nl
fn_print "Print querying message with eol"
fn_print_info_eol_nl
fn_print "Print checking message with eol"
fn_print_querying_eol_nl
fn_print "Print delay message with eol"
fn_print_checking_eol_nl
fn_print "Print canceled message with eol"
fn_print_delay_eol_nl
fn_print "Print removed message with eol"
fn_print_canceled_eol_nl
fn_print "Print update message with eol"
fn_print_removed_eol_nl
fn_print "Print skip message with eol"
fn_print_update_eol_nl
fn_print "Print skip message with eol"
fn_print_skip_eol_nl
fn_print_nl ""
fn_print_nl "${lightgreen}Restart warning${default}"
fn_messages_separator
fn_print_restart_warning
core_exit.sh

110
lgsm/modules/command_fastdl.sh

@ -3,7 +3,7 @@
# Author: Daniel Gibbs
# Contributors: https://linuxgsm.com/contrib
# Website: https://linuxgsm.com
# Description: Creates a FastDL directory.
# Description: Creates a Fastdl directory.
commandname="FASTDL"
commandaction="Fastdl"
@ -30,18 +30,18 @@ fi
# Header
fn_print_header
echo -e "More info: https://docs.linuxgsm.com/commands/fastdl"
echo -e ""
fn_print_nl "More info: ${italic}https://docs.linuxgsm.com/commands/fastdl"
fn_print_nl ""
# Prompts user for FastDL creation settings.
echo -e "${commandaction} setup"
# Prompts user for Fastdl creation settings.
fn_print_nl "${bold}${lightyellow}${commandaction} Setup"
fn_messages_separator
# Prompt for clearing old files if directory was already here.
if [ -d "${fastdldir}" ]; then
fn_print_warning_nl "FastDL directory already exists."
echo -e "${fastdldir}"
echo -e ""
fn_print_warning_nl "Fastdl directory already exists."
fn_print_nl "${fastdldir}"
fn_print_nl ""
if fn_prompt_yn "Overwrite existing directory?" Y; then
fn_script_log_info "Overwrite existing directory: YES"
else
@ -63,18 +63,18 @@ fi
# Clears any fastdl directory content.
fn_clear_old_fastdl() {
# Clearing old FastDL.
# Clearing old Fastdl.
if [ -d "${fastdldir}" ]; then
echo -en "clearing existing FastDL directory ${fastdldir}..."
fn_print "clearing existing Fastdl directory ${fastdldir}"
rm -rf "${fastdldir:?}"
exitcode=$?
if [ "${exitcode}" != 0 ]; then
if [ "${exitcode}" -ne 0 ]; then
fn_print_fail_eol_nl
fn_script_log_fail "Clearing existing FastDL directory ${fastdldir}"
fn_script_log_fail "Clearing existing Fastdl directory ${fastdldir}"
core_exit.sh
else
fn_print_ok_eol_nl
fn_script_log_pass "Clearing existing FastDL directory ${fastdldir}"
fn_script_log_pass "Clearing existing Fastdl directory ${fastdldir}"
fi
fi
}
@ -82,10 +82,10 @@ fn_clear_old_fastdl() {
fn_fastdl_dirs() {
# Check and create directories.
if [ ! -d "${webdir}" ]; then
echo -en "creating web directory ${webdir}..."
fn_print "creating web directory ${webdir}"
mkdir -p "${webdir}"
exitcode=$?
if [ "${exitcode}" != 0 ]; then
if [ "${exitcode}" -ne 0 ]; then
fn_print_fail_eol_nl
fn_script_log_fail "Creating web directory ${webdir}"
core_exit.sh
@ -95,10 +95,10 @@ fn_fastdl_dirs() {
fi
fi
if [ ! -d "${fastdldir}" ]; then
echo -en "creating fastdl directory ${fastdldir}..."
fn_print "creating fastdl directory ${fastdldir}"
mkdir -p "${fastdldir}"
exitcode=$?
if [ "${exitcode}" != 0 ]; then
if [ "${exitcode}" -ne 0 ]; then
fn_print_fail_eol_nl
fn_script_log_fail "Creating fastdl directory ${fastdldir}"
core_exit.sh
@ -125,7 +125,7 @@ fn_human_readable_file_size() {
local precision="${2}"
if [[ "${bytes}" == "1" ]]; then
echo -e "1 byte"
fn_print_nl "1 byte"
else
for item in "${abbrevs[@]}"; do
local factor="${item%:*}"
@ -145,7 +145,7 @@ fn_fastdl_preview() {
if [ -f "${tmpdir}/fastdl_files_to_compress.txt" ]; then
rm -f "${tmpdir:?}/fastdl_files_to_compress.txt"
fi
echo -e "analysing required files"
fn_print_nl "analysing required files"
fn_script_log_info "Analysing required files"
# Garry's Mod
if [ "${shortname}" == "gmod" ]; then
@ -158,13 +158,13 @@ fn_fastdl_preview() {
((fileswc++))
tput rc
tput el
echo -e "gathering ${allowed_extention} : ${fileswc}..."
fn_print "gathering ${allowed_extention} : ${fileswc}"
echo -e "${ext}" >> "${tmpdir}/fastdl_files_to_compress.txt"
done < <(find . -type f -iname "${allowed_extention}")
if [ ${fileswc} != 0 ]; then
fn_print_ok_eol_nl
else
fn_print_info_eol_nl
fn_print_skip_eol_nl
fi
done
# Source engine
@ -190,12 +190,12 @@ fn_fastdl_preview() {
((fileswc++))
tput rc
tput el
echo -e "gathering ${directory} ${allowed_extention} : ${fileswc}..."
fn_print "gathering ${directory} ${allowed_extention} : ${fileswc}"
echo -e "${ext}" >> "${tmpdir}/fastdl_files_to_compress.txt"
done < <(find "${systemdir}/${directory}" -type f -iname "${allowed_extention}")
tput rc
tput el
echo -e "gathering ${directory} ${allowed_extention} : ${fileswc}..."
fn_print "gathering ${directory} ${allowed_extention} : ${fileswc}"
if [ ${fileswc} != 0 ]; then
fn_print_ok_eol_nl
else
@ -206,7 +206,7 @@ fn_fastdl_preview() {
done
fi
if [ -f "${tmpdir}/fastdl_files_to_compress.txt" ]; then
echo -e "calculating total file size..."
fn_print_nl "calculating total file size"
fn_sleep_time_1
totalfiles=$(wc -l < "${tmpdir}/fastdl_files_to_compress.txt")
# Calculates total file size.
@ -214,9 +214,9 @@ fn_fastdl_preview() {
filesize=$(stat -c %s "${dufile}")
filesizetotal=$((filesizetotal + filesize))
exitcode=$?
if [ "${exitcode}" != 0 ]; then
if [ "${exitcode}" -ne 0 ]; then
fn_print_fail_eol_nl
fn_script_log_fail "Calculating total file size."
fn_script_log_fail "Calculating total file size"
core_exit.sh
fi
done < "${tmpdir}/fastdl_files_to_compress.txt"
@ -225,8 +225,8 @@ fn_fastdl_preview() {
fn_script_log_fail "Generating file list."
core_exit.sh
fi
echo -e "about to compress ${totalfiles} files, total size $(fn_human_readable_file_size ${filesizetotal} 0)"
fn_script_log_info "${totalfiles} files, total size $(fn_human_readable_file_size ${filesizetotal} 0)"
fn_print_nl "about to compress ${totalfiles} files, total size $(fn_human_readable_file_size "${filesizetotal}" 0)"
fn_script_log_info "${totalfiles} files, total size $(fn_human_readable_file_size "${filesizetotal}" 0)"
rm -f "${tmpdir:?}/fastdl_files_to_compress.txt"
if ! fn_prompt_yn "Continue?" Y; then
fn_script_log "User exited"
@ -244,10 +244,10 @@ fn_fastdl_gmod() {
((fileswc++))
tput rc
tput el
echo -e "copying ${allowed_extention} : ${fileswc}..."
fn_print "copying ${allowed_extention} : ${fileswc}"
cp --parents "${fastdlfile}" "${fastdldir}"
exitcode=$?
if [ "${exitcode}" != 0 ]; then
if [ "${exitcode}" -ne 0 ]; then
fn_print_fail_eol_nl
fn_script_log_fail "Copying ${fastdlfile} > ${fastdldir}"
core_exit.sh
@ -259,12 +259,12 @@ fn_fastdl_gmod() {
fn_print_ok_eol_nl
fi
done
# Correct addons directory structure for FastDL.
# Correct addons directory structure for Fastdl.
if [ -d "${fastdldir}/addons" ]; then
echo -en "updating addons file structure..."
fn_print "updating addons file structure..."
cp -Rf "${fastdldir}"/addons/*/* "${fastdldir}"
exitcode=$?
if [ "${exitcode}" != 0 ]; then
if [ "${exitcode}" -ne 0 ]; then
fn_print_fail_eol_nl
fn_script_log_fail "Updating addons file structure"
core_exit.sh
@ -273,11 +273,11 @@ fn_fastdl_gmod() {
fn_script_log_pass "Updating addons file structure"
fi
# Clear addons directory in fastdl.
echo -en "clearing addons dir from fastdl dir..."
fn_print "clearing addons dir from fastdl dir..."
fn_sleep_time_1
rm -rf "${fastdldir:?}/addons"
exitcode=$?
if [ "${exitcode}" != 0 ]; then
if [ "${exitcode}" -ne 0 ]; then
fn_print_fail_eol_nl
fn_script_log_fail "Clearing addons dir from fastdl dir"
core_exit.sh
@ -288,11 +288,11 @@ fn_fastdl_gmod() {
fi
# Correct content that may be into a lua directory by mistake like some darkrpmodification addons.
if [ -d "${fastdldir}/lua" ]; then
echo -en "correcting DarkRP files..."
fn_print "correcting DarkRP files..."
fn_sleep_time_1
cp -Rf "${fastdldir}/lua/"* "${fastdldir}"
exitcode=$?
if [ "${exitcode}" != 0 ]; then
if [ "${exitcode}" -ne 0 ]; then
fn_print_fail_eol_nl
fn_script_log_fail "Correcting DarkRP files"
core_exit.sh
@ -332,8 +332,8 @@ fn_fastdl_source() {
((fileswc++))
tput rc
tput el
echo -e "copying ${directory} ${allowed_extention} : ${fileswc}..."
fn_sleep_time_1
fn_print "copying ${directory} ${allowed_extention} : ${fileswc}"
fn_sleep_time
# get relative path of file in the dir
tmprelfilepath="${fastdlfile#"${systemdir}/"}"
copytodir="${tmprelfilepath%/*}"
@ -343,7 +343,7 @@ fn_fastdl_source() {
fi
cp "${fastdlfile}" "${fastdldir}/${copytodir}"
exitcode=$?
if [ "${exitcode}" != 0 ]; then
if [ "${exitcode}" -ne 0 ]; then
fn_print_fail_eol_nl
fn_script_log_fail "Copying ${fastdlfile} > ${fastdldir}/${copytodir}"
core_exit.sh
@ -361,8 +361,8 @@ fn_fastdl_source() {
# Builds the fastdl directory content.
fn_fastdl_build() {
# Copy all needed files for FastDL.
echo -e "copying files to ${fastdldir}"
# Copy all needed files for Fastdl.
fn_print_nl "copying files to ${fastdldir}"
fn_script_log_info "Copying files to ${fastdldir}"
if [ "${shortname}" == "gmod" ]; then
fn_fastdl_gmod
@ -372,14 +372,14 @@ fn_fastdl_build() {
fi
}
# Generate lua file that will force download any file into the FastDL directory.
# Generate lua file that will force download any file into the Fastdl directory.
fn_fastdl_gmod_dl_enforcer() {
# Clear old lua file.
if [ -f "${luafastdlfullpath}" ]; then
echo -en "removing existing download enforcer: ${luafastdlfile}..."
fn_print "removing existing download enforcer: ${luafastdlfile}"
rm -f "${luafastdlfullpath:?}"
exitcode=$?
if [ "${exitcode}" != 0 ]; then
if [ "${exitcode}" -ne 0 ]; then
fn_print_fail_eol_nl
fn_script_log_fail "Removing existing download enforcer ${luafastdlfullpath}"
core_exit.sh
@ -390,14 +390,14 @@ fn_fastdl_gmod_dl_enforcer() {
fi
# Generate new one if user said yes.
if [ "${luaresource}" == "on" ]; then
echo -en "creating new download enforcer: ${luafastdlfile}..."
fn_print "creating new download enforcer: ${luafastdlfile}"
touch "${luafastdlfullpath}"
# Read all filenames and put them into a lua file at the right path.
while read -r line; do
echo -e "resource.AddFile( \"${line}\" )" >> "${luafastdlfullpath}"
done < <(find "${fastdldir:?}" \( -type f ! -name "*.bz2" \) -printf '%P\n')
exitcode=$?
if [ "${exitcode}" != 0 ]; then
if [ "${exitcode}" -ne 0 ]; then
fn_print_fail_eol_nl
fn_script_log_fail "Creating new download enforcer ${luafastdlfullpath}"
core_exit.sh
@ -408,21 +408,21 @@ fn_fastdl_gmod_dl_enforcer() {
fi
}
# Compresses FastDL files using bzip2.
# Compresses Fastdl files using bzip2.
fn_fastdl_bzip2() {
while read -r filetocompress; do
echo -en "\r\033[Kcompressing ${filetocompress}..."
fn_print "compressing ${filetocompress}"
bzip2 -f "${filetocompress}"
exitcode=$?
if [ "${exitcode}" != 0 ]; then
if [ "${exitcode}" -ne 0 ]; then
fn_print_fail_eol_nl
fn_script_log_fail "Compressing ${filetocompress}"
core_exit.sh
else
fn_print_ok_eol_nl
fn_script_log_pass "Compressing ${filetocompress}"
fi
done < <(find "${fastdldir:?}" \( -type f ! -name "*.bz2" \))
fn_print_ok_eol_nl
}
check.sh
@ -433,9 +433,9 @@ fn_fastdl_dirs
fn_fastdl_build
fn_fastdl_bzip2
# Finished message.
echo -e "FastDL files are located in:"
echo -e "${fastdldir}"
echo -e "FastDL completed"
fn_script_log_info "FastDL completed"
fn_print_nl "Fastdl files are located in:"
fn_print_nl "${fastdldir}"
fn_print_nl "Fastdl completed"
fn_script_log_info "Fastdl completed"
core_exit.sh

2
lgsm/modules/command_install_resources_mta.sh

@ -12,7 +12,7 @@ fn_firstcommand_set
fn_install_resources() {
echo -e ""
echo -e "${lightyellow}Installing Default Resources${default}"
echo -e "${bold}${lightyellow}Installing Default Resources${default}"
fn_messages_separator
fn_fetch_file "http://mirror.mtasa.com/mtasa/resources/mtasa-resources-latest.zip" "" "" "" "${tmpdir}" "mtasa-resources-latest.zip" "nochmodx" "norun" "noforce" "nohash"
fn_dl_extract "${tmpdir}" "mtasa-resources-latest.zip" "${resourcesdir}"

2
lgsm/modules/command_mods_install.sh

@ -6,7 +6,7 @@
# Description: List and installs available mods along with mods_list.sh and mods_core.sh.
commandname="MODS-INSTALL"
commandaction="Installing mods"
commandaction="Installing Mods"
moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
fn_firstcommand_set

12
lgsm/modules/command_mods_remove.sh

@ -6,7 +6,7 @@
# Description: Uninstall mods along with mods_list.sh and mods_core.sh.
commandname="MODS-REMOVE"
commandaction="Removing mods"
commandaction="Removing Mods"
moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
fn_firstcommand_set
@ -70,8 +70,8 @@ while [ "${modfileline}" -le "${modsfilelistsize}" ]; do
if [ -f "${modinstalldir}/${currentfileremove}" ] || [ -d "${modinstalldir}/${currentfileremove}" ]; then
rm -rf "${modinstalldir:?}/${currentfileremove:?}"
((exitcode = $?))
if [ "${exitcode}" != 0 ]; then
exitcode=$?
if [ "${exitcode}" -ne 0 ]; then
fn_script_log_fail "Removing ${modinstalldir}/${currentfileremove}"
break
else
@ -87,7 +87,7 @@ done
# 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
if [ "${exitcode}" -ne 0 ]; then
fn_print_fail_eol_nl
core_exit.sh
else
@ -102,7 +102,7 @@ echo -en "removing ${modcommand}-files.txt..."
fn_sleep_time_1
rm -rf "${modsdir:?}/${modcommand}-files.txt"
exitcode=$?
if [ "${exitcode}" != 0 ]; then
if [ "${exitcode}" -ne 0 ]; then
fn_script_log_fail "Removing ${modsdir}/${modcommand}-files.txt"
fn_print_fail_eol_nl
core_exit.sh
@ -117,7 +117,7 @@ fn_sleep_time_1
sed -i "/^${modcommand}$/d" "${modsinstalledlistfullpath}"
exitcode=$?
if [ "${exitcode}" != 0 ]; then
if [ "${exitcode}" -ne 0 ]; then
fn_script_log_fail "Removing ${modcommand} from ${modsinstalledlist}"
fn_print_fail_eol_nl
core_exit.sh

2
lgsm/modules/command_mods_update.sh

@ -6,7 +6,7 @@
# Description: Updates installed mods along with mods_list.sh and mods_core.sh.
commandname="MODS-UPDATE"
commandaction="Updating mods"
commandaction="Updating Mods"
moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
fn_firstcommand_set

79
lgsm/modules/command_monitor.sh

@ -18,10 +18,10 @@ fn_monitor_check_monitoring() {
date '+%s' > "${lockdir:?}/${selfname}-monitoring.lock"
elif [ ! -f "${lockdir}/${selfname}-monitoring.lock" ]; then
# Monitor does not run if lockfile is not found.
fn_print_dots "Checking lockfile: "
fn_print_dots "Checking lockfile"
fn_print_checking_eol
fn_script_log_info "Checking lockfile: CHECKING"
fn_print_error "Checking lockfile: No lockfile found: "
fn_print_error "Checking lockfile: No lockfile found"
fn_print_error_eol_nl
fn_script_log_error "Checking lockfile: No lockfile found: ERROR"
echo -e "* Start ${selfname} to run monitor."
@ -31,10 +31,10 @@ fn_monitor_check_monitoring() {
fn_monitor_check_install() {
if [ "$(pgrep -fc -u "${USER}" "/bin/bash ./${selfname} install")" != "0" ] || [ "$(pgrep -fcx -u "${USER}" "/bin/bash ./${selfname} i")" != "0" ] || [ "$(pgrep -fcx -u "${USER}" "/bin/bash ./${selfname} auto-install")" != "0" ] || [ "$(pgrep -fcx -u "${USER}" "/bin/bash ./${selfname} ai")" != "0" ]; then
fn_print_dots "Checking installer: "
fn_print_dots "Checking installer"
fn_print_checking_eol
fn_script_log_info "Checking installer: CHECKING"
fn_print_info "Checking installer: LinuxGSM is installing: "
fn_print_info "Checking installer: LinuxGSM is installing"
fn_print_info_eol_nl
fn_script_log_pass "Checking installer: LinuxGSM is installing"
core_exit.sh
@ -43,9 +43,9 @@ fn_monitor_check_install() {
fn_monitor_check_debug() {
if [ "$(pgrep -fcx -u "${USER}" "/bin/bash ./${selfname} debug")" != "0" ] || [ "$(pgrep -fcx -u "${USER}" "/bin/bash ./${selfname} d")" != "0" ]; then
fn_print_dots "Checking debug: "
fn_print_dots "Checking debug"
fn_print_checking_eol
fn_print_info "Checking debug: Debug is running: "
fn_print_info "Checking debug: Debug is running"
fn_print_info_eol_nl
fn_script_log_pass "Checking debug: Debug is running"
core_exit.sh
@ -54,9 +54,9 @@ fn_monitor_check_debug() {
fn_monitor_check_details() {
if [ "$(pgrep -fcx -u "${USER}" "/bin/bash ./${selfname} details")" != "0" ] || [ "$(pgrep -fcx -u "${USER}" "/bin/bash ./${selfname} dt")" != "0" ]; then
fn_print_dots "Checking details: "
fn_print_dots "Checking details"
fn_print_checking_eol
fn_print_info "Checking details: Details is running: "
fn_print_info "Checking details: Details is running"
fn_print_info_eol_nl
fn_script_log_pass "Checking details: Details is running"
core_exit.sh
@ -67,9 +67,9 @@ fn_monitor_check_starting() {
# Remove stale lockfile.
if [ -f "${lockdir}/${selfname}-starting.lock" ]; then
if [ "$(find "${lockdir}/${selfname}-starting.lock" -mmin +5)" ]; then
fn_print_dots "Checking start: "
fn_print_dots "Checking start"
fn_print_checking_eol
fn_print_warn "Checking start: Removing stale lockfile: "
fn_print_warn "Checking start: Removing stale lockfile"
fn_print_warn_eol_nl
fn_script_log_warn "Checking start: Removing stale lockfile"
rm -f "${lockdir:?}/${selfname}-starting.lock"
@ -77,9 +77,9 @@ fn_monitor_check_starting() {
fi
if [ -f "${lockdir}/${selfname}-starting.lock" ] && [[ "$(pgrep -fcx -u "${USER}" "/bin/bash ./${selfname} start")" != "0" || "$(pgrep -fcx -u "${USER}" "/bin/bash ./${selfname} s")" != "0" ]]; then
fn_print_dots "Checking start: "
fn_print_dots "Checking start"
fn_print_checking_eol
fn_print_info "Checking start: LinuxGSM is starting: "
fn_print_info "Checking start: LinuxGSM is starting"
fn_print_info_eol_nl
fn_script_log_info "Checking backup: LinuxGSM is starting"
core_exit.sh
@ -90,9 +90,9 @@ fn_monitor_check_stopping() {
# Remove stale lockfile.
if [ -f "${lockdir}/${selfname}-stopping.lock" ]; then
if [ "$(find "${lockdir}/${selfname}-stopping.lock" -mmin +5)" ]; then
fn_print_dots "Checking stop: "
fn_print_dots "Checking stop"
fn_print_checking_eol
fn_print_warn "Checking stop: Removing stale lockfile: "
fn_print_warn "Checking stop: Removing stale lockfile"
fn_print_warn_eol_nl
fn_script_log_warn "Checking stop: Removing stale lockfile"
rm -f "${lockdir:?}/${selfname}-stopping.lock"
@ -100,9 +100,9 @@ fn_monitor_check_stopping() {
fi
if [ -f "${lockdir}/${selfname}-stopping.lock" ] && [[ "$(pgrep -fcx -u "${USER}" "/bin/bash ./${selfname} stop")" != "0" || "$(pgrep -fcx -u "${USER}" "/bin/bash ./${selfname} s")" != "0" ]]; then
fn_print_dots "Checking stop: "
fn_print_dots "Checking stop"
fn_print_checking_eol
fn_print_info "Checking stop: LinuxGSM is stopping: "
fn_print_info "Checking stop: LinuxGSM is stopping"
fn_print_info_eol_nl
fn_script_log_info "Checking backup: LinuxGSM is stopping"
core_exit.sh
@ -113,9 +113,9 @@ fn_monitor_check_backup() {
# Remove stale lockfile.
if [ -f "${lockdir}/backup.lock" ]; then
if [ "$(find "${lockdir}/backup.lock" -mmin +60)" ]; then
fn_print_dots "Checking backup: "
fn_print_dots "Checking backup"
fn_print_checking_eol
fn_print_warn "Checking backup: Removing stale lockfile: "
fn_print_warn "Checking backup: Removing stale lockfile"
fn_print_warn_eol
fn_script_log_warn "Checking backup: Removing stale lockfile"
rm -f "${lockdir:?}/backup.lock"
@ -123,9 +123,9 @@ fn_monitor_check_backup() {
fi
if [ -f "${lockdir}/backup.lock" ] && [[ "$(pgrep -fcx -u "${USER}" "/bin/bash ./${selfname} backup")" != "0" || "$(pgrep -fcx -u "${USER}" "/bin/bash ./${selfname} b")" != "0" ]]; then
fn_print_dots "Checking backup: "
fn_print_dots "Checking backup"
fn_print_checking_eol
fn_print_info "Checking backup: Backup is running: "
fn_print_info "Checking backup: Backup is running"
fn_print_info_eol_nl
fn_script_log_info "Checking backup: Backup is running"
core_exit.sh
@ -136,9 +136,9 @@ fn_monitor_check_update() {
# Remove stale lockfile.
if [ -f "${lockdir}/update.lock" ]; then
if [ "$(find "${lockdir}/update.lock" -mmin +15)" ]; then
fn_print_dots "Checking update: "
fn_print_dots "Checking update"
fn_print_checking_eol
fn_print_warn "Checking update: Removing stale lockfile: "
fn_print_warn "Checking update: Removing stale lockfile"
fn_print_warn_eol_nl
fn_script_log_warn "Checking update: Removing stale lockfile"
rm -f "${lockdir:?}/update.lock"
@ -146,9 +146,9 @@ fn_monitor_check_update() {
fi
if [ -f "${lockdir}/update.lock" ] && [[ "$(pgrep -fcx -u "${USER}" "/bin/bash ./${selfname} update")" != "0" || "$(pgrep -fcx -u "${USER}" "/bin/bash ./${selfname} validate")" != "0" || "$(pgrep -fcx -u "${USER}" "/bin/bash ./${selfname} v")" != "0" || "$(pgrep -fc force-update "${USER}" "/bin/bash ./${selfname} fu")" != "0" ]]; then
fn_print_dots "Checking update: "
fn_print_dots "Checking update"
fn_print_checking_eol
fn_print_info "Checking update: LinuxGSM is updating the game server: "
fn_print_info "Checking update: LinuxGSM is updating the game server"
fn_print_info_eol_nl
fn_script_log_pass "Checking update: LinuxGSM is updating the game server"
core_exit.sh
@ -159,10 +159,10 @@ fn_monitor_check_update() {
fn_monitor_check_update_source() {
if [ -f "${consolelogdir}/${selfname}-console.log" ] && [ "${engine}" == "source" ]; then
if grep -q "Your server needs to be restarted in order to receive the latest update." "${consolelogdir}/${selfname}-console.log"; then
fn_print_dots "Checking update: "
fn_print_dots "Checking update"
fn_print_checking_eol
fn_script_log_info "Checking update: CHECKING"
fn_print_ok "Checking update: "
fn_print_ok "Checking update"
fn_print_ok_eol_nl
fn_script_log_info "Checking update: ${selfname} has requested an update and needs to be restarted"
alert="update-request"
@ -174,7 +174,7 @@ fn_monitor_check_update_source() {
}
fn_monitor_check_session() {
fn_print_dots "Checking session: "
fn_print_dots "Checking session"
fn_print_checking_eol
fn_script_log_info "Checking session: CHECKING"
# Tmux session width and height needs to be reviewed as may no longer be required.
@ -182,7 +182,7 @@ fn_monitor_check_session() {
sessionheight="23"
# Check for PIDS with identical tmux sessions running.
if [ "$(pgrep -fcx "tmux -L ${socketname} new-session -d -x ${sessionwidth} -y ${sessionheight} -s ${sessionname}")" -ge "2" ]; then
fn_print_error "Checking session: There are PIDS with identical tmux sessions running: "
fn_print_error "Checking session: There are PIDS with identical tmux sessions running"
fn_print_error_eol_nl
fn_script_log_error "Checking session: ERROR"
fn_script_log_error "Checking session: There are PIDS with identical tmux sessions running"
@ -192,7 +192,7 @@ fn_monitor_check_session() {
core_exit.sh
# Check for tmux pids with the same tmux session and socket names. This will reduce issues with migration to release v23.5.0. #4296
elif [ "$(pgrep -fc -u "${USER}" "tmux -L ${sessionname} new-session -d -x ${sessionwidth} -y ${sessionheight} -s ${sessionname}")" != "0" ]; then
fn_print_error "Checking session: PIDS with the same tmux session and socket names are running: "
fn_print_error "Checking session: PIDS with the same tmux session and socket names are running"
fn_print_error_eol_nl
fn_script_log_error "Checking session: ERROR"
fn_script_log_error "Checking session: PIDS with the same tmux session and socket names are running"
@ -202,7 +202,7 @@ fn_monitor_check_session() {
core_exit.sh
# Check for tmux pids that are using the old type of tmux session. This will reduce issues with migration to release v23.5.0. #4296
elif [ "$(pgrep -fc -u "${USER}" "tmux new-session -d -x ${sessionwidth} -y ${sessionheight} -s ${sessionname}")" != "0" ]; then
fn_print_error "Checking session: PIDS with old type tmux session are running: "
fn_print_error "Checking session: PIDS with old type tmux session are running"
fn_print_error_eol_nl
fn_script_log_error "Checking session: ERROR"
fn_script_log_error "Checking session: PIDS with old type tmux session are running"
@ -211,7 +211,7 @@ fn_monitor_check_session() {
command_restart.sh
core_exit.sh
elif [ "${status}" != "0" ]; then
fn_print_ok "Checking session: "
fn_print_ok "Checking session"
fn_print_ok_eol_nl
fn_script_log_pass "Checking session: OK"
# send LinuxGSM stats if monitor is OK.
@ -219,7 +219,7 @@ fn_monitor_check_session() {
info_stats.sh
fi
else
fn_print_error "Checking session: "
fn_print_error "Checking session"
fn_print_fail_eol_nl
fn_script_log_fail "Checking session: FAIL"
alert="monitor-session"
@ -233,7 +233,7 @@ fn_monitor_check_session() {
# Monitor will check queryport is set before continuing.
fn_monitor_check_queryport() {
if [ -z "${queryport}" ] || [ "${queryport}" == "0" ]; then
fn_print_dots "Checking port: "
fn_print_dots "Checking port"
fn_print_checking_eol
fn_script_log_info "Checking port: CHECKING"
if [ -n "${rconenabled}" ] && [ "${rconenabled}" != "true" ] && [ "${shortname}" == "av" ]; then
@ -266,12 +266,12 @@ fn_monitor_query() {
totalseconds=0
for queryattempt in {1..5}; do
for queryip in "${queryips[@]}"; do
fn_print_dots "Querying port: ${querymethod}: ${queryip}:${queryport} : ${totalseconds}/${queryattempt}: "
fn_print_dots "Querying port: ${querymethod}: ${queryip}:${queryport} : ${totalseconds}/${queryattempt}"
fn_print_querying_eol
fn_script_log_info "Querying port: ${querymethod}: ${queryip}:${queryport} : ${queryattempt} : QUERYING"
# querydelay
if [ "$(head -n 1 "${lockdir}/${selfname}-started.lock")" -gt "$(date "+%s" -d "${querydelay} mins ago")" ]; then
fn_print_ok "Querying port: ${querymethod}: ${ip}:${queryport} : ${totalseconds}/${queryattempt}: "
fn_print_ok "Querying port: ${querymethod}: ${ip}:${queryport} : ${totalseconds}/${queryattempt}"
fn_print_delay_eol_nl
fn_script_log_info "Querying port: ${querymethod}: ${ip}:${queryport} : ${queryattempt} : DELAY"
fn_script_log_info "Query bypassed: ${gameservername} started less than ${querydelay} minutes ago"
@ -293,7 +293,7 @@ fn_monitor_query() {
if [ "${querystatus}" == "0" ]; then
# Server query OK.
fn_print_ok "Querying port: ${querymethod}: ${queryip}:${queryport} : ${totalseconds}/${queryattempt}: "
fn_print_ok "Querying port: ${querymethod}: ${queryip}:${queryport} : ${totalseconds}/${queryattempt}"
fn_print_ok_eol_nl
fn_script_log_pass "Querying port: ${querymethod}: ${queryip}:${queryport} : ${queryattempt} : OK"
monitorpass=1
@ -323,14 +323,14 @@ fn_monitor_query() {
core_exit.sh
else
# Server query FAIL.
fn_print_fail "Querying port: ${querymethod}: ${queryip}:${queryport} : ${totalseconds}/${queryattempt}: "
fn_print_fail "Querying port: ${querymethod}: ${queryip}:${queryport} : ${totalseconds}/${queryattempt}"
fn_print_fail_eol
fn_script_log_warn "Querying port: ${querymethod}: ${queryip}:${queryport} : ${queryattempt} : FAIL"
# Monitor will try gamedig (if supported) for first 30s then gsquery before restarting.
# gsquery will fail if longer than 60s
if [ "${totalseconds}" -ge "59" ]; then
# Monitor will FAIL if over 60s and trigger gane server reboot.
fn_print_fail "Querying port: ${querymethod}: ${queryip}:${queryport} : ${totalseconds}/${queryattempt}: "
fn_print_fail "Querying port: ${querymethod}: ${queryip}:${queryport} : ${totalseconds}/${queryattempt}"
fn_print_fail_eol_nl
fn_script_log_warn "Querying port: ${querymethod}: ${queryip}:${queryport} : ${queryattempt} : FAIL"
# Send alert if enabled.
@ -344,7 +344,8 @@ fn_monitor_query() {
done
# Second counter will wait for 15s before breaking loop.
for seconds in {1..15}; do
fn_print_fail "Querying port: ${querymethod}: ${ip}:${queryport} : ${totalseconds}/${queryattempt} : ${cyan}WAIT${default}"
fn_print_fail "Querying port: ${querymethod}: ${ip}:${queryport} : ${totalseconds}/${queryattempt}"
fn_print_wait_eol
fn_sleep_time_1
totalseconds=$((totalseconds + 1))
if [ "${seconds}" == "15" ]; then

12
lgsm/modules/command_postdetails.sh

@ -6,20 +6,18 @@
# Description: Strips sensitive information out of Details output.
commandname="POST-DETAILS"
commandaction="Posting details"
commandaction="Post Details"
moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
fn_firstcommand_set
posttarget="https://termbin.com"
# source all of the modules defined in the details command.
info_messages.sh
fn_bad_postdetailslog() {
fn_print_fail_nl "Unable to create temporary file ${postdetailslog}."
core_exit.sh
}
# source all of the modules defined in the details command.
info_messages.sh
# Remove any existing postdetails.log file.
if [ -f "${postdetailslog}" ]; then
rm -f "${postdetailslog:?}"
@ -68,7 +66,7 @@ pdurl="${link}"
if [ "${firstcommandname}" == "POST-DETAILS" ]; then
echo -e ""
echo -e "Please share the following url for support: "
echo -e "${pdurl}"
echo -e "${italic}${pdurl}${default}"
fi
fn_script_log_info "${pdurl}"
alerturl="${pdurl}"

2
lgsm/modules/command_send.sh

@ -26,8 +26,8 @@ if [ "${status}" != "0" ]; then
fi
echo ""
fn_print_dots "Sending command to console: \"${commandtosend}\""
tmux -L "${socketname}" send-keys -t "${sessionname}" "${commandtosend}" ENTER
fn_print_ok_nl "Sending command to console: \"${commandtosend}\""
tmux -L "${socketname}" send-keys -t "${sessionname}" "${commandtosend}" ENTER
fn_script_log_pass "Command \"${commandtosend}\" sent to console"
else
fn_print_error_nl "Server not running"

2
lgsm/modules/command_skeleton.sh

@ -16,7 +16,7 @@ check.sh
# Find all directorys and create them in the skel directory
find "${rootdir}" -type d -not \( -path ./skel -prune \) | cpio -pdvm skel 2> /dev/null
exitcode=$?
if [ "${exitcode}" != 0 ]; then
if [ "${exitcode}" -ne 0 ]; then
fn_print_fail_nl "Creating skeleton directory"
fn_script_log_fail "Creating skeleton directory"
else

2
lgsm/modules/command_sponsor.sh

@ -11,7 +11,7 @@ moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
fn_firstcommand_set
fn_print_ascii_logo
echo -e "${lightyellow}Support LinuxGSM${default}"
echo -e "${bold}${lightyellow}Support LinuxGSM${default}"
fn_messages_separator
echo -e ""
echo -e "Been using LinuxGSM?"

6
lgsm/modules/command_start.sh

@ -127,12 +127,12 @@ fn_start_tmux() {
echo -e ""
echo -e " usermod -G tty $(whoami)"
echo -e ""
echo -e "https://linuxgsm.com/tmux-op-perm"
echo -e "${italic}https://linuxgsm.com/tmux-op-perm"
fn_script_log_info "https://linuxgsm.com/tmux-op-perm"
else
echo -e "No known fix currently. Please log an issue."
fn_script_log_info "No known fix currently. Please log an issue."
echo -e "https://linuxgsm.com/support"
echo -e "${italic}https://linuxgsm.com/support"
fn_script_log_info "https://linuxgsm.com/support"
fi
fi
@ -176,7 +176,7 @@ check.sh
# If the server already started dont start again.
if [ "${status}" != "0" ]; then
fn_print_dots "${servername}"
fn_print_info_nl "${servername} is already running"
fn_print_skip_nl "${servername} is already running"
fn_script_log_error "${servername} is already running"
if [ -z "${exitbypass}" ]; then
# Remove starting lockfile when command ends.

10
lgsm/modules/command_stop.sh

@ -20,7 +20,7 @@ fn_stop_graceful_ctrlc() {
for seconds in {1..30}; do
check_status.sh
if [ "${status}" == "0" ]; then
fn_print_ok "Graceful: CTRL+c: ${seconds}: "
fn_print_ok "Graceful: CTRL+c: ${seconds}"
fn_print_ok_eol_nl
fn_script_log_pass "Graceful: CTRL+c: OK: ${seconds} seconds"
if [ "${statusalert}" == "on" ] && [ "${firstcommandname}" == "STOP" ]; then
@ -52,7 +52,7 @@ fn_stop_graceful_cmd() {
for ((seconds = 1; seconds <= ${2}; seconds++)); do
check_status.sh
if [ "${status}" == "0" ]; then
fn_print_ok "Graceful: sending \"${1}\": ${seconds}: "
fn_print_ok "Graceful: sending \"${1}\": ${seconds}"
fn_print_ok_eol_nl
fn_script_log_pass "Graceful: sending \"${1}\": OK: ${seconds} seconds"
if [ "${statusalert}" == "on" ] && [ "${firstcommandname}" == "STOP" ]; then
@ -85,7 +85,7 @@ fn_stop_graceful_goldsrc() {
fn_sleep_time_1
fn_print_dots "Graceful: sending \"quit\": ${seconds}"
done
fn_print_ok "Graceful: sending \"quit\": ${seconds}: "
fn_print_ok "Graceful: sending \"quit\": ${seconds}"
fn_print_ok_eol_nl
fn_script_log_pass "Graceful: sending \"quit\": OK: ${seconds} seconds"
if [ "${statusalert}" == "on" ] && [ "${firstcommandname}" == "STOP" ]; then
@ -297,7 +297,7 @@ fn_stop_graceful_avorion() {
for seconds in {1..30}; do
check_status.sh
if [ "${status}" == "0" ]; then
fn_print_ok "Graceful: /save /stop: ${seconds}: "
fn_print_ok "Graceful: /save /stop: ${seconds}"
fn_print_ok_eol_nl
fn_script_log_pass "Graceful: /save /stop: OK: ${seconds} seconds"
if [ "${statusalert}" == "on" ] && [ "${firstcommandname}" == "STOP" ]; then
@ -370,7 +370,7 @@ fn_stop_tmux() {
# Checks if the server is already stopped.
fn_stop_pre_check() {
if [ "${status}" == "0" ]; then
fn_print_info_nl "${servername} is already stopped"
fn_print_skip_nl "${servername} is already stopped"
fn_script_log_info "${servername} is already stopped"
else
# Select graceful shutdown.

2
lgsm/modules/command_ts3_server_pass.sh

@ -6,7 +6,7 @@
# Description: Changes TS3 serveradmin password.
commandname="CHANGE-PASSWORD"
commandaction="Changing password"
commandaction="Changing Password"
moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
fn_firstcommand_set

77
lgsm/modules/command_update_linuxgsm.sh

@ -27,10 +27,11 @@ fn_script_log_info "Selecting repo"
# Select remotereponame
curl ${nocache} --connect-timeout 3 -IsfL "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/linuxgsm.sh" 1> /dev/null
if [ $? != "0" ]; then
curl curl ${nocache} --connect-timeout 3 -IsfL "https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/linuxgsm.sh" 1> /dev/null
if [ $? != "0" ]; then
exitcode=$?
if [ "${exitcode}" -ne "0" ]; then
curl ${nocache} --connect-timeout 3 -IsfL "https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/linuxgsm.sh" 1> /dev/null
exitcode=$?
if [ "${exitcode}" -ne "0" ]; then
fn_print_fail_nl "Selecting repo: Unable to to access GitHub or Bitbucket repositories"
fn_script_log_fail "Selecting repo: Unable to to access GitHub or Bitbucket repositories"
core_exit.sh
@ -44,16 +45,17 @@ else
fi
# Check linuxsm.sh
echo -en "checking ${remotereponame} linuxgsm.sh...\c"
echo -en "checking ${remotereponame} script [ ${italic}linuxgsm.sh${default} ]\c"
if [ "${remotereponame}" == "GitHub" ]; then
curl ${nocache} --connect-timeout 3 -IsfL "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/linuxgsm.sh" 1> /dev/null
else
curl ${nocache} --connect-timeout 3 -IsfL "https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/linuxgsm.sh" 1> /dev/null
fi
if [ $? != "0" ]; then
exitcode=$?
if [ "${exitcode}" -ne 0 ]; then
fn_print_fail_eol_nl
fn_script_log_fail "Checking ${remotereponame} linuxgsm.sh"
fn_script_log_fail "Curl returned error: $?"
fn_script_log_fail "Curl returned error: ${exitcode}"
core_exit.sh
fi
@ -65,41 +67,42 @@ fi
if [ "${tmp_script_diff}" != "" ]; then
fn_print_update_eol_nl
fn_script_log_update "Checking ${remotereponame} linuxgsm.sh"
fn_script_log "Checking ${remotereponame} script linuxgsm.sh"
rm -f "${tmpdir:?}/linuxgsm.sh"
fn_fetch_file_github "" "linuxgsm.sh" "${tmpdir}" "nochmodx" "norun" "noforcedl" "nohash"
else
fn_print_ok_eol_nl
fn_script_log_pass "Checking ${remotereponame} linuxgsm.sh"
fn_print_skip_eol_nl
fn_script_log_pass "Checking ${remotereponame} script linuxgsm.sh"
fi
# Check gameserver.sh
# Compare gameserver.sh against linuxgsm.sh in the tmp dir.
# Ignoring server specific vars.
echo -en "checking ${selfname}...\c"
echo -en "checking script [ ${italic}${selfname}${default} ]\c"
fn_script_log_info "Checking ${selfname}"
script_diff=$(diff <(sed '\/shortname/d;\/gameservername/d;\/gamename/d;\/githubuser/d;\/githubrepo/d;\/githubbranch/d' "${tmpdir}/linuxgsm.sh") <(sed '\/shortname/d;\/gameservername/d;\/gamename/d;\/githubuser/d;\/githubrepo/d;\/githubbranch/d' "${rootdir}/${selfname}"))
if [ "${script_diff}" != "" ]; then
fn_print_update_eol_nl
fn_script_log_update "Checking ${selfname}"
echo -en "backup ${selfname}...\c"
fn_script_log_info "Backup ${selfname}"
fn_script_log "Checking script ${selfname}"
echo -en "backup ${selfname}\c"
fn_script_log_info "Backup script ${selfname}"
if [ ! -d "${backupdir}/script" ]; then
mkdir -p "${backupdir}/script"
fi
cp "${rootdir}/${selfname}" "${backupdir}/script/${selfname}-$(date +"%m_%d_%Y_%M").bak"
if [ $? != 0 ]; then
exitcode=$?
if [ "${exitcode}" -ne 0 ]; then
fn_print_fail_eol_nl
fn_script_log_fail "Backup ${selfname}"
core_exit.sh
else
fn_print_ok_eol_nl
fn_script_log_pass "Backup ${selfname}"
echo -e "backup location ${backupdir}/script/${selfname}-$(date +"%m_%d_%Y_%M").bak"
fn_script_log_pass "Backup script${selfname}"
echo -e "backup location [ ${backupdir}/script/${selfname}-$(date +"%m_%d_%Y_%M").bak ]"
fn_script_log_pass "Backup location ${backupdir}/script/${selfname}-$(date +"%m_%d_%Y_%M").bak"
fi
echo -en "copying ${selfname}...\c"
echo -en "copying ${selfname}"
fn_script_log_info "Copying ${selfname}"
cp "${tmpdir}/linuxgsm.sh" "${rootdir}/${selfname}"
sed -i "s+shortname=\"core\"+shortname=\"${shortname}\"+g" "${rootdir}/${selfname}"
@ -109,7 +112,8 @@ if [ "${script_diff}" != "" ]; then
sed -i "s+githubrepo=\"LinuxGSM\"+githubrepo=\"${githubrepo}\"+g" "${rootdir}/${selfname}"
sed -i "s+githubbranch=\"master\"+githubbranch=\"${githubbranch}\"+g" "${rootdir}/${selfname}"
if [ $? != "0" ]; then
exitcode=$?
if [ "${exitcode}" -ne 0 ]; then
fn_print_fail_eol_nl
fn_script_log_fail "copying ${selfname}"
core_exit.sh
@ -118,22 +122,23 @@ if [ "${script_diff}" != "" ]; then
fn_script_log_pass "copying ${selfname}"
fi
else
fn_print_ok_eol_nl
fn_print_skip_eol_nl
fn_script_log_info "Checking ${selfname}"
fi
# Check _default.cfg.
echo -en "checking ${remotereponame} config _default.cfg...\c"
echo -en "checking ${remotereponame} config [ ${italic}_default.cfg${default} ]\c"
fn_script_log_info "Checking ${remotereponame} config _default.cfg"
if [ "${remotereponame}" == "GitHub" ]; then
curl ${nocache} --connect-timeout 3 -IsfL "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/lgsm/config-default/config-lgsm/${gameservername}/_default.cfg" 1> /dev/null
else
curl ${nocache} --connect-timeout 3 -IsfL "https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/lgsm/config-default/config-lgsm/${gameservername}/_default.cfg" 1> /dev/null
fi
if [ $? != "0" ]; then
exitcode=$?
if [ "${exitcode}" -ne 0 ]; then
fn_print_fail_eol_nl
fn_script_log_fail "Checking ${remotereponame} config _default.cfg"
fn_script_log_fail "Curl returned error: $?"
fn_script_log_fail "Curl returned error: ${exitcode}"
core_exit.sh
fi
@ -145,29 +150,30 @@ fi
if [ "${config_file_diff}" != "" ]; then
fn_print_update_eol_nl
fn_script_log_update "Checking ${remotereponame} config _default.cfg"
fn_script_log "Checking ${remotereponame} config _default.cfg"
rm -f "${configdirdefault:?}/config-lgsm/${gameservername:?}/_default.cfg"
fn_fetch_file_github "lgsm/config-default/config-lgsm/${gameservername}" "_default.cfg" "${configdirdefault}/config-lgsm/${gameservername}" "nochmodx" "norun" "noforce" "nohash"
alert="config"
alert.sh
else
fn_print_ok_eol_nl
fn_print_skip_eol_nl
fn_script_log_pass "Checking ${remotereponame} config _default.cfg"
fi
# Check distro csv. ${datadir}/${distroid}-${distroversioncsv}.csv
if [ -f "${datadir}/${distroid}-${distroversioncsv}.csv" ]; then
echo -en "checking ${remotereponame} config ${distroid}-${distroversioncsv}.csv...\c"
echo -en "checking ${remotereponame} config [ ${italic}${distroid}-${distroversioncsv}.csv${default} ]\c"
fn_script_log_info "Checking ${remotereponame} ${distroid}-${distroversioncsv}.csv"
if [ "${remotereponame}" == "GitHub" ]; then
curl ${nocache} --connect-timeout 3 -IsfL "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/lgsm/data/${distroid}-${distroversioncsv}.csv" 1> /dev/null
else
curl ${nocache} --connect-timeout 3 -IsfL "https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/lgsm/data/${distroid}-${distroversioncsv}.csv" 1> /dev/null
fi
if [ $? != "0" ]; then
exitcode=$?
if [ "${exitcode}" -ne 0 ]; then
fn_print_fail_eol_nl
fn_script_log_fail "Checking ${remotereponame} ${distroid}-${distroversioncsv}.csv"
fn_script_log_fail "Curl returned error: $?"
fn_script_log_fail "Curl returned error: ${exitcode}"
core_exit.sh
fi
@ -179,11 +185,11 @@ if [ -f "${datadir}/${distroid}-${distroversioncsv}.csv" ]; then
if [ "${config_file_diff}" != "" ]; then
fn_print_update_eol_nl
fn_script_log_update "Checking ${remotereponame} ${distroid}-${distroversioncsv}.csv"
fn_script_log "Checking ${remotereponame} ${distroid}-${distroversioncsv}.csv"
rm -f "${datadir:?}/${distroid}-${distroversioncsv}.csv"
fn_fetch_file_github "lgsm/data" "${distroid}-${distroversioncsv}.csv" "${datadir}" "nochmodx" "norun" "noforce" "nohash"
fn_fetch_file_github "${datadir}" "${distroid}-${distroversioncsv}.csv" "${datadir}" "nochmodx" "norun" "noforce" "nohash"
else
fn_print_ok_eol_nl
fn_print_skip_eol_nl
fn_script_log_pass "Checking ${remotereponame} ${distroid}-${distroversioncsv}.csv"
fi
fi
@ -195,14 +201,15 @@ if [ -n "${modulesdir}" ]; then
for modulefile in *; do
# check if module exists in the repo and remove if missing.
# commonly used if module names change.
echo -en "checking ${remotereponame} module ${modulefile}...\c"
echo -en "checking ${remotereponame} module [ ${italic}${modulefile}${default} ]\c"
github_file_url_dir="lgsm/modules"
if [ "${remotereponame}" == "GitHub" ]; then
curl ${nocache} --connect-timeout 3 -IsfL "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${modulefile}" 1> /dev/null
else
curl ${nocache} --connect-timeout 3 -IsfL "https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/${github_file_url_dir}/${modulefile}" 1> /dev/null
fi
if [ $? != 0 ]; then
exitcode=$?
if [ "${exitcode}" -ne 0 ]; then
fn_print_error_eol_nl
fn_script_log_error "Checking ${remotereponame} module ${modulefile}"
echo -en "removing module ${modulefile}...\c"
@ -225,11 +232,11 @@ if [ -n "${modulesdir}" ]; then
# results
if [ "${module_file_diff}" != "" ]; then
fn_print_update_eol_nl
fn_script_log_update "Checking ${remotereponame} module ${modulefile}"
fn_script_log "Checking ${remotereponame} module ${modulefile}"
rm -rf "${modulesdir:?}/${modulefile}"
fn_update_module
else
fn_print_ok_eol_nl
fn_print_skip_eol_nl
fn_script_log_pass "Checking ${remotereponame} module ${modulefile}"
fi
fi

6
lgsm/modules/command_validate.sh

@ -11,18 +11,18 @@ moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
fn_firstcommand_set
fn_validate() {
fn_print_warn "Validate might overwrite some customised files"
fn_print_warn ": SteamCMD: Validate might overwrite some customised files"
fn_script_log_warn "${commandaction} server: Validate might overwrite some customised files"
totalseconds=3
for seconds in {3..1}; do
fn_print_warn "Validate might overwrite some customised files: ${totalseconds}"
fn_print_warn ": SteamCMD: Validate might overwrite some customised files: ${totalseconds}"
totalseconds=$((totalseconds - 1))
fn_sleep_time_1
if [ "${seconds}" == "0" ]; then
break
fi
done
fn_print_warn_nl "Validate might overwrite some customised files"
fn_print_warn_nl ": SteamCMD: Validate might overwrite some customised files"
date '+%s' > "${lockdir:?}/update.lock"
fn_dl_steamcmd
}

31
lgsm/modules/command_wipe.sh

@ -13,7 +13,7 @@ fn_firstcommand_set
# Provides an exit code upon error.
fn_wipe_exit_code() {
exitcode=$?
if [ "${exitcode}" != 0 ]; then
if [ "${exitcode}" -ne 0 ]; then
fn_print_fail_eol_nl
core_exit.sh
else
@ -29,14 +29,14 @@ fn_wipe_files() {
# Remove Map files
if [ -n "${serverwipe}" ] || [ -n "${mapwipe}" ]; then
if [ -n "$(find "${serveridentitydir}" -type f -name "*.map")" ]; then
echo -en "removing .map file(s)..."
fn_print "removing .map file(s)..."
fn_script_log_info "Removing *.map file(s)"
fn_sleep_time
find "${serveridentitydir:?}" -type f -name "*.map" -printf "%f\n" >> "${lgsmlog}"
find "${serveridentitydir:?}" -type f -name "*.map" -delete | tee -a "${lgsmlog}"
fn_wipe_exit_code
else
echo -e "no .map file(s) to remove"
fn_print_nl "no .map file(s) to remove"
fn_sleep_time
fn_script_log_pass "no .map file(s) to remove"
fi
@ -44,14 +44,14 @@ fn_wipe_files() {
# Remove Save files.
if [ -n "${serverwipe}" ] || [ -n "${mapwipe}" ]; then
if [ -n "$(find "${serveridentitydir}" -type f -name "*.sav*")" ]; then
echo -en "removing .sav file(s)..."
fn_print "removing .sav file(s)..."
fn_script_log_info "Removing .sav file(s)"
fn_sleep_time
find "${serveridentitydir:?}" -type f -name "*.sav*" -printf "%f\n" >> "${lgsmlog}"
find "${serveridentitydir:?}" -type f -name "*.sav*" -delete
fn_wipe_exit_code
else
echo -e "no .sav file(s) to remove"
fn_print_nl "no .sav file(s) to remove"
fn_script_log_pass "no .sav file(s) to remove"
fn_sleep_time
fi
@ -60,14 +60,14 @@ fn_wipe_files() {
# Excluding player.tokens.db for Rust+.
if [ -n "${serverwipe}" ]; then
if [ -n "$(find "${serveridentitydir}" -type f ! -name 'player.tokens.db' -name "*.db")" ]; then
echo -en "removing .db file(s)..."
fn_print "removing .db file(s)..."
fn_script_log_info "Removing .db file(s)"
fn_sleep_time
find "${serveridentitydir:?}" -type f ! -name 'player.tokens.db' -name "*.db" -printf "%f\n" >> "${lgsmlog}"
find "${serveridentitydir:?}" -type f ! -name 'player.tokens.db' -name "*.db" -delete
fn_wipe_exit_code
else
echo -e "no .db file(s) to remove"
fn_print_nl "no .db file(s) to remove"
fn_sleep_time
fn_script_log_pass "no .db file(s) to remove"
fi
@ -104,13 +104,13 @@ fn_full_wipe_warning() {
fn_print_warn_nl "Server wipe will reset the map data and remove blueprint data"
}
# Will change the seed if the seed is not defined by the user.
# If the seed is not defined by the user, generate a seed file.
fn_wipe_random_seed() {
if [ -f "${datadir}/${selfname}-seed.txt" ] && [ -n "${randomseed}" ]; then
shuf -i 1-2147483647 -n 1 > "${datadir}/${selfname}-seed.txt"
seed=$(cat "${datadir}/${selfname}-seed.txt")
randomseed=1
echo -en "generating new random seed (${cyan}${seed}${default})..."
fn_print "generating new random seed (${cyan}${seed}${default})..."
fn_script_log_pass "Generating new random seed (${cyan}${seed}${default})"
fn_sleep_time
fn_print_ok_eol_nl
@ -120,21 +120,21 @@ fn_wipe_random_seed() {
# A summary of what wipe is going to do.
fn_wipe_details() {
fn_print_information_nl "Wipe does not remove Rust+ data."
echo -en "* Wipe map data: "
fn_print "* Wipe map data "
if [ -n "${serverwipe}" ] || [ -n "${mapwipe}" ]; then
fn_print_yes_eol_nl
else
fn_print_no_eol_nl
fi
echo -en "* Wipe blueprint data: "
fn_print "* Wipe blueprint data "
if [ -n "${serverwipe}" ]; then
fn_print_yes_eol_nl
else
fn_print_no_eol_nl
fi
echo -en "* Change Procedural Map seed: "
fn_print "* Change Procedural Map seed "
if [ -n "${randomseed}" ]; then
fn_print_yes_eol_nl
else
@ -142,10 +142,9 @@ fn_wipe_details() {
fi
}
fn_print_dots ""
check.sh
fix_rust.sh
fn_print_dots ""
# Check if there is something to wipe.
if [ -n "$(find "${serveridentitydir}" -type f -name "*.map")" ] || [ -n "$(find "${serveridentitydir}" -type f -name "*.sav*")" ] && [ -n "$(find "${serveridentitydir}" -type f ! -name 'player.tokens.db' -name "*.db")" ]; then
if [ -n "${serverwipe}" ]; then
@ -165,7 +164,7 @@ if [ -n "$(find "${serveridentitydir}" -type f -name "*.map")" ] || [ -n "$(find
fn_firstcommand_reset
fn_wipe_files
fn_wipe_random_seed
fn_print_complete_nl "${wipetype}"
fn_print_success_nl "${wipetype}"
fn_script_log_pass "${wipetype}"
alert="wipe"
alert.sh
@ -175,7 +174,7 @@ if [ -n "$(find "${serveridentitydir}" -type f -name "*.map")" ] || [ -n "$(find
else
fn_wipe_files
fn_wipe_random_seed
fn_print_complete_nl "${wipetype}"
fn_print_success_nl "${wipetype}"
fn_script_log_pass "${wipetype}"
alert="wipe"
alert.sh

2
lgsm/modules/compress_unreal2_maps.sh

@ -6,7 +6,7 @@
# Description: Compresses unreal maps.
commandname="MAP-COMPRESSOR"
commandaction="Compressing maps"
commandaction="Compressing Maps"
moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
fn_firstcommand_set

2
lgsm/modules/compress_ut99_maps.sh

@ -6,7 +6,7 @@
# Description: Compresses unreal maps.
commandname="MAP-COMPRESSOR"
commandaction="Compressing maps"
commandaction="Compressing Maps"
moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
fn_firstcommand_set

49
lgsm/modules/core_dl.sh

@ -20,6 +20,7 @@
moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
fn_dl_steamcmd() {
remotelocation="SteamCMD"
fn_print_start_nl "${remotelocation}"
fn_script_log_info "${commandaction} ${selfname}: ${remotelocation}"
if [ -n "${branch}" ]; then
@ -53,7 +54,7 @@ fn_dl_steamcmd() {
rm -f "${steamcmdlog:?}"
fi
counter=0
while [ "${counter}" == "0" ] || [ "${exitcode}" != "0" ]; do
while [ "${counter}" -eq 0 ] || [ "${exitcode}" -ne 0 ]; do
counter=$((counter + 1))
# Select SteamCMD parameters
# If GoldSrc (appid 90) servers. GoldSrc (appid 90) require extra commands.
@ -127,16 +128,19 @@ fn_dl_steamcmd() {
elif [ -n "$(grep "0x626" "${steamcmdlog}" | tail -1)" ] || [ -n "$(grep "0x626" "${steamcmdlog}" | tail -1)" ]; then
fn_print_error2_nl "${commandaction} ${selfname}: ${remotelocation}: Missing update files"
fn_script_log_error "${commandaction} ${selfname}: ${remotelocation}: Missing update files"
elif [ -n "$(grep "0x6A6" "${steamcmdlog}" | tail -1)" ]; then
fn_print_error2_nl "${commandaction} ${selfname}: ${remotelocation}: Corrupt update files"
fn_script_log_error "${commandaction} ${selfname}: ${remotelocation}: Corrupt update files"
else
fn_print_error2_nl "${commandaction} ${selfname}: ${remotelocation}: Unknown error occured"
echo -en "Please provide content log to LinuxGSM developers https://linuxgsm.com/steamcmd-error"
fn_print_nl "Please provide content log to LinuxGSM developers https://linuxgsm.com/steamcmd-error"
fn_script_log_error "${commandaction} ${selfname}: ${remotelocation}: Unknown error occured"
fi
elif [ "${exitcode}" != 0 ]; then
elif [ "${exitcode}" -ne 0 ]; then
fn_print_error2_nl "${commandaction} ${selfname}: ${remotelocation}: Exit code: ${exitcode}"
fn_script_log_error "${commandaction} ${selfname}: ${remotelocation}: Exit code: ${exitcode}"
else
fn_print_complete_nl "${commandaction} ${selfname}: ${remotelocation}"
fn_print_success_nl "${commandaction} ${selfname}: ${remotelocation}"
fn_script_log_pass "${commandaction} ${selfname}: ${remotelocation}"
fi
@ -150,16 +154,16 @@ fn_dl_steamcmd() {
# Emptys contents of the LinuxGSM tmpdir.
fn_clear_tmp() {
echo -en "clearing LinuxGSM tmp directory..."
echo -en "clearing tmp directory [ ${italic}${tmpdir}${default} ]"
if [ -d "${tmpdir}" ]; then
rm -rf "${tmpdir:?}/"*
local exitcode=$?
if [ "${exitcode}" != 0 ]; then
exitcode=$?
if [ "${exitcode}" -ne 0 ]; then
fn_print_error_eol_nl
fn_script_log_error "clearing LinuxGSM tmp directory"
fn_script_log_error "clearing tmp directory ${tmpdir}"
else
fn_print_ok_eol_nl
fn_script_log_pass "clearing LinuxGSM tmp directory"
fn_script_log_pass "clearing tmp directory ${tmpdir}"
fi
fi
}
@ -259,8 +263,8 @@ fn_dl_extract() {
extractcmd=$(unzip -qo -d "${extractdest}" "${local_filedir}/${local_filename}")
fi
fi
local exitcode=$?
if [ "${exitcode}" != 0 ]; then
exitcode=$?
if [ "${exitcode}" -ne 0 ]; then
fn_print_fail_eol_nl
fn_script_log_fail "Extracting ${local_filename}"
if [ -f "${lgsmlog}" ]; then
@ -277,11 +281,11 @@ fn_dl_extract() {
# Trap to remove file download if canceled before completed.
fn_fetch_trap() {
echo -e ""
echo -en "downloading ${local_filename}..."
echo -en "downloading ${local_filename}"
fn_print_canceled_eol_nl
fn_script_log_info "Downloading ${local_filename}...CANCELED"
rm -f "${local_filedir:?}/${local_filename}"
echo -en "downloading ${local_filename}..."
echo -en "downloading ${local_filename}"
fn_print_removed_eol_nl
fn_script_log_info "Downloading ${local_filename}...REMOVED"
core_exit.sh
@ -313,12 +317,12 @@ fn_check_file() {
fileurl_name="${remote_fileurl_backup_name}"
fi
counter=$((counter + 1))
echo -en "checking ${fileurl_name} ${remote_filename}...\c"
echo -e "checking ${fileurl_name} ${remote_filename}\c"
curlcmd=$(curl --output /dev/null --silent --head --fail "${fileurl}" 2>&1)
local exitcode=$?
exitcode=$?
# On first try will error. On second try will fail.
if [ "${exitcode}" != 0 ]; then
if [ "${exitcode}" -ne 0 ]; then
if [ ${counter} -ge 2 ]; then
fn_print_fail_eol_nl
if [ -f "${lgsmlog}" ]; then
@ -379,6 +383,7 @@ fn_fetch_file() {
counter=1
remote_fileurls_array=(remote_fileurl)
fi
for remote_fileurl_array in "${remote_fileurls_array[@]}"; do
if [ "${remote_fileurl_array}" == "remote_fileurl" ]; then
fileurl="${remote_fileurl}"
@ -399,15 +404,15 @@ fn_fetch_file() {
local exitcode=""
large_files=("bz2" "gz" "zip" "jar" "xz")
if grep -qE "(^|\s)${local_filename##*.}(\s|$)" <<< "${large_files[@]}"; then
echo -en "downloading ${local_filename}..."
echo -e "downloading file [ ${italic}${local_filename}${default} ]"
fn_sleep_time
echo -en "\033[1K"
"${curlcmd[@]}" --progress-bar "${fileurl}" 2>&1
exitcode="$?"
exitcode=$?
echo -en "downloading file [ ${italic}${local_filename}${default} ]"
else
echo -en "fetching ${fileurl_name} ${local_filename}...\c"
echo -en "fetching ${fileurl_name} [ ${italic}${local_filename}${default} ]\c"
"${curlcmd[@]}" --silent --show-error "${fileurl}" 2>&1
exitcode="$?"
exitcode=$?
fi
# Download will fail if downloads a html file.
@ -419,7 +424,7 @@ fn_fetch_file() {
fi
# On first try will error. On second try will fail.
if [ "${exitcode}" != 0 ]; then
if [ "${exitcode}" -ne 0 ]; then
if [ ${counter} -ge 2 ]; then
fn_print_fail_eol_nl
if [ -f "${lgsmlog}" ]; then

10
lgsm/modules/core_exit.sh

@ -27,14 +27,14 @@ fi
if [ "${exitbypass}" ]; then
unset exitbypass
elif [ "${exitcode}" != "0" ]; then
elif [ "${exitcode}" -ne 0 ]; then
# List LinuxGSM version in logs
fn_script_log_info "LinuxGSM version: ${version}"
if [ "${exitcode}" == "1" ]; then
if [ "${exitcode}" -eq 1 ]; then
fn_script_log_fail "${moduleselfname} exiting with code: ${exitcode}"
elif [ "${exitcode}" == "2" ]; then
elif [ "${exitcode}" -eq 2 ]; then
fn_script_log_error "${moduleselfname} exiting with code: ${exitcode}"
elif [ "${exitcode}" == "3" ]; then
elif [ "${exitcode}" -eq 3 ]; then
fn_script_log_warn "${moduleselfname} exiting with code: ${exitcode}"
else
# if exit code is not set assume error.
@ -45,7 +45,7 @@ elif [ "${exitcode}" != "0" ]; then
# remove trap.
trap - INT
exit "${exitcode}"
elif [ "${exitcode}" ] && [ "${exitcode}" == "0" ]; then
elif [ "${exitcode}" ] && [ "${exitcode}" -eq 0 ]; then
# List LinuxGSM version in logs
fn_script_log_info "LinuxGSM version: ${version}"
fn_script_log_pass "${moduleselfname} exiting with code: ${exitcode}"

17
lgsm/modules/core_getopt.sh

@ -56,6 +56,7 @@ cmd_dev_detect_deps=("dd;detect-deps" "command_dev_detect_deps.sh" "Detect requi
cmd_dev_detect_glibc=("dg;detect-glibc" "command_dev_detect_glibc.sh" "Detect required glibc.")
cmd_dev_detect_ldd=("dl;detect-ldd" "command_dev_detect_ldd.sh" "Detect required dynamic dependencies.")
cmd_dev_query_raw=("qr;query-raw" "command_dev_query_raw.sh" "The raw output of gamedig and gsquery.")
cmd_dev_ui=("ui;ui" "command_dev_ui.sh" "Assist with UI development.")
cmd_dev_clear_modules=("cm;clear-modules" "command_dev_clear_modules.sh" "Delete the contents of the modules dir.")
### Set specific opt here.
@ -147,7 +148,7 @@ currentopt+=("${cmd_install[@]}" "${cmd_auto_install[@]}")
## Developer commands.
currentopt+=("${cmd_dev_debug[@]}")
if [ -f ".dev-debug" ]; then
currentopt+=("${cmd_dev_parse_game_details[@]}" "${cmd_dev_parse_distro_details[@]}" "${cmd_dev_detect_deps[@]}" "${cmd_dev_detect_glibc[@]}" "${cmd_dev_detect_ldd[@]}" "${cmd_dev_query_raw[@]}" "${cmd_dev_clear_modules[@]}")
currentopt+=("${cmd_dev_parse_game_details[@]}" "${cmd_dev_parse_distro_details[@]}" "${cmd_dev_detect_deps[@]}" "${cmd_dev_detect_glibc[@]}" "${cmd_dev_detect_ldd[@]}" "${cmd_dev_query_raw[@]}" "${cmd_dev_ui[@]}" "${cmd_dev_clear_modules[@]}")
fi
## Sponsor.
@ -165,19 +166,19 @@ done
# Shows LinuxGSM usage.
fn_opt_usage() {
echo -e "Usage: $0 [option]"
echo -e ""
echo -e "LinuxGSM - ${gamename} - Version ${version}"
echo -e "https://linuxgsm.com/${gameservername}"
echo -e ""
echo -e "${lightyellow}Commands${default}"
fn_print_nl "Usage: $0 [option]"
fn_print_nl ""
fn_print_nl "LinuxGSM - ${gamename} - Version ${version}"
fn_print_nl "https://linuxgsm.com/${gameservername}"
fn_print_nl ""
fn_print_nl "${bold}${lightyellow}Commands${default}"
# Display available commands.
index="0"
{
for ((index = "0"; index < ${#currentopt[@]}; index += 3)); do
# Hide developer commands.
if [ "${currentopt[index + 2]}" != "DEVCOMMAND" ]; then
echo -e "${cyan}$(echo -e "${currentopt[index]}" | awk -F ';' '{ print $2 }')\t${default}$(echo -e "${currentopt[index]}" | awk -F ';' '{ print $1 }')\t| ${currentopt[index + 2]}"
fn_print_nl "${cyan}$(echo -e "${currentopt[index]}" | awk -F ';' '{ print $2 }')\t${default}$(echo -e "${currentopt[index]}" | awk -F ';' '{ print $1 }')\t| ${currentopt[index + 2]}"
fi
done
} | column -s $'\t' -t

6
lgsm/modules/core_legacy.sh

@ -35,6 +35,12 @@ if [ -n "${autosaveinterval}" ]; then
saveinterval="${autosaveinterval}"
fi
if [ "${shortname}" == "st" ]; then
if [ -n "${worldname}" ]; then
worldsave="${worldname}"
fi
fi
# Added as part of migrating functions dir to modules dir.
# Will remove functions dir if files in modules dir older than 14 days
functionsdir="${lgsmdir}/modules"

306
lgsm/modules/core_messages.sh

@ -34,6 +34,14 @@ fn_ansi_loader() {
# erase to end of line.
creeol+="\033[K"
fi
# carriage return & erase to end of line.
creeol="\r\033[K"
bold="\e[1m"
dim="\e[2m"
italic="\e[3m"
underline="\e[4m"
reverse="\e[7m"
}
fn_sleep_time() {
@ -71,216 +79,141 @@ fn_script_log() {
## Feb 28 14:56:58 ut99-server: Monitor: PASS:
fn_script_log_pass() {
if [ -d "${lgsmlogdir}" ]; then
if [ -n "${commandname}" ]; then
echo -e "$(date '+%b %d %H:%M:%S.%3N') ${selfname}: ${commandname}: PASS: ${1}" >> "${lgsmlog}"
else
echo -e "$(date '+%b %d %H:%M:%S.%3N') ${selfname}: PASS: ${1}" >> "${lgsmlog}"
fi
fi
fn_script_log "PASS: ${1}"
exitcode=0
}
## Feb 28 14:56:58 ut99-server: Monitor: FATAL:
fn_script_log_fail() {
if [ -d "${lgsmlogdir}" ]; then
if [ -n "${commandname}" ]; then
echo -e "$(date '+%b %d %H:%M:%S.%3N') ${selfname}: ${commandname}: FATAL: ${1}" >> "${lgsmlog}"
else
echo -e "$(date '+%b %d %H:%M:%S.%3N') ${selfname}: FATAL: ${1}" >> "${lgsmlog}"
fi
fi
fn_script_log "FAIL: ${1}"
exitcode=1
}
## Feb 28 14:56:58 ut99-server: Monitor: ERROR:
fn_script_log_error() {
if [ -d "${lgsmlogdir}" ]; then
if [ -n "${commandname}" ]; then
echo -e "$(date '+%b %d %H:%M:%S.%3N') ${selfname}: ${commandname}: ERROR: ${1}" >> "${lgsmlog}"
else
echo -e "$(date '+%b %d %H:%M:%S.%3N') ${selfname}: ERROR: ${1}" >> "${lgsmlog}"
fi
fi
fn_script_log "ERROR: ${1}"
exitcode=2
}
## Feb 28 14:56:58 ut99-server: Monitor: WARN:
fn_script_log_warn() {
if [ -d "${lgsmlogdir}" ]; then
if [ -n "${commandname}" ]; then
echo -e "$(date '+%b %d %H:%M:%S.%3N') ${selfname}: ${commandname}: WARN: ${1}" >> "${lgsmlog}"
else
echo -e "$(date '+%b %d %H:%M:%S.%3N') ${selfname}: WARN: ${1}" >> "${lgsmlog}"
fi
fi
fn_script_log "WARN: ${1}"
exitcode=3
}
## Feb 28 14:56:58 ut99-server: Monitor: INFO:
fn_script_log_info() {
if [ -d "${lgsmlogdir}" ]; then
if [ -n "${commandname}" ]; then
echo -e "$(date '+%b %d %H:%M:%S.%3N') ${selfname}: ${commandname}: INFO: ${1}" >> "${lgsmlog}"
else
echo -e "$(date '+%b %d %H:%M:%S.%3N') ${selfname}: INFO: ${1}" >> "${lgsmlog}"
fi
fi
}
## Feb 28 14:56:58 ut99-server: Monitor: UPDATE:
fn_script_log_update() {
if [ -d "${lgsmlogdir}" ]; then
if [ -n "${commandname}" ]; then
echo -e "$(date '+%b %d %H:%M:%S.%3N') ${selfname}: ${commandname}: UPDATE: ${1}" >> "${lgsmlog}"
else
echo -e "$(date '+%b %d %H:%M:%S.%3N') ${selfname}: UPDATE: ${1}" >> "${lgsmlog}"
fi
fi
fn_script_log "INFO: ${1}"
}
# On-Screen - Automated functions
##################################
# [ .... ]
fn_print_dots() {
fn_print() {
echo -en "$*${default}"
}
fn_print_nl() {
echo -e "$*${default}"
}
# Helper function to print messages with a specific format and color
fn_print_message() {
local type="$1"
local color="$2"
local message="$3"
if [ "${commandaction}" ]; then
echo -en "${creeol}[ .... ] ${commandaction} ${selfname}: $*"
echo -en "${bold}${creeol}[${color} ${type} ${default}]${default} ${commandaction} ${selfname}: ${message}${default}"
else
echo -en "${creeol}[ .... ] $*"
echo -en "${bold}${cree}[${color} ${type} ${default}]${default} ${message}${default}"
fi
fn_sleep_time_05
fn_sleep_time
}
fn_print_dots_nl() {
fn_print_message_nl() {
local type="$1"
local color="$2"
local message="$3"
if [ "${commandaction}" ]; then
echo -e "${creeol}[ .... ] ${commandaction} ${selfname}: $*"
echo -e "${bold}${creeol}[${color} ${type} ${default}]${default} ${commandaction} ${selfname}: ${message}${default}"
else
echo -e "${creeol}[ .... ] $*"
echo -e "${bold}${creeol}[${color} ${type} ${default}]${default} ${message}${default}"
fi
fn_sleep_time
}
# [ .... ]
fn_print_dots() {
fn_print_message "...." "${default}" "$*"
fn_sleep_time_05
}
fn_print_dots_nl() {
fn_print_message_nl "...." "${default}" "$*"
fn_sleep_time_05
echo -en "\n"
}
# [ OK ]
fn_print_ok() {
if [ "${commandaction}" ]; then
echo -en "${creeol}[${green} OK ${default}] ${commandaction} ${selfname}: $*"
else
echo -en "${creeol}[${green} OK ${default}] $*"
fi
fn_sleep_time
fn_print_message " OK " "${green}" "$*"
}
fn_print_ok_nl() {
if [ "${commandaction}" ]; then
echo -en "${creeol}[${green} OK ${default}] ${commandaction} ${selfname}: $*"
else
echo -en "${creeol}[${green} OK ${default}] $*"
fi
fn_sleep_time
echo -en "\n"
fn_print_message_nl " OK " "${green}" "$*"
}
# [ FAIL ]
fn_print_fail() {
if [ "${commandaction}" ]; then
echo -en "${creeol}[${red} FAIL ${default}] ${commandaction} ${selfname}: $*"
else
echo -en "${creeol}[${red} FAIL ${default}] $*"
fi
fn_sleep_time
fn_print_message "FAIL" "${red}" "$*"
}
fn_print_fail_nl() {
if [ "${commandaction}" ]; then
echo -en "${creeol}[${red} FAIL ${default}] ${commandaction} ${selfname}: $*"
else
echo -en "${creeol}[${red} FAIL ${default}] $*"
fi
fn_sleep_time
echo -en "\n"
fn_print_message_nl "FAIL" "${red}" "$*"
}
# [ ERROR ]
fn_print_error() {
if [ "${commandaction}" ]; then
echo -en "${creeol}[${red} ERROR ${default}] ${commandaction} ${selfname}: $*"
else
echo -en "${creeol}[${red} ERROR ${default}] $*"
fi
fn_sleep_time
fn_print_message "ERROR" "${red}" "$*"
}
fn_print_error_nl() {
if [ "${commandaction}" ]; then
echo -en "${creeol}[${red} ERROR ${default}] ${commandaction} ${selfname}: $*"
else
echo -en "${creeol}[${red} ERROR ${default}] $*"
fi
fn_sleep_time
echo -en "\n"
fn_print_message_nl "ERROR" "${red}" "$*"
}
# [ WARN ]
fn_print_warn() {
if [ "${commandaction}" ]; then
echo -en "${creeol}[${lightyellow} WARN ${default}] ${commandaction} ${selfname}: $*"
else
echo -en "${creeol}[${lightyellow} WARN ${default}] $*"
fi
fn_sleep_time
fn_print_message "WARN" "${lightyellow}" "$*"
}
fn_print_warn_nl() {
if [ "${commandaction}" ]; then
echo -en "${creeol}[${lightyellow} WARN ${default}] ${commandaction} ${selfname}: $*"
else
echo -en "${creeol}[${lightyellow} WARN ${default}] $*"
fi
fn_sleep_time
echo -en "\n"
fn_print_message_nl "WARN" "${lightyellow}" "$*"
}
# [ INFO ]
fn_print_info() {
if [ "${commandaction}" ]; then
echo -en "${creeol}[${cyan} INFO ${default}] ${commandaction} ${selfname}: $*"
else
echo -en "${creeol}[${cyan} INFO ${default}] $*"
fi
fn_sleep_time
fn_print_message "INFO" "${cyan}" "$*"
}
fn_print_info_nl() {
if [ "${commandaction}" ]; then
echo -en "${creeol}[${cyan} INFO ${default}] ${commandaction} ${selfname}: $*"
else
echo -en "${creeol}[${cyan} INFO ${default}] $*"
fi
fn_sleep_time
echo -en "\n"
fn_print_message_nl "INFO" "${cyan}" "$*"
}
# [ SKIP ]
fn_print_skip() {
fn_print_message "SKIP" "${cyan}" "$*"
}
fn_print_skip_nl() {
fn_print_message_nl "SKIP" "${cyan}" "$*"
}
# [ START ]
fn_print_start() {
if [ "${commandaction}" ]; then
echo -en "${creeol}[${lightgreen} START ${default}] ${commandaction} ${selfname}: $*"
else
echo -en "${creeol}[${lightgreen} START ${default}] $*"
fi
fn_sleep_time
fn_print_message "START" "${lightgreen}" "$*"
}
fn_print_start_nl() {
if [ "${commandaction}" ]; then
echo -en "${creeol}[${lightgreen} START ${default}] ${commandaction} ${selfname}: $*"
else
echo -en "${creeol}[${lightgreen} START ${default}] $*"
fi
fn_sleep_time
echo -en "\n"
fn_print_message_nl "START" "${lightgreen}" "$*"
}
# On-Screen - Interactive messages
@ -304,63 +237,75 @@ fn_print_header() {
fn_messages_separator
}
# Complete!
fn_print_complete() {
echo -en "${green}Complete!${default} $*"
# Success!
fn_print_success() {
echo -en "${green}Success!${default} $*${default}"
fn_sleep_time
}
fn_print_complete_nl() {
echo -e "${green}Complete!${default} $*"
fn_print_success_nl() {
echo -e "${green}Success!${default} $*${default}"
fn_sleep_time
}
# Failure!
fn_print_failure() {
echo -en "${red}Failure!${default} $*"
echo -en "${red}Failure!${default} $*${default}"
fn_sleep_time
}
fn_print_failure_nl() {
echo -e "${red}Failure!${default} $*"
echo -e "${red}Failure!${default} $*${default}"
fn_sleep_time
}
# Error!
fn_print_error2() {
echo -en "${red}Error!${default} $*"
echo -en "${red}Error!${default} $*${default}"
fn_sleep_time
}
fn_print_error2_nl() {
echo -e "${red}Error!${default} $*"
echo -e "${red}Error!${default} $*${default}"
fn_sleep_time
}
# Warning!
fn_print_warning() {
echo -en "${lightyellow}Warning!${default} $*"
echo -en "${lightyellow}Warning!${default} $*${default}"
fn_sleep_time
}
fn_print_warning_nl() {
echo -e "${lightyellow}Warning!${default} $*"
echo -e "${lightyellow}Warning!${default} $*${default}"
fn_sleep_time
}
# Information!
fn_print_information() {
echo -en "${cyan}Information!${default} $*"
echo -en "${cyan}Information!${default} $*${default}"
fn_sleep_time
}
fn_print_information_nl() {
echo -e "${cyan}Information!${default} $*"
echo -e "${cyan}Information!${default} $*${default}"
fn_sleep_time
}
# Skip!
fn_print_skip2() {
echo -en "${cyan}Skip!${default} $*${default}"
fn_sleep_time
}
fn_print_skip2_nl() {
echo -e "${cyan}Skip!${default} $*${default}"
fn_sleep_time
}
# Y/N Prompt
fn_prompt_yn() {
echo -e ""
local prompt="$1"
local initial="$2"
@ -400,155 +345,166 @@ fn_prompt_message() {
# YES
fn_print_yes_eol() {
echo -en "${cyan}YES${default}"
echo -en " ... ${cyan}YES${default}"
fn_sleep_time
}
fn_print_yes_eol_nl() {
echo -e "${cyan}YES${default}"
echo -e " ... ${cyan}YES${default}"
fn_sleep_time
}
# NO
fn_print_no_eol() {
echo -en "${red}NO${default}"
echo -en " ... ${red}NO${default}"
fn_sleep_time
}
fn_print_no_eol_nl() {
echo -e "${red}NO${default}"
echo -e " ... ${red}NO${default}"
fn_sleep_time
}
# OK
fn_print_ok_eol() {
echo -en "${green}OK${default}"
echo -en " ... ${green}OK${default}"
fn_sleep_time
}
fn_print_ok_eol_nl() {
echo -e "${green}OK${default}"
echo -e " ... ${green}OK${default}"
fn_sleep_time
}
# FAIL
fn_print_fail_eol() {
echo -en "${red}FAIL${default}"
echo -en " ... ${red}FAIL${default}"
fn_sleep_time
}
fn_print_fail_eol_nl() {
echo -e "${red}FAIL${default}"
echo -e " ... ${red}FAIL${default}"
fn_sleep_time
}
# ERROR
fn_print_error_eol() {
echo -en "${red}ERROR${default}"
echo -en " ... ${red}ERROR${default}"
fn_sleep_time
}
fn_print_error_eol_nl() {
echo -e "${red}ERROR${default}"
echo -e " ... ${red}ERROR${default}"
fn_sleep_time
}
# WAIT
fn_print_wait_eol() {
echo -en "${cyan}WAIT${default}"
echo -en " ... ${cyan}WAIT${default}"
fn_sleep_time
}
fn_print_wait_eol_nl() {
echo -e "${cyan}WAIT${default}"
echo -e " ... ${cyan}WAIT${default}"
fn_sleep_time
}
# WARN
fn_print_warn_eol() {
echo -en "${lightyellow}WARN${default}"
echo -en " ... ${lightyellow}WARN${default}"
fn_sleep_time
}
fn_print_warn_eol_nl() {
echo -e "${lightyellow}WARN${default}"
echo -e " ... ${lightyellow}WARN${default}"
fn_sleep_time
}
# INFO
fn_print_info_eol() {
echo -en "${cyan}INFO${default}"
echo -en " ... ${cyan}INFO${default}"
fn_sleep_time
}
fn_print_info_eol_nl() {
echo -e "${cyan}INFO${default}"
echo -e " ... ${cyan}INFO${default}"
fn_sleep_time
}
# QUERYING
fn_print_querying_eol() {
echo -en "${cyan}QUERYING${default}"
echo -en " ... ${cyan}QUERYING${default}"
fn_sleep_time_1
}
fn_print_querying_eol_nl() {
echo -e "${cyan}QUERYING${default}"
echo -e " ... ${cyan}QUERYING${default}"
fn_sleep_time_1
}
# CHECKING
fn_print_checking_eol() {
echo -en "${cyan}CHECKING${default}"
echo -en " ... ${cyan}CHECKING${default}"
fn_sleep_time_1
}
fn_print_checking_eol_nl() {
echo -e "${cyan}CHECKING${default}"
echo -e " ... ${cyan}CHECKING${default}"
fn_sleep_time_1
}
# DELAY
fn_print_delay_eol() {
echo -en "${green}DELAY${default}"
echo -en " ... ${green}DELAY${default}"
fn_sleep_time_1
}
fn_print_delay_eol_nl() {
echo -e "${green}DELAY${default}"
echo -e " ... ${green}DELAY${default}"
fn_sleep_time_1
}
# CANCELED
fn_print_canceled_eol() {
echo -en "${lightyellow}CANCELED${default}"
echo -en " ... ${lightyellow}CANCELED${default}"
fn_sleep_time_1
}
fn_print_canceled_eol_nl() {
echo -e "${lightyellow}CANCELED${default}"
echo -e " ... ${lightyellow}CANCELED${default}"
fn_sleep_time_1
}
# REMOVED
fn_print_removed_eol() {
echo -en "${red}REMOVED${default}"
echo -en " ... ${red}REMOVED${default}"
fn_sleep_time_1
}
fn_print_removed_eol_nl() {
echo -e "${red}REMOVED${default}"
echo -e " ... ${red}REMOVED${default}"
fn_sleep_time_1
}
# UPDATE
fn_print_update_eol() {
echo -en "${cyan}UPDATE${default}"
echo -en " ... ${lightblue}UPDATE${default}"
fn_sleep_time
}
fn_print_update_eol_nl() {
echo -e "${cyan}UPDATE${default}"
echo -e " ... ${lightblue}UPDATE${default}"
fn_sleep_time
}
# SKIP
fn_print_skip_eol() {
echo -en " ... ${cyan}SKIP${default}"
fn_sleep_time
}
fn_print_skip_eol_nl() {
echo -e " ... ${cyan}SKIP${default}"
fn_sleep_time
}

12
lgsm/modules/core_modules.sh

@ -8,7 +8,7 @@
moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
modulesversion="v24.3.4"
modulesversion="v25.1.0"
# Core
@ -42,6 +42,11 @@ core_legacy.sh() {
core_exit.sh() {
modulefile="${FUNCNAME[0]}"
fn_fetch_module
exitcode=$?
if [ "${exitcode}" -ne 0 ]; then
echo "fn_fetch_module failed, using fn_bootstrap_fetch_module instead."
fn_bootstrap_fetch_module
fi
}
core_getopt.sh() {
@ -324,6 +329,11 @@ command_dev_detect_ldd.sh() {
fn_fetch_module
}
command_dev_ui.sh() {
modulefile="${FUNCNAME[0]}"
fn_fetch_module
}
command_dev_query_raw.sh() {
modulefile="${FUNCNAME[0]}"
fn_fetch_module

139
lgsm/modules/core_steamcmd.sh

@ -23,7 +23,7 @@ fn_check_steamcmd_user() {
# Checks if steamuser is setup.
if [ "${steamuser}" == "username" ]; then
fn_print_fail_nl "Steam login not set. Update steamuser in ${configdirserver}"
echo -e " * Change steamuser=\"username\" to a valid steam login."
fn_print_nl " * Change steamuser=\"username\" to a valid steam login."
if [ -d "${lgsmlogdir}" ]; then
fn_script_log_fail "Steam login not set. Update steamuser in ${configdirserver}"
fi
@ -44,15 +44,16 @@ fn_check_steamcmd() {
# Only install if steamcmd package is missing or steamcmd dir is missing.
if [ ! -f "${steamcmddir}/steamcmd.sh" ] && [ -z "$(command -v steamcmd 2> /dev/null)" ]; then
if [ "${commandname}" == "INSTALL" ]; then
fn_print_nl "install SteamCMD"
fn_install_steamcmd
else
fn_print_warn_nl "SteamCMD is missing"
fn_script_log_warn "SteamCMD is missing"
fn_print_warn_nl "SteamCMD is not installed"
fn_script_log_warn "SteamCMD is not installed"
fn_install_steamcmd
fi
elif [ "${commandname}" == "INSTALL" ]; then
fn_print_information "SteamCMD is already installed..."
fn_print_ok_eol_nl
fn_print "install SteamCMD"
fn_print_skip_eol_nl
fi
}
@ -128,7 +129,7 @@ fn_check_steamcmd_clear() {
if [ "$(command -v steamcmd 2> /dev/null)" ] && [ -d "${rootdir}/steamcmd" ]; then
rm -rf "${steamcmddir:?}"
exitcode=$?
if [ "${exitcode}" != 0 ]; then
if [ "${exitcode}" -ne 0 ]; then
fn_script_log_fail "Removing ${rootdir}/steamcmd"
else
fn_script_log_pass "Removing ${rootdir}/steamcmd"
@ -214,18 +215,18 @@ fn_update_steamcmd_compare() {
# Create update lockfile.
date '+%s' > "${lockdir:?}/update.lock"
fn_print_ok_nl "Checking for update: ${remotelocation}"
echo -en "\n"
echo -e "Update available"
echo -e "* Local build: ${red}${localbuild}${default}"
echo -e "* Remote build: ${green}${remotebuildversion}${default}"
fn_print "\n"
fn_print_nl "${bold}${underline}Update${default} available"
fn_print_nl "* Local build: ${red}${localbuild}${default}"
fn_print_nl "* Remote build: ${green}${remotebuildversion}${default}"
if [ -n "${branch}" ]; then
echo -e "* Branch: ${branch}"
fn_print_nl "* Branch: ${branch}"
fi
if [ -n "${betapassword}" ]; then
echo -e "* Branch password: ${betapassword}"
fn_print_nl "* Branch password: ${betapassword}"
fi
echo -e "https://steamdb.info/app/${appid}/"
echo -en "\n"
fn_print_nl "${italic}https://steamdb.info/app/${appid}/history"
fn_print "\n"
fn_script_log_info "Update available"
fn_script_log_info "Local build: ${localbuild}"
fn_script_log_info "Remote build: ${remotebuildversion}"
@ -264,18 +265,18 @@ fn_update_steamcmd_compare() {
alert.sh
else
fn_print_ok_nl "Checking for update: ${remotelocation}"
echo -en "\n"
echo -e "No update available"
echo -e "* Local build: ${green}${localbuild}${default}"
echo -e "* Remote build: ${green}${remotebuildversion}${default}"
fn_print "\n"
fn_print_nl "${bold}${underline}No update${default} available"
fn_print_nl "* Local build: ${green}${localbuild}${default}"
fn_print_nl "* Remote build: ${green}${remotebuildversion}${default}"
if [ -n "${branch}" ]; then
echo -e "* Branch: ${branch}"
fn_print_nl "* Branch: ${branch}"
fi
if [ -n "${betapassword}" ]; then
echo -e "* Branch password: ${betapassword}"
fn_print_nl "* Branch password: ${betapassword}"
fi
echo -e "https://steamdb.info/app/${appid}/"
echo -en "\n"
fn_print_nl "https://steamdb.info/app/${appid}/history"
fn_print "\n"
fn_script_log_info "No update available"
fn_script_log_info "Local build: ${localbuild}"
fn_script_log_info "Remote build: ${remotebuildversion}"
@ -309,9 +310,9 @@ fn_check_steamcmd_appmanifest() {
if [ "${appmanifestfilewc}" -ge "2" ]; then
fn_print_fail "Unable to remove x${appmanifestfilewc} appmanifest_${appid}.acf files"
fn_script_log_fail "Unable to remove x${appmanifestfilewc} appmanifest_${appid}.acf files"
echo -e "* Check user permissions"
fn_print_nl "* Check user permissions"
for appfile in ${appmanifestfile}; do
echo -e " ${appfile}"
fn_print_nl " ${appfile}"
done
core_exit.sh
else
@ -365,63 +366,63 @@ fn_check_steamcmd_appmanifest() {
fn_print_info_nl "Forcing update to correct issue"
fn_script_log_info "Forcing update to correct issue"
if [ "${shortname}" == "ahl" ]; then
fn_fetch_file_github "lgsm/data/appmanifest/${shortname}" "appmanifest_90.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash"
fn_fetch_file_github "lgsm/data/appmanifest/${shortname}" "appmanifest_10.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash"
fn_fetch_file_github "lgsm/data/appmanifest/${shortname}" "appmanifest_70.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash"
fn_fetch_file_github "${datadir}/appmanifest/${shortname}" "appmanifest_90.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash"
fn_fetch_file_github "${datadir}/appmanifest/${shortname}" "appmanifest_10.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash"
fn_fetch_file_github "${datadir}/appmanifest/${shortname}" "appmanifest_70.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash"
elif [ "${shortname}" == "bb" ]; then
fn_fetch_file_github "lgsm/data/appmanifest/${shortname}" "appmanifest_90.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash"
fn_fetch_file_github "lgsm/data/appmanifest/${shortname}" "appmanifest_10.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash"
fn_fetch_file_github "lgsm/data/appmanifest/${shortname}" "appmanifest_70.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash"
fn_fetch_file_github "${datadir}/appmanifest/${shortname}" "appmanifest_90.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash"
fn_fetch_file_github "${datadir}/appmanifest/${shortname}" "appmanifest_10.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash"
fn_fetch_file_github "${datadir}/appmanifest/${shortname}" "appmanifest_70.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash"
elif [ "${shortname}" == "cscz" ]; then
fn_fetch_file_github "lgsm/data/appmanifest/${shortname}" "appmanifest_90.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash"
fn_fetch_file_github "lgsm/data/appmanifest/${shortname}" "appmanifest_10.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash"
fn_fetch_file_github "lgsm/data/appmanifest/${shortname}" "appmanifest_70.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash"
fn_fetch_file_github "lgsm/data/appmanifest/${shortname}" "appmanifest_80.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash"
fn_fetch_file_github "${datadir}/appmanifest/${shortname}" "appmanifest_90.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash"
fn_fetch_file_github "${datadir}/appmanifest/${shortname}" "appmanifest_10.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash"
fn_fetch_file_github "${datadir}/appmanifest/${shortname}" "appmanifest_70.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash"
fn_fetch_file_github "${datadir}/appmanifest/${shortname}" "appmanifest_80.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash"
elif [ "${shortname}" == "css" ]; then
fn_fetch_file_github "lgsm/data/appmanifest/${shortname}" "appmanifest_90.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash"
fn_fetch_file_github "lgsm/data/appmanifest/${shortname}" "appmanifest_10.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash"
fn_fetch_file_github "lgsm/data/appmanifest/${shortname}" "appmanifest_70.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash"
fn_fetch_file_github "${datadir}/appmanifest/${shortname}" "appmanifest_90.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash"
fn_fetch_file_github "${datadir}/appmanifest/${shortname}" "appmanifest_10.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash"
fn_fetch_file_github "${datadir}/appmanifest/${shortname}" "appmanifest_70.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash"
elif [ "${shortname}" == "dmc" ]; then
fn_fetch_file_github "lgsm/data/appmanifest/${shortname}" "appmanifest_90.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash"
fn_fetch_file_github "lgsm/data/appmanifest/${shortname}" "appmanifest_10.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash"
fn_fetch_file_github "lgsm/data/appmanifest/${shortname}" "appmanifest_40.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash"
fn_fetch_file_github "lgsm/data/appmanifest/${shortname}" "appmanifest_70.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash"
fn_fetch_file_github "${datadir}/appmanifest/${shortname}" "appmanifest_90.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash"
fn_fetch_file_github "${datadir}/appmanifest/${shortname}" "appmanifest_10.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash"
fn_fetch_file_github "${datadir}/appmanifest/${shortname}" "appmanifest_40.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash"
fn_fetch_file_github "${datadir}/appmanifest/${shortname}" "appmanifest_70.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash"
elif [ "${shortname}" == "dod" ]; then
fn_fetch_file_github "lgsm/data/appmanifest/${shortname}" "appmanifest_90.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash"
fn_fetch_file_github "lgsm/data/appmanifest/${shortname}" "appmanifest_10.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash"
fn_fetch_file_github "lgsm/data/appmanifest/${shortname}" "appmanifest_30.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash"
fn_fetch_file_github "lgsm/data/appmanifest/${shortname}" "appmanifest_70.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash"
fn_fetch_file_github "${datadir}/appmanifest/${shortname}" "appmanifest_90.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash"
fn_fetch_file_github "${datadir}/appmanifest/${shortname}" "appmanifest_10.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash"
fn_fetch_file_github "${datadir}/appmanifest/${shortname}" "appmanifest_30.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash"
fn_fetch_file_github "${datadir}/appmanifest/${shortname}" "appmanifest_70.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash"
elif [ "${shortname}" == "hldm" ]; then
fn_fetch_file_github "lgsm/data/appmanifest/${shortname}" "appmanifest_90.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash"
fn_fetch_file_github "lgsm/data/appmanifest/${shortname}" "appmanifest_10.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash"
fn_fetch_file_github "lgsm/data/appmanifest/${shortname}" "appmanifest_70.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash"
fn_fetch_file_github "${datadir}/appmanifest/${shortname}" "appmanifest_90.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash"
fn_fetch_file_github "${datadir}/appmanifest/${shortname}" "appmanifest_10.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash"
fn_fetch_file_github "${datadir}/appmanifest/${shortname}" "appmanifest_70.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash"
elif [ "${shortname}" == "ns" ]; then
fn_fetch_file_github "lgsm/data/appmanifest/${shortname}" "appmanifest_90.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash"
fn_fetch_file_github "lgsm/data/appmanifest/${shortname}" "appmanifest_10.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash"
fn_fetch_file_github "lgsm/data/appmanifest/${shortname}" "appmanifest_70.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash"
fn_fetch_file_github "${datadir}/appmanifest/${shortname}" "appmanifest_90.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash"
fn_fetch_file_github "${datadir}/appmanifest/${shortname}" "appmanifest_10.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash"
fn_fetch_file_github "${datadir}/appmanifest/${shortname}" "appmanifest_70.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash"
elif [ "${shortname}" == "opfor" ]; then
fn_fetch_file_github "lgsm/data/appmanifest/${shortname}" "appmanifest_90.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash"
fn_fetch_file_github "lgsm/data/appmanifest/${shortname}" "appmanifest_10.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash"
fn_fetch_file_github "lgsm/data/appmanifest/${shortname}" "appmanifest_50.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash"
fn_fetch_file_github "lgsm/data/appmanifest/${shortname}" "appmanifest_70.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash"
fn_fetch_file_github "${datadir}/appmanifest/${shortname}" "appmanifest_90.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash"
fn_fetch_file_github "${datadir}/appmanifest/${shortname}" "appmanifest_10.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash"
fn_fetch_file_github "${datadir}/appmanifest/${shortname}" "appmanifest_50.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash"
fn_fetch_file_github "${datadir}/appmanifest/${shortname}" "appmanifest_70.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash"
elif [ "${shortname}" == "ricochet" ]; then
fn_fetch_file_github "lgsm/data/appmanifest/${shortname}" "appmanifest_90.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash"
fn_fetch_file_github "lgsm/data/appmanifest/${shortname}" "appmanifest_10.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash"
fn_fetch_file_github "lgsm/data/appmanifest/${shortname}" "appmanifest_60.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash"
fn_fetch_file_github "lgsm/data/appmanifest/${shortname}" "appmanifest_70.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash"
fn_fetch_file_github "${datadir}/appmanifest/${shortname}" "appmanifest_90.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash"
fn_fetch_file_github "${datadir}/appmanifest/${shortname}" "appmanifest_10.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash"
fn_fetch_file_github "${datadir}/appmanifest/${shortname}" "appmanifest_60.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash"
fn_fetch_file_github "${datadir}/appmanifest/${shortname}" "appmanifest_70.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash"
elif [ "${shortname}" == "tfc" ]; then
fn_fetch_file_github "lgsm/data/appmanifest/${shortname}" "appmanifest_90.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash"
fn_fetch_file_github "lgsm/data/appmanifest/${shortname}" "appmanifest_10.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash"
fn_fetch_file_github "lgsm/data/appmanifest/${shortname}" "appmanifest_20.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash"
fn_fetch_file_github "lgsm/data/appmanifest/${shortname}" "appmanifest_70.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash"
fn_fetch_file_github "${datadir}/appmanifest/${shortname}" "appmanifest_90.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash"
fn_fetch_file_github "${datadir}/appmanifest/${shortname}" "appmanifest_10.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash"
fn_fetch_file_github "${datadir}/appmanifest/${shortname}" "appmanifest_20.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash"
fn_fetch_file_github "${datadir}/appmanifest/${shortname}" "appmanifest_70.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash"
elif [ "${shortname}" == "ts" ]; then
fn_fetch_file_github "lgsm/data/appmanifest/${shortname}" "appmanifest_90.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash"
fn_fetch_file_github "lgsm/data/appmanifest/${shortname}" "appmanifest_10.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash"
fn_fetch_file_github "lgsm/data/appmanifest/${shortname}" "appmanifest_70.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash"
fn_fetch_file_github "${datadir}/appmanifest/${shortname}" "appmanifest_90.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash"
fn_fetch_file_github "${datadir}/appmanifest/${shortname}" "appmanifest_10.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash"
fn_fetch_file_github "${datadir}/appmanifest/${shortname}" "appmanifest_70.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash"
elif [ "${shortname}" == "vs" ]; then
fn_fetch_file_github "lgsm/data/appmanifest/${shortname}" "appmanifest_90.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash"
fn_fetch_file_github "lgsm/data/appmanifest/${shortname}" "appmanifest_10.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash"
fn_fetch_file_github "lgsm/data/appmanifest/${shortname}" "appmanifest_70.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash"
fn_fetch_file_github "${datadir}/appmanifest/${shortname}" "appmanifest_90.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash"
fn_fetch_file_github "${datadir}/appmanifest/${shortname}" "appmanifest_10.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash"
fn_fetch_file_github "${datadir}/appmanifest/${shortname}" "appmanifest_70.acf" "${serverfiles}/steamapps" "nochmodx" "norun" "noforce" "nohash"
fi
fn_dl_steamcmd
fi

5
lgsm/modules/fix.sh

@ -22,7 +22,8 @@ fn_fix_msg_start_nl() {
}
fn_fix_msg_end() {
if [ $? != 0 ]; then
exirtcode=$?
if [ "${exitcode}" -ne 0 ]; then
fn_print_error_nl "Applying ${fixname} fix: ${gamename}"
fn_script_log_error "Applying ${fixname} fix: ${gamename}"
else
@ -79,7 +80,7 @@ fi
if [ "${commandname}" == "INSTALL" ]; then
if grep -qEe "(^|\s)${shortname}(\s|$)" <<< "${apply_post_install_fix[@]}"; then
echo -e ""
echo -e "${lightyellow}Applying Post-Install Fixes${default}"
echo -e "${bold}${lightyellow}Applying Post-Install Fixes${default}"
fn_messages_separator
postinstall=1
fn_apply_fix "post install" "${shortname}"

2
lgsm/modules/fix_bt.sh

@ -5,7 +5,7 @@
# Website: https://linuxgsm.com
# Description: Resolves issues with Barotrauma.
module_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
# Fixes: Missing user data directory error.
if [ ! -d "${XDG_DATA_HOME:="${HOME}/.local/share"}/Daedalic Entertainment GmbH/Barotrauma" ]; then

2
lgsm/modules/fix_rust.sh

@ -11,7 +11,7 @@ moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${serverfiles}:${serverfiles}/RustDedicated_Data/Plugins/x86_64"
# Part of random seed feature.
# If seed is not defined by user generate a seed file.
# If the seed is not defined by the user, generate a seed file.
if [ -z "${seed}" ] || [ "${seed}" == "0" ]; then
if [ ! -f "${datadir}/${selfname}-seed.txt" ]; then
shuf -i 1-2147483647 -n 1 > "${datadir}/${selfname}-seed.txt"

9
lgsm/modules/info_distro.sh

@ -188,13 +188,10 @@ if [ "$(command -v numfmt 2> /dev/null)" ]; then
else
# Older distros will need to use free.
# Older versions of free do not support -h option.
if [ "$(
free -h > /dev/null 2>&1
echo $?
)" -ne "0" ]; then
humanreadable="-m"
else
if free -h > /dev/null 2>&1; then
humanreadable="-h"
else
humanreadable="-m"
fi
physmemtotalmb="$(free -m | awk '/Mem:/ {print $2}')" # integer
physmemtotalgb="$(free -m | awk '/Mem:/ {print $2}')" # integer

12
lgsm/modules/info_game.sh

@ -673,7 +673,7 @@ fn_info_game_st() {
saveinterval="${saveinterval:-"0"}"
servername="${servername:-"NOT SET"}"
serverpassword="${serverpassword:-"NOT SET"}"
worldname="${worldname:-"NOT SET"}"
worldsave="${worldsave:-"NOT SET"}"
worldtype="${worldtype:-"NOT SET"}"
}
@ -936,6 +936,8 @@ fn_info_game_armar() {
fn_info_game_json "queryport" ".a2s.port"
fn_info_game_json "servername" ".game.name"
fn_info_game_json "serverpassword" ".game.password"
fn_info_game_json "rconpassword" ".rcon.password"
fn_info_game_json "rconport" ".rcon.port"
fi
adminpassword="${adminpassword:-"NOT SET"}"
battleeyeport="$((port + 4))"
@ -957,13 +959,14 @@ fn_info_game_bf1942() {
fn_info_game_keyvalue_pairs_space "configip" "game.serverIP"
fn_info_game_keyvalue_pairs_space "maxplayers" "game.serverMaxPlayers"
fn_info_game_keyvalue_pairs_space "port" "game.serverPort"
fn_info_game_keyvalue_pairs_space "queryport" "game.gameSpyPort"
fn_info_game_keyvalue_pairs_space "servername" "game.serverName"
fn_info_game_keyvalue_pairs_space "serverpassword" "game.serverPassword"
fi
configip="${configip:-"0.0.0.0"}"
maxplayers="${maxplayers:-"0"}"
port="${port:-"0"}"
queryport="22000"
queryport="${queryport:-"0"}"
servername="${servername:-"NOT SET"}"
serverpassword="${serverpassword:-"NOT SET"}"
}
@ -980,11 +983,12 @@ fn_info_game_bfv() {
fn_info_game_keyvalue_pairs_space "port" "game.serverPort"
fn_info_game_keyvalue_pairs_space "servername" "game.serverName"
fn_info_game_keyvalue_pairs_space "serverpassword" "game.serverPassword"
fn_info_game_keyvalue_pairs_space "queryport" "game.gameSpyPort"
fi
configip="${configip:-"0.0.0.0"}"
maxplayers="${maxplayers:-"0"}"
port="${port:-"0"}"
queryport="22000"
queryport="${queryport:-"0"}"
servername="${servername:-"NOT SET"}"
serverpassword="${serverpassword:-"NOT SET"}"
}
@ -2402,7 +2406,7 @@ elif [ "${shortname}" == "pc" ]; then
fn_info_game_pc
elif [ "${shortname}" == "pc2" ]; then
fn_info_game_pc2
elif [ "${shortname}" == "ps" ]; then
elif [ "${shortname}" == "squad44" ]; then
fn_info_game_ps
elif [ "${shortname}" == "pvr" ]; then
fn_info_game_pvr

80
lgsm/modules/info_messages.sh

@ -7,6 +7,29 @@
moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
# Converts querytype to imgsoquerytype for use with ismygameserver.online urls
if [ -n "${querytype}" ]; then
if [ "${querytype}" == "protocol-valve" ]; then
imgsoquerytype="valve"
elif [ "${querytype}" == "protocol-gamespy1" ]; then
imgsoquerytype="gamespy"
elif [ "${querytype}" == "protocol-gamespy2" ]; then
imgsoquerytype="gamespy"
elif [ "${querytype}" == "protocol-gamespy3" ]; then
imgsoquerytype="gamespy"
elif [ "${querytype}" == "protocol-quake1" ]; then
imgsoquerytype="quake"
elif [ "${querytype}" == "protocol-quake2" ]; then
imgsoquerytype="quake"
elif [ "${querytype}" == "protocol-quake3" ]; then
imgsoquerytype="quake"
elif [ "${querytype}" == "protocol-unreal2" ]; then
imgsoquerytype="unrealtournament2004"
else
imgsoquerytype="${querytype}"
fi
fi
# Removes the passwords form all but details.
fn_info_messages_password_strip() {
if [ "${commandname}" != "DETAILS" ]; then
@ -66,6 +89,11 @@ fn_info_messages_head() {
echo -e "Hostname"
echo -e "${HOSTNAME}"
echo -e ""
if [ -n "${querytype}" ]; then
echo -e "Is my Game Server Online?"
echo -e "https://ismygameserver.online/${imgsoquerytype}/${alertip}:${queryport}"
echo -e ""
fi
echo -e "Server Time"
echo -e "$(date)"
}
@ -132,7 +160,7 @@ fn_info_messages_server_resource() {
echo -e "${bold}${lightyellow}Server Resource${default}"
fn_messages_separator
{
echo -e "${lightyellow}CPU\t${default}"
echo -e "${bold}${lightyellow}CPU\t${default}"
echo -e "${lightblue}Model:\t${default}${cpumodel}"
echo -e "${lightblue}Cores:\t${default}${cpucores}"
echo -e "${lightblue}Frequency:\t${default}${cpufreqency}MHz"
@ -140,14 +168,14 @@ fn_info_messages_server_resource() {
} | column -s $'\t' -t
echo -e ""
{
echo -e "${lightyellow}Memory\t${default}"
echo -e "${bold}${lightyellow}Memory\t${default}"
echo -e "${lightblue}Mem:\t${lightblue}total\tused\tfree\tcached\tavailable${default}"
echo -e "${lightblue}Physical:\t${default}${physmemtotal}\t${physmemused}\t${physmemfree}\t${physmemcached}\t${physmemavailable}${default}"
echo -e "${lightblue}Swap:\t${default}${swaptotal}\t${swapused}\t${swapfree}${default}"
} | column -s $'\t' -t
echo -e ""
{
echo -e "${lightyellow}Storage${default}"
echo -e "${bold}${lightyellow}Storage${default}"
echo -e "${lightblue}Filesystem:\t${default}${filesystem}"
echo -e "${lightblue}Total:\t${default}${totalspace}"
echo -e "${lightblue}Used:\t${default}${usedspace}"
@ -155,7 +183,7 @@ fn_info_messages_server_resource() {
} | column -s $'\t' -t
echo -e ""
{
echo -e "${lightyellow}Network${default}"
echo -e "${bold}${lightyellow}Network${default}"
if [ -n "${netint}" ]; then
echo -e "${lightblue}Interface:\t${default}${netint}"
fi
@ -203,7 +231,7 @@ fn_info_messages_gameserver_resource() {
} | column -s $'\t' -t
echo -e ""
{
echo -e "${lightyellow}Storage${default}"
echo -e "${bold}${lightyellow}Storage${default}"
echo -e "${lightblue}Total:\t${default}${rootdirdu}"
echo -e "${lightblue}Serverfiles:\t${default}${serverfilesdu}"
if [ -d "${backupdir}" ]; then
@ -292,7 +320,7 @@ fn_info_messages_gameserver() {
echo -e "${lightblue}Server password:\t${default}${serverpassword}"
fi
# Query enabled (Starbound)
# Query enabled (Starbound, Minecraft)
if [ -n "${queryenabled}" ]; then
echo -e "${lightblue}Query enabled:\t${default}${queryenabled}"
fi
@ -503,6 +531,11 @@ fn_info_messages_gameserver() {
else
echo -e "${lightblue}Status:\t${green}STARTED${default}"
fi
# ismygameserver.online
if [ -n "${querytype}" ]; then
echo -e "${lightblue}Query Check:\t${default}https://ismygameserver.online/${imgsoquerytype}/${alertip}:${queryport}"
fi
} | column -s $'\t' -t
echo -e ""
}
@ -553,23 +586,39 @@ fn_info_messages_script() {
fi
# Discord alert
echo -e "${lightblue}Discord alert:\t${default}${discordalert}"
if [ "${discordalert}" == "on" ]; then
echo -e "${lightblue}Discord alert:\t${default}${discordalert}"
fi
# Email alert
echo -e "${lightblue}Email alert:\t${default}${emailalert}"
if [ "${emailalert}" == "on" ]; then
echo -e "${lightblue}Email alert:\t${default}${emailalert}"
fi
# Gotify alert
echo -e "${lightblue}Gotify alert:\t${default}${gotifyalert}"
if [ "${gotifyalert}" == "on" ]; then
echo -e "${lightblue}Gotify alert:\t${default}${gotifyalert}"
fi
# IFTTT alert
echo -e "${lightblue}IFTTT alert:\t${default}${iftttalert}"
# Pushbullet alert
echo -e "${lightblue}Pushbullet alert:\t${default}${pushbulletalert}"
if [ "${pushbulletalert}" == "on" ]; then
echo -e "${lightblue}Pushbullet alert:\t${default}${pushbulletalert}"
fi
# Pushover alert
echo -e "${lightblue}Pushover alert:\t${default}${pushoveralert}"
if [ "${pushoveralert}" == "on" ]; then
echo -e "${lightblue}Pushover alert:\t${default}${pushoveralert}"
fi
# Rocketchat alert
echo -e "${lightblue}Rocketchat alert:\t${default}${rocketchatalert}"
if [ "${rocketchatalert}" == "on" ]; then
echo -e "${lightblue}Rocketchat alert:\t${default}${rocketchatalert}"
fi
# Slack alert
echo -e "${lightblue}Slack alert:\t${default}${slackalert}"
if [ "${slackalert}" == "on" ]; then
echo -e "${lightblue}Slack alert:\t${default}${slackalert}"
fi
# Telegram alert
echo -e "${lightblue}Telegram alert:\t${default}${telegramalert}"
if [ "${telegramalert}" == "on" ]; then
echo -e "${lightblue}Telegram alert:\t${default}${telegramalert}"
fi
# Update on start
if [ -n "${updateonstart}" ]; then
@ -1461,6 +1510,7 @@ fn_info_messages_sm() {
{
fn_port "header"
fn_port "Game" port udp
fn_port "Game" port tcp
fn_port "Query" queryport udp
fn_port "Telnet" telnetport tcp
} | column -s $'\t' -t
@ -1841,7 +1891,7 @@ fn_info_messages_select_engine() {
fn_info_messages_pc
elif [ "${shortname}" == "pc2" ]; then
fn_info_messages_pc2
elif [ "${shortname}" == "ps" ]; then
elif [ "${shortname}" == "squad44" ]; then
fn_info_messages_ps
elif [ "${shortname}" == "pvr" ]; then
fn_info_messages_pvr

15
lgsm/modules/install_complete.sh

@ -8,25 +8,24 @@
moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
echo -e ""
fn_messages_separator
if [ "${exitcode}" == "1" ]; then
if [ "${exitcode}" -eq 1 ]; then
echo -e "${bold}${red}Install Failed!${default}"
fn_script_log_fail "Install Failed!"
elif [ "${exitcode}" == "2" ]; then
elif [ "${exitcode}" -eq 2 ]; then
echo -e "${bold}${red}Install Completed with Errors!${default}}"
fn_script_log_error "Install Completed with Errors!"
elif [ "${exitcode}" == "3" ]; then
elif [ "${exitcode}" -eq 3 ]; then
echo -e "${bold}${lightyellow}Install Completed with Warnings!${default}}"
fn_script_log_warn "Install Completed with Warnings!"
elif [ -z "${exitcode}" ] || [ "${exitcode}" == "0" ]; then
elif [ -z "${exitcode}" ] || [ "${exitcode}" -eq 0 ]; then
echo -e "${bold}${green}Install Complete!${default}"
fn_script_log_pass "Install Complete!"
fi
fn_messages_separator
fn_script_log_info "Install Complete!"
echo -e ""
echo -e "To start server type:"
echo -e "./${selfname} start"
echo -e "To start the ${gamename} server type:"
echo -e "${italic}./${selfname} start${default}"
echo -e ""
core_exit.sh

260
lgsm/modules/install_config.sh

@ -16,43 +16,76 @@ fn_check_cfgdir() {
fi
}
# Downloads default configs from Game-Server-Configs repo to lgsm/config-default.
fn_fetch_default_config() {
# Copys default configs from Game-Server-Configs repo to server config location.
fn_default_config_remote() {
echo -e ""
echo -e "${bold}${lightyellow}Downloading ${gamename} Configs${default}"
fn_messages_separator
echo -e "Downloading default configs from:"
echo -e ""
echo -e "${italic}https://github.com/GameServerManagers/Game-Server-Configs${default}"
echo -e "Downloading default configs from: ${italic}https://github.com/GameServerManagers/Game-Server-Configs${default}"
echo -e ""
fn_sleep_time_1
mkdir -p "${lgsmdir}/config-default/config-game"
githuburl="https://raw.githubusercontent.com/GameServerManagers/Game-Server-Configs/main"
for config in "${array_configs[@]}"; do
# Downloads default configs from Game-Server-Configs repo to lgsm/config-default.
fn_fetch_file "${githuburl}/${shortname}/${config}" "${remote_fileurl_backup}" "GitHub" "Bitbucket" "${lgsmdir}/config-default/config-game" "${config}" "nochmodx" "norun" "forcedl" "nohash"
done
}
# Copys default configs from Game-Server-Configs repo to server config location.
fn_default_config_remote() {
for config in "${array_configs[@]}"; do
# every config is copied
echo -e "copying ${config} config file."
fn_script_log_info "Copying ${servercfg} config file."
# Every config is copied.
if [ "${config}" == "${servercfgdefault}" ]; then
mkdir -p "${servercfgdir}"
cp -nv "${lgsmdir}/config-default/config-game/${config}" "${servercfgfullpath}"
echo -en "copying config file [ ${italic}${servercfgfullpath}${default} ]"
changes+=$(cp -nv "${lgsmdir}/config-default/config-game/${config}" "${servercfgfullpath}")
exitcode=$?
if [ "${exitcode}" -ne 0 ]; then
fn_print_fail_eol_nl
fn_script_log_fail "copying config file ${servercfgfullpath}"
elif [ "${changes}" != "" ]; then
fn_print_ok_eol_nl
fn_script_log_pass "copying config file ${servercfgfullpath}"
else
fn_print_skip_eol_nl
fi
elif [ "${shortname}" == "arma3" ] && [ "${config}" == "${networkcfgdefault}" ]; then
mkdir -p "${servercfgdir}"
cp -nv "${lgsmdir}/config-default/config-game/${config}" "${networkcfgfullpath}"
echo -en "copying config file [ ${italic}${networkcfgfullpath}${default} ]"
changes+=$(cp -nv "${lgsmdir}/config-default/config-game/${config}" "${networkcfgfullpath}")
if [ "${exitcode}" -ne 0 ]; then
fn_print_fail_eol_nl
fn_script_log_fail "copying config file ${networkcfgdefault}"
elif [ "${changes}" != "" ]; then
fn_print_ok_eol_nl
fn_script_log_pass "copying config file ${networkcfgdefault}"
else
fn_print_skip_eol_nl
fi
elif [ "${shortname}" == "dst" ] && [ "${config}" == "${clustercfgdefault}" ]; then
cp -nv "${lgsmdir}/config-default/config-game/${clustercfgdefault}" "${clustercfgfullpath}"
echo -en "copying config file [ ${italic}${clustercfgfullpath}${default} ]"
changes+=$(cp -nv "${lgsmdir}/config-default/config-game/${clustercfgdefault}" "${clustercfgfullpath}")
if [ "${exitcode}" -ne 0 ]; then
fn_print_fail_eol_nl
fn_script_log_fail "copying config file ${clustercfgfullpath}"
elif [ "${changes}" != "" ]; then
fn_print_ok_eol_nl
fn_script_log_pass "copying config file ${clustercfgfullpath}"
else
fn_print_skip_eol_nl
fi
else
mkdir -p "${servercfgdir}"
cp -nv "${lgsmdir}/config-default/config-game/${config}" "${servercfgdir}/${config}"
echo -en "copying config file [ ${italic}${servercfgdir}/${config}${default} ]"
changes+=$(cp -nv "${lgsmdir}/config-default/config-game/${config}" "${servercfgdir}/${config}")
if [ "${exitcode}" -ne 0 ]; then
fn_print_fail_eol_nl
fn_script_log_fail "copying config file ${servercfgdir}/${config}"
elif [ "${changes}" != "" ]; then
fn_print_ok_eol_nl
fn_script_log_pass "copying config file ${servercfgdir}/${config}"
else
fn_print_skip_eol_nl
fi
fi
unset changes
done
fn_sleep_time
}
# Copys local default config to server config location.
@ -71,7 +104,7 @@ fn_default_config_local() {
echo -en "copying config file [ ${italic}${servercfgdefault}${default} ]: "
cp --update=none "${servercfgdir}/${servercfgdefault}" "${servercfgfullpath}"
exitcode=$?
if [ "${exitcode}" != 0 ]; then
if [ "${exitcode}" -ne 0 ]; then
fn_print_fail_eol
fn_script_log_fail "copying config file [ ${servercfgdefault} ]: "
else
@ -87,30 +120,48 @@ fn_set_config_vars() {
if [ -f "${servercfgfullpath}" ]; then
randomstring=$(tr -dc 'A-Za-z0-9_' < /dev/urandom 2> /dev/null | head -c 8 | xargs)
servername="LinuxGSM"
rconpass="admin${randomstring}"
echo -e "changing hostname."
fn_script_log_info "Changing hostname."
adminpass="admin${randomstring}"
echo -en "setting hostname\c"
fn_script_log_info "setting hostname"
fn_sleep_time
# prevents var from being overwritten with the servername.
if grep -q "SERVERNAME=SERVERNAME" "${lgsmdir}/config-default/config-game/${config}" 2> /dev/null; then
sed -i "s/SERVERNAME=SERVERNAME/SERVERNAME=${servername}/g" "${servercfgfullpath}"
changes+=$(sed -i "s/SERVERNAME=SERVERNAME/SERVERNAME=${servername}/g w /dev/stdout" "${servercfgfullpath}")
elif grep -q "SERVERNAME=\"SERVERNAME\"" "${lgsmdir}/config-default/config-game/${config}" 2> /dev/null; then
sed -i "s/SERVERNAME=\"SERVERNAME\"/SERVERNAME=\"${servername}\"/g" "${servercfgfullpath}"
changes+=$(sed -i "s/SERVERNAME=\"SERVERNAME\"/SERVERNAME=\"${servername}\"/g w /dev/stdout" "${servercfgfullpath}")
else
sed -i "s/SERVERNAME/${servername}/g" "${servercfgfullpath}"
changes+=$(sed -i "s/SERVERNAME/${servername}/g w /dev/stdout" "${servercfgfullpath}")
fi
echo -e "changing rcon/admin password."
fn_script_log_info "Changing rcon/admin password."
if [ "${shortname}" == "squad" ]; then
sed -i "s/ADMINPASSWORD/${rconpass}/g" "${servercfgdir}/Rcon.cfg"
exitcode=$?
if [ "${exitcode}" -ne 0 ]; then
fn_print_fail_eol
fn_script_log_fail "setting hostname"
elif [ "${changes}" != "" ]; then
fn_print_ok_eol_nl
fn_script_log_pass "setting hostname"
else
sed -i "s/ADMINPASSWORD/${rconpass}/g" "${servercfgfullpath}"
fn_print_skip_eol_nl
fi
echo -en "generating admin/rcon password\c"
fn_script_log_info "generating admin/rcon password"
fn_sleep_time
else
fn_script_log_warn "Config file not found, cannot alter it."
echo -e "Config file not found, cannot alter it."
fn_sleep_time
if [ "${shortname}" == "squad" ]; then
changes+=$(sed -i "s/ADMINPASSWORD/${adminpass}/g w /dev/stdout" "${servercfgdir}/Rcon.cfg")
else
changes+=$(sed -i "s/ADMINPASSWORD/${adminpass}/g w /dev/stdout" "${servercfgfullpath}")
fi
exitcode=$?
if [ "${exitcode}" -ne 0 ]; then
fn_print_fail_eol
fn_script_log_fail "generating admin/rcon password"
elif [ "${changes}" != "" ]; then
fn_print_ok_eol_nl
fn_script_log_pass "generating admin/rcon password"
else
fn_print_skip_eol_nl
fi
unset changes
fi
}
@ -164,22 +215,22 @@ fn_set_dst_config_vars() {
echo -e ""
}
# Lists local config file locations
# Lists local config locations
fn_list_config_locations() {
echo -e ""
echo -e "${bold}${lightyellow}Config Locations${default}"
fn_messages_separator
if [ -n "${servercfgfullpath}" ]; then
if [ -f "${servercfgfullpath}" ]; then
echo -e "Game Server Config File: ${servercfgfullpath}"
echo -e "${gamename} config file: ${italic}${servercfgfullpath}${default}"
elif [ -d "${servercfgfullpath}" ]; then
echo -e "Game Server Config Dir: ${servercfgfullpath}"
echo -e "${gamename} config directory: ${italic}${servercfgfullpath}"
else
echo -e "Config file: ${red}${servercfgfullpath}${default} (${red}FILE MISSING${default})"
echo -e "${gamename} config: ${italic}${red}${servercfgfullpath}${default} (${red}CONFIG IS MISSING${default})"
fi
fi
echo -e "LinuxGSM Config: ${lgsmdir}/config-lgsm/${gameservername}"
echo -e "Documentation: https://docs.linuxgsm.com/configuration/game-server-config"
echo -e "LinuxGSM config: ${italic}${lgsmdir}/config-lgsm/${gameservername}${default}"
echo -e "Config documentation: ${italic}https://docs.linuxgsm.com/configuration${default}"
}
if [ "${shortname}" == "sdtd" ]; then
@ -187,66 +238,51 @@ if [ "${shortname}" == "sdtd" ]; then
fn_list_config_locations
elif [ "${shortname}" == "ac" ]; then
array_configs+=(server_cfg.ini)
fn_fetch_default_config
fn_default_config_remote
fn_set_config_vars
fn_list_config_locations
elif [ "${shortname}" == "ahl" ]; then
array_configs+=(server.cfg)
fn_fetch_default_config
fn_default_config_remote
fn_set_config_vars
fn_list_config_locations
elif [ "${shortname}" == "ahl2" ]; then
array_configs+=(server.cfg)
fn_fetch_default_config
fn_default_config_remote
fn_set_config_vars
fn_list_config_locations
elif [ "${shortname}" == "ark" ]; then
fn_check_cfgdir
array_configs+=(GameUserSettings.ini)
fn_fetch_default_config
fn_default_config_remote
fn_set_config_vars
fn_list_config_locations
elif [ "${shortname}" == "arma3" ]; then
fn_check_cfgdir
array_configs+=(server.cfg network.cfg)
fn_fetch_default_config
fn_default_config_remote
fn_set_config_vars
fn_list_config_locations
elif [ "${shortname}" == "armar" ]; then
fn_check_cfgdir
array_configs+=(server.json)
fn_fetch_default_config
fn_default_config_remote
fn_set_config_vars
fn_list_config_locations
elif [ "${shortname}" == "ats" ]; then
fn_check_cfgdir
array_configs+=(server_config.sii)
fn_fetch_default_config
fn_default_config_remote
fn_set_config_vars
fn_list_config_locations
elif [ "${shortname}" == "bo" ]; then
array_configs+=(config.txt)
fn_fetch_default_config
fn_default_config_remote
fn_set_config_vars
fn_list_config_locations
elif [ "${shortname}" == "bd" ]; then
array_configs+=(server.cfg)
fn_fetch_default_config
fn_default_config_remote
fn_set_config_vars
fn_list_config_locations
elif [ "${shortname}" == "bt" ]; then
fn_check_cfgdir
array_configs+=(serversettings.xml)
fn_fetch_default_config
fn_default_config_remote
fn_set_config_vars
fn_list_config_locations
@ -259,91 +295,76 @@ elif [ "${shortname}" == "btl" ]; then
fn_list_config_locations
elif [ "${shortname}" == "bf1942" ]; then
array_configs+=(serversettings.con)
fn_fetch_default_config
fn_default_config_remote
fn_set_config_vars
fn_list_config_locations
elif [ "${shortname}" == "bfv" ]; then
array_configs+=(serversettings.con)
fn_fetch_default_config
fn_default_config_remote
fn_set_config_vars
fn_list_config_locations
elif [ "${shortname}" == "bs" ]; then
array_configs+=(server.cfg)
fn_fetch_default_config
fn_default_config_remote
fn_set_config_vars
fn_list_config_locations
elif [ "${shortname}" == "bb" ]; then
array_configs+=(server.cfg)
fn_fetch_default_config
fn_default_config_remote
fn_set_config_vars
fn_list_config_locations
elif [ "${shortname}" == "bb2" ]; then
array_configs+=(server.cfg)
fn_fetch_default_config
fn_default_config_remote
fn_set_config_vars
fn_list_config_locations
elif [ "${shortname}" == "bmdm" ]; then
array_configs+=(server.cfg)
fn_fetch_default_config
fn_default_config_remote
fn_set_config_vars
fn_list_config_locations
elif [ "${shortname}" == "ck" ]; then
array_configs+=(ServerConfig.json)
fn_fetch_default_config
fn_default_config_remote
fn_set_config_vars
fn_list_config_locations
elif [ "${shortname}" == "cod" ]; then
array_configs+=(server.cfg)
fn_fetch_default_config
fn_default_config_remote
fn_set_config_vars
fn_list_config_locations
elif [ "${shortname}" == "coduo" ]; then
array_configs+=(server.cfg)
fn_fetch_default_config
fn_default_config_remote
fn_set_config_vars
fn_list_config_locations
elif [ "${shortname}" == "cod2" ]; then
array_configs+=(server.cfg)
fn_fetch_default_config
fn_default_config_remote
fn_set_config_vars
fn_list_config_locations
elif [ "${shortname}" == "cod4" ]; then
array_configs+=(server.cfg)
fn_fetch_default_config
fn_default_config_remote
fn_set_config_vars
fn_list_config_locations
elif [ "${shortname}" == "codwaw" ]; then
array_configs+=(server.cfg)
fn_fetch_default_config
fn_default_config_remote
fn_set_config_vars
fn_list_config_locations
elif [ "${shortname}" == "cc" ]; then
array_configs+=(server.cfg)
fn_fetch_default_config
fn_default_config_remote
fn_set_config_vars
fn_list_config_locations
elif [ "${shortname}" == "col" ]; then
array_configs+=(colserver.json)
fn_fetch_default_config
fn_default_config_remote
fn_set_config_vars
fn_list_config_locations
elif [ "${shortname}" == "cs" ]; then
array_configs+=(server.cfg)
fn_fetch_default_config
fn_default_config_remote
fn_set_config_vars
fn_list_config_locations
@ -355,86 +376,70 @@ elif [ "${shortname}" == "cs2" ]; then
fn_list_config_locations
elif [ "${shortname}" == "cscz" ]; then
array_configs+=(server.cfg)
fn_fetch_default_config
fn_default_config_remote
fn_set_config_vars
fn_list_config_locations
elif [ "${shortname}" == "csgo" ]; then
array_configs+=(server.cfg)
fn_fetch_default_config
fn_default_config_remote
fn_set_config_vars
fn_list_config_locations
elif [ "${shortname}" == "css" ]; then
array_configs+=(server.cfg)
fn_fetch_default_config
fn_default_config_remote
fn_set_config_vars
fn_list_config_locations
elif [ "${shortname}" == "ct" ]; then
array_configs+=(ServerSetting.ini)
fn_fetch_default_config
fn_default_config_remote
fn_set_config_vars
fn_list_config_locations
elif [ "${shortname}" == "dayz" ]; then
fn_check_cfgdir
array_configs+=(server.cfg)
fn_fetch_default_config
fn_default_config_remote
fn_set_config_vars
fn_list_config_locations
elif [ "${shortname}" == "dod" ]; then
array_configs+=(server.cfg)
fn_fetch_default_config
fn_default_config_remote
fn_set_config_vars
fn_list_config_locations
elif [ "${shortname}" == "dodr" ]; then
array_configs+=(Game.ini)
fn_fetch_default_config
fn_default_config_remote
fn_list_config_locations
elif [ "${shortname}" == "dods" ]; then
array_configs+=(server.cfg)
fn_fetch_default_config
fn_default_config_remote
fn_set_config_vars
fn_list_config_locations
elif [ "${shortname}" == "doi" ]; then
array_configs+=(server.cfg)
fn_fetch_default_config
fn_default_config_remote
fn_set_config_vars
fn_list_config_locations
elif [ "${shortname}" == "dmc" ]; then
array_configs+=(server.cfg)
fn_fetch_default_config
fn_default_config_remote
fn_set_config_vars
fn_list_config_locations
elif [ "${shortname}" == "dst" ]; then
fn_check_cfgdir
array_configs+=(cluster.ini server.ini)
fn_fetch_default_config
fn_default_config_remote
fn_set_dst_config_vars
fn_list_config_locations
elif [ "${shortname}" == "dab" ]; then
array_configs+=(server.cfg)
fn_fetch_default_config
fn_default_config_remote
fn_set_config_vars
fn_list_config_locations
elif [ "${shortname}" == "dys" ]; then
array_configs+=(server.cfg)
fn_fetch_default_config
fn_default_config_remote
fn_set_config_vars
fn_list_config_locations
elif [ "${shortname}" == "eco" ]; then
array_configs+=(Network.eco)
fn_fetch_default_config
fn_default_config_remote
fn_set_config_vars
fn_list_config_locations
@ -443,44 +448,36 @@ elif [ "${shortname}" == "em" ]; then
fn_list_config_locations
elif [ "${shortname}" == "etl" ]; then
array_configs+=(server.cfg)
fn_fetch_default_config
fn_default_config_remote
fn_set_config_vars
fn_list_config_locations
elif [ "${shortname}" == "ets2" ]; then
fn_check_cfgdir
array_configs+=(server_config.sii)
fn_fetch_default_config
fn_default_config_remote
fn_set_config_vars
fn_list_config_locations
elif [ "${shortname}" == "fctr" ]; then
array_configs+=(server-settings.json)
fn_fetch_default_config
fn_default_config_remote
fn_set_config_vars
fn_list_config_locations
elif [ "${shortname}" == "fof" ]; then
array_configs+=(server.cfg)
fn_fetch_default_config
fn_default_config_remote
fn_set_config_vars
fn_list_config_locations
elif [ "${shortname}" == "gmod" ]; then
array_configs+=(server.cfg)
fn_fetch_default_config
fn_default_config_remote
fn_set_config_vars
fn_list_config_locations
elif [ "${shortname}" == "hldm" ]; then
array_configs+=(server.cfg)
fn_fetch_default_config
fn_default_config_remote
fn_set_config_vars
fn_list_config_locations
elif [ "${shortname}" == "hldms" ]; then
array_configs+=(server.cfg)
fn_fetch_default_config
fn_default_config_remote
fn_set_config_vars
fn_list_config_locations
@ -492,13 +489,11 @@ elif [ "${shortname}" == "ohd" ]; then
fn_list_config_locations
elif [ "${shortname}" == "opfor" ]; then
array_configs+=(server.cfg)
fn_fetch_default_config
fn_default_config_remote
fn_set_config_vars
fn_list_config_locations
elif [ "${shortname}" == "hl2dm" ]; then
array_configs+=(server.cfg)
fn_fetch_default_config
fn_default_config_remote
fn_set_config_vars
fn_list_config_locations
@ -507,104 +502,84 @@ elif [ "${shortname}" == "hz" ]; then
:
elif [ "${shortname}" == "ins" ]; then
array_configs+=(server.cfg)
fn_fetch_default_config
fn_default_config_remote
fn_set_config_vars
fn_list_config_locations
elif [ "${shortname}" == "ios" ]; then
array_configs+=(server.cfg)
fn_fetch_default_config
fn_default_config_remote
fn_set_config_vars
fn_list_config_locations
elif [ "${shortname}" == "jc2" ]; then
array_configs+=(config.lua)
fn_fetch_default_config
fn_default_config_remote
fn_set_config_vars
fn_list_config_locations
elif [ "${shortname}" == "jc3" ]; then
array_configs+=(config.json)
fn_fetch_default_config
fn_default_config_remote
fn_set_config_vars
fn_list_config_locations
elif [ "${shortname}" == "kf" ]; then
array_configs+=(Default.ini)
fn_fetch_default_config
fn_default_config_remote
fn_set_config_vars
fn_list_config_locations
elif [ "${shortname}" == "l4d" ]; then
array_configs+=(server.cfg)
fn_fetch_default_config
fn_default_config_remote
fn_set_config_vars
fn_list_config_locations
elif [ "${shortname}" == "l4d2" ]; then
array_configs+=(server.cfg)
fn_fetch_default_config
fn_default_config_remote
fn_set_config_vars
fn_list_config_locations
elif [ "${shortname}" == "mc" ] || [ "${shortname}" == "pmc" ]; then
array_configs+=(server.properties)
fn_fetch_default_config
fn_default_config_remote
fn_set_config_vars
fn_list_config_locations
elif [ "${shortname}" == "mcb" ]; then
array_configs+=(server.properties)
fn_fetch_default_config
fn_default_config_remote
fn_set_config_vars
fn_list_config_locations
elif [ "${shortname}" == "mohaa" ]; then
array_configs+=(server.cfg)
fn_fetch_default_config
fn_default_config_remote
fn_set_config_vars
fn_list_config_locations
elif [ "${shortname}" == "mh" ]; then
fn_check_cfgdir
array_configs+=(Game.ini)
fn_fetch_default_config
fn_default_config_remote
fn_set_config_vars
fn_list_config_locations
elif [ "${shortname}" == "ns" ]; then
array_configs+=(server.cfg)
fn_fetch_default_config
fn_default_config_remote
fn_set_config_vars
fn_list_config_locations
elif [ "${shortname}" == "nmrih" ]; then
array_configs+=(server.cfg)
fn_fetch_default_config
fn_default_config_remote
fn_set_config_vars
fn_list_config_locations
elif [ "${shortname}" == "nd" ]; then
array_configs+=(server.cfg)
fn_fetch_default_config
fn_default_config_remote
fn_set_config_vars
fn_list_config_locations
elif [ "${shortname}" == "mta" ]; then
fn_check_cfgdir
array_configs+=(acl.xml mtaserver.conf vehiclecolors.conf)
fn_fetch_default_config
fn_default_config_remote
fn_list_config_locations
elif [ "${shortname}" == "pvr" ]; then
fn_check_cfgdir
array_configs+=(Game.ini)
fn_fetch_default_config
fn_default_config_remote
fn_set_config_vars
elif [ "${shortname}" == "pvkii" ]; then
array_configs+=(server.cfg)
fn_fetch_default_config
fn_default_config_remote
fn_set_config_vars
fn_list_config_locations
@ -615,22 +590,17 @@ elif [ "${shortname}" == "pw" ]; then
fn_set_config_vars
fn_list_config_locations
elif [ "${shortname}" == "pz" ]; then
fn_check_cfgdir
array_configs+=(server.ini)
fn_fetch_default_config
fn_default_config_remote
fn_set_config_vars
fn_list_config_locations
elif [ "${shortname}" == "nec" ]; then
fn_check_cfgdir
array_configs+=(server.cfg)
fn_fetch_default_config
fn_default_config_remote
fn_set_config_vars
fn_list_config_locations
elif [ "${shortname}" == "pc" ]; then
array_configs+=(server.cfg)
fn_fetch_default_config
fn_default_config_remote
fn_set_config_vars
fn_list_config_locations
@ -639,13 +609,12 @@ elif [ "${shortname}" == "pc2" ]; then
fn_list_config_locations
elif [ "${shortname}" == "q2" ]; then
array_configs+=(server.cfg)
fn_fetch_default_config
fn_default_config_remote
fn_set_config_vars
fn_list_config_locations
elif [ "${shortname}" == "q3" ]; then
array_configs+=(server.cfg)
fn_fetch_default_configs
fn_fetch_default_config
fn_default_config_remote
fn_set_config_vars
fn_list_config_locations
@ -657,159 +626,133 @@ elif [ "${shortname}" == "q4" ]; then
fn_list_config_locations
elif [ "${shortname}" == "ql" ]; then
array_configs+=(server.cfg)
fn_fetch_default_config
fn_default_config_remote
fn_set_config_vars
fn_list_config_locations
elif [ "${shortname}" == "jk2" ]; then
array_configs+=(server.cfg)
fn_fetch_default_config
fn_default_config_remote
fn_set_config_vars
elif [ "${shortname}" == "qw" ]; then
array_configs+=(server.cfg)
fn_fetch_default_config
fn_default_config_remote
fn_set_config_vars
fn_list_config_locations
elif [ "${shortname}" == "ricochet" ]; then
array_configs+=(server.cfg)
fn_fetch_default_config
fn_default_config_remote
fn_set_config_vars
fn_list_config_locations
elif [ "${shortname}" == "rtcw" ]; then
array_configs+=(server.cfg)
fn_fetch_default_config
fn_default_config_remote
fn_set_config_vars
fn_list_config_locations
elif [ "${shortname}" == "rust" ]; then
fn_check_cfgdir
array_configs+=(server.cfg)
fn_fetch_default_config
fn_default_config_remote
fn_list_config_locations
elif [ "${shortname}" == "scpsl" ] || [ "${shortname}" == "scpslsm" ]; then
array_configs+=(config_gameplay.txt config_localadmin.txt)
fn_fetch_default_config
fn_default_config_remote
fn_set_config_vars
fn_list_config_locations
elif [ "${shortname}" == "sf" ]; then
array_configs+=(GameUserSettings.ini)
fn_fetch_default_config
fn_default_config_remote
fn_set_config_vars
fn_list_config_locations
elif [ "${shortname}" == "sm" ]; then
fn_default_config_local
fn_list_config_locations
elif [ "${shortname}" == "sol" ]; then
array_configs+=(soldat.ini)
fn_fetch_default_config
fn_default_config_remote
fn_set_config_vars
fn_list_config_locations
elif [ "${shortname}" == "sof2" ]; then
array_configs+=(server.cfg mapcycle.txt)
fn_fetch_default_config
fn_default_config_remote
fn_set_config_vars
fn_list_config_locations
elif [ "${shortname}" == "sfc" ]; then
array_configs+=(server.cfg)
fn_fetch_default_config
fn_default_config_remote
fn_set_config_vars
fn_list_config_locations
elif [ "${shortname}" == "squad" ]; then
array_configs+=(Admins.cfg Bans.cfg License.cfg Server.cfg Rcon.cfg)
fn_fetch_default_config
fn_default_config_remote
fn_set_config_vars
fn_list_config_locations
elif [ "${shortname}" == "sb" ]; then
array_configs+=(starbound_server.config)
fn_fetch_default_config
fn_default_config_remote
fn_set_config_vars
fn_list_config_locations
elif [ "${shortname}" == "st" ]; then
array_configs+=(setting.xml)
fn_default_config_remote
fn_set_config_vars
fn_list_config_locations
elif [ "${shortname}" == "stn" ]; then
array_configs+=(ServerConfig.txt ServerUsers.txt TpPresets.json UserPermissions.json)
fn_fetch_default_config
fn_default_config_remote
fn_set_config_vars
fn_list_config_locations
elif [ "${shortname}" == "sven" ]; then
array_configs+=(server.cfg)
fn_fetch_default_config
fn_default_config_remote
fn_set_config_vars
fn_list_config_locations
elif [ "${shortname}" == "tf2" ]; then
array_configs+=(server.cfg)
fn_fetch_default_config
fn_default_config_remote
fn_set_config_vars
fn_list_config_locations
elif [ "${shortname}" == "tfc" ]; then
array_configs+=(server.cfg)
fn_fetch_default_config
fn_default_config_remote
fn_set_config_vars
fn_list_config_locations
elif [ "${shortname}" == "ti" ]; then
array_configs+=(Game.ini Engine.ini)
fn_fetch_default_config
fn_default_config_remote
fn_set_config_vars
fn_list_config_locations
elif [ "${shortname}" == "ts" ]; then
array_configs+=(server.cfg)
fn_fetch_default_config
fn_default_config_remote
fn_set_config_vars
fn_list_config_locations
elif [ "${shortname}" == "ts3" ]; then
array_configs+=(ts3server.ini)
fn_fetch_default_config
fn_default_config_remote
fn_list_config_locations
elif [ "${shortname}" == "tw" ]; then
array_configs+=(server.cfg ctf.cfg dm.cfg duel.cfg tdm.cfg)
fn_fetch_default_config
fn_default_config_remote
fn_set_config_vars
fn_list_config_locations
elif [ "${shortname}" == "terraria" ]; then
array_configs+=(serverconfig.txt)
fn_fetch_default_config
fn_default_config_remote
fn_set_config_vars
fn_list_config_locations
elif [ "${shortname}" == "tu" ]; then
fn_check_cfgdir
array_configs+=(TowerServer.ini)
fn_fetch_default_config
fn_default_config_remote
fn_set_config_vars
fn_list_config_locations
elif [ "${shortname}" == "ut" ]; then
array_configs+=(Game.ini Engine.ini)
fn_fetch_default_config
fn_default_config_remote
fn_set_config_vars
fn_list_config_locations
elif [ "${shortname}" == "ut2k4" ]; then
array_configs+=(UT2004.ini)
fn_fetch_default_config
fn_default_config_remote
fn_set_config_vars
fn_list_config_locations
elif [ "${shortname}" == "ut99" ]; then
array_configs+=(Default.ini)
fn_fetch_default_config
fn_default_config_remote
fn_set_config_vars
fn_list_config_locations
@ -821,25 +764,21 @@ elif [ "${shortname}" == "vints" ]; then
:
elif [ "${shortname}" == "vs" ]; then
array_configs+=(server.cfg)
fn_fetch_default_config
fn_default_config_remote
fn_set_config_vars
fn_list_config_locations
elif [ "${shortname}" == "wet" ]; then
array_configs+=(server.cfg)
fn_fetch_default_config
fn_default_config_remote
fn_set_config_vars
fn_list_config_locations
elif [ "${shortname}" == "wf" ]; then
array_configs+=(server.cfg)
fn_fetch_default_config
fn_default_config_remote
fn_set_config_vars
fn_list_config_locations
elif [ "${shortname}" == "wmc" ]; then
array_configs+=(config.yml)
fn_fetch_default_config
fn_default_config_remote
fn_set_config_vars
fn_list_config_locations
@ -851,19 +790,16 @@ elif [ "${shortname}" == "xnt" ]; then
fn_list_config_locations
elif [ "${shortname}" == "wurm" ]; then
array_configs+=(server.cfg)
fn_fetch_default_config
fn_default_config_remote
fn_set_config_vars
fn_list_config_locations
elif [ "${shortname}" == "zmr" ]; then
array_configs+=(server.cfg)
fn_fetch_default_config
fn_default_config_remote
fn_set_config_vars
fn_list_config_locations
elif [ "${shortname}" == "zps" ]; then
array_configs+=(server.cfg)
fn_fetch_default_config
fn_default_config_remote
fn_set_config_vars
fn_list_config_locations

2
lgsm/modules/install_dst_token.sh

@ -12,7 +12,7 @@ echo -e "${bold}${lightyellow}Enter ${gamename} Cluster Token${default}"
fn_messages_separator
echo -e "A cluster token is required to run this server!"
echo -e "Follow the instructions in this link to obtain this key:"
echo -e "https://linuxgsm.com/dst-auth-token"
echo -e "${italic}https://linuxgsm.com/dst-auth-token"
echo -e ""
if [ -z "${autoinstall}" ]; then
overwritetoken="true"

4
lgsm/modules/install_eula.sh

@ -19,11 +19,11 @@ echo -e ""
echo -e "${bold}${lightyellow}Accept ${gamename} EULA${default}"
fn_messages_separator
echo -e "You are required to accept the EULA:"
echo -e "${eulaurl}"
echo -e ""
echo -e "${italic}${eulaurl}${default}"
echo -e ""
if [ -z "${autoinstall}" ]; then
echo -e "By continuing you are indicating your agreement to the EULA."
echo -e ""
if ! fn_prompt_yn "Continue?" Y; then
exitcode=0
core_exit.sh

20
lgsm/modules/install_gslt.sh

@ -11,17 +11,16 @@ echo -e ""
echo -e "${bold}${lightyellow}Game Server Login Token${default}"
fn_messages_separator
if [ "${shortname}" == "csgo" ] || [ "${shortname}" == "css" ] || [ "${shortname}" == "nmrih" ] || [ "${shortname}" == "bs" ]; then
echo -e "GSLT is required to run a public ${gamename} server"
echo -e "GSLT is required to run a public ${gamename} server."
fn_script_log_info "GSLT is required to run a public ${gamename} server"
else
echo -e "GSLT is an optional feature for ${gamename} server"
echo -e "GSLT is an optional feature for ${gamename} server."
fn_script_log_info "GSLT is an optional feature for ${gamename} server"
fi
echo -e "Get more info and a token here:"
echo -e "https://docs.linuxgsm.com/steamcmd/gslt"
fn_script_log_info "Get more info and a token here:"
fn_script_log_info "https://docs.linuxgsm.com/steamcmd/gslt"
echo -e ""
echo -e "More info: ${italic}https://docs.linuxgsm.com/steamcmd/gslt${default}"
fn_script_log_info "More info: https://docs.linuxgsm.com/steamcmd/gslt"
echo -e ""
if [ -z "${autoinstall}" ]; then
if [ "${shortname}" != "tu" ]; then
@ -37,11 +36,10 @@ if [ -z "${autoinstall}" ]; then
fi
if [ "${shortname}" == "tu" ]; then
echo -e "The GSLT can be changed by editing ${servercfgdir}/${servercfg}."
fn_script_log_info "The GSLT can be changed by editing ${servercfgdir}/${servercfg}."
echo -e "The GSLT can be changed by editing: ${italic}${servercfgdir}/${servercfg}${default}"
fn_script_log_info "The GSLT can be changed by editing: ${servercfgdir}/${servercfg}."
else
echo -e "The GSLT can be changed by editing ${configdirserver}/${selfname}.cfg."
fn_script_log_info "The GSLT can be changed by editing ${configdirserver}/${selfname}.cfg."
echo -e "The GSLT can be changed by editing: ${italic}${configdirserver}/${selfname}.cfg${default}"
fn_script_log_info "The GSLT can be changed by editing: ${configdirserver}/${selfname}.cfg."
fi
fn_sleep_time_1
echo -e ""

98
lgsm/modules/install_logs.sh

@ -7,93 +7,117 @@
moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
if [ "${checklogs}" != "1" ]; then
if [ -z "${checklogs}" ]; then
echo -e ""
echo -e "${bold}${lightyellow}Creating Log Directories${default}"
fn_messages_separator
fi
# Create LinuxGSM logs.
echo -en "installing log dir: ${logdir}..."
mkdir -p "${logdir}"
if [ $? != 0 ]; then
fn_print_fail_eol_nl
core_exit.sh
else
fn_print_ok_eol_nl
fi
echo -en "installing LinuxGSM log dir: ${lgsmlogdir}..."
mkdir -p "${lgsmlogdir}"
if [ $? != 0 ]; then
fn_print_fail_eol_nl
core_exit.sh
echo -en "creating log directory [ ${italic}${logdir}${default} ]"
if [ ! -d "${logdir}" ]; then
if ! mkdir -p "${logdir}"; then
fn_print_fail_eol_nl
core_exit.sh
else
fn_print_ok_eol_nl
fi
else
fn_print_ok_eol_nl
fn_print_skip_eol_nl
fi
echo -en "creating LinuxGSM log: ${lgsmlog}..."
touch "${lgsmlog}"
if [ $? != 0 ]; then
fn_print_fail_eol_nl
core_exit.sh
echo -en "creating script log directory [ ${italic}${lgsmlogdir}${default} ]"
if [ ! -d "${lgsmlogdir}" ]; then
if ! mkdir -p "${lgsmlogdir}"; then
fn_print_fail_eol_nl
core_exit.sh
else
fn_print_ok_eol_nl
fi
else
fn_print_ok_eol_nl
fn_print_skip_eol_nl
fi
# Create Console logs.
if [ "${consolelogdir}" ]; then
echo -en "installing console log dir: ${consolelogdir}..."
mkdir -p "${consolelogdir}"
if [ $? != 0 ]; then
echo -en "creating script log [ ${italic}${lgsmlog}${default} ]"
if [ ! -f "${lgsmlog}" ]; then
if ! touch "${lgsmlog}"; then
fn_print_fail_eol_nl
core_exit.sh
else
fn_print_ok_eol_nl
fi
echo -en "creating console log: ${consolelog}..."
if ! touch "${consolelog}"; then
else
fn_print_skip_eol_nl
fi
echo -en "creating console log directory [ ${italic}${consolelogdir}${default} ]"
if [ ! -d "${consolelogdir}" ]; then
if ! mkdir -p "${consolelogdir}"; then
fn_print_fail_eol_nl
core_exit.sh
else
fn_print_ok_eol_nl
fi
else
fn_print_skip_eol_nl
fi
# Create Game logs.
if [ "${gamelogdir}" ] && [ ! -d "${gamelogdir}" ]; then
echo -en "installing game log dir: ${gamelogdir}..."
if ! mkdir -p "${gamelogdir}"; then
echo -en "creating console log [ ${italic}${consolelog}${default} ]"
if [ ! -f "${consolelog}" ]; then
if ! touch "${consolelog}"; then
fn_print_fail_eol_nl
core_exit.sh
else
fn_print_ok_eol_nl
fi
else
fn_print_skip_eol_nl
fi
if [ -n "${gamelogdir}" ]; then
echo -en "creating game log directory [ ${italic}${gamelogdir}${default} ]"
if [ ! -d "${gamelogdir}" ]; then
if ! mkdir -p "${gamelogdir}"; then
fn_print_fail_eol_nl
core_exit.sh
else
fn_print_ok_eol_nl
fi
else
fn_print_skip_eol_nl
fi
fi
# Symlink to gamelogdir
# unless gamelogdir is within logdir.
# e.g serverfiles/log is not within log/: symlink created
# log/server is in log/: symlink not created
if [ "${gamelogdir}" ]; then
if [ "${gamelogdir:0:${#logdir}}" != "${logdir}" ]; then
echo -en "creating symlink to game log dir: ${logdir}/server -> ${gamelogdir}..."
if [ -n "${gamelogdir}" ] && [ "${gamelogdir:0:${#logdir}}" != "${logdir}" ]; then
echo -en "creating symlink to game log directory [ ${italic}${logdir}/server -> ${gamelogdir}${default} ]"
# if path does not exist or does not match gamelogdir
if [ ! -h "${logdir}/server" ] || [ "$(readlink -f "${logdir}/server")" != "${gamelogdir}" ]; then
if ! ln -nfs "${gamelogdir}" "${logdir}/server"; then
fn_print_fail_eol_nl
core_exit.sh
else
fn_print_ok_eol_nl
fi
else
fn_print_skip_eol_nl
fi
fi
# If server uses SteamCMD create a symbolic link to the Steam logs.
if [ -d "${HOME}/.steam/steam/logs" ]; then
echo -en "creating symlink to steam log directory [ ${italic}${logdir}/steam -> ${HOME}/.steam/steam/logs${default} ]"
if [ ! -L "${logdir}/steam" ]; then
echo -en "creating symlink to steam log dir: ${logdir}/steam -> ${HOME}/.steam/steam/logs..."
if ! ln -nfs "${HOME}/.steam/steam/logs" "${logdir}/steam"; then
fn_print_fail_eol_nl
core_exit.sh
else
fn_print_ok_eol_nl
fi
else
fn_print_skip_eol_nl
fi
fi
fn_script_log_info "Logs installed"

12
lgsm/modules/install_server_dir.sh

@ -10,10 +10,16 @@ moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
echo -e ""
echo -e "${bold}${lightyellow}Server Directory${default}"
fn_messages_separator
echo -en "creating serverfiles directory [ ${italic}${serverfiles}${default} ]"
if [ -d "${serverfiles}" ]; then
fn_print_warning_nl "A server is already installed here."
fn_print_skip_eol_nl
echo -e ""
echo -e "${italic}A game server is already exists at this location.${default}"
else
fn_print_ok_eol_nl
fi
pwd
if [ -z "${autoinstall}" ]; then
if ! fn_prompt_yn "Continue?" Y; then
exitcode=0
@ -21,5 +27,5 @@ if [ -z "${autoinstall}" ]; then
fi
fi
if [ ! -d "${serverfiles}" ]; then
mkdir -v "${serverfiles}"
mkdir "${serverfiles}"
fi

7
lgsm/modules/install_server_files.sh

@ -241,6 +241,10 @@ fn_install_server_files() {
fn_clear_tmp
}
if [ "${shortname}" == "mc" ] || [ "${shortname}" == "pmc" ] || [ "${shortname}" == "ut" ]; then
install_eula.sh
fi
echo -e ""
echo -e "${bold}${lightyellow}Installing ${gamename} Server${default}"
fn_messages_separator
@ -255,12 +259,10 @@ fi
if [ "${shortname}" == "ts3" ]; then
update_ts3.sh
elif [ "${shortname}" == "mc" ]; then
install_eula.sh
update_mc.sh
elif [ "${shortname}" == "mcb" ]; then
update_mcb.sh
elif [ "${shortname}" == "pmc" ]; then
install_eula.sh
update_pmc.sh
elif [ "${shortname}" == "wmc" ] || [ "${shortname}" == "vpmc" ]; then
update_pmc.sh
@ -287,7 +289,6 @@ fi
if [ -z "${autoinstall}" ]; then
echo -e ""
fn_messages_separator
if ! fn_prompt_yn "Was the install successful?" Y; then
install_retry.sh
fi

2
lgsm/modules/install_squad_license.sh

@ -14,7 +14,7 @@ echo -e "Server license is an optional feature for ${gamename} server"
fn_script_log_info "Server license is an optional feature for ${gamename} server"
echo -e "Get more info and a server license here:"
echo -e "https://squad.fandom.com/wiki/Server_licensing"
echo -e "${italic}https://squad.fandom.com/wiki/Server_licensing"
fn_script_log_info "Get more info and a server license here:"
fn_script_log_info "https://squad.fandom.com/wiki/Server_licensing"
echo -e ""

4
lgsm/modules/install_stats.sh

@ -13,6 +13,7 @@ fn_messages_separator
echo -e "Assist LinuxGSM development by sending anonymous stats to developers."
echo -e "Collected data is publicly available: ${italic}https://linuxgsm.com/data/usage${default}"
echo -e "More info: ${italic}https://docs.linuxgsm.com/configuration/linuxgsm-stats${default}"
echo -e ""
echo -e "The following info will be sent: "
echo -e "* game server"
echo -e "* distro"
@ -24,5 +25,6 @@ if [ -z "${autoinstall}" ]; then
fn_print_information_nl "Stats setting is now enabled in common.cfg."
fi
else
fn_print_information_nl "auto-install leaves stats off by default. Stats can be enabled in common.cfg"
echo -e ""
echo -e "auto-install leaves stats off by default. Stats can be enabled in ${italic}common.cfg${default}"
fi

4
lgsm/modules/install_ts3db.sh

@ -11,8 +11,8 @@ fn_install_ts3db_mariadb() {
if [ ! -f "${serverfiles}/libts3db_mariadb.so" ]; then
echo -e "copying libmariadb.so.2...\c"
cp "${serverfiles}/redist/libmariadb.so.2" "${serverfiles}"
local exitcode=$?
if [ "${exitcode}" != "0" ]; then
exitcode=$?
if [ "${exitcode}" -ne 0 ]; then
fn_print_fail_eol_nl
fn_script_log_fail "copying libmariadb.so.2"
core_exit.sh

2
lgsm/modules/install_ut2k4_key.sh

@ -12,7 +12,7 @@ echo -e "${bold}${lightyellow}Enter ${gamename} CD Key${default}"
fn_messages_separator
echo -e "To get your server listed on the Master Server list"
echo -e "you must get a free CD key. Get a key here:"
echo -e "https://www.epicgames.com/unrealtournament/forums/cdkey.php?2004"
echo -e "${italic}https://www.epicgames.com/unrealtournament/forums/cdkey.php?2004"
echo -e ""
if [ -z "${autoinstall}" ]; then
echo -e "Once you have the key enter it below"

62
lgsm/modules/mods_core.sh

@ -57,8 +57,8 @@ fn_mod_lowercase() {
# Finally we can rename the file
mv "${src}" "${dst}"
# Exit if it fails for any reason
local exitcode=$?
if [ "${exitcode}" != 0 ]; then
exitcode=$?
if [ "${exitcode}" -ne 0 ]; then
fn_print_fail_eol_nl
core_exit.sh
fi
@ -74,8 +74,8 @@ fn_mod_create_filelist() {
fn_sleep_time
# ${modsdir}/${modcommand}-files.txt.
find "${extractdest}" -mindepth 1 -printf '%P\n' > "${modsdir}/${modcommand}-files.txt"
local exitcode=$?
if [ "${exitcode}" != 0 ]; then
exitcode=$?
if [ "${exitcode}" -ne 0 ]; then
fn_print_fail_eol_nl
fn_script_log_fail "Building ${modsdir}/${modcommand}-files.txt"
core_exit.sh
@ -94,8 +94,8 @@ fn_mod_copy_destination() {
echo -en "copying ${modprettyname} to ${modinstalldir}..."
fn_sleep_time
cp -Rf "${extractdest}/." "${modinstalldir}/"
local exitcode=$?
if [ "${exitcode}" != 0 ]; then
exitcode=$?
if [ "${exitcode}" -ne 0 ]; then
fn_print_fail_eol_nl
fn_script_log_fail "Copying ${modprettyname} to ${modinstalldir}"
else
@ -132,8 +132,8 @@ fn_mod_tidy_files_list() {
# Delete line(s) matching exactly.
sed -i "/^${removefilevar}$/d" "${modsdir}/${modcommand}-files.txt"
# Exit on error.
local exitcode=$?
if [ "${exitcode}" != 0 ]; then
exitcode=$?
if [ "${exitcode}" -ne 0 ]; then
fn_print_fail_eol_nl
fn_script_log_fail "Error while tidying line: ${removefilevar} from: ${modsdir}/${modcommand}-files.txt"
core_exit.sh
@ -388,7 +388,7 @@ fn_create_mods_dir() {
echo -en "creating LinuxGSM mods data directory ${modsdir}..."
mkdir -p "${modsdir}"
exitcode=$?
if [ "${exitcode}" != 0 ]; then
if [ "${exitcode}" -ne 0 ]; then
fn_print_fail_eol_nl
fn_script_log_fail "Creating mod download dir ${modsdir}"
core_exit.sh
@ -402,7 +402,7 @@ fn_create_mods_dir() {
echo -en "creating mods install directory ${modinstalldir}..."
mkdir -p "${modinstalldir}"
exitcode=$?
if [ "${exitcode}" != 0 ]; then
if [ "${exitcode}" -ne 0 ]; then
fn_print_fail_eol_nl
fn_script_log_fail "Creating mod install directory ${modinstalldir}"
core_exit.sh
@ -412,7 +412,7 @@ fn_create_mods_dir() {
fi
fi
# Create lgsm/data/${modsinstalledlist}.
# Create ${datadir}/${modsinstalledlist}.
if [ ! -f "${modsinstalledlistfullpath}" ]; then
touch "${modsinstalledlistfullpath}"
fn_script_log_info "Created ${modsinstalledlistfullpath}"
@ -425,7 +425,7 @@ fn_mods_create_tmp_dir() {
mkdir -p "${modstmpdir}"
exitcode=$?
echo -en "creating mod download directory ${modstmpdir}..."
if [ "${exitcode}" != 0 ]; then
if [ "${exitcode}" -ne 0 ]; then
fn_print_fail_eol_nl
fn_script_log_fail "Creating mod download directory ${modstmpdir}"
core_exit.sh
@ -442,7 +442,7 @@ fn_mods_clear_tmp_dir() {
echo -en "clearing mod download directory ${modstmpdir}..."
rm -rf "${modstmpdir:?}"
exitcode=$?
if [ "${exitcode}" != 0 ]; then
if [ "${exitcode}" -ne 0 ]; then
fn_print_fail_eol_nl
fn_script_log_fail "Clearing mod download directory ${modstmpdir}"
core_exit.sh
@ -580,7 +580,7 @@ fn_mod_install_liblist_gam_file() {
grep -q "addons/metamod/dlls/metamod.dll" "${modinstalldir}/liblist.gam"
exitcode=$?
# if replacement back didn't happen, error out.
if [ "${exitcode}" != 0 ]; then
if [ "${exitcode}" -ne 0 ]; then
fn_script_log_fail "${logentry}"
fn_print_fail_eol_nl
else
@ -596,7 +596,7 @@ fn_mod_install_liblist_gam_file() {
grep -q "addons/metamod/dlls/metamod.so" "${modinstalldir}/liblist.gam"
exitcode=$?
# if replacement back didn't happen, error out
if [ "${exitcode}" != 0 ]; then
if [ "${exitcode}" -ne 0 ]; then
fn_script_log_fail "${logentry}"
fn_print_fail_eol_nl
else
@ -614,11 +614,11 @@ fn_mod_install_liblist_gam_file() {
grep -q "addons/metamod/dlls/metamod.dylib" "${modinstalldir}/liblist.gam"
exitcode=$?
# if replacement back didn't happen, error out.
if [ "${exitcode}" != 0 ]; then
if [ "${exitcode}" -ne 0 ]; then
fn_script_log_fail "${logentry}"
fn_print_fail_eol_nl
else
fn_script_log_pass ${logentry}
fn_script_log_pass "${logentry}"
fn_print_ok_eol_nl
fi
fi
@ -638,11 +638,11 @@ fn_mod_remove_liblist_gam_file() {
grep -q "${moddll}" "${modinstalldir}/liblist.gam"
exitcode=$?
# if replacement back didn't happen, error out.
if [ "${exitcode}" != 0 ]; then
if [ "${exitcode}" -ne 0 ]; then
fn_script_log_fail "${logentry}"
fn_print_fail_eol_nl
else
fn_script_log_pass ${logentry}
fn_script_log_pass "${logentry}"
fn_print_ok_eol_nl
fi
@ -654,11 +654,11 @@ fn_mod_remove_liblist_gam_file() {
grep -q "${modso}" "${modinstalldir}/liblist.gam"
exitcode=$?
# if replacement back didn't happen, error out
if [ "${exitcode}" != 0 ]; then
if [ "${exitcode}" -ne 0 ]; then
fn_script_log_fail "${logentry}"
fn_print_fail_eol_nl
else
fn_script_log_pass ${logentry}
fn_script_log_pass "${logentry}"
fn_print_ok_eol_nl
fi
@ -672,11 +672,11 @@ fn_mod_remove_liblist_gam_file() {
grep -q "${moddylib}" "${modinstalldir}/liblist.gam"
# if replacement back didn't happen, error out.
exitcode=$?
if [ "${exitcode}" != 0 ]; then
if [ "${exitcode}" -ne 0 ]; then
fn_script_log_fail "${logentry}"
fn_print_fail_eol_nl
else
fn_script_log_pass ${logentry}
fn_script_log_pass "${logentry}"
fn_print_ok_eol_nl
fi
fi
@ -691,15 +691,15 @@ fn_mod_install_amxmodx_file() {
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
if [ "${exitcode}" -ne 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
if [ "${exitcode}" -ne 0 ]; then
fn_script_log_fail "${logentry}"
fn_print_fail_eol_nl
else
fn_script_log_pass ${logentry}
fn_script_log_pass "${logentry}"
fn_print_ok_eol_nl
fi
fi
@ -707,12 +707,12 @@ fn_mod_install_amxmodx_file() {
# 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
if [ "${exitcode}" -ne 0 ]; then
fn_script_log_fail "${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
@ -726,17 +726,17 @@ fn_mod_remove_amxmodx_file() {
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
if [ "${exitcode}" -eq 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
if [ "${exitcode}" -ne 0 ]; then
fn_script_log_fail "${logentry}"
fn_print_fail_eol_nl
else
fn_script_log_pass ${logentry}
fn_script_log_pass "${logentry}"
fn_print_ok_eol_nl
fi

4
lgsm/modules/query_gamedig.sh

@ -42,9 +42,7 @@ if [ "$(command -v "${gamedigbinary}" 2> /dev/null)" ] && [ "$(command -v jq 2>
fi
# numplayers.
if [ "${querytype}" == "minecraft" ]; then
gdplayers=$(echo "${gamedigraw}" | jq -re '.players | length-1')
elif [ "${querytype}" == "teamspeak3" ]; then
if [ "${querytype}" == "teamspeak3" ]; then
gdplayers=$(echo "${gamedigraw}" | jq -re '.raw.virtualserver_clientsonline')
else
gdplayers=$(echo "${gamedigraw}" | jq -re '.players | length')

14
lgsm/modules/query_gsquery.py

@ -11,7 +11,7 @@ import socket
import sys
engine_types = ('protocol-valve', 'protocol-quake2', 'protocol-quake3', 'protocol-gamespy1',
'protocol-unreal2', 'ut3', 'minecraft', 'minecraftbe', 'jc2m', 'mumbleping', 'soldat', 'teeworlds')
'protocol-unreal2', 'ut3', 'minecraft', 'minecraftbe', 'jc2mp', 'mumbleping', 'soldat', 'teeworlds')
class gsquery:
@ -22,11 +22,11 @@ class gsquery:
idtech2query = ('protocol-quake2', 'idtech2', 'quake', 'iw2.0')
idtech3query = ('protocol-quake3', 'iw3.0', 'ioquake3', 'qfusion')
minecraftquery = ('minecraft', 'lwjgl2')
minecraftbequery = ('minecraftbe',)
jc2mquery = ('jc2m',)
mumblequery = ('mumbleping',)
soldatquery = ('soldat',)
twquery = ('teeworlds',)
minecraftbequery = ('minecraftbe')
jc2mpquery = ('jc2mp')
mumblequery = ('mumbleping')
soldatquery = ('soldat')
twquery = ('teeworlds')
unrealquery = ('protocol-gamespy1', 'unreal')
unreal2query = ('protocol-unreal2', 'unreal2')
unreal3query = ('ut3', 'unreal3')
@ -40,7 +40,7 @@ class gsquery:
self.query_prompt_string = b'\xff\xff\xff\xffstatus\x00'
elif self.argument.engine in self.idtech3query:
self.query_prompt_string = b'\xff\xff\xff\xffgetstatus'
elif self.argument.engine in self.jc2mquery:
elif self.argument.engine in self.jc2mpquery:
self.query_prompt_string = b'\xFE\xFD\x09\x10\x20\x30\x40'
elif self.argument.engine in self.minecraftquery:
self.query_prompt_string = b'\xFE\xFD\x09\x3d\x54\x1f\x93'

6
lgsm/modules/update_jk2.sh

@ -152,6 +152,12 @@ fn_update_compare() {
# The location where the builds are checked and downloaded.
remotelocation="github.com"
if [ "$(command -v jq 2> /dev/null)" ]; then
fn_print_fail_nl "jq is not installed"
fn_script_log_fatal "jq is not installed"
core_exit.sh
fi
if [ "${firstcommandname}" == "INSTALL" ]; then
fn_update_remotebuild
fn_update_dl

6
lgsm/modules/update_mc.sh

@ -167,6 +167,12 @@ fn_update_compare() {
# The location where the builds are checked and downloaded.
remotelocation="mojang.com"
if [ "$(command -v jq 2> /dev/null)" ]; then
fn_print_fail_nl "jq is not installed"
fn_script_log_fatal "jq is not installed"
core_exit.sh
fi
if [ "${firstcommandname}" == "INSTALL" ]; then
fn_update_remotebuild
fn_update_dl

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

Loading…
Cancel
Save