diff --git a/README.md b/README.md index 25996581ab..6fecaea1a7 100644 --- a/README.md +++ b/README.md @@ -60,3 +60,4 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome! + diff --git a/lgsm/config-default/config-lgsm/acserver/_default.cfg b/lgsm/config-default/config-lgsm/acserver/_default.cfg new file mode 100644 index 0000000000..b9436fb3f2 --- /dev/null +++ b/lgsm/config-default/config-lgsm/acserver/_default.cfg @@ -0,0 +1,169 @@ +################################## +######## 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 #### + +## SteamCMD Login | https://docs.linuxgsm.com/steamcmd#steamcmd-login +steamuser="username" +steampass='password' + +## Server Start Settings | https://docs.linuxgsm.com/configuration/start-parameters + +## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +fn_parms(){ +parms="-c ${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" +postdays="7" +posttarget="https://termbin.com" + +# Discord Alerts | https://docs.linuxgsm.com/alerts/discord +discordalert="off" +discordwebhook="webhook" + +# Email Alerts | https://docs.linuxgsm.com/alerts/email +emailalert="off" +email="email@example.com" +emailfrom="" + +# IFTTT Alerts | https://docs.linuxgsm.com/alerts/ifttt +iftttalert="off" +ifttttoken="accesstoken" +iftttevent="linuxgsm_alert" + +# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun +mailgunalert="off" +mailguntoken="accesstoken" +mailgundomain="example.com" +mailgunemailfrom="alert@example.com" +mailgunemail="email@myemail.com" + +# Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet +pushbulletalert="off" +pushbullettoken="accesstoken" +channeltag="" + +# Pushover Alerts | https://docs.linuxgsm.com/alerts/pushover +pushoveralert="off" +pushovertoken="accesstoken" + +# Slack Alerts | https://docs.linuxgsm.com/alerts/slack +slackalert="off" +slackwebhook="webhook" + +# Telegram Alerts | https://docs.linuxgsm.com/alerts/telegram +# You can add a custom cURL string eg proxy (useful in Russia) or else in "curlcustomstring". +# like a "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help", if you not need +# 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" + +## 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="302550" +# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch +branch="" + +## 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 +stopmode="2" + +## Query mode +# 1: session only +# 2: gamedig + gsquery +# 3: gamedig +# 4: gsquery +# 5: tcp +querymode="5" +querytype="" + +## Game Server Details +# Do not edit +gamename="Assetto Corsa" +engine="unity3d" +glibc="" + +#### Directories #### +# Edit with care + +## Game Server Directories +systemdir="${serverfiles}" +executabledir="${systemdir}" +executable="./acServer" +servercfgdir="${systemdir}/cfg" +servercfg="${selfname}.cfg" +servercfgdefault="server_cfg.ini" +servercfgfullpath="${servercfgdir}/${servercfg}" + +## Backup Directory +backupdir="${lgsmdir}/backup" + +## Logging Directories +logdir="${rootdir}/log" +gamelogdir="${systemdir}/logs" +lgsmlogdir="${logdir}/script" +consolelogdir="${logdir}/console" +lgsmlog="${lgsmlogdir}/${selfname}-script.log" +consolelog="${consolelogdir}/${selfname}-console.log" +alertlog="${lgsmlogdir}/${selfname}-alert.log" +postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" + +## Logs Naming +lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" +consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" diff --git a/lgsm/config-default/config-lgsm/ahl2server/_default.cfg b/lgsm/config-default/config-lgsm/ahl2server/_default.cfg index 02dd1657ac..c41d0c8f96 100644 --- a/lgsm/config-default/config-lgsm/ahl2server/_default.cfg +++ b/lgsm/config-default/config-lgsm/ahl2server/_default.cfg @@ -120,8 +120,8 @@ sleeptime="0.5" # 6: q # 7: exit # 8: 7 Days to Die -# 9: Gold Source -# 10: Teamspeak 3 +# 9: GoldSrc +# 10: Avorion stopmode="3" ## Query mode diff --git a/lgsm/config-default/config-lgsm/ahlserver/_default.cfg b/lgsm/config-default/config-lgsm/ahlserver/_default.cfg index 4e3039209b..69fc33e0c6 100644 --- a/lgsm/config-default/config-lgsm/ahlserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/ahlserver/_default.cfg @@ -124,8 +124,8 @@ steammaster="true" # 6: q # 7: exit # 8: 7 Days to Die -# 9: Gold Source -# 10: Teamspeak 3 +# 9: GoldSrc +# 10: Avorion stopmode="9" ## Query mode @@ -140,7 +140,7 @@ querytype="protocol-valve" ## Game Server Details # Do not edit gamename="Action half-life" -engine="goldsource" +engine="goldsrc" glibc="2.3.4" #### Directories #### diff --git a/lgsm/config-default/config-lgsm/arkserver/_default.cfg b/lgsm/config-default/config-lgsm/arkserver/_default.cfg index 2bc9894afc..a657d62738 100644 --- a/lgsm/config-default/config-lgsm/arkserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/arkserver/_default.cfg @@ -125,8 +125,8 @@ steammaster="true" # 6: q # 7: exit # 8: 7 Days to Die -# 9: Gold Source -# 10: Teamspeak 3 +# 9: GoldSrc +# 10: Avorion stopmode="2" ## Query mode diff --git a/lgsm/config-default/config-lgsm/arma3server/_default.cfg b/lgsm/config-default/config-lgsm/arma3server/_default.cfg index f56fdac896..628634140d 100644 --- a/lgsm/config-default/config-lgsm/arma3server/_default.cfg +++ b/lgsm/config-default/config-lgsm/arma3server/_default.cfg @@ -139,8 +139,8 @@ steammaster="false" # 6: q # 7: exit # 8: 7 Days to Die -# 9: Gold Source -# 10: Teamspeak 3 +# 9: GoldSrc +# 10: Avorion stopmode="2" ## Query mode diff --git a/lgsm/config-default/config-lgsm/avserver/_default.cfg b/lgsm/config-default/config-lgsm/avserver/_default.cfg new file mode 100644 index 0000000000..4b53d68d23 --- /dev/null +++ b/lgsm/config-default/config-lgsm/avserver/_default.cfg @@ -0,0 +1,173 @@ +################################## +######## 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 Start Settings | https://docs.linuxgsm.com/configuration/start-parameters +port="27000" +# https://steamidfinder.com +adminsteamid="" +avgalaxy="avgalaxy" + +## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +fn_parms(){ +if [ ! -z "${adminsteamid}" ]; then + admincmd="--admin ${adminsteamid}" +fi +parms="--galaxy-name ${avgalaxy} --ip ${ip} --datapath ${avdatapath} ${admincmd}" +} + +#### 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" +postdays="7" +posttarget="https://termbin.com" + +# Discord Alerts | https://docs.linuxgsm.com/alerts/discord +discordalert="off" +discordwebhook="webhook" + +# Email Alerts | https://docs.linuxgsm.com/alerts/email +emailalert="off" +email="email@example.com" +emailfrom="" + +# IFTTT Alerts | https://docs.linuxgsm.com/alerts/ifttt +iftttalert="off" +ifttttoken="accesstoken" +iftttevent="linuxgsm_alert" + +# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun +mailgunalert="off" +mailguntoken="accesstoken" +mailgundomain="example.com" +mailgunemailfrom="alert@example.com" +mailgunemail="email@myemail.com" + +# Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet +pushbulletalert="off" +pushbullettoken="accesstoken" +channeltag="" + +# Pushover Alerts | https://docs.linuxgsm.com/alerts/pushover +pushoveralert="off" +pushovertoken="accesstoken" + +# Slack Alerts | https://docs.linuxgsm.com/alerts/slack +slackalert="off" +slackwebhook="webhook" + +# Telegram Alerts | https://docs.linuxgsm.com/alerts/telegram +# You can add a custom cURL string eg proxy (useful in Russia) or else in "curlcustomstring". +# like a "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help", if you not need +# 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" + +## 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="565060" +# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch +branch="" +# 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 +stopmode="10" + +## Query mode +# 1: session only +# 2: gamedig + gsquery +# 3: gamedig +# 4: gsquery +# 5: tcp +querymode="5" +querytype="" + +## Game Server Details +# Do not edit +gamename="Avorion" +engine="avorion" +glibc="2.15" + +#### Directories #### +# Edit with care + +## Game Server Directories +avdatapath="${serverfiles}/galaxy" +avgalaxypath="${avdatapath}/${avgalaxy}" +systemdir="${serverfiles}" +executabledir="${systemdir}" +executable="./server.sh" +servercfgdir="${avgalaxypath}" +servercfg="server.ini" +servercfgdefault="server.ini" +servercfgfullpath="${servercfgdir}/${servercfg}" + +## Backup Directory +backupdir="${lgsmdir}/backup" + +## Logging Directories +logdir="${rootdir}/log" +gamelogdir="${systemdir}/ServerLogs" +lgsmlogdir="${logdir}/script" +consolelogdir="${logdir}/console" +lgsmlog="${lgsmlogdir}/${selfname}-script.log" +consolelog="${consolelogdir}/${selfname}-console.log" +alertlog="${lgsmlogdir}/${selfname}-alert.log" +postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" + +## Logs Naming +lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" +consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" diff --git a/lgsm/config-default/config-lgsm/bb2server/_default.cfg b/lgsm/config-default/config-lgsm/bb2server/_default.cfg index a1a9ae3500..e361cb9dc5 100644 --- a/lgsm/config-default/config-lgsm/bb2server/_default.cfg +++ b/lgsm/config-default/config-lgsm/bb2server/_default.cfg @@ -129,8 +129,8 @@ steammaster="true" # 6: q # 7: exit # 8: 7 Days to Die -# 9: Gold Source -# 10: Teamspeak 3 +# 9: GoldSrc +# 10: Avorion stopmode="3" ## Query mode diff --git a/lgsm/config-default/config-lgsm/bbserver/_default.cfg b/lgsm/config-default/config-lgsm/bbserver/_default.cfg index 75da976626..3fdb866c33 100644 --- a/lgsm/config-default/config-lgsm/bbserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/bbserver/_default.cfg @@ -124,8 +124,8 @@ steammaster="true" # 6: q # 7: exit # 8: 7 Days to Die -# 9: Gold Source -# 10: Teamspeak 3 +# 9: GoldSrc +# 10: Avorion stopmode="9" ## Query mode @@ -140,7 +140,7 @@ querytype="protocol-valve" ## Game Server Details # Do not edit gamename="BrainBread" -engine="goldsource" +engine="goldsrc" glibc="2.3.4" #### Directories #### diff --git a/lgsm/config-default/config-lgsm/bdserver/_default.cfg b/lgsm/config-default/config-lgsm/bdserver/_default.cfg index 77c169e6a1..ec408753ee 100644 --- a/lgsm/config-default/config-lgsm/bdserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/bdserver/_default.cfg @@ -123,8 +123,8 @@ steammaster="true" # 6: q # 7: exit # 8: 7 Days to Die -# 9: Gold Source -# 10: Teamspeak 3 +# 9: GoldSrc +# 10: Avorion stopmode="9" ## Query mode @@ -139,7 +139,7 @@ querytype="protocol-valve" ## Game Server Details # Do not edit gamename="Base Defense" -engine="goldsource" +engine="goldsrc" glibc="2.14" #### Directories #### diff --git a/lgsm/config-default/config-lgsm/bf1942server/_default.cfg b/lgsm/config-default/config-lgsm/bf1942server/_default.cfg index b6e508e010..ebb977a921 100644 --- a/lgsm/config-default/config-lgsm/bf1942server/_default.cfg +++ b/lgsm/config-default/config-lgsm/bf1942server/_default.cfg @@ -108,8 +108,8 @@ sleeptime="0.5" # 6: q # 7: exit # 8: 7 Days to Die -# 9: Gold Source -# 10: Teamspeak 3 +# 9: GoldSrc +# 10: Avorion stopmode="2" ## Query mode diff --git a/lgsm/config-default/config-lgsm/bmdmserver/_default.cfg b/lgsm/config-default/config-lgsm/bmdmserver/_default.cfg index b92257fff5..61d4c3e4c1 100644 --- a/lgsm/config-default/config-lgsm/bmdmserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/bmdmserver/_default.cfg @@ -129,8 +129,8 @@ steammaster="true" # 6: q # 7: exit # 8: 7 Days to Die -# 9: Gold Source -# 10: Teamspeak 3 +# 9: GoldSrc +# 10: Avorion stopmode="3" ## Query mode diff --git a/lgsm/config-default/config-lgsm/boserver/_default.cfg b/lgsm/config-default/config-lgsm/boserver/_default.cfg index 73015c2d6c..698667c10c 100644 --- a/lgsm/config-default/config-lgsm/boserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/boserver/_default.cfg @@ -122,8 +122,8 @@ steammaster="false" # 6: q # 7: exit # 8: 7 Days to Die -# 9: Gold Source -# 10: Teamspeak 3 +# 9: GoldSrc +# 10: Avorion stopmode="2" ## Query mode diff --git a/lgsm/config-default/config-lgsm/bsserver/_default.cfg b/lgsm/config-default/config-lgsm/bsserver/_default.cfg index 612e4cb2bb..69094f8ef2 100644 --- a/lgsm/config-default/config-lgsm/bsserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/bsserver/_default.cfg @@ -133,8 +133,8 @@ steammaster="true" # 6: q # 7: exit # 8: 7 Days to Die -# 9: Gold Source -# 10: Teamspeak 3 +# 9: GoldSrc +# 10: Avorion stopmode="3" ## Query mode diff --git a/lgsm/config-default/config-lgsm/bt1944server/_default.cfg b/lgsm/config-default/config-lgsm/bt1944server/_default.cfg index 2ca021b278..d90b945235 100644 --- a/lgsm/config-default/config-lgsm/bt1944server/_default.cfg +++ b/lgsm/config-default/config-lgsm/bt1944server/_default.cfg @@ -121,8 +121,8 @@ steammaster="false" # 6: q # 7: exit # 8: 7 Days to Die -# 9: Gold Source -# 10: Teamspeak 3 +# 9: GoldSrc +# 10: Avorion stopmode="2" ## Query mode diff --git a/lgsm/config-default/config-lgsm/btserver/_default.cfg b/lgsm/config-default/config-lgsm/btserver/_default.cfg index 45d54833a9..416e77c09d 100644 --- a/lgsm/config-default/config-lgsm/btserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/btserver/_default.cfg @@ -116,8 +116,8 @@ steammaster="true" # 6: q # 7: exit # 8: 7 Days to Die -# 9: Gold Source -# 10: Teamspeak 3 +# 9: GoldSrc +# 10: Avorion stopmode="7" ## Query mode diff --git a/lgsm/config-default/config-lgsm/ccserver/_default.cfg b/lgsm/config-default/config-lgsm/ccserver/_default.cfg index 2913a289db..e9f0a70dd8 100644 --- a/lgsm/config-default/config-lgsm/ccserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/ccserver/_default.cfg @@ -124,8 +124,8 @@ steammaster="false" # 6: q # 7: exit # 8: 7 Days to Die -# 9: Gold Source -# 10: Teamspeak 3 +# 9: GoldSrc +# 10: Avorion stopmode="3" ## Query mode diff --git a/lgsm/config-default/config-lgsm/cod2server/_default.cfg b/lgsm/config-default/config-lgsm/cod2server/_default.cfg index 6c8a31c715..a686ea45fb 100644 --- a/lgsm/config-default/config-lgsm/cod2server/_default.cfg +++ b/lgsm/config-default/config-lgsm/cod2server/_default.cfg @@ -111,8 +111,8 @@ sleeptime="0.5" # 6: q # 7: exit # 8: 7 Days to Die -# 9: Gold Source -# 10: Teamspeak 3 +# 9: GoldSrc +# 10: Avorion stopmode="3" ## Query mode diff --git a/lgsm/config-default/config-lgsm/cod4server/_default.cfg b/lgsm/config-default/config-lgsm/cod4server/_default.cfg index f319c7ae95..027c525091 100644 --- a/lgsm/config-default/config-lgsm/cod4server/_default.cfg +++ b/lgsm/config-default/config-lgsm/cod4server/_default.cfg @@ -111,8 +111,8 @@ sleeptime="0.5" # 6: q # 7: exit # 8: 7 Days to Die -# 9: Gold Source -# 10: Teamspeak 3 +# 9: GoldSrc +# 10: Avorion stopmode="3" ## Query mode diff --git a/lgsm/config-default/config-lgsm/codserver/_default.cfg b/lgsm/config-default/config-lgsm/codserver/_default.cfg index 14c2ea889c..74e186466f 100644 --- a/lgsm/config-default/config-lgsm/codserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/codserver/_default.cfg @@ -111,8 +111,8 @@ sleeptime="0.5" # 6: q # 7: exit # 8: 7 Days to Die -# 9: Gold Source -# 10: Teamspeak 3 +# 9: GoldSrc +# 10: Avorion stopmode="3" ## Query mode diff --git a/lgsm/config-default/config-lgsm/coduoserver/_default.cfg b/lgsm/config-default/config-lgsm/coduoserver/_default.cfg index 9eb271d27a..b4e16cfffa 100644 --- a/lgsm/config-default/config-lgsm/coduoserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/coduoserver/_default.cfg @@ -111,8 +111,8 @@ sleeptime="0.5" # 6: q # 7: exit # 8: 7 Days to Die -# 9: Gold Source -# 10: Teamspeak 3 +# 9: GoldSrc +# 10: Avorion stopmode="3" ## Query mode diff --git a/lgsm/config-default/config-lgsm/codwawserver/_default.cfg b/lgsm/config-default/config-lgsm/codwawserver/_default.cfg index 14799814fa..aeecf8f7b3 100644 --- a/lgsm/config-default/config-lgsm/codwawserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/codwawserver/_default.cfg @@ -111,8 +111,8 @@ sleeptime="0.5" # 6: q # 7: exit # 8: 7 Days to Die -# 9: Gold Source -# 10: Teamspeak 3 +# 9: GoldSrc +# 10: Avorion stopmode="3" ## Query mode diff --git a/lgsm/config-default/config-lgsm/csczserver/_default.cfg b/lgsm/config-default/config-lgsm/csczserver/_default.cfg index 0fd33cd68c..8065dbba2f 100644 --- a/lgsm/config-default/config-lgsm/csczserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/csczserver/_default.cfg @@ -124,8 +124,8 @@ steammaster="true" # 6: q # 7: exit # 8: 7 Days to Die -# 9: Gold Source -# 10: Teamspeak 3 +# 9: GoldSrc +# 10: Avorion stopmode="9" ## Query mode @@ -140,7 +140,7 @@ querytype="protocol-valve" ## Game Server Details # Do not edit gamename="Counter-Strike: Condition Zero" -engine="goldsource" +engine="goldsrc" glibc="2.3.6" #### Directories #### diff --git a/lgsm/config-default/config-lgsm/csgoserver/_default.cfg b/lgsm/config-default/config-lgsm/csgoserver/_default.cfg index 0cabcd249e..963f873c56 100644 --- a/lgsm/config-default/config-lgsm/csgoserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/csgoserver/_default.cfg @@ -149,8 +149,8 @@ steammaster="true" # 6: q # 7: exit # 8: 7 Days to Die -# 9: Gold Source -# 10: Teamspeak 3 +# 9: GoldSrc +# 10: Avorion stopmode="3" ## Query mode diff --git a/lgsm/config-default/config-lgsm/csserver/_default.cfg b/lgsm/config-default/config-lgsm/csserver/_default.cfg index 36f0d955a4..584e0ad77f 100644 --- a/lgsm/config-default/config-lgsm/csserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/csserver/_default.cfg @@ -124,8 +124,8 @@ steammaster="true" # 6: q # 7: exit # 8: 7 Days to Die -# 9: Gold Source -# 10: Teamspeak 3 +# 9: GoldSrc +# 10: Avorion stopmode="9" ## Query mode @@ -140,7 +140,7 @@ querytype="protocol-valve" ## Game Server Details # Do not edit gamename="Counter-Strike 1.6" -engine="goldsource" +engine="goldsrc" glibc="2.3.6" #### Directories #### diff --git a/lgsm/config-default/config-lgsm/cssserver/_default.cfg b/lgsm/config-default/config-lgsm/cssserver/_default.cfg index 586b6dc18e..316eb26f8d 100644 --- a/lgsm/config-default/config-lgsm/cssserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/cssserver/_default.cfg @@ -129,8 +129,8 @@ steammaster="true" # 6: q # 7: exit # 8: 7 Days to Die -# 9: Gold Source -# 10: Teamspeak 3 +# 9: GoldSrc +# 10: Avorion stopmode="3" ## Query mode diff --git a/lgsm/config-default/config-lgsm/dabserver/_default.cfg b/lgsm/config-default/config-lgsm/dabserver/_default.cfg index f03645b95f..612ea671f2 100644 --- a/lgsm/config-default/config-lgsm/dabserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/dabserver/_default.cfg @@ -124,8 +124,8 @@ steammaster="true" # 6: q # 7: exit # 8: 7 Days to Die -# 9: Gold Source -# 10: Teamspeak 3 +# 9: GoldSrc +# 10: Avorion stopmode="3" ## Query mode diff --git a/lgsm/config-default/config-lgsm/dmcserver/_default.cfg b/lgsm/config-default/config-lgsm/dmcserver/_default.cfg index 3af9ee7d7c..43fe8e8f1c 100644 --- a/lgsm/config-default/config-lgsm/dmcserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/dmcserver/_default.cfg @@ -124,8 +124,8 @@ steammaster="true" # 6: q # 7: exit # 8: 7 Days to Die -# 9: Gold Source -# 10: Teamspeak 3 +# 9: GoldSrc +# 10: Avorion stopmode="9" ## Query mode @@ -140,7 +140,7 @@ querytype="protocol-valve" ## Game Server Details # Do not edit gamename="Deathmatch Classic" -engine="goldsource" +engine="goldsrc" glibc="2.3.4" #### Directories #### diff --git a/lgsm/config-default/config-lgsm/dodserver/_default.cfg b/lgsm/config-default/config-lgsm/dodserver/_default.cfg index 79df74acb0..0d1b447c34 100644 --- a/lgsm/config-default/config-lgsm/dodserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/dodserver/_default.cfg @@ -124,8 +124,8 @@ steammaster="true" # 6: q # 7: exit # 8: 7 Days to Die -# 9: Gold Source -# 10: Teamspeak 3 +# 9: GoldSrc +# 10: Avorion stopmode="9" ## Query mode @@ -140,7 +140,7 @@ querytype="protocol-valve" ## Game Server Details # Do not edit gamename="Day of Defeat" -engine="goldsource" +engine="goldsrc" glibc="2.3.4" #### Directories #### diff --git a/lgsm/config-default/config-lgsm/dodsserver/_default.cfg b/lgsm/config-default/config-lgsm/dodsserver/_default.cfg index 7ec70a81db..572046108c 100644 --- a/lgsm/config-default/config-lgsm/dodsserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/dodsserver/_default.cfg @@ -124,8 +124,8 @@ steammaster="true" # 6: q # 7: exit # 8: 7 Days to Die -# 9: Gold Source -# 10: Teamspeak 3 +# 9: GoldSrc +# 10: Avorion stopmode="3" ## Query mode diff --git a/lgsm/config-default/config-lgsm/doiserver/_default.cfg b/lgsm/config-default/config-lgsm/doiserver/_default.cfg index c31bea09f5..d7916e2b5c 100644 --- a/lgsm/config-default/config-lgsm/doiserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/doiserver/_default.cfg @@ -125,8 +125,8 @@ steammaster="true" # 6: q # 7: exit # 8: 7 Days to Die -# 9: Gold Source -# 10: Teamspeak 3 +# 9: GoldSrc +# 10: Avorion stopmode="3" ## Query mode diff --git a/lgsm/config-default/config-lgsm/dstserver/_default.cfg b/lgsm/config-default/config-lgsm/dstserver/_default.cfg index f93bca0581..7491e7e55c 100644 --- a/lgsm/config-default/config-lgsm/dstserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/dstserver/_default.cfg @@ -127,8 +127,8 @@ steammaster="false" # 6: q # 7: exit # 8: 7 Days to Die -# 9: Gold Source -# 10: Teamspeak 3 +# 9: GoldSrc +# 10: Avorion stopmode="2" ## Query mode diff --git a/lgsm/config-default/config-lgsm/dysserver/_default.cfg b/lgsm/config-default/config-lgsm/dysserver/_default.cfg index 51c9db8cf9..28cc7fb98a 100644 --- a/lgsm/config-default/config-lgsm/dysserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/dysserver/_default.cfg @@ -129,8 +129,8 @@ steammaster="true" # 6: q # 7: exit # 8: 7 Days to Die -# 9: Gold Source -# 10: Teamspeak 3 +# 9: GoldSrc +# 10: Avorion stopmode="3" ## Query mode diff --git a/lgsm/config-default/config-lgsm/ecoserver/_default.cfg b/lgsm/config-default/config-lgsm/ecoserver/_default.cfg index 1286860fca..b4a4b92eb7 100644 --- a/lgsm/config-default/config-lgsm/ecoserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/ecoserver/_default.cfg @@ -116,8 +116,8 @@ steammaster="false" # 6: q # 7: exit # 8: 7 Days to Die -# 9: Gold Source -# 10: Teamspeak 3 +# 9: GoldSrc +# 10: Avorion stopmode="2" ## Query mode diff --git a/lgsm/config-default/config-lgsm/emserver/_default.cfg b/lgsm/config-default/config-lgsm/emserver/_default.cfg index 4d6fc18242..8ab7aefe13 100644 --- a/lgsm/config-default/config-lgsm/emserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/emserver/_default.cfg @@ -129,8 +129,8 @@ steammaster="true" # 6: q # 7: exit # 8: 7 Days to Die -# 9: Gold Source -# 10: Teamspeak 3 +# 9: GoldSrc +# 10: Avorion stopmode="3" ## Query mode diff --git a/lgsm/config-default/config-lgsm/etlserver/_default.cfg b/lgsm/config-default/config-lgsm/etlserver/_default.cfg index ffc85e4b98..add0f74b65 100644 --- a/lgsm/config-default/config-lgsm/etlserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/etlserver/_default.cfg @@ -105,8 +105,8 @@ sleeptime="0.5" # 6: q # 7: exit # 8: 7 Days to Die -# 9: Gold Source -# 10: Teamspeak 3 +# 9: GoldSrc +# 10: Avorion stopmode="3" ## Query mode diff --git a/lgsm/config-default/config-lgsm/fctrserver/_default.cfg b/lgsm/config-default/config-lgsm/fctrserver/_default.cfg index 711194a840..fddab05eed 100644 --- a/lgsm/config-default/config-lgsm/fctrserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/fctrserver/_default.cfg @@ -116,8 +116,8 @@ sleeptime="0.5" # 6: q # 7: exit # 8: 7 Days to Die -# 9: Gold Source -# 10: Teamspeak 3 +# 9: GoldSrc +# 10: Avorion stopmode="2" ## Query mode diff --git a/lgsm/config-default/config-lgsm/fofserver/_default.cfg b/lgsm/config-default/config-lgsm/fofserver/_default.cfg index 0946a0eac2..49105660c6 100644 --- a/lgsm/config-default/config-lgsm/fofserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/fofserver/_default.cfg @@ -124,8 +124,8 @@ steammaster="true" # 6: q # 7: exit # 8: 7 Days to Die -# 9: Gold Source -# 10: Teamspeak 3 +# 9: GoldSrc +# 10: Avorion stopmode="3" ## Query mode diff --git a/lgsm/config-default/config-lgsm/gesserver/_default.cfg b/lgsm/config-default/config-lgsm/gesserver/_default.cfg index d47983a795..a26a5df396 100644 --- a/lgsm/config-default/config-lgsm/gesserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/gesserver/_default.cfg @@ -124,8 +124,8 @@ steammaster="true" # 6: q # 7: exit # 8: 7 Days to Die -# 9: Gold Source -# 10: Teamspeak 3 +# 9: GoldSrc +# 10: Avorion stopmode="3" ## Query mode diff --git a/lgsm/config-default/config-lgsm/gmodserver/_default.cfg b/lgsm/config-default/config-lgsm/gmodserver/_default.cfg index 66202641c0..bd254e8b18 100644 --- a/lgsm/config-default/config-lgsm/gmodserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/gmodserver/_default.cfg @@ -140,8 +140,8 @@ steammaster="true" # 6: q # 7: exit # 8: 7 Days to Die -# 9: Gold Source -# 10: Teamspeak 3 +# 9: GoldSrc +# 10: Avorion stopmode="3" ## Query mode diff --git a/lgsm/config-default/config-lgsm/hl2dmserver/_default.cfg b/lgsm/config-default/config-lgsm/hl2dmserver/_default.cfg index a67d26a96a..22c3da3295 100644 --- a/lgsm/config-default/config-lgsm/hl2dmserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/hl2dmserver/_default.cfg @@ -124,8 +124,8 @@ steammaster="true" # 6: q # 7: exit # 8: 7 Days to Die -# 9: Gold Source -# 10: Teamspeak 3 +# 9: GoldSrc +# 10: Avorion stopmode="3" ## Query mode diff --git a/lgsm/config-default/config-lgsm/hldmserver/_default.cfg b/lgsm/config-default/config-lgsm/hldmserver/_default.cfg index 2e15cea7e7..1a17fdd919 100644 --- a/lgsm/config-default/config-lgsm/hldmserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/hldmserver/_default.cfg @@ -123,8 +123,8 @@ steammaster="true" # 6: q # 7: exit # 8: 7 Days to Die -# 9: Gold Source -# 10: Teamspeak 3 +# 9: GoldSrc +# 10: Avorion stopmode="9" ## Query mode @@ -139,7 +139,7 @@ querytype="protocol-valve" ## Game Server Details # Do not edit gamename="Half Life: Deathmatch" -engine="goldsource" +engine="goldsrc" glibc="2.3.4" #### Directories #### diff --git a/lgsm/config-default/config-lgsm/hldmsserver/_default.cfg b/lgsm/config-default/config-lgsm/hldmsserver/_default.cfg index e6d3b0a2a2..0036ec7e1c 100644 --- a/lgsm/config-default/config-lgsm/hldmsserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/hldmsserver/_default.cfg @@ -124,8 +124,8 @@ steammaster="true" # 6: q # 7: exit # 8: 7 Days to Die -# 9: Gold Source -# 10: Teamspeak 3 +# 9: GoldSrc +# 10: Avorion stopmode="3" ## Query mode diff --git a/lgsm/config-default/config-lgsm/hwserver/_default.cfg b/lgsm/config-default/config-lgsm/hwserver/_default.cfg index c934622fb5..426d2d2501 100644 --- a/lgsm/config-default/config-lgsm/hwserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/hwserver/_default.cfg @@ -135,8 +135,8 @@ steammaster="false" # 6: q # 7: exit # 8: 7 Days to Die -# 9: Gold Source -# 10: Teamspeak 3 +# 9: GoldSrc +# 10: Avorion stopmode="2" ## Query mode diff --git a/lgsm/config-default/config-lgsm/insserver/_default.cfg b/lgsm/config-default/config-lgsm/insserver/_default.cfg index 9fea80b0db..98817e9087 100644 --- a/lgsm/config-default/config-lgsm/insserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/insserver/_default.cfg @@ -130,8 +130,8 @@ steammaster="false" # 6: q # 7: exit # 8: 7 Days to Die -# 9: Gold Source -# 10: Teamspeak 3 +# 9: GoldSrc +# 10: Avorion stopmode="3" ## Query mode diff --git a/lgsm/config-default/config-lgsm/inssserver/_default.cfg b/lgsm/config-default/config-lgsm/inssserver/_default.cfg index 04becc7529..605a95fbbf 100644 --- a/lgsm/config-default/config-lgsm/inssserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/inssserver/_default.cfg @@ -131,8 +131,8 @@ steammaster="false" # 6: q # 7: exit # 8: 7 Days to Die -# 9: Gold Source -# 10: Teamspeak 3 +# 9: GoldSrc +# 10: Avorion stopmode="2" ## Query mode diff --git a/lgsm/config-default/config-lgsm/iosserver/_default.cfg b/lgsm/config-default/config-lgsm/iosserver/_default.cfg index bb53acf48a..acf13f3683 100644 --- a/lgsm/config-default/config-lgsm/iosserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/iosserver/_default.cfg @@ -124,8 +124,8 @@ steammaster="false" # 6: q # 7: exit # 8: 7 Days to Die -# 9: Gold Source -# 10: Teamspeak 3 +# 9: GoldSrc +# 10: Avorion stopmode="3" ## Query mode diff --git a/lgsm/config-default/config-lgsm/jc2server/_default.cfg b/lgsm/config-default/config-lgsm/jc2server/_default.cfg index 822e860c5d..81cd0ff5ba 100644 --- a/lgsm/config-default/config-lgsm/jc2server/_default.cfg +++ b/lgsm/config-default/config-lgsm/jc2server/_default.cfg @@ -116,8 +116,8 @@ steammaster="true" # 6: q # 7: exit # 8: 7 Days to Die -# 9: Gold Source -# 10: Teamspeak 3 +# 9: GoldSrc +# 10: Avorion stopmode="2" ## Query mode diff --git a/lgsm/config-default/config-lgsm/jc3server/_default.cfg b/lgsm/config-default/config-lgsm/jc3server/_default.cfg index dbe9d4616c..e3793f8050 100644 --- a/lgsm/config-default/config-lgsm/jc3server/_default.cfg +++ b/lgsm/config-default/config-lgsm/jc3server/_default.cfg @@ -116,8 +116,8 @@ steammaster="false" # 6: q # 7: exit # 8: 7 Days to Die -# 9: Gold Source -# 10: Teamspeak 3 +# 9: GoldSrc +# 10: Avorion stopmode="2" ## Query mode diff --git a/lgsm/config-default/config-lgsm/kf2server/_default.cfg b/lgsm/config-default/config-lgsm/kf2server/_default.cfg index 6e31023beb..7ad9fc930e 100644 --- a/lgsm/config-default/config-lgsm/kf2server/_default.cfg +++ b/lgsm/config-default/config-lgsm/kf2server/_default.cfg @@ -122,8 +122,8 @@ steammaster="false" # 6: q # 7: exit # 8: 7 Days to Die -# 9: Gold Source -# 10: Teamspeak 3 +# 9: GoldSrc +# 10: Avorion stopmode="2" ## Query mode diff --git a/lgsm/config-default/config-lgsm/kfserver/_default.cfg b/lgsm/config-default/config-lgsm/kfserver/_default.cfg index df07967d73..f4ef0a7f79 100644 --- a/lgsm/config-default/config-lgsm/kfserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/kfserver/_default.cfg @@ -128,8 +128,8 @@ steammaster="false" # 6: q # 7: exit # 8: 7 Days to Die -# 9: Gold Source -# 10: Teamspeak 3 +# 9: GoldSrc +# 10: Avorion stopmode="2" ## Query mode diff --git a/lgsm/config-default/config-lgsm/l4d2server/_default.cfg b/lgsm/config-default/config-lgsm/l4d2server/_default.cfg index c2dd765c24..4852b22317 100644 --- a/lgsm/config-default/config-lgsm/l4d2server/_default.cfg +++ b/lgsm/config-default/config-lgsm/l4d2server/_default.cfg @@ -123,8 +123,8 @@ steammaster="false" # 6: q # 7: exit # 8: 7 Days to Die -# 9: Gold Source -# 10: Teamspeak 3 +# 9: GoldSrc +# 10: Avorion stopmode="3" ## Query mode diff --git a/lgsm/config-default/config-lgsm/l4dserver/_default.cfg b/lgsm/config-default/config-lgsm/l4dserver/_default.cfg index c40a1199f7..158605d2f4 100644 --- a/lgsm/config-default/config-lgsm/l4dserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/l4dserver/_default.cfg @@ -123,8 +123,8 @@ steammaster="false" # 6: q # 7: exit # 8: 7 Days to Die -# 9: Gold Source -# 10: Teamspeak 3 +# 9: GoldSrc +# 10: Avorion stopmode="2" ## Query mode diff --git a/lgsm/config-default/config-lgsm/mcbserver/_default.cfg b/lgsm/config-default/config-lgsm/mcbserver/_default.cfg index 1a600d8211..839f5a9af2 100644 --- a/lgsm/config-default/config-lgsm/mcbserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/mcbserver/_default.cfg @@ -108,8 +108,8 @@ sleeptime="0.5" # 6: q # 7: exit # 8: 7 Days to Die -# 9: Gold Source -# 10: Teamspeak 3 +# 9: GoldSrc +# 10: Avorion stopmode="5" ## Query mode diff --git a/lgsm/config-default/config-lgsm/mcserver/_default.cfg b/lgsm/config-default/config-lgsm/mcserver/_default.cfg index 2bfcb3d1d2..a49465f457 100644 --- a/lgsm/config-default/config-lgsm/mcserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/mcserver/_default.cfg @@ -114,8 +114,8 @@ sleeptime="0.5" # 6: q # 7: exit # 8: 7 Days to Die -# 9: Gold Source -# 10: Teamspeak 3 +# 9: GoldSrc +# 10: Avorion stopmode="5" ## Query mode diff --git a/lgsm/config-default/config-lgsm/mhserver/_default.cfg b/lgsm/config-default/config-lgsm/mhserver/_default.cfg index 6a9b9a82e4..255ecdd04f 100644 --- a/lgsm/config-default/config-lgsm/mhserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/mhserver/_default.cfg @@ -124,8 +124,8 @@ steammaster="false" # 6: q # 7: exit # 8: 7 Days to Die -# 9: Gold Source -# 10: Teamspeak 3 +# 9: GoldSrc +# 10: Avorion stopmode="2" ## Query mode diff --git a/lgsm/config-default/config-lgsm/mohaaserver/_default.cfg b/lgsm/config-default/config-lgsm/mohaaserver/_default.cfg index 22d05c7525..1f82fe0c4f 100644 --- a/lgsm/config-default/config-lgsm/mohaaserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/mohaaserver/_default.cfg @@ -110,8 +110,8 @@ sleeptime="0.5" # 6: q # 7: exit # 8: 7 Days to Die -# 9: Gold Source -# 10: Teamspeak 3 +# 9: GoldSrc +# 10: Avorion stopmode="3" ## Query mode diff --git a/lgsm/config-default/config-lgsm/mtaserver/_default.cfg b/lgsm/config-default/config-lgsm/mtaserver/_default.cfg index 944f4ae570..dc6aac282c 100644 --- a/lgsm/config-default/config-lgsm/mtaserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/mtaserver/_default.cfg @@ -109,8 +109,8 @@ sleeptime="0.5" # 6: q # 7: exit # 8: 7 Days to Die -# 9: Gold Source -# 10: Teamspeak 3 +# 9: GoldSrc +# 10: Avorion stopmode="4" ## Query mode diff --git a/lgsm/config-default/config-lgsm/mumbleserver/_default.cfg b/lgsm/config-default/config-lgsm/mumbleserver/_default.cfg index 301318217f..6afe760ae2 100644 --- a/lgsm/config-default/config-lgsm/mumbleserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/mumbleserver/_default.cfg @@ -109,8 +109,8 @@ sleeptime="0.5" # 6: q # 7: exit # 8: 7 Days to Die -# 9: Gold Source -# 10: Teamspeak 3 +# 9: GoldSrc +# 10: Avorion stopmode="2" ## Query mode diff --git a/lgsm/config-default/config-lgsm/ndserver/_default.cfg b/lgsm/config-default/config-lgsm/ndserver/_default.cfg index 58092d361f..084bcc20b0 100644 --- a/lgsm/config-default/config-lgsm/ndserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/ndserver/_default.cfg @@ -124,8 +124,8 @@ steammaster="true" # 6: q # 7: exit # 8: 7 Days to Die -# 9: Gold Source -# 10: Teamspeak 3 +# 9: GoldSrc +# 10: Avorion stopmode="3" ## Query mode diff --git a/lgsm/config-default/config-lgsm/nmrihserver/_default.cfg b/lgsm/config-default/config-lgsm/nmrihserver/_default.cfg index 6219623494..261d74feda 100644 --- a/lgsm/config-default/config-lgsm/nmrihserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/nmrihserver/_default.cfg @@ -129,8 +129,8 @@ steammaster="true" # 6: q # 7: exit # 8: 7 Days to Die -# 9: Gold Source -# 10: Teamspeak 3 +# 9: GoldSrc +# 10: Avorion stopmode="3" ## Query mode diff --git a/lgsm/config-default/config-lgsm/ns2cserver/_default.cfg b/lgsm/config-default/config-lgsm/ns2cserver/_default.cfg index 01b6bc9b21..6e857c346e 100644 --- a/lgsm/config-default/config-lgsm/ns2cserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/ns2cserver/_default.cfg @@ -131,8 +131,8 @@ steammaster="true" # 6: q # 7: exit # 8: 7 Days to Die -# 9: Gold Source -# 10: Teamspeak 3 +# 9: GoldSrc +# 10: Avorion stopmode="6" ## Query mode diff --git a/lgsm/config-default/config-lgsm/ns2server/_default.cfg b/lgsm/config-default/config-lgsm/ns2server/_default.cfg index acd89375fc..01cb086f9f 100644 --- a/lgsm/config-default/config-lgsm/ns2server/_default.cfg +++ b/lgsm/config-default/config-lgsm/ns2server/_default.cfg @@ -135,8 +135,8 @@ steammaster="true" # 6: q # 7: exit # 8: 7 Days to Die -# 9: Gold Source -# 10: Teamspeak 3 +# 9: GoldSrc +# 10: Avorion stopmode="6" ## Query mode diff --git a/lgsm/config-default/config-lgsm/nsserver/_default.cfg b/lgsm/config-default/config-lgsm/nsserver/_default.cfg index 1f0ebcb49e..446e8ab8a3 100644 --- a/lgsm/config-default/config-lgsm/nsserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/nsserver/_default.cfg @@ -124,8 +124,8 @@ steammaster="true" # 6: q # 7: exit # 8: 7 Days to Die -# 9: Gold Source -# 10: Teamspeak 3 +# 9: GoldSrc +# 10: Avorion stopmode="9" ## Query mode @@ -140,7 +140,7 @@ querytype="protocol-valve" ## Game Server Details # Do not edit gamename="Natural Selection" -engine="goldsource" +engine="goldsrc" glibc="2.3.4" #### Directories #### diff --git a/lgsm/config-default/config-lgsm/onsetserver/_default.cfg b/lgsm/config-default/config-lgsm/onsetserver/_default.cfg index bf4576a6d7..7401de91a1 100644 --- a/lgsm/config-default/config-lgsm/onsetserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/onsetserver/_default.cfg @@ -116,8 +116,8 @@ steammaster="false" # 6: q # 7: exit # 8: 7 Days to Die -# 9: Gold Source -# 10: Teamspeak 3 +# 9: GoldSrc +# 10: Avorion stopmode="2" ## Query mode diff --git a/lgsm/config-default/config-lgsm/opforserver/_default.cfg b/lgsm/config-default/config-lgsm/opforserver/_default.cfg index 87fb58d2f9..a341627a98 100644 --- a/lgsm/config-default/config-lgsm/opforserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/opforserver/_default.cfg @@ -124,8 +124,8 @@ steammaster="true" # 6: q # 7: exit # 8: 7 Days to Die -# 9: Gold Source -# 10: Teamspeak 3 +# 9: GoldSrc +# 10: Avorion stopmode="9" ## Query mode @@ -140,7 +140,7 @@ querytype="protocol-valve" ## Game Server Details # Do not edit gamename="Half-Life: Opposing Force" -engine="goldsource" +engine="goldsrc" glibc="2.3.4" #### Directories #### diff --git a/lgsm/config-default/config-lgsm/pcserver/_default.cfg b/lgsm/config-default/config-lgsm/pcserver/_default.cfg index 8cf6c09ca4..fc74fbe5e7 100644 --- a/lgsm/config-default/config-lgsm/pcserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/pcserver/_default.cfg @@ -116,8 +116,8 @@ steammaster="false" # 6: q # 7: exit # 8: 7 Days to Die -# 9: Gold Source -# 10: Teamspeak 3 +# 9: GoldSrc +# 10: Avorion stopmode="2" ## Query mode diff --git a/lgsm/config-default/config-lgsm/pstbsserver/_default.cfg b/lgsm/config-default/config-lgsm/pstbsserver/_default.cfg index 54cec9d8d2..9c60c53bc1 100644 --- a/lgsm/config-default/config-lgsm/pstbsserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/pstbsserver/_default.cfg @@ -125,8 +125,8 @@ steammaster="false" # 6: q # 7: exit # 8: 7 Days to Die -# 9: Gold Source -# 10: Teamspeak 3 +# 9: GoldSrc +# 10: Avorion stopmode="2" ## Query mode diff --git a/lgsm/config-default/config-lgsm/pvkiiserver/_default.cfg b/lgsm/config-default/config-lgsm/pvkiiserver/_default.cfg index 84e1bd8974..0118ecaa4b 100644 --- a/lgsm/config-default/config-lgsm/pvkiiserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/pvkiiserver/_default.cfg @@ -124,8 +124,8 @@ steammaster="true" # 6: q # 7: exit # 8: 7 Days to Die -# 9: Gold Source -# 10: Teamspeak 3 +# 9: GoldSrc +# 10: Avorion stopmode="3" ## Query mode diff --git a/lgsm/config-default/config-lgsm/pzserver/_default.cfg b/lgsm/config-default/config-lgsm/pzserver/_default.cfg index 68300b0bc9..da9ae479d0 100644 --- a/lgsm/config-default/config-lgsm/pzserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/pzserver/_default.cfg @@ -120,8 +120,8 @@ steammaster="false" # 6: q # 7: exit # 8: 7 Days to Die -# 9: Gold Source -# 10: Teamspeak 3 +# 9: GoldSrc +# 10: Avorion stopmode="3" ## Query mode diff --git a/lgsm/config-default/config-lgsm/q2server/_default.cfg b/lgsm/config-default/config-lgsm/q2server/_default.cfg index 1647eab1ac..832f641c79 100644 --- a/lgsm/config-default/config-lgsm/q2server/_default.cfg +++ b/lgsm/config-default/config-lgsm/q2server/_default.cfg @@ -110,8 +110,8 @@ sleeptime="0.5" # 6: q # 7: exit # 8: 7 Days to Die -# 9: Gold Source -# 10: Teamspeak 3 +# 9: GoldSrc +# 10: Avorion stopmode="3" ## Query mode diff --git a/lgsm/config-default/config-lgsm/q3server/_default.cfg b/lgsm/config-default/config-lgsm/q3server/_default.cfg index cd6634afb8..6d28f4caf9 100644 --- a/lgsm/config-default/config-lgsm/q3server/_default.cfg +++ b/lgsm/config-default/config-lgsm/q3server/_default.cfg @@ -110,8 +110,8 @@ sleeptime="0.5" # 6: q # 7: exit # 8: 7 Days to Die -# 9: Gold Source -# 10: Teamspeak 3 +# 9: GoldSrc +# 10: Avorion stopmode="3" ## Query mode diff --git a/lgsm/config-default/config-lgsm/qlserver/_default.cfg b/lgsm/config-default/config-lgsm/qlserver/_default.cfg index 89bcb26a34..3a5471ad68 100644 --- a/lgsm/config-default/config-lgsm/qlserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/qlserver/_default.cfg @@ -118,8 +118,8 @@ steammaster="true" # 6: q # 7: exit # 8: 7 Days to Die -# 9: Gold Source -# 10: Teamspeak 3 +# 9: GoldSrc +# 10: Avorion stopmode="3" ## Query mode diff --git a/lgsm/config-default/config-lgsm/qwserver/_default.cfg b/lgsm/config-default/config-lgsm/qwserver/_default.cfg index 0bd55debff..59cdcc0f16 100644 --- a/lgsm/config-default/config-lgsm/qwserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/qwserver/_default.cfg @@ -109,8 +109,8 @@ sleeptime="0.5" # 6: q # 7: exit # 8: 7 Days to Die -# 9: Gold Source -# 10: Teamspeak 3 +# 9: GoldSrc +# 10: Avorion stopmode="3" ## Query mode diff --git a/lgsm/config-default/config-lgsm/ricochetserver/_default.cfg b/lgsm/config-default/config-lgsm/ricochetserver/_default.cfg index 787571afd4..b825fb75b1 100644 --- a/lgsm/config-default/config-lgsm/ricochetserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/ricochetserver/_default.cfg @@ -124,8 +124,8 @@ steammaster="true" # 6: q # 7: exit # 8: 7 Days to Die -# 9: Gold Source -# 10: Teamspeak 3 +# 9: GoldSrc +# 10: Avorion stopmode="9" ## Query mode @@ -140,7 +140,7 @@ querytype="protocol-valve" ## Game Server Details # Do not edit gamename="Ricochet" -engine="goldsource" +engine="goldsrc" glibc="2.3.4" #### Directories #### diff --git a/lgsm/config-default/config-lgsm/roserver/_default.cfg b/lgsm/config-default/config-lgsm/roserver/_default.cfg index ab9c1625b8..3cbfd58888 100644 --- a/lgsm/config-default/config-lgsm/roserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/roserver/_default.cfg @@ -124,8 +124,8 @@ steammaster="false" # 6: q # 7: exit # 8: 7 Days to Die -# 9: Gold Source -# 10: Teamspeak 3 +# 9: GoldSrc +# 10: Avorion stopmode="2" ## Query mode @@ -150,7 +150,7 @@ glibc="2.4" serverfiles="${rootdir}/serverfiles" systemdir="${serverfiles}/system" executabledir="${systemdir}" -executable="./ucc-bin"servercfgdir="${systemdir}" +executable="./ucc-bin" servercfgdir="${systemdir}" servercfg="${selfname}.ini" servercfgdefault="default.ini" diff --git a/lgsm/config-default/config-lgsm/rtcwserver/_default.cfg b/lgsm/config-default/config-lgsm/rtcwserver/_default.cfg index 792c1a7f8b..93b9ce3fe2 100644 --- a/lgsm/config-default/config-lgsm/rtcwserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/rtcwserver/_default.cfg @@ -110,8 +110,8 @@ sleeptime="0.5" # 6: q # 7: exit # 8: 7 Days to Die -# 9: Gold Source -# 10: Teamspeak 3 +# 9: GoldSrc +# 10: Avorion stopmode="3" ## Query mode diff --git a/lgsm/config-default/config-lgsm/rustserver/_default.cfg b/lgsm/config-default/config-lgsm/rustserver/_default.cfg index abb9c79df7..cf70cdae77 100644 --- a/lgsm/config-default/config-lgsm/rustserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/rustserver/_default.cfg @@ -148,8 +148,8 @@ steammaster="false" # 6: q # 7: exit # 8: 7 Days to Die -# 9: Gold Source -# 10: Teamspeak 3 +# 9: GoldSrc +# 10: Avorion stopmode="2" ## Query mode diff --git a/lgsm/config-default/config-lgsm/rwserver/_default.cfg b/lgsm/config-default/config-lgsm/rwserver/_default.cfg index 37e755c29a..95c37ef2db 100644 --- a/lgsm/config-default/config-lgsm/rwserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/rwserver/_default.cfg @@ -119,8 +119,8 @@ steammaster="false" # 6: q # 7: exit # 8: 7 Days to Die -# 9: Gold Source -# 10: Teamspeak 3 +# 9: GoldSrc +# 10: Avorion stopmode="3" ## Query mode diff --git a/lgsm/config-default/config-lgsm/sampserver/_default.cfg b/lgsm/config-default/config-lgsm/sampserver/_default.cfg index a658daa0c1..67331ee390 100644 --- a/lgsm/config-default/config-lgsm/sampserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/sampserver/_default.cfg @@ -109,8 +109,8 @@ sleeptime="0.5" # 6: q # 7: exit # 8: 7 Days to Die -# 9: Gold Source -# 10: Teamspeak 3 +# 9: GoldSrc +# 10: Avorion stopmode="2" ## Query mode diff --git a/lgsm/config-default/config-lgsm/sbotsserver/_default.cfg b/lgsm/config-default/config-lgsm/sbotsserver/_default.cfg index 6fb2b35796..6145c9905b 100644 --- a/lgsm/config-default/config-lgsm/sbotsserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/sbotsserver/_default.cfg @@ -124,8 +124,8 @@ steammaster="false" # 6: q # 7: exit # 8: 7 Days to Die -# 9: Gold Source -# 10: Teamspeak 3 +# 9: GoldSrc +# 10: Avorion stopmode="2" ## Query mode diff --git a/lgsm/config-default/config-lgsm/sbserver/_default.cfg b/lgsm/config-default/config-lgsm/sbserver/_default.cfg index fa9560f6c7..f9ae836d18 100644 --- a/lgsm/config-default/config-lgsm/sbserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/sbserver/_default.cfg @@ -122,8 +122,8 @@ steammaster="flase" # 6: q # 7: exit # 8: 7 Days to Die -# 9: Gold Source -# 10: Teamspeak 3 +# 9: GoldSrc +# 10: Avorion stopmode="2" ## Query mode diff --git a/lgsm/config-default/config-lgsm/sdtdserver/_default.cfg b/lgsm/config-default/config-lgsm/sdtdserver/_default.cfg index a67e5795de..6269e6150a 100644 --- a/lgsm/config-default/config-lgsm/sdtdserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/sdtdserver/_default.cfg @@ -119,8 +119,8 @@ steammaster="true" # 6: q # 7: exit # 8: 7 Days to Die -# 9: Gold Source -# 10: Teamspeak 3 +# 9: GoldSrc +# 10: Avorion stopmode="8" ## Query mode diff --git a/lgsm/config-default/config-lgsm/sfcserver/_default.cfg b/lgsm/config-default/config-lgsm/sfcserver/_default.cfg index f9d6ad595b..2203ba14b6 100644 --- a/lgsm/config-default/config-lgsm/sfcserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/sfcserver/_default.cfg @@ -124,8 +124,8 @@ steammaster="true" # 6: q # 7: exit # 8: 7 Days to Die -# 9: Gold Source -# 10: Teamspeak 3 +# 9: GoldSrc +# 10: Avorion stopmode="3" ## Query mode diff --git a/lgsm/config-default/config-lgsm/sof2server/_default.cfg b/lgsm/config-default/config-lgsm/sof2server/_default.cfg index bd81102747..090330f49b 100644 --- a/lgsm/config-default/config-lgsm/sof2server/_default.cfg +++ b/lgsm/config-default/config-lgsm/sof2server/_default.cfg @@ -110,8 +110,8 @@ sleeptime="0.5" # 6: q # 7: exit # 8: 7 Days to Die -# 9: Gold Source -# 10: Teamspeak 3 +# 9: GoldSrc +# 10: Avorion stopmode="3" ## Query mode diff --git a/lgsm/config-default/config-lgsm/solserver/_default.cfg b/lgsm/config-default/config-lgsm/solserver/_default.cfg index 2a923d554c..d1f853dcac 100644 --- a/lgsm/config-default/config-lgsm/solserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/solserver/_default.cfg @@ -10,13 +10,11 @@ ## Server Start Settings | https://docs.linuxgsm.com/configuration/start-parameters ip="0.0.0.0" -port="23073" -maxplayers="32" maplist="mapslist.txt" ## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters fn_parms(){ -parms="-b ${ip} -p ${port} -l ${maxplayers} -m ${maplist} -c ${servercfg}" +parms="-b ${ip} -m ${maplist} -c ${servercfg}" } #### LinuxGSM Settings #### @@ -102,6 +100,12 @@ ansi="on" ## Message Display Time | https://docs.linuxgsm.com/features/message-display-time sleeptime="0.5" +## SteamCMD Settings | https://docs.linuxgsm.com/steamcmd +# Server appid +appid="638500" +# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch +branch="" + ## Stop Mode | https://docs.linuxgsm.com/features/stop-mode # 1: tmux kill # 2: CTRL+c @@ -111,8 +115,8 @@ sleeptime="0.5" # 6: q # 7: exit # 8: 7 Days to Die -# 9: Gold Source -# 10: Teamspeak 3 +# 9: GoldSrc +# 10: Avorion stopmode="2" ## Query mode @@ -121,8 +125,8 @@ stopmode="2" # 3: gamedig # 4: gsquery # 5: tcp -querymode="5" -querytype="" +querymode="4" +querytype="soldat" ## Game Server Details # Do not edit diff --git a/lgsm/config-default/config-lgsm/squadserver/_default.cfg b/lgsm/config-default/config-lgsm/squadserver/_default.cfg index f75bd26678..81eb50c01f 100644 --- a/lgsm/config-default/config-lgsm/squadserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/squadserver/_default.cfg @@ -121,8 +121,8 @@ steammaster="false" # 6: q # 7: exit # 8: 7 Days to Die -# 9: Gold Source -# 10: Teamspeak 3 +# 9: GoldSrc +# 10: Avorion stopmode="2" ## Query mode diff --git a/lgsm/config-default/config-lgsm/ss3server/_default.cfg b/lgsm/config-default/config-lgsm/ss3server/_default.cfg index f5ab99168e..9032678a4f 100644 --- a/lgsm/config-default/config-lgsm/ss3server/_default.cfg +++ b/lgsm/config-default/config-lgsm/ss3server/_default.cfg @@ -120,8 +120,8 @@ steammaster="false" # 6: q # 7: exit # 8: 7 Days to Die -# 9: Gold Source -# 10: Teamspeak 3 +# 9: GoldSrc +# 10: Avorion stopmode="2" ## Query mode diff --git a/lgsm/config-default/config-lgsm/stserver/_default.cfg b/lgsm/config-default/config-lgsm/stserver/_default.cfg index 60fb0ebfae..581c1481a6 100644 --- a/lgsm/config-default/config-lgsm/stserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/stserver/_default.cfg @@ -126,8 +126,8 @@ steammaster="false" # 6: q # 7: exit # 8: 7 Days to Die -# 9: Gold Source -# 10: Teamspeak 3 +# 9: GoldSrc +# 10: Avorion stopmode="2" ## Query mode diff --git a/lgsm/config-default/config-lgsm/svenserver/_default.cfg b/lgsm/config-default/config-lgsm/svenserver/_default.cfg index 3036470b75..72b3acaddb 100644 --- a/lgsm/config-default/config-lgsm/svenserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/svenserver/_default.cfg @@ -123,8 +123,8 @@ steammaster="true" # 6: q # 7: exit # 8: 7 Days to Die -# 9: Gold Source -# 10: Teamspeak 3 +# 9: GoldSrc +# 10: Avorion stopmode="9" ## Query mode @@ -139,7 +139,7 @@ querytype="protocol-valve" ## Game Server Details # Do not edit gamename="Sven Co-op" -engine="goldsource" +engine="goldsrc" glibc="2.24" #### Directories #### diff --git a/lgsm/config-default/config-lgsm/terrariaserver/_default.cfg b/lgsm/config-default/config-lgsm/terrariaserver/_default.cfg index 574e183459..3f941122ff 100644 --- a/lgsm/config-default/config-lgsm/terrariaserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/terrariaserver/_default.cfg @@ -123,8 +123,8 @@ steammaster="false" # 6: q # 7: exit # 8: 7 Days to Die -# 9: Gold Source -# 10: Teamspeak 3 +# 9: GoldSrc +# 10: Avorion stopmode="7" ## Query mode diff --git a/lgsm/config-default/config-lgsm/tf2server/_default.cfg b/lgsm/config-default/config-lgsm/tf2server/_default.cfg index 5655d9c9e8..31eefeb124 100644 --- a/lgsm/config-default/config-lgsm/tf2server/_default.cfg +++ b/lgsm/config-default/config-lgsm/tf2server/_default.cfg @@ -129,8 +129,8 @@ steammaster="true" # 6: q # 7: exit # 8: 7 Days to Die -# 9: Gold Source -# 10: Teamspeak 3 +# 9: GoldSrc +# 10: Avorion stopmode="3" ## Query mode diff --git a/lgsm/config-default/config-lgsm/tfcserver/_default.cfg b/lgsm/config-default/config-lgsm/tfcserver/_default.cfg index e9158641b9..ccd4988e08 100644 --- a/lgsm/config-default/config-lgsm/tfcserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/tfcserver/_default.cfg @@ -124,8 +124,8 @@ steammaster="true" # 6: q # 7: exit # 8: 7 Days to Die -# 9: Gold Source -# 10: Teamspeak 3 +# 9: GoldSrc +# 10: Avorion stopmode="9" ## Query mode @@ -140,7 +140,7 @@ querytype="protocol-valve" ## Game Server Details # Do not edit gamename="Team Fortress Classic" -engine="goldsource" +engine="goldsrc" glibc="2.3.4" #### Directories #### diff --git a/lgsm/config-default/config-lgsm/ts3server/_default.cfg b/lgsm/config-default/config-lgsm/ts3server/_default.cfg index 54fd8ac0eb..3a511b394b 100644 --- a/lgsm/config-default/config-lgsm/ts3server/_default.cfg +++ b/lgsm/config-default/config-lgsm/ts3server/_default.cfg @@ -111,8 +111,8 @@ sleeptime="0.5" # 6: q # 7: exit # 8: 7 Days to Die -# 9: Gold Source -# 10: Teamspeak 3 +# 9: GoldSrc +# 10: Avorion stopmode="2" ## Query mode diff --git a/lgsm/config-default/config-lgsm/tsserver/_default.cfg b/lgsm/config-default/config-lgsm/tsserver/_default.cfg index 232087699f..f73622b42e 100644 --- a/lgsm/config-default/config-lgsm/tsserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/tsserver/_default.cfg @@ -124,8 +124,8 @@ steammaster="true" # 6: q # 7: exit # 8: 7 Days to Die -# 9: Gold Source -# 10: Teamspeak 3 +# 9: GoldSrc +# 10: Avorion stopmode="9" ## Query mode @@ -140,7 +140,7 @@ querytype="protocol-valve" ## Game Server Details # Do not edit gamename="The Specialists" -engine="goldsource" +engine="goldsrc" glibc="2.3.4" #### Directories #### diff --git a/lgsm/config-default/config-lgsm/tuserver/_default.cfg b/lgsm/config-default/config-lgsm/tuserver/_default.cfg index 36521c885f..ff4165e45e 100644 --- a/lgsm/config-default/config-lgsm/tuserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/tuserver/_default.cfg @@ -126,8 +126,8 @@ steammaster="false" # 6: q # 7: exit # 8: 7 Days to Die -# 9: Gold Source -# 10: Teamspeak 3 +# 9: GoldSrc +# 10: Avorion stopmode="2" ## Query mode diff --git a/lgsm/config-default/config-lgsm/twserver/_default.cfg b/lgsm/config-default/config-lgsm/twserver/_default.cfg index 4762f3fdc9..461c970595 100644 --- a/lgsm/config-default/config-lgsm/twserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/twserver/_default.cfg @@ -123,8 +123,8 @@ steammaster="false" # 6: q # 7: exit # 8: 7 Days to Die -# 9: Gold Source -# 10: Teamspeak 3 +# 9: GoldSrc +# 10: Avorion stopmode="2" ## Query mode diff --git a/lgsm/config-default/config-lgsm/untserver/_default.cfg b/lgsm/config-default/config-lgsm/untserver/_default.cfg index 713ccb7d24..ef0fe4c24f 100644 --- a/lgsm/config-default/config-lgsm/untserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/untserver/_default.cfg @@ -126,8 +126,8 @@ steammaster="false" # 6: q # 7: exit # 8: 7 Days to Die -# 9: Gold Source -# 10: Teamspeak 3 +# 9: GoldSrc +# 10: Avorion stopmode="2" ## Query mode diff --git a/lgsm/config-default/config-lgsm/ut2k4server/_default.cfg b/lgsm/config-default/config-lgsm/ut2k4server/_default.cfg index 8e1d6fc550..9c4164c72f 100644 --- a/lgsm/config-default/config-lgsm/ut2k4server/_default.cfg +++ b/lgsm/config-default/config-lgsm/ut2k4server/_default.cfg @@ -109,8 +109,8 @@ sleeptime="0.5" # 6: q # 7: exit # 8: 7 Days to Die -# 9: Gold Source -# 10: Teamspeak 3 +# 9: GoldSrc +# 10: Avorion stopmode="2" ## Query mode diff --git a/lgsm/config-default/config-lgsm/ut3server/_default.cfg b/lgsm/config-default/config-lgsm/ut3server/_default.cfg index 421ce42b3c..2a2c8a518f 100644 --- a/lgsm/config-default/config-lgsm/ut3server/_default.cfg +++ b/lgsm/config-default/config-lgsm/ut3server/_default.cfg @@ -120,8 +120,8 @@ sleeptime="0.5" # 6: q # 7: exit # 8: 7 Days to Die -# 9: Gold Source -# 10: Teamspeak 3 +# 9: GoldSrc +# 10: Avorion stopmode="2" ## Query mode diff --git a/lgsm/config-default/config-lgsm/ut99server/_default.cfg b/lgsm/config-default/config-lgsm/ut99server/_default.cfg index b74e0b14ee..caab7ffea4 100644 --- a/lgsm/config-default/config-lgsm/ut99server/_default.cfg +++ b/lgsm/config-default/config-lgsm/ut99server/_default.cfg @@ -109,8 +109,8 @@ sleeptime="0.5" # 6: q # 7: exit # 8: 7 Days to Die -# 9: Gold Source -# 10: Teamspeak 3 +# 9: GoldSrc +# 10: Avorion stopmode="2" ## Query mode diff --git a/lgsm/config-default/config-lgsm/utserver/_default.cfg b/lgsm/config-default/config-lgsm/utserver/_default.cfg index fe8da5acaf..40d6cc526f 100644 --- a/lgsm/config-default/config-lgsm/utserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/utserver/_default.cfg @@ -113,8 +113,8 @@ sleeptime="0.5" # 6: q # 7: exit # 8: 7 Days to Die -# 9: Gold Source -# 10: Teamspeak 3 +# 9: GoldSrc +# 10: Avorion stopmode="2" ## Query mode diff --git a/lgsm/config-default/config-lgsm/vsserver/_default.cfg b/lgsm/config-default/config-lgsm/vsserver/_default.cfg index 484929179f..1eaa9ff863 100644 --- a/lgsm/config-default/config-lgsm/vsserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/vsserver/_default.cfg @@ -124,8 +124,8 @@ steammaster="true" # 6: q # 7: exit # 8: 7 Days to Die -# 9: Gold Source -# 10: Teamspeak 3 +# 9: GoldSrc +# 10: Avorion stopmode="9" ## Query mode @@ -140,7 +140,7 @@ querytype="protocol-valve" ## Game Server Details # Do not edit gamename="Vampire Slayer" -engine="goldsource" +engine="goldsrc" glibc="2.3.4" #### Directories #### diff --git a/lgsm/config-default/config-lgsm/wetserver/_default.cfg b/lgsm/config-default/config-lgsm/wetserver/_default.cfg index e52be9249b..54ee3d25bc 100644 --- a/lgsm/config-default/config-lgsm/wetserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/wetserver/_default.cfg @@ -105,8 +105,8 @@ sleeptime="0.5" # 6: q # 7: exit # 8: 7 Days to Die -# 9: Gold Source -# 10: Teamspeak 3 +# 9: GoldSrc +# 10: Avorion stopmode="3" ## Query mode diff --git a/lgsm/config-default/config-lgsm/wfserver/_default.cfg b/lgsm/config-default/config-lgsm/wfserver/_default.cfg index f5da24af76..1ddbd77462 100644 --- a/lgsm/config-default/config-lgsm/wfserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/wfserver/_default.cfg @@ -110,8 +110,8 @@ sleeptime="0.5" # 6: q # 7: exit # 8: 7 Days to Die -# 9: Gold Source -# 10: Teamspeak 3 +# 9: GoldSrc +# 10: Avorion stopmode="3" ## Query mode diff --git a/lgsm/config-default/config-lgsm/wurmserver/_default.cfg b/lgsm/config-default/config-lgsm/wurmserver/_default.cfg index 47b0fbc0ba..e131fc28ba 100644 --- a/lgsm/config-default/config-lgsm/wurmserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/wurmserver/_default.cfg @@ -115,8 +115,8 @@ steammaster="false" # 6: q # 7: exit # 8: 7 Days to Die -# 9: Gold Source -# 10: Teamspeak 3 +# 9: GoldSrc +# 10: Avorion stopmode="2" ## Query mode diff --git a/lgsm/config-default/config-lgsm/zmrserver/_default.cfg b/lgsm/config-default/config-lgsm/zmrserver/_default.cfg index db18539303..b22f79fc21 100644 --- a/lgsm/config-default/config-lgsm/zmrserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/zmrserver/_default.cfg @@ -124,8 +124,8 @@ steammaster="true" # 6: q # 7: exit # 8: 7 Days to Die -# 9: Gold Source -# 10: Teamspeak 3 +# 9: GoldSrc +# 10: Avorion stopmode="3" ## Query mode diff --git a/lgsm/config-default/config-lgsm/zpsserver/_default.cfg b/lgsm/config-default/config-lgsm/zpsserver/_default.cfg index bfeceda7e5..279f7258a7 100644 --- a/lgsm/config-default/config-lgsm/zpsserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/zpsserver/_default.cfg @@ -129,8 +129,8 @@ steammaster="true" # 6: q # 7: exit # 8: 7 Days to Die -# 9: Gold Source -# 10: Teamspeak 3 +# 9: GoldSrc +# 10: Avorion stopmode="3" ## Query mode diff --git a/lgsm/data/serverlist.csv b/lgsm/data/serverlist.csv index 3cceb1f91e..f3b13a7fc9 100644 --- a/lgsm/data/serverlist.csv +++ b/lgsm/data/serverlist.csv @@ -1,7 +1,9 @@ +ac,acserver,Assetto Corsa ahl,ahlserver,Action half-life ahl2,ahl2server,Action: Source ark,arkserver,ARK: Survival Evolved arma3,arma3server,ARMA 3 +av,avserver,Avorion bb,bbserver,BrainBread bb2,bb2server,BrainBread 2 bd,bdserver,Base Defense @@ -102,4 +104,4 @@ wet,wetserver,Wolfenstein: Enemy Territory wf,wfserver,Warfork wurm,wurmserver,Wurm Unlimited zmr,zmrserver,Zombie Master: Reborn -zps,zpsserver,Zombie Panic! Source +zps,zpsserver,Zombie Panic! Source \ No newline at end of file diff --git a/lgsm/functions/alert.sh b/lgsm/functions/alert.sh index b81cc4d0c6..f76500105c 100644 --- a/lgsm/functions/alert.sh +++ b/lgsm/functions/alert.sh @@ -104,10 +104,10 @@ elif [ "${postalert}" != "on" ]&&[ "${function_selfname}" == "command_test_alert fn_print_warn_nl "More Info not enabled" fn_script_log_warn "More Info alerts not enabled" elif [ -z "${posttarget}" ]&&[ "${function_selfname}" == "command_test_alert.sh" ]; then - fn_print_error "posttarget not set" + fn_print_error_nl "posttarget not set" fn_script_error "posttarget not set" elif [ -z "${postdays}" ]&&[ "${function_selfname}" == "command_test_alert.sh" ]; then - fn_print_error "postdays not set" + fn_print_error_nl "postdays not set" fn_script_error "postdays not set" fi @@ -117,7 +117,7 @@ elif [ "${discordalert}" != "on" ]&&[ "${function_selfname}" == "command_test_al fn_print_warn_nl "Discord alerts not enabled" fn_script_log_warn "Discord alerts not enabled" elif [ -z "${discordtoken}" ]&&[ "${function_selfname}" == "command_test_alert.sh" ]; then - fn_print_error "Discord token not set" + fn_print_error_nl "Discord token not set" echo -e "* https://docs.linuxgsm.com/alerts/discord" fn_script_error "Discord token not set" fi @@ -128,7 +128,7 @@ elif [ "${emailalert}" != "on" ]&&[ "${function_selfname}" == "command_test_aler fn_print_warn_nl "Email alerts not enabled" fn_script_log_warn "Email alerts not enabled" elif [ -z "${email}" ]&&[ "${function_selfname}" == "command_test_alert.sh" ]; then - fn_print_error "Email not set" + fn_print_error_nl "Email not set" fn_script_log_error "Email not set" fi @@ -138,7 +138,7 @@ elif [ "${iftttalert}" != "on" ]&&[ "${function_selfname}" == "command_test_aler fn_print_warn_nl "IFTTT alerts not enabled" fn_script_log_warn "IFTTT alerts not enabled" elif [ -z "${ifttttoken}" ]&&[ "${function_selfname}" == "command_test_alert.sh" ]; then - fn_print_error "IFTTT token not set" + fn_print_error_nl "IFTTT token not set" echo -e "* https://docs.linuxgsm.com/alerts/ifttt" fn_script_error "IFTTT token not set" fi @@ -149,7 +149,7 @@ elif [ "${mailgunalert}" != "on" ]&&[ "${function_selfname}" == "command_test_al fn_print_warn_nl "Mailgun alerts not enabled" fn_script_log_warn "Mailgun alerts not enabled" elif [ -z "${mailguntoken}" ]&&[ "${function_selfname}" == "command_test_alert.sh" ]; then - fn_print_error "Mailgun token not set" + fn_print_error_nl "Mailgun token not set" echo -e "* https://docs.linuxgsm.com/alerts/mailgun" fn_script_error "Mailgun token not set" fi @@ -160,7 +160,7 @@ elif [ "${pushbulletalert}" != "on" ]&&[ "${function_selfname}" == "command_test fn_print_warn_nl "Pushbullet alerts not enabled" fn_script_log_warn "Pushbullet alerts not enabled" elif [ -z "${pushbullettoken}" ]&&[ "${function_selfname}" == "command_test_alert.sh" ]; then - fn_print_error "Pushbullet token not set" + fn_print_error_nl "Pushbullet token not set" echo -e "* https://docs.linuxgsm.com/alerts/pushbullet" fn_script_error "Pushbullet token not set" fi @@ -171,7 +171,7 @@ elif [ "${pushoveralert}" != "on" ]&&[ "${function_selfname}" == "command_test_a fn_print_warn_nl "Pushover alerts not enabled" fn_script_log_warn "Pushover alerts not enabled" elif [ -z "${pushovertoken}" ]&&[ "${function_selfname}" == "command_test_alert.sh" ]; then - fn_print_error "Pushover token not set" + fn_print_error_nl "Pushover token not set" echo -e "* https://docs.linuxgsm.com/alerts/pushover" fn_script_error "Pushover token not set" fi @@ -182,11 +182,11 @@ elif [ "${telegramalert}" != "on" ]&&[ "${function_selfname}" == "command_test_a fn_print_warn_nl "Telegram Messages not enabled" fn_script_log_warn "Telegram Messages not enabled" elif [ -z "${telegramtoken}" ]&&[ "${function_selfname}" == "command_test_alert.sh" ]; then - fn_print_error "Telegram token not set." + fn_print_error_nl "Telegram token not set." echo -e "* https://docs.linuxgsm.com/alerts/telegram" fn_script_error "Telegram token not set." elif [ -z "${telegramchatid}" ]&&[ "${function_selfname}" == "command_test_alert.sh" ]; then - fn_print_error "Telegram chat id not set." + fn_print_error_nl "Telegram chat id not set." echo -e "* https://docs.linuxgsm.com/alerts/telegram" fn_script_error "Telegram chat id not set." fi @@ -197,7 +197,7 @@ elif [ "${slackalert}" != "on" ]&&[ "${function_selfname}" == "command_test_aler fn_print_warn_nl "Slack alerts not enabled" fn_script_log_warn "Slack alerts not enabled" elif [ -z "${slacktoken}" ]&&[ "${function_selfname}" == "command_test_alert.sh" ]; then - fn_print_error "Slack token not set" + fn_print_error_nl "Slack token not set" echo -e "* https://docs.linuxgsm.com/alerts/slack" fn_script_error "Slack token not set" fi diff --git a/lgsm/functions/alert_discord.sh b/lgsm/functions/alert_discord.sh index 87ff4ed5f4..c088df2812 100644 --- a/lgsm/functions/alert_discord.sh +++ b/lgsm/functions/alert_discord.sh @@ -58,9 +58,9 @@ fn_print_dots "Sending Discord alert" discordsend=$(curl -sSL -H "Content-Type: application/json" -X POST -d "$(echo -n "$json" | jq -c .)" "${discordwebhook}") if [ "${discordsend}" ]; then - fn_print_fail "Sending Discord alert: ${discordsend}" + fn_print_fail_nl "Sending Discord alert: ${discordsend}" fn_script_log_fatal "Sending Discord alert: ${discordsend}" else - fn_print_ok "Sending Discord alert" + fn_print_ok_nl "Sending Discord alert" fn_script_log_pass "Sending Discord alert" fi diff --git a/lgsm/functions/alert_email.sh b/lgsm/functions/alert_email.sh index 1419af5e47..398ecc3e89 100644 --- a/lgsm/functions/alert_email.sh +++ b/lgsm/functions/alert_email.sh @@ -6,7 +6,7 @@ local modulename="ALERT" local commandaction="Alert" -local function_selfname=$(basename "$(readlink -f "${BASH_SOURCE[0]}")") +local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_print_dots "Sending Email alert: ${email}" fn_sleep_time @@ -18,9 +18,9 @@ else fi exitcode=$? if [ "${exitcode}" == "0" ]; then - fn_print_ok "Sending Email alert: ${email}" + fn_print_ok_nl "Sending Email alert: ${email}" fn_script_log_pass "Sending Email alert: ${email}" else - fn_print_fail "Sending Email alert: ${email}" + fn_print_fail_nl "Sending Email alert: ${email}" fn_script_log_fatal "Sending Email alert: ${email}" fi diff --git a/lgsm/functions/alert_ifttt.sh b/lgsm/functions/alert_ifttt.sh index ccf3341419..0e983e2dc3 100644 --- a/lgsm/functions/alert_ifttt.sh +++ b/lgsm/functions/alert_ifttt.sh @@ -6,7 +6,7 @@ local modulename="ALERT" local commandaction="Alert" -local function_selfname=$(basename "$(readlink -f "${BASH_SOURCE[0]}")") +local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" json=$(cat </dev/null)" ]&&[ -d "${steamcmddir}" ]; then +if [ "$(command -v steamcmd 2>/dev/null)" ]&&[ -d "${rootdir}/steamcmd" ]; then rm -rf "${steamcmddir:?}" exitcode=$? if [ ${exitcode} -ne 0 ]; then - fn_script_log_fatal "Removing ${steamcmddir}" + fn_script_log_fatal "Removing ${rootdir}/steamcmd" else - fn_script_log_pass "Removing ${steamcmddir}" + fn_script_log_pass "Removing ${rootdir}/steamcmd" fi fi } @@ -108,5 +149,7 @@ fn_check_steamcmd if [ ${shortname} == "ark" ]; then fn_check_steamcmd_ark fi +fn_check_steamcmd_dir +fn_check_steamcmd_dir_legacy fn_check_steamcmd_user fn_check_steamcmd_exec diff --git a/lgsm/functions/command_backup.sh b/lgsm/functions/command_backup.sh index 6c195f8751..1f9a2cae7a 100644 --- a/lgsm/functions/command_backup.sh +++ b/lgsm/functions/command_backup.sh @@ -7,7 +7,7 @@ local modulename="BACKUP" local commandaction="Backup" -local function_selfname=$(basename "$(readlink -f "${BASH_SOURCE[0]}")") +local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" check.sh @@ -22,15 +22,15 @@ fn_backup_trap(){ fn_print_removed_eol_nl fn_script_log_info "Backup ${backupname}.tar.gz: REMOVED" # Remove lock file. - rm -f "${tmpdir:?}/.backup.lock" + rm -f "${lockdir:?}/.backup.lock" core_exit.sh } # Check if a backup is pending or has been aborted using .backup.lock. fn_backup_check_lockfile(){ - if [ -f "${tmpdir}/.backup.lock" ]; then + if [ -f "${lockdir}/.backup.lock" ]; then fn_print_info_nl "Lock file found: Backup is currently running" - fn_script_log_error "Lock file found: Backup is currently running: ${tmpdir}/.backup.lock" + fn_script_log_error "Lock file found: Backup is currently running: ${lockdir}/.backup.lock" core_exit.sh fi } @@ -43,9 +43,9 @@ fn_backup_init(){ info_distro.sh fn_print_dots "Backup starting" fn_script_log_info "Backup starting" - fn_print_ok "Backup starting" + fn_print_ok_nl "Backup starting" if [ ! -d "${backupdir}" ]||[ "${backupcount}" == "0" ]; then - fn_print_info "There are no previous backups" + fn_print_info_nl "There are no previous backups" else if [ "${lastbackupdaysago}" == "0" ]; then daysago="less than 1 day ago" @@ -54,7 +54,6 @@ fn_backup_init(){ else daysago="${lastbackupdaysago} days ago" fi - echo -en "\n" echo -e "* Previous backup was created ${daysago}, total size ${lastbackupsize}" fi } @@ -74,8 +73,7 @@ fn_backup_stop_server(){ fn_script_log_warn "Although unlikely; creating a backup while ${selfname} is running might corrupt the backup" # Server is running and will be stopped if stoponbackup=on or unset. else - fn_print_warn "${selfname} will be stopped during the backup" - fn_script_log_warn "${selfname} will be stopped during the backup" + fn_stop_warning serverstopped="yes" exitbypass=1 command_stop.sh @@ -117,9 +115,9 @@ fn_backup_migrate_olddir(){ fn_backup_create_lockfile(){ # Create lockfile. - date '+%s' > "${tmpdir}/.backup.lock" + date '+%s' > "${lockdir}/.backup.lock" fn_script_log_info "Lockfile generated" - fn_script_log_info "${tmpdir}/.backup.lock" + fn_script_log_info "${lockdir}/.backup.lock" # trap to remove lockfile on quit. trap fn_backup_trap INT } @@ -135,26 +133,26 @@ fn_backup_compression(){ # Check that excludedir is a valid path. if [ ! -d "${excludedir}" ] ; then - fn_print_fail "Problem identifying the previous backup directory for exclusion." + fn_print_fail_nl "Problem identifying the previous backup directory for exclusion." fn_script_log_fatal "Problem identifying the previous backup directory for exclusion" core_exit.sh fi - tar -czf "${backupdir}/${backupname}.tar.gz" -C "${rootdir}" --exclude "${excludedir}" --exclude "${tmpdir}/.backup.lock" ./. + tar -czf "${backupdir}/${backupname}.tar.gz" -C "${rootdir}" --exclude "${excludedir}" --exclude "${lockdir}/.backup.lock" ./. local exitcode=$? if [ ${exitcode} -ne 0 ]; then fn_print_fail_eol fn_script_log_fatal "Backup in progress: FAIL" echo -e "${tarcmd}" | tee -a "${lgsmlog}" - fn_print_fail "Starting backup" + fn_print_fail_nl "Starting backup" fn_script_log_fatal "Starting backup" else fn_print_ok_eol - fn_print_ok "Completed: ${backupname}.tar.gz, total size $(du -sh "${backupdir}/${backupname}.tar.gz" | awk '{print $1}')" + fn_print_ok_nl "Completed: ${backupname}.tar.gz, total size $(du -sh "${backupdir}/${backupname}.tar.gz" | awk '{print $1}')" fn_script_log_pass "Backup created: ${backupname}.tar.gz, total size $(du -sh "${backupdir}/${backupname}.tar.gz" | awk '{print $1}')" fi # Remove lock file - rm -f "${tmpdir:?}/.backup.lock" + rm -f "${lockdir:?}/.backup.lock" } # Clear old backups according to maxbackups and maxbackupdays variables. @@ -171,7 +169,7 @@ fn_backup_prune(){ if [ "${backupquotadiff}" -gt "0" ]||[ "${backupsoudatedcount}" -gt "0" ]; then fn_print_dots "Pruning" fn_script_log_info "Backup pruning activated" - fn_print_ok "Pruning" + fn_print_ok_nl "Pruning" # If maxbackups greater or equal to backupsoutdatedcount, then it is over maxbackupdays. if [ "${backupquotadiff}" -ge "${backupsoudatedcount}" ]; then # Display how many backups will be cleared. @@ -182,7 +180,7 @@ fn_backup_prune(){ fn_script_log_info "Pruning: Clearing ${backupquotadiff} backup(s)" # Clear backups over quota. find "${backupdir}"/ -type f -name "*.tar.gz" -printf '%T@ %p\n' | sort -rn | tail -${backupquotadiff} | cut -f2- -d" " | xargs rm - fn_print_ok "Pruning: Clearing ${backupquotadiff} backup(s)" + fn_print_ok_nl "Pruning: Clearing ${backupquotadiff} backup(s)" fn_script_log_pass "Pruning: Cleared ${backupquotadiff} backup(s)" # If maxbackupdays is used over maxbackups. elif [ "${backupquotadiff}" -lt "${backupsoudatedcount}" ]; then @@ -194,7 +192,7 @@ fn_backup_prune(){ fn_script_log_info "Pruning: Clearing ${backupquotadiff} backup(s)" # Clear backups over quota find "${backupdir}"/ -type f -mtime +"${maxbackupdays}" -exec rm -f {} \; - fn_print_ok "Pruning: Clearing ${backupquotadiff} backup(s)" + fn_print_ok_nl "Pruning: Clearing ${backupquotadiff} backup(s)" fn_script_log_pass "Pruning: Cleared ${backupquotadiff} backup(s)" fi fi @@ -202,11 +200,9 @@ fn_backup_prune(){ } fn_backup_relpath() { - # Written by CedarLUG as a "realpath --relative-to" alternative in bash. - + # Written by CedarLUG as a "realpath --relative-to" alternative in bash. # Populate an array of tokens initialized from the rootdir components. - declare -a rdirtoks=($(readlink -f "${rootdir}" | sed "s/\// /g")) - + declare -a rdirtoks=($(readlink -f "${rootdir}" | sed "s/\// /g")) if [ ${#rdirtoks[@]} -eq 0 ]; then fn_print_fail_nl "Problem assessing rootdir during relative path assessment" fn_script_log_fatal "Problem assessing rootdir during relative path assessment: ${rootdir}" @@ -214,7 +210,7 @@ fn_backup_relpath() { fi # Populate an array of tokens initialized from the backupdir components. - declare -a bdirtoks=($(readlink -f "${backupdir}" | sed "s/\// /g")) + declare -a bdirtoks=($(readlink -f "${backupdir}" | sed "s/\// /g")) if [ ${#bdirtoks[@]} -eq 0 ]; then fn_print_fail_nl "Problem assessing backupdir during relative path assessment" fn_script_log_fatal "Problem assessing backupdir during relative path assessment: ${rootdir}" @@ -223,31 +219,46 @@ fn_backup_relpath() { # Compare the leading entries of each array. These common elements will be clipped off. # for the relative path output. - for ((base=0; base<${#rdirtoks[@]}; base++)) - do - [[ "${rdirtoks[$base]}" != "${bdirtoks[$base]}" ]] && break - done + for ((base=0; base<${#rdirtoks[@]}; base++)) + do + [[ "${rdirtoks[$base]}" != "${bdirtoks[$base]}" ]] && break + done # Next, climb out of the remaining rootdir location with updir references. - for ((x=base;x<${#rdirtoks[@]};x++)) - do - echo -n "../" - done + for ((x=base;x<${#rdirtoks[@]};x++)) + do + echo -n "../" + done # Climb down the remaining components of the backupdir location. - for ((x=base;x<$(( ${#bdirtoks[@]} - 1 ));x++)) - do - echo -n "${bdirtoks[$x]}/" - done + for ((x=base;x<$(( ${#bdirtoks[@]} - 1 ));x++)) + do + echo -n "${bdirtoks[$x]}/" + done # In the event there were no directories left in the backupdir above to # traverse down, just add a newline. Otherwise at this point, there is # one remaining directory component in the backupdir to navigate. - if (( "$base" < "${#bdirtoks[@]}" )) ; then - echo -e "${bdirtoks[ $(( ${#bdirtoks[@]} - 1)) ]}" - else - echo + if (( "$base" < "${#bdirtoks[@]}" )) ; then + echo -e "${bdirtoks[ $(( ${#bdirtoks[@]} - 1)) ]}" + else + echo + fi +} + +fn_stop_warning(){ + fn_print_warn "Updating server: SteamCMD: ${selfname} will be stopped during backup" + fn_script_log_warn "Updating server: SteamCMD: ${selfname} will be stopped during backup" + totalseconds=3 + for seconds in {3..1}; do + fn_print_warn "Updating server: SteamCMD: ${selfname} will be stopped during backup: ${totalseconds}" + totalseconds=$((totalseconds - 1)) + sleep 1 + if [ "${seconds}" == "0" ]; then + break fi + done + fn_print_warn_nl "Updating server: SteamCMD: ${selfname} will be stopped during backup" } # Restart the server if it was stopped for the backup. diff --git a/lgsm/functions/command_console.sh b/lgsm/functions/command_console.sh index 796f24454b..16578600cc 100644 --- a/lgsm/functions/command_console.sh +++ b/lgsm/functions/command_console.sh @@ -6,7 +6,7 @@ local modulename="CONSOLE" local commandaction="Console" -local function_selfname=$(basename "$(readlink -f "${BASH_SOURCE[0]}")") +local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" check.sh fn_print_header diff --git a/lgsm/functions/command_debug.sh b/lgsm/functions/command_debug.sh index f3e2a0cc16..5a681c4a2e 100644 --- a/lgsm/functions/command_debug.sh +++ b/lgsm/functions/command_debug.sh @@ -6,12 +6,12 @@ local modulename="DEBUG" local commandaction="Debug" -local function_selfname=$(basename "$(readlink -f "${BASH_SOURCE[0]}")") +local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" # Trap to remove lockfile on quit. fn_lockfile_trap(){ # Remove lockfile. - rm -f "${rootdir:?}/${lockselfname}" + rm -f "${lockdir:?}/${selfname}.lock" # resets terminal. Servers can sometimes mess up the terminal on exit. reset fn_print_ok_nl "Closing debug" @@ -62,20 +62,12 @@ if [ "${extip}" ]; then echo -e "${lightblue}Internet IP:\t${default}${extip}:${port}" fi fi -# Listed on Master Server. -if [ "${displaymasterserver}" ]; then - if [ "${displaymasterserver}" == "true" ]; then - echo -e "${lightblue}Master Server:\t${green}${displaymasterserver}${default}" - else - echo -e "${lightblue}Master Server:\t${red}${displaymasterserver}${default}" - fi -fi # Server password. if [ "${serverpassword}" ]; then echo -e "${lightblue}Server password:\t${default}${serverpassword}" fi echo -e "${lightblue}Start parameters:${default}" -if [ "${engine}" == "source" ]||[ "${engine}" == "goldsource" ]; then +if [ "${engine}" == "source" ]||[ "${engine}" == "goldsrc" ]; then echo -e "${executable} ${parms} -debug" else echo -e "${executable} ${parms}" @@ -98,15 +90,15 @@ fn_script_log_info "Starting debug" fn_print_ok_nl "Starting debug" # Create lockfile. -date '+%s' > "${rootdir}/${lockselfname}" +date '+%s' > "${lockdir}/${selfname}.lock" fn_script_log_info "Lockfile generated" -fn_script_log_info "${rootdir}/${lockselfname}" +fn_script_log_info "${lockdir}/${selfname}.lock" # trap to remove lockfile on quit. trap fn_lockfile_trap INT cd "${executabledir}" || exit # Note: do not add double quotes to ${executable} ${parms}. -if [ "${engine}" == "source" ]||[ "${engine}" == "goldsource" ]; then +if [ "${engine}" == "source" ]||[ "${engine}" == "goldsrc" ]; then ${executable} ${parms} -debug elif [ "${engine}" == "realvirtuality" ]; then # Arma3 requires semicolons in the module list, which need to diff --git a/lgsm/functions/command_details.sh b/lgsm/functions/command_details.sh index 461dc78f5e..02726f1971 100644 --- a/lgsm/functions/command_details.sh +++ b/lgsm/functions/command_details.sh @@ -7,7 +7,7 @@ local modulename="DETAILS" local commandaction="Details" -local function_selfname=$(basename "$(readlink -f "${BASH_SOURCE[0]}")") +local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" # Run checks and gathers details to display. check.sh @@ -15,7 +15,9 @@ info_config.sh info_parms.sh info_distro.sh info_messages.sh -query_gamedig.sh +if [ "${querymode}" == "2" ]||[ "${querymode}" == "3" ]; then + query_gamedig.sh +fi fn_info_message_distro fn_info_message_server_resource fn_info_message_gameserver_resource diff --git a/lgsm/functions/command_dev_debug.sh b/lgsm/functions/command_dev_debug.sh index ba80921c67..f17b67fe24 100644 --- a/lgsm/functions/command_dev_debug.sh +++ b/lgsm/functions/command_dev_debug.sh @@ -5,8 +5,8 @@ # Description: Dev only: Enables debugging log to be saved to dev-debug.log. local modulename="DEV-DEBUG" -local commandaction="Dev-Debug" -local function_selfname=$(basename "$(readlink -f "${BASH_SOURCE[0]}")") +local commandaction="Dev Debug" +local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" if [ -f "${rootdir}/.dev-debug" ]; then rm "${rootdir:?}/.dev-debug" diff --git a/lgsm/functions/command_dev_detect_deps.sh b/lgsm/functions/command_dev_detect_deps.sh index b308c3579d..79770044d0 100644 --- a/lgsm/functions/command_dev_detect_deps.sh +++ b/lgsm/functions/command_dev_detect_deps.sh @@ -5,8 +5,8 @@ # Description: Detects dependencies the server binary requires. local modulename="DETECT-DEPS" -local commandaction="Detect-Deps" -local function_selfname=$(basename "$(readlink -f "${BASH_SOURCE[0]}")") +local commandaction="Detect Deps" +local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" echo -e "=================================" echo -e "Dependencies Checker" diff --git a/lgsm/functions/command_dev_detect_glibc.sh b/lgsm/functions/command_dev_detect_glibc.sh index 0ffc7e0a72..49d7cc55ae 100644 --- a/lgsm/functions/command_dev_detect_glibc.sh +++ b/lgsm/functions/command_dev_detect_glibc.sh @@ -6,8 +6,8 @@ # Can check a file or directory recursively. local modulename="DETECT-GLIBC" -local commandaction="Detect-Glibc" -local function_selfname=$(basename "$(readlink -f "${BASH_SOURCE[0]}")") +local commandaction="Detect Glibc" +local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" echo -e "=================================" echo -e "glibc Requirements Checker" diff --git a/lgsm/functions/command_dev_detect_ldd.sh b/lgsm/functions/command_dev_detect_ldd.sh index f612366bf9..919900de13 100644 --- a/lgsm/functions/command_dev_detect_ldd.sh +++ b/lgsm/functions/command_dev_detect_ldd.sh @@ -6,8 +6,8 @@ # Can check a file or directory recursively. local modulename="DETECT-LDD" -local commandaction="Detect-LDD" -local function_selfname=$(basename "$(readlink -f "${BASH_SOURCE[0]}")") +local commandaction="Detect LDD" +local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" echo -e "=================================" echo -e "Shared Object dependencies Checker" diff --git a/lgsm/functions/command_dev_query_raw.sh b/lgsm/functions/command_dev_query_raw.sh index 78ba80e77d..0f5e5c8e25 100644 --- a/lgsm/functions/command_dev_query_raw.sh +++ b/lgsm/functions/command_dev_query_raw.sh @@ -6,12 +6,22 @@ local modulename="QUERY-RAW" local commandaction="Query Raw" -local function_selfname=$(basename "$(readlink -f "${BASH_SOURCE[0]}")") +local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +check.sh +info_config.sh +info_parms.sh echo -e "" echo -e "Query Port - Raw Output" echo -e "==================================================================" echo -e "" +echo -e "Ports" +echo -e "=================================" +echo -e "" +echo -e "PORT: ${port}" +echo -e "QUERY PORT: ${queryport}" +echo -e "" echo -e "Gamedig Raw Output" echo -e "=================================" echo -e "" @@ -22,10 +32,6 @@ if [ ! "$(command -v jq 2>/dev/null)" ]; then fn_print_failure_nl "jq not installed" fi -check.sh -info_config.sh -info_parms.sh - query_gamedig.sh echo -e "${gamedigcmd}" echo"" @@ -75,4 +81,5 @@ else echo -e "TCP query FAIL" fi +exitcode=0 core_exit.sh diff --git a/lgsm/functions/command_fastdl.sh b/lgsm/functions/command_fastdl.sh index 12a33e8e1d..4e0007fd8b 100644 --- a/lgsm/functions/command_fastdl.sh +++ b/lgsm/functions/command_fastdl.sh @@ -7,7 +7,7 @@ local modulename="FASTDL" local commandaction="FastDL" -local function_selfname=$(basename "$(readlink -f "${BASH_SOURCE[0]}")") +local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" check.sh diff --git a/lgsm/functions/command_install.sh b/lgsm/functions/command_install.sh index caab4ee897..65b22de70d 100644 --- a/lgsm/functions/command_install.sh +++ b/lgsm/functions/command_install.sh @@ -7,7 +7,7 @@ local modulename="INSTALL" local commandaction="Install" -local function_selfname=$(basename "$(readlink -f "${BASH_SOURCE[0]}")") +local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" check.sh if [ "$(whoami)" = "root" ]; then diff --git a/lgsm/functions/command_install_resources_mta.sh b/lgsm/functions/command_install_resources_mta.sh index 5874818a6f..3d75824f74 100644 --- a/lgsm/functions/command_install_resources_mta.sh +++ b/lgsm/functions/command_install_resources_mta.sh @@ -6,7 +6,7 @@ local modulename="DEFAULT_RESOURCES" local commandaction="Default Resources" -local function_selfname=$(basename "$(readlink -f "${BASH_SOURCE[0]}")") +local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_install_resources(){ echo -e "" diff --git a/lgsm/functions/command_mods_install.sh b/lgsm/functions/command_mods_install.sh index 1bef36c25c..971db33149 100644 --- a/lgsm/functions/command_mods_install.sh +++ b/lgsm/functions/command_mods_install.sh @@ -7,7 +7,7 @@ local modulename="MODS" local commandaction="addons/mods" -local function_selfname=$(basename "$(readlink -f "${BASH_SOURCE[0]}")") +local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" check.sh mods_core.sh diff --git a/lgsm/functions/command_mods_remove.sh b/lgsm/functions/command_mods_remove.sh index cec994fead..61289b60e6 100644 --- a/lgsm/functions/command_mods_remove.sh +++ b/lgsm/functions/command_mods_remove.sh @@ -7,7 +7,7 @@ local modulename="MODS" local commandaction="Mods Remove" -local function_selfname=$(basename "$(readlink -f "${BASH_SOURCE[0]}")") +local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" check.sh mods_core.sh diff --git a/lgsm/functions/command_mods_update.sh b/lgsm/functions/command_mods_update.sh index 8d0146f096..44ff4d9b48 100644 --- a/lgsm/functions/command_mods_update.sh +++ b/lgsm/functions/command_mods_update.sh @@ -7,7 +7,7 @@ local modulename="MODS" local commandaction="Mods Update" -local function_selfname=$(basename "$(readlink -f "${BASH_SOURCE[0]}")") +local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" check.sh mods_core.sh diff --git a/lgsm/functions/command_monitor.sh b/lgsm/functions/command_monitor.sh index a70d185ed5..98f018cf42 100644 --- a/lgsm/functions/command_monitor.sh +++ b/lgsm/functions/command_monitor.sh @@ -8,11 +8,11 @@ local modulename="MONITOR" local commandaction="Monitor" -local function_selfname=$(basename "$(readlink -f "${BASH_SOURCE[0]}")") +local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_monitor_check_lockfile(){ # Monitor does not run it lockfile is not found. - if [ ! -f "${rootdir}/${lockselfname}" ]; then + if [ ! -f "${lockdir}/${selfname}.lock" ]; then fn_print_dots "Checking lockfile: " fn_print_checking_eol fn_script_log_info "Checking lockfile: CHECKING" @@ -26,8 +26,8 @@ fn_monitor_check_lockfile(){ fi # Fix if lockfile is not unix time or contains letters - if [[ "$(cat "${rootdir}/${lockselfname}")" =~ [A-Za-z] ]]; then - date '+%s' > "${rootdir}/${lockselfname}" + if [[ "$(cat "${lockdir}/${selfname}.lock")" =~ [A-Za-z] ]]; then + date '+%s' > "${lockdir}/${selfname}.lock" fi } @@ -75,11 +75,17 @@ fn_monitor_check_queryport(){ if [ -z "${queryport}" ]||[ "${queryport}" == "0" ]; then fn_print_dots "Checking port: " fn_print_checking_eol - fn_script_log_info "Checking session: CHECKING" + fn_script_log_info "Checking port: CHECKING" fn_sleep_time - fn_print_error "Checking port: Unable to query as queryport is not set: " - fn_print_error_eol_nl - fn_script_log_error "Checking port: Unable to query as queryport is not set: ERROR" + if [ -n "${rconenabled}" ]&&[ "${rconenabled}" != "true" ]&&[ ${shortname} == "av" ]; then + fn_print_warn "Checking port: Unable to query as rconport, rcon not enabled: " + fn_print_warn_eol_nl + fn_script_log_warn "Checking port: Unable to query rconport, rcon not enabled: WARN" + else + fn_print_error "Checking port: Unable to query queryport is not set: " + fn_print_error_eol_nl + fn_script_log_error "Checking port: Unable to query as queryport is not set: ERROR" + fi fn_sleep_time core_exit.sh fi @@ -108,7 +114,7 @@ for queryattempt in {1..5}; do fn_script_log_info "Querying port: ${querymethod}: ${ip}:${queryport} : ${queryattempt} : QUERYING" fn_sleep_time # querydelay - if [ "$(cat "${rootdir}/${lockselfname}")" -gt "$(date "+%s" -d "${querydelay} mins ago")" ]; then + if [ "$(cat "${lockdir}/${selfname}.lock")" -gt "$(date "+%s" -d "${querydelay} mins ago")" ]; then fn_print_ok "Querying port: ${querymethod}: ${ip}:${queryport} : ${totalseconds}/${queryattempt}: " fn_print_delay_eol_nl fn_script_log_info "Querying port: ${querymethod}: ${ip}:${queryport} : ${queryattempt} : DELAY" @@ -147,6 +153,9 @@ for queryattempt in {1..5}; do if [ "${gdplayers}" ]; then fn_script_log_info "Players: ${gdplayers}/${gdmaxplayers}" fi + if [ "${gdbots}" ]; then + fn_script_log_info "Bots: ${gdbots}" + fi if [ "${gdmap}" ]; then fn_script_log_info "Map: ${gdmap}" fi diff --git a/lgsm/functions/command_postdetails.sh b/lgsm/functions/command_postdetails.sh index 12554565fe..b62cc708a9 100644 --- a/lgsm/functions/command_postdetails.sh +++ b/lgsm/functions/command_postdetails.sh @@ -7,7 +7,7 @@ local modulename="POSTDETAILS" local commandaction="Postdetails" -local function_selfname=$(basename "$(readlink -f "${BASH_SOURCE[0]}")") +local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" # Set posttarget to the appropriately-defined post destination. @@ -78,7 +78,7 @@ else fi if [ "${posttarget}" == "http://pastebin.com" ] ; then - fn_print_dots "Posting details to pastbin.com for ${postexpire}" + fn_print_dots "pastbin.com for ${postexpire}" # grab the return from 'value' from an initial visit to pastebin. csrftoken=$(curl -s "${posttarget}" | sed -n 's/^.*input type="hidden" name="csrf_token_post" value="\(.*\)".*$/\1/p') @@ -93,23 +93,26 @@ if [ "${posttarget}" == "http://pastebin.com" ] ; then awk '/^location: / { print $2 }' | sed "s/\n//g") # Output the resulting link. - fn_print_ok_nl "Posting details to pastbin.com for ${postexpire}" + fn_print_ok_nl "pastbin.com for ${postexpire}" pdurl="${posttarget}${link}" + echo -e "" echo -e " Please share the following url for support: ${pdurl}" elif [ "${posttarget}" == "https://hastebin.com" ] ; then - fn_print_dots "Posting details to hastebin.com" + fn_print_dots "hastebin.com" # hastebin is a bit simpler. If successful, the returned result # should look like: {"something":"key"}, putting the reference that # we need in "key". TODO - error handling. -CedarLUG link=$(curl -H "HTTP_X_REQUESTED_WITH:XMLHttpRequest" -s -d "$(<${postdetailslog})" "${posttarget}/documents" | cut -d\" -f4) - fn_print_ok_nl "Posting details to hastebin.com for ${postexpire}" + fn_print_ok_nl "hastebin.com for ${postexpire}" pdurl="${posttarget}/${link}" + echo -e "" echo -e "Please share the following url for support: ${pdurl}" elif [ "${posttarget}" == "https://termbin.com" ] ; then - fn_print_dots "Posting details to termbin.com" + fn_print_dots "termbin.com" link=$(cat "${postdetailslog}" | nc termbin.com 9999 | tr -d '\n\0') - fn_print_ok_nl "Posting details to termbin.com" + fn_print_ok_nl "termbin.com" pdurl="${link}" + echo -e "" echo -e "Please share the following url for support: " echo -e "${pdurl}" else diff --git a/lgsm/functions/command_restart.sh b/lgsm/functions/command_restart.sh index 56b6d7872e..c127d21b48 100644 --- a/lgsm/functions/command_restart.sh +++ b/lgsm/functions/command_restart.sh @@ -6,7 +6,7 @@ local modulename="RESTART" local commandaction="Restarting" -local function_selfname=$(basename "$(readlink -f "${BASH_SOURCE[0]}")") +local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" info_config.sh exitbypass=1 diff --git a/lgsm/functions/command_start.sh b/lgsm/functions/command_start.sh index 8f60a73144..d1ee21e42c 100644 --- a/lgsm/functions/command_start.sh +++ b/lgsm/functions/command_start.sh @@ -7,7 +7,7 @@ local modulename="START" local commandaction="Starting" -local function_selfname=$(basename "$(readlink -f "${BASH_SOURCE[0]}")") +local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_start_teamspeak3(){ if [ ! -f "${servercfgfullpath}" ]; then @@ -62,13 +62,16 @@ fn_start_tmux(){ fi # Create lockfile - date > "${rootdir}/${lockselfname}" + date > "${lockdir}/${selfname}.lock" cd "${executabledir}" || exit tmux new-session -d -x "${sessionwidth}" -y "${sessionheight}" -s "${selfname}" "${executable} ${parms}" 2> "${lgsmlogdir}/.${selfname}-tmux-error.tmp" # Create logfile. touch "${consolelog}" + # Create last start lock file + date +%s > "${lockdir}/${selfname}-laststart.lock" + # Get tmux version. tmuxversion=$(tmux -V | sed "s/tmux //" | sed -n '1 p') # Tmux compiled from source will return "master", therefore ignore it. @@ -170,7 +173,7 @@ fn_print_dots "${servername}" # Is the server already started. # $status comes from check_status.sh, which is run by check.sh for this command if [ "${status}" != "0" ]; then - fn_print_info "${servername} is already running" + fn_print_info_nl "${servername} is already running" fn_script_log_error "${servername} is already running" if [ -z "${exitbypass}" ]; then core_exit.sh diff --git a/lgsm/functions/command_stop.sh b/lgsm/functions/command_stop.sh index c7c6ebf3be..c25714de2f 100644 --- a/lgsm/functions/command_stop.sh +++ b/lgsm/functions/command_stop.sh @@ -7,7 +7,7 @@ local modulename="STOP" local commandaction="Stopping" -local function_selfname=$(basename "$(readlink -f "${BASH_SOURCE[0]}")") +local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" # Attempts graceful shutdown by sending 'CTRL+c'. fn_stop_graceful_ctrlc(){ @@ -65,15 +65,15 @@ fn_stop_graceful_cmd(){ fn_sleep_time } -# Attempts graceful shutdown of goldsource using rcon 'quit' command. +# Attempts graceful shutdown of goldsrc using rcon 'quit' command. # There is only a 3 second delay before a forced a tmux shutdown -# as Goldsource servers 'quit' command does a restart rather than shutdown. -fn_stop_graceful_goldsource(){ +# as GoldSrc servers 'quit' command does a restart rather than shutdown. +fn_stop_graceful_goldsrc(){ fn_print_dots "Graceful: sending \"quit\"" fn_script_log_info "Graceful: sending \"quit\"" # sends quit tmux send -t "${selfname}" quit ENTER > /dev/null 2>&1 - # Waits 3 seconds as goldsource servers restart with the quit command. + # Waits 3 seconds as goldsrc servers restart with the quit command. for seconds in {1..3}; do sleep 1 fn_print_dots "Graceful: sending \"quit\": ${seconds}" @@ -181,6 +181,36 @@ fn_stop_graceful_sdtd(){ fn_sleep_time } +# Attempts graceful shutdown by sending /save /stop. +fn_stop_graceful_avorion(){ + fn_print_dots "Graceful: /save /stop" + fn_script_log_info "Graceful: /save /stop" + # Sends /save. + tmux send-keys -t "${selfname}" /save ENTER > /dev/null 2>&1 + sleep 5 + # Sends /quit. + tmux send-keys -t "${selfname}" /stop ENTER > /dev/null 2>&1 + # Waits up to 30 seconds giving the server time to shutdown gracefuly. + for seconds in {1..30}; do + check_status.sh + if [ "${status}" == "0" ]; then + fn_print_ok "Graceful: /save /stop: ${seconds}: " + fn_print_ok_eol_nl + fn_script_log_pass "Graceful: /save /stop: OK: ${seconds} seconds" + break + fi + sleep 1 + fn_print_dots "Graceful: /save /stop: ${seconds}" + done + check_status.sh + if [ "${status}" != "0" ]; then + fn_print_error "Graceful: /save /stop: " + fn_print_fail_eol_nl + fn_script_log_error "Graceful: /save /stop: FAIL" + fi + fn_sleep_time +} + fn_stop_graceful_select(){ if [ "${stopmode}" == "1" ]; then fn_stop_tmux @@ -199,7 +229,9 @@ fn_stop_graceful_select(){ elif [ "${stopmode}" == "8" ]; then fn_stop_graceful_sdtd elif [ "${stopmode}" == "9" ]; then - fn_stop_graceful_goldsource + fn_stop_graceful_goldsrc + elif [ "${stopmode}" == "10" ]; then + fn_stop_graceful_avorion fi } @@ -211,7 +243,7 @@ fn_stop_tmux(){ fn_sleep_time check_status.sh if [ "${status}" == "0" ]; then - fn_print_ok "${servername}" + fn_print_ok_nl "${servername}" fn_script_log_pass "Stopped ${servername}" else fn_print_fail_nl "Unable to stop ${servername}" @@ -241,8 +273,8 @@ fn_print_dots "${servername}" info_config.sh fn_stop_pre_check # Remove lockfile. -if [ -f "${rootdir}/${lockselfname}" ]; then - rm -f "${rootdir:?}/${lockselfname}" +if [ -f "${lockdir}/${selfname}.lock" ]; then + rm -f "${lockdir:?}/${selfname}.lock" fi if [ -z "${exitbypass}" ]; then diff --git a/lgsm/functions/command_test_alert.sh b/lgsm/functions/command_test_alert.sh index 3bc975949e..b921babe11 100644 --- a/lgsm/functions/command_test_alert.sh +++ b/lgsm/functions/command_test_alert.sh @@ -6,11 +6,12 @@ local modulename="ALERT" local commandaction="Alert" -local function_selfname=$(basename "$(readlink -f "${BASH_SOURCE[0]}")") +local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_print_dots "${servername}" check.sh info_config.sh alert="test" alert.sh + core_exit.sh diff --git a/lgsm/functions/command_ts3_server_pass.sh b/lgsm/functions/command_ts3_server_pass.sh index dfe9c58240..91d19afeb1 100644 --- a/lgsm/functions/command_ts3_server_pass.sh +++ b/lgsm/functions/command_ts3_server_pass.sh @@ -7,7 +7,7 @@ local modulename="PASSWORD-CHANGE" local commandaction="Password Change" -local function_selfname=$(basename "$(readlink -f "${BASH_SOURCE[0]}")") +local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_serveradmin_password_prompt(){ fn_print_header diff --git a/lgsm/functions/command_update.sh b/lgsm/functions/command_update.sh index 64cfcb2f55..f54423be43 100644 --- a/lgsm/functions/command_update.sh +++ b/lgsm/functions/command_update.sh @@ -6,11 +6,12 @@ local modulename="UPDATE" local commandaction="Update" -local function_selfname=$(basename "$(readlink -f "${BASH_SOURCE[0]}")") +local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_print_dots "" check.sh logs.sh +check_last_update.sh if [ "${shortname}" == "ts3" ]; then update_ts3.sh diff --git a/lgsm/functions/command_update_linuxgsm.sh b/lgsm/functions/command_update_linuxgsm.sh index ce8864c802..d141c0659e 100644 --- a/lgsm/functions/command_update_linuxgsm.sh +++ b/lgsm/functions/command_update_linuxgsm.sh @@ -6,7 +6,7 @@ local modulename="UPDATE LINUXGSM" local commandaction="Update LinuxGSM" -local function_selfname=$(basename "$(readlink -f "${BASH_SOURCE[0]}")") +local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_print_dots "Updating LinuxGSM" check.sh diff --git a/lgsm/functions/command_validate.sh b/lgsm/functions/command_validate.sh index 6764831f4d..410d1eb4dd 100644 --- a/lgsm/functions/command_validate.sh +++ b/lgsm/functions/command_validate.sh @@ -6,52 +6,87 @@ local modulename="VALIDATE" local commandaction="Validate" -local function_selfname=$(basename "$(readlink -f "${BASH_SOURCE[0]}")") +local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" -fn_validation(){ - fn_print_info "Validating files: SteamCMD" - echo -e "" - echo -e "* Validating may overwrite some customised files." - echo -e "* https://docs.linuxgsm.com/commands/validate" - fn_script_log_info "Validating files: SteamCMD" - sleep 3 +fn_validate(){ + fn_script_log_warn "Validating server: SteamCMD: Validate might overwrite some customised files" + totalseconds=3 + for seconds in {3..1}; do + fn_print_warn "Validating server: SteamCMD: Validate might overwrite some customised files: ${totalseconds}" + totalseconds=$((totalseconds - 1)) + sleep 1 + if [ "${seconds}" == "0" ]; then + break + fi + done + fn_print_warn_nl "Validating server: SteamCMD: Validate might overwrite some customised files" + fn_print_start_nl "Validating server: SteamCMD" + fn_script_log_info "Validating server: SteamCMD" if [ -d "${steamcmddir}" ]; then cd "${steamcmddir}" || exit fi - # Detects if unbuffer command is available for 32 bit distributions only. + # Detects if unbuffer command is available, for 32 bit distributions only. info_distro.sh if [ "$(command -v stdbuf)" ]&&[ "${arch}" != "x86_64" ]; then unbuffer="stdbuf -i0 -o0 -e0" fi + # If GoldSrc (appid 90) servers. GoldSrc (appid 90) require extra commands. if [ "${appid}" == "90" ]; then - ${unbuffer} ${steamcmdcommand} +login "${steamuser}" "${steampass}" +force_install_dir "${serverfiles}" +app_info_print 70 +app_set_config 90 mod "${appidmod}" +app_update "${appid}" "${branch}" +app_update "${appid}" -beta "${branch}" validate +quit | tee -a "${lgsmlog}" - else + # If using a specific branch. + if [ -n "${branch}" ]; then + ${unbuffer} ${steamcmdcommand} +login "${steamuser}" "${steampass}" +force_install_dir "${serverfiles}" +app_info_print 70 +app_set_config 90 mod "${appidmod}" +app_update "${appid}" "${branch}" +app_update "${appid}" -beta "${branch}" validate +quit | tee -a "${lgsmlog}" + else + ${unbuffer} ${steamcmdcommand} +login "${steamuser}" "${steampass}" +force_install_dir "${serverfiles}" +app_info_print 70 +app_set_config 90 mod "${appidmod}" +app_update "${appid}" "${branch}" +app_update "${appid}" validate +quit | tee -a "${lgsmlog}" + fi + elif [ "${shortname}" == "ac" ]; then + ${unbuffer} ${steamcmdcommand} +@sSteamCmdForcePlatformType windows +login "${steamuser}" "${steampass}" +force_install_dir "${serverfiles}" +app_update "${appid}" validate +quit + local exitcode=$? + # All other servers. + elif [ -n "${branch}" ]; then ${unbuffer} ${steamcmdcommand} +login "${steamuser}" "${steampass}" +force_install_dir "${serverfiles}" +app_update "${appid}" -beta "${branch}" validate +quit | tee -a "${lgsmlog}" + else + ${unbuffer} ${steamcmdcommand} +login "${steamuser}" "${steampass}" +force_install_dir "${serverfiles}" +app_update "${appid}" validate +quit | tee -a "${lgsmlog}" fi - if [ $? != 0 ]; then - fn_print_fail "Validating files: SteamCMD" - fn_script_log_fatal "Validating files: SteamCMD: FAIL" + + exitcode=$? + fn_print_dots "Validating server: SteamCMD" + if [ "${exitcode}" != "0" ]; then + fn_print_fail_nl "Validating server: SteamCMD" + fn_script_log_fatal "Validating server: SteamCMD: FAIL" else - fn_print_ok "Validating files: SteamCMD" - fn_script_log_pass "Validating files: SteamCMD: OK" + fn_print_ok_nl "Validating server: SteamCMD" + fn_script_log_pass "Validating server: SteamCMD: OK" fi - fix.sh + core_exit.sh +} +fn_stop_warning(){ + fn_print_warn "Validating server: SteamCMD: ${selfname} will be stopped during validation" + fn_script_log_warn "Validating server: SteamCMD: ${selfname} will be stopped during validation" + totalseconds=3 + for seconds in {3..1}; do + fn_print_warn "Validating server: SteamCMD: ${selfname} will be stopped during validation: ${totalseconds}" + totalseconds=$((totalseconds - 1)) + sleep 1 + if [ "${seconds}" == "0" ]; then + break + fi + done + fn_print_warn_nl "Validating server: SteamCMD: ${selfname} will be stopped during validation" } -fn_print_dots "Validating files:" -fn_print_dots "Validating files: SteamCMD" +fn_print_dots "Validating server" +fn_print_dots "Validating server: SteamCMD" check.sh check_status.sh if [ "${status}" != "0" ]; then + fn_stop_warning exitbypass=1 command_stop.sh - fn_validation "${appid}" + fn_validate exitbypass=1 command_start.sh else - fn_validation + fn_validate fi - -core_exit.sh diff --git a/lgsm/functions/command_wipe.sh b/lgsm/functions/command_wipe.sh index dde48e23ad..55e636b079 100644 --- a/lgsm/functions/command_wipe.sh +++ b/lgsm/functions/command_wipe.sh @@ -7,7 +7,7 @@ local modulename="WIPE" local commandaction="Wipe" -local function_selfname=$(basename "$(readlink -f "${BASH_SOURCE[0]}")") +local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" check.sh fn_print_header diff --git a/lgsm/functions/compress_unreal2_maps.sh b/lgsm/functions/compress_unreal2_maps.sh index bc7a9ffb84..99078bfc7d 100644 --- a/lgsm/functions/compress_unreal2_maps.sh +++ b/lgsm/functions/compress_unreal2_maps.sh @@ -5,7 +5,7 @@ # Description: Compresses unreal maps. local commandaction="Unreal Map Compressor" -local function_selfname=$(basename "$(readlink -f "${BASH_SOURCE[0]}")") +local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" check.sh fn_print_header diff --git a/lgsm/functions/compress_ut99_maps.sh b/lgsm/functions/compress_ut99_maps.sh index 9f24ff9a36..94b3119ab6 100644 --- a/lgsm/functions/compress_ut99_maps.sh +++ b/lgsm/functions/compress_ut99_maps.sh @@ -5,7 +5,7 @@ # Description: Compresses unreal maps. local commandaction="Unreal Map Compressor" -local function_selfname=$(basename "$(readlink -f "${BASH_SOURCE[0]}")") +local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" check.sh fn_print_header diff --git a/lgsm/functions/core_dl.sh b/lgsm/functions/core_dl.sh index c3281505d8..244ccb9f9b 100644 --- a/lgsm/functions/core_dl.sh +++ b/lgsm/functions/core_dl.sh @@ -19,7 +19,7 @@ local modulename="DOWNLOAD" local commandaction="Download" -local function_selfname=$(basename "$(readlink -f "${BASH_SOURCE[0]}")") +local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" # Emptys contents of the LinuxGSM tmpdir. fn_clear_tmp(){ diff --git a/lgsm/functions/core_exit.sh b/lgsm/functions/core_exit.sh index ee7e9c6c8b..5d242816c0 100644 --- a/lgsm/functions/core_exit.sh +++ b/lgsm/functions/core_exit.sh @@ -23,6 +23,8 @@ fi if [ "${exitbypass}" ]; then unset exitbypass elif [ "${exitcode}" ]&&[ "${exitcode}" != "0" ]; then + # List LinuxGSM version in logs + fn_script_log_info "LinuxGSM version: ${version}" if [ "${exitcode}" == "1" ]; then fn_script_log_fatal "${function_selfname} exiting with code: ${exitcode}" elif [ "${exitcode}" == "2" ]; then @@ -36,10 +38,21 @@ elif [ "${exitcode}" ]&&[ "${exitcode}" != "0" ]; then # remove trap. trap - INT exit "${exitcode}" -else +elif [ "${exitcode}" ]&&[ "${exitcode}" == "0" ]; then + # List LinuxGSM version in logs + fn_script_log_info "LinuxGSM version: ${version}" fn_script_log_pass "${function_selfname} exiting with code: ${exitcode}" fn_exit_dev_debug # remove trap. trap - INT exit "${exitcode}" +else + # List LinuxGSM version in logs + fn_script_log_info "LinuxGSM version: ${version}" + fn_print_error "No exit code set" + fn_script_log_pass "${function_selfname} exiting with code: NOT SET" + fn_exit_dev_debug + # remove trap. + trap - INT + exit "${exitcode}" fi diff --git a/lgsm/functions/core_functions.sh b/lgsm/functions/core_functions.sh index 54d7ec6a2d..29bc46f562 100644 --- a/lgsm/functions/core_functions.sh +++ b/lgsm/functions/core_functions.sh @@ -188,6 +188,11 @@ functionfile="${FUNCNAME[0]}" fn_fetch_function } +check_last_update.sh(){ +functionfile="${FUNCNAME[0]}" +fn_fetch_function +} + check_logs.sh(){ functionfile="${FUNCNAME[0]}" fn_fetch_function @@ -296,6 +301,11 @@ functionfile="${FUNCNAME[0]}" fn_fetch_function } +fix_av.sh(){ +functionfile="${FUNCNAME[0]}" +fn_fetch_function +} + fix_arma3.sh(){ functionfile="${FUNCNAME[0]}" fn_fetch_function @@ -316,6 +326,11 @@ functionfile="${FUNCNAME[0]}" fn_fetch_function } +fix_hw.sh(){ +functionfile="${FUNCNAME[0]}" +fn_fetch_function +} + fix_ins.sh(){ functionfile="${FUNCNAME[0]}" fn_fetch_function @@ -386,6 +401,11 @@ functionfile="${FUNCNAME[0]}" fn_fetch_function } +fix_tu.sh(){ +functionfile="${FUNCNAME[0]}" +fn_fetch_function +} + fix_ut3.sh(){ functionfile="${FUNCNAME[0]}" fn_fetch_function @@ -701,6 +721,11 @@ if [ ! -d "${tmpdir}" ]; then mkdir -p "${tmpdir}" fi +# Creates lock dir if missing +if [ ! -d "${lockdir}" ]; then + mkdir -p "${lockdir}" +fi + # Calls on-screen messages (bootstrap) core_messages.sh diff --git a/lgsm/functions/core_getopt.sh b/lgsm/functions/core_getopt.sh index 7216dc7650..2eccb56cb1 100644 --- a/lgsm/functions/core_getopt.sh +++ b/lgsm/functions/core_getopt.sh @@ -4,7 +4,7 @@ # Website: https://linuxgsm.com # Description: getopt arguments. -local function_selfname=$(basename "$(readlink -f "${BASH_SOURCE[0]}")") +local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" ### Define all commands here. ## User commands | Trigger commands | Description @@ -15,7 +15,7 @@ cmd_start=( "st;start" "command_start.sh" "Start the server." ) cmd_stop=( "sp;stop" "command_stop.sh" "Stop the server." ) cmd_restart=( "r;restart" "command_restart.sh" "Restart the server." ) cmd_details=( "dt;details" "command_details.sh" "Display server information." ) -cmd_postdetails=( "pd;postdetails" "command_postdetails.sh" "Post details to hastebin (removing passwords)." ) +cmd_postdetails=( "pd;postdetails" "command_postdetails.sh" "Post details to termbin.com (removing passwords)." ) cmd_backup=( "b;backup" "command_backup.sh" "Create backup archives of the server." ) 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." ) @@ -167,14 +167,15 @@ fn_opt_usage(){ fi done } | column -s $'\t' -t + fn_script_log_pass "Display commands" core_exit.sh } -# Check if user commands exist and run corresponding scripts, or display script usage. +# Check if command existw and run corresponding scripts, or display script usage. if [ -z "${getopt}" ]; then fn_opt_usage fi -# Command exists. +# If command exists. for i in "${optcommands[@]}"; do if [ "${i}" == "${getopt}" ] ; then # Seek and run command. @@ -185,8 +186,10 @@ for i in "${optcommands[@]}"; do if [ "$(echo -e "${currentopt[index]}" | awk -F ';' -v x=${currcmdindex} '{ print $x }')" == "${getopt}" ]; then # Run command. eval "${currentopt[index+1]}" + # Exit should occur in modules. Should this not happen print an error + fn_print_error2_nl "Command did not exit correctly: ${getopt}" + fn_script_log_error "Command did not exit correctly: ${getopt}" core_exit.sh - break fi done done @@ -194,7 +197,7 @@ for i in "${optcommands[@]}"; do done # If we're executing this, it means command was not found. -echo -e "${red}Unknown command${default}: $0 ${getopt}" -exitcode=2 +fn_print_error2_nl "Unknown command: $0 ${getopt}" +fn_script_log_error "Unknown command: $0 ${getopt}" fn_opt_usage core_exit.sh diff --git a/lgsm/functions/core_legacy.sh b/lgsm/functions/core_legacy.sh index c3efe7b631..e0ea7f9b33 100644 --- a/lgsm/functions/core_legacy.sh +++ b/lgsm/functions/core_legacy.sh @@ -26,7 +26,7 @@ if [ -z "${lgsmlogdate}" ]; then fi if [ -z "${steamcmddir}" ]; then - steamcmddir="${rootdir}/steamcmd" + steamcmddir="${HOME}/.steam/steamcmd" fi if [ -z "${lgsmdir}" ]; then diff --git a/lgsm/functions/core_messages.sh b/lgsm/functions/core_messages.sh index 71c6eff8ba..59814f62f3 100644 --- a/lgsm/functions/core_messages.sh +++ b/lgsm/functions/core_messages.sh @@ -47,7 +47,7 @@ fn_sleep_time(){ fn_script_log(){ if [ -d "${lgsmlogdir}" ]; then if [ "${modulename}" ]; then - echo -e "$(date '+%b %d %H:%M:%S.%3N') ${selfname}: ${commandname}: ${1}" >> "${lgsmlog}" + echo -e "$(date '+%b %d %H:%M:%S.%3N') ${selfname}: ${modulename}: ${1}" >> "${lgsmlog}" else echo -e "$(date '+%b %d %H:%M:%S.%3N') ${selfname}: ${1}" >> "${lgsmlog}" fi @@ -59,7 +59,7 @@ fn_script_log_pass(){ if [ -d "${lgsmlogdir}" ]; then if [ "${modulename}" ]; then - echo -e "$(date '+%b %d %H:%M:%S.%3N') ${selfname}: ${commandname}: PASS: ${1}" >> "${lgsmlog}" + echo -e "$(date '+%b %d %H:%M:%S.%3N') ${selfname}: ${modulename}: PASS: ${1}" >> "${lgsmlog}" else echo -e "$(date '+%b %d %H:%M:%S.%3N') ${selfname}: PASS: ${1}" >> "${lgsmlog}" fi @@ -71,7 +71,7 @@ fn_script_log_pass(){ fn_script_log_fatal(){ if [ -d "${lgsmlogdir}" ]; then if [ "${modulename}" ]; then - echo -e "$(date '+%b %d %H:%M:%S.%3N') ${selfname}: ${commandname}: FATAL: ${1}" >> "${lgsmlog}" + echo -e "$(date '+%b %d %H:%M:%S.%3N') ${selfname}: ${modulename}: FATAL: ${1}" >> "${lgsmlog}" else echo -e "$(date '+%b %d %H:%M:%S.%3N') ${selfname}: FATAL: ${1}" >> "${lgsmlog}" fi @@ -83,7 +83,7 @@ fn_script_log_fatal(){ fn_script_log_error(){ if [ -d "${lgsmlogdir}" ]; then if [ "${modulename}" ]; then - echo -e "$(date '+%b %d %H:%M:%S.%3N') ${selfname}: ${commandname}: ERROR: ${1}" >> "${lgsmlog}" + echo -e "$(date '+%b %d %H:%M:%S.%3N') ${selfname}: ${modulename}: ERROR: ${1}" >> "${lgsmlog}" else echo -e "$(date '+%b %d %H:%M:%S.%3N') ${selfname}: ERROR: ${1}" >> "${lgsmlog}" fi @@ -95,7 +95,7 @@ fn_script_log_error(){ fn_script_log_warn(){ if [ -d "${lgsmlogdir}" ]; then if [ "${modulename}" ]; then - echo -e "$(date '+%b %d %H:%M:%S.%3N') ${selfname}: ${commandname}: WARN: ${1}" >> "${lgsmlog}" + echo -e "$(date '+%b %d %H:%M:%S.%3N') ${selfname}: ${modulename}: WARN: ${1}" >> "${lgsmlog}" else echo -e "$(date '+%b %d %H:%M:%S.%3N') ${selfname}: WARN: ${1}" >> "${lgsmlog}" fi @@ -107,7 +107,7 @@ fn_script_log_warn(){ fn_script_log_info(){ if [ -d "${lgsmlogdir}" ]; then if [ "${modulename}" ]; then - echo -e "$(date '+%b %d %H:%M:%S.%3N') ${selfname}: ${commandname}: INFO: ${1}" >> "${lgsmlog}" + echo -e "$(date '+%b %d %H:%M:%S.%3N') ${selfname}: ${modulename}: INFO: ${1}" >> "${lgsmlog}" else echo -e "$(date '+%b %d %H:%M:%S.%3N') ${selfname}: INFO: ${1}" >> "${lgsmlog}" fi @@ -149,9 +149,9 @@ fn_print_ok(){ fn_print_ok_nl(){ if [ "${commandaction}" ]; then - echo -e "${creeol}[${green} OK ${default}] ${commandaction} ${selfname}: $*" + echo -en "${creeol}[${green} OK ${default}] ${commandaction} ${selfname}: $*" else - echo -e "${creeol}[${green} OK ${default}] $*" + echo -en "${creeol}[${green} OK ${default}] $*" fi fn_sleep_time echo -en "\n" @@ -169,9 +169,9 @@ fn_print_fail(){ fn_print_fail_nl(){ if [ "${commandaction}" ]; then - echo -e "${creeol}[${red} FAIL ${default}] ${commandaction} ${selfname}: $*" + echo -en "${creeol}[${red} FAIL ${default}] ${commandaction} ${selfname}: $*" else - echo -e "${creeol}[${red} FAIL ${default}] $*" + echo -en "${creeol}[${red} FAIL ${default}] $*" fi fn_sleep_time echo -en "\n" @@ -180,18 +180,18 @@ fn_print_fail_nl(){ # [ ERROR ] fn_print_error(){ if [ "${commandaction}" ]; then - echo -en "${creeol}[${red}ERROR ${default}] ${commandaction} ${selfname}: $*" + echo -en "${creeol}[${red} ERROR ${default}] ${commandaction} ${selfname}: $*" else - echo -en "${creeol}[${red}ERROR ${default}] $*" + echo -en "${creeol}[${red} ERROR ${default}] $*" fi fn_sleep_time } fn_print_error_nl(){ if [ "${commandaction}" ]; then - echo -e "${creeol}[${red}ERROR ${default}] ${commandaction} ${selfname}: $*" + echo -en "${creeol}[${red} ERROR ${default}] ${commandaction} ${selfname}: $*" else - echo -e "${creeol}[${red}ERROR ${default}] $*" + echo -en "${creeol}[${red} ERROR ${default}] $*" fi fn_sleep_time echo -en "\n" @@ -209,9 +209,9 @@ fn_print_warn(){ fn_print_warn_nl(){ if [ "${commandaction}" ]; then - echo -e "${creeol}[${lightyellow} WARN ${default}] ${commandaction} ${selfname}: $*" + echo -en "${creeol}[${lightyellow} WARN ${default}] ${commandaction} ${selfname}: $*" else - echo -e "${creeol}[${lightyellow} WARN ${default}] $*" + echo -en "${creeol}[${lightyellow} WARN ${default}] $*" fi fn_sleep_time echo -en "\n" @@ -229,9 +229,29 @@ fn_print_info(){ fn_print_info_nl(){ if [ "${commandaction}" ]; then - echo -e "${creeol}[${cyan} INFO ${default}] ${commandaction} ${selfname}: $*" + echo -en "${creeol}[${cyan} INFO ${default}] ${commandaction} ${selfname}: $*" + else + echo -en "${creeol}[${cyan} INFO ${default}] $*" + fi + fn_sleep_time + echo -en "\n" +} + +# [ START ] +fn_print_start(){ + if [ "${commandaction}" ]; then + echo -en "${creeol}[${lightgreen} START ${default}] ${commandaction} ${selfname}: $*" + else + echo -en "${creeol}[${lightgreen} START ${default}] $*" + fi + fn_sleep_time +} + +fn_print_start_nl(){ + if [ "${commandaction}" ]; then + echo -en "${creeol}[${lightgreen} START ${default}] ${commandaction} ${selfname}: $*" else - echo -e "${creeol}[${cyan} INFO ${default}] $*" + echo -en "${creeol}[${lightgreen} START ${default}] $*" fi fn_sleep_time echo -en "\n" diff --git a/lgsm/functions/fix.sh b/lgsm/functions/fix.sh index 7533590de4..b5c278847c 100644 --- a/lgsm/functions/fix.sh +++ b/lgsm/functions/fix.sh @@ -17,7 +17,7 @@ fn_fix_msg_start(){ fn_fix_msg_start_nl(){ fn_print_dots "Applying ${fixname} fix: ${gamename}" - fn_print_info_nl "Applying ${fixname} fix: ${gamename}" + fn_print_info "Applying ${fixname} fix: ${gamename}" fn_script_log_info "Applying ${fixname} fix: ${gamename}" } @@ -47,6 +47,8 @@ if [ "${function_selfname}" != "command_install.sh" ]&&[ -z "${fixbypass}" ]; th fix_dst.sh elif [ "${shortname}" == "ges" ]; then fix_ges.sh + elif [ "${shortname}" == "hw" ]; then + fix_hw.sh elif [ "${shortname}" == "ins" ]; then fix_ins.sh elif [ "${shortname}" == "nmrih" ]; then @@ -71,6 +73,8 @@ if [ "${function_selfname}" != "command_install.sh" ]&&[ -z "${fixbypass}" ]; th fix_terraria.sh elif [ "${shortname}" == "ts3" ]; then fix_ts3.sh + elif [ "${shortname}" == "tu" ]; then + fix_tu.sh elif [ "${shortname}" == "mcb" ]; then fix_mcb.sh elif [ "${shortname}" == "mta" ]; then @@ -86,12 +90,15 @@ fi # Fixes that are run on install only. if [ "${function_selfname}" == "command_install.sh" ]; then - if [ "${shortname}" == "kf" ]||[ "${shortname}" == "kf2" ]||[ "${shortname}" == "ro" ]||[ "${shortname}" == "ut2k4" ]||[ "${shortname}" == "ut" ]||[ "${shortname}" == "ut3" ]; then + if [ "${shortname}" == "av" ]||[ "${shortname}" == "kf" ]||[ "${shortname}" == "kf2" ]||[ "${shortname}" == "onset" ]||[ "${shortname}" == "ro" ]||[ "${shortname}" == "ut2k4" ]||[ "${shortname}" == "ut" ]||[ "${shortname}" == "ut3" ]; then echo -e "" echo -e "Applying Post-Install Fixes" echo -e "=================================" fn_sleep_time - if [ "${shortname}" == "kf" ]; then + postinstall=1 + if [ "${shortname}" == "av" ]; then + fix_av.sh + elif [ "${shortname}" == "kf" ]; then fix_kf.sh elif [ "${shortname}" == "kf2" ]; then fix_kf2.sh diff --git a/lgsm/functions/fix_arma3.sh b/lgsm/functions/fix_arma3.sh index de9785e511..60dd4db252 100644 --- a/lgsm/functions/fix_arma3.sh +++ b/lgsm/functions/fix_arma3.sh @@ -6,12 +6,12 @@ local modulename="FIX" local commandaction="Fix" -local function_selfname=$(basename "$(readlink -f "${BASH_SOURCE[0]}")") +local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" # Fixes: 20150 Segmentation fault (core dumped) error. -if [ ! -d "${HOME}/.local/share/Arma 3" ]||[ ! -d "${HOME}/.local/share/Arma 3 - Other Profiles" ]; then +if [ ! -d "${XDG_DATA_HOME:="${HOME}/.local/share"}/Arma 3" ]||[ ! -d "${XDG_DATA_HOME:="${HOME}/.local/share"}/Arma 3 - Other Profiles" ]; then fixname="20150 Segmentation fault (core dumped)" fn_fix_msg_start - mkdir -p "${HOME}/.local/share/Arma 3 - Other Profiles" + mkdir -p "${XDG_DATA_HOME:="${HOME}/.local/share"}/Arma 3 - Other Profiles" fn_fix_msg_end fi diff --git a/lgsm/functions/fix_av.sh b/lgsm/functions/fix_av.sh new file mode 100644 index 0000000000..fcbab6b136 --- /dev/null +++ b/lgsm/functions/fix_av.sh @@ -0,0 +1,23 @@ +#!/bin/bash +# LinuxGSM fix_av.sh function +# Author: Christian Birk +# Website: https://linuxgsm.com +# Description: Resolves startup issue with Avorion + +local commandname="FIX" +local commandaction="Fix" + +export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${serverfiles}:${serverfiles}/linux64" + +if [ "${postinstall}" == "1" ]; then + fn_parms(){ + parms="--datapath ${avdatapath} --galaxy-name ${avgalaxy} --init-folders-only" + } + + fn_print_information "starting ${gamename} server to generate configs." + fn_sleep_time + # go to the executeable dir and start the init of the server + cd "${systemdir}" || return 2 + fn_parms + "${executabledir}/${executable}" ${parms} +fi diff --git a/lgsm/functions/fix_csgo.sh b/lgsm/functions/fix_csgo.sh index 0ea098eede..f1f9c92414 100644 --- a/lgsm/functions/fix_csgo.sh +++ b/lgsm/functions/fix_csgo.sh @@ -6,7 +6,7 @@ local modulename="FIX" local commandaction="Fix" -local function_selfname=$(basename "$(readlink -f "${BASH_SOURCE[0]}")") +local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" # Fixes: server not always creating steam_appid.txt file. if [ ! -f "${serverfiles}/steam_appid.txt" ]; then diff --git a/lgsm/functions/fix_dst.sh b/lgsm/functions/fix_dst.sh index 46c17756b0..ca86bdd4f3 100644 --- a/lgsm/functions/fix_dst.sh +++ b/lgsm/functions/fix_dst.sh @@ -6,7 +6,7 @@ local modulename="FIX" local commandaction="Fix" -local function_selfname=$(basename "$(readlink -f "${BASH_SOURCE[0]}")") +local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" # Fixes: ./dontstarve_dedicated_server_nullrenderer: ./lib32/libcurl-gnutls.so.4: no version information available (required by ./dontstarve_dedicated_server_nullrenderer). # Issue only occures on CentOS as libcurl-gnutls.so.4 is called libcurl.so.4 on CentOS. diff --git a/lgsm/functions/fix_hw.sh b/lgsm/functions/fix_hw.sh new file mode 100644 index 0000000000..8b5844f52c --- /dev/null +++ b/lgsm/functions/fix_hw.sh @@ -0,0 +1,33 @@ +#!/bin/bash +# LinuxGSM fix_hw.sh function +# Author: Daniel Gibbs +# Website: https://linuxgsm.com +# Description: Resolves various issues with Hurtworld. + +if [ "${shortname}" == "hw" ]; then + # Fixes: [S_API FAIL] SteamAPI_Init() failed; unable to locate a running instance of Steam, or a local steamclient.so. + if [ ! -f "${serverfiles}/Hurtworld_Data/Plugins/x86/steamclient.so" ]; then + fixname="steamclient.so x86" + fn_fix_msg_start + if [ -f "${HOME}/.steam/steamcmd/linux32/steamclient.so" ]; then + cp -v "${HOME}/.steam/steamcmd/linux32/steamclient.so" "${serverfiles}/Hurtworld_Data/Plugins/x86/steamclient.so" >> "${lgsmlog}" + elif [ -f "${steamcmddir}/linux32/steamclient.so" ]; then + cp -v "${steamcmddir}/linux32/steamclient.so" "${serverfiles}/Hurtworld_Data/Plugins/x86/steamclient.so" >> "${lgsmlog}" + else + : + fi + fn_fix_msg_end + fi + if [ ! -f "${serverfiles}/Hurtworld_Data/Plugins/x86_64/steamclient.so" ]; then + fixname="steamclient.so x86_64" + fn_fix_msg_start + if [ -f "${HOME}/.steam/steamcmd/linux64/steamclient.so" ]; then + cp -v "${HOME}/.steam/steamcmd/linux64/steamclient.so" "${serverfiles}/Hurtworld_Data/Plugins/x86_64/steamclient.so" >> "${lgsmlog}" + elif [ -f "${steamcmddir}/linux64/steamclient.so" ]; then + cp -v "${steamcmddir}/linux64/steamclient.so" "${serverfiles}/Hurtworld_Data/Plugins/x86_64/steamclient.so" >> "${lgsmlog}" + else + : + fi + fn_fix_msg_end + fi +fi diff --git a/lgsm/functions/fix_kf.sh b/lgsm/functions/fix_kf.sh index 0ce05184bf..f1b6d7b891 100644 --- a/lgsm/functions/fix_kf.sh +++ b/lgsm/functions/fix_kf.sh @@ -6,7 +6,7 @@ local modulename="FIX" local commandaction="Fix" -local function_selfname=$(basename "$(readlink -f "${BASH_SOURCE[0]}")") +local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" echo -e "Applying WebAdmin ROOst.css fix." echo -e "http://forums.tripwireinteractive.com/showpost.php?p=585435&postcount=13" diff --git a/lgsm/functions/fix_kf2.sh b/lgsm/functions/fix_kf2.sh index 7cc1be568a..2e54f11337 100644 --- a/lgsm/functions/fix_kf2.sh +++ b/lgsm/functions/fix_kf2.sh @@ -6,7 +6,7 @@ local modulename="FIX" local commandaction="Fix" -local function_selfname=$(basename "$(readlink -f "${BASH_SOURCE[0]}")") +local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_parms(){ parms="\"${defaultmap}?Game=KFGameContent.KFGameInfo_VersusSurvival\"" diff --git a/lgsm/functions/fix_mcb.sh b/lgsm/functions/fix_mcb.sh index 5352fdee88..c417a8a39f 100644 --- a/lgsm/functions/fix_mcb.sh +++ b/lgsm/functions/fix_mcb.sh @@ -2,7 +2,7 @@ # LinuxGSM fix_mcb.sh function # Author: Daniel Gibbs # Website: https://linuxgsm.com -# Description: Resolves possible startup issue with Minecraft Bedrock +# Description: Resolves possible startup issue with Minecraft Bedrock. local modulename="FIX" local commandaction="Fix" diff --git a/lgsm/functions/fix_mta.sh b/lgsm/functions/fix_mta.sh index 236a2336b2..662a1df00f 100644 --- a/lgsm/functions/fix_mta.sh +++ b/lgsm/functions/fix_mta.sh @@ -3,10 +3,11 @@ # Author: Daniel Gibbs # Contributor: ChaosMTA # Website: https://linuxgsm.com -# Description: Installs the libmysqlclient for database functions on the server -local commandname="FIX" +# Description: Installs the libmysqlclient for database functions on the server. + +local modulename="FIX" local commandaction="Fix" -local function_selfname=$(basename "$(readlink -f "${BASH_SOURCE[0]}")") +local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" if [ ! -f "${lgsmdir}/lib/libmysqlclient.so.16" ]; then fixname="libmysqlclient16" diff --git a/lgsm/functions/fix_nmrih.sh b/lgsm/functions/fix_nmrih.sh index 8dd5f592c6..62ba20c216 100644 --- a/lgsm/functions/fix_nmrih.sh +++ b/lgsm/functions/fix_nmrih.sh @@ -1,13 +1,16 @@ #!/bin/bash # LinuxGSM fix_nmrih.sh function # Author: Denperidge -# Description: Create symlinks for renamed No More Room In Hell serverfiles +# Description: Create symlinks for renamed No More Room In Hell serverfiles. # Solution from Steam Community post: https://steamcommunity.com/app/224260/discussions/2/1732089092441769414/ +local modulename="FIX" +local commandaction="Fix" + ln -s "${serverfiles}/bin/vphysics_srv.so" "${serverfiles}/bin/vphysics.so" ln -s "${serverfiles}/bin/studiorender_srv.so" "${serverfiles}/bin/studiorender.so" ln -s "${serverfiles}/bin/soundemittersystem_srv.so" "${serverfiles}/bin/soundemittersystem.so" ln -s "${serverfiles}/bin/shaderapiempty_srv.so" "${serverfiles}/bin/shaderapiempty.so" ln -s "${serverfiles}/bin/scenefilecache_srv.so" "${serverfiles}/bin/scenefilecache.so" ln -s "${serverfiles}/bin/replay_srv.so" "${serverfiles}/bin/replay.so" -ln -s "${serverfiles}/bin/materialsystem_srv.so" "${serverfiles}/bin/materialsystem.so" \ No newline at end of file +ln -s "${serverfiles}/bin/materialsystem_srv.so" "${serverfiles}/bin/materialsystem.so" diff --git a/lgsm/functions/fix_onset.sh b/lgsm/functions/fix_onset.sh index 299e448fa9..59f7783edb 100644 --- a/lgsm/functions/fix_onset.sh +++ b/lgsm/functions/fix_onset.sh @@ -2,11 +2,11 @@ # LinuxGSM fix_onset.sh function # Author: Frédéric C. # Website: https://linuxgsm.com -# Description: Resolves various issues with Onset +# Description: Resolves various issues with Onset. local modulename="FIX" local commandaction="Fix" -local function_selfname=$(basename "$(readlink -f "${BASH_SOURCE[0]}")") +local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${serverfiles}" diff --git a/lgsm/functions/fix_ro.sh b/lgsm/functions/fix_ro.sh index e7ced52ad0..f07581ae20 100644 --- a/lgsm/functions/fix_ro.sh +++ b/lgsm/functions/fix_ro.sh @@ -6,7 +6,7 @@ local modulename="FIX" local commandaction="Fix" -local function_selfname=$(basename "$(readlink -f "${BASH_SOURCE[0]}")") +local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" echo -e "Applying WebAdmin ROOst.css fix." echo -e "http://forums.tripwireinteractive.com/showpost.php?p=585435&postcount=13" diff --git a/lgsm/functions/fix_rust.sh b/lgsm/functions/fix_rust.sh index bb70724dbc..29f2299c67 100644 --- a/lgsm/functions/fix_rust.sh +++ b/lgsm/functions/fix_rust.sh @@ -2,7 +2,7 @@ # LinuxGSM fix_rust.sh function # Author: Daniel Gibbs # Website: https://linuxgsm.com -# Description: Resolves startup issue with Rust +# Description: Resolves startup issue with Rust. local modulename="FIX" local commandaction="Fix" diff --git a/lgsm/functions/fix_rw.sh b/lgsm/functions/fix_rw.sh index 73cafcf2e2..650d3b2317 100644 --- a/lgsm/functions/fix_rw.sh +++ b/lgsm/functions/fix_rw.sh @@ -2,7 +2,7 @@ # LinuxGSM fix_rw.sh function # Author: Daniel Gibbs # Website: https://linuxgsm.com -# Description: Resolves startup issue with Rising World +# Description: Resolves various issues with Rising World. local modulename="FIX" local commandaction="Fix" diff --git a/lgsm/functions/fix_sdtd.sh b/lgsm/functions/fix_sdtd.sh index 005fb8f6cd..acb1d9891f 100644 --- a/lgsm/functions/fix_sdtd.sh +++ b/lgsm/functions/fix_sdtd.sh @@ -2,7 +2,7 @@ # LinuxGSM fix_sdtd.sh function # Author: Daniel Gibbs # Website: https://linuxgsm.com -# Description: Resolves startup issue with 7 Days to Die +# Description: Resolves various issues with 7 Days to Die. local modulename="FIX" local commandaction="Fix" diff --git a/lgsm/functions/fix_sfc.sh b/lgsm/functions/fix_sfc.sh index ce42211fbc..f749847532 100644 --- a/lgsm/functions/fix_sfc.sh +++ b/lgsm/functions/fix_sfc.sh @@ -6,7 +6,7 @@ local modulename="FIX" local commandaction="Fix" -local function_selfname=$(basename "$(readlink -f "${BASH_SOURCE[0]}")") +local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" if [ ! -f "${serverfiles}/bin/datacache.so" ]; then ln -s "${serverfiles}/bin/datacache_srv.so" "${serverfiles}/bin/datacache.so" diff --git a/lgsm/functions/fix_sof2.sh b/lgsm/functions/fix_sof2.sh index 11af88522a..cdffa6c7fb 100644 --- a/lgsm/functions/fix_sof2.sh +++ b/lgsm/functions/fix_sof2.sh @@ -2,7 +2,7 @@ # LinuxGSM fix_rust.sh function # Author: Daniel Gibbs # Website: https://linuxgsm.com -# Description: Resolves startup issue with Soldier of Fortune 2 +# Description: Resolves various issues with Soldier of Fortune 2. local modulename="FIX" local commandaction="Fix" diff --git a/lgsm/functions/fix_ss3.sh b/lgsm/functions/fix_ss3.sh index 1c81f87aec..1a5b22d7f5 100644 --- a/lgsm/functions/fix_ss3.sh +++ b/lgsm/functions/fix_ss3.sh @@ -6,12 +6,21 @@ local modulename="FIX" local commandaction="Fix" -local function_selfname=$(basename "$(readlink -f "${BASH_SOURCE[0]}")") +local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" -# Fixes https://steamcommunity.com/app/41070/discussions/0/353916981477716386/ -if [ "$(diff "${HOME}/.steam/steamcmd/linux32/steamclient.so" "${serverfiles}/Bin/steamclient.so" >/dev/null)" ]; then +# Fixes: https://steamcommunity.com/app/41070/discussions/0/353916981477716386/ +if [ ! -f "${serverfiles}/Bin/steamclient.so" ]||[ "$(diff "${HOME}/.steam/steamcmd/linux32/steamclient.so" "${serverfiles}/Bin/steamclient.so" 2>/dev/null)" ]; then fixname="steamclient.so" fn_fix_msg_start cp -f "${HOME}/.steam/steamcmd/linux32/steamclient.so" "${serverfiles}/Bin/steamclient.so" fn_fix_msg_end fi + +# Fixes: .steam/bin32/libsteam.so: cannot open shared object file: No such file or directory +if [ ! -f "${HOME}/.steam/bin32/libsteam.so" ]; then + fixname="libsteam.so" + fn_fix_msg_start + mkdir -pv "${HOME}/.steam/bin32" >> "${lgsmlog}" + cp "${serverfiles}/Bin/libsteam.so" "${HOME}/.steam/bin32/libsteam.so" >> "${lgsmlog}" + fn_fix_msg_end +fi diff --git a/lgsm/functions/fix_steamcmd.sh b/lgsm/functions/fix_steamcmd.sh index 3f4907d150..aba06461c9 100644 --- a/lgsm/functions/fix_steamcmd.sh +++ b/lgsm/functions/fix_steamcmd.sh @@ -6,11 +6,26 @@ local modulename="FIX" local commandaction="Fix" -function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" +local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" -# Fixes: [S_API FAIL] SteamAPI_Init() failed; unable to locate a running instance of Steam,or a local steamclient.so. +# Helps fix: [S_API FAIL] SteamAPI_Init() failed; unable to locate a running instance of Steam,or a local steamclient.so. +if [ ! -f "${HOME}/.steam/sdk64/steamclient.so" ]; then + fixname="steamclient.so sdk64" + fn_fix_msg_start + mkdir -pv "${HOME}/.steam/sdk64" >> "${lgsmlog}" + if [ -f "${HOME}/.steam/steamcmd/linux64/steamclient.so" ]; then + cp -v "${HOME}/.steam/steamcmd/linux64/steamclient.so" "${HOME}/.steam/sdk64/steamclient.so" >> "${lgsmlog}" + elif [ -f "${steamcmddir}/linux64/steamclient.so" ]; then + cp -v "${steamcmddir}/linux64/steamclient.so" "${HOME}/.steam/sdk64/steamclient.so" >> "${lgsmlog}" + else + $?=2 + fi + fn_fix_msg_end +fi + +# Helps fix: [S_API FAIL] SteamAPI_Init() failed; unable to locate a running instance of Steam,or a local steamclient.so. if [ ! -f "${HOME}/.steam/sdk32/steamclient.so" ]; then - fixname="steamclient.so" + fixname="steamclient.so sdk32" fn_fix_msg_start mkdir -pv "${HOME}/.steam/sdk32" >> "${lgsmlog}" if [ -f "${HOME}/.steam/steamcmd/linux32/steamclient.so" ]; then @@ -22,62 +37,3 @@ if [ ! -f "${HOME}/.steam/sdk32/steamclient.so" ]; then fi fn_fix_msg_end fi - -if [ "${shortname}" == "bt" ]; then - # Fixes: [S_API FAIL] SteamAPI_Init() failed; SteamAPI_IsSteamRunning() failed. - if [ ! -L "${executabledir}/lib64/steamclient.so" ]; then - fixname="steamclient.so x86_64" - fn_fix_msg_start - if [ -f "${HOME}/.steam/steamcmd/linux64/steamclient.so" ]; then - cp -v "${HOME}/.steam/steamcmd/linux64/steamclient.so" "${executabledir}/lib64/steamclient.so" >> "${lgsmlog}" - elif [ -f "${steamcmddir}/linux64/steamclient.so" ]; then - cp -v "${steamcmddir}/linux64/steamclient.so" "${executabledir}/lib64/steamclient.so" >> "${lgsmlog}" - else - $?=2 - fi - fn_fix_msg_end - fi -elif [ "${shortname}" == "ss3" ]; then - # Fixes: .steam/bin32/libsteam.so: cannot open shared object file: No such file or directory - if [ ! -f "${HOME}/.steam/bin32/libsteam.so" ]; then - fixname="libsteam.so" - fn_fix_msg_start - mkdir -pv "${HOME}/.steam/bin32" >> "${lgsmlog}" - cp "${serverfiles}/Bin/libsteam.so" "${HOME}/.steam/bin32/libsteam.so" >> "${lgsmlog}" - fn_fix_msg_end - fi -elif [ "${shortname}" == "hw" ]; then - # Fixes: [S_API FAIL] SteamAPI_Init() failed; unable to locate a running instance of Steam, or a local steamclient.so. - if [ ! -f "${serverfiles}/Hurtworld_Data/Plugins/x86/steamclient.so" ]; then - fixname="steamclient.so x86" - fn_fix_msg_start - if [ -f "${HOME}/.steam/steamcmd/linux32/steamclient.so" ]; then - cp -v "${HOME}/.steam/steamcmd/linux32/steamclient.so" "${serverfiles}/Hurtworld_Data/Plugins/x86/steamclient.so" >> "${lgsmlog}" - elif [ -f "${steamcmddir}/linux32/steamclient.so" ]; then - cp -v "${steamcmddir}/linux32/steamclient.so" "${serverfiles}/Hurtworld_Data/Plugins/x86/steamclient.so" >> "${lgsmlog}" - else - : - fi - fn_fix_msg_end - fi - if [ ! -f "${serverfiles}/Hurtworld_Data/Plugins/x86_64/steamclient.so" ]; then - fixname="steamclient.so x86_64" - fn_fix_msg_start - if [ -f "${HOME}/.steam/steamcmd/linux64/steamclient.so" ]; then - cp -v "${HOME}/.steam/steamcmd/linux64/steamclient.so" "${serverfiles}/Hurtworld_Data/Plugins/x86_64/steamclient.so" >> "${lgsmlog}" - elif [ -f "${steamcmddir}/linux64/steamclient.so" ]; then - cp -v "${steamcmddir}/linux64/steamclient.so" "${serverfiles}/Hurtworld_Data/Plugins/x86_64/steamclient.so" >> "${lgsmlog}" - else - : - fi - fn_fix_msg_end - fi -elif [ "${shortname}" == "tu" ]; then - # Fixes: [S_API FAIL] SteamAPI_Init() failed; unable to locate a running instance of Steam, or a local steamclient.so. - if [ ! -f "${executabledir}/steamclient.so" ]; then - fixname="steamclient.so" - fn_fix_msg_start - cp -v "${serverfiles}/linux64/steamclient.so" "${executabledir}/steamclient.so" >> "${lgsmlog}" - fn_fix_msg_end - fi -fi diff --git a/lgsm/functions/fix_terraria.sh b/lgsm/functions/fix_terraria.sh index 8d9af09474..bce7d44f8f 100644 --- a/lgsm/functions/fix_terraria.sh +++ b/lgsm/functions/fix_terraria.sh @@ -6,6 +6,6 @@ local modulename="FIX" local commandaction="Fix" -local function_selfname=$(basename "$(readlink -f "${BASH_SOURCE[0]}")") +local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" export TERM=xterm diff --git a/lgsm/functions/fix_tf2.sh b/lgsm/functions/fix_tf2.sh index b0e9ce1ce8..72c5b53ab9 100644 --- a/lgsm/functions/fix_tf2.sh +++ b/lgsm/functions/fix_tf2.sh @@ -6,7 +6,7 @@ local modulename="FIX" local commandaction="Fix" -local function_selfname=$(basename "$(readlink -f "${BASH_SOURCE[0]}")") +local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" # Fixes: Team Fortress 2 Segmentation fault for Red-Hat Distros #2062. if [ -f "/etc/redhat-release" ]&&[ ! -f "${serverfiles}/bin/libcurl-gnutls.so.4" ]; then diff --git a/lgsm/functions/fix_ts3.sh b/lgsm/functions/fix_ts3.sh index 2a921d91dd..5b4c010c7c 100644 --- a/lgsm/functions/fix_ts3.sh +++ b/lgsm/functions/fix_ts3.sh @@ -6,7 +6,7 @@ local modulename="FIX" local commandaction="Fix" -local function_selfname=$(basename "$(readlink -f "${BASH_SOURCE[0]}")") +local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" # Fixes: makes libmariadb2 available #1924. if [ ! -f "${serverfiles}/libmariadb.so.2" ]; then diff --git a/lgsm/functions/fix_tu.sh b/lgsm/functions/fix_tu.sh new file mode 100644 index 0000000000..24bae047a3 --- /dev/null +++ b/lgsm/functions/fix_tu.sh @@ -0,0 +1,15 @@ +#!/bin/bash +# LinuxGSM fix_tu.sh function +# Author: Daniel Gibbs +# Website: https://linuxgsm.com +# Description: Resolves various issues with Tower Unite. + +if [ "${shortname}" == "tu" ]; then + # Fixes: [S_API FAIL] SteamAPI_Init() failed; unable to locate a running instance of Steam, or a local steamclient.so. + if [ ! -f "${executabledir}/steamclient.so" ]; then + fixname="steamclient.so" + fn_fix_msg_start + cp -v "${serverfiles}/linux64/steamclient.so" "${executabledir}/steamclient.so" >> "${lgsmlog}" + fn_fix_msg_end + fi +fi diff --git a/lgsm/functions/fix_unt.sh b/lgsm/functions/fix_unt.sh index 2c27e2f31c..f55be43a98 100644 --- a/lgsm/functions/fix_unt.sh +++ b/lgsm/functions/fix_unt.sh @@ -2,7 +2,7 @@ # LinuxGSM fix_rust.sh function # Author: Daniel Gibbs # Website: https://linuxgsm.com -# Description: Resolves startup issue with Unturned +# Description: Resolves startup issue with Unturned. local modulename="FIX" local commandaction="Fix" diff --git a/lgsm/functions/fix_ut.sh b/lgsm/functions/fix_ut.sh index 7c8c124584..e3e004be46 100644 --- a/lgsm/functions/fix_ut.sh +++ b/lgsm/functions/fix_ut.sh @@ -6,7 +6,7 @@ local modulename="FIX" local commandaction="Fix" -local function_selfname=$(basename "$(readlink -f "${BASH_SOURCE[0]}")") +local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" #Set Binary Executable echo -e "chmod +x ${executabledir}/${executable}" diff --git a/lgsm/functions/fix_ut2k4.sh b/lgsm/functions/fix_ut2k4.sh index 70ed0465d1..8dfb334324 100644 --- a/lgsm/functions/fix_ut2k4.sh +++ b/lgsm/functions/fix_ut2k4.sh @@ -6,7 +6,7 @@ local modulename="FIX" local commandaction="Fix" -local function_selfname=$(basename "$(readlink -f "${BASH_SOURCE[0]}")") +local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" echo -e "applying WebAdmin ut2003.css fix." echo -e "http://forums.tripwireinteractive.com/showpost.php?p=585435&postcount=13" diff --git a/lgsm/functions/fix_ut3.sh b/lgsm/functions/fix_ut3.sh index 3b5537d67b..4c099294fd 100644 --- a/lgsm/functions/fix_ut3.sh +++ b/lgsm/functions/fix_ut3.sh @@ -2,11 +2,11 @@ # LinuxGSM fix_ut2.sh function # Author: Daniel Gibbs # Website: https://linuxgsm.com -# Description: Resolves various issues with configs in Unreal Tournament 3. +# Description: Resolves various issues with Unreal Tournament 3. local modulename="FIX" local commandaction="Fix" -local function_selfname=$(basename "$(readlink -f "${BASH_SOURCE[0]}")") +local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_parms(){ parms="server VCTF-Suspense?Game=UTGameContent.UTVehicleCTFGame_Content?bIsDedicated=true?bIsLanMatch=false?bUsesStats=false?bShouldAdvertise=false?PureServer=1?bAllowJoinInProgress=true?ConfigSubDir=${selfname} -port=${port} -queryport=${queryport} -multihome=${ip} -nohomedir -unattended -log=${gamelog}" diff --git a/lgsm/functions/fix_wurm.sh b/lgsm/functions/fix_wurm.sh index 756636cacd..79babb65e6 100644 --- a/lgsm/functions/fix_wurm.sh +++ b/lgsm/functions/fix_wurm.sh @@ -2,7 +2,10 @@ # LinuxGSM fix_wurm.sh function # Author: Daniel Gibbs # Website: https://linuxgsm.com -# Description: Resolves various issues with ARK: Survival Evolved. +# Description: Resolves various issues with Wurm Unlimited. + +local modulename="FIX" +local commandaction="Fix" # Copies steamclient.so to correct location. if [ ! -f "${serverfiles}/nativelibs" ]; then diff --git a/lgsm/functions/fix_zmr.sh b/lgsm/functions/fix_zmr.sh index 25deec45fd..dade0ee1d1 100644 --- a/lgsm/functions/fix_zmr.sh +++ b/lgsm/functions/fix_zmr.sh @@ -6,7 +6,7 @@ local modulename="FIX" local commandaction="Fix" -local function_selfname=$(basename "$(readlink -f "${BASH_SOURCE[0]}")") +local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" if [ ! -f "${serverfiles}/bin/datacache.so" ]; then ln -s "${serverfiles}/bin/datacache_srv.so" "${serverfiles}/bin/datacache.so" diff --git a/lgsm/functions/info_config.sh b/lgsm/functions/info_config.sh index 9618d60c6d..2a73917390 100644 --- a/lgsm/functions/info_config.sh +++ b/lgsm/functions/info_config.sh @@ -5,7 +5,7 @@ # Website: https://linuxgsm.com # Description: Gets specific details from config files. -local function_selfname=$(basename "$(readlink -f "${BASH_SOURCE[0]}")") +local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" ## Examples of filtering to get info from config files. # sed 's/foo//g' - remove foo @@ -14,6 +14,31 @@ local function_selfname=$(basename "$(readlink -f "${BASH_SOURCE[0]}")") # grep -v "foo" filter out lines that contain foo # cut -f1 -d "/" remove everything after / + +fn_info_config_assettocorsa(){ + if [ ! -f "${servercfgfullpath}" ]; then + httpport="${zero}" + port="${zero}" + queryport="${zero}" + servername="${unavailable}" + adminpassword="${unavailable}" + else + httpport=$(grep "HTTP_PORT" "${servercfgfullpath}" | tr -cd '[:digit:]') + port=$(grep "TCP_PORT" "${servercfgfullpath}" | tr -cd '[:digit:]') + queryport="${port}" + servername=$(grep "NAME" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/NAME//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//'| head -n 1) + adminpassword=$(grep "ADMIN_PASSWORD" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/ADMIN_PASSWORD//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + + # Not Set + httpport=${httpport:-"0"} + port=${port:-"0"} + queryport=${queryport:-"0"} + servername=${servername:-"NOT SET"} + adminpassword=${adminpassword:-"NOT SET"} + + fi +} + fn_info_config_justcause2(){ if [ ! -f "${servercfgfullpath}" ]; then servername="${unavailable}" @@ -392,7 +417,7 @@ fn_info_config_minecraft_bedrock(){ maxplayers="${zero}" port="${zero}" port6="${zero}" - queryport="${zero}" + queryport="${zero}" gamemode="${unavailable}" gameworld="${unavailable}" else @@ -400,7 +425,7 @@ fn_info_config_minecraft_bedrock(){ maxplayers=$(grep "max-players" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') port=$(grep "server-port\b" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') port6=$(grep "server-portv6\b" "${servercfgfullpath}" | sed 's/v6//g' | grep -v "#" | tr -cd '[:digit:]') - queryport=${port} + queryport=${port} gamemode=$(grep "gamemode" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/gamemode//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') gameworld=$(grep "level-name" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/level-name//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') @@ -409,7 +434,7 @@ fn_info_config_minecraft_bedrock(){ maxplayers=${maxplayers:-"NOT SET"} port=${port:-"NOT SET"} port6=${port6:-"NOT SET"} - queryport=${queryport:-"NOT SET"} + queryport=${queryport:-"NOT SET"} gamemode=${gamemode:-"NOT SET"} gameworld=${gameworld:-"NOT SET"} fi @@ -434,7 +459,7 @@ fn_info_config_onset(){ maxplayers=${maxplayers:-"NOT SET"} port=${port:-"NOT SET"} httpport=${httpport:-"NOT SET"} - queryport=${queryport:-"NOT SET"} + queryport=${queryport:-"NOT SET"} fi } @@ -826,7 +851,7 @@ fn_info_config_teamspeak3(){ queryport=$(grep "query_port" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') fileport=$(grep "filetransfer_port" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]') - ip=$(grep "voice_ip" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/voice_ip//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') + ip=$(grep "voice_ip" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/voice_ip//g' | sed 's/,.*//' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//') ipsetinconfig=1 ipinconfigvar="voice_ip" @@ -1053,7 +1078,7 @@ fn_info_config_ut(){ # Not set servername=${servername:-"NOT SET"} - fi + fi } fn_info_config_warfork(){ @@ -1348,21 +1373,73 @@ fn_info_config_mordhau(){ fi } -fn_info_config_soldat(){ + +fn_info_config_avorion() { if [ ! -f "${servercfgfullpath}" ]; then + maxplayers="${unavailable}" servername="${unavailable}" serverpassword="${unavailable}" + rconpassword="${unavailable}" + rconport="${unavailable}" + rconenabled="${unavailable}" + queryport="${unavailable}" + else + maxplayers=$(grep "maxPlayers=" "${servercfgfullpath}" | sed 's/maxPlayers=//') + servername=$(grep "name=" "${servercfgfullpath}" | sed 's/name=//') + serverpassword=$(grep "password=" "${servercfgfullpath}" | sed 's/password=//') + rconpassword=$(grep "rconPassword=" "${servercfgfullpath}" | sed 's/rconPassword=//') + rconport=$(grep "rconPort=" "${servercfgfullpath}" | sed 's/rconPort=//') + if [ -n "${rconpassword}" ]; then + rconenabled="true" + queryport="${rconport}" + fi + + # Not set + maxplayers=${maxplayers:-"NOT SET"} + servername=${servername:-"NOT SET"} + serverpassword=${serverpassword:-"NOT SET"} + rconpassword=${rconpassword:-"NOT SET"} + rconport=${rconport:-"0"} + rconenabled=${rconenabled:-"false"} + queryport=${queryport:-"0"} + fi +} + +fn_info_config_soldat(){ + if [ ! -f "${servercfgfullpath}" ]; then adminpassword="${unavailable}" + maxplayers="${unavailable}" + port="${zero}" + queryport="${zero}" + servername="${unavailable}" + serverpassword="${unavailable}" else - servername=$(grep "Server_Name" "${servercfgfullpath}" | awk -F '=' '{print $2}') - serverpassword=$(grep "Game_Password" "${servercfgfullpath}" | awk -F '=' '{print $2}') - adminpassword=$(grep "Admin_Password" "${servercfgfullpath}" | awk -F '=' '{print $2}') + adminpassword=$(grep "Admin_Password=" "${servercfgfullpath}" | awk -F '=' '{print $2}') + maxplayers=$(grep "Max_Players=" "${servercfgfullpath}" | tr -cd '[:digit:]') + port=$(grep "Port=" "${servercfgfullpath}" | tr -cd '[:digit:]') + queryport="${port}" + servername=$(grep "Server_Name=" "${servercfgfullpath}" | awk -F '=' '{print $2}') + serverpassword=$(grep "Game_Password=" "${servercfgfullpath}" | awk -F '=' '{print $2}') + + # Not set + adminpassword=${adminpassword:-"NOT SET"} + maxplayers=${maxplayers:-"0"} + port=${port:-"23073"} + queryport=${queryport:-"23083"} + servername=${servername:-"NOT SET"} + serverpassword=${serverpassword:-"NOT SET"} fi } +# Assetto Corsa +if [ "${shortname}" == "ac" ]; then + fn_info_config_assettocorsa # ARK: Survival Evolved -if [ "${shortname}" == "ark" ]; then +elif [ "${shortname}" == "ark" ]; then fn_info_config_ark +# Avorion +elif [ "${shortname}" == "av" ]; then + fn_info_config_avorion # Ballistic Overkill elif [ "${shortname}" == "bo" ]; then fn_info_config_ballistic_overkill @@ -1460,7 +1537,7 @@ elif [ "${shortname}" == "sol" ]; then elif [ "${shortname}" == "sof2" ]; then fn_info_config_sof2 # Source Engine Games -elif [ "${engine}" == "source" ]||[ "${engine}" == "goldsource" ]; then +elif [ "${engine}" == "source" ]||[ "${engine}" == "goldsrc" ]; then fn_info_config_source # Starbound elif [ "${shortname}" == "sb" ]; then @@ -1491,7 +1568,7 @@ elif [ "${engine}" == "unreal" ]; then fn_info_config_unreal # Unreal 2 engine elif [ "${engine}" == "unreal2" ]; then - fn_info_config_unreal2 + fn_info_config_unreal2 # Unreal 3 engine elif [ "${engine}" == "unreal3" ]; then fn_info_config_unreal3 diff --git a/lgsm/functions/info_distro.sh b/lgsm/functions/info_distro.sh index d6cfc95f9a..de35150ac5 100644 --- a/lgsm/functions/info_distro.sh +++ b/lgsm/functions/info_distro.sh @@ -5,7 +5,7 @@ # Description: Variables providing useful info on the Operating System such as disk and performace info. # Used for command_details.sh, command_debug.sh and alert.sh. -local function_selfname=$(basename "$(readlink -f "${BASH_SOURCE[0]}")") +local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" ### Game Server pid if [ "${status}" == "1" ]; then @@ -263,9 +263,9 @@ fi if [ "$(command -v jq 2>/dev/null)" ]; then if [ "${ip}" ]&&[ "${port}" ]; then if [ "${steammaster}" == "true" ]; then - masterserver=$(curl -m 3 -s 'https://api.steampowered.com/ISteamApps/GetServersAtAddress/v0001?addr='${ip}':'${port}'&format=json' | jq '.response.servers[]|.addr' | wc -l) + masterserver=$(curl -m 3 -s 'https://api.steampowered.com/ISteamApps/GetServersAtAddress/v0001?addr='${ip}':'${port}'&format=json' | jq '.response.servers[]|.addr' | wc -l 2>/dev/null) if [ "${masterserver}" == "0" ]; then - masterserver=$(curl -m 3 -s 'https://api.steampowered.com/ISteamApps/GetServersAtAddress/v0001?addr='${extip}':'${port}'&format=json' | jq '.response.servers[]|.addr' | wc -l) + masterserver=$(curl -m 3 -s 'https://api.steampowered.com/ISteamApps/GetServersAtAddress/v0001?addr='${extip}':'${port}'&format=json' | jq '.response.servers[]|.addr' | wc -l 2>/dev/null) fi if [ "${masterserver}" == "0" ]; then displaymasterserver="false" diff --git a/lgsm/functions/info_messages.sh b/lgsm/functions/info_messages.sh index 035cc6abeb..07bbaa7f7d 100644 --- a/lgsm/functions/info_messages.sh +++ b/lgsm/functions/info_messages.sh @@ -105,10 +105,10 @@ fn_info_message_server_resource(){ echo -e "" { echo -e "${lightyellow}Network${default}" - if [ "${netint}" ]; then + if [ -n "${netint}" ]; then echo -e "${lightblue}Interface:\t${default}${netint}" fi - if [ "${netlink}" ]; then + if [ -n "${netlink}" ]; then echo -e "${lightblue}Link Speed:\t${default}${netlink}" fi echo -e "${lightblue}IP:\t${default}${ip}" @@ -174,19 +174,19 @@ fn_info_message_gameserver(){ fn_messages_separator { # Server name - if [ "${gdname}" ]; then + if [ -n "${gdname}" ]; then echo -e "${lightblue}Server name:\t${default}${gdname}" - elif [ "${servername}" ]; then + elif [ -n "${servername}" ]; then echo -e "${lightblue}Server name:\t${default}${servername}" fi # Server description - if [ "${serverdescription}" ]; then + if [ -n "${serverdescription}" ]; then echo -e "${lightblue}Server Description:\t${default}${serverdescription}" fi # Branch - if [ "${branch}" ]; then + if [ -n "${branch}" ]; then echo -e "${lightblue}Branch:\t${default}${branch}" fi @@ -198,179 +198,175 @@ fn_info_message_gameserver(){ fi # Internet ip - if [ "${extip}" ]; then + if [ -n "${extip}" ]; then if [ "${ip}" != "${extip}" ]; then echo -e "${lightblue}Internet IP:\t${default}${extip}:${port}" fi fi # Display ip - if [ "${displayip}" ]; then + if [ -n "${displayip}" ]; then echo -e "${lightblue}Display IP:\t${default}${displayip}:${port}" fi # Server password - if [ "${serverpassword}" ]; then + if [ -n "${serverpassword}" ]; then echo -e "${lightblue}Server password:\t${default}${serverpassword}" fi # Query enabled (Starbound) - if [ "${queryenabled}" ]; then + if [ -n "${queryenabled}" ]; then echo -e "${lightblue}Query enabled:\t${default}${queryenabled}" fi # RCON enabled (Starbound) - if [ "${rconenabled}" ]; then - echo -e "${lightblue}RCON enabled:\t${default}${rconpassword}" + if [ -n "${rconenabled}" ]; then + echo -e "${lightblue}RCON enabled:\t${default}${rconenabled}" fi # RCON password - if [ "${rconpassword}" ]; then + if [ -n "${rconpassword}" ]; then echo -e "${lightblue}RCON password:\t${default}${rconpassword}" fi # RCON web (Rust) - if [ "${rconweb}" ]; then + if [ -n "${rconweb}" ]; then echo -e "${lightblue}RCON web:\t${default}${rconweb}" fi # Admin password - if [ "${adminpassword}" ]; then + if [ -n "${adminpassword}" ]; then echo -e "${lightblue}Admin password:\t${default}${adminpassword}" fi # Stats password (Quake Live) - if [ "${statspassword}" ]; then + if [ -n "${statspassword}" ]; then echo -e "${lightblue}Stats password:\t${default}${statspassword}" fi # Players if [ "${querystatus}" != "0" ]; then - if [ "${maxplayers}" ]; then + if [ -n "${maxplayers}" ]; then echo -e "${lightblue}Maxplayers:\t${default}${maxplayers}" fi else - if [ "${gdplayers}" ]&&[ -n "${gdmaxplayers}" ]; then + if [ -n "${gdplayers}" ]&&[ -n "${gdmaxplayers}" ]; then echo -e "${lightblue}Players:\t${default}${gdplayers}/${gdmaxplayers}" - - elif [ "${gdplayers}" ]&&[ -n "${maxplayers}" ]; then + elif [ -n "${gdplayers}" ]&&[ -n "${maxplayers}" ]; then echo -e "${lightblue}Players:\t${default}${gdplayers}/${maxplayers}" - elif [ -z "${gdplayers}" ]&&[ -n "${gdmaxplayers}" ]; then echo -e "${lightblue}Players:\t${default}0/${gdmaxplayers}" - - elif [ "${gdplayers}" ]&&[ -z "${gdmaxplayers}" ]; then - echo -e "${lightblue}Players:\t${default}${gdplayers}|∞" - + elif [ -n "${gdplayers}" ]&&[ -z "${gdmaxplayers}" ]; then + echo -e "${lightblue}Players:\t${default}${gdplayers}/∞" elif [ -z "${gdplayers}" ]&&[ -z "${gdmaxplayers}" ]&&[ -n "${maxplayers}" ]; then echo -e "${lightblue}Maxplayers:\t${default}${maxplayers}" fi fi # Bots - if [ "${gdbots}" ]; then + if [ -n "${gdbots}" ]; then echo -e "${lightblue}Bots:\t${default}${gdbots}" fi # Current map - if [ "${gdmap}" ]; then + if [ -n "${gdmap}" ]; then echo -e "${lightblue}Current map:\t${default}${gdmap}" fi # Default map - if [ "${defaultmap}" ]; then + if [ -n "${defaultmap}" ]; then echo -e "${lightblue}Default map:\t${default}${defaultmap}" fi - if [ "${defaultscenario}" ]; then + if [ -n "${defaultscenario}" ]; then # Current scenario - if [ "${gdgamemode}" ]; then + if [ -n "${gdgamemode}" ]; then echo -e "${lightblue}Current scenario:\t${default}${gdgamemode}" fi else # Current game mode - if [ "${gdgamemode}" ]; then + if [ -n "${gdgamemode}" ]; then echo -e "${lightblue}Current game mode:\t${default}${gdgamemode}" fi fi # Default scenario - if [ "${defaultscenario}" ]; then + if [ -n "${defaultscenario}" ]; then echo -e "${lightblue}Default scenario:\t${default}${defaultscenario}" fi # Game type - if [ "${gametype}" ]; then + if [ -n "${gametype}" ]; then echo -e "${lightblue}Game type:\t${default}${gametype}" fi # Game mode - if [ "${gamemode}" ]; then + if [ -n "${gamemode}" ]; then echo -e "${lightblue}Game mode:\t${default}${gamemode}" fi # Game world - if [ "${gameworld}" ]; then + if [ -n "${gameworld}" ]; then echo -e "${lightblue}Game world:\t${default}${gameworld}" fi # Tick rate - if [ "${tickrate}" ]; then + if [ -n "${tickrate}" ]; then echo -e "${lightblue}Tick rate:\t${default}${tickrate}" fi # Sharding (Don't Starve Together) - if [ "${sharding}" ]; then + if [ -n "${sharding}" ]; then echo -e "${lightblue}Sharding:\t${default}${sharding}" fi # Master (Don't Starve Together) - if [ "${master}" ]; then + if [ -n "${master}" ]; then echo -e "${lightblue}Master:\t${default}${master}" fi # Shard (Don't Starve Together) - if [ "${shard}" ]; then + if [ -n "${shard}" ]; then echo -e "${lightblue}Shard:\t${default}${shard}" fi # Cluster (Don't Starve Together) - if [ "${cluster}" ]; then + if [ -n "${cluster}" ]; then echo -e "${lightblue}Cluster:\t${default}${cluster}" fi # Cave (Don't Starve Together) - if [ "${cave}" ]; then + if [ -n "${cave}" ]; then echo -e "${lightblue}Cave:\t${default}${cave}" fi # Creativemode (Hurtworld) - if [ "${creativemode}" ]; then + if [ -n "${creativemode}" ]; then echo -e "${lightblue}Creativemode:\t${default}${creativemode}" fi # TeamSpeak dbplugin - if [ "${dbplugin}" ]; then + if [ -n "${dbplugin}" ]; then echo -e "${lightblue}dbplugin:\t${default}${dbplugin}" fi # ASE (Multi Theft Auto) - if [ "${ase}" ]; then + if [ -n "${ase}" ]; then echo -e "${lightblue}ASE:\t${default}${ase}" fi # Save interval (Rust) - if [ "${saveinterval}" ]; then + if [ -n "${saveinterval}" ]; then echo -e "${lightblue}ASE:\t${default}${saveinterval} s" fi # Random map rotation mode (Squad and Post Scriptum) - if [ "${randommap}" ]; then + if [ -n "${randommap}" ]; then echo -e "${lightblue}Map rotation:\t${default}${randommap}" fi # Listed on Master server - if [ "${displaymasterserver}" ]; then + if [ -n "${displaymasterserver}" ]; then if [ "${displaymasterserver}" == "true" ]; then echo -e "${lightblue}Master server:\t${green}${displaymasterserver}${default}" else @@ -416,12 +412,12 @@ fn_info_message_script(){ echo -e "${lightblue}Script name:\t${default}${selfname}" # LinuxGSM version - if [ "${version}" ]; then + if [ -n "${version}" ]; then echo -e "${lightblue}LinuxGSM version:\t${default}${version}" fi # glibc required - if [ "${glibc}" ]; then + if [ -n "${glibc}" ]; then if [ "${glibc}" == "null" ]; then # Glibc is not required. : @@ -451,7 +447,7 @@ fn_info_message_script(){ # Telegram alert echo -e "${lightblue}Telegram alert:\t${default}${telegramalert}" # Update on start - if [ "${updateonstart}" ]; then + if [ -n "${updateonstart}" ]; then echo -e "${lightblue}Update on start:\t${default}${updateonstart}" fi @@ -462,7 +458,7 @@ fn_info_message_script(){ echo -e "${lightblue}Location:\t${default}${rootdir}" # Config file location - if [ "${servercfgfullpath}" ]; then + if [ -n "${servercfgfullpath}" ]; then if [ -f "${servercfgfullpath}" ]; then echo -e "${lightblue}Config file:\t${default}${servercfgfullpath}" elif [ -d "${servercfgfullpath}" ]; then @@ -473,7 +469,7 @@ fn_info_message_script(){ fi # Network config file location (ARMA 3) - if [ "${networkcfgfullpath}" ]; then + if [ -n "${networkcfgfullpath}" ]; then echo -e "${lightblue}Network config file:\t${default}${networkcfgfullpath}" fi } | column -s $'\t' -t @@ -553,7 +549,7 @@ fn_info_message_ports(){ fi done # engines/games that require editing the parms. - local ports_edit_array=( "goldsource" "Factorio" "Hurtworld" "iw3.0" "ioquake3" "qfusion" "Rust" "Soldat" "spark" "source" "starbound" "unreal4" "realvirtuality" "Unturned" ) + local ports_edit_array=( "Avorion" "goldsrc" "Factorio" "Hurtworld" "iw3.0" "ioquake3" "qfusion" "Rust" "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 @@ -580,7 +576,7 @@ fn_info_logs(){ echo -e "${selfname} Logs" echo -e "=================================" - if [ "${lgsmlog}" ]; then + if [ -n "${lgsmlog}" ]; then echo -e "\nScript log\n===================" if [ ! "$(ls -A "${lgsmlogdir}")" ]; then echo -e "${lgsmlogdir} (NO LOG FILES)" @@ -593,7 +589,7 @@ fn_info_logs(){ echo -e "" fi - if [ "${consolelog}" ]; then + if [ -n "${consolelog}" ]; then echo -e "\nConsole log\n====================" if [ ! "$(ls -A "${consolelogdir}")" ]; then echo -e "${consolelogdir} (NO LOG FILES)" @@ -606,7 +602,7 @@ fn_info_logs(){ echo -e "" fi - if [ "${gamelogdir}" ]; then + if [ -n "${gamelogdir}" ]; then echo -e "\nServer log\n===================" if [ ! "$(ls -A "${gamelogdir}")" ]; then echo -e "${gamelogdir} (NO LOG FILES)" @@ -621,6 +617,16 @@ fn_info_logs(){ # Engine/Game Specific details +fn_info_message_assettocorsa(){ + echo -e "netstat -atunp| grep acServer" + echo -e "" + { + echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" + echo -e "> Game\tINBOUND\t${port}\tudp" + echo -e "> HTTP\tINBOUND\t${port}\tudp" + } | column -s $'\t' -t +} + fn_info_message_ark(){ echo -e "netstat -atunp | grep ShooterGame" echo -e "" @@ -636,6 +642,16 @@ fn_info_message_ark(){ } | column -s $'\t' -t } +fn_info_message_avorion() { + echo "netstat -atunp | grep Avorion" + echo -e "" + { + echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL" + echo -e "> Game\tINBOUND\t${port}\tudp" + echo -e "> RCON\tINBOUND\t${rconport}\ttcp" + } | column -s $'\t' -t +} + fn_info_message_ballisticoverkill(){ echo -e "netstat -atunp | grep BODS.x86" echo -e "" @@ -749,7 +765,7 @@ fn_info_message_factorio(){ } | column -s $'\t' -t } -fn_info_message_goldsource(){ +fn_info_message_goldsrc(){ echo -e "netstat -atunp | grep hlds_linux" echo -e "" { @@ -1341,7 +1357,7 @@ fn_info_message_soldat() { { echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}" echo -e "> Game\tINBOUND\t${port}\tudp" - echo -e "> RCON\tINBOUND\t${port}\ttcp" + echo -e "> Query\tINBOUND\t${queryport}\tudp" echo -e "> FILES\tINBOUND\t$((port+10))\ttcp" } | column -s $'\t' -t } @@ -1358,8 +1374,12 @@ fn_info_message_warfork(){ fn_info_message_select_engine(){ # Display details depending on game or engine. - if [ "${shortname}" == "ark" ]; then + if [ "${shortname}" == "ac" ]; then + fn_info_message_assettocorsa + elif [ "${shortname}" == "ark" ]; then fn_info_message_ark + elif [ "${shortname}" == "av" ]; then + fn_info_message_avorion elif [ "${shortname}" == "arma3" ]; then fn_info_message_arma3 elif [ "${shortname}" == "bo" ]; then @@ -1468,8 +1488,8 @@ fn_info_message_select_engine(){ fn_info_message_risingworld elif [ "${shortname}" == "wet" ]; then fn_info_message_wolfensteinenemyterritory - elif [ "${engine}" == "goldsource" ]; then - fn_info_message_goldsource + elif [ "${engine}" == "goldsrc" ]; then + fn_info_message_goldsrc elif [ "${engine}" == "source" ]; then fn_info_message_source elif [ "${engine}" == "spark" ]; then diff --git a/lgsm/functions/info_parms.sh b/lgsm/functions/info_parms.sh index a4d483bb31..9cb56bb584 100644 --- a/lgsm/functions/info_parms.sh +++ b/lgsm/functions/info_parms.sh @@ -4,7 +4,7 @@ # Website: https://linuxgsm.com # Description: If specific parms are not set then this will be displayed in details. -local function_selfname=$(basename "$(readlink -f "${BASH_SOURCE[0]}")") +local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" ## Examples of filtering to get info from config files # sed 's/foo//g' - remove foo @@ -179,15 +179,6 @@ fn_info_parms_sof2(){ defaultmap=${defaultmap:-"NOT SET"} } -fn_info_parms_soldat(){ - port=${port:-"0"} - queryport=${port:-"0"} - servername=${servername:-"NOT SET"} - serverpassword=${serverpassword:-"NOT SET"} - adminpassword=${adminpassword:-"NOT SET"} - maxplayers=${maxplayers:-"0"} -} - fn_info_parms_ss3(){ port=${port:-"0"} queryport=$((port + 1)) @@ -279,12 +270,10 @@ elif [ "${shortname}" == "sof2" ]; then # Sticky Bots elif [ "${shortname}" == "sbots" ]; then fn_info_parms_stickybots -elif [ "${shortname}" == "sol" ]; then - fn_info_parms_soldat # Serious Sam elif [ "${shortname}" == "ss3" ]; then fn_info_parms_ss3 -elif [ "${engine}" == "source" ]||[ "${engine}" == "goldsource" ]; then +elif [ "${engine}" == "source" ]||[ "${engine}" == "goldsrc" ]; then fn_info_parms_source # Spark elif [ "${engine}" == "spark" ]; then diff --git a/lgsm/functions/install_complete.sh b/lgsm/functions/install_complete.sh index 70f4e5345b..03beeddd5c 100644 --- a/lgsm/functions/install_complete.sh +++ b/lgsm/functions/install_complete.sh @@ -6,7 +6,7 @@ local modulename="INSTALL" local commandaction="Install" -local function_selfname=$(basename "$(readlink -f "${BASH_SOURCE[0]}")") +local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" echo -e "" echo -e "=================================" diff --git a/lgsm/functions/install_config.sh b/lgsm/functions/install_config.sh index f6d08a8d63..0322be9fb9 100644 --- a/lgsm/functions/install_config.sh +++ b/lgsm/functions/install_config.sh @@ -6,7 +6,7 @@ local modulename="INSTALL" local commandaction="Install" -local function_selfname=$(basename "$(readlink -f "${BASH_SOURCE[0]}")") +local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" # Checks if server cfg dir exists, creates it if it doesn't. fn_check_cfgdir(){ @@ -147,6 +147,12 @@ fn_set_dst_config_vars(){ if [ "${shortname}" == "sdtd" ]; then gamedirname="7DaysToDie" fn_default_config_local +elif [ "${shortname}" == "ac" ]; then + gamedirname="AssettoCorsa" + array_configs+=( server_cfg.ini ) + fn_fetch_default_config + fn_default_config_remote + fn_set_config_vars elif [ "${shortname}" == "ahl" ]; then gamedirname="ActionHalfLife" array_configs+=( server.cfg ) diff --git a/lgsm/functions/install_dst_token.sh b/lgsm/functions/install_dst_token.sh index 247280a56c..b1fec01c3f 100644 --- a/lgsm/functions/install_dst_token.sh +++ b/lgsm/functions/install_dst_token.sh @@ -6,7 +6,7 @@ local modulename="INSTALL" local commandaction="Install" -local function_selfname=$(basename "$(readlink -f "${BASH_SOURCE[0]}")") +local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" echo -e "" echo -e "${lightyellow}Enter ${gamename} Cluster Token${default}" diff --git a/lgsm/functions/install_gslt.sh b/lgsm/functions/install_gslt.sh index 3162f669cb..ae10508b5c 100644 --- a/lgsm/functions/install_gslt.sh +++ b/lgsm/functions/install_gslt.sh @@ -6,7 +6,7 @@ local modulename="INSTALL" local commandaction="Install" -local function_selfname=$(basename "$(readlink -f "${BASH_SOURCE[0]}")") +local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" echo -e "" echo -e "${lightyellow}Game Server Login Token${default}" diff --git a/lgsm/functions/install_header.sh b/lgsm/functions/install_header.sh index bd2e4524be..8a63fb289f 100644 --- a/lgsm/functions/install_header.sh +++ b/lgsm/functions/install_header.sh @@ -6,7 +6,7 @@ local modulename="INSTALL" local commandaction="Install" -local function_selfname=$(basename "$(readlink -f "${BASH_SOURCE[0]}")") +local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" clear fn_print_ascii_logo diff --git a/lgsm/functions/install_logs.sh b/lgsm/functions/install_logs.sh index bb4fdd2b8f..98057df6f7 100644 --- a/lgsm/functions/install_logs.sh +++ b/lgsm/functions/install_logs.sh @@ -6,7 +6,7 @@ local modulename="INSTALL" local commandaction="Install" -local function_selfname=$(basename "$(readlink -f "${BASH_SOURCE[0]}")") +local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" if [ "${checklogs}" != "1" ]; then echo -e "" diff --git a/lgsm/functions/install_mta_resources.sh b/lgsm/functions/install_mta_resources.sh index fb7bb012b6..01ceeeb805 100644 --- a/lgsm/functions/install_mta_resources.sh +++ b/lgsm/functions/install_mta_resources.sh @@ -7,7 +7,7 @@ local modulename="INSTALL" local commandaction="Install" -local function_selfname=$(basename "$(readlink -f "${BASH_SOURCE[0]}")") +local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_print_information_nl "${gamename} will not function without resources!" echo -e " * install default resources using ./${selfname} install-default-resources" diff --git a/lgsm/functions/install_retry.sh b/lgsm/functions/install_retry.sh index 15cbf938e3..3a65049ced 100644 --- a/lgsm/functions/install_retry.sh +++ b/lgsm/functions/install_retry.sh @@ -6,7 +6,7 @@ local modulename="INSTALL" local commandaction="Install" -local function_selfname=$(basename "$(readlink -f "${BASH_SOURCE[0]}")") +local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" if fn_prompt_yn "Retry install?" Y; then command_install.sh; core_exit.sh diff --git a/lgsm/functions/install_server_dir.sh b/lgsm/functions/install_server_dir.sh index 006264a062..71f2aa4c45 100644 --- a/lgsm/functions/install_server_dir.sh +++ b/lgsm/functions/install_server_dir.sh @@ -6,7 +6,7 @@ local modulename="INSTALL" local commandaction="Install" -local function_selfname=$(basename "$(readlink -f "${BASH_SOURCE[0]}")") +local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" echo -e "" echo -e "${lightyellow}Server Directory${default}" diff --git a/lgsm/functions/install_server_files.sh b/lgsm/functions/install_server_files.sh index 859d696173..75aefccc50 100644 --- a/lgsm/functions/install_server_files.sh +++ b/lgsm/functions/install_server_files.sh @@ -6,7 +6,7 @@ local modulename="INSTALL" local commandaction="Install" -local function_selfname=$(basename "$(readlink -f "${BASH_SOURCE[0]}")") +local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_install_server_files(){ if [ "${shortname}" == "ahl" ]; then @@ -61,8 +61,6 @@ fn_install_server_files(){ remote_fileurl="http://linuxgsm.download/WolfensteinEnemyTerritory/enemy-territory.260b.tar.bz2"; local_filedir="${tmpdir}"; local_filename="enemy-territory.260b.tar.bz2"; chmodx="nochmodx" run="norun"; force="noforce"; md5="f833f514bfcdd46b42c111f83350c5a7" elif [ "${shortname}" == "samp" ]; then remote_fileurl="https://files.sa-mp.com/samp037svr_R2-1.tar.gz"; local_filedir="${tmpdir}"; local_filename="samp037svr_R2-1.tar.gz"; chmodx="nochmodx" run="norun"; force="noforce"; md5="93705e165550c97484678236749198a4" - elif [ "${shortname}" == "sol" ]; then - remote_fileurl="https://static.soldat.pl/downloads/soldatserver2.8.1_1.7.1.zip"; local_filedir="${tmpdir}"; local_filename="soldatserver2.8.1_1.7.1.zip"; chmodx="nochmodx" run="norun"; force="noforce"; md5="994409c28520425965dec5c71ccb55e1" elif [ "${shortname}" == "zmr" ]; then remote_fileurl="http://linuxgsm.download/ZombieMasterReborn/zombie_master_reborn_b5_2.tar.bz2"; local_filedir="${tmpdir}"; local_filename="zombie_master_reborn_b5_2.tar.bz2"; chmodx="nochmodx" run="norun"; force="noforce"; md5="d52ef2db376f5d21e3a4ceca85ec8761" fi @@ -105,19 +103,45 @@ fn_install_server_files_steamcmd(){ fi if [ "${counter}" -le "4" ]; then + # If GoldSrc (appid 90) servers. GoldSrc (appid 90) require extra commands. if [ "${appid}" == "90" ]; then - ${unbuffer} ${steamcmdcommand} +login "${steamuser}" "${steampass}" +force_install_dir "${serverfiles}" +app_set_config 90 mod "${appidmod}" +app_update "${appid}" -beta "${branch}" +quit - local exitcode=$? + # If using a specific branch. + if [ -n "${branch}" ]; then + ${unbuffer} ${steamcmdcommand} +login "${steamuser}" "${steampass}" +force_install_dir "${serverfiles}" +app_set_config 90 mod "${appidmod}" +app_update "${appid}" -beta "${branch}" +quit + else + ${unbuffer} ${steamcmdcommand} +login "${steamuser}" "${steampass}" +force_install_dir "${serverfiles}" +app_set_config 90 mod "${appidmod}" +app_update "${appid}" +quit + fi + elif [ "${shortname}" == "ac" ]; then + ${unbuffer} ${steamcmdcommand} +@sSteamCmdForcePlatformType windows +login "${steamuser}" "${steampass}" +force_install_dir "${serverfiles}" +app_update "${appid}" +quit + # All other servers. else - ${unbuffer} ${steamcmdcommand} +login "${steamuser}" "${steampass}" +force_install_dir "${serverfiles}" +app_update "${appid}" -beta "${branch}" +quit - local exitcode=$? + if [ -n "${branch}" ]; then + ${unbuffer} ${steamcmdcommand} +login "${steamuser}" "${steampass}" +force_install_dir "${serverfiles}" +app_update -beta "${branch}" +quit + else + ${unbuffer} ${steamcmdcommand} +login "${steamuser}" "${steampass}" +force_install_dir "${serverfiles}" +app_update "${appid}" +quit + fi fi + local exitcode=$? elif [ "${counter}" -ge "5" ]; then - if [ "${engine}" == "goldsource" ]; then - ${unbuffer} ${steamcmdcommand} +login "${steamuser}" "${steampass}" +force_install_dir "${serverfiles}" +app_set_config 90 mod "${appidmod}" +app_update "${appid}" -beta "${branch}" validate +quit + # If GoldSrc (appid 90) servers. GoldSrc (appid 90) require extra commands. + if [ "${appid}" == "90" ]; then + # If using a specific branch. + if [ -n "${branch}" ]; then + ${unbuffer} ${steamcmdcommand} +login "${steamuser}" "${steampass}" +force_install_dir "${serverfiles}" +app_set_config 90 mod "${appidmod}" +app_update "${appid}" -beta "${branch}" validate +quit + else + ${unbuffer} ${steamcmdcommand} +login "${steamuser}" "${steampass}" +force_install_dir "${serverfiles}" +app_set_config 90 mod "${appidmod}" +app_update "${appid}" validate +quit + fi local exitcode=$? + elif [ "${shortname}" == "ac" ]; then + ${unbuffer} ${steamcmdcommand} +@sSteamCmdForcePlatformType windows +login "${steamuser}" "${steampass}" +force_install_dir "${serverfiles}" +app_update "${appid}" +quit + local exitcode=$? + # All other servers. else - ${unbuffer} ${steamcmdcommand} +login "${steamuser}" "${steampass}" +force_install_dir "${serverfiles}" +app_update "${appid}" -beta "${branch}" validate +quit + if [ -n "${branch}" ]; then + ${unbuffer} ${steamcmdcommand} +login "${steamuser}" "${steampass}" +force_install_dir "${serverfiles}" +app_update "${appid}" -beta "${branch}" validate +quit + else + ${unbuffer} ${steamcmdcommand} +login "${steamuser}" "${steampass}" +force_install_dir "${serverfiles}" +app_update "${appid}" validate +quit + fi local exitcode=$? fi fi @@ -128,14 +152,18 @@ fn_install_server_files_steamcmd(){ fi done - # Goldsource servers commonly fail to download all the server files required. + # GoldSrc (appid 90) servers commonly fail to download all the server files required. # Validating a few of times may reduce the chance of this issue. - if [ "${engine}" == "goldsource" ]; then - fn_print_information_nl "Goldsource servers commonly fail to download all the server files required. Validating a few of times may reduce the chance of this issue." + if [ "${appid}" == "90" ]; then + fn_print_information_nl "GoldSrc servers commonly fail to download all the server files required. Validating a few of times may reduce the chance of this issue." counter="0" while [ "${counter}" -le "4" ]; do counter=$((counter+1)) - ${unbuffer} ${steamcmdcommand} +login "${steamuser}" "${steampass}" +force_install_dir "${serverfiles}" +app_set_config 90 mod "${appidmod}" +app_update "${appid}" "${branch}" validate +quit + if [ -n "${branch}" ]; then + ${unbuffer} ${steamcmdcommand} +login "${steamuser}" "${steampass}" +force_install_dir "${serverfiles}" +app_set_config 90 mod "${appidmod}" +app_update "${appid}" "${branch}" validate +quit + else + ${unbuffer} ${steamcmdcommand} +login "${steamuser}" "${steampass}" +force_install_dir "${serverfiles}" +app_set_config 90 mod "${appidmod}" +app_update "${appid}" validate +quit + fi local exitcode=$? done fi diff --git a/lgsm/functions/install_squad_license.sh b/lgsm/functions/install_squad_license.sh index cd8ba87b65..accb3021e0 100644 --- a/lgsm/functions/install_squad_license.sh +++ b/lgsm/functions/install_squad_license.sh @@ -6,7 +6,7 @@ local modulename="INSTALL" local commandaction="Install" -local function_selfname=$(basename "$(readlink -f "${BASH_SOURCE[0]}")") +local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" echo -e "" echo -e "${lightyellow}Squad Server License${default}" diff --git a/lgsm/functions/install_stats.sh b/lgsm/functions/install_stats.sh index 4a00edd49d..2d44706e86 100644 --- a/lgsm/functions/install_stats.sh +++ b/lgsm/functions/install_stats.sh @@ -6,7 +6,7 @@ local modulename="INSTALL" local commandaction="Install" -local function_selfname=$(basename "$(readlink -f "${BASH_SOURCE[0]}")") +local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" echo -e "" echo -e "${lightyellow}LinuxGSM Stats${default}" diff --git a/lgsm/functions/install_ts3db.sh b/lgsm/functions/install_ts3db.sh index cf8831dd38..7cc448d7bf 100644 --- a/lgsm/functions/install_ts3db.sh +++ b/lgsm/functions/install_ts3db.sh @@ -7,7 +7,7 @@ local modulename="INSTALL" local commandaction="Install" -local function_selfname=$(basename "$(readlink -f "${BASH_SOURCE[0]}")") +local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_install_ts3db_mariadb(){ if [ ! -f "${serverfiles}/libts3db_mariadb.so" ]; then diff --git a/lgsm/functions/install_ut2k4_key.sh b/lgsm/functions/install_ut2k4_key.sh index c5eff82e6e..cb02829d2d 100644 --- a/lgsm/functions/install_ut2k4_key.sh +++ b/lgsm/functions/install_ut2k4_key.sh @@ -6,7 +6,7 @@ local modulename="INSTALL" local commandaction="Install" -local function_selfname=$(basename "$(readlink -f "${BASH_SOURCE[0]}")") +local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" echo -e "" echo -e "${lightyellow}Enter ${gamename} CD Key${default}" diff --git a/lgsm/functions/logs.sh b/lgsm/functions/logs.sh index dc55456ef7..0013917784 100644 --- a/lgsm/functions/logs.sh +++ b/lgsm/functions/logs.sh @@ -41,8 +41,7 @@ if [ "$(find "${lgsmlogdir}"/ -type f -mtime +"${logdays}" | wc -l)" -ne "0" ]; # Setting up counting variables scriptcount="0" ; consolecount="0" ; gamecount="0" ; srcdscount="0" ; smcount="0" ; ulxcount="0" ; darkrpcount="0" ; legacycount="0" fn_sleep_time - fn_print_ok_nl "Starting" - fn_print_info_nl "Removing logs older than ${logdays} days" + fn_print_info "Removing logs older than ${logdays} days" fn_script_log_info "Removing logs older than ${logdays} days" # Logging logfiles to be removed according to "${logdays}", counting and removing them. # Script logfiles. @@ -100,6 +99,6 @@ if [ "$(find "${lgsmlogdir}"/ -type f -mtime +"${logdays}" | wc -l)" -ne "0" ]; # Count total amount of files removed. countlogs=$((scriptcount + consolecount + gamecount + srcdscount + smcount + ulxcount + darkrpcount)) # Job done. - fn_print_ok_nl "Removed ${countlogs} log files" + fn_print_ok "Removed ${countlogs} log files" fn_script_log "Removed ${countlogs} log files" fi diff --git a/lgsm/functions/mods_core.sh b/lgsm/functions/mods_core.sh index 68f791dbdc..ff088653b0 100644 --- a/lgsm/functions/mods_core.sh +++ b/lgsm/functions/mods_core.sh @@ -7,7 +7,7 @@ local modulename="MODS" local commandaction="Mods" -local function_selfname=$(basename "$(readlink -f "${BASH_SOURCE[0]}")") +local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" # Files and Directories. modsdir="${lgsmdir}/mods" diff --git a/lgsm/functions/mods_list.sh b/lgsm/functions/mods_list.sh index 8037f1eed9..ed354d1532 100644 --- a/lgsm/functions/mods_list.sh +++ b/lgsm/functions/mods_list.sh @@ -10,7 +10,7 @@ local modulename="MODS" local commandaction="List Mods" -local function_selfname=$(basename "$(readlink -f "${BASH_SOURCE[0]}")") +local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" # Get a proper URL for mods that don't provide a good one (optional) fn_script_log_info "Retrieving latest mods URLs" diff --git a/lgsm/functions/query_gamedig.sh b/lgsm/functions/query_gamedig.sh index 4f1bc56383..bfe38b9372 100644 --- a/lgsm/functions/query_gamedig.sh +++ b/lgsm/functions/query_gamedig.sh @@ -30,7 +30,7 @@ if [ "$(command -v gamedig 2>/dev/null)" ]&&[ "$(command -v jq 2>/dev/null)" ]; fi # numplayers. - gdplayers=$(echo -e "${gamedigraw}" | jq -re '.players') + gdplayers=$(echo -e "${gamedigraw}" | jq -re '.raw.vanilla.raw.players.online') if [ "${gdplayers}" == "null" ]; then unset gdplayers elif [ "${gdplayers}" == "[]" ]; then diff --git a/lgsm/functions/query_gsquery.py b/lgsm/functions/query_gsquery.py index f6e3ce1680..fea94dc6b8 100644 --- a/lgsm/functions/query_gsquery.py +++ b/lgsm/functions/query_gsquery.py @@ -17,13 +17,14 @@ def __init__(self, options, arguments): self.server_response_timeout = 5 self.default_buffer_length = 1024 # - sourcequery=['protocol-valve','avalanche3.0','barotrauma','madness','quakelive','realvirtuality','refractor','source','goldsource','spark','starbound','unity3d','unreal4','wurm'] + sourcequery=['protocol-valve','avalanche3.0','barotrauma','madness','quakelive','realvirtuality','refractor','source','goldsrc','spark','starbound','unity3d','unreal4','wurm'] idtech2query=['protocol-quake3','idtech2','quake','iw2.0'] idtech3query=['protocol-quake3','iw3.0','ioquake3','qfusion'] minecraftquery=['minecraft','lwjgl2'] minecraftbequery=['minecraftbe'] jc2mpquery=['jc2mp'] mumblequery=['mumbleping'] + soldatquery=['soldat'] twquery=['teeworlds'] unrealquery=['protocol-gamespy1','unreal'] unreal2query=['protocol-unreal2','unreal2'] @@ -41,12 +42,14 @@ def __init__(self, options, arguments): self.query_prompt_string = b'\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\xff\xff\x00\xfe\xfe\xfe\xfe\xfd\xfd\xfd\xfd\x12\x34\x56\x78\x00\x00\x00\x00\x00\x00\x00\x00' elif self.option.engine in mumblequery: self.query_prompt_string = b'\x00\x00\x00\x00\x01\x02\x03\x04\x05\x06\x07\x08' + elif self.option.engine in soldatquery: + self.query_prompt_string = b'\x69\x00' + elif self.option.engine in twquery: + self.query_prompt_string = b"\x04\x00\x00\xff\xff\xff\xff\x05" + bytearray(511) elif self.option.engine in unrealquery: self.query_prompt_string = b'\x5C\x69\x6E\x66\x6F\x5C' elif self.option.engine in unreal2query: self.query_prompt_string = b'\x79\x00\x00\x00\x00' - elif self.option.engine in twquery: - self.query_prompt_string = b"\x04\x00\x00\xff\xff\xff\xff\x05" + bytearray(511) self.connected = False self.response = None @@ -81,7 +84,7 @@ def responding(self): # Response. if self.response is None: self.fatal_error('No response', 3) - if len(self.response) < 10: + if len(self.response) < 5: sys.exit('Short response.', 3) else: self.exit_success(str(self.response)) @@ -116,7 +119,7 @@ def sanity_checks(self): action='store', dest='engine', default=False, - help='Engine type: protocol-valve protocol-quake3 protocol-quake3 protocol-gamespy1 protocol-unreal2 minecraft minecraftbe jc2mp mumbleping teeworlds' + help='Engine type: protocol-valve protocol-quake3 protocol-quake3 protocol-gamespy1 protocol-unreal2 minecraft minecraftbe jc2mp mumbleping soldat teeworlds' ) parser.add_option( '-v', '--verbose', diff --git a/lgsm/functions/update_factorio.sh b/lgsm/functions/update_factorio.sh index 6d520bacf6..1fcfe9bf98 100644 --- a/lgsm/functions/update_factorio.sh +++ b/lgsm/functions/update_factorio.sh @@ -6,7 +6,7 @@ local modulename="UPDATE" local commandaction="Update" -local function_selfname=$(basename "$(readlink -f "${BASH_SOURCE[0]}")") +local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_update_factorio_dl(){ fn_fetch_file "https://factorio.com/get-download/${downloadbranch}/headless/${factorioarch}" "${tmpdir}" "factorio_headless_${factorioarch}-${remotebuild}.tar.xz" @@ -27,7 +27,7 @@ fn_update_factorio_dl(){ fn_update_factorio_localbuild(){ # Gets local build info. - fn_print_dots "Checking for update: ${remotelocation}: checking local build" + fn_print_dots "Checking local build: ${remotelocation}" # Uses executable to find local build. cd "${executabledir}" || exit if [ -f "${executable}" ]; then @@ -45,14 +45,14 @@ fn_update_factorio_remotebuild(){ # Gets remote build info. remotebuild=$(curl -s "https://factorio.com/get-download/${downloadbranch}/headless/${factorioarch}" | grep -o '[0-9]\.[0-9]\{1,\}\.[0-9]\{1,\}' | head -1) if [ "${installer}" != "1" ]; then - fn_print_dots "Checking for update: ${remotelocation}: checking remote build" + fn_print_dots "Checking remote build: ${remotelocation}" # Checks if remotebuild variable has been set. if [ -z "${remotebuild}" ]||[ "${remotebuild}" == "null" ]; then - fn_print_fail "Checking for update: ${remotelocation}: checking remote build" + fn_print_fail "Checking remote build: ${remotelocation}" fn_script_log_fatal "Checking remote build" core_exit.sh else - fn_print_ok "Checking for update: ${remotelocation}: checking remote build" + fn_print_ok "Checking remote build: ${remotelocation}" fn_script_log_pass "Checking remote build" fi else @@ -68,14 +68,16 @@ fn_update_factorio_remotebuild(){ fn_update_factorio_compare(){ fn_print_dots "Checking for update: ${remotelocation}" # Removes dots so if statement can compare version numbers. + fn_print_dots "Checking for update: ${remotelocation}" localbuilddigit=$(echo -e "${localbuild}" | tr -cd '[:digit:]') remotebuilddigit=$(echo -e "${remotebuild}" | tr -cd '[:digit:]') if [ "${localbuilddigit}" -ne "${remotebuilddigit}" ]||[ "${forceupdate}" == "1" ]; then fn_print_ok_nl "Checking for update: ${remotelocation}" + echo -en "\n" echo -e "Update available" echo -e "* Local build: ${red}${localbuild} ${factorioarch}${default}" echo -e "* Remote build: ${green}${remotebuild} ${factorioarch}${default}" - if [ -v "${branch}" ]; then + if [ -n "${branch}" ]; then echo -e "* Branch: ${branch}" fi fn_script_log_info "Update available" @@ -85,18 +87,8 @@ fn_update_factorio_compare(){ fn_script_log_info "Branch: ${branch}" fi fn_script_log_info "${localbuild} > ${remotebuild}" - fn_sleep_time - echo -en "\n" - echo -en "applying update.\r" - sleep 1 - echo -en "applying update..\r" - sleep 1 - echo -en "applying update...\r" - sleep 1 - echo -en "\n" unset updateonstart - check_status.sh # If server stopped. if [ "${status}" == "0" ]; then @@ -108,6 +100,7 @@ fn_update_factorio_compare(){ command_stop.sh # If server started. else + fn_stop_warning exitbypass=1 command_stop.sh exitbypass=1 @@ -115,10 +108,12 @@ fn_update_factorio_compare(){ exitbypass=1 command_start.sh fi + 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} ${factorioarch}${default}" echo -e "* Remote build: ${green}${remotebuild} ${factorioarch}${default}" @@ -134,6 +129,21 @@ fn_update_factorio_compare(){ fi } +fn_stop_warning(){ + fn_print_warn "Updating server: SteamCMD: ${selfname} will be stopped during update" + fn_script_log_warn "Updating server: SteamCMD: ${selfname} will be stopped during update" + totalseconds=3 + for seconds in {3..1}; do + fn_print_warn "Updating server: SteamCMD: ${selfname} will be stopped during update: ${totalseconds}" + totalseconds=$((totalseconds - 1)) + sleep 1 + if [ "${seconds}" == "0" ]; then + break + fi + done + fn_print_warn_nl "Updating server: SteamCMD: ${selfname} will be stopped during update" +} + # The location where the builds are checked and downloaded. remotelocation="factorio.com" diff --git a/lgsm/functions/update_minecraft.sh b/lgsm/functions/update_minecraft.sh index d404cb0460..a8f97dd17f 100644 --- a/lgsm/functions/update_minecraft.sh +++ b/lgsm/functions/update_minecraft.sh @@ -6,7 +6,7 @@ local modulename="UPDATE" local commandaction="Update" -local function_selfname=$(basename "$(readlink -f "${BASH_SOURCE[0]}")") +local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_update_minecraft_dl(){ if [ "${branch}" == "release" ]; then @@ -34,14 +34,14 @@ fn_update_minecraft_dl(){ fn_update_minecraft_localbuild(){ # Gets local build info. - fn_print_dots "Checking for update: ${remotelocation}: checking local build" + fn_print_dots "Checking local build: ${remotelocation}" # Uses log file to gather info. # Gives time for log file to generate. if [ ! -f "${serverfiles}/logs/latest.log" ]; then - fn_print_error "Checking for update: ${remotelocation}: checking local build" - fn_print_error_nl "Checking for update: ${remotelocation}: checking local build: no log files" - fn_script_log_error "No log file found" - fn_print_info_nl "Checking for update: ${remotelocation}: checking local build: forcing server restart" + fn_print_error "Checking local build: ${remotelocation}" + fn_print_error_nl "Checking local build: ${remotelocation}: no log files containing version info" + fn_print_info_nl "Checking local build: ${remotelocation}: forcing server restart" + fn_script_log_error "No log files containing version info" fn_script_log_info "Forcing server restart" exitbypass=1 command_stop.sh @@ -51,7 +51,7 @@ fn_update_minecraft_localbuild(){ # Check again, allow time to generate logs. while [ ! -f "${serverfiles}/logs/latest.log" ]; do sleep 1 - fn_print_info "Checking for update: ${remotelocation}: checking local build: waiting for log file: ${totalseconds}" + fn_print_info "Checking local build: ${remotelocation}: waiting for log file: ${totalseconds}" if [ -v "${loopignore}" ]; then loopignore=1 fn_script_log_info "Waiting for log file to generate" @@ -59,7 +59,7 @@ fn_update_minecraft_localbuild(){ if [ "${totalseconds}" -gt "120" ]; then localbuild="0" - fn_print_error "Checking for update: ${remotelocation}: waiting for log file: missing log file" + fn_print_error "Checking local build: ${remotelocation}: waiting for log file: missing log file" fn_script_log_error "Missing log file" fn_script_log_error "Set localbuild to 0" fi @@ -76,7 +76,7 @@ fn_update_minecraft_localbuild(){ # Gives time for var to generate. totalseconds=0 for seconds in {1..120}; do - fn_print_info "Checking for update: ${remotelocation}: checking local build: waiting for local build: ${totalseconds}" + fn_print_info "Checking local build: ${remotelocation}: waiting for local build: ${totalseconds}" if [ -z "${loopignore}" ]; then loopignore=1 fn_script_log_info "Waiting for local build to generate" @@ -92,11 +92,11 @@ fn_update_minecraft_localbuild(){ if [ -z "${localbuild}" ]; then localbuild="0" - fn_print_error "Checking for update: ${remotelocation}: waiting for local build: missing local build info" + fn_print_error "Checking local build: ${remotelocation}: waiting for local build: missing local build info" fn_script_log_error "Missing local build info" fn_script_log_error "Set localbuild to 0" else - fn_print_ok "Checking for update: ${remotelocation}: checking local build" + fn_print_ok "Checking local build: ${remotelocation}" fn_script_log_pass "Checking local build" fi } @@ -110,14 +110,14 @@ fn_update_minecraft_remotebuild(){ fi if [ "${installer}" != "1" ]; then - fn_print_dots "Checking for update: ${remotelocation}: checking remote build" + fn_print_dots "Checking remote build: ${remotelocation}" # Checks if remotebuild variable has been set. if [ -z "${remotebuild}" ]||[ "${remotebuild}" == "null" ]; then - fn_print_fail "Checking for update: ${remotelocation}: checking remote build" + fn_print_fail "Checking remote build: ${remotelocation}" fn_script_log_fatal "Checking remote build" core_exit.sh else - fn_print_ok "Checking for update: ${remotelocation}: checking remote build" + fn_print_ok "Checking remote build: ${remotelocation}" fn_script_log_pass "Checking remote build" fi else @@ -135,6 +135,7 @@ fn_update_minecraft_compare(){ 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}" @@ -145,18 +146,8 @@ fn_update_minecraft_compare(){ fn_script_log_info "Local build: ${localbuild}" fn_script_log_info "Remote build: ${remotebuild}" fn_script_log_info "${localbuild} > ${remotebuild}" - fn_sleep_time - echo -en "\n" - echo -en "applying update.\r" - sleep 1 - echo -en "applying update..\r" - sleep 1 - echo -en "applying update...\r" - sleep 1 - echo -en "\n" unset updateonstart - check_status.sh # If server stopped. if [ "${status}" == "0" ]; then @@ -168,6 +159,7 @@ fn_update_minecraft_compare(){ command_stop.sh # If server started. else + fn_stop_warning exitbypass=1 command_stop.sh exitbypass=1 @@ -175,10 +167,12 @@ fn_update_minecraft_compare(){ exitbypass=1 command_start.sh fi + 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}" @@ -194,6 +188,21 @@ fn_update_minecraft_compare(){ fi } +fn_stop_warning(){ + fn_print_warn "Updating server: SteamCMD: ${selfname} will be stopped during update" + fn_script_log_warn "Updating server: SteamCMD: ${selfname} will be stopped during update" + totalseconds=3 + for seconds in {3..1}; do + fn_print_warn "Updating server: SteamCMD: ${selfname} will be stopped during update: ${totalseconds}" + totalseconds=$((totalseconds - 1)) + sleep 1 + if [ "${seconds}" == "0" ]; then + break + fi + done + fn_print_warn_nl "Updating server: SteamCMD: ${selfname} will be stopped during update" +} + # The location where the builds are checked and downloaded. remotelocation="mojang.com" diff --git a/lgsm/functions/update_minecraft_bedrock.sh b/lgsm/functions/update_minecraft_bedrock.sh index 2dadec7c25..d9d875c459 100644 --- a/lgsm/functions/update_minecraft_bedrock.sh +++ b/lgsm/functions/update_minecraft_bedrock.sh @@ -32,43 +32,43 @@ fn_update_minecraft_dl(){ fn_update_minecraft_localbuild(){ # Gets local build info. - fn_print_dots "Checking for update: ${remotelocation}: checking local build" + fn_print_dots "Checking local build: ${remotelocation}" # Uses log file to gather info. # Log is generated and cleared on startup but filled on shutdown. - - localbuild=$(grep Version $(ls -tr "${consolelogdir}"/* 2>/dev/null) | tail -1 | sed 's/.*Version //') - + localbuild=$(grep Version "$(ls -tr "${consolelogdir}"/* 2>/dev/null)" | tail -1 | sed 's/.*Version //') if [ -z "${localbuild}" ]; then - fn_print_error "Checking for update: ${remotelocation}: checking local build" - fn_print_error_nl "Checking for update: ${remotelocation}: checking local build: no log files containing version info" + fn_print_error "Checking local build: ${remotelocation}" + fn_print_error_nl "Checking local build: ${remotelocation}: no log files containing version info" + fn_print_info_nl "Checking local build: ${remotelocation}: forcing server restart" fn_script_log_error "No log files containing version info" - fn_print_info_nl "Checking for update: ${remotelocation}: checking local build: forcing server restart" fn_script_log_info "Forcing server restart" check_status.sh - if [ "${status}" != "0" ]; then - exitbypass=1 - command_stop.sh - else + # If server stopped. + if [ "${status}" == "0" ]; then exitbypass=1 command_start.sh sleep 3 exitbypass=1 command_stop.sh + # If server started. + else + exitbypass=1 + command_stop.sh fi fi if [ -z "${localbuild}" ]; then - localbuild=$(grep Version $(ls -tr "${consolelogdir}"/* 2>/dev/null) | tail -1 | sed 's/.*Version //') + localbuild=$(grep Version "$(ls -tr "${consolelogdir}"/* 2>/dev/null)" | tail -1 | sed 's/.*Version //') fi if [ -z "${localbuild}" ]; then localbuild="0" - fn_print_error "Checking for update: ${remotelocation}: waiting for local build: missing local build info" + fn_print_error "Checking local build: ${remotelocation}: waiting for local build: missing local build info" fn_script_log_error "Missing local build info" fn_script_log_error "Set localbuild to 0" else - fn_print_ok "Checking for update: ${remotelocation}: checking local build" + fn_print_ok "Checking local build: ${remotelocation}: checking local build" fn_script_log_pass "Checking local build" fi } @@ -77,14 +77,14 @@ fn_update_minecraft_remotebuild(){ # Gets remote build info. remotebuild=$(curl -s "https://www.minecraft.net/en-us/download/server/bedrock/" | grep -o 'https://minecraft.azureedge.net/bin-linux/[^"]*' | sed 's/.*\///' | grep -Eo "[.0-9]+[0-9]") if [ "${installer}" != "1" ]; then - fn_print_dots "Checking for update: ${remotelocation}: checking remote build" + fn_print_dots "Checking remote build: ${remotelocation}" # Checks if remotebuild variable has been set. if [ -z "${remotebuild}" ]||[ "${remotebuild}" == "null" ]; then - fn_print_fail "Checking for update: ${remotelocation}: checking remote build" + fn_print_fail "Checking remote build: ${remotelocation}" fn_script_log_fatal "Checking remote build" core_exit.sh else - fn_print_ok "Checking for update: ${remotelocation}: checking remote build" + fn_print_ok "Checking remote build: ${remotelocation}" fn_script_log_pass "Checking remote build" fi else @@ -104,6 +104,7 @@ fn_update_minecraft_compare(){ remotebuilddigit=$(echo -e "${remotebuild}" | tr -cd '[:digit:]') if [ "${localbuilddigit}" -ne "${remotebuilddigit}" ]||[ "${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}" @@ -111,18 +112,8 @@ fn_update_minecraft_compare(){ fn_script_log_info "Local build: ${localbuild}" fn_script_log_info "Remote build: ${remotebuild}" fn_script_log_info "${localbuild} > ${remotebuild}" - fn_sleep_time - echo -en "\n" - echo -en "applying update.\r" - sleep 1 - echo -en "applying update..\r" - sleep 1 - echo -en "applying update...\r" - sleep 1 - echo -en "\n" unset updateonstart - check_status.sh # If server stopped. if [ "${status}" == "0" ]; then @@ -134,6 +125,7 @@ fn_update_minecraft_compare(){ command_stop.sh # If server started. else + fn_stop_warning exitbypass=1 command_stop.sh exitbypass=1 @@ -141,10 +133,12 @@ fn_update_minecraft_compare(){ exitbypass=1 command_start.sh fi + 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}" @@ -154,6 +148,21 @@ fn_update_minecraft_compare(){ fi } +fn_stop_warning(){ + fn_print_warn "Updating server: SteamCMD: ${selfname} will be stopped during update" + fn_script_log_warn "Updating server: SteamCMD: ${selfname} will be stopped during update" + totalseconds=3 + for seconds in {3..1}; do + fn_print_warn "Updating server: SteamCMD: ${selfname} will be stopped during update: ${totalseconds}" + totalseconds=$((totalseconds - 1)) + sleep 1 + if [ "${seconds}" == "0" ]; then + break + fi + done + fn_print_warn_nl "Updating server: SteamCMD: ${selfname} will be stopped during update" +} + # The location where the builds are checked and downloaded. remotelocation="minecraft.net" @@ -161,7 +170,6 @@ if [ "${installer}" == "1" ]; then fn_update_minecraft_remotebuild fn_update_minecraft_dl else - check_status.sh fn_print_dots "Checking for update: ${remotelocation}" fn_script_log_info "Checking for update: ${remotelocation}" fn_update_minecraft_localbuild diff --git a/lgsm/functions/update_mta.sh b/lgsm/functions/update_mta.sh index da0d16fdb1..db3080b170 100644 --- a/lgsm/functions/update_mta.sh +++ b/lgsm/functions/update_mta.sh @@ -6,7 +6,7 @@ local modulename="UPDATE" local commandaction="Update" -local function_selfname=$(basename "$(readlink -f "${BASH_SOURCE[0]}")") +local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_update_mta_dl(){ fn_fetch_file "http://linux.mtasa.com/dl/multitheftauto_linux_x64.tar.gz" "${tmpdir}" "multitheftauto_linux_x64.tar.gz" @@ -29,14 +29,14 @@ fn_update_mta_dl(){ fn_update_mta_localbuild(){ # Gets local build info. - fn_print_dots "Checking for update: ${remotelocation}: checking local build" + fn_print_dots "Checking local build: ${remotelocation}" # Uses log file to gather info. # Gives time for log file to generate. if [ ! -f "${serverfiles}/mods/deathmatch/logs/server.log" ]; then - fn_print_error "Checking for update: ${remotelocation}: checking local build" - fn_print_error_nl "Checking for update: ${remotelocation}: checking local build: no log files" - fn_script_log_error "No log file found" - fn_print_info_nl "Checking for update: ${remotelocation}: checking local build: forcing server restart" + fn_print_error "Checking local build: ${remotelocation}" + fn_print_error_nl "Checking local build: ${remotelocation}: no log files containing version info" + fn_print_info_nl "Checking local build: ${remotelocation}: forcing server restart" + fn_script_log_error "No log files containing version info" fn_script_log_info "Forcing server restart" exitbypass=1 command_stop.sh @@ -46,7 +46,7 @@ fn_update_mta_localbuild(){ # Check again, allow time to generate logs. while [ ! -f "${serverfiles}/mods/deathmatch/logs/server.log" ]; do sleep 1 - fn_print_info "Checking for update: ${remotelocation}: checking local build: waiting for log file: ${totalseconds}" + fn_print_info "Checking local build: ${remotelocation}: waiting for log file: ${totalseconds}" if [ -v "${loopignore}" ]; then loopignore=1 fn_script_log_info "Waiting for log file to generate" @@ -54,7 +54,7 @@ fn_update_mta_localbuild(){ if [ "${totalseconds}" -gt "120" ]; then localbuild="0" - fn_print_error "Checking for update: ${remotelocation}: waiting for log file: missing log file" + fn_print_error "Checking local build: ${remotelocation}: waiting for log file: missing log file" fn_script_log_error "Missing log file" fn_script_log_error "Set localbuild to 0" fi @@ -69,10 +69,9 @@ fn_update_mta_localbuild(){ if [ -z "${localbuild}" ]; then # Gives time for var to generate. - end=$((SECONDS+120)) totalseconds=0 - while [ "${SECONDS}" -lt "${end}" ]; do - fn_print_info "Checking for update: ${remotelocation}: checking local build: waiting for local build: ${totalseconds}" + for seconds in {1..120}; do + fn_print_info "Checking local build: ${remotelocation}: waiting for local build: ${totalseconds}" if [ -z "${loopignore}" ]; then loopignore=1 fn_script_log_info "Waiting for local build to generate" @@ -88,11 +87,11 @@ fn_update_mta_localbuild(){ if [ -z "${localbuild}" ]; then localbuild="0" - fn_print_error "Checking for update: ${remotelocation}: waiting for local build: missing local build info" + fn_print_error "Checking local build: ${remotelocation}: waiting for local build: missing local build info" fn_script_log_error "Missing local build info" fn_script_log_error "Set localbuild to 0" else - fn_print_ok "Checking for update: ${remotelocation}: checking local build" + fn_print_ok "Checking local build: ${remotelocation}" fn_script_log_pass "Checking local build" fi } @@ -104,14 +103,14 @@ fn_update_mta_remotebuild(){ maintenanceversion=$(curl -s https://raw.githubusercontent.com/multitheftauto/mtasa-blue/master/Server/version.h | grep "#define MTASA_VERSION_MAINTENANCE" | awk '{ print $3 }' | sed 's/\r//g') remotebuild="${majorversion}.${minorversion}.${maintenanceversion}" if [ "${installer}" != "1" ]; then - fn_print_dots "Checking for update: ${remotelocation}: checking remote build" + fn_print_dots "Checking remote build: ${remotelocation}" # Checks if remotebuild variable has been set. if [ -z "${remotebuild}" ]||[ "${remotebuild}" == "null" ]; then - fn_print_fail "Checking for update: ${remotelocation}: checking remote build" + fn_print_fail "Checking remote build: ${remotelocation}" fn_script_log_fatal "Checking remote build" core_exit.sh else - fn_print_ok "Checking for update: ${remotelocation}: checking remote build" + fn_print_ok "Checking remote build: ${remotelocation}" fn_script_log_pass "Checking remote build" fi else @@ -145,18 +144,8 @@ fn_update_mta_compare(){ fn_script_log_info "Local build: ${localbuild}" fn_script_log_info "Remote build: ${remotebuild}" fn_script_log_info "${localbuild} > ${remotebuild}" - fn_sleep_time - echo -en "\n" - echo -en "applying update.\r" - sleep 1 - echo -en "applying update..\r" - sleep 1 - echo -en "applying update...\r" - sleep 1 - echo -en "\n" unset updateonstart - check_status.sh # If server stopped. if [ "${status}" == "0" ]; then @@ -168,6 +157,7 @@ fn_update_mta_compare(){ command_stop.sh # If server started. else + fn_stop_warning exitbypass=1 command_stop.sh exitbypass=1 @@ -175,10 +165,12 @@ fn_update_mta_compare(){ exitbypass=1 command_start.sh fi + 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}" @@ -188,6 +180,21 @@ fn_update_mta_compare(){ fi } +fn_stop_warning(){ + fn_print_warn "Updating server: SteamCMD: ${selfname} will be stopped during update" + fn_script_log_warn "Updating server: SteamCMD: ${selfname} will be stopped during update" + totalseconds=3 + for seconds in {3..1}; do + fn_print_warn "Updating server: SteamCMD: ${selfname} will be stopped during update: ${totalseconds}" + totalseconds=$((totalseconds - 1)) + sleep 1 + if [ "${seconds}" == "0" ]; then + break + fi + done + fn_print_warn_nl "Updating server: SteamCMD: ${selfname} will be stopped during update" +} + # The location where the builds are checked and downloaded. remotelocation="linux.mtasa.com" diff --git a/lgsm/functions/update_mumble.sh b/lgsm/functions/update_mumble.sh index 097e3c1588..88a7102c81 100644 --- a/lgsm/functions/update_mumble.sh +++ b/lgsm/functions/update_mumble.sh @@ -6,7 +6,7 @@ local modulename="UPDATE" local commandaction="Update" -local function_selfname=$(basename "$(readlink -f "${BASH_SOURCE[0]}")") +local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_update_mumble_dl(){ fn_fetch_file "https://github.com/mumble-voip/mumble/releases/download/${remotebuild}/murmur-static_${mumblearch}-${remotebuild}.tar.bz2" "${tmpdir}" "murmur-static_${mumblearch}-${remotebuild}.tar.bz2" @@ -27,16 +27,16 @@ fn_update_mumble_dl(){ fn_update_mumble_localbuild(){ # Gets local build info. - fn_print_dots "Checking for update: ${remotelocation}: checking local build" + fn_print_dots "Checking local build: ${remotelocation}" # Uses executable to find local build. cd "${executabledir}" || exit if [ -f "${executable}" ]; then localbuild=$(${executable} -version 2>&1 >/dev/null | awk '{print $5}') - fn_print_ok "Checking for update: ${remotelocation}: checking local build" + fn_print_ok "Checking local build: ${remotelocation}" fn_script_log_pass "Checking local build" else localbuild="0" - fn_print_error "Checking for update: ${remotelocation}: checking local build" + fn_print_error "Checking local build: ${remotelocation}" fn_script_log_error "Checking local build" fi } @@ -45,14 +45,14 @@ fn_update_mumble_remotebuild(){ # Gets remote build info. remotebuild=$(curl -s "https://api.github.com/repos/mumble-voip/mumble/releases/latest" | grep 'murmur-static_x86.*\.bz2"' | tail -1 | awk -F"/" '{ print $8 }') if [ "${installer}" != "1" ]; then - fn_print_dots "Checking for update: ${remotelocation}: checking remote build" + fn_print_dots "Checking remote build: ${remotelocation}" # Checks if remotebuild variable has been set. if [ -z "${remotebuild}" ]||[ "${remotebuild}" == "null" ]; then - fn_print_fail "Checking for update: ${remotelocation}: checking remote build" + fn_print_fail "Checking remote build: ${remotelocation}" fn_script_log_fatal "Checking remote build" core_exit.sh else - fn_print_ok "Checking for update: ${remotelocation}: checking remote build" + fn_print_ok "Checking remote build: ${remotelocation}" fn_script_log_pass "Checking remote build" fi else @@ -72,6 +72,7 @@ fn_update_mumble_compare(){ remotebuilddigit=$(echo -e "${remotebuild}" | tr -cd '[:digit:]') if [ "${localbuilddigit}" -ne "${remotebuilddigit}" ]||[ "${forceupdate}" == "1" ]; then fn_print_ok_nl "Checking for update: ${remotelocation}" + echo -en "\n" echo -e "Update available" echo -e "* Local build: ${red}${localbuild} ${mumblearch}${default}" echo -e "* Remote build: ${green}${remotebuild} ${mumblearch}${default}" @@ -79,18 +80,8 @@ fn_update_mumble_compare(){ fn_script_log_info "Local build: ${localbuild} ${mumblearch}" fn_script_log_info "Remote build: ${remotebuild} ${mumblearch}" fn_script_log_info "${localbuild} > ${remotebuild}" - fn_sleep_time - echo -en "\n" - echo -en "applying update.\r" - sleep 1 - echo -en "applying update..\r" - sleep 1 - echo -en "applying update...\r" - sleep 1 - echo -en "\n" unset updateonstart - check_status.sh # If server stopped. if [ "${status}" == "0" ]; then @@ -102,6 +93,7 @@ fn_update_mumble_compare(){ command_stop.sh # If server started. else + fn_stop_warning exitbypass=1 command_stop.sh exitbypass=1 @@ -109,10 +101,12 @@ fn_update_mumble_compare(){ exitbypass=1 command_start.sh fi + 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} ${mumblearch}${default}" echo -e "* Remote build: ${green}${remotebuild} ${mumblearch}${default}" @@ -122,6 +116,21 @@ fn_update_mumble_compare(){ fi } +fn_stop_warning(){ + fn_print_warn "Updating server: SteamCMD: ${selfname} will be stopped during update" + fn_script_log_warn "Updating server: SteamCMD: ${selfname} will be stopped during update" + totalseconds=3 + for seconds in {3..1}; do + fn_print_warn "Updating server: SteamCMD: ${selfname} will be stopped during update: ${totalseconds}" + totalseconds=$((totalseconds - 1)) + sleep 1 + if [ "${seconds}" == "0" ]; then + break + fi + done + fn_print_warn_nl "Updating server: SteamCMD: ${selfname} will be stopped during update" +} + # The location where the builds are checked and downloaded. remotelocation="mumble.info" diff --git a/lgsm/functions/update_steamcmd.sh b/lgsm/functions/update_steamcmd.sh index 17006a909f..6ac489042d 100644 --- a/lgsm/functions/update_steamcmd.sh +++ b/lgsm/functions/update_steamcmd.sh @@ -6,11 +6,10 @@ local modulename="UPDATE" local commandaction="Update" -local function_selfname=$(basename "$(readlink -f "${BASH_SOURCE[0]}")") +local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_update_steamcmd_dl(){ info_config.sh - # Detects if unbuffer command is available for 32 bit distributions only. info_distro.sh if [ "$(command -v stdbuf)" ]&&[ "${arch}" != "x86_64" ]; then @@ -19,17 +18,31 @@ fn_update_steamcmd_dl(){ if [ -d "${steamcmddir}" ]; then cd "${steamcmddir}" || exit fi + + # If GoldSrc (appid 90) servers. GoldSrc (appid 90) require extra commands. if [ "${appid}" == "90" ]; then - ${unbuffer} ${steamcmdcommand} +login "${steamuser}" "${steampass}" +force_install_dir "${serverfiles}" +app_set_config 90 mod "${appidmod}" +app_update "${appid}" -beta "${branch}" +quit | tee -a "${lgsmlog}" + # If using a specific branch. + if [ -n "${branch}" ]; then + ${unbuffer} ${steamcmdcommand} +login "${steamuser}" "${steampass}" +force_install_dir "${serverfiles}" +app_set_config 90 mod "${appidmod}" +app_update "${appid}" -beta "${branch}" +quit | tee -a "${lgsmlog}" + else + ${unbuffer} ${steamcmdcommand} +login "${steamuser}" "${steampass}" +force_install_dir "${serverfiles}" +app_set_config 90 mod "${appidmod}" +app_update "${appid}" +quit | tee -a "${lgsmlog}" + fi + elif [ "${shortname}" == "ac" ]; then + ${unbuffer} ${steamcmdcommand} +@sSteamCmdForcePlatformType windows +login "${steamuser}" "${steampass}" +force_install_dir "${serverfiles}" +app_update "${appid}" +quit + # All other servers. else - ${unbuffer} ${steamcmdcommand} +login "${steamuser}" "${steampass}" +force_install_dir "${serverfiles}" +app_update "${appid}" -beta "${branch}" +quit | tee -a "${lgsmlog}" + if [ -n "${branch}" ]; then + ${unbuffer} ${steamcmdcommand} +login "${steamuser}" "${steampass}" +force_install_dir "${serverfiles}" +app_update "${appid}" -beta "${branch}" +quit | tee -a "${lgsmlog}" + else + ${unbuffer} ${steamcmdcommand} +login "${steamuser}" "${steampass}" +force_install_dir "${serverfiles}" +app_update "${appid}" +quit | tee -a "${lgsmlog}" + fi fi fix.sh } fn_update_steamcmd_localbuild(){ # Gets local build info. - fn_print_dots "Checking for update: ${remotelocation}: checking local build" + 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) @@ -46,7 +59,16 @@ fn_update_steamcmd_localbuild(){ else branchname="public" fi - fn_sleep_time + + # 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(){ @@ -56,14 +78,14 @@ fn_update_steamcmd_remotebuild(){ fi remotebuild=$(${steamcmdcommand} +login "${steamuser}" "${steampass}" +app_info_update 1 +app_info_print "${appid}" +quit | sed '1,/branches/d' | sed "1,/${branchname}/d" | grep -m 1 buildid | tr -cd '[:digit:]') if [ "${installer}" != "1" ]; then - fn_print_dots "Checking for update: ${remotelocation}: checking remote build" + fn_print_dots "Checking remote build: ${remotelocation}" # Checks if remotebuild variable has been set. if [ -z "${remotebuild}" ]||[ "${remotebuild}" == "null" ]; then - fn_print_fail "Checking for update: ${remotelocation}: checking remote build" + fn_print_fail "Checking remote build: ${remotelocation}" fn_script_log_fatal "Checking remote build" core_exit.sh else - fn_print_ok "Checking for update: ${remotelocation}: checking remote build" + fn_print_ok "Checking remote build: ${remotelocation}" fn_script_log_pass "Checking remote build" fi else @@ -80,6 +102,7 @@ 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}" @@ -87,6 +110,7 @@ fn_update_steamcmd_compare(){ echo -e "* Branch: ${branch}" 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}" @@ -94,35 +118,29 @@ fn_update_steamcmd_compare(){ fn_script_log_info "Branch: ${branch}" fi fn_script_log_info "${localbuild} > ${remotebuild}" - fn_sleep_time - echo -en "\n" - echo -en "applying update.\r" - sleep 1 - echo -en "applying update..\r" - sleep 1 - echo -en "applying update...\r" - sleep 1 - echo -en "\n" unset updateonstart - check_status.sh # If server stopped. if [ "${status}" == "0" ]; then fn_update_steamcmd_dl # If server started. else + fn_stop_warning exitbypass=1 command_stop.sh exitbypass=1 fn_update_steamcmd_dl + date +%s > "${lockdir}/lastupdate.lock" exitbypass=1 command_start.sh fi + 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}" @@ -130,6 +148,7 @@ fn_update_steamcmd_compare(){ echo -e "* Branch: ${branch}" 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}" @@ -149,7 +168,6 @@ fn_appmanifest_check(){ # Multiple or no matching appmanifest files may sometimes be present. # This error is corrected if required. if [ "${appmanifestfilewc}" -ge "2" ]; then - fn_sleep_time 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" @@ -158,10 +176,11 @@ fn_appmanifest_check(){ 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" + echo -e "* Check user permissions" for appfile in ${appmanifestfile}; do echo -e " ${appfile}" done @@ -169,43 +188,62 @@ fn_appmanifest_check(){ 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 "Forcing update to correct issue" + fn_print_info_nl "Forcing update to correct issue" fn_script_log_info "Forcing update to correct issue" fn_update_steamcmd_dl fi elif [ "${appmanifestfilewc}" -eq "0" ]; then - fn_print_error "No appmanifest_${appid}.acf found" + fn_print_error_nl "No appmanifest_${appid}.acf found" fn_script_log_error "No appmanifest_${appid}.acf found" - fn_print_info "Forcing update to correct issue" + fn_print_info_nl "Forcing update to correct issue" fn_script_log_info "Forcing update to correct issue" fn_update_steamcmd_dl fn_appmanifest_info if [ "${appmanifestfilewc}" -eq "0" ]; then - fn_print_fail "Still no appmanifest_${appid}.acf found" + 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 } +fn_stop_warning(){ + fn_print_warn "Updating server: SteamCMD: ${selfname} will be stopped during update" + fn_script_log_warn "Updating server: SteamCMD: ${selfname} will be stopped during update" + totalseconds=3 + for seconds in {3..1}; do + fn_print_warn "Updating server: SteamCMD: ${selfname} will be stopped during update: ${totalseconds}" + totalseconds=$((totalseconds - 1)) + sleep 1 + if [ "${seconds}" == "0" ]; then + break + fi + done + fn_print_warn_nl "Updating server: SteamCMD: ${selfname} will be stopped during update" +} + # The location where the builds are checked and downloaded. remotelocation="SteamCMD" - check.sh if [ "${forceupdate}" == "1" ]; then # forceupdate bypasses update checks. check_status.sh if [ "${status}" != "0" ]; then + fn_stop_warning exitbypass=1 command_stop.sh fn_update_steamcmd_dl + date +%s > "${lockdir}/lastupdate.lock" exitbypass=1 command_start.sh else fn_update_steamcmd_dl + date +%s > "${lockdir}/lastupdate.lock" fi else + fn_print_dots "Checking for update" + fn_print_dots "Checking for update: ${remotelocation}" fn_update_steamcmd_localbuild fn_update_steamcmd_remotebuild fn_update_steamcmd_compare diff --git a/lgsm/functions/update_ts3.sh b/lgsm/functions/update_ts3.sh index 3c88372146..593183f6f0 100644 --- a/lgsm/functions/update_ts3.sh +++ b/lgsm/functions/update_ts3.sh @@ -6,7 +6,7 @@ local modulename="UPDATE" local commandaction="Update" -local function_selfname=$(basename "$(readlink -f "${BASH_SOURCE[0]}")") +local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_update_ts3_dl(){ if [ "${ts3arch}" == "amd64" ]; then @@ -32,15 +32,14 @@ fn_update_ts3_dl(){ fn_update_ts3_localbuild(){ # Gets local build info. - fn_print_dots "Checking for update: ${remotelocation}: checking local build" - fn_sleep_time + fn_print_dots "Checking local build: ${remotelocation}" # Uses log file to gather info. # Gives time for log file to generate. if [ ! -d "${serverfiles}/logs" ]||[ -z "$(find "${serverfiles}/logs/"* -name 'ts3server*_0.log' 2> /dev/null)" ]; then - fn_print_error "Checking for update: ${remotelocation}: checking local build" - fn_print_error_nl "Checking for update: ${remotelocation}: checking local build: no log files" - fn_script_log_error "No log file found" - fn_print_info_nl "Checking for update: ${remotelocation}: checking local build: forcing server restart" + fn_print_error "Checking local build: ${remotelocation}" + fn_print_error_nl "Checking local build: ${remotelocation}: no log files containing version info" + fn_print_info_nl "Checking local build: ${remotelocation}: forcing server restart" + fn_script_log_error "No log files containing version info" fn_script_log_info "Forcing server restart" exitbypass=1 command_stop.sh @@ -50,7 +49,7 @@ fn_update_ts3_localbuild(){ # Check again, allow time to generate logs. while [ ! -d "${serverfiles}/logs" ]||[ -z "$(find "${serverfiles}/logs/"* -name 'ts3server*_0.log' 2> /dev/null)" ]; do sleep 1 - fn_print_info "Checking for update: ${remotelocation}: checking local build: waiting for log file: ${totalseconds}" + fn_print_info "Checking local build: ${remotelocation}: waiting for log file: ${totalseconds}" if [ -v "${loopignore}" ]; then loopignore=1 fn_script_log_info "Waiting for log file to generate" @@ -58,7 +57,7 @@ fn_update_ts3_localbuild(){ if [ "${totalseconds}" -gt "120" ]; then localbuild="0" - fn_print_error "Checking for update: ${remotelocation}: waiting for log file: missing log file" + fn_print_error "Checking local build: ${remotelocation}: waiting for log file: missing log file" fn_script_log_error "Missing log file" fn_script_log_error "Set localbuild to 0" fi @@ -73,16 +72,15 @@ fn_update_ts3_localbuild(){ if [ -z "${localbuild}" ]; then # Gives time for var to generate. - end=$((SECONDS+120)) totalseconds=0 - while [ "${SECONDS}" -lt "${end}" ]; do - fn_print_info "Checking for update: ${remotelocation}: checking local build: waiting for local build: ${totalseconds}" + for seconds in {1..120}; do + fn_print_info "Checking local build: ${remotelocation}: waiting for local build: ${totalseconds}" if [ -z "${loopignore}" ]; then loopignore=1 fn_script_log_info "Waiting for local build to generate" fi localbuild=$(cat "$(find ./* -name "ts3server*_0.log" 2> /dev/null | sort | tail -1)" | grep -Eo "TeamSpeak 3 Server ((\.)?[0-9]{1,3}){1,3}\.[0-9]{1,3}" | grep -Eo "((\.)?[0-9]{1,3}){1,3}\.[0-9]{1,3}" | tail -1) - if [ "${localbuild}" ]; then + if [ "${localbuild}" ]||[ "${seconds}" == "120" ]; then break fi sleep 1 @@ -92,11 +90,11 @@ fn_update_ts3_localbuild(){ if [ -z "${localbuild}" ]; then localbuild="0" - fn_print_error "Checking for update: ${remotelocation}: waiting for local build: missing local build info" + fn_print_error "Checking local build: ${remotelocation}: waiting for local build: missing local build info" fn_script_log_error "Missing local build info" fn_script_log_error "Set localbuild to 0" else - fn_print_ok "Checking for update: ${remotelocation}: checking local build" + fn_print_ok "Checking local build: ${remotelocation}" fn_script_log_pass "Checking local build" fi } @@ -109,14 +107,14 @@ fn_update_ts3_remotebuild(){ remotebuild=$(curl -s "https://www.teamspeak.com/versions/server.json" | jq -r '.linux.x86.version') fi if [ "${installer}" != "1" ]; then - fn_print_dots "Checking for update: ${remotelocation}: checking remote build" + fn_print_dots "Checking remote build: ${remotelocation}" # Checks if remotebuild variable has been set. if [ -z "${remotebuild}" ]||[ "${remotebuild}" == "null" ]; then - fn_print_fail "Checking for update: ${remotelocation}: checking remote build" + fn_print_fail "Checking remote build: ${remotelocation}" fn_script_log_fatal "Checking remote build" core_exit.sh else - fn_print_ok "Checking for update: ${remotelocation}: checking remote build" + fn_print_ok "Checking remote build: ${remotelocation}" fn_script_log_pass "Checking remote build" fi else @@ -136,6 +134,7 @@ fn_update_ts3_compare(){ remotebuilddigit=$(echo -e "${remotebuild}" | tr -cd '[:digit:]') if [ "${localbuilddigit}" -ne "${remotebuilddigit}" ]||[ "${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}" @@ -143,18 +142,8 @@ fn_update_ts3_compare(){ fn_script_log_info "Local build: ${localbuild}" fn_script_log_info "Remote build: ${remotebuild}" fn_script_log_info "${localbuild} > ${remotebuild}" - fn_sleep_time - echo -en "\n" - echo -en "applying update.\r" - sleep 1 - echo -en "applying update..\r" - sleep 1 - echo -en "applying update...\r" - sleep 1 - echo -en "\n" unset updateonstart - check_status.sh # If server stopped. if [ "${status}" == "0" ]; then @@ -166,6 +155,7 @@ fn_update_ts3_compare(){ command_stop.sh # If server started. else + fn_stop_warning exitbypass=1 command_stop.sh exitbypass=1 @@ -177,6 +167,7 @@ fn_update_ts3_compare(){ alert.sh else fn_print_ok_nl "Checking for update: ${remotelocation}" + echo -en "\n" echo -e "No update available" echo -e "* Local build: ${green}${localbuild}${default}" echo -e "* Remote build: ${green}${remotebuild}${default}" @@ -198,6 +189,21 @@ else core_exit.sh fi +fn_stop_warning(){ + fn_print_warn "Updating server: SteamCMD: ${selfname} will be stopped during update" + fn_script_log_warn "Updating server: SteamCMD: ${selfname} will be stopped during update" + totalseconds=3 + for seconds in {3..1}; do + fn_print_warn "Updating server: SteamCMD: ${selfname} will be stopped during update: ${totalseconds}" + totalseconds=$((totalseconds - 1)) + sleep 1 + if [ "${seconds}" == "0" ]; then + break + fi + done + fn_print_warn_nl "Updating server: SteamCMD: ${selfname} will be stopped during update" +} + # The location where the builds are checked and downloaded. remotelocation="teamspeak.com" diff --git a/linuxgsm.sh b/linuxgsm.sh index 9e5a5b6856..19ebb01af0 100755 --- a/linuxgsm.sh +++ b/linuxgsm.sh @@ -1,7 +1,7 @@ #!/bin/bash # Project: Game Server Managers - LinuxGSM # Author: Daniel Gibbs -# License: MIT License, Copyright (c) 2019 Daniel Gibbs +# License: MIT License, Copyright (c) 2020 Daniel Gibbs # Purpose: Linux Game Server Management Script # Contributors: https://linuxgsm.com/contrib # Documentation: https://docs.linuxgsm.com @@ -20,20 +20,20 @@ if [ -f ".dev-debug" ]; then set -x fi -version="v20.1.5" +version="v20.2.0" shortname="core" gameservername="core" rootdir=$(dirname "$(readlink -f "${BASH_SOURCE[0]}")") selfname=$(basename "$(readlink -f "${BASH_SOURCE[0]}")") -lockselfname=".${selfname}.lock" lgsmdir="${rootdir}/lgsm" logdir="${rootdir}/log" lgsmlogdir="${logdir}/lgsm" -steamcmddir="${rootdir}/steamcmd" +steamcmddir="${HOME}/.steam/steamcmd" serverfiles="${rootdir}/serverfiles" functionsdir="${lgsmdir}/functions" tmpdir="${lgsmdir}/tmp" datadir="${lgsmdir}/data" +lockdir="${lgsmdir}/lock" serverlist="${datadir}/serverlist.csv" serverlistmenu="${datadir}/serverlistmenu.csv" configdir="${lgsmdir}/config-lgsm" diff --git a/tests/tests_defaultcfg/defaultcfg_1.txt b/tests/tests_defaultcfg/defaultcfg_1.txt index 9a4df6c0bd..505b6b1f0a 100644 --- a/tests/tests_defaultcfg/defaultcfg_1.txt +++ b/tests/tests_defaultcfg/defaultcfg_1.txt @@ -39,8 +39,8 @@ # 6: q # 7: exit # 8: 7 Days to Die -# 9: Gold Source -# 10: Teamspeak 3 +# 9: GoldSrc +# 10: Avorion ## Game Server Details # Do not edit #### Directories #### diff --git a/tests/tests_fctrserver.sh b/tests/tests_fctrserver.sh index 67008f883c..235d1bd93f 100644 --- a/tests/tests_fctrserver.sh +++ b/tests/tests_fctrserver.sh @@ -1,7 +1,7 @@ #!/bin/bash # Project: Game Server Managers - LinuxGSM # Author: Daniel Gibbs -# License: MIT License, Copyright (c) 2019 Daniel Gibbs +# License: MIT License, Copyright (c) 2020 Daniel Gibbs # Purpose: Travis CI Tests: Factorio | Linux Game Server Management Script # Contributors: https://linuxgsm.com/contrib # Documentation: https://docs.linuxgsm.com @@ -20,20 +20,20 @@ if [ -f ".dev-debug" ]; then set -x fi -version="v19.9.0" +version="v20.2.0" shortname="fctr" gameservername="fctrserver" rootdir=$(dirname "$(readlink -f "${BASH_SOURCE[0]}")") selfname=$(basename "$(readlink -f "${BASH_SOURCE[0]}")") -lockselfname=".${selfname}.lock" lgsmdir="${rootdir}/lgsm" logdir="${rootdir}/log" lgsmlogdir="${logdir}/lgsm" -steamcmddir="${rootdir}/steamcmd" +steamcmddir="${HOME}/.steam/steamcmd" serverfiles="${rootdir}/serverfiles" functionsdir="${lgsmdir}/functions" tmpdir="${lgsmdir}/tmp" datadir="${lgsmdir}/data" +lockdir="${lgsmdir}/lock" serverlist="${datadir}/serverlist.csv" serverlistmenu="${datadir}/serverlistmenu.csv" configdir="${lgsmdir}/config-lgsm" @@ -41,14 +41,17 @@ configdirserver="${configdir}/${gameservername}" configdirdefault="${lgsmdir}/config-default" userinput="${1}" -# Allows for testing not on Travis CI -if [ ! -v TRAVIS ]; then +# Allows for testing not on Travis CI. +# if using travis for tests +if [ -n "${TRAVIS}" ]; then + selfname="travis" +# if not using travis for tests +else TRAVIS_BRANCH="develop" TRAVIS_BUILD_DIR="${rootdir}" -else - selfname="travis" - travistest="1" + fi +travistest="1" ## GitHub Branch Select # Allows for the use of different function files @@ -353,19 +356,24 @@ else fi fi fi + # shellcheck source=/dev/null source "${configdirserver}/_default.cfg" # Load the common.cfg config. If missing download it. if [ ! -f "${configdirserver}/common.cfg" ]; then fn_fetch_config "lgsm/config-default/config-lgsm" "common-template.cfg" "${configdirserver}" "common.cfg" "${chmodx}" "nochmodx" "norun" "noforcedl" "nomd5" + # shellcheck source=/dev/null source "${configdirserver}/common.cfg" else + # shellcheck source=/dev/null source "${configdirserver}/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" + # shellcheck source=/dev/null source "${configdirserver}/${selfname}.cfg" else + # shellcheck source=/dev/null source "${configdirserver}/${selfname}.cfg" fi @@ -377,7 +385,7 @@ else # Enables ANSI colours from core_messages.sh. Can be disabled with ansi=off. fn_ansi_loader # Prevents running of core_exit.sh for Travis-CI. - if [ -z "${travistest}" ]; then + if [ "${travistest}" != "1" ]; then getopt=$1 core_getopt.sh fi @@ -392,15 +400,6 @@ fn_currentstatus_tmux(){ fi } -fn_currentstatus_ts3(){ - check_status.sh - if [ "${status}" != "0" ]; then - currentstatus="ONLINE" - else - currentstatus="OFFLINE" - fi -} - fn_setstatus(){ fn_currentstatus_tmux echo"" @@ -490,10 +489,61 @@ echo -e "" echo -e "=================================" echo -e "Server Tests" echo -e "Using: ${gamename}" -echo -e "Testing Branch: $TRAVIS_BRANCH" +echo -e "Testing Branch: ${TRAVIS_BRANCH}" echo -e "=================================" echo -e "" +echo -e "Tests Summary" +echo -e "=================================" +echo -e "0.0 - Pre-test Tasks" +echo -e "0.1 - Create log dir's" +echo -e "0.2 - Enable dev-debug" +echo -e "" +echo -e "1.0 - Pre-install tests" +echo -e "1.1 - start - no files" +echo -e "1.2 - getopt" +echo -e "1.3 - getopt with incorrect args" +echo -e "" +echo -e "2.0 - Installation" +echo -e "2.1 - install" +echo -e "" +echo -e "3.0 - Start/Stop/Restart Tests" +echo -e "3.1 - start" +echo -e "3.2 - start - online" +echo -e "3.3 - start - updateonstart" +echo -e "3.4 - stop" +echo -e "3.5 - stop - offline" +echo -e "3.6 - restart" +echo -e "3.7 - restart - offline" +echo -e "" +echo -e "4.0 - Update Tests" +echo -e "4.1 - update" +echo -e "4.2 - update-lgsm" +echo -e "" +echo -e "5.0 - Monitor Tests" +echo -e "5.1 - monitor - online" +echo -e "5.2 - monitor - offline - with lockfile" +echo -e "5.3 - monitor - offline - no lockfile" +echo -e "5.4 - test-alert" +echo -e "" +echo -e "6.0 - Details Tests" +echo -e "6.1 - details" +echo -e "6.2 - postdetails" +echo -e "" +echo -e "7.0 - Backup Tests" +echo -e "7.1 - backup" +echo -e "" +echo -e "8.0 - Development Tools Tests" +echo -e "8.1 - dev - detect glibc" +echo -e "8.2 - dev - detect ldd" +echo -e "8.3 - dev - detect deps" +echo -e "8.4 - dev - query-raw" + +echo -e "" +echo -e "9.0 - Donate" +echo -e "9.1 - donate" +echo -e "" + echo -e "0.0 - Pre-test Tasks" echo -e "==================================================================" echo -e "Description:" @@ -543,7 +593,7 @@ echo -e "test script reaction to missing server files." echo -e "Command: ./${gameservername} start" echo -e "" # Allows for testing not on Travis CI -if [ ! -v TRAVIS ]; then +if [ -z "${TRAVIS}" ]; then ( exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" BASH_XTRACEFD="5" @@ -591,7 +641,7 @@ getopt="abc123" set -x core_getopt.sh ) -fn_test_result_fail +fn_test_result_pass echo -e "run order" echo -e "=================" grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' @@ -601,7 +651,7 @@ echo -e "2.0 - Installation" echo -e "==================================================================" echo -e "" -echo -e "2.0 - install" +echo -e "2.1 - install" echo -e "=================================" echo -e "Description:" echo -e "install ${gamename} server." @@ -777,10 +827,31 @@ echo -e "run order" echo -e "=================" grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +echo -e "" +echo -e "4.2 - update-lgsm" +echo -e "=================================" +echo -e "Description:" +echo -e "update LinuxGSM." +echo -e "" +echo -e "Command: ./jc2server update-lgam" +requiredstatus="ONLINE" +fn_setstatus +( + exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + BASH_XTRACEFD="5" + set -x + command_update_linuxgsm.sh +) +fn_test_result_pass +echo -e "run order" +echo -e "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' + echo -e "" echo -e "5.0 - Monitor Tests" echo -e "==================================================================" echo -e "" +info_config.sh echo -e "Server IP - Port: ${ip}:${port}" echo -e "Server IP - Query Port: ${ip}:${queryport}" @@ -812,7 +883,7 @@ echo -e "Command: ./${gameservername} monitor" requiredstatus="OFFLINE" fn_setstatus fn_print_info_nl "creating lockfile." -date '+%s' > "${rootdir}/${lockselfname}" +date '+%s' > "${lockdir}/${selfname}.lock" ( exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" BASH_XTRACEFD="5" @@ -1003,6 +1074,30 @@ echo -e "run order" echo -e "=================" grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +echo -e "" + +echo -e "9.0 - Donate" +echo -e "==================================================================" + +echo -e "" +echo -e "9.1 - donate" +echo -e "=================================" +echo -e "Description:" +echo -e "donate." +echo -e "Command: ./${gameservername} donate" +requiredstatus="ONLINE" +fn_setstatus +( + exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + BASH_XTRACEFD="5" + set -x + command_donate.sh +) +fn_test_result_pass +echo -e "run order" +echo -e "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' + echo -e "" echo -e "=================================" echo -e "Server Tests - Complete!" @@ -1010,8 +1105,5 @@ echo -e "Using: ${gamename}" echo -e "=================================" requiredstatus="OFFLINE" fn_setstatus -if [ ! -v TRAVIS ]; then - fn_print_info "Tidying up directories." - rm -rfv "${serverfiles:?}" -fi + core_exit.sh diff --git a/tests/tests_jc2server.sh b/tests/tests_jc2server.sh index 9495098141..65e8acaefb 100644 --- a/tests/tests_jc2server.sh +++ b/tests/tests_jc2server.sh @@ -1,7 +1,7 @@ #!/bin/bash # Project: Game Server Managers - LinuxGSM # Author: Daniel Gibbs -# License: MIT License, Copyright (c) 2019 Daniel Gibbs +# License: MIT License, Copyright (c) 2020 Daniel Gibbs # Purpose: Travis CI Tests: Just Cause 2 | Linux Game Server Management Script # Contributors: https://linuxgsm.com/contrib # Documentation: https://docs.linuxgsm.com @@ -20,20 +20,20 @@ if [ -f ".dev-debug" ]; then set -x fi -version="v19.9.0" +version="v20.2.0" shortname="jc2" gameservername="jc2server" rootdir=$(dirname "$(readlink -f "${BASH_SOURCE[0]}")") selfname=$(basename "$(readlink -f "${BASH_SOURCE[0]}")") -lockselfname=".${selfname}.lock" lgsmdir="${rootdir}/lgsm" logdir="${rootdir}/log" lgsmlogdir="${logdir}/lgsm" -steamcmddir="${rootdir}/steamcmd" +steamcmddir="${HOME}/.steam/steamcmd" serverfiles="${rootdir}/serverfiles" functionsdir="${lgsmdir}/functions" tmpdir="${lgsmdir}/tmp" datadir="${lgsmdir}/data" +lockdir="${lgsmdir}/lock" serverlist="${datadir}/serverlist.csv" serverlistmenu="${datadir}/serverlistmenu.csv" configdir="${lgsmdir}/config-lgsm" @@ -41,14 +41,16 @@ configdirserver="${configdir}/${gameservername}" configdirdefault="${lgsmdir}/config-default" userinput="${1}" -# Allows for testing not on Travis CI -if [ ! -v TRAVIS ]; then +# Allows for testing not on Travis CI. +# if using travis for tests +if [ -n "${TRAVIS}" ]; then + selfname="travis" +# if not using travis for tests +else TRAVIS_BRANCH="develop" TRAVIS_BUILD_DIR="${rootdir}" -else - selfname="travis" - travistest="1" fi +travistest="1" ## GitHub Branch Select # Allows for the use of different function files @@ -242,7 +244,7 @@ fn_install_file(){ if [ -e "${local_filename}" ]; then i=2 while [ -e "${local_filename}-${i}" ] ; do - let i++ + (( i++ )) done local_filename="${local_filename}-${i}" fi @@ -353,19 +355,24 @@ else fi fi fi + # shellcheck source=/dev/null source "${configdirserver}/_default.cfg" # Load the common.cfg config. If missing download it. if [ ! -f "${configdirserver}/common.cfg" ]; then fn_fetch_config "lgsm/config-default/config-lgsm" "common-template.cfg" "${configdirserver}" "common.cfg" "${chmodx}" "nochmodx" "norun" "noforcedl" "nomd5" + # shellcheck source=/dev/null source "${configdirserver}/common.cfg" else + # shellcheck source=/dev/null source "${configdirserver}/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" + # shellcheck source=/dev/null source "${configdirserver}/${selfname}.cfg" else + # shellcheck source=/dev/null source "${configdirserver}/${selfname}.cfg" fi @@ -377,7 +384,7 @@ else # Enables ANSI colours from core_messages.sh. Can be disabled with ansi=off. fn_ansi_loader # Prevents running of core_exit.sh for Travis-CI. - if [ -z "${travistest}" ]; then + if [ "${travistest}" != "1" ]; then getopt=$1 core_getopt.sh fi @@ -392,15 +399,6 @@ fn_currentstatus_tmux(){ fi } -fn_currentstatus_ts3(){ - check_status.sh - if [ "${status}" != "0" ]; then - currentstatus="ONLINE" - else - currentstatus="OFFLINE" - fi -} - fn_setstatus(){ fn_currentstatus_tmux echo"" @@ -490,9 +488,64 @@ echo -e "" echo -e "=================================" echo -e "Server Tests" echo -e "Using: ${gamename}" -echo -e "Testing Branch: $TRAVIS_BRANCH" +echo -e "Testing Branch: ${TRAVIS_BRANCH}" echo -e "=================================" - +echo -e "" +echo -e "Tests Summary" +echo -e "=================================" +echo -e "0.0 - Pre-test Tasks" +echo -e "0.1 - Create log dir's" +echo -e "0.2 - Enable dev-debug" +echo -e "" +echo -e "1.0 - Pre-install tests" +echo -e "1.1 - start - no files" +echo -e "1.2 - getopt" +echo -e "1.3 - getopt with incorrect args" +echo -e "" +echo -e "2.0 - Installation" +echo -e "2.1 - install" +echo -e "" +echo -e "3.0 - Start/Stop/Restart Tests" +echo -e "3.1 - start" +echo -e "3.2 - start - online" +echo -e "3.3 - start - updateonstart" +echo -e "3.4 - stop" +echo -e "3.5 - stop - offline" +echo -e "3.6 - restart" +echo -e "3.7 - restart - offline" +echo -e "" +echo -e "4.0 - Update Tests" +echo -e "4.1 - update" +echo -e "4.2 - update - change buildid" +echo -e "4.3 - update - change buildid - online" +echo -e "4.4 - update - remove appmanifest file" +echo -e "4.5 - force-update" +echo -e "4.6 - force-update - online" +echo -e "4.7 - validate" +echo -e "4.8 - validate - online" +echo -e "4.9 - update-lgsm" +echo -e "" +echo -e "5.0 - Monitor Tests" +echo -e "5.1 - monitor - online" +echo -e "5.2 - monitor - offline - with lockfile" +echo -e "5.3 - monitor - offline - no lockfile" +echo -e "5.4 - test-alert" +echo -e "" +echo -e "6.0 - Details Tests" +echo -e "6.1 - details" +echo -e "6.2 - postdetails" +echo -e "" +echo -e "7.0 - Backup Tests" +echo -e "7.1 - backup" +echo -e "" +echo -e "8.0 - Development Tools Tests" +echo -e "8.1 - dev - detect glibc" +echo -e "8.2 - dev - detect ldd" +echo -e "8.3 - dev - detect deps" +echo -e "8.4 - dev - query-raw" +echo -e "" +echo -e "9.0 - Donate" +echo -e "9.1 - donate" echo -e "" echo -e "0.0 - Pre-test Tasks" echo -e "==================================================================" @@ -543,7 +596,7 @@ echo -e "test script reaction to missing server files." echo -e "Command: ./${gameservername} start" echo -e "" # Allows for testing not on Travis CI -if [ ! -v TRAVIS ]; then +if [ -z "${TRAVIS}" ]; then ( exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" BASH_XTRACEFD="5" @@ -591,7 +644,7 @@ getopt="abc123" set -x core_getopt.sh ) -fn_test_result_fail +fn_test_result_pass echo -e "run order" echo -e "=================" grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' @@ -601,7 +654,7 @@ echo -e "2.0 - Installation" echo -e "==================================================================" echo -e "" -echo -e "2.0 - install" +echo -e "2.1 - install" echo -e "=================================" echo -e "Description:" echo -e "install ${gamename} server." @@ -917,6 +970,26 @@ echo -e "run order" echo -e "=================" grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +echo -e "" +echo -e "4.9 - update-lgsm" +echo -e "=================================" +echo -e "Description:" +echo -e "update LinuxGSM." +echo -e "" +echo -e "Command: ./jc2server update-lgam" +requiredstatus="ONLINE" +fn_setstatus +( + exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + BASH_XTRACEFD="5" + set -x + command_update_linuxgsm.sh +) +fn_test_result_pass +echo -e "run order" +echo -e "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' + echo -e "" echo -e "Inserting IP address" echo -e "=================================" @@ -935,6 +1008,7 @@ echo -e "" echo -e "5.0 - Monitor Tests" echo -e "==================================================================" echo -e "" +info_config.sh echo -e "Server IP - Port: ${ip}:${port}" echo -e "Server IP - Query Port: ${ip}:${queryport}" @@ -966,7 +1040,7 @@ echo -e "Command: ./${gameservername} monitor" requiredstatus="OFFLINE" fn_setstatus fn_print_info_nl "creating lockfile." -date '+%s' > "${rootdir}/${lockselfname}" +date '+%s' > "${lockdir}/${selfname}.lock" ( exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" BASH_XTRACEFD="5" @@ -1164,6 +1238,29 @@ echo -e "run order" echo -e "=================" grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +echo -e "" +echo -e "9.0 - Donate" +echo -e "==================================================================" + +echo -e "" +echo -e "9.1 - donate" +echo -e "=================================" +echo -e "Description:" +echo -e "donate." +echo -e "Command: ./${gameservername} donate" +requiredstatus="ONLINE" +fn_setstatus +( + exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + BASH_XTRACEFD="5" + set -x + command_donate.sh +) +fn_test_result_pass +echo -e "run order" +echo -e "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' + echo -e "" echo -e "=================================" echo -e "Server Tests - Complete!" @@ -1171,8 +1268,4 @@ echo -e "Using: ${gamename}" echo -e "=================================" requiredstatus="OFFLINE" fn_setstatus -if [ ! -v TRAVIS ]; then - fn_print_info "Tidying up directories." - rm -rfv "${serverfiles:?}" -fi core_exit.sh diff --git a/tests/tests_mcserver.sh b/tests/tests_mcserver.sh index 9e8bf266ca..1a3f86802f 100644 --- a/tests/tests_mcserver.sh +++ b/tests/tests_mcserver.sh @@ -1,7 +1,7 @@ #!/bin/bash # Project: Game Server Managers - LinuxGSM # Author: Daniel Gibbs -# License: MIT License, Copyright (c) 2019 Daniel Gibbs +# License: MIT License, Copyright (c) 2020 Daniel Gibbs # Purpose: Travis CI Tests: Minecraft | Linux Game Server Management Script # Contributors: https://linuxgsm.com/contrib # Documentation: https://docs.linuxgsm.com @@ -20,20 +20,20 @@ if [ -f ".dev-debug" ]; then set -x fi -version="v19.9.0" +version="v20.2.0" shortname="mc" gameservername="mcserver" rootdir=$(dirname "$(readlink -f "${BASH_SOURCE[0]}")") selfname=$(basename "$(readlink -f "${BASH_SOURCE[0]}")") -lockselfname=".${selfname}.lock" lgsmdir="${rootdir}/lgsm" logdir="${rootdir}/log" lgsmlogdir="${logdir}/lgsm" -steamcmddir="${rootdir}/steamcmd" +steamcmddir="${HOME}/.steam/steamcmd" serverfiles="${rootdir}/serverfiles" functionsdir="${lgsmdir}/functions" tmpdir="${lgsmdir}/tmp" datadir="${lgsmdir}/data" +lockdir="${lgsmdir}/lock" serverlist="${datadir}/serverlist.csv" serverlistmenu="${datadir}/serverlistmenu.csv" configdir="${lgsmdir}/config-lgsm" @@ -41,14 +41,17 @@ configdirserver="${configdir}/${gameservername}" configdirdefault="${lgsmdir}/config-default" userinput="${1}" -# Allows for testing not on Travis CI -if [ ! -v TRAVIS ]; then +# Allows for testing not on Travis CI. +# if using travis for tests +if [ -n "${TRAVIS}" ]; then + selfname="travis" +# if not using travis for tests +else TRAVIS_BRANCH="develop" TRAVIS_BUILD_DIR="${rootdir}" -else - selfname="travis" - travistest="1" + fi +travistest="1" ## GitHub Branch Select # Allows for the use of different function files @@ -242,7 +245,7 @@ fn_install_file(){ if [ -e "${local_filename}" ]; then i=2 while [ -e "${local_filename}-${i}" ] ; do - let i++ + (( i++ )) done local_filename="${local_filename}-${i}" fi @@ -353,19 +356,24 @@ else fi fi fi + # shellcheck source=/dev/null source "${configdirserver}/_default.cfg" # Load the common.cfg config. If missing download it. if [ ! -f "${configdirserver}/common.cfg" ]; then fn_fetch_config "lgsm/config-default/config-lgsm" "common-template.cfg" "${configdirserver}" "common.cfg" "${chmodx}" "nochmodx" "norun" "noforcedl" "nomd5" + # shellcheck source=/dev/null source "${configdirserver}/common.cfg" else + # shellcheck source=/dev/null source "${configdirserver}/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" + # shellcheck source=/dev/null source "${configdirserver}/${selfname}.cfg" else + # shellcheck source=/dev/null source "${configdirserver}/${selfname}.cfg" fi @@ -377,7 +385,7 @@ else # Enables ANSI colours from core_messages.sh. Can be disabled with ansi=off. fn_ansi_loader # Prevents running of core_exit.sh for Travis-CI. - if [ -z "${travistest}" ]; then + if [ "${travistest}" != "1" ]; then getopt=$1 core_getopt.sh fi @@ -392,15 +400,6 @@ fn_currentstatus_tmux(){ fi } -fn_currentstatus_ts3(){ - check_status.sh - if [ "${status}" != "0" ]; then - currentstatus="ONLINE" - else - currentstatus="OFFLINE" - fi -} - fn_setstatus(){ fn_currentstatus_tmux echo"" @@ -490,8 +489,57 @@ echo -e "" echo -e "=================================" echo -e "Server Tests" echo -e "Using: ${gamename}" -echo -e "Testing Branch: $TRAVIS_BRANCH" +echo -e "Testing Branch: ${TRAVIS_BRANCH}" +echo -e "=================================" +echo -e "" +echo -e "Tests Summary" echo -e "=================================" +echo -e "0.0 - Pre-test Tasks" +echo -e "0.1 - Create log dir's" +echo -e "0.2 - Enable dev-debug" +echo -e "" +echo -e "1.0 - Pre-install tests" +echo -e "1.1 - start - no files" +echo -e "1.2 - getopt" +echo -e "1.3 - getopt with incorrect args" +echo -e "" +echo -e "2.0 - Installation" +echo -e "2.1 - install" +echo -e "" +echo -e "3.0 - Start/Stop/Restart Tests" +echo -e "3.1 - start" +echo -e "3.2 - start - online" +echo -e "3.3 - start - updateonstart" +echo -e "3.4 - stop" +echo -e "3.5 - stop - offline" +echo -e "3.6 - restart" +echo -e "3.7 - restart - offline" +echo -e "" +echo -e "4.0 - Update Tests" +echo -e "4.1 - update" +echo -e "4.2 - update-lgsm" +echo -e "" +echo -e "5.0 - Monitor Tests" +echo -e "5.1 - monitor - online" +echo -e "5.2 - monitor - offline - with lockfile" +echo -e "5.3 - monitor - offline - no lockfile" +echo -e "5.4 - test-alert" +echo -e "" +echo -e "6.0 - Details Tests" +echo -e "6.1 - details" +echo -e "6.2 - postdetails" +echo -e "" +echo -e "7.0 - Backup Tests" +echo -e "7.1 - backup" +echo -e "" +echo -e "8.0 - Development Tools Tests" +echo -e "8.1 - dev - detect glibc" +echo -e "8.2 - dev - detect ldd" +echo -e "8.3 - dev - detect deps" +echo -e "8.4 - dev - query-raw" +echo -e "" +echo -e "9.0 - Donate" +echo -e "9.1 - donate" echo -e "" echo -e "0.0 - Pre-test Tasks" @@ -543,7 +591,7 @@ echo -e "test script reaction to missing server files." echo -e "Command: ./${gameservername} start" echo -e "" # Allows for testing not on Travis CI -if [ ! -v TRAVIS ]; then +if [ -z "${TRAVIS}" ]; then ( exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" BASH_XTRACEFD="5" @@ -591,7 +639,7 @@ getopt="abc123" set -x core_getopt.sh ) -fn_test_result_fail +fn_test_result_pass echo -e "run order" echo -e "=================" grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' @@ -601,7 +649,7 @@ echo -e "2.0 - Installation" echo -e "==================================================================" echo -e "" -echo -e "2.0 - install" +echo -e "2.1 - install" echo -e "=================================" echo -e "Description:" echo -e "install ${gamename} server." @@ -786,6 +834,26 @@ echo -e "run order" echo -e "=================" grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +echo -e "" +echo -e "4.2 - update-lgsm" +echo -e "=================================" +echo -e "Description:" +echo -e "update LinuxGSM." +echo -e "" +echo -e "Command: ./jc2server update-lgam" +requiredstatus="ONLINE" +fn_setstatus +( + exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + BASH_XTRACEFD="5" + set -x + command_update_linuxgsm.sh +) +fn_test_result_pass +echo -e "run order" +echo -e "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' + echo -e "" echo -e "Inserting IP address" echo -e "=================================" @@ -804,6 +872,7 @@ echo -e "" echo -e "5.0 - Monitor Tests" echo -e "==================================================================" echo -e "" +info_config.sh echo -e "Server IP - Port: ${ip}:${port}" echo -e "Server IP - Query Port: ${ip}:${queryport}" @@ -845,7 +914,7 @@ echo -e "Command: ./${gameservername} monitor" requiredstatus="OFFLINE" fn_setstatus fn_print_info_nl "creating lockfile." -date '+%s' > "${rootdir}/${lockselfname}" +date '+%s' > "${lockdir}/${selfname}.lock" ( exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" BASH_XTRACEFD="5" @@ -1050,6 +1119,29 @@ echo -e "run order" echo -e "=================" grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +echo -e "" +echo -e "9.0 - Donate" +echo -e "==================================================================" + +echo -e "" +echo -e "9.1 - donate" +echo -e "=================================" +echo -e "Description:" +echo -e "donate." +echo -e "Command: ./${gameservername} donate" +requiredstatus="ONLINE" +fn_setstatus +( + exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + BASH_XTRACEFD="5" + set -x + command_donate.sh +) +fn_test_result_pass +echo -e "run order" +echo -e "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' + echo -e "" echo -e "=================================" echo -e "Server Tests - Complete!" @@ -1057,8 +1149,5 @@ echo -e "Using: ${gamename}" echo -e "=================================" requiredstatus="OFFLINE" fn_setstatus -if [ ! -v TRAVIS ]; then - fn_print_info "Tidying up directories." - rm -rfv "${serverfiles:?}" -fi + core_exit.sh diff --git a/tests/tests_shellcheck.sh b/tests/tests_shellcheck.sh index 51784906c2..f4bbf48683 100644 --- a/tests/tests_shellcheck.sh +++ b/tests/tests_shellcheck.sh @@ -1,7 +1,7 @@ #!/bin/bash # Project: Game Server Managers - LinuxGSM # Author: Daniel Gibbs -# License: MIT License, Copyright (c) 2019 Daniel Gibbs +# License: MIT License, Copyright (c) 2020 Daniel Gibbs # Purpose: Travis CI Tests: Shellcheck | Linux Game Server Management Script # Contributors: https://github.com/GameServerManagers/LinuxGSM/graphs/contributors # Documentation: https://docs.linuxgsm.com/ diff --git a/tests/tests_ts3server.sh b/tests/tests_ts3server.sh index a9527b68bb..01c195ce3d 100644 --- a/tests/tests_ts3server.sh +++ b/tests/tests_ts3server.sh @@ -1,7 +1,7 @@ #!/bin/bash # Project: Game Server Managers - LinuxGSM # Author: Daniel Gibbs -# License: MIT License, Copyright (c) 2019 Daniel Gibbs +# License: MIT License, Copyright (c) 2020 Daniel Gibbs # Purpose: Travis CI Tests: Teamspeak 3 | Linux Game Server Management Script # Contributors: https://linuxgsm.com/contrib # Documentation: https://docs.linuxgsm.com @@ -20,20 +20,20 @@ if [ -f ".dev-debug" ]; then set -x fi -version="v19.9.0" +version="v20.2.0" shortname="ts3" gameservername="ts3server" rootdir=$(dirname "$(readlink -f "${BASH_SOURCE[0]}")") selfname=$(basename "$(readlink -f "${BASH_SOURCE[0]}")") -lockselfname=".${selfname}.lock" lgsmdir="${rootdir}/lgsm" logdir="${rootdir}/log" lgsmlogdir="${logdir}/lgsm" -steamcmddir="${rootdir}/steamcmd" +steamcmddir="${HOME}/.steam/steamcmd" serverfiles="${rootdir}/serverfiles" functionsdir="${lgsmdir}/functions" tmpdir="${lgsmdir}/tmp" datadir="${lgsmdir}/data" +lockdir="${lgsmdir}/lock" serverlist="${datadir}/serverlist.csv" serverlistmenu="${datadir}/serverlistmenu.csv" configdir="${lgsmdir}/config-lgsm" @@ -41,14 +41,17 @@ configdirserver="${configdir}/${gameservername}" configdirdefault="${lgsmdir}/config-default" userinput="${1}" -# Allows for testing not on Travis CI -if [ ! -v TRAVIS ]; then +# Allows for testing not on Travis CI. +# if using travis for tests +if [ -n "${TRAVIS}" ]; then + selfname="travis" +# if not using travis for tests +else TRAVIS_BRANCH="develop" TRAVIS_BUILD_DIR="${rootdir}" -else - selfname="travis" - travistest="1" + fi +travistest="1" ## GitHub Branch Select # Allows for the use of different function files @@ -353,19 +356,24 @@ else fi fi fi + # shellcheck source=/dev/null source "${configdirserver}/_default.cfg" # Load the common.cfg config. If missing download it. if [ ! -f "${configdirserver}/common.cfg" ]; then fn_fetch_config "lgsm/config-default/config-lgsm" "common-template.cfg" "${configdirserver}" "common.cfg" "${chmodx}" "nochmodx" "norun" "noforcedl" "nomd5" + # shellcheck source=/dev/null source "${configdirserver}/common.cfg" else + # shellcheck source=/dev/null source "${configdirserver}/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" + # shellcheck source=/dev/null source "${configdirserver}/${selfname}.cfg" else + # shellcheck source=/dev/null source "${configdirserver}/${selfname}.cfg" fi @@ -377,7 +385,7 @@ else # Enables ANSI colours from core_messages.sh. Can be disabled with ansi=off. fn_ansi_loader # Prevents running of core_exit.sh for Travis-CI. - if [ -z "${travistest}" ]; then + if [ "${travistest}" != "1" ]; then getopt=$1 core_getopt.sh fi @@ -392,24 +400,15 @@ fn_currentstatus_tmux(){ fi } -fn_currentstatus_ts3(){ - check_status.sh - if [ "${status}" != "0" ]; then - currentstatus="ONLINE" - else - currentstatus="OFFLINE" - fi -} - fn_setstatus(){ - fn_currentstatus_ts3 + fn_currentstatus_tmux echo"" echo -e "Required status: ${requiredstatus}" counter=0 echo -e "Current status: ${currentstatus}" while [ "${requiredstatus}" != "${currentstatus}" ]; do counter=$((counter+1)) - fn_currentstatus_ts3 + fn_currentstatus_tmux echo -en "New status: ${currentstatus}\\r" if [ "${requiredstatus}" == "ONLINE" ]; then @@ -490,9 +489,58 @@ echo -e "" echo -e "=================================" echo -e "Server Tests" echo -e "Using: ${gamename}" -echo -e "Testing Branch: $TRAVIS_BRANCH" +echo -e "Testing Branch: ${TRAVIS_BRANCH}" echo -e "=================================" +echo -e "" +echo -e "Tests Summary" +echo -e "=================================" +echo -e "0.0 - Pre-test Tasks" +echo -e "0.1 - Create log dir's" +echo -e "0.2 - Enable dev-debug" +echo -e "" +echo -e "1.0 - Pre-install tests" +echo -e "1.1 - start - no files" +echo -e "1.2 - getopt" +echo -e "1.3 - getopt with incorrect args" +echo -e "" +echo -e "2.0 - Installation" +echo -e "2.1 - install" +echo -e "" +echo -e "3.0 - Start/Stop/Restart Tests" +echo -e "3.1 - start" +echo -e "3.2 - start - online" +echo -e "3.3 - start - updateonstart" +echo -e "3.4 - stop" +echo -e "3.5 - stop - offline" +echo -e "3.6 - restart" +echo -e "3.7 - restart - offline" +echo -e "" +echo -e "4.0 - Update Tests" +echo -e "4.1 - update" +echo -e "4.2 - update-lgsm" +echo -e "" +echo -e "5.0 - Monitor Tests" +echo -e "5.1 - monitor - online" +echo -e "5.2 - monitor - offline - with lockfile" +echo -e "5.3 - monitor - offline - no lockfile" +echo -e "5.4 - test-alert" +echo -e "" +echo -e "6.0 - Details Tests" +echo -e "6.1 - details" +echo -e "6.2 - postdetails" +echo -e "" +echo -e "7.0 - Backup Tests" +echo -e "7.1 - backup" +echo -e "" +echo -e "8.0 - Development Tools Tests" +echo -e "8.1 - dev - detect glibc" +echo -e "8.2 - dev - detect ldd" +echo -e "8.3 - dev - detect deps" +echo -e "8.4 - dev - query-raw" +echo -e "" +echo -e "9.0 - Donate" +echo -e "9.1 - donate" echo -e "" echo -e "0.0 - Pre-test Tasks" echo -e "==================================================================" @@ -543,7 +591,7 @@ echo -e "test script reaction to missing server files." echo -e "Command: ./${gameservername} start" echo -e "" # Allows for testing not on Travis CI -if [ ! -v TRAVIS ]; then +if [ -z "${TRAVIS}" ]; then ( exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" BASH_XTRACEFD="5" @@ -591,7 +639,7 @@ getopt="abc123" set -x core_getopt.sh ) -fn_test_result_fail +fn_test_result_pass echo -e "run order" echo -e "=================" grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' @@ -601,7 +649,7 @@ echo -e "2.0 - Installation" echo -e "==================================================================" echo -e "" -echo -e "2.0 - install" +echo -e "2.1 - install" echo -e "=================================" echo -e "Description:" echo -e "install ${gamename} server." @@ -777,10 +825,31 @@ echo -e "run order" echo -e "=================" grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +echo -e "" +echo -e "4.2 - update-lgsm" +echo -e "=================================" +echo -e "Description:" +echo -e "update LinuxGSM." +echo -e "" +echo -e "Command: ./jc2server update-lgam" +requiredstatus="ONLINE" +fn_setstatus +( + exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + BASH_XTRACEFD="5" + set -x + command_update_linuxgsm.sh +) +fn_test_result_pass +echo -e "run order" +echo -e "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' + echo -e "" echo -e "5.0 - Monitor Tests" echo -e "==================================================================" echo -e "" +info_config.sh echo -e "Server IP - Port: ${ip}:${port}" echo -e "Server IP - Query Port: ${ip}:${queryport}" @@ -812,7 +881,7 @@ echo -e "Command: ./${gameservername} monitor" requiredstatus="OFFLINE" fn_setstatus fn_print_info_nl "creating lockfile." -date '+%s' > "${rootdir}/${lockselfname}" +date '+%s' > "${lockdir}/${selfname}.lock" ( exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" BASH_XTRACEFD="5" @@ -1003,6 +1072,29 @@ echo -e "run order" echo -e "=================" grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' +echo -e "" +echo -e "9.0 - Donate" +echo -e "==================================================================" + +echo -e "" +echo -e "9.1 - donate" +echo -e "=================================" +echo -e "Description:" +echo -e "donate." +echo -e "Command: ./${gameservername} donate" +requiredstatus="ONLINE" +fn_setstatus +( + exec 5>"${TRAVIS_BUILD_DIR}/dev-debug.log" + BASH_XTRACEFD="5" + set -x + command_donate.sh +) +fn_test_result_pass +echo -e "run order" +echo -e "=================" +grep functionfile= "${TRAVIS_BUILD_DIR}/dev-debug.log" | sed 's/functionfile=//g' + echo -e "" echo -e "=================================" echo -e "Server Tests - Complete!" @@ -1010,8 +1102,5 @@ echo -e "Using: ${gamename}" echo -e "=================================" requiredstatus="OFFLINE" fn_setstatus -if [ ! -v TRAVIS ]; then - fn_print_info "Tidying up directories." - rm -rfv "${serverfiles:?}" -fi + core_exit.sh