Browse Source

merge

pull/3212/head
Daniel Gibbs 5 years ago
parent
commit
a5f300c4f0
  1. 55
      lgsm/config-default/config-lgsm/vhserver/README.md
  2. 190
      lgsm/config-default/config-lgsm/vhserver/_default.cfg
  3. 1
      lgsm/data/serverlist.csv
  4. 108
      lgsm/data/serverlistmenu.csv
  5. 0
      lgsm/functions/README.md
  6. 11
      lgsm/functions/alert.sh
  7. 0
      lgsm/functions/alert_discord.sh
  8. 0
      lgsm/functions/alert_email.sh
  9. 0
      lgsm/functions/alert_ifttt.sh
  10. 0
      lgsm/functions/alert_mailgun.sh
  11. 0
      lgsm/functions/alert_pushbullet.sh
  12. 0
      lgsm/functions/alert_pushover.sh
  13. 56
      lgsm/functions/alert_rocketchat.sh
  14. 0
      lgsm/functions/alert_slack.sh
  15. 0
      lgsm/functions/alert_telegram.sh
  16. 0
      lgsm/functions/check.sh
  17. 0
      lgsm/functions/check_config.sh
  18. 0
      lgsm/functions/check_deps.sh
  19. 0
      lgsm/functions/check_executable.sh
  20. 0
      lgsm/functions/check_glibc.sh
  21. 0
      lgsm/functions/check_ip.sh
  22. 0
      lgsm/functions/check_last_update.sh
  23. 0
      lgsm/functions/check_logs.sh
  24. 0
      lgsm/functions/check_permissions.sh
  25. 0
      lgsm/functions/check_root.sh
  26. 0
      lgsm/functions/check_status.sh
  27. 0
      lgsm/functions/check_steamcmd.sh
  28. 0
      lgsm/functions/check_system_dir.sh
  29. 0
      lgsm/functions/check_system_requirements.sh
  30. 0
      lgsm/functions/check_tmuxception.sh
  31. 0
      lgsm/functions/check_version.sh
  32. 0
      lgsm/functions/command_backup.sh
  33. 0
      lgsm/functions/command_console.sh
  34. 0
      lgsm/functions/command_debug.sh
  35. 0
      lgsm/functions/command_details.sh
  36. 0
      lgsm/functions/command_dev_clear_functions.sh
  37. 0
      lgsm/functions/command_dev_debug.sh
  38. 0
      lgsm/functions/command_dev_detect_deps.sh
  39. 0
      lgsm/functions/command_dev_detect_glibc.sh
  40. 0
      lgsm/functions/command_dev_detect_ldd.sh
  41. 0
      lgsm/functions/command_dev_query_raw.sh
  42. 0
      lgsm/functions/command_donate.sh
  43. 0
      lgsm/functions/command_fastdl.sh
  44. 0
      lgsm/functions/command_install.sh
  45. 0
      lgsm/functions/command_install_resources_mta.sh
  46. 0
      lgsm/functions/command_mods_install.sh
  47. 0
      lgsm/functions/command_mods_remove.sh
  48. 0
      lgsm/functions/command_mods_update.sh
  49. 0
      lgsm/functions/command_monitor.sh
  50. 0
      lgsm/functions/command_postdetails.sh
  51. 0
      lgsm/functions/command_restart.sh
  52. 0
      lgsm/functions/command_start.sh
  53. 23
      lgsm/functions/command_stop.sh
  54. 0
      lgsm/functions/command_test_alert.sh
  55. 0
      lgsm/functions/command_ts3_server_pass.sh
  56. 0
      lgsm/functions/command_update.sh
  57. 0
      lgsm/functions/command_update_functions.sh
  58. 0
      lgsm/functions/command_update_linuxgsm.sh
  59. 0
      lgsm/functions/command_validate.sh
  60. 0
      lgsm/functions/command_wipe.sh
  61. 0
      lgsm/functions/compress_unreal2_maps.sh
  62. 0
      lgsm/functions/compress_ut99_maps.sh
  63. 0
      lgsm/functions/core_dl.sh
  64. 0
      lgsm/functions/core_exit.sh
  65. 10
      lgsm/functions/core_functions.sh
  66. 0
      lgsm/functions/core_getopt.sh
  67. 0
      lgsm/functions/core_legacy.sh
  68. 0
      lgsm/functions/core_logs.sh
  69. 0
      lgsm/functions/core_messages.sh
  70. 0
      lgsm/functions/core_trap.sh
  71. 2
      lgsm/functions/fix.sh
  72. 0
      lgsm/functions/fix_ark.sh
  73. 0
      lgsm/functions/fix_arma3.sh
  74. 0
      lgsm/functions/fix_av.sh
  75. 0
      lgsm/functions/fix_cmw.sh
  76. 0
      lgsm/functions/fix_csgo.sh
  77. 0
      lgsm/functions/fix_dst.sh
  78. 0
      lgsm/functions/fix_ges.sh
  79. 0
      lgsm/functions/fix_hw.sh
  80. 0
      lgsm/functions/fix_ins.sh
  81. 0
      lgsm/functions/fix_kf.sh
  82. 0
      lgsm/functions/fix_kf2.sh
  83. 0
      lgsm/functions/fix_mcb.sh
  84. 0
      lgsm/functions/fix_mta.sh
  85. 0
      lgsm/functions/fix_nmrih.sh
  86. 0
      lgsm/functions/fix_onset.sh
  87. 0
      lgsm/functions/fix_ro.sh
  88. 0
      lgsm/functions/fix_rust.sh
  89. 0
      lgsm/functions/fix_rw.sh
  90. 0
      lgsm/functions/fix_sdtd.sh
  91. 0
      lgsm/functions/fix_sfc.sh
  92. 0
      lgsm/functions/fix_sof2.sh
  93. 0
      lgsm/functions/fix_ss3.sh
  94. 0
      lgsm/functions/fix_steamcmd.sh
  95. 0
      lgsm/functions/fix_terraria.sh
  96. 0
      lgsm/functions/fix_tf2.sh
  97. 0
      lgsm/functions/fix_ts3.sh
  98. 0
      lgsm/functions/fix_tu.sh
  99. 0
      lgsm/functions/fix_unt.sh
  100. 0
      lgsm/functions/fix_ut.sh

