#!/bin/sh if [ "${DEBUGGING}" = "true" ]; then set -o xtrace fi #set -o errexit #set -o pipefail #travistest: unbound variable #set -o nounset ## Server Start Settings | https://docs.linuxgsm.com/configuration/start-parameters ip="$SERVER_IP" port="$SERVER_PORT" clientport="$SERVER_CLIENTPORT" sourcetvport="$SERVER_SOURCETVPORT" defaultmap="$SERVER_DEFAULT_MAP" maxplayers="$SERVER_MAX_PLAYERS" tickrate="$SERVER_TICKRATE" gamemode="$SERVER_GAMEMODE" ## Workshop Parameters | https://wiki.garrysmod.com/page/Workshop_for_Dedicated_Servers # To get an API key visit - https://steamcommunity.com/dev/apikey wsapikey="$WORKSHOP_API_KEY" wscollectionid="$WORKSHOP_COLLECTION_ID" ## Custom Start Parameters # Default -disableluarefresh, disables lua autorefresh reducing server lag. Auto refresh only useful for developers. customparms="$SERVER_ADDITIONAL_PARAMETERS" ## Optional: Game Server Login Token # GSLT can be used for running a public server. # 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} +hostname '$servername' ${customparms}" } #### LinuxGSM Settings #### ## Notification Alerts # (on|off) # Display IP | https://docs.linuxgsm.com/alerts#display-ip #shellcheck disable=SC2034 displayip="$LGSM_DISPLAYIP" # More info | https://docs.linuxgsm.com/alerts#more-info #shellcheck disable=SC2034 postalert="$LGSM_POSTALERT" #shellcheck disable=SC2034 postdays="$LGSM_POSTDAYS" #shellcheck disable=SC2034 posttarget="$LGSM_POSTTARGET" # Discord Alerts | https://docs.linuxgsm.com/alerts/discord #shellcheck disable=SC2034 discordalert="$LGSM_DISCORDALERT" #shellcheck disable=SC2034 discordwebhook="$LGSM_DISCORDWEBHOOK" # Email Alerts | https://docs.linuxgsm.com/alerts/email #shellcheck disable=SC2034 emailalert="$LGSM_EMAILALERT" #shellcheck disable=SC2034 email="$LGSM_EMAIL" #shellcheck disable=SC2034 emailfrom="$LGSM_EMAILFROM" # IFTTT Alerts | https://docs.linuxgsm.com/alerts/ifttt #shellcheck disable=SC2034 iftttalert="$LGSM_IFTTTALERT" #shellcheck disable=SC2034 ifttttoken="$LGSM_IFTTTTOKEN" #shellcheck disable=SC2034 iftttevent="$LGSM_IFTTTEVENT" # Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun #shellcheck disable=SC2034 mailgunalert="$LGSM_MAILGUNALERT" #shellcheck disable=SC2034 mailguntoken="$LGSM_MAILGUNTOKEN" #shellcheck disable=SC2034 mailgundomain="$LGSM_MAILGUNDOMAIN" #shellcheck disable=SC2034 mailgunemailfrom="$LGSM_MAILGUNEMAILFROM" #shellcheck disable=SC2034 mailgunemail="$LGSM_MAILGUNEMAIL" # Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet #shellcheck disable=SC2034 pushbulletalert="$LGSM_PUSHBULLETALERT" #shellcheck disable=SC2034 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" # 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. #shellcheck disable=SC2034 telegramalert="$LGSM_TELEGRAMALERT" #shellcheck disable=SC2034 telegramtoken="$LGSM_TELEGRAMTOKEN" #shellcheck disable=SC2034 telegramchatid="$LGSM_TELEGRAMCHATID" #shellcheck disable=SC2034 curlcustomstring="$LGSM_CURLCUSTOMSTRING" ## Updating | https://docs.linuxgsm.com/commands/update #shellcheck disable=SC2034 updateonstart="$LGSM_UPDATEONSTART" ## Backup | https://docs.linuxgsm.com/commands/backup #shellcheck disable=SC2034 maxbackups="$LGSM_MAXBACKUPS" #shellcheck disable=SC2034 maxbackupdays="$LGSM_MAXBACKUPDAYS" #shellcheck disable=SC2034 stoponbackup="$LGSM_STOPONBACKUP" ## Logging | https://docs.linuxgsm.com/features/logging #shellcheck disable=SC2034 consolelogging="$LGSM_CONSOLELOGGING" #shellcheck disable=SC2034 logdays="$LGSM_LOGDAYS" ## Monitor | https://docs.linuxgsm.com/commands/monitor # Query delay time #shellcheck disable=SC2034 querydelay="$LGSM_QUERYDELAY" #### LinuxGSM Advanced Settings #### # ANSI Colors #shellcheck disable=SC2034 ansi="on" # Message Display Time #shellcheck disable=SC2034 sleeptime="0.5" ## SteamCMD Settings # Server appid #shellcheck disable=SC2034 appid="4020" # SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch #shellcheck disable=SC2034 branch="$LGSM_BRANCH" # Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server #shellcheck disable=SC2034 steammaster="$LGSM_STEAMMASTER"