Browse Source

Merge remote-tracking branch 'legendofmiracles/master' into systemd

pull/3125/head
Daniel Gibbs 5 years ago
parent
commit
892eec8c5f
  1. 2
      lgsm/config-default/config-lgsm/rustserver/_default.cfg
  2. 168
      lgsm/config-default/config-lgsm/scpslserver/_default.cfg
  3. 168
      lgsm/config-default/config-lgsm/scpslsmserver/_default.cfg
  4. 171
      lgsm/config-default/config-lgsm/vintsserver/_default.cfg
  5. 3
      lgsm/data/serverlist.csv
  6. 9
      lgsm/functions/check_deps.sh
  7. 20
      lgsm/functions/command_install_init.sh
  8. 2
      lgsm/functions/command_update.sh
  9. 5
      lgsm/functions/core_functions.sh
  10. 10
      lgsm/functions/core_steamcmd.sh
  11. 45
      lgsm/functions/info_config.sh
  12. 26
      lgsm/functions/info_messages.sh
  13. 7
      lgsm/functions/info_parms.sh
  14. 14
      lgsm/functions/install_config.sh
  15. 2
      lgsm/functions/install_server_files.sh
  16. 2
      lgsm/functions/update_minecraft.sh
  17. 145
      lgsm/functions/update_vintagestory.sh

2
lgsm/config-default/config-lgsm/rustserver/_default.cfg

@ -14,7 +14,7 @@ port="28015"
rconport="28016"
appport=28082
rconpassword="CHANGE_ME"
rconweb="1" # Value is: 1 for the Facepunch web panel; 0 for RCON tools like Rusty or Rustadmin.
rconweb="1" # Value is: 1 for the Facepunch web panel, Rustadmin desktop and Rustadmin Online; 0 for RCON tools like Rusty.
servername="Rust"
maxplayers="50"
seed="" # range: 1-2147483647, used to reproduce a procedural map.

168
lgsm/config-default/config-lgsm/scpslserver/_default.cfg

@ -0,0 +1,168 @@
##################################
######## 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"
# 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"

168
lgsm/config-default/config-lgsm/scpslsmserver/_default.cfg

@ -0,0 +1,168 @@
##################################
######## 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"
# 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"

171
lgsm/config-default/config-lgsm/vintsserver/_default.cfg

@ -0,0 +1,171 @@
##################################
######## 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 Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters
fn_parms(){
parms="--datapath ${servercfgdir}"
}
## Release Settings | https://docs.linuxgsm.com/game-servers/vintagestory#release-settings
# Branch (stable|unstable)
branch="stable"
#### 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"
# 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"
mailgunapiregion="us"
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"
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) in "curlcustomstring".
# For example "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help".
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"
## 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"
## 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="2"
## Query mode
# 1: session only
# 2: gamedig (gsquery fallback)
# 3: gamedig
# 4: gsquery
# 5: tcp
querymode="5"
querytype=""
## Console type
consoleverbose="yes"
consoleinteract="yes"
## Game Server Details
# Do not edit
gamename="Vintage Story"
engine="vintagestory"
glibc="2.17"
#### Directories ####
# Edit with care
## Game Server Directories
systemdir="${serverfiles}"
executabledir="${systemdir}"
preexecutable="mono"
executable="./VintagestoryServer.exe"
servercfgdir="${serverfiles}/data/${selfname}"
servercfg="serverconfig.json"
servercfgdefault="serverconfig.json"
servercfgfullpath="${servercfgdir}/${servercfg}"
## Backup Directory
backupdir="${lgsmdir}/backup"
## Logging Directories
logdir="${rootdir}/log"
gamelogdir="${vsdataworld}/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"

3
lgsm/data/serverlist.csv

@ -84,6 +84,8 @@ rw,rwserver,Rising World
samp,sampserver,San Andreas Multiplayer
sb,sbserver,Starbound
sbots,sbotsserver,StickyBots
scpsl,scpslserver,SCP: Secret Laboratory
scpslsm,scpslsmserver,SCP: Secret Laboratory ServerMod
sdtd,sdtdserver,7 Days to Die
sfc,sfcserver,SourceForts Classic
sof2,sof2server,Soldier Of Fortune 2: Gold Edition
@ -104,6 +106,7 @@ ut2k4,ut2k4server,Unreal Tournament 2004
ut3,ut3server,Unreal Tournament 3
ut99,ut99server,Unreal Tournament 99
vs,vsserver,Vampire Slayer
vints,vintsserver,Vintage Story
wet,wetserver,Wolfenstein: Enemy Territory
wf,wfserver,Warfork
wurm,wurmserver,Wurm Unlimited

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

