From 7f5d8ca09bd4e64e6597fc1d843f9c348555f64b Mon Sep 17 00:00:00 2001 From: Lucas Briese Date: Wed, 1 Mar 2023 18:11:11 +0100 Subject: [PATCH] fix(config): startargs upstream func -> var --- gmod/common.cfg | 132 +++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 107 insertions(+), 25 deletions(-) diff --git a/gmod/common.cfg b/gmod/common.cfg index afd57fe..d9f6370 100644 --- a/gmod/common.cfg +++ b/gmod/common.cfg @@ -1,15 +1,15 @@ -#!/bin/sh - +################################## +######## Default Settings ######## +################################## +# Copy settings from here and use them in either: +# common.cfg - applies settings to every instance. +# [instance].cfg - applies settings to a specific instance. if [ "${DEBUGGING}" = "true" ]; then set -o xtrace fi +#### Game Server Settings #### -#set -o errexit -#set -o pipefail -#travistest: unbound variable -#set -o nounset - -## Server Start Settings | https://docs.linuxgsm.com/configuration/start-parameters +## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters ip="$SERVER_IP" port="$SERVER_PORT" clientport="$SERVER_CLIENTPORT" @@ -33,14 +33,17 @@ customparms="$SERVER_ADDITIONAL_PARAMETERS" # More info: https://linuxgsm.com/gslt gslt="$SERVER_LOGIN_TOKEN" -## Server Start Command | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters -fn_parms(){ - #shellcheck disable=SC2034,SC2154 - parms="-game garrysmod -strictportbind -ip ${ip} -port ${port} -tickrate ${tickrate} +host_workshop_collection ${wscollectionid} -authkey ${wsapikey} +clientport ${clientport} +tv_port ${sourcetvport} +gamemode ${gamemode} +map ${defaultmap} +sv_setsteamaccount ${gslt} +servercfgfile ${servercfg} -maxplayers ${maxplayers} ${customparms}" -} +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="-game garrysmod -strictportbind -ip ${ip} -port ${port} -tickrate ${tickrate} +host_workshop_collection ${wscollectionid} -authkey ${wsapikey} +clientport ${clientport} +tv_port ${sourcetvport} +gamemode ${gamemode} +map ${defaultmap} +sv_setsteamaccount ${gslt} +servercfgfile ${servercfg} -maxplayers ${maxplayers} ${customparms}" #### 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) @@ -70,6 +73,11 @@ email="$LGSM_EMAIL" #shellcheck disable=SC2034 emailfrom="$LGSM_EMAILFROM" +# Gotify Alerts | https://docs.linuxgsm.com/alerts/gotify +gotifyalert="off" +gotifytoken="token" +gotifywebhook="webhook" + # IFTTT Alerts | https://docs.linuxgsm.com/alerts/ifttt #shellcheck disable=SC2034 iftttalert="$LGSM_IFTTTALERT" @@ -81,6 +89,7 @@ iftttevent="$LGSM_IFTTTEVENT" # Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun #shellcheck disable=SC2034 mailgunalert="$LGSM_MAILGUNALERT" +mailgunapiregion="us" #shellcheck disable=SC2034 mailguntoken="$LGSM_MAILGUNTOKEN" #shellcheck disable=SC2034 @@ -98,16 +107,28 @@ pushbullettoken="$LGSM_PUSHBULLETTOKEN" #shellcheck disable=SC2034 channeltag="$LGSM_CHANNELTAG" + # Pushover Alerts | https://docs.linuxgsm.com/alerts/pushover #shellcheck disable=SC2034 pushoveralert="$LGSM_PUSHOVERALERT" #shellcheck disable=SC2034 pushovertoken="$LGSM_PUSHOVERTOKEN" +pushoveruserkey="userkey" + +# Rocket.Chat Alerts | https://docs.linuxgsm.com/alerts/rocket.chat +rocketchatalert="off" +rocketchatwebhook="webhook" +rocketchattoken="" + +# Slack Alerts | https://docs.linuxgsm.com/alerts/slack +slackalert="off" +slackwebhook="webhook" # Telegram Alerts | https://docs.linuxgsm.com/alerts/telegram -# You can add a custom cURL string eg proxy (useful in Russia) 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. +# You can add a custom cURL string eg proxy (useful in Russia) in "curlcustomstring". +# For example "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help". +#shellcheck disable=SC2034 +telegramapi="api.telegram.org" #shellcheck disable=SC2034 telegramalert="$LGSM_TELEGRAMALERT" #shellcheck disable=SC2034 @@ -140,23 +161,84 @@ logdays="$LGSM_LOGDAYS" #shellcheck disable=SC2034 querydelay="$LGSM_QUERYDELAY" -#### LinuxGSM Advanced Settings #### - -# ANSI Colors -#shellcheck disable=SC2034 +## ANSI Colors | https://docs.linuxgsm.com/features/ansi-colors ansi="on" -# Message Display Time -#shellcheck disable=SC2034 +#### Advanced Settings #### + +## Message Display Time | https://docs.linuxgsm.com/features/message-display-time sleeptime="0.5" -## SteamCMD Settings +## SteamCMD Settings | https://docs.linuxgsm.com/steamcmd # Server appid -#shellcheck disable=SC2034 appid="4020" +steamcmdforcewindows="no" # SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch -#shellcheck disable=SC2034 branch="$LGSM_BRANCH" +betapassword="" # Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server #shellcheck disable=SC2034 steammaster="$LGSM_STEAMMASTER" + +## Stop Mode | https://docs.linuxgsm.com/features/stop-mode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: GoldSrc +# 10: Avorion +# 11: end +stopmode="3" + +## Query mode +# 1: session only +# 2: gamedig (gsquery fallback) +# 3: gamedig +# 4: gsquery +# 5: tcp +querymode="2" +querytype="protocol-valve" + +## Console type +consoleverbose="yes" +consoleinteract="yes" + +## Game Server Details +# Do not edit +gamename="Garry's Mod" +engine="source" +glibc="2.15" + +#### Directories #### +# Edit with care + +## Game Server Directories +systemdir="${serverfiles}/garrysmod" +addonsdir="${systemdir}/addons" +executabledir="${serverfiles}" +executable="./srcds_run" +servercfgdir="${systemdir}/cfg" +servercfg="${selfname}.cfg" +servercfgdefault="server.cfg" +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" \ No newline at end of file