committed by
GitHub
36 changed files with 1538 additions and 370 deletions
@ -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" |
@ -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" |
@ -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" |
@ -0,0 +1,5 @@ |
|||||
|
################################## |
||||
|
######## Common Secrets ########## |
||||
|
################################## |
||||
|
# PLACE GLOBAL SECRET SETTINGS HERE |
||||
|
## These settings will apply to all instances. |
@ -0,0 +1,5 @@ |
|||||
|
################################## |
||||
|
####### Instance Secrets ######### |
||||
|
################################## |
||||
|
# PLACE INSTANCE SECRET SETTINGS HERE |
||||
|
## These settings will apply to a specific instance. |
@ -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" |
Can't render this file because it has a wrong number of fields in line 66.
|
@ -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 |
@ -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 |
@ -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 |
||||
|
} |
@ -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 |
Loading…
Reference in new issue