9
lgsm/functions/check_deps.sh

@ -437,6 +437,9 @@ fn_deps_build_debian(){
else
array_deps_required+=( default-jre rng-tools )
fi
# SCP: Secret Laboratory, SCP: Secret Laboratory ServerMod
elif [ "${shortname}" == "scpsl" ]||[ "${shortname}" == "scpslsm" ]; then
array_deps_required+=( mono-complete )
# Sven Co-op
elif [ "${shortname}" == "sven" ]; then
array_deps_required+=( libssl1.1:i386 zlib1g:i386 )
@ -452,6 +455,9 @@ fn_deps_build_debian(){
# Unreal Tournament
elif [ "${shortname}" == "ut" ]; then
array_deps_required+=( unzip )
# Vintage Story
elif [ "${shortname}" == "vints" ]; then
array_deps_required+=( mono-complete )
# Wurm: Unlimited
elif [ "${shortname}" == "wurm" ]; then
array_deps_required+=( xvfb )
@ -564,6 +570,9 @@ fn_deps_build_redhat(){
# Unreal Tournament
elif [ "${shortname}" == "ut" ]; then
array_deps_required+=( unzip )
# Vintage Story
elif [ "${shortname}" == "vints" ]; then
array_deps_required+=( mono-complete )
# Wurm: Unlimited
elif [ "${shortname}" == "wurm" ]; then
array_deps_required+=( xorg-x11-server-Xvfb )

20
lgsm/functions/command_install_init.sh

@ -8,6 +8,14 @@ commandaction="systemd service file"
functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
fn_firstcommand_set
fn_print_content_on_error() {
fn_print_fail_nl "sudo exited with non 0 exit code - something went wrong"
fn_print_information_nl "You can place the contents of the service file manually in $1"
fn_print_information_nl "Contents: "
printf "\n$2"
exit 1
}
fn_install_systemd() {
file_c=$'[Unit]
Description=LinuxGSM gamename Server
@ -25,19 +33,21 @@ RemainAfterExit=yes
[Install]
WantedBy=multi-user.target'
file_c=$(printf "$file_c" | sed s/'gamename'/$gamename/g | sed "s|path|$path|g" | sed s/'whoami'/$(whoami)/g)
path="/etc/systemd/system/${selfname}-lgsm.service"
fn_print_ok_nl "Generated the file contents"
fn_print_information_nl "Enter the password of root:"
su -c "echo \"$file_c\" > /etc/systemd/system/${selfname}-lgsm.service" || return 1 && return 0
fn_print_information_nl "Enter the password of root: (only if you haven't this terminal in the past few minutes)"
printf "$file_c" | sudo tee $path && return 0 || fn_print_content_on_error $path "$file_c"
}
fn_install_systemd
if [ $? -eq 1 ]
then
fn_print_error_nl "su exited with non 0 exit code.. something went wrong";
fn_script_log_fatal "su exited with non 0 exit code."
fn_script_log_fatal "sudo exited with non 0 exit code."
else
echo
fn_print_complete_nl "Placed the file in /etc/systemd/system/ as ${selfname}-lgsm.service"
fn_print_information_nl "run \`systemctl enable ${selfname}-lgsm.service\` (as root), to enable the game on boot"
fn_script_log_pass "sucessfullly installed the systemd service file"
fn_script_log_pass "successfullly installed the systemd service file"
fi
core_exit.sh

2
lgsm/functions/command_update.sh

@ -28,6 +28,8 @@ elif [ "${shortname}" == "mta" ]; then
update_mta.sh
elif [ "${shortname}" == "jk2" ]; then
update_jediknight2.sh
elif [ "${shortname}" == "vints" ]; then
update_vintagestory.sh
else
update_steamcmd.sh
fi

5
lgsm/functions/core_functions.sh

@ -649,6 +649,11 @@ functionfile="${FUNCNAME[0]}"
fn_fetch_function
}
update_vintagestory.sh(){
functionfile="${FUNCNAME[0]}"
fn_fetch_function
}
fn_update_functions.sh(){
functionfile="${FUNCNAME[0]}"
fn_fetch_function

10
lgsm/functions/core_steamcmd.sh

@ -13,16 +13,6 @@ fn_install_steamcmd(){
if [ ! -d "${steamcmddir}" ]; then
mkdir -p "${steamcmddir}"
fi
remote_fileurl="${1}"
remote_fileurl_backup="${2}"
remote_fileurl_name="${3}"
remote_fileurl_backup_name="${4}"
local_filedir="${5}"
local_filename="${6}"
chmodx="${7:-0}"
run="${8:-0}"
forcedl="${9:-0}"
md5="${10:-0}"
fn_fetch_file "http://media.steampowered.com/client/steamcmd_linux.tar.gz" "" "" "" "${tmpdir}" "steamcmd_linux.tar.gz" "" "norun" "noforce" "nomd5"
fn_dl_extract "${tmpdir}" "steamcmd_linux.tar.gz" "${steamcmddir}"
chmod +x "${steamcmddir}/steamcmd.sh"

45
lgsm/functions/info_config.sh

@ -1548,6 +1548,47 @@ fn_info_config_col(){
fi
}
fn_info_config_vintagestory(){
if [ ! -f "${servercfgfullpath}" ]; then
servername="${unavailable}"
maxplayers="${unavailable}"
serverpassword="${unavailable}"
port="${unavailable}"
queryport="${unavailable}"
configip="${unavailable}"
else
servername=$(jq -r '.ServerName' "${servercfgfullpath}")
maxplayers=$(jq -r '.MaxClients' "${servercfgfullpath}")
serverpassword=$(jq -r 'select(.Password != null) | .Password' "${servercfgfullpath}")
port=$(jq -r '.Port' "${servercfgfullpath}")
queryport=${port:-"0"}
configip=$(jq -r 'select(.Ip != null) | .Ip' "${servercfgfullpath}")
serverpassword=${serverpassword:-"NOT SET"}
configip=${configip:-"0.0.0.0"}
fi
}
fn_info_config_scpsl(){
if [ -f "${servercfgfullpath}" ]; then
servername=$(sed -nr 's/^server_name: (.*)$/\1/p' "${servercfgfullpath}")
maxplayers=$(sed -nr 's/^max_players: (.*)$/\1/p' "${servercfgfullpath}")
configip=$(sed -nr 's/^ipv4_bind_ip: (.*)$/\1/p' "${servercfgfullpath}")
tickrate=$(sed -nr 's/^server_tickrate: (.*)$/\1/p' "${servercfgfullpath}")
adminpassword=$(sed -nr 's/^administrator_query_password: (.*)$/\1/p' "${servercfgfullpath}")
if [ "${adminpassword}" == "none" ]; then
adminpassword="NOT SET"
fi
else
servername=${servername:-"NOT SET"}
maxplayers=${maxplayers:-"0"}
configip=${configip:-"0.0.0.0"}
tickrate=${tickrate:-"NOT SET"}
adminpassword=${adminpassword:-"NOT SET"}
fi
}
if [ "${shortname}" == "ac" ]; then
fn_info_config_assettocorsa
elif [ "${shortname}" == "ark" ]; then
@ -1652,6 +1693,8 @@ elif [ "${engine}" == "unreal3" ]; then
fn_info_config_unreal3
elif [ "${shortname}" == "ut" ]; then
fn_info_config_ut
elif [ "${shortname}" == "scpsl" ]||[ "${shortname}" == "scpslsm" ]; then
fn_info_config_scpsl
elif [ "${shortname}" == "sdtd" ]; then
fn_info_config_sdtd
elif [ "${shortname}" == "wet" ]; then
@ -1672,4 +1715,6 @@ elif [ "${shortname}" == "mh" ]; then
fn_info_config_mordhau
elif [ "${shortname}" == "pvr" ];then
fn_info_config_pavlovvr
elif [ "${shortname}" == "vints" ]; then
fn_info_config_vintagestory
fi

26
lgsm/functions/info_messages.sh

@ -572,7 +572,7 @@ fn_info_message_ports(){
parmslocation="${red}UNKNOWN${default}"
# engines/games that require editing in the config file.
local ports_edit_array=( "avalanche2.0" "avalanche3.0" "Ballistic Overkill" "Barotrauma" "dontstarve" "Eco" "idtech2" "idtech3" "idtech3_ql" "lwjgl2" "Minecraft Bedrock" "Project Cars" "projectzomboid" "quake" "refractor" "realvirtuality" "renderware" "Stationeers" "teeworlds" "terraria" "unreal" "unreal2" "unreal3" "TeamSpeak 3" "Mumble" "7 Days To Die" "wurm")
local ports_edit_array=( "avalanche2.0" "avalanche3.0" "Ballistic Overkill" "Barotrauma" "dontstarve" "Eco" "idtech2" "idtech3" "idtech3_ql" "lwjgl2" "Minecraft Bedrock" "Project Cars" "projectzomboid" "quake" "refractor" "realvirtuality" "renderware" "Stationeers" "teeworlds" "terraria" "unreal" "unreal2" "unreal3" "TeamSpeak 3" "Mumble" "7 Days To Die" "Vintage Story" "wurm")
for port_edit in "${ports_edit_array[@]}"; do
if [ "${shortname}" == "ut3" ]; then
parmslocation="${servercfgdir}/UTWeb.ini"
@ -583,7 +583,7 @@ fn_info_message_ports(){
fi
done
# engines/games that require editing the parms.
local ports_edit_array=( "Avorion" "col" "goldsrc" "Factorio" "Hurtworld" "iw3.0" "ioquake3" "qfusion" "Rust" "Soldat" "spark" "source" "starbound" "unreal4" "realvirtuality" "Unturned" )
local ports_edit_array=( "Avorion" "col" "goldsrc" "Factorio" "Hurtworld" "iw3.0" "ioquake3" "qfusion" "Rust" "scpsl" "scpslsm" "Soldat" "spark" "source" "starbound" "unreal4" "realvirtuality" "Unturned" )
for port_edit in "${ports_edit_array[@]}"; do
if [ "${engine}" == "${port_edit}" ]||[ "${gamename}" == "${port_edit}" ]||[ "${shortname}" == "${port_edit}" ]; then
parmslocation="${configdirserver}"
@ -1455,6 +1455,24 @@ fn_info_message_colony(){
} | column -s $'\t' -t
}
fn_info_message_vintagestory(){
echo "netstat -atunp | grep cli"
echo -e ""
{
echo -e "DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL"
echo -e "> Game\tINBOUND\t${port}\tTCP"
} | column -s $'\t' -t
}
fn_info_message_scpsl(){
echo -e "netstat -atunp | grep SCPSL"
echo -e ""
{
echo -e "${lightblue}DESCRIPTION\tDIRECTION\tPORT\tPROTOCOL${default}"
echo -e "> Game\tINBOUND\t${port}\tudp"
} | column -s $'\t' -t
}
fn_info_message_select_engine(){
# Display details depending on game or engine.
if [ "${shortname}" == "ac" ]; then
@ -1527,6 +1545,8 @@ fn_info_message_select_engine(){
fn_info_message_quakelive
elif [ "${shortname}" == "samp" ]; then
fn_info_message_samp
elif [ "${shortname}" == "scpsl" ]||[ "${shortname}" == "scpslsm" ]; then
fn_info_message_scpsl
elif [ "${shortname}" == "sdtd" ]; then
fn_info_message_sdtd
elif [ "${shortname}" == "squad" ]; then
@ -1573,6 +1593,8 @@ fn_info_message_select_engine(){
fn_info_message_pavlovvr
elif [ "${shortname}" == "rust" ]; then
fn_info_message_rust
elif [ "${shortname}" == "vints" ]; then
fn_info_message_vintagestory
elif [ "${shortname}" == "wf" ]; then
fn_info_message_warfork
elif [ "${shortname}" == "wurm" ]; then

7
lgsm/functions/info_parms.sh

@ -233,6 +233,10 @@ fn_info_parms_wf(){
webadminport=${webadminport:-"0"}
}
fn_info_parms_queryport(){
queryport="${port:-"0"}"
}
if [ "${shortname}" == "ark" ]; then
fn_info_parms_ark
elif [ "${shortname}" == "arma3" ]; then
@ -295,4 +299,7 @@ elif [ "${shortname}" == "ut" ]; then
fn_info_parms_ut
elif [ "${shortname}" == "wf" ]; then
fn_info_parms_wf
# for servers that have a missing queryport from the config
elif [ "${shortname}" == "scpsl" ]||[ "${shortname}" == "scpslsm" ]; then
fn_info_parms_queryport
fi

14
lgsm/functions/install_config.sh

@ -667,6 +667,13 @@ elif [ "${shortname}" == "rust" ]; then
fn_fetch_default_config
fn_default_config_remote
fn_list_config_locations
elif [ "${shortname}" == "scpsl" ]||[ "${shortname}" == "scpslsm" ]; then
gamedirname="SCPSecretLaboratory"
array_configs+=( config_gameplay.txt config_localadmin.txt )
fn_fetch_default_config
fn_default_config_remote
fn_set_config_vars
fn_list_config_locations
elif [ "${shortname}" == "sol" ]; then
gamedirname="Soldat"
array_configs+=( soldat.ini )
@ -793,6 +800,13 @@ elif [ "${shortname}" == "unt" ]; then
fn_default_config_remote
fn_set_config_vars
fn_list_config_locations
elif [ "${shortname}" == "vints" ]; then
gamedirname="VintageStory"
array_configs+=( serverconfig.json )
fn_fetch_default_config
fn_default_config_remote
fn_set_config_vars
fn_list_config_locations
elif [ "${shortname}" == "vs" ]; then
gamedirname="VampireSlayer"
array_configs+=( server.cfg )

2
lgsm/functions/install_server_files.sh

@ -91,6 +91,8 @@ elif [ "${shortname}" == "fctr" ]; then
install_factorio_save.sh
elif [ "${shortname}" == "jk2" ]; then
update_jediknight2.sh
elif [ "${shortname}" == "vints" ]; then
update_vintagestory.sh
elif [ -z "${appid}" ]||[ "${shortname}" == "ahl" ]||[ "${shortname}" == "bd" ]||[ "${shortname}" == "bb" ]||[ "${shortname}" == "ns" ]||[ "${shortname}" == "sfc" ]||[ "${shortname}" == "ts" ]||[ "${shortname}" == "vs" ]||[ "${shortname}" == "zmr" ]; then
if [ "${shortname}" == "ut" ]; then
install_eula.sh

2
lgsm/functions/update_minecraft.sh

@ -88,10 +88,10 @@ fn_update_minecraft_compare(){
echo -e "Update available"
echo -e "* Local build: ${red}${localbuild}${default}"
echo -e "* Remote build: ${green}${remotebuild}${default}"
echo -en "\n"
if [ -n "${branch}" ]; then
echo -e "* Branch: ${branch}"
fi
echo -en "\n"
fn_script_log_info "Update available"
fn_script_log_info "Local build: ${localbuild}"
fn_script_log_info "Remote build: ${remotebuild}"

145
lgsm/functions/update_vintagestory.sh

@ -0,0 +1,145 @@
#!/bin/bash
# LinuxGSM update_vintagestory.sh function
# Author: Christian Birk
# Website: https://linuxgsm.com
# Description: Handles updating of Vintage Story servers.
functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
fn_update_vs_dl(){
# get version info for download
remotebuildresponse=$(curl -s "${apiurl}" | jq --arg version "${remotebuild}" '.[$version].server')
remotebuildfile=$(echo -e "${remotebuildresponse}" | jq -r '.filename')
remotebuildlink=$(echo -e "${remotebuildresponse}" | jq -r '.urls.cdn')
remotebuildmd5=$(echo -e "${remotebuildresponse}" | jq -r '.md5')
# Download and extract files to serverfiles
fn_fetch_file "${remotebuildlink}" "" "" "" "${tmpdir}" "${remotebuildfile}" "nochmodx" "norun" "force" "${remotebuildmd5}"
fn_dl_extract "${tmpdir}" "${remotebuildfile}" "${serverfiles}"
fn_clear_tmp
}
fn_update_vs_localbuild(){
# Gets local build info.
fn_print_dots "Checking local build: ${remotelocation}"
# Uses executable to find local build.
cd "${executabledir}" || exit
if [ -f "${executable}" ]; then
localbuild="$(${preexecutable} ${executable} --version | sed '/^[[:space:]]*$/d')"
fn_print_ok "Checking local build: ${remotelocation}"
fn_script_log_pass "Checking local build"
else
localbuild="0"
fn_print_error "Checking local build: ${remotelocation}"
fn_script_log_error "Checking local build"
fi
}
fn_update_vs_remotebuild(){
if [ "${branch}" == "stable" ]; then
remotebuild=$(curl -s "${apiurl}" | jq -r '[ to_entries[] ] | .[].key' | grep -Ev "\-rc|\-pre" | sort -r -V | head -1)
else
remotebuild=$(curl -s "${apiurl}" | jq -r '[ to_entries[] ] | .[].key' | grep -E "\-rc|\-pre" | sort -r -V | head -1)
fi
if [ "${firstcommandname}" != "INSTALL" ]; then
fn_print_dots "Checking remote build: ${remotelocation}"
# Checks if remotebuild variable has been set.
if [ -z "${remotebuild}" ]||[ "${remotebuild}" == "null" ]; then
fn_print_fail "Checking remote build: ${remotelocation}"
fn_script_log_fatal "Checking remote build"
core_exit.sh
else
fn_print_ok "Checking remote build: ${remotelocation}"
fn_script_log_pass "Checking remote build"
fi
else
# Checks if remotebuild variable has been set.
if [ -z "${remotebuild}" ]||[ "${remotebuild}" == "null" ]; then
fn_print_failure "Unable to get remote build"
fn_script_log_fatal "Unable to get remote build"
core_exit.sh
fi
fi
}
fn_update_vs_compare(){
# Removes dots so if statement can compare version numbers.
fn_print_dots "Checking for update: ${remotelocation}"
if [ "${localbuild}" != "${remotebuild}" ]||[ "${forceupdate}" == "1" ]; then
fn_print_ok_nl "Checking for update: ${remotelocation}"
echo -en "\n"
echo -e "Update available"
echo -e "* Local build: ${red}${localbuild}${default}"
echo -e "* Remote build: ${green}${remotebuild}${default}"
if [ -n "${branch}" ]; then
echo -e "* Branch: ${branch}"
fi
echo -en "\n"
fn_script_log_info "Update available"
fn_script_log_info "Local build: ${localbuild}"
fn_script_log_info "Remote build: ${remotebuild}"
fn_script_log_info "${localbuild} > ${remotebuild}"
unset updateonstart
check_status.sh
# If server stopped.
if [ "${status}" == "0" ]; then
exitbypass=1
fn_update_vs_dl
exitbypass=1
command_start.sh
exitbypass=1
command_stop.sh
fn_firstcommand_reset
# If server started.
else
fn_print_restart_warning
exitbypass=1
command_stop.sh
fn_firstcommand_reset
exitbypass=1
fn_update_vs_dl
exitbypass=1
command_start.sh
fn_firstcommand_reset
fi
unset exitbypass
date +%s > "${lockdir}/lastupdate.lock"
alert="update"
alert.sh
else
fn_print_ok_nl "Checking for update: ${remotelocation}"
echo -en "\n"
echo -e "No update available"
echo -e "* Local build: ${green}${localbuild}${default}"
echo -e "* Remote build: ${green}${remotebuild}${default}"
if [ -n "${branch}" ]; then
echo -e "* Branch: ${branch}"
fi
echo -en "\n"
fn_script_log_info "No update available"
fn_script_log_info "Local build: ${localbuild}"
fn_script_log_info "Remote build: ${remotebuild}"
if [ -n "${branch}" ]; then
fn_script_log_info "Branch: ${branch}"
fi
fi
}
# The location where the builds are checked and downloaded.
remotelocation="vintagestory.at"
apiurl="http://api.${remotelocation}/stable-unstable.json"
localversionfile="${datadir}/vintagestoryversion"
if [ "${firstcommandname}" == "INSTALL" ]; then
fn_update_vs_remotebuild
fn_update_vs_dl
else
fn_print_dots "Checking for update"
fn_print_dots "Checking for update: ${remotelocation}"
fn_script_log_info "Checking for update: ${remotelocation}"
fn_update_vs_localbuild
fn_update_vs_remotebuild
fn_update_vs_compare
fi
Loading…
Cancel
Save