55
lgsm/config-default/config-lgsm/vhserver/README.md

@ -0,0 +1,55 @@
A Saga of how a Viking <strike>wrote</strike> *bash*ed some <strike>scripts</strike> runes together that led him on a journey to the tenth (or so) missing realm of Valheim!
... *pausing for effect* ...
Upon the whims of Odin, I was chosen to undergo the trial of Valheim, where, by chance, I met my liege, Sir Gloor, an outstanding burly Viking Warrior and Shaman (long beard, pointy hat), who had long discovered the secrets of Valheim, due to his divine connections. Blah blah blah ...etc. etc. etc., (skip the prologue)....booorrrriiinnngggg. Anyways, in order to be able to set out on adventures on dedicated servers, I'll point out some viking-ways to get you set up. First, you'll need 5 wood and 2 stones...
I won't go into to much detail, as lot of the knowledge to run on a server is similar to other server in Linuxgsm. So I will point to links to their site as I go along. You can either copy the whole repository, or just wget <path_to_Linuxgsm.sh>.
First the game has it's own parameters for starting that should be set. Like other games managed with Linuxgsm, these can be found in the corresponding game folder, in Valheim's case: lgsm/config-default/config-lgsm/vhserver/_default.cfg. You shouldn't edit this file, as a copy will be made elsewhere upon installing the server, at lgsm/conifg-lgsm/vhserver/_default.cfg. Note: this file is always checked by the code if it has been changed, and will always be reset to match the version of github.
I will suggest setting the following in the common.cfg, which will apply to all game instances created:
`- steamuser=`
(In the _default.cfg, I mention at the steam section, that you should login prior to install, as the default is to log on anonymously, which is, at the time of this writting, not allowed, as the server requires username and password. You should only need to set your username within the configuration file (common.cfg or '*instance*.cfg), and after logging on manually into steamcmd and entering your password once, it should remember the server as trustworthy. You may need to enter it manually again later, depending, otherwise you can add steampass="" in the file as well. It's just a matter of security, depending if you are willing to risk your steam account, should the server be compromised.)
And then for specific game instances (i.e. vhserver, vhserver-2, etc.), you should
- `name` (server name as it appears in steam server list)
- `world` (the save name of the game world found under .config/unity3d/IronGate/Valheim/worlds/ )
- `password`
- `public` (if you wish to change the default value: public)
Technically, you can choose which settings are global for all servers (common.cfg) or localised for just a specific instance (*instance*.cfg). It is up to you to sharpen your axe and make the best choice for your situation. For example, I've chosen to make notification "global", turning them on in the common.cfg, so all games will be reported.
Depending if you have a beta branch:
- `branch`
- `branchpassword` (this is presently lacking in the parent branch of Linuxgsm, but works for Valheim! Viking Power!)
There are suggestions and steps to backing up the the entire server setup of Linuxgsm: https://docs.linuxgsm.com/commands/backup
I have done that, but I have also included, similarly, the automating backups of the actual world file (.config/unity3d/IronGate/Valheim/worlds/). Here is an example:
```bash
#!/bin/bash
cd /home/<user>/.config/unity3d/IronGate/Valheim/worlds/
files=`ls ./*.fwl`
for i in $files
do
file=`basename -s .fwl $i`
tar -czf "$1_$file.tar.gz" $file.fwl $file.db
done;
```
This script combines to the files need for the world into one tar file, and does so for every unique world file. It takes a name as a parameter and places it in front of the world's name. So I have a monthly back up called Monthly_<world_name>.tar.gz, that automatically overwrites itself every month. And similarly, the daily backup overwrites itself everyday. You can customize it as needed. This is an excerpt from cronjob:
```
#Valheim World Backups
0 0 * * * /home/<user>/<script_name>.sh Daily >/dev/null 2>&1
0 1 1 * * /home/<user>/<script_name>.sh Monthly >/dev/null 2>&1
```
#$@&%*! *swearing after smashing a finger with the hammer while chiseling the words out*
Presently, gamedig does not support Valheim, so I've set the default to check the session value, which is adequet.
At this time in writing, I've added alert notification for rocketchat, which on the main repository is presently lacking.
All is as Odin wishes,
A Saga, by the IT Viking

190
lgsm/config-default/config-lgsm/vhserver/_default.cfg

@ -0,0 +1,190 @@
##################################
######## 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
# Name of the server, as shown in steam server list
name="Valheim Server"
# Minimum password length is 5 characters & Password cant be in the server name.
password="secret"
# Valheim's default port
port="2456"
# The name of the world's save file
world="World"
# 1 is true, 0 is false, whether server is public
public="1"
## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters
fn_parms(){
parms="-name ${name} -password ${password} -port ${port} -world ${world} -public ${public} > /dev/null"
}
#### 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 protected]"
emailfrom=""
# IFTTT Alerts | https://docs.linuxgsm.com/alerts/ifttt
iftttalert="off"
ifttttoken="accesstoken"
iftttevent="linuxgsm_alert"
# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun
mailgunalert="off"
mailguntoken="accesstoken"
mailgundomain="example.com"
mailgunemailfrom="[email protected]"
mailgunemail="[email protected]"
# Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet
pushbulletalert="off"
pushbullettoken="accesstoken"
channeltag=""
# Pushover Alerts | https://docs.linuxgsm.com/alerts/pushover
pushoveralert="off"
pushovertoken="accesstoken"
# Rocketchat Alerts
rocketchatalert="off"
rocketchatwebhook="webhook"
rocketchattoken=""
# Slack Alerts | https://docs.linuxgsm.com/alerts/slack
slackalert="off"
slackwebhook="webhook"
# Telegram Alerts | https://docs.linuxgsm.com/alerts/telegram
# You can add a custom cURL string eg proxy (useful in Russia) 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="off"
## Logging | https://docs.linuxgsm.com/features/logging
consolelogging="on"
logdays="7"
## Monitor | https://docs.linuxgsm.com/commands/monitor
# Query delay time
querydelay="5"
## 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="896660"
# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch
branch=""
branchpassword=""
# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server
steammaster="false"
## Important! Valheim is a game that requires ownership of the game, which will require
## the logging in with steamcmd. I suggest logging in ahead of time, and then add in the
## common.cfg file add: steamuser="<username>" , along with using email verification with
## steamguard, you'll authorise the server for logging in. The first time logging in to steamcmd
## will require a verification code that you recieve per email. This is why it should be done
## before installing the server. Otherwise, it will try installing the server anonymously,
## which will not be possible.
## Stop Mode | https://docs.linuxgsm.com/features/stop-mode
# 1: tmux kill
# 2: CTRL+c
# 3: quit
# 4: quit 120s
# 5: stop
# 6: q
# 7: exit
# 8: 7 Days to Die
# 9: GoldSrc
# 10: Avorion
# 11: Valheim
stopmode="11"
## Query mode
# 1: session only
# 2: gamedig + gsquery
# 3: gamedig
# 4: gsquery
# 5: tcp
querymode="1"
#querytype="protocol-valve"
## Game Server Details
# Do not edit
gamename="Valheim"
engine="unity3d"
glibc="2.15"
#### Directories ####
# Edit with care
## Game Server Directories
systemdir="${serverfiles}"
executabledir="${serverfiles}"
executable="./valheim_server.x86_64"
serverfiles="${rootdir}/serverfiles"
## Backup Directory
backupdir="${lgsmdir}/backup"
## Logging Directories
logdir="${rootdir}/log"
gamelogdir="${systemdir}/Saved/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"

1
lgsm/data/serverlist.csv

@ -103,6 +103,7 @@ ut,utserver,Unreal Tournament
ut2k4,ut2k4server,Unreal Tournament 2004
ut3,ut3server,Unreal Tournament 3
ut99,ut99server,Unreal Tournament 99
vh,vhserver,Valheim
vs,vsserver,Vampire Slayer
wet,wetserver,Wolfenstein: Enemy Territory
wf,wfserver,Warfork

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

108
lgsm/data/serverlistmenu.csv

@ -0,0 +1,108 @@
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
bf1942,bf1942server,Battlefield 1942
bmdm,bmdmserver,Black Mesa: Deathmatch
bo,boserver,Ballistic Overkill
bs,bsserver,Blade Symphony
bt,btserver,Barotrauma
bt1944,bt1944server,Battalion 1944
cc,ccserver,Codename CURE
cmw,cmwserver,Chivalry: Medieval Warfare
cod,codserver,Call of Duty
cod2,cod2server,Call of Duty 2
cod4,cod4server,Call of Duty 4
coduo,coduoserver,Call of Duty: United Offensive
codwaw,codwawserver,Call of Duty: World at War
cs,csserver,Counter-Strike 1.6
cscz,csczserver,Counter-Strike: Condition Zero
csgo,csgoserver,Counter-Strike: Global Offensive
css,cssserver,Counter-Strike: Source
dab,dabserver,Double Action: Boogaloo
dmc,dmcserver,Deathmatch Classic
dod,dodserver,Day of Defeat
dods,dodsserver,Day of Defeat: Source
doi,doiserver,Day of Infamy
dst,dstserver,Don't Starve Together
dys,dysserver,Dystopia
eco,ecoserver,Eco
em,emserver,Empires Mod
etl,etlserver,ET: Legacy
fctr,fctrserver,Factorio
fof,fofserver,Fistful of Frags
ges,gesserver,GoldenEye: Source
gmod,gmodserver,Garrys Mod
hl2dm,hl2dmserver,Half-Life 2: Deathmatch
hldm,hldmserver,Half-Life: Deathmatch
hldms,hldmsserver,Half-Life Deathmatch: Source
hw,hwserver,Hurtworld
ins,insserver,Insurgency
inss,inssserver,Insurgency: Sandstorm
ios,iosserver,IOSoccer
jc2,jc2server,Just Cause 2
jc3,jc3server,Just Cause 3
kf,kfserver,Killing Floor
kf2,kf2server,Killing Floor 2
l4d,l4dserver,Left 4 Dead
l4d2,l4d2server,Left 4 Dead 2
mc,mcserver,Minecraft
mcb,mcbserver,Minecraft Bedrock
mh,mhserver,MORDHAU
mohaa,mohaaserver,Medal of Honor: Allied Assault
mta,mtaserver,Multi Theft Auto
mumble,mumbleserver,Mumble
nd,ndserver,Nuclear Dawn
nmrih,nmrihserver,No More Room in Hell
ns,nsserver,Natural Selection
ns2,ns2server,Natural Selection 2
ns2c,ns2cserver,NS2: Combat
onset,onsetserver,Onset
opfor,opforserver,Opposing Force
pc,pcserver,Project Cars
pstbs,pstbsserver,Post Scriptum: The Bloody Seventh
pvkii,pvkiiserver,Pirates Vikings & Knights II
pz,pzserver,Project Zomboid
q2,q2server,Quake 2
q3,q3server,Quake 3: Arena
ql,qlserver,Quake Live
qw,qwserver,Quake World
ricochet,ricochetserver,Ricochet
ro,roserver,Red Orchestra: Ostfront 41-45
rtcw,rtcwserver,Return to Castle Wolfenstein
rust,rustserver,Rust
rw,rwserver,Rising World
samp,sampserver,San Andreas Multiplayer
sb,sbserver,Starbound
sbots,sbotsserver,StickyBots
sdtd,sdtdserver,7 Days to Die
sfc,sfcserver,SourceForts Classic
sof2,sof2server,Soldier Of Fortune 2: Gold Edition
sol,solserver,Soldat
squad,squadserver,Squad
ss3,ss3server,Serious Sam 3: BFE
st,stserver,Stationeers
sven,svenserver,Sven Co-op
terraria,terrariaserver,Terraria
tf2,tf2server,Team Fortress 2
tfc,tfcserver,Team Fortress Classic
ts,tsserver,The Specialists
ts3,ts3server,Teamspeak 3
tu,tuserver,Tower Unite
tw,twserver,Teeworlds
unt,untserver,Unturned
ut,utserver,Unreal Tournament
ut2k4,ut2k4server,Unreal Tournament 2004
ut3,ut3server,Unreal Tournament 3
ut99,ut99server,Unreal Tournament 99
vh,vhserver,Valheim
vs,vsserver,Vampire Slayer
wet,wetserver,Wolfenstein: Enemy Territory
wf,wfserver,Warfork
wurm,wurmserver,Wurm Unlimited
zmr,zmrserver,Zombie Master: Reborn
zps,zpsserver,Zombie Panic! Source
1 ahl ahlserver Action half-life
2 ahl2 ahl2server Action: Source
3 ark arkserver ARK: Survival Evolved
4 arma3 arma3server ARMA 3
5 av avserver Avorion
6 bb bbserver BrainBread
7 bb2 bb2server BrainBread 2
8 bd bdserver Base Defense
9 bf1942 bf1942server Battlefield 1942
10 bmdm bmdmserver Black Mesa: Deathmatch
11 bo boserver Ballistic Overkill
12 bs bsserver Blade Symphony
13 bt btserver Barotrauma
14 bt1944 bt1944server Battalion 1944
15 cc ccserver Codename CURE
16 cmw cmwserver Chivalry: Medieval Warfare
17 cod codserver Call of Duty
18 cod2 cod2server Call of Duty 2
19 cod4 cod4server Call of Duty 4
20 coduo coduoserver Call of Duty: United Offensive
21 codwaw codwawserver Call of Duty: World at War
22 cs csserver Counter-Strike 1.6
23 cscz csczserver Counter-Strike: Condition Zero
24 csgo csgoserver Counter-Strike: Global Offensive
25 css cssserver Counter-Strike: Source
26 dab dabserver Double Action: Boogaloo
27 dmc dmcserver Deathmatch Classic
28 dod dodserver Day of Defeat
29 dods dodsserver Day of Defeat: Source
30 doi doiserver Day of Infamy
31 dst dstserver Don't Starve Together
32 dys dysserver Dystopia
33 eco ecoserver Eco
34 em emserver Empires Mod
35 etl etlserver ET: Legacy
36 fctr fctrserver Factorio
37 fof fofserver Fistful of Frags
38 ges gesserver GoldenEye: Source
39 gmod gmodserver Garrys Mod
40 hl2dm hl2dmserver Half-Life 2: Deathmatch
41 hldm hldmserver Half-Life: Deathmatch
42 hldms hldmsserver Half-Life Deathmatch: Source
43 hw hwserver Hurtworld
44 ins insserver Insurgency
45 inss inssserver Insurgency: Sandstorm
46 ios iosserver IOSoccer
47 jc2 jc2server Just Cause 2
48 jc3 jc3server Just Cause 3
49 kf kfserver Killing Floor
50 kf2 kf2server Killing Floor 2
51 l4d l4dserver Left 4 Dead
52 l4d2 l4d2server Left 4 Dead 2
53 mc mcserver Minecraft
54 mcb mcbserver Minecraft Bedrock
55 mh mhserver MORDHAU
56 mohaa mohaaserver Medal of Honor: Allied Assault
57 mta mtaserver Multi Theft Auto
58 mumble mumbleserver Mumble
59 nd ndserver Nuclear Dawn
60 nmrih nmrihserver No More Room in Hell
61 ns nsserver Natural Selection
62 ns2 ns2server Natural Selection 2
63 ns2c ns2cserver NS2: Combat
64 onset onsetserver Onset
65 opfor opforserver Opposing Force
66 pc pcserver Project C

0
lgsm/functions/README.md

11
lgsm/functions/alert.sh

@ -191,6 +191,17 @@ elif [ -z "${telegramchatid}" ]&&[ "${commandname}" == "TEST-ALERT" ]; then
fn_script_error "Telegram chat id not set."
fi
if [ "${rocketchatalert}" == "on" ]&&[ -n "${rocketchatalert}" ]; then
alert_rocketchat.sh
elif [ "${rocketchatalert}" != "on" ]&&[ "${commandname}" == "TEST-ALERT" ]; then
fn_print_warn_nl "Rocketchat alerts not enabled"
fn_script_log_warn "Rocketchat alerts not enabled"
elif [ -z "${rocketchattoken}" ]&&[ "${commandname}" == "TEST-ALERT" ]; then
fn_print_error_nl "Rocketchat token not set"
#echo -e "* https://docs.linuxgsm.com/alerts/slack"
fn_script_error "Rocketchat token not set"
fi
if [ "${slackalert}" == "on" ]&&[ -n "${slackalert}" ]; then
alert_slack.sh
elif [ "${slackalert}" != "on" ]&&[ "${commandname}" == "TEST-ALERT" ]; then

0
lgsm/functions/alert_discord.sh

0
lgsm/functions/alert_email.sh

0
lgsm/functions/alert_ifttt.sh

0
lgsm/functions/alert_mailgun.sh

0
lgsm/functions/alert_pushbullet.sh

0
lgsm/functions/alert_pushover.sh

56
lgsm/functions/alert_rocketchat.sh

@ -0,0 +1,56 @@
#!/bin/bash
# LinuxGSM alert_rocketchat.sh function
# Author: Alasdair Haig
# Website: https://linuxgsm.com
# Description: Sends Rocketchat alert.
functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
if ! command -v jq > /dev/null; then
fn_print_fail_nl "Sending Rocketchat alert: jq is missing."
fn_script_log_fatal "Sending Rocketchat alert: jq is missing."
fi
json=$(cat <<EOF
{
"alias":"Yggdragsil",
"text":"* ${alertemoji} ${alertsubject}* + \n ${alertbody}",
"attachments":[
{
"title":"Linuxgsm Alert",
"text":"Hostname: ${HOSTNAME}",
"color":"#36a64f",
"fields":[
{
"short":true,
"title":"Game:",
"value":"${gamename}"
},
{
"short":true,
"title":"Server IP:",
"value":"${alertip}:${port}"
},
{
"short":true,
"title":"Server Name:",
"value":"${servername}"
}
]
}
]
}
EOF
)
fn_print_dots "Sending Rocketchat alert"
rocketlaunch=$(curl -X POST -H "Content-Type:application/json" --data "$(echo -n "$json" | jq -c .)" "${rocketchatwebhook}")
if [ "${rocketlaunch}" == "ok" ]; then
fn_print_ok_nl "Sending Rocketchat alert"
fn_script_log_pass "Sending Rocketchat alert"
else
fn_print_fail_nl "Sending Rocketchat alert: ${rocketlaunch}"
fn_script_log_fatal "Sending Rocketchat alert: ${rocketlaunch}"
fi

0
lgsm/functions/alert_slack.sh

0
lgsm/functions/alert_telegram.sh

0
lgsm/functions/check.sh

0
lgsm/functions/check_config.sh

0
lgsm/functions/check_deps.sh

0
lgsm/functions/check_executable.sh

0
lgsm/functions/check_glibc.sh

0
lgsm/functions/check_ip.sh

0
lgsm/functions/check_last_update.sh

0
lgsm/functions/check_logs.sh

0
lgsm/functions/check_permissions.sh

0
lgsm/functions/check_root.sh

0
lgsm/functions/check_status.sh

0
lgsm/functions/check_steamcmd.sh

0
lgsm/functions/check_system_dir.sh

0
lgsm/functions/check_system_requirements.sh

0
lgsm/functions/check_tmuxception.sh

0
lgsm/functions/check_version.sh

0
lgsm/functions/command_backup.sh

0
lgsm/functions/command_console.sh

0
lgsm/functions/command_debug.sh

0
lgsm/functions/command_details.sh

0
lgsm/functions/command_dev_clear_functions.sh

0
lgsm/functions/command_dev_debug.sh

0
lgsm/functions/command_dev_detect_deps.sh

0
lgsm/functions/command_dev_detect_glibc.sh

0
lgsm/functions/command_dev_detect_ldd.sh

0
lgsm/functions/command_dev_query_raw.sh

0
lgsm/functions/command_donate.sh

0
lgsm/functions/command_fastdl.sh

0
lgsm/functions/command_install.sh

0
lgsm/functions/command_install_resources_mta.sh

0
lgsm/functions/command_mods_install.sh

0
lgsm/functions/command_mods_remove.sh

0
lgsm/functions/command_mods_update.sh

0
lgsm/functions/command_monitor.sh

0
lgsm/functions/command_postdetails.sh

0
lgsm/functions/command_restart.sh

0
lgsm/functions/command_start.sh

23
lgsm/functions/command_stop.sh

@ -208,6 +208,27 @@ fn_stop_graceful_avorion(){
fi
}
# Attempts graceful shutdown of valheim using the developer's
# custom half-baked shutdown procedure. Up till now, the game does
# not support any signals.
fn_stop_graceful_valheim(){
fn_print_dots "Graceful: echo 1 to server_exit.drp"
fn_script_log_info "Graceful: echo 1 to server_exit.drp"
# sends quit
/bin/echo 1 > "${serverfiles}"/server_exit.drp
# Animate dots for shutdown period
for seconds in {1..10}; do
sleep 1
fn_print_dots "Graceful: echo 1 to server_exit.drp: ${seconds}"
done
fn_print_ok "Graceful: echo 1 to server_exit.drp: ${seconds}: "
fn_print_ok_eol_nl
fn_script_log_pass "Graceful: echo 1 to server_exit.drp: OK: ${seconds} seconds"
}
fn_stop_graceful_select(){
if [ "${stopmode}" == "1" ]; then
fn_stop_tmux
@ -231,6 +252,8 @@ fn_stop_graceful_select(){
fn_stop_graceful_avorion
elif [ "${stopmode}" == "11" ]; then
fn_stop_graceful_cmd "end" 30
elif [ "${stopmode}" == "12" ]; then
fn_stop_graceful_valheim
fi
}

0
lgsm/functions/command_test_alert.sh

0
lgsm/functions/command_ts3_server_pass.sh

0
lgsm/functions/command_update.sh

0
lgsm/functions/command_update_functions.sh

0
lgsm/functions/command_update_linuxgsm.sh

0
lgsm/functions/command_validate.sh

0
lgsm/functions/command_wipe.sh

0
lgsm/functions/compress_unreal2_maps.sh

0
lgsm/functions/compress_ut99_maps.sh

0
lgsm/functions/core_dl.sh

0
lgsm/functions/core_exit.sh

10
lgsm/functions/core_functions.sh

@ -465,6 +465,11 @@ functionfile="${FUNCNAME[0]}"
fn_fetch_function
}
fix_vh.sh(){
functionfile="${FUNCNAME[0]}"
fn_fetch_function
}
fix_wurm.sh(){
functionfile="${FUNCNAME[0]}"
fn_fetch_function
@ -549,6 +554,11 @@ functionfile="${FUNCNAME[0]}"
fn_fetch_function
}
alert_rocketchat.sh(){
functionfile="${FUNCNAME[0]}"
fn_fetch_function
}
alert_slack.sh(){
functionfile="${FUNCNAME[0]}"
fn_fetch_function

0
lgsm/functions/core_getopt.sh

0
lgsm/functions/core_legacy.sh

0
lgsm/functions/core_logs.sh

0
lgsm/functions/core_messages.sh

0
lgsm/functions/core_trap.sh

2
lgsm/functions/fix.sh

@ -82,6 +82,8 @@ if [ "${commandname}" != "INSTALL" ]&&[ -z "${fixbypass}" ]; then
fix_mta.sh
elif [ "${shortname}" == "unt" ]; then
fix_unt.sh
elif [ "${shortname}" == "vh" ]; then
fix_vh.sh
elif [ "${shortname}" == "wurm" ]; then
fix_wurm.sh
elif [ "${shortname}" == "zmr" ]; then

0
lgsm/functions/fix_ark.sh

0
lgsm/functions/fix_arma3.sh

0
lgsm/functions/fix_av.sh

0
lgsm/functions/fix_cmw.sh

0
lgsm/functions/fix_csgo.sh

0
lgsm/functions/fix_dst.sh

0
lgsm/functions/fix_ges.sh

0
lgsm/functions/fix_hw.sh

0
lgsm/functions/fix_ins.sh

0
lgsm/functions/fix_kf.sh

0
lgsm/functions/fix_kf2.sh

0
lgsm/functions/fix_mcb.sh

0
lgsm/functions/fix_mta.sh

0
lgsm/functions/fix_nmrih.sh

0
lgsm/functions/fix_onset.sh

0
lgsm/functions/fix_ro.sh

0
lgsm/functions/fix_rust.sh

0
lgsm/functions/fix_rw.sh

0
lgsm/functions/fix_sdtd.sh

0
lgsm/functions/fix_sfc.sh

0
lgsm/functions/fix_sof2.sh

0
lgsm/functions/fix_ss3.sh

0
lgsm/functions/fix_steamcmd.sh

0
lgsm/functions/fix_terraria.sh

0
lgsm/functions/fix_tf2.sh

0
lgsm/functions/fix_ts3.sh

0
lgsm/functions/fix_tu.sh

0
lgsm/functions/fix_unt.sh

0
lgsm/functions/fix_ut.sh

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

Loading…
Cancel
Save