Browse Source

Merge branch 'develop' into master

pull/3125/head
legendofmiracles 5 years ago
committed by GitHub
parent
commit
a86fa1ba64
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 178
      lgsm/config-default/config-lgsm/colserver/_default.cfg
  2. 2
      lgsm/config-default/config-lgsm/gmodserver/_default.cfg
  3. 4
      lgsm/config-default/config-lgsm/mcserver/_default.cfg
  4. 2
      lgsm/config-default/config-lgsm/rustserver/_default.cfg
  5. 168
      lgsm/config-default/config-lgsm/scpslserver/_default.cfg
  6. 168
      lgsm/config-default/config-lgsm/scpslsmserver/_default.cfg
  7. 5
      lgsm/config-default/config-lgsm/secrets-common-template.cfg
  8. 5
      lgsm/config-default/config-lgsm/secrets-instance-template.cfg
  9. 171
      lgsm/config-default/config-lgsm/vintsserver/_default.cfg
  10. 4
      lgsm/data/serverlist.csv
  11. 11
      lgsm/functions/alert.sh
  12. 13
      lgsm/functions/check_config.sh
  13. 34
      lgsm/functions/check_deps.sh
  14. 141
      lgsm/functions/check_steamcmd.sh
  15. 24
      lgsm/functions/command_check_update.sh
  16. 21
      lgsm/functions/command_skeleton.sh
  17. 2
      lgsm/functions/command_stop.sh
  18. 2
      lgsm/functions/command_update.sh
  19. 3
      lgsm/functions/core_dl.sh
  20. 22
      lgsm/functions/core_functions.sh
  21. 10
      lgsm/functions/core_getopt.sh
  22. 322
      lgsm/functions/core_steamcmd.sh
  23. 2
      lgsm/functions/fix_steamcmd.sh
  24. 70
      lgsm/functions/info_config.sh
  25. 38
      lgsm/functions/info_messages.sh
  26. 7
      lgsm/functions/info_parms.sh
  27. 21
      lgsm/functions/install_config.sh
  28. 2
      lgsm/functions/install_server_files.sh
  29. 2
      lgsm/functions/update_minecraft.sh
  30. 187
      lgsm/functions/update_steamcmd.sh
  31. 145
      lgsm/functions/update_vintagestory.sh
  32. 20
      linuxgsm.sh
  33. 20
      tests/tests_fctrserver.sh
  34. 20
      tests/tests_jc2server.sh
  35. 20
      tests/tests_mcserver.sh
  36. 20
      tests/tests_ts3server.sh

178
lgsm/config-default/config-lgsm/colserver/_default.cfg

@ -0,0 +1,178 @@
##################################
######## Default Settings ########
##################################
# DO NOT EDIT, ANY CHANGES WILL BE OVERWRITTEN!
# Copy settings from here and use them in either:
# common.cfg - applies settings to every instance.
# [instance].cfg - applies settings to a specific instance.
#### Game Server Settings ####
## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters
# Edit with care | https://colonysurvival.gamepedia.com/Dedicated_Server#Installation_.28Linux.29
fn_parms(){
parms="-batchmode -nographics +server.config ${servercfgfullpath}"
}
#### LinuxGSM Settings ####
## LinuxGSM Stats
# Send useful stats to LinuxGSM developers.
# https://docs.linuxgsm.com/configuration/linuxgsm-stats
# (on|off)
stats="off"
## Notification Alerts
# (on|off)
# Display IP | https://docs.linuxgsm.com/alerts#display-ip
displayip=""
# More info | https://docs.linuxgsm.com/alerts#more-info
postalert="off"
# Discord Alerts | https://docs.linuxgsm.com/alerts/discord
discordalert="off"
discordwebhook="webhook"
# Email Alerts | https://docs.linuxgsm.com/alerts/email
emailalert="off"
email="[email protected]"
emailfrom=""
# IFTTT Alerts | https://docs.linuxgsm.com/alerts/ifttt
iftttalert="off"
ifttttoken="accesstoken"
iftttevent="linuxgsm_alert"
# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun
mailgunalert="off"
mailgunapiregion="us"
mailguntoken="accesstoken"
mailgundomain="example.com"
mailgunemailfrom="[email protected]"
mailgunemail="[email protected]"
# Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet
pushbulletalert="off"
pushbullettoken="accesstoken"
channeltag=""
# Pushover Alerts | https://docs.linuxgsm.com/alerts/pushover
pushoveralert="off"
pushovertoken="accesstoken"
pushoveruserkey="userkey"
# Rocket.Chat Alerts | https://docs.linuxgsm.com/alerts/rocket.chat
rocketchatalert="off"
rocketchatwebhook="webhook"
rocketchattoken=""
# Slack Alerts | https://docs.linuxgsm.com/alerts/slack
slackalert="off"
slackwebhook="webhook"
# Telegram Alerts | https://docs.linuxgsm.com/alerts/telegram
# You can add a custom cURL string eg proxy (useful in Russia) in "curlcustomstring".
# For example "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help".
telegramalert="off"
telegramtoken="accesstoken"
telegramchatid=""
curlcustomstring=""
## Updating | https://docs.linuxgsm.com/commands/update
updateonstart="off"
## Backup | https://docs.linuxgsm.com/commands/backup
maxbackups="4"
maxbackupdays="30"
stoponbackup="on"
## Logging | https://docs.linuxgsm.com/features/logging
consolelogging="on"
logdays="7"
## Monitor | https://docs.linuxgsm.com/commands/monitor
# Query delay time
querydelay="1"
## ANSI Colors | https://docs.linuxgsm.com/features/ansi-colors
ansi="on"
#### Advanced Settings ####
## Message Display Time | https://docs.linuxgsm.com/features/message-display-time
sleeptime="0.5"
## SteamCMD Settings | https://docs.linuxgsm.com/steamcmd
# Server appid
appid="748090"
# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch
branch=""
betapassword=""
# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server
steammaster="false"
## Stop Mode | https://docs.linuxgsm.com/features/stop-mode
# 1: tmux kill
# 2: CTRL+c
# 3: quit
# 4: quit 120s
# 5: stop
# 6: q
# 7: exit
# 8: 7 Days to Die
# 9: GoldSrc
# 10: Avorion
# 11: end
stopmode="2"
## Query mode
# 1: session only
# 2: gamedig (gsquery fallback)
# 3: gamedig
# 4: gsquery
# 5: tcp
querymode="2"
querytype="protocol-valve"
## Console type
consoleverbose="no"
consoleinteract="no"
## Game Server Details
# Do not edit
gamename="Colony Survival"
engine="unity3d"
glibc="2.15"
#### Directories ####
# Edit with care
## Game Server Directories
systemdir="${serverfiles}"
executabledir="${serverfiles}"
executable="./colonyserver.x86_64"
servercfgdir="${systemdir}/gamedata/settings"
servercfg="${selfname}.json"
servercfgdefault="colserver.json"
servercfgfullpath="${servercfgdir}/${servercfg}"
## Backup Directory
backupdir="${lgsmdir}/backup"
## Logging Directories
logdir="${rootdir}/log"
gamelogdir="${serverfiles}/gamedata/logs/server/"
lgsmlogdir="${logdir}/script"
consolelogdir="${logdir}/console"
gamelog="${gamelogdir}/${selfname}-game.log"
lgsmlog="${lgsmlogdir}/${selfname}-script.log"
consolelog="${consolelogdir}/${selfname}-console.log"
alertlog="${lgsmlogdir}/${selfname}-alert.log"
postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log"
## Logs Naming
gamelogdate="${gamelogdir}/${selfname}-game-$(date '+%Y-%m-%d-%H:%M:%S').log"
lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log"
consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log"

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

@ -18,7 +18,7 @@ maxplayers="16"
tickrate="66"
gamemode="sandbox"
## Workshop Parameters | https://wiki.garrysmod.com/page/Workshop_for_Dedicated_Servers
## Workshop Parameters | https://wiki.facepunch.com/gmod/Workshop_for_Dedicated_Servers
# To get an API key visit - https://steamcommunity.com/dev/apikey
wsapikey=""
wscollectionid=""

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

@ -14,6 +14,7 @@ javaram="1024" # -Xmx$1024M
## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters
fn_parms(){
parms="nogui"
executable="java -Xmx${javaram}M -jar ${jarfile}"
}
## Release Settings | https://docs.linuxgsm.com/game-servers/minecraft#release-settings
@ -151,7 +152,8 @@ glibc="null"
## Game Server Directories
systemdir="${serverfiles}"
executabledir="${serverfiles}"
executable="java -Xmx${javaram}M -jar ${serverfiles}/minecraft_server.jar"
jarfile="${serverfiles}/minecraft_server.jar"
executable="${jarfile}"
servercfgdir="${systemdir}"
servercfg="server.properties"
servercfgdefault="server.properties"

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

@ -14,7 +14,7 @@ port="28015"
rconport="28016"
appport=28082
rconpassword="CHANGE_ME"
rconweb="1" # Value is: 1 for the Facepunch web panel; 0 for RCON tools like Rusty or Rustadmin.
rconweb="1" # Value is: 1 for the Facepunch web panel, Rustadmin desktop and Rustadmin Online; 0 for RCON tools like Rusty.
servername="Rust"
maxplayers="50"
seed="" # range: 1-2147483647, used to reproduce a procedural map.

168
lgsm/config-default/config-lgsm/scpslserver/_default.cfg

@ -0,0 +1,168 @@
##################################
######## Default Settings ########
##################################
# DO NOT EDIT WILL BE OVERWRITTEN!
# Copy settings from here and use them in either
# common.cfg - applies settings to every instance
# [instance].cfg - applies settings to a specific instance
#### Server Settings ####
## Server Start Settings | https://docs.linuxgsm.com/configuration/start-parameters
## All server settings except the server port are done in the config file:
## Docs: https://en.scpslgame.com/index.php?title=Docs:Server_Config
port="7777"
## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters
fn_parms(){
parms="${port}"
}
#### LinuxGSM Settings ####
## Notification Alerts
# (on|off)
# Display IP | https://docs.linuxgsm.com/alerts#display-ip
displayip=""
# More info | https://docs.linuxgsm.com/alerts#more-info
postalert="off"
postdays="7"
posttarget="https://hastebin.com"
# Discord Alerts | https://docs.linuxgsm.com/alerts/discord
discordalert="off"
discordwebhook="webhook"
# Slack Alerts | https://docs.linuxgsm.com/alerts/slack
slackalert="off"
slackwebhook="webhook"
# Email Alerts | https://docs.linuxgsm.com/alerts/email
emailalert="off"
email="[email protected]"
emailfrom=""
# IFTTT Alerts | https://docs.linuxgsm.com/alerts/ifttt
iftttalert="off"
ifttttoken="accesstoken"
iftttevent="linuxgsm_alert"
# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun
mailgunalert="off"
mailguntoken="accesstoken"
mailgundomain="example.com"
mailgunemailfrom="[email protected]"
mailgunemail="[email protected]"
# Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet
pushbulletalert="off"
pushbullettoken="accesstoken"
channeltag=""
# Pushover Alerts | https://docs.linuxgsm.com/alerts/pushover
pushoveralert="off"
pushovertoken="accesstoken"
# Telegram Alerts | https://docs.linuxgsm.com/alerts/telegram
# You can add a custom cURL string eg proxy (useful in Russia) or else in "curlcustomstring".
# like a "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help", if you not need
# any custom string in curl - simple ignore this parameter.
telegramalert="off"
telegramtoken="accesstoken"
telegramchatid=""
curlcustomstring=""
## Updating | https://docs.linuxgsm.com/commands/update
updateonstart="off"
## Backup | https://docs.linuxgsm.com/commands/backup
maxbackups="4"
maxbackupdays="30"
stoponbackup="on"
## Logging | https://docs.linuxgsm.com/features/logging
consolelogging="on"
logdays="7"
## Monitor | https://docs.linuxgsm.com/commands/monitor
# Query delay time
querydelay="1"
#### LinuxGSM Advanced Settings ####
# ANSI Colors
ansi="on"
# Message Display Time
sleeptime="0.5"
# Stop Mode | https://docs.linuxgsm.com/steamcmd/stopmode
# 1: tmux kill
# 2: CTRL+c
# 3: quit
# 4: quit 120s
# 5: stop
# 6: q
# 7: exit
# 8: 7 Days to Die
# 9: Gold Source
# 10: Teamspeak 3
stopmode="7"
## Query mode
# 1: session only
# 2: gamedig + gsquery
# 3: gamedig
# 4: gsquery
# 5: tcp
querymode="1"
querytype=""
## Console type
consoleverbose="yes"
consoleinteract="yes"
## SteamCMD Settings
# Server appid
appid="996560"
# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch
branch=""
# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server
steammaster=""
## LinuxGSM Server Details
# Do not edit
gamename="SCP: Secret Laboratory"
engine="unity3d"
glibc="2.27"
#### Directories ####
# Edit with care
## Server Specific Directories
systemdir="${serverfiles}"
executabledir="${systemdir}"
executable="./LocalAdmin"
servercfg="config_gameplay.txt"
servercfgdefault="config_gameplay.txt"
servercfgdir="${HOME}/.config/SCP Secret Laboratory/config/${port}"
servercfgfullpath="${servercfgdir}/${servercfg}"
## Backup Directory
backupdir="${rootdir}/backups"
## Logging Directories
logdir="${rootdir}/log"
gamelogdir="${HOME}/.config/SCP Secret Laboratory/LocalAdminLogs/${port}"
lgsmlogdir="${logdir}/script"
consolelogdir="${logdir}/console"
lgsmlog="${lgsmlogdir}/${selfname}-script.log"
consolelog="${consolelogdir}/${selfname}-console.log"
alertlog="${lgsmlogdir}/${selfname}-alert.log"
postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log"
## Logs Naming
lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log"
consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log"

