feat(newserver): soulmask (#4590)

* feat: reference new smserver

* feat: add default config

* feat: add stop command using telnet

* fix: remove duplicate unused telnetpassword var

* feat: add soulmask to config & info functions

* fix: remove ini config for now

* fix: startparameter initialization fix

* feat: remove pve fixed param in startparameters

* fix: update default gamelogdir

* fix: handle telnet response during stop process

* add sm fix

* add fix_sm.sh

* add ss command

* and

* add memory requirements

* adjust start parameters

* remove telnetpassword

* add backup interval

a

* comments

* rename variables to telnetpassword

* var name change

---------

Co-authored-by: Daniel Gibbs <me@danielgibbs.co.uk>
This commit is contained in:
Thomas S 2024-06-16 20:18:00 +02:00 committed by GitHub
parent 0e7314d26a
commit 493a3a82fa
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
35 changed files with 381 additions and 20 deletions

View File

@ -0,0 +1,189 @@
##################################
######## 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 ####
## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters
servername="LinuxGSM"
serverpassword=""
adminpassword=""
port="8777"
queryport="27015"
telnetport="18888"
maxplayers="50"
backupinterval="15" # Backup interval in minutes.
defaultmap="Level01_Main"
## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters
startparameters="WS ${defaultmap} -MultiHome=${ip} -Port=${port} -EchoPort=${telnetport} -QueryPort=${queryport} -SteamServerName='${servername}' -PSW='${serverpassword}' -adminpsw='${adminpassword}' -MaxPlayers=${maxplayers} -initbackup -backupinterval=${backupinterval} -UTF8Output -forcepassthrough -log"
#### 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"
# Alert on Start/Stop/Restart
statusalert="off"
# 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=""
# Gotify Alerts | https://docs.linuxgsm.com/alerts/gotify
gotifyalert="off"
gotifytoken="token"
gotifywebhook="webhook"
# IFTTT Alerts | https://docs.linuxgsm.com/alerts/ifttt
iftttalert="off"
ifttttoken="accesstoken"
iftttevent="linuxgsm_alert"
# 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"
pushoveruserkey="userkey"
# Rocket.Chat Alerts | https://docs.linuxgsm.com/alerts/rocket.chat
rocketchatalert="off"
rocketchatwebhook="webhook"
# 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) in "curlcustomstring".
# For example "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help all".
telegramapi="api.telegram.org"
telegramalert="off"
telegramtoken="accesstoken"
telegramchatid=""
telegramthreadid=""
telegramsilentnotification="false"
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="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="3017300"
steamcmdforcewindows="no"
# SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch
branch=""
betapassword=""
# Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server
steammaster="true"
## 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
# 12: shutdown
# 13: soulmask
stopmode="13"
## 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="no"
## Game Server Details
# Do not edit
gamename="Soulmask"
engine="unreal4"
glibc="2.17"
#### Directories ####
# Edit with care
## Game Server Directories
systemdir="${serverfiles}/WS"
executabledir="${systemdir}/Binaries/Linux"
executable="./WSServer-Linux-Shipping"
## Backup Directory
backupdir="${lgsmdir}/backup"
## Logging Directories
[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log"
gamelogdir="${systemdir}/WS/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"
## Log Parameters
logtimestamp="off"
logtimestampformat="%Y-%m-%d %H:%M:%S"

View File

@ -25,7 +25,7 @@ greenhand="true"
maxplayers="40"
maxqueuesize="50"
queuevalidtime="120"
saveinterval="300"
saveinterval="300" # Auto-save in seconds.
serveradmins="" # Use 17-digit Steam IDs separated by commas to grant admin privileges to players.
servername="LinuxGSM"
serverpassword=""

View File

@ -10,14 +10,13 @@
## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters
servername="LinuxGSM"
# Minimum password length is 5.
serverpassword=""
serverpassword="" # Minimum password length is 5.
port="2456"
worldname="${selfname}"
public="1"
savedir="$HOME/.config/unity3d/IronGate/Valheim"
logFile=""
saveinterval="1800"
saveinterval="1800" # Auto-save in seconds.
backups="4"
backupshort="7200"
backuplong="43200"

View File

@ -105,6 +105,7 @@ scpslsm
sdtd,telnet,expect,libxml2
sf
sfc,ncurses-libs.i686
sm,telnet,expect
sof2
sol
squad

1 all,bc,binutils,bzip2,cpio,curl,epel-release,file,glibc.i686,gzip,hostname,jq,libstdc++,libstdc++.i686,nmap-ncat,pigz,python36,tar,tmux,unzip,util-linux,wget,xz
105 sdtd,telnet,expect,libxml2
106 sf
107 sfc,ncurses-libs.i686
108 sm,telnet,expect
109 sof2
110 sol
111 squad

View File

@ -105,6 +105,7 @@ scpslsm
sdtd,telnet,expect,libxml2
sf
sfc,ncurses-libs.i686
sm,telnet,expect
sof2
sol
squad

1 all,bc,binutils,bzip2,cpio,curl,epel-release,file,glibc.i686,gzip,hostname,jq,libstdc++,libstdc++.i686,nmap-ncat,pigz,python3,tar,tmux,unzip,util-linux,wget,xz
105 sdtd,telnet,expect,libxml2
106 sf
107 sfc,ncurses-libs.i686
108 sm,telnet,expect
109 sof2
110 sol
111 squad

View File

@ -105,6 +105,7 @@ scpslsm
sdtd,telnet,expect,libxml2
sf
sfc,ncurses-libs.i686
sm,telnet,expect
sof2
sol
squad

1 all,bc,binutils,bzip2,cpio,curl,epel-release,file,glibc.i686,gzip,hostname,jq,libstdc++,libstdc++.i686,nmap-ncat,pigz,python3,tar,tmux,unzip,util-linux,wget,xz
105 sdtd,telnet,expect,libxml2
106 sf
107 sfc,ncurses-libs.i686
108 sm,telnet,expect
109 sof2
110 sol
111 squad

View File

@ -105,6 +105,7 @@ scpslsm
sdtd,telnet,expect,libxml2
sf
sfc,ncurses-libs.i686
sm,telnet,expect
sof2
sol
squad

1 all,bc,binutils,bzip2,cpio,curl,epel-release,file,glibc.i686,gzip,hostname,jq,libstdc++,libstdc++.i686,nmap-ncat,pigz,python36,tar,tmux,unzip,util-linux,wget,xz
105 sdtd,telnet,expect,libxml2
106 sf
107 sfc,ncurses-libs.i686
108 sm,telnet,expect
109 sof2
110 sol
111 squad

View File

@ -105,6 +105,7 @@ scpslsm
sdtd,telnet,expect,libxml2
sf
sfc,ncurses-libs.i686
sm,telnet,expect
sof2
sol
squad

1 all,bc,binutils,bzip2,cpio,curl,epel-release,file,glibc.i686,gzip,hostname,jq,libstdc++,libstdc++.i686,nmap-ncat,pigz,python3,tar,tmux,unzip,util-linux,wget,xz
105 sdtd,telnet,expect,libxml2
106 sf
107 sfc,ncurses-libs.i686
108 sm,telnet,expect
109 sof2
110 sol
111 squad

View File

@ -104,6 +104,7 @@ scpslsm,mono-complete
sdtd,telnet,expect,libxml2-utils
sf
sfc,libtinfo5:i386
sm,telnet,expect
sof2
sol
squad

1 ac
104 sdtd,telnet,expect,libxml2-utils
105 sf
106 sfc,libtinfo5:i386
107 sm,telnet,expect
108 sof2
109 sol
110 squad

View File

@ -105,6 +105,7 @@ scpslsm,mono-complete
sdtd,telnet,expect,libxml2-utils
sf
sfc,libtinfo5:i386
sm,telnet,expect
sof2
sol
squad

1 all,bc,binutils,bsdmainutils,bzip2,ca-certificates,cpio,curl,distro-info,file,gzip,hostname,jq,lib32gcc-s1,lib32stdc++6,netcat,pigz,python3,tar,tmux,unzip,util-linux,uuid-runtime,wget,xz-utils
105 sdtd,telnet,expect,libxml2-utils
106 sf
107 sfc,libtinfo5:i386
108 sm,telnet,expect
109 sof2
110 sol
111 squad

View File

@ -105,6 +105,7 @@ scpslsm,mono-complete
sdtd,telnet,expect,libxml2-utils
sf
sfc,libtinfo5:i386
sm,telnet,expect
sof2
sol
squad

1 all,bc,binutils,bsdmainutils,bzip2,ca-certificates,cpio,curl,distro-info,file,gzip,hostname,jq,lib32gcc-s1,lib32stdc++6,netcat-openbsd,pigz,python3,tar,tmux,unzip,util-linux,uuid-runtime,wget,xz-utils
105 sdtd,telnet,expect,libxml2-utils
106 sf
107 sfc,libtinfo5:i386
108 sm,telnet,expect
109 sof2
110 sol
111 squad

View File

@ -105,6 +105,7 @@ scpslsm,mono-complete
sdtd,telnet,expect,libxml2-utils
sf
sfc,libtinfo5:i386
sm,telnet,expect
sof2
sol
squad

1 all,bc,binutils,bsdmainutils,bzip2,ca-certificates,cpio,curl,distro-info,file,gzip,hostname,jq,lib32gcc1,lib32stdc++6,netcat,pigz,python3,tar,tmux,unzip,util-linux,wget,xz-utils
105 sdtd,telnet,expect,libxml2-utils
106 sf
107 sfc,libtinfo5:i386
108 sm,telnet,expect
109 sof2
110 sol
111 squad

View File

@ -105,6 +105,7 @@ scpslsm
sdtd,telnet,expect,libxml2
sf
sfc,ncurses-libs.i686
sm,telnet,expect
sof2
sol
squad

1 all,bc,binutils,bzip2,cpio,curl,epel-release,file,glibc.i686,gzip,hostname,jq,libstdc++,libstdc++.i686,nmap-ncat,pigz,python36,tar,tmux,unzip,util-linux,wget,xz
105 sdtd,telnet,expect,libxml2
106 sf
107 sfc,ncurses-libs.i686
108 sm,telnet,expect
109 sof2
110 sol
111 squad

View File

@ -105,6 +105,7 @@ scpslsm
sdtd,telnet,expect,libxml2
sf
sfc,ncurses-libs.i686
sm,telnet,expect
sof2
sol
squad

1 all,bc,binutils,bzip2,cpio,curl,epel-release,file,glibc.i686,gzip,hostname,jq,libstdc++,libstdc++.i686,nmap-ncat,pigz,python36,tar,tmux,unzip,util-linux,wget,xz
105 sdtd,telnet,expect,libxml2
106 sf
107 sfc,ncurses-libs.i686
108 sm,telnet,expect
109 sof2
110 sol
111 squad

View File

@ -105,6 +105,7 @@ scpslsm
sdtd,telnet,expect,libxml2
sf
sfc,ncurses-libs.i686
sm,telnet,expect
sof2
sol
squad

1 all,bc,binutils,bzip2,cpio,curl,epel-release,file,glibc.i686,gzip,hostname,jq,libstdc++,libstdc++.i686,nmap-ncat,pigz,python3,tar,tmux,unzip,util-linux,wget,xz
105 sdtd,telnet,expect,libxml2
106 sf
107 sfc,ncurses-libs.i686
108 sm,telnet,expect
109 sof2
110 sol
111 squad

View File

@ -105,6 +105,7 @@ scpslsm
sdtd,telnet,expect,libxml2
sf
sfc,ncurses-libs.i686
sm,telnet,expect
sof2
sol
squad

1 all,bc,binutils,bzip2,cpio,curl,epel-release,file,glibc.i686,gzip,hostname,jq,libstdc++,libstdc++.i686,nmap-ncat,pigz,python36,tar,tmux,unzip,util-linux,wget,xz
105 sdtd,telnet,expect,libxml2
106 sf
107 sfc,ncurses-libs.i686
108 sm,telnet,expect
109 sof2
110 sol
111 squad

View File

@ -105,6 +105,7 @@ scpslsm
sdtd,telnet,expect,libxml2
sf
sfc,ncurses-libs.i686
sm,telnet,expect
sof2
sol
squad

1 all,bc,binutils,bzip2,cpio,curl,epel-release,file,glibc.i686,gzip,hostname,jq,libstdc++,libstdc++.i686,nmap-ncat,pigz,python3,tar,tmux,unzip,util-linux,wget,xz
105 sdtd,telnet,expect,libxml2
106 sf
107 sfc,ncurses-libs.i686
108 sm,telnet,expect
109 sof2
110 sol
111 squad

View File

@ -104,6 +104,7 @@ scpslsm,scpslsmserver,SCP: Secret Laboratory ServerMod,ubuntu-22.04
sdtd,sdtdserver,7 Days to Die,ubuntu-22.04
sf,sfserver,Satisfactory,ubuntu-22.04
sfc,sfcserver,SourceForts Classic,ubuntu-22.04
sm,smserver,Soulmask,ubuntu-22.04
sof2,sof2server,Soldier Of Fortune 2: Gold Edition,ubuntu-22.04
sol,solserver,Soldat,ubuntu-22.04
squad,squadserver,Squad,ubuntu-22.04

1 shortname gameservername gamename os
104 sdtd sdtdserver 7 Days to Die ubuntu-22.04
105 sf sfserver Satisfactory ubuntu-22.04
106 sfc sfcserver SourceForts Classic ubuntu-22.04
107 sm smserver Soulmask ubuntu-22.04
108 sof2 sof2server Soldier Of Fortune 2: Gold Edition ubuntu-22.04
109 sol solserver Soldat ubuntu-22.04
110 squad squadserver Squad ubuntu-22.04

View File

@ -105,6 +105,7 @@ scpslsm,mono-complete
sdtd,telnet,expect,libxml2-utils
sf
sfc,libtinfo5:i386
sm,telnet,expect
sof2
sol
squad

1 all,bc,binutils,bsdmainutils,bzip2,ca-certificates,cpio,curl,file,gzip,hostname,jq,lib32gcc1,lib32stdc++6,netcat,pigz,python3,tar,tmux,unzip,util-linux,uuid-runtime,wget,xz-utils
105 sdtd,telnet,expect,libxml2-utils
106 sf
107 sfc,libtinfo5:i386
108 sm,telnet,expect
109 sof2
110 sol
111 squad

View File

@ -105,6 +105,7 @@ scpslsm,mono-complete
sdtd,telnet,expect,libxml2-utils
sf
sfc,libtinfo5:i386
sm,telnet,expect
sof2
sol
squad

1 all,bc,binutils,bsdmainutils,bzip2,ca-certificates,cpio,curl,distro-info,file,gzip,hostname,jq,lib32gcc1,lib32stdc++6,netcat,pigz,python3,tar,tmux,unzip,util-linux,uuid-runtime,wget,xz-utils
105 sdtd,telnet,expect,libxml2-utils
106 sf
107 sfc,libtinfo5:i386
108 sm,telnet,expect
109 sof2
110 sol
111 squad

View File

@ -105,6 +105,7 @@ scpslsm,mono-complete
sdtd,telnet,expect,libxml2-utils
sf
sfc,libtinfo5:i386
sm,telnet,expect
sof2
sol
squad

1 all,bc,binutils,bsdmainutils,bzip2,ca-certificates,cpio,curl,distro-info,file,gzip,hostname,jq,lib32gcc1,lib32stdc++6,netcat,pigz,python3,tar,tmux,unzip,util-linux,uuid-runtime,wget,xz-utils
105 sdtd,telnet,expect,libxml2-utils
106 sf
107 sfc,libtinfo5:i386
108 sm,telnet,expect
109 sof2
110 sol
111 squad

View File

@ -105,6 +105,7 @@ scpslsm,mono-complete
sdtd,telnet,expect,libxml2-utils
sf
sfc,libtinfo5:i386
sm,telnet,expect
sof2
sol
squad

1 all,bc,binutils,bsdmainutils,bzip2,ca-certificates,cpio,curl,distro-info,file,gzip,hostname,jq,lib32gcc-s1,lib32stdc++6,netcat,pigz,python3,tar,tmux,unzip,util-linux,uuid-runtime,wget,xz-utils
105 sdtd,telnet,expect,libxml2-utils
106 sf
107 sfc,libtinfo5:i386
108 sm,telnet,expect
109 sof2
110 sol
111 squad

View File

@ -105,6 +105,7 @@ scpslsm,mono-complete
sdtd,telnet,expect,libxml2-utils
sf
sfc,libtinfo5:i386
sm,telnet,expect
sof2
sol
squad

1 all,bc,binutils,bsdmainutils,bzip2,ca-certificates,cpio,curl,distro-info,file,gzip,hostname,jq,lib32gcc-s1,lib32stdc++6,netcat-openbsd,pigz,python3,tar,tmux,unzip,util-linux,uuid-runtime,wget,xz-utils
105 sdtd,telnet,expect,libxml2-utils
106 sf
107 sfc,libtinfo5:i386
108 sm,telnet,expect
109 sof2
110 sol
111 squad

View File

@ -105,6 +105,7 @@ scpslsm,mono-complete
sdtd,telnet,expect,libxml2-utils
sf
sfc,libtinfo5:i386
sm,telnet,expect
sof2
sol
squad

1 all,bc,binutils,bsdmainutils,bzip2,ca-certificates,cpio,curl,distro-info,file,gzip,hostname,jq,lib32gcc-s1,lib32stdc++6,netcat-openbsd,pigz,python3,tar,tmux,unzip,util-linux,uuid-runtime,wget,xz-utils
105 sdtd,telnet,expect,libxml2-utils
106 sf
107 sfc,libtinfo5:i386
108 sm,telnet,expect
109 sof2
110 sol
111 squad

View File

@ -105,6 +105,7 @@ scpslsm,mono-complete
sdtd,telnet,expect,libxml2-utils
sf
sfc,libtinfo5:i386
sm,telnet,expect
sof2
sol
squad

1 all,bc,binutils,bsdmainutils,bzip2,ca-certificates,cpio,curl,distro-info,file,gzip,hostname,jq,lib32gcc-s1,lib32stdc++6,netcat-openbsd,pigz,python3,tar,tmux,unzip,util-linux,uuid-runtime,wget,xz-utils
105 sdtd,telnet,expect,libxml2-utils
106 sf
107 sfc,libtinfo5:i386
108 sm,telnet,expect
109 sof2
110 sol
111 squad

View File

@ -9,7 +9,7 @@ moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
info_distro.sh
# RAM requirements in megabytes for each game or engine.
# RAM requirements in gigabytes for each game or engine.
if [ "${shortname}" == "ark" ]; then
ramrequirementgb="7"
@ -49,6 +49,8 @@ elif [ "${shortname}" == "sf" ]; then
ramrequirementgb="12"
elif [ "${shortname}" == "squad" ]; then
ramrequirementgb="2"
elif [ "${shortname}" == "sm" ]; then
ramrequirementgb="10"
elif [ "${shortname}" == "st" ]; then
ramrequirementgb="1"
elif [ "${shortname}" == "stn" ]; then

View File

@ -112,7 +112,6 @@ declare -A server_details=(
['Steamworks Port']="${steamworksport}"
['Telnet Enabled']="${telnetenabled}"
['Telnet IP']="${telnetip}"
['Telnet Password']="${telnetpass}"
['Telnet Password']="${telnetpassword}"
['Telnet Port']="${telnetport}"
['Tickrate']="${tickrate}"

View File

@ -207,7 +207,7 @@ echo -e ""
echo -e "${lightgreen}Gamedig Raw Output${default}"
fn_messages_separator
echo -e ""
if [ ! "$(command -v gamedig 2> /dev/null)" ] || [ ! -f "${lgsmdir}/node_modules/gamedig/bin/gamedig.js" ]; then
if [ ! "$(command -v gamedig 2> /dev/null)" ] && [ ! -f "${lgsmdir}/node_modules/gamedig/bin/gamedig.js" ]; then
fn_print_failure_nl "gamedig not installed"
fi
if [ ! "$(command -v jq 2> /dev/null)" ]; then

View File

@ -96,8 +96,8 @@ fn_stop_graceful_goldsrc() {
# telnet command for sdtd graceful shutdown.
fn_stop_graceful_sdtd_telnet() {
if [ -z "${telnetpass}" ] || [ "${telnetpass}" == "NOT SET" ]; then
sdtd_telnet_shutdown=$(expect -c '
if [ -z "${telnetpassword}" ] || [ "${telnetpassword}" == "NOT SET" ]; then
sdtdtelnetshutdown=$(expect -c '
proc abort {} {
puts "Timeout or EOF\n"
exit 1
@ -111,14 +111,14 @@ fn_stop_graceful_sdtd_telnet() {
puts "Completed.\n"
')
else
sdtd_telnet_shutdown=$(expect -c '
sdtdtelnetshutdown=$(expect -c '
proc abort {} {
puts "Timeout or EOF\n"
exit 1
}
spawn telnet '"${telnetip}"' '"${telnetport}"'
expect {
"password:" { send "'"${telnetpass}"'\r" }
"password:" { send "'"${telnetpassword}"'\r" }
default abort
}
expect {
@ -143,8 +143,8 @@ fn_stop_graceful_sdtd() {
fn_print_dots "Graceful: telnet: ${telnetip}:${telnetport}"
fn_script_log_info "Graceful: telnet: ${telnetip}:${telnetport}"
fn_stop_graceful_sdtd_telnet
completed=$(echo -en "\n ${sdtd_telnet_shutdown}" | grep "Completed.")
refused=$(echo -en "\n ${sdtd_telnet_shutdown}" | grep "Timeout or EOF")
completed=$(echo -en "\n ${sdtdtelnetshutdown}" | grep "Completed.")
refused=$(echo -en "\n ${sdtdtelnetshutdown}" | grep "Timeout or EOF")
if [ "${refused}" ]; then
fn_print_error "Graceful: telnet: ${telnetip}:${telnetport} : "
fn_print_fail_eol_nl
@ -159,7 +159,7 @@ fn_stop_graceful_sdtd() {
if [ "${completed}" ]; then
for seconds in {1..30}; do
fn_stop_graceful_sdtd_telnet
refused=$(echo -en "\n ${sdtd_telnet_shutdown}" | grep "Timeout or EOF")
refused=$(echo -en "\n ${sdtdtelnetshutdown}" | grep "Timeout or EOF")
if [ "${refused}" ]; then
fn_print_ok "Graceful: telnet: ${telnetip}:${telnetport} : "
fn_print_ok_eol_nl
@ -185,7 +185,7 @@ fn_stop_graceful_sdtd() {
fi
echo -en "\n" | tee -a "${lgsmlog}"
echo -en "Telnet output:" | tee -a "${lgsmlog}"
echo -en "\n ${sdtd_telnet_shutdown}" | tee -a "${lgsmlog}"
echo -en "\n ${sdtdtelnetshutdown}" | tee -a "${lgsmlog}"
echo -en "\n\n" | tee -a "${lgsmlog}"
fi
else
@ -195,6 +195,95 @@ fn_stop_graceful_sdtd() {
fi
}
# Attempts graceful shutdown of Soulmask using telnet.
fn_stop_graceful_sm() {
fn_print_dots "Graceful: telnet"
fn_script_log_info "Graceful: telnet"
if [ "${telnetenabled}" == "false" ]; then
fn_print_info_nl "Graceful: telnet: DISABLED: Enable in ${servercfg}"
elif [ "$(command -v expect 2> /dev/null)" ]; then
# Tries to shutdown with both localhost and server IP.
for telnetip in 127.0.0.1 ${ip}; do
fn_print_dots "Graceful: telnet: ${telnetip}:${telnetport}"
fn_script_log_info "Graceful: telnet: ${telnetip}:${telnetport}"
fn_stop_graceful_sm_telnet
completed=$(echo -en "\n ${smtelnetshutdown}" | grep "Completed.")
refused=$(echo -en "\n ${smtelnetshutdown}" | grep "Timeout or EOF")
if [ "${refused}" ]; then
fn_print_error "Graceful: telnet: ${telnetip}:${telnetport} : "
fn_print_fail_eol_nl
fn_script_log_error "Graceful: telnet: ${telnetip}:${telnetport} : FAIL"
elif [ "${completed}" ]; then
break
fi
done
# If telnet shutdown was successful will use telnet again to check
# the connection has closed, confirming that the tmux session can now be killed.
if [ "${completed}" ]; then
for seconds in {1..30}; do
fn_stop_graceful_sm_telnet
refused=$(echo -en "\n ${smtelnetshutdown}" | grep "Timeout or EOF")
if [ "${refused}" ]; then
fn_print_ok "Graceful: telnet: ${telnetip}:${telnetport} : "
fn_print_ok_eol_nl
fn_script_log_pass "Graceful: telnet: ${telnetip}:${telnetport} : ${seconds} seconds"
if [ "${statusalert}" == "on" ] && [ "${firstcommandname}" == "STOP" ]; then
alert="stopped"
alert.sh
fi
break
fi
fn_sleep_time_1
fn_print_dots "Graceful: telnet: ${seconds}"
done
# If telnet shutdown fails, show it and stop
else
if [ "${refused}" ]; then
fn_print_error "Graceful: telnet: "
fn_print_fail_eol_nl
fn_script_log_error "Graceful: telnet: ${telnetip}:${telnetport} : FAIL"
else
fn_print_error_nl "Graceful: telnet: Unknown error"
fn_script_log_error "Graceful: telnet: Unknown error"
fi
echo -en "\n" | tee -a "${lgsmlog}"
echo -en "Telnet output:" | tee -a "${lgsmlog}"
echo -en "\n ${smtelnetshutdown}" | tee -a "${lgsmlog}"
echo -en "\n\n" | tee -a "${lgsmlog}"
fi
else
fn_print_warn "Graceful: telnet: expect not installed: "
fn_print_fail_eol_nl
fn_script_log_warn "Graceful: telnet: expect not installed: FAIL"
fi
}
# telnet command for soulmask graceful shutdown.
fn_stop_graceful_sm_telnet() {
smtelnetshutdown=$(expect -c '
proc abort {} {
puts "Timeout or EOF\n"
exit 1
}
spawn telnet '"${telnetip}"' '"${telnetport}"'
expect {
"Hello:" { send "saveworld 1\r" }
default abort
}
expect {
"the world is saved." { send "quit 1\r" }
default abort
}
expect {
"World is closing..." {}
default abort
}
expect { eof }
puts "Completed.\n"
')
}
# Attempts graceful shutdown by sending /save /stop.
fn_stop_graceful_avorion() {
fn_print_dots "Graceful: /save /stop"
@ -253,6 +342,8 @@ fn_stop_graceful_select() {
fn_stop_graceful_cmd "end" 30
elif [ "${stopmode}" == "12" ]; then
fn_stop_graceful_cmd "shutdown" 30
elif [ "${stopmode}" == "13" ]; then
fn_stop_graceful_sm
fi
}

View File

@ -446,6 +446,11 @@ fix_sfc.sh() {
fn_fetch_module
}
fix_sm.sh() {
modulefile="${FUNCNAME[0]}"
fn_fetch_module
}
fix_st.sh() {
modulefile="${FUNCNAME[0]}"
fn_fetch_module

View File

@ -52,7 +52,7 @@ fn_apply_fix() {
fi
}
apply_pre_start_fix=(arma3 armar ark av bt bo csgo cmw dst hw ins kf nmrih onset pvr ro rust rw samp sdtd sfc sof2 squad st tf2 terraria ts3 mcb mta unt vh wurm zmr)
apply_pre_start_fix=(arma3 armar ark av bt bo csgo cmw dst hw ins kf nmrih onset pvr ro rust rw samp sdtd sfc sm sof2 squad st tf2 terraria ts3 mcb mta unt vh wurm zmr)
apply_post_install_fix=(av kf kf2 ro ut2k4 ut ut3)
# validate registered fixes for safe development

10
lgsm/modules/fix_sm.sh Normal file
View File

@ -0,0 +1,10 @@
#!/bin/bash
# LinuxGSM fix_sm.sh module
# Author: Daniel Gibbs
# Contributors: http://linuxgsm.com/contrib
# Website: https://linuxgsm.com
# Description: Resolves issues with Unturned.
moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${serverfiles}:${serverfiles}/linux64"

View File

@ -1970,7 +1970,7 @@ fn_info_game_sdtd() {
telnetenabled="${telnetenabled:-"NOT SET"}"
# Telnet IP will be localhost if no password is set
# check_ip will set the IP first. This will overwrite it.
if [ -z "${telnetpass}" ]; then
if [ -z "${telnetpassword}" ]; then
telnetip="127.0.0.1"
fi
telnetpass="${telnetpass:-"NOT SET"}"
@ -1988,6 +1988,19 @@ fn_info_game_sf() {
beaconport="${beaconport:-"0"}"
}
# Config Type: Parameters (with an ini)
fn_info_game_sm() {
servername="${servername:-"NOT SET"}"
adminpassword="${adminpassword:-"NOT SET"}"
port="${port:-"0"}"
queryport="${queryport:-"0"}"
maxplayers="${maxplayers:-"0"}"
# telnet config
telnetenabled=true
telnetip="127.0.0.1"
telnetport="${telnetport:-"0"}"
}
# Config Type: QuakeC
# Comment: // or /* */
# Example: set sv_hostname "SERVERNAME"
@ -2407,6 +2420,8 @@ elif [ "${shortname}" == "sdtd" ]; then
fn_info_game_sdtd
elif [ "${shortname}" == "sf" ]; then
fn_info_game_sf
elif [ "${shortname}" == "sm" ]; then
fn_info_game_sm
elif [ "${shortname}" == "sof2" ]; then
fn_info_game_sof2
elif [ "${shortname}" == "sol" ]; then

View File

@ -30,8 +30,8 @@ fn_info_messages_password_strip() {
httppassword="********"
fi
if [ "${telnetpass}" ]; then
telnetpass="********"
if [ "${telnetpassword}" ]; then
telnetpassword="********"
fi
if [ "${wsapikey}" ]; then
@ -483,6 +483,11 @@ fn_info_messages_gameserver() {
echo -e "${lightblue}Version Count:\t${default}${versioncount}"
fi
# backupinterval (Soulmask)
if [ -n "${backupinterval}" ]; then
echo -e "${lightblue}Backup Interval:\t${default}${backupinterval}"
fi
# Listed on Master server
if [ -n "${displaymasterserver}" ]; then
if [ "${displaymasterserver}" == "true" ]; then
@ -702,6 +707,8 @@ fn_info_messages_ports() {
portcommand="ss -tuplwn | grep java"
elif [ "${shortname}" == "terraria" ]; then
portcommand="ss -tuplwn | grep Main"
elif [ "${shortname}" == "sm" ]; then
portcommand="ss -tuplwn | grep WSServer-Linux"
elif [ "${engine}" == "source" ]; then
portcommand="ss -tuplwn | grep srcds_linux"
elif [ "${engine}" == "goldsrc" ]; then
@ -1435,7 +1442,7 @@ fn_info_messages_sdtd() {
{
echo -e "${lightblue}Telnet enabled:\t${default}${telnetenabled}"
echo -e "${lightblue}Telnet address:\t${default}${telnetip} ${telnetport}"
echo -e "${lightblue}Telnet password:\t${default}${telnetpass}"
echo -e "${lightblue}Telnet password:\t${default}${telnetpassword}"
} | column -s $'\t' -t
}
@ -1448,6 +1455,23 @@ fn_info_messages_sf() {
} | column -s $'\t' -t
}
fn_info_messages_sm() {
fn_info_messages_password_strip
{
fn_port "header"
fn_port "Game" port udp
fn_port "Query" queryport udp
fn_port "Telnet" telnetport tcp
} | column -s $'\t' -t
echo -e ""
echo -e "${bold}${lightgreen}${gamename} Telnet${default}"
fn_messages_separator
{
echo -e "${lightblue}Telnet enabled:\t${default}${telnetenabled}"
echo -e "${lightblue}Telnet address:\t${default}${telnetip} ${telnetport}"
} | column -s $'\t' -t
}
fn_info_messages_sof2() {
{
fn_port "header"
@ -1842,6 +1866,8 @@ fn_info_messages_select_engine() {
fn_info_messages_sdtd
elif [ "${shortname}" == "sf" ]; then
fn_info_messages_sf
elif [ "${shortname}" == "sm" ]; then
fn_info_messages_sm
elif [ "${shortname}" == "sof2" ]; then
fn_info_messages_sof2
elif [ "${shortname}" == "sol" ]; then

View File

@ -695,6 +695,9 @@ elif [ "${shortname}" == "sf" ]; then
fn_default_config_remote
fn_set_config_vars
fn_list_config_locations
elif [ "${shortname}" == "sm" ]; then
fn_default_config_local
fn_list_config_locations
elif [ "${shortname}" == "sol" ]; then
array_configs+=(soldat.ini)
fn_fetch_default_config