110 changed files with 848 additions and 176 deletions
@ -67,6 +67,13 @@ rocketchatalert="off" |
|||
rocketchatwebhook="webhook" |
|||
rocketchattoken="" |
|||
|
|||
# Sendgrid Email Alerts | https://docs.linuxgsm.com/alerts/sendgrid |
|||
sendgridalert="off" |
|||
sendgridtoken="accesstoken" |
|||
sendgriddomain="example.com" |
|||
sendgridemailfrom="[email protected]" |
|||
sendgridemail="[email protected]" |
|||
|
|||
# Slack Alerts | https://docs.linuxgsm.com/alerts/slack |
|||
slackalert="off" |
|||
slackwebhook="webhook" |
|||
@ -106,6 +113,7 @@ sleeptime="0.5" |
|||
## SteamCMD Settings | https://docs.linuxgsm.com/steamcmd |
|||
# Server appid |
|||
appid="261140" |
|||
steamcmdforcewindows="no" |
|||
# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch |
|||
branch="" |
|||
betapassword="" |
|||
|
@ -0,0 +1,169 @@ |
|||
################################## |
|||
######## Default Settings ######## |
|||
################################## |
|||
# DO NOT EDIT WILL BE OVERWRITTEN! |
|||
# Copy settings from here and use them in either |
|||
# common.cfg - applies settings to every instance |
|||
# [instance].cfg - applies settings to a specific instance |
|||
|
|||
#### Server Settings #### |
|||
|
|||
## Server Start Settings | https://docs.linuxgsm.com/configuration/start-parameters |
|||
## All server settings except the server port are done in the config file: |
|||
## Docs: https://en.scpslgame.com/index.php?title=Docs:Server_Config |
|||
port="7777" |
|||
|
|||
## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters |
|||
fn_parms(){ |
|||
parms="${port}" |
|||
} |
|||
|
|||
#### LinuxGSM Settings #### |
|||
|
|||
## Notification Alerts |
|||
# (on|off) |
|||
|
|||
# Display IP | https://docs.linuxgsm.com/alerts#display-ip |
|||
displayip="" |
|||
|
|||
# More info | https://docs.linuxgsm.com/alerts#more-info |
|||
postalert="off" |
|||
postdays="7" |
|||
posttarget="https://hastebin.com" |
|||
|
|||
# Discord Alerts | https://docs.linuxgsm.com/alerts/discord |
|||
discordalert="off" |
|||
discordwebhook="webhook" |
|||
|
|||
# Slack Alerts | https://docs.linuxgsm.com/alerts/slack |
|||
slackalert="off" |
|||
slackwebhook="webhook" |
|||
|
|||
# Email Alerts | https://docs.linuxgsm.com/alerts/email |
|||
emailalert="off" |
|||
email="[email protected]" |
|||
emailfrom="" |
|||
|
|||
# IFTTT Alerts | https://docs.linuxgsm.com/alerts/ifttt |
|||
iftttalert="off" |
|||
ifttttoken="accesstoken" |
|||
iftttevent="linuxgsm_alert" |
|||
|
|||
# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun |
|||
mailgunalert="off" |
|||
mailguntoken="accesstoken" |
|||
mailgundomain="example.com" |
|||
mailgunemailfrom="[email protected]" |
|||
mailgunemail="[email protected]" |
|||
|
|||
# Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet |
|||
pushbulletalert="off" |
|||
pushbullettoken="accesstoken" |
|||
channeltag="" |
|||
|
|||
# Pushover Alerts | https://docs.linuxgsm.com/alerts/pushover |
|||
pushoveralert="off" |
|||
pushovertoken="accesstoken" |
|||
|
|||
# Telegram Alerts | https://docs.linuxgsm.com/alerts/telegram |
|||
# You can add a custom cURL string eg proxy (useful in Russia) or else in "curlcustomstring". |
|||
# like a "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help", if you not need |
|||
# any custom string in curl - simple ignore this parameter. |
|||
telegramalert="off" |
|||
telegramtoken="accesstoken" |
|||
telegramchatid="" |
|||
curlcustomstring="" |
|||
|
|||
## Updating | https://docs.linuxgsm.com/commands/update |
|||
updateonstart="off" |
|||
|
|||
## Backup | https://docs.linuxgsm.com/commands/backup |
|||
maxbackups="4" |
|||
maxbackupdays="30" |
|||
stoponbackup="on" |
|||
|
|||
## Logging | https://docs.linuxgsm.com/features/logging |
|||
consolelogging="on" |
|||
logdays="7" |
|||
|
|||
## Monitor | https://docs.linuxgsm.com/commands/monitor |
|||
# Query delay time |
|||
querydelay="1" |
|||
|
|||
#### LinuxGSM Advanced Settings #### |
|||
|
|||
# ANSI Colors |
|||
ansi="on" |
|||
|
|||
# Message Display Time |
|||
sleeptime="0.5" |
|||
|
|||
# Stop Mode | https://docs.linuxgsm.com/steamcmd/stopmode |
|||
# 1: tmux kill |
|||
# 2: CTRL+c |
|||
# 3: quit |
|||
# 4: quit 120s |
|||
# 5: stop |
|||
# 6: q |
|||
# 7: exit |
|||
# 8: 7 Days to Die |
|||
# 9: Gold Source |
|||
# 10: Teamspeak 3 |
|||
stopmode="7" |
|||
|
|||
## Query mode |
|||
# 1: session only |
|||
# 2: gamedig + gsquery |
|||
# 3: gamedig |
|||
# 4: gsquery |
|||
# 5: tcp |
|||
querymode="1" |
|||
querytype="" |
|||
|
|||
## Console type |
|||
consoleverbose="yes" |
|||
consoleinteract="yes" |
|||
|
|||
## SteamCMD Settings |
|||
# Server appid |
|||
appid="996560" |
|||
steamcmdforcewindows="no" |
|||
# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch |
|||
branch="" |
|||
# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server |
|||
steammaster="" |
|||
|
|||
## LinuxGSM Server Details |
|||
# Do not edit |
|||
gamename="SCP: Secret Laboratory" |
|||
engine="unity3d" |
|||
glibc="2.27" |
|||
|
|||
#### Directories #### |
|||
# Edit with care |
|||
|
|||
## Server Specific Directories |
|||
systemdir="${serverfiles}" |
|||
executabledir="${systemdir}" |
|||
executable="./LocalAdmin" |
|||
servercfg="config_gameplay.txt" |
|||
servercfgdefault="config_gameplay.txt" |
|||
servercfgdir="${HOME}/.config/SCP Secret Laboratory/config/${port}" |
|||
servercfgfullpath="${servercfgdir}/${servercfg}" |
|||
|
|||
## Backup Directory |
|||
backupdir="${rootdir}/backups" |
|||
|
|||
## Logging Directories |
|||
logdir="${rootdir}/log" |
|||
gamelogdir="${HOME}/.config/SCP Secret Laboratory/LocalAdminLogs/${port}" |
|||
lgsmlogdir="${logdir}/script" |
|||
consolelogdir="${logdir}/console" |
|||
lgsmlog="${lgsmlogdir}/${selfname}-script.log" |
|||
consolelog="${consolelogdir}/${selfname}-console.log" |
|||
alertlog="${lgsmlogdir}/${selfname}-alert.log" |
|||
postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" |
|||
|
|||
## Logs Naming |
|||
lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" |
|||
consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" |
@ -0,0 +1,169 @@ |
|||
################################## |
|||
######## Default Settings ######## |
|||
################################## |
|||
# DO NOT EDIT WILL BE OVERWRITTEN! |
|||
# Copy settings from here and use them in either |
|||
# common.cfg - applies settings to every instance |
|||
# [instance].cfg - applies settings to a specific instance |
|||
|
|||
#### Server Settings #### |
|||
|
|||
## Server Start Settings | https://docs.linuxgsm.com/configuration/start-parameters |
|||
## All server settings except the server port are done in the config file: |
|||
## Docs: https://en.scpslgame.com/index.php?title=Docs:Server_Config |
|||
port="7777" |
|||
|
|||
## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters |
|||
fn_parms(){ |
|||
parms="${port}" |
|||
} |
|||
|
|||
#### LinuxGSM Settings #### |
|||
|
|||
## Notification Alerts |
|||
# (on|off) |
|||
|
|||
# Display IP | https://docs.linuxgsm.com/alerts#display-ip |
|||
displayip="" |
|||
|
|||
# More info | https://docs.linuxgsm.com/alerts#more-info |
|||
postalert="off" |
|||
postdays="7" |
|||
posttarget="https://hastebin.com" |
|||
|
|||
# Discord Alerts | https://docs.linuxgsm.com/alerts/discord |
|||
discordalert="off" |
|||
discordwebhook="webhook" |
|||
|
|||
# Slack Alerts | https://docs.linuxgsm.com/alerts/slack |
|||
slackalert="off" |
|||
slackwebhook="webhook" |
|||
|
|||
# Email Alerts | https://docs.linuxgsm.com/alerts/email |
|||
emailalert="off" |
|||
email="[email protected]" |
|||
emailfrom="" |
|||
|
|||
# IFTTT Alerts | https://docs.linuxgsm.com/alerts/ifttt |
|||
iftttalert="off" |
|||
ifttttoken="accesstoken" |
|||
iftttevent="linuxgsm_alert" |
|||
|
|||
# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun |
|||
mailgunalert="off" |
|||
mailguntoken="accesstoken" |
|||
mailgundomain="example.com" |
|||
mailgunemailfrom="[email protected]" |
|||
mailgunemail="[email protected]" |
|||
|
|||
# Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet |
|||
pushbulletalert="off" |
|||
pushbullettoken="accesstoken" |
|||
channeltag="" |
|||
|
|||
# Pushover Alerts | https://docs.linuxgsm.com/alerts/pushover |
|||
pushoveralert="off" |
|||
pushovertoken="accesstoken" |
|||
|
|||
# Telegram Alerts | https://docs.linuxgsm.com/alerts/telegram |
|||
# You can add a custom cURL string eg proxy (useful in Russia) or else in "curlcustomstring". |
|||
# like a "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help", if you not need |
|||
# any custom string in curl - simple ignore this parameter. |
|||
telegramalert="off" |
|||
telegramtoken="accesstoken" |
|||
telegramchatid="" |
|||
curlcustomstring="" |
|||
|
|||
## Updating | https://docs.linuxgsm.com/commands/update |
|||
updateonstart="off" |
|||
|
|||
## Backup | https://docs.linuxgsm.com/commands/backup |
|||
maxbackups="4" |
|||
maxbackupdays="30" |
|||
stoponbackup="on" |
|||
|
|||
## Logging | https://docs.linuxgsm.com/features/logging |
|||
consolelogging="on" |
|||
logdays="7" |
|||
|
|||
## Monitor | https://docs.linuxgsm.com/commands/monitor |
|||
# Query delay time |
|||
querydelay="1" |
|||
|
|||
#### LinuxGSM Advanced Settings #### |
|||
|
|||
# ANSI Colors |
|||
ansi="on" |
|||
|
|||
# Message Display Time |
|||
sleeptime="0.5" |
|||
|
|||
# Stop Mode | https://docs.linuxgsm.com/steamcmd/stopmode |
|||
# 1: tmux kill |
|||
# 2: CTRL+c |
|||
# 3: quit |
|||
# 4: quit 120s |
|||
# 5: stop |
|||
# 6: q |
|||
# 7: exit |
|||
# 8: 7 Days to Die |
|||
# 9: Gold Source |
|||
# 10: Teamspeak 3 |
|||
stopmode="7" |
|||
|
|||
## Query mode |
|||
# 1: session only |
|||
# 2: gamedig + gsquery |
|||
# 3: gamedig |
|||
# 4: gsquery |
|||
# 5: tcp |
|||
querymode="1" |
|||
querytype="" |
|||
|
|||
## Console type |
|||
consoleverbose="yes" |
|||
consoleinteract="yes" |
|||
|
|||
## SteamCMD Settings |
|||
# Server appid |
|||
appid="786920" |
|||
steamcmdforcewindows="no" |
|||
# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch |
|||
branch="" |
|||
# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server |
|||
steammaster="" |
|||
|
|||
## LinuxGSM Server Details |
|||
# Do not edit |
|||
gamename="SCP: Secret Laboratory ServerMod" |
|||
engine="unity3d" |
|||
glibc="2.27" |
|||
|
|||
#### Directories #### |
|||
# Edit with care |
|||
|
|||
## Server Specific Directories |
|||
systemdir="${serverfiles}" |
|||
executabledir="${systemdir}" |
|||
executable="./LocalAdmin" |
|||
servercfg="config_gameplay.txt" |
|||
servercfgdefault="config_gameplay.txt" |
|||
servercfgdir="${HOME}/.config/SCP Secret Laboratory/config/${port}" |
|||
servercfgfullpath="${servercfgdir}/${servercfg}" |
|||
|
|||
## Backup Directory |
|||
backupdir="${rootdir}/backups" |
|||
|
|||
## Logging Directories |
|||
logdir="${rootdir}/log" |
|||
gamelogdir="${HOME}/.config/SCP Secret Laboratory/LocalAdminLogs/${port}" |
|||
lgsmlogdir="${logdir}/script" |
|||
consolelogdir="${logdir}/console" |
|||
lgsmlog="${lgsmlogdir}/${selfname}-script.log" |
|||
consolelog="${consolelogdir}/${selfname}-console.log" |
|||
alertlog="${lgsmlogdir}/${selfname}-alert.log" |
|||
postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" |
|||
|
|||
## Logs Naming |
|||
lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" |
|||
consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" |
Can't render this file because it has a wrong number of fields in line 66.
|
@ -0,0 +1,23 @@ |
|||
#!/bin/bash |
|||
# LinuxGSM alert_sendgrid.sh function |
|||
# Author: Daniel Gibbs |
|||
# Website: https://linuxgsm.com |
|||
# Description: Sends SendGrid Email alert. |
|||
|
|||
functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" |
|||
|
|||
fn_print_dots "Sending Email alert: SendGrid: ${email}" |
|||
|
|||
sendgridsend=$(curl -s --request POST \ |
|||
--url https://api.sendgrid.com/v3/mail/send \ |
|||
--header "Authorization: Bearer ${sendgridtoken}" \ |
|||
--header 'Content-Type: application/json' \ |
|||
--data '{"personalizations": [{"to": [{"email": ${sendgridemail}"}]}],"from": {"email": "${sendgridemailfrom}"},"subject": "${alertemoji} ${alertsubject} ${alertemoji}","content": [{"type": "text/plain", "value": "$(cat "${alertlog}")"}]}') |
|||
|
|||
if [ -z "${sendgridsend}" ]; then |
|||
fn_print_fail_nl "Sending Email alert: SendGrid: ${email}" |
|||
fn_script_log_fatal "Sending Email alert: SendGrid: ${email}" |
|||
else |
|||
fn_print_ok_nl "Sending Email alert: SendGrid: ${email}" |
|||
fn_script_log_pass "Sending Email alert: SendGrid: ${email}" |
|||
fi |
@ -0,0 +1,113 @@ |
|||
#!/bin/bash |
|||
# LinuxGSM core_github.sh function |
|||
# Author: Christian Birk |
|||
# Website: https://linuxgsm.com |
|||
# Description: core function file for updates via github |
|||
|
|||
functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" |
|||
|
|||
github_api="https://api.github.com" |
|||
|
|||
fn_githublocalversionfile(){ |
|||
local githubreleaseuser="${1}" |
|||
local githubreleaserepo="${2}" |
|||
|
|||
githublocalversionfile="${datadir}/github-${githubreleaseuser}-${githubreleaserepo}-version" |
|||
} |
|||
|
|||
# $1 githubuser/group |
|||
# $2 github repo name |
|||
fn_github_get_latest_release_version(){ |
|||
local githubreleaseuser="${1}" |
|||
local githubreleaserepo="${2}" |
|||
local githublatestreleaseurl="${github_api}/repos/${githubreleaseuser}/${githubreleaserepo}/releases/latest" |
|||
|
|||
githubreleaseversion=$(curl -s --connect-timeout 10 "${githublatestreleaseurl}" | jq '.tag_name' ) |
|||
|
|||
# error if no version is there |
|||
if [ -z "${githubreleaseversion}" ]; then |
|||
fn_print_fail_nl "Cannot get version from GitHub API for ${githubreleaseuser}/${githubreleaserepo}" |
|||
fn_script_log_fatal "Cannot get version from GitHub API for ${githubreleaseuser}/${githubreleaserepo}" |
|||
fi |
|||
} |
|||
|
|||
# $1 githubuser/group |
|||
# $2 github repo name |
|||
fn_github_set_latest_release_version(){ |
|||
local githubreleaseuser="${1}" |
|||
local githubreleaserepo="${2}" |
|||
|
|||
fn_githublocalversionfile "${githubreleaseuser}" "${githubreleaserepo}" |
|||
|
|||
local githublatestreleaseurl="${github_api}/repos/${githubreleaseuser}/${githubreleaserepo}/releases/latest" |
|||
githubreleaseversion=$(curl -s "${githublatestreleaseurl}" | jq -r '.tag_name' ) |
|||
|
|||
# error if no version is there |
|||
if [ -z "${githubreleaseversion}" ]; then |
|||
fn_print_fail_nl "Cannot get version from GitHub API for ${githubreleaseuser}/${githubreleaserepo}" |
|||
fn_script_log_fatal "Cannot get version from GitHub API for ${githubreleaseuser}/${githubreleaserepo}" |
|||
else |
|||
echo "${githubreleaseversion}" > "${githublocalversionfile}" |
|||
fi |
|||
} |
|||
|
|||
# $1 githubuser/group |
|||
# $2 github repo name |
|||
fn_github_get_installed_version(){ |
|||
local githubreleaseuser="${1}" |
|||
local githubreleaserepo="${2}" |
|||
|
|||
fn_githublocalversionfile "${githubreleaseuser}" "${githubreleaserepo}" |
|||
|
|||
githublocalversion=$(cat "${githublocalversionfile}") |
|||
} |
|||
|
|||
# $1 githubuser/group |
|||
# $2 github repo name |
|||
# if a update needs to be downloaded - updateneeded is set to 1 |
|||
fn_github_compare_version(){ |
|||
local githubreleaseuser="${1}" |
|||
local githubreleaserepo="${2}" |
|||
exitcode=0 |
|||
updateneeded=0 |
|||
|
|||
fn_githublocalversionfile "${githubreleaseuser}" "${githubreleaserepo}" |
|||
local githublatestreleaseurl="${github_api}/repos/${githubreleaseuser}/${githubreleaserepo}/releases/latest" |
|||
|
|||
githublocalversion=$(cat "${githublocalversionfile}") |
|||
githubreleaseversion=$(curl -s "${githublatestreleaseurl}" | jq '.tag_name' ) |
|||
|
|||
# error if no version is there |
|||
if [ -z "${githubreleaseversion}" ]; then |
|||
fn_print_fail_nl "Can not get version from Github Api for ${githubreleaseuser}/${githubreleaserepo}" |
|||
fn_script_log_fatal "Can not get version from Github Api for ${githubreleaseuser}/${githubreleaserepo}" |
|||
else |
|||
if [ "${githublocalversion}" == "${githubreleaseversion}" ]; then |
|||
echo -en "\n" |
|||
echo -e "No update from github.com/${githubreleaseuser}/${githubreleaserepo}/ available:" |
|||
echo -e "* Local build: ${red}${githublocalversion}${default}" |
|||
echo -e "* Remote build: ${green}${githubreleaseversion}${default}" |
|||
echo -en "\n" |
|||
else |
|||
# check if version that is installed is higher than the remote version to not override it |
|||
last_version=$(echo -e "${githublocalversion}\n${githubreleaseversion}" | sort -V | head -n1 ) |
|||
if [ "${githubreleaseversion}" == "${last_version}" ]; then |
|||
echo -en "\n" |
|||
echo -e "Update from github.com/${githubreleaseuser}/${githubreleaserepo}/ available:" |
|||
echo -e "* Local build: ${red}${githublocalversion}${default}" |
|||
echo -e "* Remote build: ${green}${githubreleaseversion}${default}" |
|||
echo -en "\n" |
|||
updateneeded=1 |
|||
else |
|||
# local version is higher than the remote version output this to the user |
|||
# strange case but could be possible, as a release could be removed from github |
|||
echo -en "\n" |
|||
echo -e "Local version is newer than the remote version" |
|||
echo -e "* Local version: ${green}${githublocalversion}${default}" |
|||
echo -e "* Remote version: ${green}${githubreleaseversion}${default}" |
|||
echo -en "\n" |
|||
exitcode=1 |
|||
fi |
|||
fi |
|||
fi |
|||
} |
Some files were not shown because too many files changed in this diff
Loading…
Reference in new issue