168
lgsm/config-default/config-lgsm/scpslsmserver/_default.cfg

@ -0,0 +1,168 @@
##################################
######## Default Settings ########
##################################
# DO NOT EDIT WILL BE OVERWRITTEN!
# Copy settings from here and use them in either
# common.cfg - applies settings to every instance
# [instance].cfg - applies settings to a specific instance
#### Server Settings ####
## Server Start Settings | https://docs.linuxgsm.com/configuration/start-parameters
## All server settings except the server port are done in the config file:
## Docs: https://en.scpslgame.com/index.php?title=Docs:Server_Config
port="7777"
## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters
fn_parms(){
parms="${port}"
}
#### LinuxGSM Settings ####
## Notification Alerts
# (on|off)
# Display IP | https://docs.linuxgsm.com/alerts#display-ip
displayip=""
# More info | https://docs.linuxgsm.com/alerts#more-info
postalert="off"
postdays="7"
posttarget="https://hastebin.com"
# Discord Alerts | https://docs.linuxgsm.com/alerts/discord
discordalert="off"
discordwebhook="webhook"
# Slack Alerts | https://docs.linuxgsm.com/alerts/slack
slackalert="off"
slackwebhook="webhook"
# Email Alerts | https://docs.linuxgsm.com/alerts/email
emailalert="off"
email="[email protected]"
emailfrom=""
# IFTTT Alerts | https://docs.linuxgsm.com/alerts/ifttt
iftttalert="off"
ifttttoken="accesstoken"
iftttevent="linuxgsm_alert"
# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun
mailgunalert="off"
mailguntoken="accesstoken"
mailgundomain="example.com"
mailgunemailfrom="[email protected]"
mailgunemail="[email protected]"
# Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet
pushbulletalert="off"
pushbullettoken="accesstoken"
channeltag=""
# Pushover Alerts | https://docs.linuxgsm.com/alerts/pushover
pushoveralert="off"
pushovertoken="accesstoken"
# Telegram Alerts | https://docs.linuxgsm.com/alerts/telegram
# You can add a custom cURL string eg proxy (useful in Russia) or else in "curlcustomstring".
# like a "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help", if you not need
# any custom string in curl - simple ignore this parameter.
telegramalert="off"
telegramtoken="accesstoken"
telegramchatid=""
curlcustomstring=""
## Updating | https://docs.linuxgsm.com/commands/update
updateonstart="off"
## Backup | https://docs.linuxgsm.com/commands/backup
maxbackups="4"
maxbackupdays="30"
stoponbackup="on"
## Logging | https://docs.linuxgsm.com/features/logging
consolelogging="on"
logdays="7"
## Monitor | https://docs.linuxgsm.com/commands/monitor
# Query delay time
querydelay="1"
#### LinuxGSM Advanced Settings ####
# ANSI Colors
ansi="on"
# Message Display Time
sleeptime="0.5"
# Stop Mode | https://docs.linuxgsm.com/steamcmd/stopmode
# 1: tmux kill
# 2: CTRL+c
# 3: quit
# 4: quit 120s
# 5: stop
# 6: q
# 7: exit
# 8: 7 Days to Die
# 9: Gold Source
# 10: Teamspeak 3
stopmode="7"
## Query mode
# 1: session only
# 2: gamedig + gsquery
# 3: gamedig
# 4: gsquery
# 5: tcp
querymode="1"
querytype=""
## Console type
consoleverbose="yes"
consoleinteract="yes"
## SteamCMD Settings
# Server appid
appid="786920"
# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch
branch=""
# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server
steammaster=""
## LinuxGSM Server Details
# Do not edit
gamename="SCP: Secret Laboratory ServerMod"
engine="unity3d"
glibc="2.27"
#### Directories ####
# Edit with care
## Server Specific Directories
systemdir="${serverfiles}"
executabledir="${systemdir}"
executable="./LocalAdmin"
servercfg="config_gameplay.txt"
servercfgdefault="config_gameplay.txt"
servercfgdir="${HOME}/.config/SCP Secret Laboratory/config/${port}"
servercfgfullpath="${servercfgdir}/${servercfg}"
## Backup Directory
backupdir="${rootdir}/backups"
## Logging Directories
logdir="${rootdir}/log"
gamelogdir="${HOME}/.config/SCP Secret Laboratory/LocalAdminLogs/${port}"
lgsmlogdir="${logdir}/script"
consolelogdir="${logdir}/console"
lgsmlog="${lgsmlogdir}/${selfname}-script.log"
consolelog="${consolelogdir}/${selfname}-console.log"
alertlog="${lgsmlogdir}/${selfname}-alert.log"
postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log"
## Logs Naming
lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log"
consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log"

5
lgsm/config-default/config-lgsm/secrets-common-template.cfg

@ -0,0 +1,5 @@
##################################
######## Common Secrets ##########
##################################
# PLACE GLOBAL SECRET SETTINGS HERE
## These settings will apply to all instances.

5
lgsm/config-default/config-lgsm/secrets-instance-template.cfg

@ -0,0 +1,5 @@
##################################
####### Instance Secrets #########
##################################
# PLACE INSTANCE SECRET SETTINGS HERE
## These settings will apply to a specific instance.

171
lgsm/config-default/config-lgsm/vintsserver/_default.cfg

@ -0,0 +1,171 @@
##################################
######## Default Settings ########
##################################
# DO NOT EDIT, ANY CHANGES WILL BE OVERWRITTEN!
# Copy settings from here and use them in either:
# common.cfg - applies settings to every instance.
# [instance].cfg - applies settings to a specific instance.
#### Game Server Settings ####
## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters
fn_parms(){
parms="--datapath ${servercfgdir}"
}
## Release Settings | https://docs.linuxgsm.com/game-servers/vintagestory#release-settings
# Branch (stable|unstable)
branch="stable"
#### LinuxGSM Settings ####
## LinuxGSM Stats
# Send useful stats to LinuxGSM developers.
# https://docs.linuxgsm.com/configuration/linuxgsm-stats
# (on|off)
stats="off"
## Notification Alerts
# (on|off)
# Display IP | https://docs.linuxgsm.com/alerts#display-ip
displayip=""
# More info | https://docs.linuxgsm.com/alerts#more-info
postalert="off"
# Discord Alerts | https://docs.linuxgsm.com/alerts/discord
discordalert="off"
discordwebhook="webhook"
# Email Alerts | https://docs.linuxgsm.com/alerts/email
emailalert="off"
email="[email protected]"
emailfrom=""
# IFTTT Alerts | https://docs.linuxgsm.com/alerts/ifttt
iftttalert="off"
ifttttoken="accesstoken"
iftttevent="linuxgsm_alert"
# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun
mailgunalert="off"
mailgunapiregion="us"
mailguntoken="accesstoken"
mailgundomain="example.com"
mailgunemailfrom="[email protected]"
mailgunemail="[email protected]"
# Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet
pushbulletalert="off"
pushbullettoken="accesstoken"
channeltag=""
# Pushover Alerts | https://docs.linuxgsm.com/alerts/pushover
pushoveralert="off"
pushovertoken="accesstoken"
pushoveruserkey="userkey"
# Rocket.Chat Alerts | https://docs.linuxgsm.com/alerts/rocket.chat
rocketchatalert="off"
rocketchatwebhook="webhook"
rocketchattoken=""
# Slack Alerts | https://docs.linuxgsm.com/alerts/slack
slackalert="off"
slackwebhook="webhook"
# Telegram Alerts | https://docs.linuxgsm.com/alerts/telegram
# You can add a custom cURL string eg proxy (useful in Russia) in "curlcustomstring".
# For example "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help".
telegramalert="off"
telegramtoken="accesstoken"
telegramchatid=""
curlcustomstring=""
## Updating | https://docs.linuxgsm.com/commands/update
updateonstart="off"
## Backup | https://docs.linuxgsm.com/commands/backup
maxbackups="4"
maxbackupdays="30"
stoponbackup="on"
## Logging | https://docs.linuxgsm.com/features/logging
consolelogging="on"
logdays="7"
## Monitor | https://docs.linuxgsm.com/commands/monitor
# Query delay time
querydelay="1"
## ANSI Colors | https://docs.linuxgsm.com/features/ansi-colors
ansi="on"
#### Advanced Settings ####
## Message Display Time | https://docs.linuxgsm.com/features/message-display-time
sleeptime="0.5"
## Stop Mode | https://docs.linuxgsm.com/features/stop-mode
# 1: tmux kill
# 2: CTRL+c
# 3: quit
# 4: quit 120s
# 5: stop
# 6: q
# 7: exit
# 8: 7 Days to Die
# 9: GoldSrc
# 10: Avorion
# 11: end
stopmode="2"
## Query mode
# 1: session only
# 2: gamedig (gsquery fallback)
# 3: gamedig
# 4: gsquery
# 5: tcp
querymode="5"
querytype=""
## Console type
consoleverbose="yes"
consoleinteract="yes"
## Game Server Details
# Do not edit
gamename="Vintage Story"
engine="vintagestory"
glibc="2.17"
#### Directories ####
# Edit with care
## Game Server Directories
systemdir="${serverfiles}"
executabledir="${systemdir}"
preexecutable="mono"
executable="./VintagestoryServer.exe"
servercfgdir="${serverfiles}/data/${selfname}"
servercfg="serverconfig.json"
servercfgdefault="serverconfig.json"
servercfgfullpath="${servercfgdir}/${servercfg}"
## Backup Directory
backupdir="${lgsmdir}/backup"
## Logging Directories
logdir="${rootdir}/log"
gamelogdir="${vsdataworld}/Logs"
lgsmlogdir="${logdir}/script"
consolelogdir="${logdir}/console"
lgsmlog="${lgsmlogdir}/${selfname}-script.log"
consolelog="${consolelogdir}/${selfname}-console.log"
alertlog="${lgsmlogdir}/${selfname}-alert.log"
postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log"
## Logs Naming
lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log"
consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log"

4
lgsm/data/serverlist.csv

@ -21,6 +21,7 @@ cod2,cod2server,Call of Duty 2
cod4,cod4server,Call of Duty 4
coduo,coduoserver,Call of Duty: United Offensive
codwaw,codwawserver,Call of Duty: World at War
col,colserver,Colony Survival
cs,csserver,Counter-Strike 1.6
cscz,csczserver,Counter-Strike: Condition Zero
csgo,csgoserver,Counter-Strike: Global Offensive
@ -83,6 +84,8 @@ rw,rwserver,Rising World
samp,sampserver,San Andreas Multiplayer
sb,sbserver,Starbound
sbots,sbotsserver,StickyBots
scpsl,scpslserver,SCP: Secret Laboratory
scpslsm,scpslsmserver,SCP: Secret Laboratory ServerMod
sdtd,sdtdserver,7 Days to Die
sfc,sfcserver,SourceForts Classic
sof2,sof2server,Soldier Of Fortune 2: Gold Edition
@ -103,6 +106,7 @@ ut2k4,ut2k4server,Unreal Tournament 2004
ut3,ut3server,Unreal Tournament 3
ut99,ut99server,Unreal Tournament 99
vs,vsserver,Vampire Slayer
vints,vintsserver,Vintage Story
wet,wetserver,Wolfenstein: Enemy Territory
wf,wfserver,Warfork
wurm,wurmserver,Wurm Unlimited

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

11
lgsm/functions/alert.sh

@ -60,6 +60,15 @@ fn_alert_update(){
alertbody="${gamename} received update"
}
fn_alert_check_update(){
fn_script_log_info "Sending alert: Update available"
alertsubject="Alert - ${selfname} - Update available"
alertemoji="🎮"
alertsound="1"
alerturl="not enabled"
alertbody="${gamename} update available"
}
fn_alert_permissions(){
fn_script_log_info "Sending alert: Permissions error"
alertsubject="Alert - ${selfname}: Permissions error"
@ -88,6 +97,8 @@ elif [ "${alert}" == "test" ]; then
fn_alert_test
elif [ "${alert}" == "update" ]; then
fn_alert_update
elif [ "${alert}" == "check-update" ]; then
fn_alert_check_update
elif [ "${alert}" == "config" ]; then
fn_alert_config
fi

13
lgsm/functions/check_config.sh

@ -6,26 +6,21 @@
functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
if [ ! -f "${servercfgfullpath}" ]; then
if [ "${shortname}" != "hw" ]&&[ "${shortname}" != "ut3" ]&&[ "${shortname}" != "kf2" ]; then
if [ -n "${servercfgfullpath}" ]&&[ ! -f "${servercfgfullpath}" ]; then
fn_print_dots ""
fn_print_warn_nl "Configuration file missing!"
echo -e "${servercfgfullpath}"
fn_script_log_warn "Configuration file missing!"
fn_script_log_warn "${servercfgfullpath}"
install_config.sh
fi
fi
if [ "${shortname}" == "rust" ]; then
if [ -z "${rconpassword}" ]; then
if [ "${shortname}" == "rust" ]&&[ -v rconpassword ]&&[ -z "${rconpassword}" ]; then
fn_print_dots ""
fn_print_fail_nl "RCON password is not set"
fn_script_log_fatal "RCON password is not set"
core_exit.sh
elif [ "${rconpassword}" == "CHANGE_ME" ]; then
fn_script_log_warn "RCON password is not set"
elif [ -v rconpassword ]&&[ "${rconpassword}" == "CHANGE_ME" ]; then
fn_print_dots ""
fn_print_warn_nl "Default RCON Password detected"
fn_script_log_warn "Default RCON Password detected"
fi
fi

34
lgsm/functions/check_deps.sh

@ -343,7 +343,7 @@ fn_deps_build_debian(){
array_deps_missing=()
# LinuxGSM requirements.
array_deps_required=( curl wget ca-certificates file bsdmainutils util-linux python3 tar bzip2 gzip unzip binutils bc jq tmux netcat )
array_deps_required=( curl wget ca-certificates file bsdmainutils util-linux python3 tar bzip2 gzip unzip binutils bc jq tmux netcat cpio )
# All servers except ts3, mumble, GTA and minecraft servers require lib32stdc++6 and lib32gcc1.
if [ "${shortname}" != "ts3" ]&&[ "${shortname}" != "mumble" ]&&[ "${shortname}" != "mc" ]&&[ "${engine}" != "renderware" ]; then
@ -385,6 +385,9 @@ fn_deps_build_debian(){
# Battlefield 1942
elif [ "${shortname}" == "bf1942" ]; then
array_deps_required+=( libncurses5:i386 libtinfo5:i386 )
# Black Mesa: Death Match
elif [ "${shortname}" == "bmdm" ]; then
array_deps_required+=( libncurses5:i386 )
# Counter-Strike: Source, Garry's Mod, No More Room in Hell, Source Forts Classic, Zombie Master Reborn and Zombie Panic: Source
elif [ "${shortname}" == "css" ]||[ "${shortname}" == "gmod" ]||[ "${shortname}" == "nmrih" ]||[ "${shortname}" == "sfc" ]||[ "${shortname}" == "zmr" ]||[ "${shortname}" == "zps" ]; then
if [ "${arch}" == "x86_64" ]; then
@ -401,6 +404,9 @@ fn_deps_build_debian(){
# Barotrauma
elif [ "${shortname}" == "bt" ]; then
array_deps_required+=( libicu-dev )
# Colony Survival
elif [ "${shortname}" == "col" ]; then
array_deps_required+=( coreutils )
# Ecoserver
elif [ "${shortname}" == "eco" ]; then
array_deps_required+=( libgdiplus )
@ -431,6 +437,9 @@ fn_deps_build_debian(){
else
array_deps_required+=( default-jre rng-tools )
fi
# SCP: Secret Laboratory, SCP: Secret Laboratory ServerMod
elif [ "${shortname}" == "scpsl" ]||[ "${shortname}" == "scpslsm" ]; then
array_deps_required+=( mono-complete )
# Sven Co-op
elif [ "${shortname}" == "sven" ]; then
array_deps_required+=( libssl1.1:i386 zlib1g:i386 )
@ -446,6 +455,9 @@ fn_deps_build_debian(){
# Unreal Tournament
elif [ "${shortname}" == "ut" ]; then
array_deps_required+=( unzip )
# Vintage Story
elif [ "${shortname}" == "vints" ]; then
array_deps_required+=( mono-complete )
# Wurm: Unlimited
elif [ "${shortname}" == "wurm" ]; then
array_deps_required+=( xvfb )
@ -464,15 +476,15 @@ fn_deps_build_redhat(){
# LinuxGSM requirements.
# CentOS
if [ "${distroversion}" == "7" ]; then
array_deps_required=( epel-release curl wget util-linux python3 file tar gzip bzip2 unzip binutils bc jq tmux nmap-ncat )
array_deps_required=( epel-release curl wget util-linux python3 file tar gzip bzip2 unzip binutils bc jq tmux nmap-ncat cpio )
elif [ "${distroversion}" == "8" ]; then
array_deps_required=( epel-release curl wget util-linux python36 file tar gzip bzip2 unzip binutils bc jq tmux nmap-ncat )
array_deps_required=( epel-release curl wget util-linux python36 file tar gzip bzip2 unzip binutils bc jq tmux nmap-ncat cpio )
elif [ "${distroid}" == "fedora" ]; then
array_deps_required=( curl wget util-linux python3 file tar gzip bzip2 unzip binutils bc jq tmux nmap-ncat )
array_deps_required=( curl wget util-linux python3 file tar gzip bzip2 unzip binutils bc jq tmux nmap-ncat cpio )
elif [[ "${distroname}" == *"Amazon Linux AMI"* ]]; then
array_deps_required=( curl wget util-linux python3 file tar gzip bzip2 unzip binutils bc jq tmux nmap-ncat )
array_deps_required=( curl wget util-linux python3 file tar gzip bzip2 unzip binutils bc jq tmux nmap-ncat cpio )
else
array_deps_required=( curl wget util-linux python3 file tar gzip bzip2 unzip binutils bc jq tmux nmap-ncat )
array_deps_required=( curl wget util-linux python3 file tar gzip bzip2 unzip binutils bc jq tmux nmap-ncat cpio )
fi
# All servers except ts3, mumble, multi theft auto and minecraft servers require glibc.i686 and libstdc++.i686.
@ -501,8 +513,8 @@ fn_deps_build_redhat(){
# Battlefield: Vietnam
elif [ "${shortname}" == "bfv" ]; then
array_deps_required+=( compat-libstdc++-33.i686 glibc.i686 )
# Battlefield 1942, Counter-Strike: Source, Garry's Mod, No More Room in Hell, Source Forts Classic, Zombie Master Reborn and Zombie Panic: Source
elif [ "${shortname}" == "bf1942" ]||[ "${shortname}" == "css" ]||[ "${shortname}" == "gmod" ]||[ "${shortname}" == "nmrih" ]||[ "${shortname}" == "sfc" ]||[ "${shortname}" == "zmr" ]||[ "${shortname}" == "zps" ]; then
# Battlefield 1942, Black Mesa: Deathmatch, Counter-Strike: Source, Garry's Mod, No More Room in Hell, Source Forts Classic, Zombie Master Reborn and Zombie Panic: Source
elif [ "${shortname}" == "bf1942" ]||[ "${shortname}" == "bmdm" ]||[ "${shortname}" == "css" ]||[ "${shortname}" == "gmod" ]||[ "${shortname}" == "nmrih" ]||[ "${shortname}" == "sfc" ]||[ "${shortname}" == "zmr" ]||[ "${shortname}" == "zps" ]; then
array_deps_required+=( ncurses-libs.i686 )
# Brainbread 2, Don't Starve Together & Team Fortress 2
elif [ "${shortname}" == "bb2" ]||[ "${shortname}" == "dst" ]||[ "${shortname}" == "tf2" ]; then
@ -510,6 +522,9 @@ fn_deps_build_redhat(){
# Call of Duty & Medal of Honor: Allied Assault
elif [ "${shortname}" == "cod" ]||[ "${shortname}" == "coduo" ]||[ "${shortname}" == "cod2" ]||[ "${shortname}" == "mohaa" ]; then
array_deps_required+=( compat-libstdc++-33.i686 )
# Colony Survival
elif [ "${shortname}" == "col" ]; then
array_deps_required+=( coreutils )
# Ecoserver
elif [ "${shortname}" == "eco" ]; then
array_deps_required+=( libgdiplus )
@ -555,6 +570,9 @@ fn_deps_build_redhat(){
# Unreal Tournament
elif [ "${shortname}" == "ut" ]; then
array_deps_required+=( unzip )
# Vintage Story
elif [ "${shortname}" == "vints" ]; then
array_deps_required+=( mono-complete )
# Wurm: Unlimited
elif [ "${shortname}" == "wurm" ]; then
array_deps_required+=( xorg-x11-server-Xvfb )

141
lgsm/functions/check_steamcmd.sh

@ -6,145 +6,8 @@
functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
fn_install_steamcmd(){
if [ "${shortname}" == "ark" ]&&[ "${installsteamcmd}" == "1" ]; then
steamcmddir="${serverfiles}/Engine/Binaries/ThirdParty/SteamCMD/Linux"
fi
if [ ! -d "${steamcmddir}" ]; then
mkdir -p "${steamcmddir}"
fi
remote_fileurl="${1}"
remote_fileurl_backup="${2}"
remote_fileurl_name="${3}"
remote_fileurl_backup_name="${4}"
local_filedir="${5}"
local_filename="${6}"
chmodx="${7:-0}"
run="${8:-0}"
forcedl="${9:-0}"
md5="${10:-0}"
fn_fetch_file "http://media.steampowered.com/client/steamcmd_linux.tar.gz" "" "" "" "${tmpdir}" "steamcmd_linux.tar.gz" "" "norun" "noforce" "nomd5"
fn_dl_extract "${tmpdir}" "steamcmd_linux.tar.gz" "${steamcmddir}"
chmod +x "${steamcmddir}/steamcmd.sh"
}
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."
if [ -d "${lgsmlogdir}" ]; then
fn_script_log_fatal "Steam login not set. Update steamuser in ${configdirserver}"
fi
core_exit.sh
fi
# Anonymous user is set if steamuser is missing.
if [ -z "${steamuser}" ]; then
if [ -d "${lgsmlogdir}" ]; then
fn_script_log_info "Using anonymous Steam login"
fi
steamuser="anonymous"
steampass=''
fi
}
fn_check_steamcmd(){
# Checks if SteamCMD exists when starting or updating a server.
# Only install if steamcmd package is missing or steamcmd dir is missing.
if [ ! -f "${steamcmddir}/steamcmd.sh" ]&&[ -z "$(command -v steamcmd 2>/dev/null)" ]; then
if [ "${commandname}" == "INSTALL" ]; then
fn_install_steamcmd
else
fn_print_warn_nl "SteamCMD is missing"
fn_script_log_warn "SteamCMD is missing"
fn_install_steamcmd
fi
elif [ "${commandname}" == "INSTALL" ]; then
fn_print_information "SteamCMD is already installed..."
fn_print_ok_eol_nl
fi
}
fn_check_steamcmd_dir(){
# Worksround that pre-installs the correct steam directories to ensure all packages use the correct Standard.
# https://github.com/ValveSoftware/steam-for-linux/issues/6976#issuecomment-610446347
# Create Steam installation directory.
if [ ! -d "${XDG_DATA_HOME:="${HOME}/.local/share"}/Steam" ]; then
mkdir -p "${XDG_DATA_HOME:="${HOME}/.local/share"}/Steam"
fi
# Create common Steam directory.
if [ ! -d "${HOME}/.steam" ]; then
mkdir -p "${HOME}/.steam"
fi
# Symbolic links to Steam installation directory.
if [ ! -L "${HOME}/.steam/root" ]; then
if [ -d "${HOME}/.steam/root" ]; then
rm "${HOME}/.steam/root"
fi
ln -s "${XDG_DATA_HOME:="${HOME}/.local/share"}/Steam" "${HOME}/.steam/root"
fi
if [ ! -L "${HOME}/.steam/steam" ]; then
if [ -d "${HOME}/.steam/steam" ]; then
rm -rf "${HOME}/.steam/steam"
fi
ln -s "${XDG_DATA_HOME:="${HOME}/.local/share"}/Steam" "${HOME}/.steam/steam"
fi
}
fn_check_steamcmd_dir_legacy(){
# Remove old Steam installation directories ~/Steam and ${rootdir}/steamcmd
if [ -d "${rootdir}/steamcmd" ]&&[ "${steamcmddir}" == "${XDG_DATA_HOME:="${HOME}/.local/share"}/Steam" ]; then
rm -rf "${rootdir:?}/steamcmd"
fi
if [ -d "${HOME}/Steam" ]&&[ "${steamcmddir}" == "${XDG_DATA_HOME:="${HOME}/.local/share"}/Steam" ]; then
rm -rf "${HOME}/Steam"
fi
}
fn_check_steamcmd_ark(){
# Checks if SteamCMD exists in
# Engine/Binaries/ThirdParty/SteamCMD/Linux
# to allow ark mods to work
if [ ! -f "${serverfiles}/Engine/Binaries/ThirdParty/SteamCMD/Linux/steamcmd.sh" ]; then
installsteamcmd=1
if [ "${commandname}" == "INSTALL" ]; then
fn_install_steamcmd
else
fn_print_warn_nl "ARK mods SteamCMD is missing"
fn_script_log_warn "ARK mods SteamCMD is missing"
fn_install_steamcmd
fi
elif [ "${commandname}" == "INSTALL" ]; then
fn_print_information "ARK mods SteamCMD is already installed..."
fn_print_ok_eol_nl
fi
}
fn_check_steamcmd_clear(){
# Will remove steamcmd dir if steamcmd package is installed.
if [ "$(command -v steamcmd 2>/dev/null)" ]&&[ -d "${rootdir}/steamcmd" ]; then
rm -rf "${steamcmddir:?}"
exitcode=$?
if [ "${exitcode}" != 0 ]; then
fn_script_log_fatal "Removing ${rootdir}/steamcmd"
else
fn_script_log_pass "Removing ${rootdir}/steamcmd"
fi
fi
}
fn_check_steamcmd_exec(){
if [ "$(command -v steamcmd 2>/dev/null)" ]; then
steamcmdcommand="steamcmd"
else
steamcmdcommand="./steamcmd.sh"
fi
}
# init steamcmd functions
core_steamcmd.sh
fn_check_steamcmd_clear
fn_check_steamcmd

24
lgsm/functions/command_check_update.sh

@ -0,0 +1,24 @@
#!/bin/bash
# LinuxGSM command_check_update.sh function
# Author: Daniel Gibbs
# Website: https://linuxgsm.com
# Description: Handles updating of servers.
commandname="CHECK-UPDATE"
commandaction="check for Update"
functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
fn_firstcommand_set
fn_print_dots ""
check.sh
core_logs.sh
core_steamcmd.sh
check_steamcmd.sh
fn_update_steamcmd_localbuild
fn_update_steamcmd_remotebuild
fn_update_steamcmd_compare
core_exit.sh

21
lgsm/functions/command_skeleton.sh

@ -0,0 +1,21 @@
#!/bin/bash
# LinuxGSM command_skeleton.sh function
# Author: Daniel Gibbs
# Website: https://linuxgsm.com
# Description: Creates an copy of a game servers directorys.
fn_print_dots "Creating skeleton directory"
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
fn_print_fail_nl "Creating skeleton directory"
fn_script_log_fatal "Creating skeleton directory"
else
fn_print_ok_nl "Creating skeleton directory: ./skel"
fn_script_log_pass "Creating skeleton directory: ./skel"
fi
core_exit.sh

2
lgsm/functions/command_stop.sh

@ -43,7 +43,7 @@ fn_stop_graceful_cmd(){
fn_print_dots "Graceful: sending \"${1}\""
fn_script_log_info "Graceful: sending \"${1}\""
# Sends specific stop command.
tmux send -t "${sessionname}" "${1}" ENTER > /dev/null 2>&1
tmux send -t "${sessionname}" ENTER "${1}" ENTER > /dev/null 2>&1
# Waits up to ${seconds} seconds giving the server time to shutdown gracefully.
for ((seconds=1; seconds<=${2}; seconds++)); do
check_status.sh

2
lgsm/functions/command_update.sh

@ -28,6 +28,8 @@ elif [ "${shortname}" == "mta" ]; then
update_mta.sh
elif [ "${shortname}" == "jk2" ]; then
update_jediknight2.sh
elif [ "${shortname}" == "vints" ]; then
update_vintagestory.sh
else
update_steamcmd.sh
fi

3
lgsm/functions/core_dl.sh

@ -87,8 +87,9 @@ fn_dl_steamcmd(){
fi
# Error checking for SteamCMD. Some errors will loop to try again and some will just exit.
# Check also if we have more errors than retries to be sure that we do not loop to many times and error out.
exitcode=$?
if [ -n "$(grep "Error!" "${steamcmdlog}" | tail -1)" ]||[ -n "$(grep "ERROR!" "${steamcmdlog}" | tail -1)" ]; then
if [ -n "$(grep -i "Error!" "${steamcmdlog}" | tail -1)" ]&&[ "$(grep -ic "Error!" "${steamcmdlog}")" -ge "${counter}" ] ; then
# Not enough space.
if [ -n "$(grep "0x202" "${steamcmdlog}" | tail -1)" ]; then
fn_print_failure_nl "${commandaction} ${selfname}: ${remotelocation}: Not enough space to download server files"

22
lgsm/functions/core_functions.sh

@ -7,7 +7,7 @@
functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
modulesversion="v20.6.1"
modulesversion="v20.6.2"
# Core
@ -53,6 +53,11 @@ functionfile="${FUNCNAME[0]}"
fn_fetch_function
}
core_steamcmd.sh(){
functionfile="${FUNCNAME[0]}"
fn_fetch_function
}
# Commands
command_backup.sh(){
@ -155,6 +160,11 @@ functionfile="${FUNCNAME[0]}"
fn_fetch_function
}
command_skeleton.sh(){
functionfile="${FUNCNAME[0]}"
fn_fetch_function
}
command_wipe.sh(){
functionfile="${FUNCNAME[0]}"
fn_fetch_function
@ -594,6 +604,11 @@ functionfile="${FUNCNAME[0]}"
fn_fetch_function
}
command_check_update.sh(){
functionfile="${FUNCNAME[0]}"
fn_fetch_function
}
update_ts3.sh(){
functionfile="${FUNCNAME[0]}"
fn_fetch_function
@ -634,6 +649,11 @@ functionfile="${FUNCNAME[0]}"
fn_fetch_function
}
update_vintagestory.sh(){
functionfile="${FUNCNAME[0]}"
fn_fetch_function
}
fn_update_functions.sh(){
functionfile="${FUNCNAME[0]}"
fn_fetch_function

10
lgsm/functions/core_getopt.sh

@ -20,6 +20,7 @@ cmd_backup=( "b;backup" "command_backup.sh" "Create backup archives of the serve
cmd_update_linuxgsm=( "ul;update-lgsm;uf;update-functions" "command_update_linuxgsm.sh" "Check and apply any LinuxGSM updates." )
cmd_test_alert=( "ta;test-alert" "command_test_alert.sh" "Send a test alert." )
cmd_monitor=( "m;monitor" "command_monitor.sh" "Check server status and restart if crashed." )
cmd_skeleton=( "sk;skeleton" "command_skeleton.sh" "Create a skeleton directory." )
cmd_donate=( "do;donate" "command_donate.sh" "Donation options." )
cmd_install_init=("ii;install-init" "command_install_init.sh" "Puts the service file in the right place")
# Console servers only.
@ -27,6 +28,7 @@ cmd_console=( "c;console" "command_console.sh" "Access server console." )
cmd_debug=( "d;debug" "command_debug.sh" "Start server directly in your terminal." )
# Update servers only.
cmd_update=( "u;update" "command_update.sh" "Check and apply any server updates." )
cmd_check_update=( "cu;check-update" "command_check_update.sh" "Check if a gameserver update is available" )
cmd_force_update=( "fu;force-update;update-restart;ur" "forceupdate=1; command_update.sh" "Apply server updates bypassing check." )
# SteamCMD servers only.
cmd_validate=( "v;validate" "command_validate.sh" "Validate server files with SteamCMD." )
@ -56,9 +58,9 @@ cmd_dev_clear_functions=( "cf;clear-functions" "command_dev_clear_functions.sh"
### Set specific opt here.
currentopt=( "${cmd_start[@]}" "${cmd_stop[@]}" "${cmd_restart[@]}" "${cmd_monitor[@]}" "${cmd_test_alert[@]}" "${cmd_details[@]}" "${cmd_postdetails[@]}" )
currentopt=( "${cmd_start[@]}" "${cmd_stop[@]}" "${cmd_restart[@]}" "${cmd_monitor[@]}" "${cmd_test_alert[@]}" "${cmd_details[@]}" "${cmd_postdetails[@]}" "${cmd_skeleton[@]}" )
# Update LGSM.
# Update LinuxGSM.
currentopt+=( "${cmd_update_linuxgsm[@]}" )
# Exclude noupdate games here.
@ -72,9 +74,9 @@ if [ "${shortname}" == "jk2" ]||[ "${engine}" != "idtech3" ];then
fi
fi
# Validate command.
# Validate and check-update command.
if [ "${appid}" ]; then
currentopt+=( "${cmd_validate[@]}" )
currentopt+=( "${cmd_validate[@]}" "${cmd_check_update[@]}" )
fi
# Backup.

322
lgsm/functions/core_steamcmd.sh

@ -0,0 +1,322 @@
#!/bin/bash
# LinuxGSM core_steamcmd.sh function
# Author: Daniel Gibbs
# Website: https://linuxgsm.com
# Description: Core functions for SteamCMD
functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
fn_install_steamcmd(){
if [ "${shortname}" == "ark" ]&&[ "${installsteamcmd}" == "1" ]; then
steamcmddir="${serverfiles}/Engine/Binaries/ThirdParty/SteamCMD/Linux"
fi
if [ ! -d "${steamcmddir}" ]; then
mkdir -p "${steamcmddir}"
fi
fn_fetch_file "http://media.steampowered.com/client/steamcmd_linux.tar.gz" "" "" "" "${tmpdir}" "steamcmd_linux.tar.gz" "" "norun" "noforce" "nomd5"
fn_dl_extract "${tmpdir}" "steamcmd_linux.tar.gz" "${steamcmddir}"
chmod +x "${steamcmddir}/steamcmd.sh"
}
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."
if [ -d "${lgsmlogdir}" ]; then
fn_script_log_fatal "Steam login not set. Update steamuser in ${configdirserver}"
fi
core_exit.sh
fi
# Anonymous user is set if steamuser is missing.
if [ -z "${steamuser}" ]; then
if [ -d "${lgsmlogdir}" ]; then
fn_script_log_info "Using anonymous Steam login"
fi
steamuser="anonymous"
steampass=''
fi
}
fn_check_steamcmd(){
# Checks if SteamCMD exists when starting or updating a server.
# Only install if steamcmd package is missing or steamcmd dir is missing.
if [ ! -f "${steamcmddir}/steamcmd.sh" ]&&[ -z "$(command -v steamcmd 2>/dev/null)" ]; then
if [ "${commandname}" == "INSTALL" ]; then
fn_install_steamcmd
else
fn_print_warn_nl "SteamCMD is missing"
fn_script_log_warn "SteamCMD is missing"
fn_install_steamcmd
fi
elif [ "${commandname}" == "INSTALL" ]; then
fn_print_information "SteamCMD is already installed..."
fn_print_ok_eol_nl
fi
}
fn_check_steamcmd_dir(){
# Worksround that pre-installs the correct steam directories to ensure all packages use the correct Standard.
# https://github.com/ValveSoftware/steam-for-linux/issues/6976#issuecomment-610446347
# Create Steam installation directory.
if [ ! -d "${XDG_DATA_HOME:="${HOME}/.local/share"}/Steam" ]; then
mkdir -p "${XDG_DATA_HOME:="${HOME}/.local/share"}/Steam"
fi
# Create common Steam directory.
if [ ! -d "${HOME}/.steam" ]; then
mkdir -p "${HOME}/.steam"
fi
# Symbolic links to Steam installation directory.
if [ ! -L "${HOME}/.steam/root" ]; then
if [ -d "${HOME}/.steam/root" ]; then
rm "${HOME}/.steam/root"
fi
ln -s "${XDG_DATA_HOME:="${HOME}/.local/share"}/Steam" "${HOME}/.steam/root"
fi
if [ ! -L "${HOME}/.steam/steam" ]; then
if [ -d "${HOME}/.steam/steam" ]; then
rm -rf "${HOME}/.steam/steam"
fi
ln -s "${XDG_DATA_HOME:="${HOME}/.local/share"}/Steam" "${HOME}/.steam/steam"
fi
}
fn_check_steamcmd_dir_legacy(){
# Remove old Steam installation directories ~/Steam and ${rootdir}/steamcmd
if [ -d "${rootdir}/steamcmd" ]&&[ "${steamcmddir}" == "${XDG_DATA_HOME:="${HOME}/.local/share"}/Steam" ]; then
rm -rf "${rootdir:?}/steamcmd"
fi
if [ -d "${HOME}/Steam" ]&&[ "${steamcmddir}" == "${XDG_DATA_HOME:="${HOME}/.local/share"}/Steam" ]; then
rm -rf "${HOME}/Steam"
fi
}
fn_check_steamcmd_ark(){
# Checks if SteamCMD exists in
# Engine/Binaries/ThirdParty/SteamCMD/Linux
# to allow ark mods to work
if [ ! -f "${serverfiles}/Engine/Binaries/ThirdParty/SteamCMD/Linux/steamcmd.sh" ]; then
installsteamcmd=1
if [ "${commandname}" == "INSTALL" ]; then
fn_install_steamcmd
else
fn_print_warn_nl "ARK mods SteamCMD is missing"
fn_script_log_warn "ARK mods SteamCMD is missing"
fn_install_steamcmd
fi
elif [ "${commandname}" == "INSTALL" ]; then
fn_print_information "ARK mods SteamCMD is already installed..."
fn_print_ok_eol_nl
fi
}
fn_check_steamcmd_clear(){
# Will remove steamcmd dir if steamcmd package is installed.
if [ "$(command -v steamcmd 2>/dev/null)" ]&&[ -d "${rootdir}/steamcmd" ]; then
rm -rf "${steamcmddir:?}"
exitcode=$?
if [ "${exitcode}" != 0 ]; then
fn_script_log_fatal "Removing ${rootdir}/steamcmd"
else
fn_script_log_pass "Removing ${rootdir}/steamcmd"
fi
fi
}
fn_check_steamcmd_exec(){
if [ "$(command -v steamcmd 2>/dev/null)" ]; then
steamcmdcommand="steamcmd"
else
steamcmdcommand="./steamcmd.sh"
fi
}
fn_update_steamcmd_localbuild(){
# Gets local build info.
fn_print_dots "Checking local build: ${remotelocation}"
fn_appmanifest_check
# Uses appmanifest to find local build.
localbuild=$(grep buildid "${appmanifestfile}" | tr '[:blank:]"' ' ' | tr -s ' ' | cut -d\ -f3)
# Set branch to public if no custom branch.
if [ -z "${branch}" ]; then
branch="public"
fi
# Checks if localbuild variable has been set.
if [ -z "${localbuild}" ]||[ "${localbuild}" == "null" ]; then
fn_print_fail "Checking local build: ${remotelocation}"
fn_script_log_fatal "Checking local build"
core_exit.sh
else
fn_print_ok "Checking local build: ${remotelocation}"
fn_script_log_pass "Checking local build"
fi
}
fn_update_steamcmd_remotebuild(){
# Gets remote build info.
if [ -d "${steamcmddir}" ]; then
cd "${steamcmddir}" || exit
fi
# Removes appinfo.vdf as a fix for not always getting up to date version info from SteamCMD.
if [ "$(find "${HOME}" -type f -name "appinfo.vdf" | wc -l)" -ne "0" ]; then
find "${HOME}" -type f -name "appinfo.vdf" -exec rm -f {} \;
fi
# password for branch not needed to check the buildid
remotebuild=$(${steamcmdcommand} +login "${steamuser}" "${steampass}" +app_info_update 1 +app_info_print "${appid}" +quit | sed -e '/"branches"/,/^}/!d' | sed -n "/\"${branch}\"/,/}/p" | grep -m 1 buildid | tr -cd '[:digit:]')
if [ "${firstcommandname}" != "INSTALL" ]; then
fn_print_dots "Checking remote build: ${remotelocation}"
# Checks if remotebuild variable has been set.
if [ -z "${remotebuild}" ]||[ "${remotebuild}" == "null" ]; then
fn_print_fail "Checking remote build: ${remotelocation}"
fn_script_log_fatal "Checking remote build"
core_exit.sh
else
fn_print_ok "Checking remote build: ${remotelocation}"
fn_script_log_pass "Checking remote build"
fi
else
# Checks if remotebuild variable has been set.
if [ -z "${remotebuild}" ]||[ "${remotebuild}" == "null" ]; then
fn_print_failure "Unable to get remote build"
fn_script_log_fatal "Unable to get remote build"
core_exit.sh
fi
fi
}
fn_update_steamcmd_compare(){
fn_print_dots "Checking for update: ${remotelocation}"
if [ "${localbuild}" != "${remotebuild}" ]; then
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}${remotebuild}${default}"
if [ -n "${branch}" ]; then
echo -e "* Branch: ${branch}"
fi
if [ -n "${betapassword}" ]; then
echo -e "* Branch password: ${betapassword}"
fi
echo -e "https://steamdb.info/app/${appid}/"
echo -en "\n"
fn_script_log_info "Update available"
fn_script_log_info "Local build: ${localbuild}"
fn_script_log_info "Remote build: ${remotebuild}"
if [ -n "${branch}" ]; then
fn_script_log_info "Branch: ${branch}"
fi
if [ -n "${betapassword}" ]; then
fn_script_log_info "Branch password: ${betapassword}"
fi
fn_script_log_info "${localbuild} > ${remotebuild}"
if [ "${commandname}" == "UPDATE" ]; then
unset updateonstart
check_status.sh
# If server stopped.
if [ "${status}" == "0" ]; then
fn_dl_steamcmd
# If server started.
else
fn_print_restart_warning
exitbypass=1
command_stop.sh
fn_firstcommand_reset
exitbypass=1
fn_dl_steamcmd
exitbypass=1
command_start.sh
fn_firstcommand_reset
fi
unset exitbypass
date +%s > "${lockdir}/lastupdate.lock"
alert="update"
elif [ "${commandname}" == "CHECK-UPDATE" ]; then
alert="check-update"
fi
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}${remotebuild}${default}"
if [ -n "${branch}" ]; then
echo -e "* Branch: ${branch}"
fi
if [ -n "${betapassword}" ]; then
echo -e "* Branch password: ${betapassword}"
fi
echo -e "https://steamdb.info/app/${appid}/"
echo -en "\n"
fn_script_log_info "No update available"
fn_script_log_info "Local build: ${localbuild}"
fn_script_log_info "Remote build: ${remotebuild}"
if [ -n "${branch}" ]; then
fn_script_log_info "Branch: ${branch}"
fi
if [ -n "${betapassword}" ]; then
fn_script_log_info "Branch password: ${betapassword}"
fi
fi
}
fn_appmanifest_info(){
appmanifestfile=$(find "${serverfiles}" -type f -name "appmanifest_${appid}.acf")
appmanifestfilewc=$(find "${serverfiles}" -type f -name "appmanifest_${appid}.acf" | wc -l)
}
fn_appmanifest_check(){
fn_appmanifest_info
# Multiple or no matching appmanifest files may sometimes be present.
# This error is corrected if required.
if [ "${appmanifestfilewc}" -ge "2" ]; then
fn_print_error "Multiple appmanifest_${appid}.acf files found"
fn_script_log_error "Multiple appmanifest_${appid}.acf files found"
fn_print_dots "Removing x${appmanifestfilewc} appmanifest_${appid}.acf files"
for appfile in ${appmanifestfile}; do
rm -f "${appfile:?}"
done
appmanifestfilewc1="${appmanifestfilewc}"
fn_appmanifest_info
# if error can not be resolved.
if [ "${appmanifestfilewc}" -ge "2" ]; then
fn_print_fail "Unable to remove x${appmanifestfilewc} appmanifest_${appid}.acf files"
fn_script_log_fatal "Unable to remove x${appmanifestfilewc} appmanifest_${appid}.acf files"
echo -e "* Check user permissions"
for appfile in ${appmanifestfile}; do
echo -e " ${appfile}"
done
core_exit.sh
else
fn_print_ok "Removed x${appmanifestfilewc1} appmanifest_${appid}.acf files"
fn_script_log_pass "Removed x${appmanifestfilewc1} appmanifest_${appid}.acf files"
fn_print_info_nl "Forcing update to correct issue"
fn_script_log_info "Forcing update to correct issue"
fn_dl_steamcmd
fi
elif [ "${appmanifestfilewc}" -eq "0" ]; then
fn_print_error_nl "No appmanifest_${appid}.acf found"
fn_script_log_error "No appmanifest_${appid}.acf found"
fn_print_info_nl "Forcing update to correct issue"
fn_script_log_info "Forcing update to correct issue"
fn_dl_steamcmd
fn_appmanifest_info
if [ "${appmanifestfilewc}" -eq "0" ]; then
fn_print_fail_nl "Still no appmanifest_${appid}.acf found"
fn_script_log_fatal "Still no appmanifest_${appid}.acf found"
core_exit.sh
fi
fi
}

2
lgsm/functions/fix_steamcmd.sh

@ -79,6 +79,8 @@ elif [ "${shortname}" == "cmw" ]; then
fn_fix_steamclient_so "32" "${executabledir}/lib"
elif [ "${shortname}" == "cs" ]; then
fn_fix_steamclient_so "32" "${serverfiles}"
elif [ "${shortname}" == "col" ]; then
fn_fix_steamclient_so "64" "${serverfiles}"
elif [ "${shortname}" == "ins" ]; then
fn_fix_steamclient_so "32" "${serverfiles}/bin"
elif [ "${shortname}" == "pz" ]; then

70
lgsm/functions/info_config.sh

@ -1525,6 +1525,70 @@ fn_info_config_pavlovvr(){
fi
}
fn_info_config_col(){
if [ -f "${servercfgfullpath}" ]; then
servername=$(jq -r '.ServerSettings.ServerName' "${servercfgfullpath}")
serverpassword=$(jq -r '.ServerSettings.ServerPassword' "${servercfgfullpath}")
maxplayers=$(jq -r '.ServerSettings.MaxPlayerCount' "${servercfgfullpath}")
port=$(jq -r '.ServerSettings.ServerGamePort' "${servercfgfullpath}")
steamport=$(jq -r '.ServerSettings.ServerSteamPort' "${servercfgfullpath}")
rconpassword=$(jq -r '.ServerSettings.RCONPassword' "${servercfgfullpath}")
configip=$(jq -r '.ServerSettings.ServerIP' "${servercfgfullpath}")
# password not set
serverpassword=${serverpassword:-"NOT SET"}
queryport=${port:-"0"}
else
servername=${servername:-"NOT SET"}
serverpassword=${serverpassword:-"NOT SET"}
maxplayers=${maxplayers:-"0"}
port=${port:-"27004"}
steamport=${steamport:-"27005"}
rconpassword=${rconpassword:-"NOT SET"}
fi
}
fn_info_config_vintagestory(){
if [ ! -f "${servercfgfullpath}" ]; then
servername="${unavailable}"
maxplayers="${unavailable}"
serverpassword="${unavailable}"
port="${unavailable}"
queryport="${unavailable}"
configip="${unavailable}"
else
servername=$(jq -r '.ServerName' "${servercfgfullpath}")
maxplayers=$(jq -r '.MaxClients' "${servercfgfullpath}")
serverpassword=$(jq -r 'select(.Password != null) | .Password' "${servercfgfullpath}")
port=$(jq -r '.Port' "${servercfgfullpath}")
queryport=${port:-"0"}
configip=$(jq -r 'select(.Ip != null) | .Ip' "${servercfgfullpath}")
serverpassword=${serverpassword:-"NOT SET"}
configip=${configip:-"0.0.0.0"}
fi
}
fn_info_config_scpsl(){
if [ -f "${servercfgfullpath}" ]; then
servername=$(sed -nr 's/^server_name: (.*)$/\1/p' "${servercfgfullpath}")
maxplayers=$(sed -nr 's/^max_players: (.*)$/\1/p' "${servercfgfullpath}")
configip=$(sed -nr 's/^ipv4_bind_ip: (.*)$/\1/p' "${servercfgfullpath}")
tickrate=$(sed -nr 's/^server_tickrate: (.*)$/\1/p' "${servercfgfullpath}")
adminpassword=$(sed -nr 's/^administrator_query_password: (.*)$/\1/p' "${servercfgfullpath}")
if [ "${adminpassword}" == "none" ]; then
adminpassword="NOT SET"
fi
else
servername=${servername:-"NOT SET"}
maxplayers=${maxplayers:-"0"}
configip=${configip:-"0.0.0.0"}
tickrate=${tickrate:-"NOT SET"}
adminpassword=${adminpassword:-"NOT SET"}
fi
}
if [ "${shortname}" == "ac" ]; then
fn_info_config_assettocorsa
elif [ "${shortname}" == "ark" ]; then
@ -1551,6 +1615,8 @@ elif [ "${shortname}" == "cod4" ]; then
fn_info_config_cod4
elif [ "${shortname}" == "codwaw" ]; then
fn_info_config_codwaw
elif [ "${shortname}" == "col" ]; then
fn_info_config_col
elif [ "${shortname}" == "dst" ]; then
fn_info_config_dontstarve
elif [ "${shortname}" == "eco" ]; then
@ -1627,6 +1693,8 @@ elif [ "${engine}" == "unreal3" ]; then
fn_info_config_unreal3
elif [ "${shortname}" == "ut" ]; then
fn_info_config_ut
elif [ "${shortname}" == "scpsl" ]||[ "${shortname}" == "scpslsm" ]; then
fn_info_config_scpsl
elif [ "${shortname}" == "sdtd" ]; then
fn_info_config_sdtd
elif [ "${shortname}" == "wet" ]; then
@ -1647,4 +1715,6 @@ elif [ "${shortname}" == "mh" ]; then
fn_info_config_mordhau
elif [ "${shortname}" == "pvr" ];then
fn_info_config_pavlovvr
elif [ "${shortname}" == "vints" ]; then
fn_info_config_vintagestory
fi

38
lgsm/functions/info_messages.sh

@ -572,7 +572,7 @@ fn_info_message_ports(){
parmslocation="${red}UNKNOWN${default}"
# engines/games that require editing in the config file.
local ports_edit_array=( "avalanche2.0" "avalanche3.0" "Ballistic Overkill" "Barotrauma" "dontstarve" "Eco" "idtech2" "idtech3" "idtech3_ql" "lwjgl2" "Minecraft Bedrock" "Project Cars" "projectzomboid" "quake" "refractor" "realvirtuality" "renderware" "Stationeers" "teeworlds" "terraria" "unreal" "unreal2" "unreal3" "TeamSpeak 3" "Mumble" "7 Days To Die" "wurm")
local ports_edit_array=( "avalanche2.0" "avalanche3.0" "Ballistic Overkill" "Barotrauma" "dontstarve" "Eco" "idtech2" "idtech3" "idtech3_ql" "lwjgl2" "Minecraft Bedrock" "Project Cars" "projectzomboid" "quake" "refractor" "realvirtuality" "renderware" "Stationeers" "teeworlds" "terraria" "unreal" "unreal2" "unreal3" "TeamSpeak 3" "Mumble" "7 Days To Die" "Vintage Story" "wurm")
for port_edit in "${ports_edit_array[@]}"; do
if [ "${shortname}" == "ut3" ]; then
parmslocation="${servercfgdir}/UTWeb.ini"
@ -583,7 +583,7 @@ fn_info_message_ports(){
fi
done
# engines/games that require editing the parms.
local ports_edit_array=( "Avorion" "goldsrc" "Factorio" "Hurtworld" "iw3.0" "ioquake3" "qfusion" "Rust" "Soldat" "spark" "source" "starbound" "unreal4" "realvirtuality" "Unturned" )
local ports_edit_array=( "Avorion" "col" "goldsrc" "Factorio" "Hurtworld" "iw3.0" "ioquake3" "qfusion" "Rust" "scpsl" "scpslsm" "Soldat" "spark" "source" "starbound" "unreal4" "realvirtuality" "Unturned" )
for port_edit in "${ports_edit_array[@]}"; do
if [ "${engine}" == "${port_edit}" ]||[ "${gamename}" == "${port_edit}" ]||[ "${shortname}" == "${port_edit}" ]; then
parmslocation="${configdirserver}"
@ -1445,6 +1445,34 @@ fn_info_message_pavlovvr(){
} | column -s $'\t' -t
}
fn_info_message_colony(){
echo -e "netstat -atunp | grep colonyserv"
echo -e ""
{
echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
echo -e "> Game\tINBOUND\t${port}\tudp"
echo -e "> Steam\tINBOUND\t${steamport}\tudp"
} | column -s $'\t' -t
}
fn_info_message_vintagestory(){
echo "netstat -atunp | grep cli"
echo -e ""
{
echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
echo -e "> Game\tINBOUND\t${port}\tTCP"
} | column -s $'\t' -t
}
fn_info_message_scpsl(){
echo -e "netstat -atunp | grep SCPSL"
echo -e ""
{
echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
echo -e "> Game\tINBOUND\t${port}\tudp"
} | column -s $'\t' -t
}
fn_info_message_select_engine(){
# Display details depending on game or engine.
if [ "${shortname}" == "ac" ]; then
@ -1473,6 +1501,8 @@ fn_info_message_select_engine(){
fn_info_message_cod4
elif [ "${shortname}" == "codwaw" ]; then
fn_info_message_codwaw
elif [ "${shortname}" == "col" ]; then
fn_info_message_colony
elif [ "${shortname}" == "dst" ]; then
fn_info_message_dst
elif [ "${shortname}" == "eco" ]; then
@ -1515,6 +1545,8 @@ fn_info_message_select_engine(){
fn_info_message_quakelive
elif [ "${shortname}" == "samp" ]; then
fn_info_message_samp
elif [ "${shortname}" == "scpsl" ]||[ "${shortname}" == "scpslsm" ]; then
fn_info_message_scpsl
elif [ "${shortname}" == "sdtd" ]; then
fn_info_message_sdtd
elif [ "${shortname}" == "squad" ]; then
@ -1561,6 +1593,8 @@ fn_info_message_select_engine(){
fn_info_message_pavlovvr
elif [ "${shortname}" == "rust" ]; then
fn_info_message_rust
elif [ "${shortname}" == "vints" ]; then
fn_info_message_vintagestory
elif [ "${shortname}" == "wf" ]; then
fn_info_message_warfork
elif [ "${shortname}" == "wurm" ]; then

7
lgsm/functions/info_parms.sh

@ -233,6 +233,10 @@ fn_info_parms_wf(){
webadminport=${webadminport:-"0"}
}
fn_info_parms_queryport(){
queryport="${port:-"0"}"
}
if [ "${shortname}" == "ark" ]; then
fn_info_parms_ark
elif [ "${shortname}" == "arma3" ]; then
@ -295,4 +299,7 @@ elif [ "${shortname}" == "ut" ]; then
fn_info_parms_ut
elif [ "${shortname}" == "wf" ]; then
fn_info_parms_wf
# for servers that have a missing queryport from the config
elif [ "${shortname}" == "scpsl" ]||[ "${shortname}" == "scpslsm" ]; then
fn_info_parms_queryport
fi

21
lgsm/functions/install_config.sh

@ -316,6 +316,13 @@ elif [ "${shortname}" == "cc" ]; then
fn_default_config_remote
fn_set_config_vars
fn_list_config_locations
elif [ "${shortname}" == "col" ]; then
gamedirname="ColonySurvival"
array_configs+=( colserver.json )
fn_fetch_default_config
fn_default_config_remote
fn_set_config_vars
fn_list_config_locations
elif [ "${shortname}" == "cs" ]; then
gamedirname="CounterStrike"
array_configs+=( server.cfg )
@ -660,6 +667,13 @@ elif [ "${shortname}" == "rust" ]; then
fn_fetch_default_config
fn_default_config_remote
fn_list_config_locations
elif [ "${shortname}" == "scpsl" ]||[ "${shortname}" == "scpslsm" ]; then
gamedirname="SCPSecretLaboratory"
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}" == "sol" ]; then
gamedirname="Soldat"
array_configs+=( soldat.ini )
@ -786,6 +800,13 @@ elif [ "${shortname}" == "unt" ]; then
fn_default_config_remote
fn_set_config_vars
fn_list_config_locations
elif [ "${shortname}" == "vints" ]; then
gamedirname="VintageStory"
array_configs+=( serverconfig.json )
fn_fetch_default_config
fn_default_config_remote
fn_set_config_vars
fn_list_config_locations
elif [ "${shortname}" == "vs" ]; then
gamedirname="VampireSlayer"
array_configs+=( server.cfg )

2
lgsm/functions/install_server_files.sh

@ -91,6 +91,8 @@ elif [ "${shortname}" == "fctr" ]; then
install_factorio_save.sh
elif [ "${shortname}" == "jk2" ]; then
update_jediknight2.sh
elif [ "${shortname}" == "vints" ]; then
update_vintagestory.sh
elif [ -z "${appid}" ]||[ "${shortname}" == "ahl" ]||[ "${shortname}" == "bd" ]||[ "${shortname}" == "bb" ]||[ "${shortname}" == "ns" ]||[ "${shortname}" == "sfc" ]||[ "${shortname}" == "ts" ]||[ "${shortname}" == "vs" ]||[ "${shortname}" == "zmr" ]; then
if [ "${shortname}" == "ut" ]; then
install_eula.sh

2
lgsm/functions/update_minecraft.sh

@ -88,10 +88,10 @@ fn_update_minecraft_compare(){
echo -e "Update available"
echo -e "* Local build: ${red}${localbuild}${default}"
echo -e "* Remote build: ${green}${remotebuild}${default}"
echo -en "\n"
if [ -n "${branch}" ]; then
echo -e "* Branch: ${branch}"
fi
echo -en "\n"
fn_script_log_info "Update available"
fn_script_log_info "Local build: ${localbuild}"
fn_script_log_info "Remote build: ${remotebuild}"

187
lgsm/functions/update_steamcmd.sh

@ -6,191 +6,8 @@
functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
fn_update_steamcmd_localbuild(){
# Gets local build info.
fn_print_dots "Checking local build: ${remotelocation}"
fn_appmanifest_check
# Uses appmanifest to find local build.
localbuild=$(grep buildid "${appmanifestfile}" | tr '[:blank:]"' ' ' | tr -s ' ' | cut -d\ -f3)
# Set branch to public if no custom branch.
if [ -z "${branch}" ]; then
branch="public"
fi
# Checks if localbuild variable has been set.
if [ -z "${localbuild}" ]||[ "${localbuild}" == "null" ]; then
fn_print_fail "Checking local build: ${remotelocation}"
fn_script_log_fatal "Checking local build"
core_exit.sh
else
fn_print_ok "Checking local build: ${remotelocation}"
fn_script_log_pass "Checking local build"
fi
}
fn_update_steamcmd_remotebuild(){
# Gets remote build info.
if [ -d "${steamcmddir}" ]; then
cd "${steamcmddir}" || exit
fi
# Removes appinfo.vdf as a fix for not always getting up to date version info from SteamCMD.
if [ "$(find "${HOME}" -type f -name "appinfo.vdf" | wc -l)" -ne "0" ]; then
find "${HOME}" -type f -name "appinfo.vdf" -exec rm -f {} \;
fi
if [ -n "${branch}" ]&&[ -n "${betapassword}" ]; then
remotebuild=$(${steamcmdcommand} +login "${steamuser}" "${steampass}" +app_info_update 1 +app_info_print "${appid}" -beta "${branch}" -betapassword "${betapassword}" +quit | sed '1,/branches/d' | sed "1,/${branch}/d" | grep -m 1 buildid | tr -cd '[:digit:]')
elif [ -n "${branch}" ]; then
remotebuild=$(${steamcmdcommand} +login "${steamuser}" "${steampass}" +app_info_update 1 +app_info_print "${appid}" -beta "${branch}" +quit | sed '1,/branches/d' | sed "1,/${branch}/d" | grep -m 1 buildid | tr -cd '[:digit:]')
else
remotebuild=$(${steamcmdcommand} +login "${steamuser}" "${steampass}" +app_info_update 1 +app_info_print "${appid}" +quit | sed '1,/branches/d' | sed "1,/${branch}/d" | grep -m 1 buildid | tr -cd '[:digit:]')
fi
if [ "${firstcommandname}" != "INSTALL" ]; then
fn_print_dots "Checking remote build: ${remotelocation}"
# Checks if remotebuild variable has been set.
if [ -z "${remotebuild}" ]||[ "${remotebuild}" == "null" ]; then
fn_print_fail "Checking remote build: ${remotelocation}"
fn_script_log_fatal "Checking remote build"
core_exit.sh
else
fn_print_ok "Checking remote build: ${remotelocation}"
fn_script_log_pass "Checking remote build"
fi
else
# Checks if remotebuild variable has been set.
if [ -z "${remotebuild}" ]||[ "${remotebuild}" == "null" ]; then
fn_print_failure "Unable to get remote build"
fn_script_log_fatal "Unable to get remote build"
core_exit.sh
fi
fi
}
fn_update_steamcmd_compare(){
fn_print_dots "Checking for update: ${remotelocation}"
if [ "${localbuild}" != "${remotebuild}" ]; then
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}${remotebuild}${default}"
if [ -n "${branch}" ]; then
echo -e "* Branch: ${branch}"
fi
if [ -n "${betapassword}" ]; then
echo -e "* Branch password: ${betapassword}"
fi
echo -e "https://steamdb.info/app/${appid}/"
echo -en "\n"
fn_script_log_info "Update available"
fn_script_log_info "Local build: ${localbuild}"
fn_script_log_info "Remote build: ${remotebuild}"
if [ -n "${branch}" ]; then
fn_script_log_info "Branch: ${branch}"
fi
if [ -n "${betapassword}" ]; then
fn_script_log_info "Branch password: ${betapassword}"
fi
fn_script_log_info "${localbuild} > ${remotebuild}"
unset updateonstart
check_status.sh
# If server stopped.
if [ "${status}" == "0" ]; then
fn_dl_steamcmd
# If server started.
else
fn_print_restart_warning
exitbypass=1
command_stop.sh
fn_firstcommand_reset
exitbypass=1
fn_dl_steamcmd
exitbypass=1
command_start.sh
fn_firstcommand_reset
fi
unset exitbypass
date +%s > "${lockdir}/lastupdate.lock"
alert="update"
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}${remotebuild}${default}"
if [ -n "${branch}" ]; then
echo -e "* Branch: ${branch}"
fi
if [ -n "${betapassword}" ]; then
echo -e "* Branch password: ${betapassword}"
fi
echo -e "https://steamdb.info/app/${appid}/"
echo -en "\n"
fn_script_log_info "No update available"
fn_script_log_info "Local build: ${localbuild}"
fn_script_log_info "Remote build: ${remotebuild}"
if [ -n "${branch}" ]; then
fn_script_log_info "Branch: ${branch}"
fi
if [ -n "${betapassword}" ]; then
fn_script_log_info "Branch password: ${betapassword}"
fi
fi
}
fn_appmanifest_info(){
appmanifestfile=$(find "${serverfiles}" -type f -name "appmanifest_${appid}.acf")
appmanifestfilewc=$(find "${serverfiles}" -type f -name "appmanifest_${appid}.acf" | wc -l)
}
fn_appmanifest_check(){
fn_appmanifest_info
# Multiple or no matching appmanifest files may sometimes be present.
# This error is corrected if required.
if [ "${appmanifestfilewc}" -ge "2" ]; then
fn_print_error "Multiple appmanifest_${appid}.acf files found"
fn_script_log_error "Multiple appmanifest_${appid}.acf files found"
fn_print_dots "Removing x${appmanifestfilewc} appmanifest_${appid}.acf files"
for appfile in ${appmanifestfile}; do
rm -f "${appfile:?}"
done
appmanifestfilewc1="${appmanifestfilewc}"
fn_appmanifest_info
# if error can not be resolved.
if [ "${appmanifestfilewc}" -ge "2" ]; then
fn_print_fail "Unable to remove x${appmanifestfilewc} appmanifest_${appid}.acf files"
fn_script_log_fatal "Unable to remove x${appmanifestfilewc} appmanifest_${appid}.acf files"
echo -e "* Check user permissions"
for appfile in ${appmanifestfile}; do
echo -e " ${appfile}"
done
core_exit.sh
else
fn_print_ok "Removed x${appmanifestfilewc1} appmanifest_${appid}.acf files"
fn_script_log_pass "Removed x${appmanifestfilewc1} appmanifest_${appid}.acf files"
fn_print_info_nl "Forcing update to correct issue"
fn_script_log_info "Forcing update to correct issue"
fn_dl_steamcmd
fi
elif [ "${appmanifestfilewc}" -eq "0" ]; then
fn_print_error_nl "No appmanifest_${appid}.acf found"
fn_script_log_error "No appmanifest_${appid}.acf found"
fn_print_info_nl "Forcing update to correct issue"
fn_script_log_info "Forcing update to correct issue"
fn_dl_steamcmd
fn_appmanifest_info
if [ "${appmanifestfilewc}" -eq "0" ]; then
fn_print_fail_nl "Still no appmanifest_${appid}.acf found"
fn_script_log_fatal "Still no appmanifest_${appid}.acf found"
core_exit.sh
fi
fi
}
# init steamcmd functions
core_steamcmd.sh
# The location where the builds are checked and downloaded.
remotelocation="SteamCMD"

145
lgsm/functions/update_vintagestory.sh

@ -0,0 +1,145 @@
#!/bin/bash
# LinuxGSM update_vintagestory.sh function
# Author: Christian Birk
# Website: https://linuxgsm.com
# Description: Handles updating of Vintage Story servers.
functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
fn_update_vs_dl(){
# get version info for download
remotebuildresponse=$(curl -s "${apiurl}" | jq --arg version "${remotebuild}" '.[$version].server')
remotebuildfile=$(echo -e "${remotebuildresponse}" | jq -r '.filename')
remotebuildlink=$(echo -e "${remotebuildresponse}" | jq -r '.urls.cdn')
remotebuildmd5=$(echo -e "${remotebuildresponse}" | jq -r '.md5')
# Download and extract files to serverfiles
fn_fetch_file "${remotebuildlink}" "" "" "" "${tmpdir}" "${remotebuildfile}" "nochmodx" "norun" "force" "${remotebuildmd5}"
fn_dl_extract "${tmpdir}" "${remotebuildfile}" "${serverfiles}"
fn_clear_tmp
}
fn_update_vs_localbuild(){
# Gets local build info.
fn_print_dots "Checking local build: ${remotelocation}"
# Uses executable to find local build.
cd "${executabledir}" || exit
if [ -f "${executable}" ]; then
localbuild="$(${preexecutable} ${executable} --version | sed '/^[[:space:]]*$/d')"
fn_print_ok "Checking local build: ${remotelocation}"
fn_script_log_pass "Checking local build"
else
localbuild="0"
fn_print_error "Checking local build: ${remotelocation}"
fn_script_log_error "Checking local build"
fi
}
fn_update_vs_remotebuild(){
if [ "${branch}" == "stable" ]; then
remotebuild=$(curl -s "${apiurl}" | jq -r '[ to_entries[] ] | .[].key' | grep -Ev "\-rc|\-pre" | sort -r -V | head -1)
else
remotebuild=$(curl -s "${apiurl}" | jq -r '[ to_entries[] ] | .[].key' | grep -E "\-rc|\-pre" | sort -r -V | head -1)
fi
if [ "${firstcommandname}" != "INSTALL" ]; then
fn_print_dots "Checking remote build: ${remotelocation}"
# Checks if remotebuild variable has been set.
if [ -z "${remotebuild}" ]||[ "${remotebuild}" == "null" ]; then
fn_print_fail "Checking remote build: ${remotelocation}"
fn_script_log_fatal "Checking remote build"
core_exit.sh
else
fn_print_ok "Checking remote build: ${remotelocation}"
fn_script_log_pass "Checking remote build"
fi
else
# Checks if remotebuild variable has been set.
if [ -z "${remotebuild}" ]||[ "${remotebuild}" == "null" ]; then
fn_print_failure "Unable to get remote build"
fn_script_log_fatal "Unable to get remote build"
core_exit.sh
fi
fi
}
fn_update_vs_compare(){
# Removes dots so if statement can compare version numbers.
fn_print_dots "Checking for update: ${remotelocation}"
if [ "${localbuild}" != "${remotebuild}" ]||[ "${forceupdate}" == "1" ]; then
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}${remotebuild}${default}"
if [ -n "${branch}" ]; then
echo -e "* Branch: ${branch}"
fi
echo -en "\n"
fn_script_log_info "Update available"
fn_script_log_info "Local build: ${localbuild}"
fn_script_log_info "Remote build: ${remotebuild}"
fn_script_log_info "${localbuild} > ${remotebuild}"
unset updateonstart
check_status.sh
# If server stopped.
if [ "${status}" == "0" ]; then
exitbypass=1
fn_update_vs_dl
exitbypass=1
command_start.sh
exitbypass=1
command_stop.sh
fn_firstcommand_reset
# If server started.
else
fn_print_restart_warning
exitbypass=1
command_stop.sh
fn_firstcommand_reset
exitbypass=1
fn_update_vs_dl
exitbypass=1
command_start.sh
fn_firstcommand_reset
fi
unset exitbypass
date +%s > "${lockdir}/lastupdate.lock"
alert="update"
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}${remotebuild}${default}"
if [ -n "${branch}" ]; then
echo -e "* Branch: ${branch}"
fi
echo -en "\n"
fn_script_log_info "No update available"
fn_script_log_info "Local build: ${localbuild}"
fn_script_log_info "Remote build: ${remotebuild}"
if [ -n "${branch}" ]; then
fn_script_log_info "Branch: ${branch}"
fi
fi
}
# The location where the builds are checked and downloaded.
remotelocation="vintagestory.at"
apiurl="http://api.${remotelocation}/stable-unstable.json"
localversionfile="${datadir}/vintagestoryversion"
if [ "${firstcommandname}" == "INSTALL" ]; then
fn_update_vs_remotebuild
fn_update_vs_dl
else
fn_print_dots "Checking for update"
fn_print_dots "Checking for update: ${remotelocation}"
fn_script_log_info "Checking for update: ${remotelocation}"
fn_update_vs_localbuild
fn_update_vs_remotebuild
fn_update_vs_compare
fi

20
linuxgsm.sh

@ -20,7 +20,7 @@ if [ -f ".dev-debug" ]; then
set -x
fi
version="v20.6.1"
version="v20.6.2"
shortname="core"
gameservername="core"
commandname="CORE"
@ -413,6 +413,15 @@ else
# shellcheck source=/dev/null
source "${configdirserver}/common.cfg"
fi
# Load the secrets-common.cfg config. If missing download it.
if [ ! -f "${configdirserver}/secrets-common.cfg" ]; then
fn_fetch_config "lgsm/config-default/config-lgsm" "secrets-common-template.cfg" "${configdirserver}" "secrets-common.cfg" "${chmodx}" "nochmodx" "norun" "noforcedl" "nomd5"
# shellcheck source=/dev/null
source "${configdirserver}/secrets-common.cfg"
else
# shellcheck source=/dev/null
source "${configdirserver}/secrets-common.cfg"
fi
# Load the instance.cfg config. If missing download it.
if [ ! -f "${configdirserver}/${selfname}.cfg" ]; then
fn_fetch_config "lgsm/config-default/config-lgsm" "instance-template.cfg" "${configdirserver}" "${selfname}.cfg" "nochmodx" "norun" "noforcedl" "nomd5"
@ -422,6 +431,15 @@ else
# shellcheck source=/dev/null
source "${configdirserver}/${selfname}.cfg"
fi
# Load the secrets-instance.cfg config. If missing download it.
if [ ! -f "${configdirserver}/secrets-${selfname}.cfg" ]; then
fn_fetch_config "lgsm/config-default/config-lgsm" "secrets-instance-template.cfg" "${configdirserver}" "secrets-${selfname}.cfg" "nochmodx" "norun" "noforcedl" "nomd5"
# shellcheck source=/dev/null
source "${configdirserver}/secrets-${selfname}.cfg"
else
# shellcheck source=/dev/null
source "${configdirserver}/secrets-${selfname}.cfg"
fi
# Load the linuxgsm.sh in to tmpdir. If missing download it.
if [ ! -f "${tmpdir}/linuxgsm.sh" ]; then

20
tests/tests_fctrserver.sh

@ -20,7 +20,7 @@ if [ -f ".dev-debug" ]; then
set -x
fi
version="v20.6.1"
version="v20.6.2"
shortname="fctr"
gameservername="fctrserver"
commandname="CORE"
@ -421,6 +421,15 @@ else
# shellcheck source=/dev/null
source "${configdirserver}/common.cfg"
fi
# Load the secrets-common.cfg config. If missing download it.
if [ ! -f "${configdirserver}/secrets-common.cfg" ]; then
fn_fetch_config "lgsm/config-default/config-lgsm" "secrets-common-template.cfg" "${configdirserver}" "secrets-common.cfg" "${chmodx}" "nochmodx" "norun" "noforcedl" "nomd5"
# shellcheck source=/dev/null
source "${configdirserver}/secrets-common.cfg"
else
# shellcheck source=/dev/null
source "${configdirserver}/secrets-common.cfg"
fi
# Load the instance.cfg config. If missing download it.
if [ ! -f "${configdirserver}/${selfname}.cfg" ]; then
fn_fetch_config "lgsm/config-default/config-lgsm" "instance-template.cfg" "${configdirserver}" "${selfname}.cfg" "nochmodx" "norun" "noforcedl" "nomd5"
@ -430,6 +439,15 @@ else
# shellcheck source=/dev/null
source "${configdirserver}/${selfname}.cfg"
fi
# Load the secrets-instance.cfg config. If missing download it.
if [ ! -f "${configdirserver}/secrets-${selfname}.cfg" ]; then
fn_fetch_config "lgsm/config-default/config-lgsm" "secrets-instance-template.cfg" "${configdirserver}" "secrets-${selfname}.cfg" "nochmodx" "norun" "noforcedl" "nomd5"
# shellcheck source=/dev/null
source "${configdirserver}/secrets-${selfname}.cfg"
else
# shellcheck source=/dev/null
source "${configdirserver}/secrets-${selfname}.cfg"
fi
# Load the linuxgsm.sh in to tmpdir. If missing download it.
if [ ! -f "${tmpdir}/linuxgsm.sh" ]; then

20
tests/tests_jc2server.sh

@ -20,7 +20,7 @@ if [ -f ".dev-debug" ]; then
set -x
fi
version="v20.6.1"
version="v20.6.2"
shortname="jc2"
gameservername="jc2server"
commandname="CORE"
@ -422,6 +422,15 @@ else
# shellcheck source=/dev/null
source "${configdirserver}/common.cfg"
fi
# Load the secrets-common.cfg config. If missing download it.
if [ ! -f "${configdirserver}/secrets-common.cfg" ]; then
fn_fetch_config "lgsm/config-default/config-lgsm" "secrets-common-template.cfg" "${configdirserver}" "secrets-common.cfg" "${chmodx}" "nochmodx" "norun" "noforcedl" "nomd5"
# shellcheck source=/dev/null
source "${configdirserver}/secrets-common.cfg"
else
# shellcheck source=/dev/null
source "${configdirserver}/secrets-common.cfg"
fi
# Load the instance.cfg config. If missing download it.
if [ ! -f "${configdirserver}/${selfname}.cfg" ]; then
fn_fetch_config "lgsm/config-default/config-lgsm" "instance-template.cfg" "${configdirserver}" "${selfname}.cfg" "nochmodx" "norun" "noforcedl" "nomd5"
@ -431,6 +440,15 @@ else
# shellcheck source=/dev/null
source "${configdirserver}/${selfname}.cfg"
fi
# Load the secrets-instance.cfg config. If missing download it.
if [ ! -f "${configdirserver}/secrets-${selfname}.cfg" ]; then
fn_fetch_config "lgsm/config-default/config-lgsm" "secrets-instance-template.cfg" "${configdirserver}" "secrets-${selfname}.cfg" "nochmodx" "norun" "noforcedl" "nomd5"
# shellcheck source=/dev/null
source "${configdirserver}/secrets-${selfname}.cfg"
else
# shellcheck source=/dev/null
source "${configdirserver}/secrets-${selfname}.cfg"
fi
# Load the linuxgsm.sh in to tmpdir. If missing download it.
if [ ! -f "${tmpdir}/linuxgsm.sh" ]; then

20
tests/tests_mcserver.sh

@ -20,7 +20,7 @@ if [ -f ".dev-debug" ]; then
set -x
fi
version="v20.6.1"
version="v20.6.2"
shortname="mc"
gameservername="mcserver"
commandname="CORE"
@ -422,6 +422,15 @@ else
# shellcheck source=/dev/null
source "${configdirserver}/common.cfg"
fi
# Load the secrets-common.cfg config. If missing download it.
if [ ! -f "${configdirserver}/secrets-common.cfg" ]; then
fn_fetch_config "lgsm/config-default/config-lgsm" "secrets-common.cfg" "${configdirserver}" "secrets-common.cfg" "${chmodx}" "nochmodx" "norun" "noforcedl" "nomd5"
# shellcheck source=/dev/null
source "${configdirserver}/secrets-common.cfg"
else
# shellcheck source=/dev/null
source "${configdirserver}/secrets-common.cfg"
fi
# Load the instance.cfg config. If missing download it.
if [ ! -f "${configdirserver}/${selfname}.cfg" ]; then
fn_fetch_config "lgsm/config-default/config-lgsm" "instance-template.cfg" "${configdirserver}" "${selfname}.cfg" "nochmodx" "norun" "noforcedl" "nomd5"
@ -431,6 +440,15 @@ else
# shellcheck source=/dev/null
source "${configdirserver}/${selfname}.cfg"
fi
# Load the secrets-instance.cfg config. If missing download it.
if [ ! -f "${configdirserver}/secrets-${selfname}.cfg" ]; then
fn_fetch_config "lgsm/config-default/config-lgsm" "secrets-instance-template.cfg" "${configdirserver}" "secrets-${selfname}.cfg" "nochmodx" "norun" "noforcedl" "nomd5"
# shellcheck source=/dev/null
source "${configdirserver}/secrets-${selfname}.cfg"
else
# shellcheck source=/dev/null
source "${configdirserver}/secrets-${selfname}.cfg"
fi
# Load the linuxgsm.sh in to tmpdir. If missing download it.
if [ ! -f "${tmpdir}/linuxgsm.sh" ]; then

20
tests/tests_ts3server.sh

@ -20,7 +20,7 @@ if [ -f ".dev-debug" ]; then
set -x
fi
version="v20.6.1"
version="v20.6.2"
shortname="ts3"
gameservername="ts3server"
commandname="CORE"
@ -422,6 +422,15 @@ else
# shellcheck source=/dev/null
source "${configdirserver}/common.cfg"
fi
# Load the secrets-common.cfg config. If missing download it.
if [ ! -f "${configdirserver}/secrets-common.cfg" ]; then
fn_fetch_config "lgsm/config-default/config-lgsm" "secrets-common-template.cfg" "${configdirserver}" "secrets-common.cfg" "${chmodx}" "nochmodx" "norun" "noforcedl" "nomd5"
# shellcheck source=/dev/null
source "${configdirserver}/secrets-common.cfg"
else
# shellcheck source=/dev/null
source "${configdirserver}/secrets-common.cfg"
fi
# Load the instance.cfg config. If missing download it.
if [ ! -f "${configdirserver}/${selfname}.cfg" ]; then
fn_fetch_config "lgsm/config-default/config-lgsm" "instance-template.cfg" "${configdirserver}" "${selfname}.cfg" "nochmodx" "norun" "noforcedl" "nomd5"
@ -431,6 +440,15 @@ else
# shellcheck source=/dev/null
source "${configdirserver}/${selfname}.cfg"
fi
# Load the secrets-instance.cfg config. If missing download it.
if [ ! -f "${configdirserver}/secrets-${selfname}.cfg" ]; then
fn_fetch_config "lgsm/config-default/config-lgsm" "secrets-instance-template.cfg" "${configdirserver}" "secrets-${selfname}.cfg" "nochmodx" "norun" "noforcedl" "nomd5"
# shellcheck source=/dev/null
source "${configdirserver}/secrets-${selfname}.cfg"
else
# shellcheck source=/dev/null
source "${configdirserver}/secrets-${selfname}.cfg"
fi
# Load the linuxgsm.sh in to tmpdir. If missing download it.
if [ ! -f "${tmpdir}/linuxgsm.sh" ]; then

Loading…
Cancel
Save