From a2bea8d7915de2a9fb88d35dce2a1d696471fb28 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maciej=20G=C5=82owacki?= <2972266+glowacki-dev@users.noreply.github.com> Date: Wed, 22 May 2024 23:16:33 +0200 Subject: [PATCH 01/20] feat(vhserver): enable crossplay support (#4544) * Install valheim dependencies for crossplay on Ubuntu * Setup minimal required dependencies for valheim crossplay * will set crossplay to default on and add instance id * add ubuntu 24.04 --------- Co-authored-by: Daniel Gibbs --- lgsm/config-default/config-lgsm/vhserver/_default.cfg | 6 ++---- lgsm/data/almalinux-8.csv | 2 +- lgsm/data/almalinux-9.csv | 2 +- lgsm/data/centos-7.csv | 2 +- lgsm/data/centos-8.csv | 2 +- lgsm/data/centos-9.csv | 2 +- lgsm/data/debian-10.csv | 2 +- lgsm/data/debian-11.csv | 2 +- lgsm/data/debian-12.csv | 2 +- lgsm/data/debian-9.csv | 2 +- lgsm/data/rhel-7.csv | 2 +- lgsm/data/rhel-8.csv | 2 +- lgsm/data/rhel-9.csv | 2 +- lgsm/data/rocky-8.csv | 2 +- lgsm/data/rocky-9.csv | 2 +- lgsm/data/ubuntu-16.04.csv | 2 +- lgsm/data/ubuntu-18.04.csv | 2 +- lgsm/data/ubuntu-20.04.csv | 2 +- lgsm/data/ubuntu-22.04.csv | 2 +- lgsm/data/ubuntu-23.04.csv | 2 +- lgsm/data/ubuntu-23.10.csv | 2 +- lgsm/data/ubuntu-24.04.csv | 2 +- 22 files changed, 23 insertions(+), 25 deletions(-) diff --git a/lgsm/config-default/config-lgsm/vhserver/_default.cfg b/lgsm/config-default/config-lgsm/vhserver/_default.cfg index 355c708247..8950435e82 100644 --- a/lgsm/config-default/config-lgsm/vhserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/vhserver/_default.cfg @@ -21,9 +21,7 @@ saveinterval="1800" backups="4" backupshort="7200" backuplong="43200" -# If crossplay is empty, it's off. Fill with any text to make true -# Crossplay is currently not working on Linux dedicated servers, so for now the default is false (empty) -crossplay="" +instanceid="1" # INSTRUCTIONS FOR WORLD MODIFIERS (from Valheim Dedicated Server Manual.pdf located in serverfiles) # World modifiers can only be set in the start parameters and can be a combination of the following @@ -53,7 +51,7 @@ crossplay="" worldmodifiers="" ## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters -startparameters="-name '${servername}' -password ${serverpassword} -port ${port} -world ${worldname} -public ${public} -savedir '${savedir}' -saveinterval ${saveinterval} -backups ${backups} -backupshort ${backupshort} -backuplong ${backuplong}${logFile:+ -logFile '${logFile}'}${crossplay:+ -crossplay}${worldmodifiers:+ ${worldmodifiers}}" +startparameters="-name '${servername}' -password ${serverpassword} -port ${port} -world ${worldname} -public ${public} -savedir '${savedir}' -saveinterval ${saveinterval} -backups ${backups} -backupshort ${backupshort} -backuplong ${backuplong} -crossplay -instanceid ${instanceid} ${logFile:+ -logFile '${logFile}'} ${worldmodifiers:+ ${worldmodifiers}}" #### LinuxGSM Settings #### diff --git a/lgsm/data/almalinux-8.csv b/lgsm/data/almalinux-8.csv index 4d6c05ca5f..e1b0426b63 100644 --- a/lgsm/data/almalinux-8.csv +++ b/lgsm/data/almalinux-8.csv @@ -126,7 +126,7 @@ ut ut2k4 ut3 ut99 -vh,glibc-devel +vh,glibc-devel,libatomic,pulseaudio-libs-devel vints,aspnetcore-runtime-7.0 vpmc,java-21-openjdk vs diff --git a/lgsm/data/almalinux-9.csv b/lgsm/data/almalinux-9.csv index 2cdd36575a..22846b2633 100644 --- a/lgsm/data/almalinux-9.csv +++ b/lgsm/data/almalinux-9.csv @@ -126,7 +126,7 @@ ut ut2k4 ut3 ut99 -vh,glibc-devel +vh,glibc-devel,libatomic,pulseaudio-libs-devel vints,aspnetcore-runtime-7.0 vpmc,java-21-openjdk vs diff --git a/lgsm/data/centos-7.csv b/lgsm/data/centos-7.csv index df7422526e..f583249fa8 100644 --- a/lgsm/data/centos-7.csv +++ b/lgsm/data/centos-7.csv @@ -126,7 +126,7 @@ ut ut2k4 ut3 ut99 -vh,glibc-devel +vh,glibc-devel,libatomic,pulseaudio-libs-devel vints,aspnetcore-runtime-7.0 vpmc,java-11-openjdk vs diff --git a/lgsm/data/centos-8.csv b/lgsm/data/centos-8.csv index 831bc38e93..82fab1912d 100644 --- a/lgsm/data/centos-8.csv +++ b/lgsm/data/centos-8.csv @@ -126,7 +126,7 @@ ut ut2k4 ut3 ut99 -vh,glibc-devel +vh,glibc-devel,libatomic,pulseaudio-libs-devel vints,aspnetcore-runtime-7.0 vpmc,java-17-openjdk vs diff --git a/lgsm/data/centos-9.csv b/lgsm/data/centos-9.csv index 4d49ee66ec..e9326e0d75 100644 --- a/lgsm/data/centos-9.csv +++ b/lgsm/data/centos-9.csv @@ -126,7 +126,7 @@ ut ut2k4 ut3 ut99 -vh,glibc-devel +vh,glibc-devel,libatomic,pulseaudio-libs-devel vints,aspnetcore-runtime-7.0 vpmc,java-17-openjdk vs diff --git a/lgsm/data/debian-10.csv b/lgsm/data/debian-10.csv index f5d63b0264..f43907e449 100644 --- a/lgsm/data/debian-10.csv +++ b/lgsm/data/debian-10.csv @@ -126,7 +126,7 @@ ut ut2k4 ut3 ut99 -vh,libc6-dev +vh,libc6-dev,libatomic1,libpulse-dev vints,aspnetcore-runtime-7.0 vpmc,openjdk-11-jre vs diff --git a/lgsm/data/debian-11.csv b/lgsm/data/debian-11.csv index 97f5b978df..e064d5b6cc 100644 --- a/lgsm/data/debian-11.csv +++ b/lgsm/data/debian-11.csv @@ -126,7 +126,7 @@ ut ut2k4 ut3 ut99 -vh,libc6-dev +vh,libc6-dev,libatomic1,libpulse-dev vints,aspnetcore-runtime-7.0 vpmc,openjdk-11-jre vs diff --git a/lgsm/data/debian-12.csv b/lgsm/data/debian-12.csv index e54d9b12bf..7964d24f9e 100644 --- a/lgsm/data/debian-12.csv +++ b/lgsm/data/debian-12.csv @@ -126,7 +126,7 @@ ut ut2k4 ut3 ut99 -vh,libc6-dev +vh,libc6-dev,libatomic1,libpulse-dev vints,aspnetcore-runtime-7.0 vpmc,openjdk-17-jre vs diff --git a/lgsm/data/debian-9.csv b/lgsm/data/debian-9.csv index 87b6dad91f..573b75b8c1 100644 --- a/lgsm/data/debian-9.csv +++ b/lgsm/data/debian-9.csv @@ -126,7 +126,7 @@ ut ut2k4 ut3 ut99 -vh,libc6-dev +vh,libc6-dev,libatomic1,libpulse-dev vints,aspnetcore-runtime-7.0 vpmc,openjdk-8-jre vs diff --git a/lgsm/data/rhel-7.csv b/lgsm/data/rhel-7.csv index 3ecff6183b..9ff890dc67 100644 --- a/lgsm/data/rhel-7.csv +++ b/lgsm/data/rhel-7.csv @@ -126,7 +126,7 @@ ut ut2k4 ut3 ut99 -vh,glibc-devel +vh,glibc-devel,libatomic,pulseaudio-libs-devel vints,aspnetcore-runtime-7.0 vpmc,java-11-openjdk vs diff --git a/lgsm/data/rhel-8.csv b/lgsm/data/rhel-8.csv index a378694b29..a6e67c2b3b 100644 --- a/lgsm/data/rhel-8.csv +++ b/lgsm/data/rhel-8.csv @@ -126,7 +126,7 @@ ut ut2k4 ut3 ut99 -vh,glibc-devel +vh,glibc-devel,libatomic,pulseaudio-libs-devel vints,aspnetcore-runtime-7.0 vpmc,java-21-openjdk vs diff --git a/lgsm/data/rhel-9.csv b/lgsm/data/rhel-9.csv index 2cdd36575a..22846b2633 100644 --- a/lgsm/data/rhel-9.csv +++ b/lgsm/data/rhel-9.csv @@ -126,7 +126,7 @@ ut ut2k4 ut3 ut99 -vh,glibc-devel +vh,glibc-devel,libatomic,pulseaudio-libs-devel vints,aspnetcore-runtime-7.0 vpmc,java-21-openjdk vs diff --git a/lgsm/data/rocky-8.csv b/lgsm/data/rocky-8.csv index a378694b29..a6e67c2b3b 100644 --- a/lgsm/data/rocky-8.csv +++ b/lgsm/data/rocky-8.csv @@ -126,7 +126,7 @@ ut ut2k4 ut3 ut99 -vh,glibc-devel +vh,glibc-devel,libatomic,pulseaudio-libs-devel vints,aspnetcore-runtime-7.0 vpmc,java-21-openjdk vs diff --git a/lgsm/data/rocky-9.csv b/lgsm/data/rocky-9.csv index 2cdd36575a..22846b2633 100644 --- a/lgsm/data/rocky-9.csv +++ b/lgsm/data/rocky-9.csv @@ -126,7 +126,7 @@ ut ut2k4 ut3 ut99 -vh,glibc-devel +vh,glibc-devel,libatomic,pulseaudio-libs-devel vints,aspnetcore-runtime-7.0 vpmc,java-21-openjdk vs diff --git a/lgsm/data/ubuntu-16.04.csv b/lgsm/data/ubuntu-16.04.csv index 41dbd0bc5c..1f81cc6bd7 100644 --- a/lgsm/data/ubuntu-16.04.csv +++ b/lgsm/data/ubuntu-16.04.csv @@ -126,7 +126,7 @@ ut ut2k4 ut3 ut99 -vh,libc6-dev +vh,libc6-dev,libatomic1,libpulse-dev vints,aspnetcore-runtime-7.0 vpmc,openjdk-8-jre vs diff --git a/lgsm/data/ubuntu-18.04.csv b/lgsm/data/ubuntu-18.04.csv index 469c667050..20e6bd8195 100644 --- a/lgsm/data/ubuntu-18.04.csv +++ b/lgsm/data/ubuntu-18.04.csv @@ -126,7 +126,7 @@ ut ut2k4 ut3 ut99 -vh,libc6-dev +vh,libc6-dev,libatomic1,libpulse-dev vints,aspnetcore-runtime-7.0 vpmc,openjdk-11-jre vs diff --git a/lgsm/data/ubuntu-20.04.csv b/lgsm/data/ubuntu-20.04.csv index 8d4cc6e521..69469c8107 100644 --- a/lgsm/data/ubuntu-20.04.csv +++ b/lgsm/data/ubuntu-20.04.csv @@ -126,7 +126,7 @@ ut ut2k4 ut3 ut99 -vh,libc6-dev +vh,libc6-dev,libatomic1,libpulse-dev vints,aspnetcore-runtime-7.0 vpmc,openjdk-11-jre vs diff --git a/lgsm/data/ubuntu-22.04.csv b/lgsm/data/ubuntu-22.04.csv index 67d28b5e93..ab0823f151 100644 --- a/lgsm/data/ubuntu-22.04.csv +++ b/lgsm/data/ubuntu-22.04.csv @@ -126,7 +126,7 @@ ut ut2k4 ut3 ut99 -vh,libc6-dev +vh,libc6-dev,libatomic1,libpulse-dev vints,aspnetcore-runtime-7.0 vpmc,openjdk-21-jre vs diff --git a/lgsm/data/ubuntu-23.04.csv b/lgsm/data/ubuntu-23.04.csv index 1b50ed7efb..63597d987b 100644 --- a/lgsm/data/ubuntu-23.04.csv +++ b/lgsm/data/ubuntu-23.04.csv @@ -126,7 +126,7 @@ ut ut2k4 ut3 ut99 -vh,libc6-dev +vh,libc6-dev,libatomic1,libpulse-dev vints,aspnetcore-runtime-7.0 vpmc,openjdk-21-jre vs diff --git a/lgsm/data/ubuntu-23.10.csv b/lgsm/data/ubuntu-23.10.csv index 1b50ed7efb..63597d987b 100644 --- a/lgsm/data/ubuntu-23.10.csv +++ b/lgsm/data/ubuntu-23.10.csv @@ -126,7 +126,7 @@ ut ut2k4 ut3 ut99 -vh,libc6-dev +vh,libc6-dev,libatomic1,libpulse-dev vints,aspnetcore-runtime-7.0 vpmc,openjdk-21-jre vs diff --git a/lgsm/data/ubuntu-24.04.csv b/lgsm/data/ubuntu-24.04.csv index 1b50ed7efb..63597d987b 100644 --- a/lgsm/data/ubuntu-24.04.csv +++ b/lgsm/data/ubuntu-24.04.csv @@ -126,7 +126,7 @@ ut ut2k4 ut3 ut99 -vh,libc6-dev +vh,libc6-dev,libatomic1,libpulse-dev vints,aspnetcore-runtime-7.0 vpmc,openjdk-21-jre vs From 685cca9c58cf207324d538728727c01fab33cb0c Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Tue, 11 Jun 2024 16:18:53 +0100 Subject: [PATCH 02/20] feat: change curl default timeout to 3 seconds (#4592) adjusted to 3 seconds from 10 for a timeout --- lgsm/modules/alert_discord.sh | 7 ++++- lgsm/modules/alert_gotify.sh | 2 +- lgsm/modules/alert_ifttt.sh | 2 +- lgsm/modules/alert_pushbullet.sh | 2 +- lgsm/modules/alert_pushover.sh | 4 +-- lgsm/modules/alert_rocketchat.sh | 2 +- lgsm/modules/alert_slack.sh | 2 +- lgsm/modules/alert_telegram.sh | 2 +- lgsm/modules/command_update_linuxgsm.sh | 36 ++++++++++++------------- lgsm/modules/core_dl.sh | 2 +- lgsm/modules/core_github.sh | 2 +- lgsm/modules/info_game.sh | 36 ++++++++++++------------- lgsm/modules/mods_list.sh | 24 ++++++++--------- linuxgsm.sh | 2 +- 14 files changed, 65 insertions(+), 60 deletions(-) diff --git a/lgsm/modules/alert_discord.sh b/lgsm/modules/alert_discord.sh index 54cf8a3483..2b2ecf21b3 100644 --- a/lgsm/modules/alert_discord.sh +++ b/lgsm/modules/alert_discord.sh @@ -118,6 +118,11 @@ jsonnoinfo=$( "value": "${HOSTNAME}", "inline": true }, + { + "name": "Is my Game Server Online?", + "value": "https://ismygameserver.online/${querytype}/${alertip}:${queryport}", + "inline": true + }, { "name": "Server Time", "value": "$(date)", @@ -142,7 +147,7 @@ else json="${jsoninfo}" fi -discordsend=$(curl --connect-timeout 10 -sSL -H "Content-Type: application/json" -X POST -d "$(echo -n "${json}" | jq -c .)" "${discordwebhook}") +discordsend=$(curl --connect-timeout 3 -sSL -H "Content-Type: application/json" -X POST -d "$(echo -n "${json}" | jq -c .)" "${discordwebhook}") if [ -n "${discordsend}" ]; then fn_print_fail_nl "Sending Discord alert: ${discordsend}" diff --git a/lgsm/modules/alert_gotify.sh b/lgsm/modules/alert_gotify.sh index 2ab6e9eb7c..8f1d31e918 100644 --- a/lgsm/modules/alert_gotify.sh +++ b/lgsm/modules/alert_gotify.sh @@ -34,7 +34,7 @@ else fi fn_print_dots "Sending Gotify alert" -gotifysend=$(curl --connect-timeout 10 -sSL "${gotifywebhook}/message"?token="${gotifytoken}" -H "Content-Type: application/json" -X POST -d "$(echo -n "${json}" | jq -c .)") +gotifysend=$(curl --connect-timeout 3 -sSL "${gotifywebhook}/message"?token="${gotifytoken}" -H "Content-Type: application/json" -X POST -d "$(echo -n "${json}" | jq -c .)") if [ -n "${gotifysend}" ]; then fn_print_ok_nl "Sending Gotify alert" diff --git a/lgsm/modules/alert_ifttt.sh b/lgsm/modules/alert_ifttt.sh index 77932569bf..cbd740ec50 100644 --- a/lgsm/modules/alert_ifttt.sh +++ b/lgsm/modules/alert_ifttt.sh @@ -34,7 +34,7 @@ else fi fn_print_dots "Sending IFTTT alert" -iftttsend=$(curl --connect-timeout 10 -sSL -H "Content-Type: application/json" -X POST -d "$(echo -n "${json}" | jq -c .)" "https://maker.ifttt.com/trigger/${iftttevent}/with/key/${ifttttoken}" | grep "Bad Request") +iftttsend=$(curl --connect-timeout 3 -sSL -H "Content-Type: application/json" -X POST -d "$(echo -n "${json}" | jq -c .)" "https://maker.ifttt.com/trigger/${iftttevent}/with/key/${ifttttoken}" | grep "Bad Request") if [ -n "${iftttsend}" ]; then fn_print_fail_nl "Sending IFTTT alert: ${pushbulletsend}" diff --git a/lgsm/modules/alert_pushbullet.sh b/lgsm/modules/alert_pushbullet.sh index dedd432686..5ed3853f66 100644 --- a/lgsm/modules/alert_pushbullet.sh +++ b/lgsm/modules/alert_pushbullet.sh @@ -36,7 +36,7 @@ else fi fn_print_dots "Sending Pushbullet alert" -pushbulletsend=$(curl --connect-timeout 10 -sSL -H "Access-Token: ${pushbullettoken}" -H "Content-Type: application/json" -X POST -d "$(echo -n "${json}" | jq -c .)" "https://api.pushbullet.com/v2/pushes" | grep "error_code") +pushbulletsend=$(curl --connect-timeout 3 -sSL -H "Access-Token: ${pushbullettoken}" -H "Content-Type: application/json" -X POST -d "$(echo -n "${json}" | jq -c .)" "https://api.pushbullet.com/v2/pushes" | grep "error_code") if [ -n "${pushbulletsend}" ]; then fn_print_fail_nl "Sending Pushbullet alert: ${pushbulletsend}" diff --git a/lgsm/modules/alert_pushover.sh b/lgsm/modules/alert_pushover.sh index c436a4a91e..22180d503d 100644 --- a/lgsm/modules/alert_pushover.sh +++ b/lgsm/modules/alert_pushover.sh @@ -23,9 +23,9 @@ else fi if [ -z "${alerturl}" ]; then - pushoversend=$(curl --connect-timeout 10 -sS -F token="${pushovertoken}" -F user="${pushoveruserkey}" -F html="1" -F sound="${alertsound}" -F priority="${alertpriority}" -F title="${alerttitle}" -F message=" Server name
${servername}

Information
${alertmessage}

Game
${gamename}

Server IP
${alertip}:${port}

Hostname
${HOSTNAME}

Server Time
$(date)" "https://api.pushover.net/1/messages.json" | grep errors) + pushoversend=$(curl --connect-timeout 3 -sS -F token="${pushovertoken}" -F user="${pushoveruserkey}" -F html="1" -F sound="${alertsound}" -F priority="${alertpriority}" -F title="${alerttitle}" -F message=" Server name
${servername}

Information
${alertmessage}

Game
${gamename}

Server IP
${alertip}:${port}

Hostname
${HOSTNAME}

Server Time
$(date)" "https://api.pushover.net/1/messages.json" | grep errors) else - pushoversend=$(curl --connect-timeout 10 -sS -F token="${pushovertoken}" -F user="${pushoveruserkey}" -F html="1" -F sound="${alertsound}" -F priority="${alertpriority}" -F title="${alerttitle}" -F message=" Server name
${servername}

Information
${alertmessage}

Game
${gamename}

Server IP
${alertip}:${port}

Hostname
${HOSTNAME}

More info
${alerturl}

Server Time
$(date)" "https://api.pushover.net/1/messages.json" | grep errors) + pushoversend=$(curl --connect-timeout 3 -sS -F token="${pushovertoken}" -F user="${pushoveruserkey}" -F html="1" -F sound="${alertsound}" -F priority="${alertpriority}" -F title="${alerttitle}" -F message=" Server name
${servername}

Information
${alertmessage}

Game
${gamename}

Server IP
${alertip}:${port}

Hostname
${HOSTNAME}

More info
${alerturl}

Server Time
$(date)" "https://api.pushover.net/1/messages.json" | grep errors) fi if [ -n "${pushoversend}" ]; then diff --git a/lgsm/modules/alert_rocketchat.sh b/lgsm/modules/alert_rocketchat.sh index 3291114942..9107228041 100644 --- a/lgsm/modules/alert_rocketchat.sh +++ b/lgsm/modules/alert_rocketchat.sh @@ -123,7 +123,7 @@ else fi fn_print_dots "Sending Rocketchat alert" -rocketchatsend=$(curl --connect-timeout 10 -sSL -H "Content-Type: application/json" -X POST -d "$(echo -n "${json}" | jq -c .)" "${rocketchatwebhook}") +rocketchatsend=$(curl --connect-timeout 3 -sSL -H "Content-Type: application/json" -X POST -d "$(echo -n "${json}" | jq -c .)" "${rocketchatwebhook}") if [ -n "${rocketchatsend}" ]; then fn_print_ok_nl "Sending Rocketchat alert" diff --git a/lgsm/modules/alert_slack.sh b/lgsm/modules/alert_slack.sh index 728a564e02..b74f98decb 100644 --- a/lgsm/modules/alert_slack.sh +++ b/lgsm/modules/alert_slack.sh @@ -182,7 +182,7 @@ fi fn_print_dots "Sending Slack alert" -slacksend=$(curl --connect-timeout 10 -sSL -H "Content-Type: application/json" -X POST -d "$(echo -n "${json}" | jq -c .)" "${slackwebhook}") +slacksend=$(curl --connect-timeout 3 -sSL -H "Content-Type: application/json" -X POST -d "$(echo -n "${json}" | jq -c .)" "${slackwebhook}") if [ "${slacksend}" == "ok" ]; then fn_print_ok_nl "Sending Slack alert" diff --git a/lgsm/modules/alert_telegram.sh b/lgsm/modules/alert_telegram.sh index 6f6426cb17..98e1a980b3 100644 --- a/lgsm/modules/alert_telegram.sh +++ b/lgsm/modules/alert_telegram.sh @@ -40,7 +40,7 @@ else fi fn_print_dots "Sending Telegram alert" -telegramsend=$(curl --connect-timeout 10 -sSL -H "Content-Type: application/json" -X POST -d "$(echo -n "${json}" | jq -c .)" ${curlcustomstring} "https://${telegramapi}/bot${telegramtoken}/sendMessage" | grep "error_code") +telegramsend=$(curl --connect-timeout 3 -sSL -H "Content-Type: application/json" -X POST -d "$(echo -n "${json}" | jq -c .)" ${curlcustomstring} "https://${telegramapi}/bot${telegramtoken}/sendMessage" | grep "error_code") if [ -n "${telegramsend}" ]; then fn_print_fail_nl "Sending Telegram alert: ${telegramsend}" diff --git a/lgsm/modules/command_update_linuxgsm.sh b/lgsm/modules/command_update_linuxgsm.sh index d202041870..43827a6723 100644 --- a/lgsm/modules/command_update_linuxgsm.sh +++ b/lgsm/modules/command_update_linuxgsm.sh @@ -20,9 +20,9 @@ fn_script_log_info "Updating LinuxGSM" fn_print_dots "Selecting repo" fn_script_log_info "Selecting repo" # Select remotereponame -curl --connect-timeout 10 -IsfL "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/linuxgsm.sh" 1> /dev/null +curl --connect-timeout 3 -IsfL "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/linuxgsm.sh" 1> /dev/null if [ $? != "0" ]; then - curl --connect-timeout 10 -IsfL "https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/linuxgsm.sh" 1> /dev/null + curl --connect-timeout 3 -IsfL "https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/linuxgsm.sh" 1> /dev/null if [ $? != "0" ]; then fn_print_fail_nl "Selecting repo: Unable to to access GitHub or Bitbucket repositories" fn_script_log_fail "Selecting repo: Unable to to access GitHub or Bitbucket repositories" @@ -39,9 +39,9 @@ fi # Check linuxsm.sh echo -en "checking ${remotereponame} linuxgsm.sh...\c" if [ "${remotereponame}" == "GitHub" ]; then - curl --connect-timeout 10 -IsfL "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/linuxgsm.sh" 1> /dev/null + curl --connect-timeout 3 -IsfL "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/linuxgsm.sh" 1> /dev/null else - curl --connect-timeout 10 -IsfL "https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/linuxgsm.sh" 1> /dev/null + curl --connect-timeout 3 -IsfL "https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/linuxgsm.sh" 1> /dev/null fi if [ $? != "0" ]; then fn_print_fail_eol_nl @@ -51,9 +51,9 @@ if [ $? != "0" ]; then fi if [ "${remotereponame}" == "GitHub" ]; then - tmp_script_diff=$(diff "${tmpdir}/linuxgsm.sh" <(curl --connect-timeout 10 -s "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/linuxgsm.sh")) + tmp_script_diff=$(diff "${tmpdir}/linuxgsm.sh" <(curl --connect-timeout 3 -s "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/linuxgsm.sh")) else - tmp_script_diff=$(diff "${tmpdir}/linuxgsm.sh" <(curl --connect-timeout 10 -s "https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/linuxgsm.sh")) + tmp_script_diff=$(diff "${tmpdir}/linuxgsm.sh" <(curl --connect-timeout 3 -s "https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/linuxgsm.sh")) fi if [ "${tmp_script_diff}" != "" ]; then @@ -119,9 +119,9 @@ fi echo -en "checking ${remotereponame} config _default.cfg...\c" fn_script_log_info "Checking ${remotereponame} config _default.cfg" if [ "${remotereponame}" == "GitHub" ]; then - curl --connect-timeout 10 -IsfL "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/lgsm/config-default/config-lgsm/${gameservername}/_default.cfg" 1> /dev/null + curl --connect-timeout 3 -IsfL "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/lgsm/config-default/config-lgsm/${gameservername}/_default.cfg" 1> /dev/null else - curl --connect-timeout 10 -IsfL "https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/lgsm/config-default/config-lgsm/${gameservername}/_default.cfg" 1> /dev/null + curl --connect-timeout 3 -IsfL "https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/lgsm/config-default/config-lgsm/${gameservername}/_default.cfg" 1> /dev/null fi if [ $? != "0" ]; then fn_print_fail_eol_nl @@ -131,9 +131,9 @@ if [ $? != "0" ]; then fi if [ "${remotereponame}" == "GitHub" ]; then - config_file_diff=$(diff "${configdirdefault}/config-lgsm/${gameservername}/_default.cfg" <(curl --connect-timeout 10 -s "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/lgsm/config-default/config-lgsm/${gameservername}/_default.cfg")) + config_file_diff=$(diff "${configdirdefault}/config-lgsm/${gameservername}/_default.cfg" <(curl --connect-timeout 3 -s "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/lgsm/config-default/config-lgsm/${gameservername}/_default.cfg")) else - config_file_diff=$(diff "${configdirdefault}/config-lgsm/${gameservername}/_default.cfg" <(curl --connect-timeout 10 -s "https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/lgsm/config-default/config-lgsm/${gameservername}/_default.cfg")) + config_file_diff=$(diff "${configdirdefault}/config-lgsm/${gameservername}/_default.cfg" <(curl --connect-timeout 3 -s "https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/lgsm/config-default/config-lgsm/${gameservername}/_default.cfg")) fi if [ "${config_file_diff}" != "" ]; then @@ -153,9 +153,9 @@ if [ -f "${datadir}/${distroid}-${distroversioncsv}.csv" ]; then echo -en "checking ${remotereponame} config ${distroid}-${distroversioncsv}.csv...\c" fn_script_log_info "Checking ${remotereponame} ${distroid}-${distroversioncsv}.csv" if [ "${remotereponame}" == "GitHub" ]; then - curl --connect-timeout 10 -IsfL "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/lgsm/data/${distroid}-${distroversioncsv}.csv" 1> /dev/null + curl --connect-timeout 3 -IsfL "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/lgsm/data/${distroid}-${distroversioncsv}.csv" 1> /dev/null else - curl --connect-timeout 10 -IsfL "https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/lgsm/data/${distroid}-${distroversioncsv}.csv" 1> /dev/null + curl --connect-timeout 3 -IsfL "https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/lgsm/data/${distroid}-${distroversioncsv}.csv" 1> /dev/null fi if [ $? != "0" ]; then fn_print_fail_eol_nl @@ -165,9 +165,9 @@ if [ -f "${datadir}/${distroid}-${distroversioncsv}.csv" ]; then fi if [ "${remotereponame}" == "GitHub" ]; then - config_file_diff=$(diff "${datadir}/${distroid}-${distroversioncsv}.csv" <(curl --connect-timeout 10 -s "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/lgsm/data/${distroid}-${distroversioncsv}.csv")) + config_file_diff=$(diff "${datadir}/${distroid}-${distroversioncsv}.csv" <(curl --connect-timeout 3 -s "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/lgsm/data/${distroid}-${distroversioncsv}.csv")) else - config_file_diff=$(diff "${datadir}/${distroid}-${distroversioncsv}.csv" <(curl --connect-timeout 10 -s "https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/lgsm/data/${distroid}-${distroversioncsv}.csv")) + config_file_diff=$(diff "${datadir}/${distroid}-${distroversioncsv}.csv" <(curl --connect-timeout 3 -s "https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/lgsm/data/${distroid}-${distroversioncsv}.csv")) fi if [ "${config_file_diff}" != "" ]; then @@ -191,9 +191,9 @@ if [ -n "${modulesdir}" ]; then echo -en "checking ${remotereponame} module ${modulefile}...\c" github_file_url_dir="lgsm/modules" if [ "${remotereponame}" == "GitHub" ]; then - curl --connect-timeout 10 -IsfL "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${modulefile}" 1> /dev/null + curl --connect-timeout 3 -IsfL "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${modulefile}" 1> /dev/null else - curl --connect-timeout 10 -IsfL "https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/${github_file_url_dir}/${modulefile}" 1> /dev/null + curl --connect-timeout 3 -IsfL "https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/${github_file_url_dir}/${modulefile}" 1> /dev/null fi if [ $? != 0 ]; then fn_print_error_eol_nl @@ -210,9 +210,9 @@ if [ -n "${modulesdir}" ]; then else # compare file if [ "${remotereponame}" == "GitHub" ]; then - module_file_diff=$(diff "${modulesdir}/${modulefile}" <(curl --connect-timeout 10 -s "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${modulefile}")) + module_file_diff=$(diff "${modulesdir}/${modulefile}" <(curl --connect-timeout 3 -s "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${modulefile}")) else - module_file_diff=$(diff "${modulesdir}/${modulefile}" <(curl --connect-timeout 10 -s "https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/${github_file_url_dir}/${modulefile}")) + module_file_diff=$(diff "${modulesdir}/${modulefile}" <(curl --connect-timeout 3 -s "https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/${github_file_url_dir}/${modulefile}")) fi # results diff --git a/lgsm/modules/core_dl.sh b/lgsm/modules/core_dl.sh index caca0fc582..89a63eb8b1 100644 --- a/lgsm/modules/core_dl.sh +++ b/lgsm/modules/core_dl.sh @@ -390,7 +390,7 @@ fn_fetch_file() { fi # Trap will remove part downloaded files if canceled. trap fn_fetch_trap INT - curlcmd=(curl --connect-timeout 10 --fail -L -o "${local_filedir}/${local_filename}" --retry 2) + curlcmd=(curl --connect-timeout 3 --fail -L -o "${local_filedir}/${local_filename}" --retry 2) # if is large file show progress, else be silent local exitcode="" diff --git a/lgsm/modules/core_github.sh b/lgsm/modules/core_github.sh index 7290f9bdfc..402ee078c3 100644 --- a/lgsm/modules/core_github.sh +++ b/lgsm/modules/core_github.sh @@ -23,7 +23,7 @@ fn_github_get_latest_release_version() { local githubreleaserepo="${2}" local githublatestreleaseurl="${github_api}/repos/${githubreleaseuser}/${githubreleaserepo}/releases/latest" - githubreleaseversion=$(curl -s --connect-timeout 10 "${githublatestreleaseurl}" | jq '.tag_name') + githubreleaseversion=$(curl -s --connect-timeout 3 "${githublatestreleaseurl}" | jq '.tag_name') # error if no version is there if [ -z "${githubreleaseversion}" ]; then diff --git a/lgsm/modules/info_game.sh b/lgsm/modules/info_game.sh index 497a65f22b..56ae055e45 100644 --- a/lgsm/modules/info_game.sh +++ b/lgsm/modules/info_game.sh @@ -2496,12 +2496,12 @@ if [ ! -f "${tmpdir}/publicip.json" ] || [ "$(find "${tmpdir}/publicip.json" -mm if [ "${exitcode}" -eq 0 ]; then fn_script_log_pass "Queried ${apiurl} for public IP address" - # Parse and reformat the response - publicip="$(echo "${ipresponse}" | jq -r '.query')" - country="$(echo "${ipresponse}" | jq -r '.country')" - countrycode="$(echo "${ipresponse}" | jq -r '.countryCode')" - # Construct a universal JSON format - echo "{\"ip\":\"${publicip}\",\"country\":\"${country}\",\"countryCode\":\"${countrycode}\",\"apiurl\":\"${apiurl}\"}" > "${tmpdir}/publicip.json" + # Parse and reformat the response + publicip="$(echo "${ipresponse}" | jq -r '.query')" + country="$(echo "${ipresponse}" | jq -r '.country')" + countrycode="$(echo "${ipresponse}" | jq -r '.countryCode')" + # Construct a universal JSON format + echo "{\"ip\":\"${publicip}\",\"country\":\"${country}\",\"countryCode\":\"${countrycode}\",\"apiurl\":\"${apiurl}\"}" > "${tmpdir}/publicip.json" else # Fallback to myip.wtf if the initial request failed or timed out apiurl="https://myip.wtf/json" @@ -2514,12 +2514,12 @@ if [ ! -f "${tmpdir}/publicip.json" ] || [ "$(find "${tmpdir}/publicip.json" -mm if [ "${exitcode}" -eq 0 ]; then fn_script_log_pass "Queried ${apiurl} for public IP address" - # Parse and reformat the response from myip.wtf - publicip="$(echo "${ipresponse}" | jq -r '.YourFuckingIPAddress')" - country="$(echo "${ipresponse}" | jq -r '.YourFuckingCountry')" - countrycode="$(echo "${ipresponse}" | jq -r '.YourFuckingCountryCode')" - # Construct a universal JSON format - echo "{\"ip\":\"${publicip}\",\"country\":\"${country}\",\"countryCode\":\"${countrycode}\",\"apiurl\":\"${apiurl}\"}" > "${tmpdir}/publicip.json" + # Parse and reformat the response from myip.wtf + publicip="$(echo "${ipresponse}" | jq -r '.YourFuckingIPAddress')" + country="$(echo "${ipresponse}" | jq -r '.YourFuckingCountry')" + countrycode="$(echo "${ipresponse}" | jq -r '.YourFuckingCountryCode')" + # Construct a universal JSON format + echo "{\"ip\":\"${publicip}\",\"country\":\"${country}\",\"countryCode\":\"${countrycode}\",\"apiurl\":\"${apiurl}\"}" > "${tmpdir}/publicip.json" else fn_script_log_error "Unable to get public IP address" publicip="NOT SET" @@ -2529,10 +2529,10 @@ if [ ! -f "${tmpdir}/publicip.json" ] || [ "$(find "${tmpdir}/publicip.json" -mm fi else # Cached IP is still valid - fn_script_log_pass "Using cached IP as public IP address" - publicip="$(jq -r '.ip' "${tmpdir}/publicip.json")" - country="$(jq -r '.country' "${tmpdir}/publicip.json")" - countrycode="$(jq -r '.countryCode' "${tmpdir}/publicip.json")" + fn_script_log_pass "Using cached IP as public IP address" + publicip="$(jq -r '.ip' "${tmpdir}/publicip.json")" + country="$(jq -r '.country' "${tmpdir}/publicip.json")" + countrycode="$(jq -r '.countryCode' "${tmpdir}/publicip.json")" fi # Alert IP address @@ -2559,11 +2559,11 @@ if [ -z "${displaymasterserver}" ]; then if [ -n "${ip}" ] && [ -n "${port}" ]; then if [ "${steammaster}" == "true" ] || [ "${commandname}" == "DEV-QUERY-RAW" ]; then # Query external IP first as most liky to succeed. - masterserver="$(curl --connect-timeout 10 -m 3 -s "https://api.steampowered.com/ISteamApps/GetServersAtAddress/v0001?addr=${publicip}&format=json" | jq --arg port "${port}" --arg queryport "${queryport}" --arg port3 "${port3}" 'if .response.servers != null then .response.servers[] | select((.gameport == ($port|tonumber) or .gameport == ($queryport|tonumber) or .gameport == ($port3|tonumber))) | .addr else empty end' | wc -l 2> /dev/null)" + masterserver="$(curl --connect-timeout 3 -m 3 -s "https://api.steampowered.com/ISteamApps/GetServersAtAddress/v0001?addr=${publicip}&format=json" | jq --arg port "${port}" --arg queryport "${queryport}" --arg port3 "${port3}" 'if .response.servers != null then .response.servers[] | select((.gameport == ($port|tonumber) or .gameport == ($queryport|tonumber) or .gameport == ($port3|tonumber))) | .addr else empty end' | wc -l 2> /dev/null)" if [ "${masterserver}" == "0" ]; then # Loop though server IP addresses if external IP fails. for queryip in "${queryips[@]}"; do - masterserver="$(curl --connect-timeout 10 -m 3 -s "https://api.steampowered.com/ISteamApps/GetServersAtAddress/v0001?addr=${queryip}&format=json" | jq --arg port "${port}" --arg queryport "${queryport}" --arg port3 "${port3}" 'if .response.servers != null then .response.servers[] | select((.gameport == ($port|tonumber) or .gameport == ($queryport|tonumber) or .gameport == ($port3|tonumber))) | .addr else empty end' | wc -l 2> /dev/null)" + masterserver="$(curl --connect-timeout 3 -m 3 -s "https://api.steampowered.com/ISteamApps/GetServersAtAddress/v0001?addr=${queryip}&format=json" | jq --arg port "${port}" --arg queryport "${queryport}" --arg port3 "${port3}" 'if .response.servers != null then .response.servers[] | select((.gameport == ($port|tonumber) or .gameport == ($queryport|tonumber) or .gameport == ($port3|tonumber))) | .addr else empty end' | wc -l 2> /dev/null)" done fi if [ "${masterserver}" == "0" ]; then diff --git a/lgsm/modules/mods_list.sh b/lgsm/modules/mods_list.sh index c13565004d..ca320e4680 100644 --- a/lgsm/modules/mods_list.sh +++ b/lgsm/modules/mods_list.sh @@ -68,7 +68,7 @@ sourcemoddownloadurl="https://www.sourcemod.net/latest.php?os=linux&version=${so sourcemodurl="${sourcemoddownloadurl}" # Steamworks steamworksscrapeurl="https://users.alliedmods.net/~kyles/builds/SteamWorks" -steamworkslatestfile=$(curl --connect-timeout 10 -sL ${steamworksscrapeurl} | grep -m 1 linux | cut -d '"' -f 4) +steamworkslatestfile=$(curl --connect-timeout 3 -sL ${steamworksscrapeurl} | grep -m 1 linux | cut -d '"' -f 4) steamworksdownloadurl="${steamworksscrapeurl}/${steamworkslatestfile}" steamworksurl="${steamworksdownloadurl}" # Stripper:Source @@ -78,34 +78,34 @@ stripperdownloadurl="http://www.bailopan.net/stripper/snapshots/1.2/${stripperla stripperurl="${stripperdownloadurl}" # CS:GO Mods -get5lastbuild=$(curl --connect-timeout 10 -sL https://api.github.com/repos/splewis/get5/releases/latest | jq '.assets[] |select(.browser_download_url | endswith(".tar.gz"))') +get5lastbuild=$(curl --connect-timeout 3 -sL https://api.github.com/repos/splewis/get5/releases/latest | jq '.assets[] |select(.browser_download_url | endswith(".tar.gz"))') get5latestfile=$(echo -e "${get5lastbuild}" | jq -r '.name') get5latestfilelink=$(echo -e "${get5lastbuild}" | jq -r '.browser_download_url') -csgopracticelatest=$(curl --connect-timeout 10 -sL https://api.github.com/repos/splewis/csgo-practice-mode/releases/latest | jq '.assets[]') +csgopracticelatest=$(curl --connect-timeout 3 -sL https://api.github.com/repos/splewis/csgo-practice-mode/releases/latest | jq '.assets[]') csgopracticelatestfile=$(echo -e "${csgopracticelatest}" | jq -r '.name') csgopracticelatestlink=$(echo -e "${csgopracticelatest}" | jq -r '.browser_download_url') -csgopuglatest=$(curl --connect-timeout 10 -sL https://api.github.com/repos/splewis/csgo-pug-setup/releases/latest | jq '.assets[]') +csgopuglatest=$(curl --connect-timeout 3 -sL https://api.github.com/repos/splewis/csgo-pug-setup/releases/latest | jq '.assets[]') csgopuglatestfile=$(echo -e "${csgopuglatest}" | jq -r '.name') csgopuglatestlink=$(echo -e "${csgopuglatest}" | jq -r '.browser_download_url') -gokzlatestversion=$(curl --connect-timeout 10 -s https://api.github.com/repos/KZGlobalTeam/gokz/releases/latest | grep "tag_name" | cut -d : -f 2,3 | sed -E 's/.*"([^"]+)".*/\1/') +gokzlatestversion=$(curl --connect-timeout 3 -s https://api.github.com/repos/KZGlobalTeam/gokz/releases/latest | grep "tag_name" | cut -d : -f 2,3 | sed -E 's/.*"([^"]+)".*/\1/') gokzlatestfile="GOKZ-v${gokzlatestversion}.zip" gokzlatestlink="https://github.com/KZGlobalTeam/gokz/releases/download/${gokzlatestversion}/${gokzlatestfile}" -movementapilatestversion=$(curl --connect-timeout 10 -s https://api.github.com/repos/danzayau/MovementAPI/releases/latest | grep "tag_name" | cut -d : -f 2,3 | sed -E 's/.*"([^"]+)".*/\1/') +movementapilatestversion=$(curl --connect-timeout 3 -s https://api.github.com/repos/danzayau/MovementAPI/releases/latest | grep "tag_name" | cut -d : -f 2,3 | sed -E 's/.*"([^"]+)".*/\1/') movementapilatestfile="MovementAPI-v${movementapilatestversion}.zip" movementapilatestlink="https://github.com/danzayau/MovementAPI/releases/download/${movementapilatestversion}/${movementapilatestfile}" # Rust carbonrustapilatestfile="Carbon.Linux.Release.tar.gz" -carbonrustlatestlink=$(curl --connect-timeout 10 -sL https://api.github.com/repos/CarbonCommunity/Carbon.Core/releases/tags/production_build | jq -r '.assets[]|select(.name == "Carbon.Linux.Release.tar.gz") | .browser_download_url') +carbonrustlatestlink=$(curl --connect-timeout 3 -sL https://api.github.com/repos/CarbonCommunity/Carbon.Core/releases/tags/production_build | jq -r '.assets[]|select(.name == "Carbon.Linux.Release.tar.gz") | .browser_download_url') # Oxide -oxiderustlatestlink=$(curl --connect-timeout 10 -sL https://api.github.com/repos/OxideMod/Oxide.Rust/releases/latest | jq -r '.assets[]|select(.browser_download_url | contains("linux")) | .browser_download_url') -oxidehurtworldlatestlink=$(curl --connect-timeout 10 -sL https://api.github.com/repos/OxideMod/Oxide.Hurtworld/releases/latest | jq -r '.assets[].browser_download_url') -oxidesdtdlatestlink=$(curl --connect-timeout 10 -sL https://api.github.com/repos/OxideMod/Oxide.SevenDaysToDie/releases/latest | jq -r '.assets[]|select(.browser_download_url | contains("linux")) | .browser_download_url') +oxiderustlatestlink=$(curl --connect-timeout 3 -sL https://api.github.com/repos/OxideMod/Oxide.Rust/releases/latest | jq -r '.assets[]|select(.browser_download_url | contains("linux")) | .browser_download_url') +oxidehurtworldlatestlink=$(curl --connect-timeout 3 -sL https://api.github.com/repos/OxideMod/Oxide.Hurtworld/releases/latest | jq -r '.assets[].browser_download_url') +oxidesdtdlatestlink=$(curl --connect-timeout 3 -sL https://api.github.com/repos/OxideMod/Oxide.SevenDaysToDie/releases/latest | jq -r '.assets[]|select(.browser_download_url | contains("linux")) | .browser_download_url') # Valheim Plus -valheimpluslatestlink=$(curl --connect-timeout 10 -sL https://api.github.com/repos/Grantapher/ValheimPlus/releases/latest | jq -r '.assets[]|select(.browser_download_url | contains("UnixServer.tar.gz")) | .browser_download_url') +valheimpluslatestlink=$(curl --connect-timeout 3 -sL https://api.github.com/repos/Grantapher/ValheimPlus/releases/latest | jq -r '.assets[]|select(.browser_download_url | contains("UnixServer.tar.gz")) | .browser_download_url') # Valheim BepInEx -bepinexvhlatestlink=$(curl --connect-timeout 10 -sL "https://thunderstore.io/api/experimental/package/denikson/BepInExPack_Valheim/" -H "accept: application/json" | jq -r '.latest.download_url') +bepinexvhlatestlink=$(curl --connect-timeout 3 -sL "https://thunderstore.io/api/experimental/package/denikson/BepInExPack_Valheim/" -H "accept: application/json" | jq -r '.latest.download_url') # Define mods information (required) diff --git a/linuxgsm.sh b/linuxgsm.sh index 8db9a57c94..6639e341f6 100755 --- a/linuxgsm.sh +++ b/linuxgsm.sh @@ -111,7 +111,7 @@ fn_bootstrap_fetch_file() { # Larger files show a progress bar. echo -en "fetching ${fileurl_name} ${local_filename}...\c" - curlcmd=$(curl --connect-timeout 10 -s --fail -L -o "${local_filedir}/${local_filename}" "${fileurl}" 2>&1) + curlcmd=$(curl --connect-timeout 3 -s --fail -L -o "${local_filedir}/${local_filename}" "${fileurl}" 2>&1) local exitcode=$? From 88f8890229d7243c2bf391503d0f3a5aba4f99d6 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Thu, 13 Jun 2024 11:45:06 +0100 Subject: [PATCH 03/20] feat: deprecate Memories of Mars (#4593) --- lgsm/data/almalinux-8.csv | 1 - lgsm/data/almalinux-9.csv | 1 - lgsm/data/centos-7.csv | 1 - lgsm/data/centos-8.csv | 1 - lgsm/data/centos-9.csv | 1 - lgsm/data/debian-10.csv | 1 - lgsm/data/debian-11.csv | 1 - lgsm/data/debian-12.csv | 1 - lgsm/data/debian-9.csv | 1 - lgsm/data/rhel-7.csv | 1 - lgsm/data/rhel-8.csv | 1 - lgsm/data/rhel-9.csv | 1 - lgsm/data/rocky-8.csv | 1 - lgsm/data/rocky-9.csv | 1 - lgsm/data/serverlist.csv | 1 - lgsm/data/ubuntu-16.04.csv | 1 - lgsm/data/ubuntu-18.04.csv | 1 - lgsm/data/ubuntu-20.04.csv | 1 - lgsm/data/ubuntu-22.04.csv | 1 - lgsm/data/ubuntu-23.04.csv | 1 - lgsm/data/ubuntu-23.10.csv | 1 - lgsm/data/ubuntu-24.04.csv | 1 - lgsm/modules/info_game.sh | 20 -------------------- lgsm/modules/info_messages.sh | 10 ---------- lgsm/modules/install_config.sh | 6 ------ 25 files changed, 58 deletions(-) diff --git a/lgsm/data/almalinux-8.csv b/lgsm/data/almalinux-8.csv index e1b0426b63..ab8d75b6a2 100644 --- a/lgsm/data/almalinux-8.csv +++ b/lgsm/data/almalinux-8.csv @@ -69,7 +69,6 @@ mc,java-21-openjdk mcb,libnsl mh mohaa,compat-libstdc++-33.i686 -mom mta,ncurses-compat-libs,libxml2 nd nec diff --git a/lgsm/data/almalinux-9.csv b/lgsm/data/almalinux-9.csv index 22846b2633..e4fb83e3b4 100644 --- a/lgsm/data/almalinux-9.csv +++ b/lgsm/data/almalinux-9.csv @@ -69,7 +69,6 @@ mc,java-21-openjdk mcb,libnsl mh mohaa,compat-libstdc++-33.i686 -mom mta,ncurses-compat-libs,libxml2 nd nec diff --git a/lgsm/data/centos-7.csv b/lgsm/data/centos-7.csv index f583249fa8..0e04e3c743 100644 --- a/lgsm/data/centos-7.csv +++ b/lgsm/data/centos-7.csv @@ -69,7 +69,6 @@ mc,java-21-openjdk mcb,libnsl mh mohaa,compat-libstdc++-33.i686 -mom mta,ncurses-libs,libxml2 nd nec diff --git a/lgsm/data/centos-8.csv b/lgsm/data/centos-8.csv index 82fab1912d..c07bf66d0d 100644 --- a/lgsm/data/centos-8.csv +++ b/lgsm/data/centos-8.csv @@ -69,7 +69,6 @@ mc,java-21-openjdk mcb,libnsl mh mohaa,compat-libstdc++-33.i686 -mom mta,ncurses-compat-libs,libxml2 nd nec diff --git a/lgsm/data/centos-9.csv b/lgsm/data/centos-9.csv index e9326e0d75..c919a160be 100644 --- a/lgsm/data/centos-9.csv +++ b/lgsm/data/centos-9.csv @@ -69,7 +69,6 @@ mc,java-17-openjdk mcb,libnsl mh mohaa,compat-libstdc++-33.i686 -mom mta,ncurses-compat-libs,libxml2 nd nec diff --git a/lgsm/data/debian-10.csv b/lgsm/data/debian-10.csv index f43907e449..1892d9f9fe 100644 --- a/lgsm/data/debian-10.csv +++ b/lgsm/data/debian-10.csv @@ -68,7 +68,6 @@ mc,openjdk-11-jre mcb mh mohaa,libstdc++5:i386 -mom mta,libncursesw5,libxml2-utils nd nec diff --git a/lgsm/data/debian-11.csv b/lgsm/data/debian-11.csv index e064d5b6cc..9a37307c02 100644 --- a/lgsm/data/debian-11.csv +++ b/lgsm/data/debian-11.csv @@ -69,7 +69,6 @@ mc,openjdk-17-jre mcb mh mohaa,libstdc++5:i386 -mom mta,libncursesw5,libxml2-utils nd nec diff --git a/lgsm/data/debian-12.csv b/lgsm/data/debian-12.csv index 7964d24f9e..8835871ee5 100644 --- a/lgsm/data/debian-12.csv +++ b/lgsm/data/debian-12.csv @@ -69,7 +69,6 @@ mc,openjdk-17-jre mcb mh mohaa,libstdc++5:i386 -mom mta,libncursesw5,libxml2-utils nd nec diff --git a/lgsm/data/debian-9.csv b/lgsm/data/debian-9.csv index 573b75b8c1..c202924de2 100644 --- a/lgsm/data/debian-9.csv +++ b/lgsm/data/debian-9.csv @@ -69,7 +69,6 @@ mc,openjdk-8-jre mcb mh mohaa,libstdc++5:i386 -mom mta,libncursesw5,libxml2-utils nd nec diff --git a/lgsm/data/rhel-7.csv b/lgsm/data/rhel-7.csv index 9ff890dc67..0546d8eb1d 100644 --- a/lgsm/data/rhel-7.csv +++ b/lgsm/data/rhel-7.csv @@ -70,7 +70,6 @@ mc,java-11-openjdk mcb,libnsl mh mohaa,compat-libstdc++-33.i686 -mom mta,ncurses-libs,libxml2 nd nec diff --git a/lgsm/data/rhel-8.csv b/lgsm/data/rhel-8.csv index a6e67c2b3b..bbfb982f0b 100644 --- a/lgsm/data/rhel-8.csv +++ b/lgsm/data/rhel-8.csv @@ -69,7 +69,6 @@ mc,java-21-openjdk mcb,libnsl mh mohaa,compat-libstdc++-33.i686 -mom mta,ncurses-compat-libs,libxml2 nd nec diff --git a/lgsm/data/rhel-9.csv b/lgsm/data/rhel-9.csv index 22846b2633..e4fb83e3b4 100644 --- a/lgsm/data/rhel-9.csv +++ b/lgsm/data/rhel-9.csv @@ -69,7 +69,6 @@ mc,java-21-openjdk mcb,libnsl mh mohaa,compat-libstdc++-33.i686 -mom mta,ncurses-compat-libs,libxml2 nd nec diff --git a/lgsm/data/rocky-8.csv b/lgsm/data/rocky-8.csv index a6e67c2b3b..bbfb982f0b 100644 --- a/lgsm/data/rocky-8.csv +++ b/lgsm/data/rocky-8.csv @@ -69,7 +69,6 @@ mc,java-21-openjdk mcb,libnsl mh mohaa,compat-libstdc++-33.i686 -mom mta,ncurses-compat-libs,libxml2 nd nec diff --git a/lgsm/data/rocky-9.csv b/lgsm/data/rocky-9.csv index 22846b2633..e4fb83e3b4 100644 --- a/lgsm/data/rocky-9.csv +++ b/lgsm/data/rocky-9.csv @@ -69,7 +69,6 @@ mc,java-21-openjdk mcb,libnsl mh mohaa,compat-libstdc++-33.i686 -mom mta,ncurses-compat-libs,libxml2 nd nec diff --git a/lgsm/data/serverlist.csv b/lgsm/data/serverlist.csv index ae270f9650..23e1266270 100644 --- a/lgsm/data/serverlist.csv +++ b/lgsm/data/serverlist.csv @@ -68,7 +68,6 @@ mc,mcserver,Minecraft,ubuntu-22.04 mcb,mcbserver,Minecraft Bedrock,ubuntu-22.04 mh,mhserver,MORDHAU,ubuntu-22.04 mohaa,mohaaserver,Medal of Honor: Allied Assault,ubuntu-22.04 -mom,momserver,Memories of Mars,ubuntu-22.04 mta,mtaserver,Multi Theft Auto,ubuntu-22.04 nd,ndserver,Nuclear Dawn,ubuntu-22.04 nec,necserver,Necesse,ubuntu-22.04 diff --git a/lgsm/data/ubuntu-16.04.csv b/lgsm/data/ubuntu-16.04.csv index 1f81cc6bd7..cf6a202205 100644 --- a/lgsm/data/ubuntu-16.04.csv +++ b/lgsm/data/ubuntu-16.04.csv @@ -70,7 +70,6 @@ mc,openjdk-8-jre mcb mh mohaa,libstdc++5:i386 -mom mta nd nec diff --git a/lgsm/data/ubuntu-18.04.csv b/lgsm/data/ubuntu-18.04.csv index 20e6bd8195..6f7dcbe18d 100644 --- a/lgsm/data/ubuntu-18.04.csv +++ b/lgsm/data/ubuntu-18.04.csv @@ -70,7 +70,6 @@ mc,openjdk-11-jre mcb mh mohaa,libstdc++5:i386 -mom mta,libncursesw5,libxml2-utils nd nec diff --git a/lgsm/data/ubuntu-20.04.csv b/lgsm/data/ubuntu-20.04.csv index 69469c8107..98ba275f9c 100644 --- a/lgsm/data/ubuntu-20.04.csv +++ b/lgsm/data/ubuntu-20.04.csv @@ -69,7 +69,6 @@ mc,openjdk-21-jre mcb mh mohaa,libstdc++5:i386 -mom mta,libncursesw5,libxml2-utils nd nec diff --git a/lgsm/data/ubuntu-22.04.csv b/lgsm/data/ubuntu-22.04.csv index ab0823f151..9bc8f7ad1c 100644 --- a/lgsm/data/ubuntu-22.04.csv +++ b/lgsm/data/ubuntu-22.04.csv @@ -69,7 +69,6 @@ mc,openjdk-21-jre mcb mh mohaa,libstdc++5:i386 -mom mta,libncursesw5,libxml2-utils nd nec diff --git a/lgsm/data/ubuntu-23.04.csv b/lgsm/data/ubuntu-23.04.csv index 63597d987b..e6d0c2962d 100644 --- a/lgsm/data/ubuntu-23.04.csv +++ b/lgsm/data/ubuntu-23.04.csv @@ -69,7 +69,6 @@ mc,openjdk-21-jre mcb mh mohaa,libstdc++5:i386 -mom mta,libncursesw5,libxml2-utils nd nec diff --git a/lgsm/data/ubuntu-23.10.csv b/lgsm/data/ubuntu-23.10.csv index 63597d987b..e6d0c2962d 100644 --- a/lgsm/data/ubuntu-23.10.csv +++ b/lgsm/data/ubuntu-23.10.csv @@ -69,7 +69,6 @@ mc,openjdk-21-jre mcb mh mohaa,libstdc++5:i386 -mom mta,libncursesw5,libxml2-utils nd nec diff --git a/lgsm/data/ubuntu-24.04.csv b/lgsm/data/ubuntu-24.04.csv index 63597d987b..e6d0c2962d 100644 --- a/lgsm/data/ubuntu-24.04.csv +++ b/lgsm/data/ubuntu-24.04.csv @@ -69,7 +69,6 @@ mc,openjdk-21-jre mcb mh mohaa,libstdc++5:i386 -mom mta,libncursesw5,libxml2-utils nd nec diff --git a/lgsm/modules/info_game.sh b/lgsm/modules/info_game.sh index 56ae055e45..007187ab85 100644 --- a/lgsm/modules/info_game.sh +++ b/lgsm/modules/info_game.sh @@ -1510,24 +1510,6 @@ fn_info_game_mohaa() { serverpassword="${serverpassword:-"NOT SET"}" } -# Config Type: json -# Parameters: true -# Comment: // or /* */ -fn_info_game_mom() { - if [ -f "${servercfgfullpath}" ]; then - fn_info_game_json "defaultmap" ".MapName" - fn_info_game_json "maxplayers" ".MaxPlayers" - fn_info_game_json "servername" ".ServerName" - fn_info_game_json "serverpassword" ".ServerPassword" - fi - beaconport="${beaconport:-"0"}" - defaultmap="${defaultmap:-"NOT SET"}" - maxplayers="${maxplayers:-"0"}" - port="${port:-"0"}" - servername="${servername:-"NOT SET"}" - serverpassword="${serverpassword:-"NOT SET"}" -} - # Config Type: xml # Comment: # Example: Default MTA Server @@ -2375,8 +2357,6 @@ elif [ "${shortname}" == "mh" ]; then fn_info_game_mh elif [ "${shortname}" == "mohaa" ]; then fn_info_game_mohaa -elif [ "${shortname}" == "mom" ]; then - fn_info_game_mom elif [ "${shortname}" == "mta" ]; then fn_info_game_mta elif [ "${shortname}" == "nec" ]; then diff --git a/lgsm/modules/info_messages.sh b/lgsm/modules/info_messages.sh index a1e8f52acf..a5f25bc742 100644 --- a/lgsm/modules/info_messages.sh +++ b/lgsm/modules/info_messages.sh @@ -1192,14 +1192,6 @@ fn_info_messages_mohaa() { } | column -s $'\t' -t } -fn_info_messages_mom() { - { - fn_port "header" - fn_port "Game" port udp - fn_port "Beacon" beaconport udp - } | column -s $'\t' -t -} - fn_info_messages_mta() { { fn_port "header" @@ -1804,8 +1796,6 @@ fn_info_messages_select_engine() { fn_info_messages_mh elif [ "${shortname}" == "mohaa" ]; then fn_info_messages_mohaa - elif [ "${shortname}" == "mom" ]; then - fn_info_messages_mom elif [ "${shortname}" == "mta" ]; then fn_info_messages_mta elif [ "${shortname}" == "nec" ]; then diff --git a/lgsm/modules/install_config.sh b/lgsm/modules/install_config.sh index 9b31467703..eea590f9e2 100644 --- a/lgsm/modules/install_config.sh +++ b/lgsm/modules/install_config.sh @@ -589,12 +589,6 @@ elif [ "${shortname}" == "mta" ]; then fn_fetch_default_config fn_default_config_remote fn_list_config_locations -elif [ "${shotname}" == "mom" ]; then - array_configs+=(DedicatedServerConfig.cfg) - fn_fetch_default_config - fn_default_config_remote - fn_set_config_vars - fn_list_config_locations elif [ "${shortname}" == "pvr" ]; then fn_check_cfgdir array_configs+=(Game.ini) From 164f9507f84e9856408bef75411ef893f7d36cc0 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Thu, 13 Jun 2024 14:13:29 +0100 Subject: [PATCH 04/20] feat: add debian 13 --- lgsm/data/debian-13.csv | 137 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 137 insertions(+) create mode 100644 lgsm/data/debian-13.csv diff --git a/lgsm/data/debian-13.csv b/lgsm/data/debian-13.csv new file mode 100644 index 0000000000..6d16deb9f8 --- /dev/null +++ b/lgsm/data/debian-13.csv @@ -0,0 +1,137 @@ +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 +steamcmd,lib32gcc-s1,lib32stdc++6,libsdl2-2.0-0:i386,steamcmd +ac +ahl +ahl2 +ark +arma3 +armar,libcurl4 +ats +av +bb +bb2,libcurl4-gnutls-dev:i386 +bd +bf1942,libncurses5:i386,libtinfo5:i386 +bfv,libncurses5:i386,libstdc++5:i386 +bmdm,libncurses5:i386 +bo +bs +bt,libicu-dev,dos2unix,libxml2-utils +btl +cc +ck,xvfb,libxi6 +cmw +cod,libstdc++5:i386 +cod2,libstdc++5:i386 +cod4 +coduo,libstdc++5:i386 +codwaw +col +cs +cs2 +cscz +csgo +css,libtinfo5:i386 +ct +dab +dayz +dmc +dod +dodr +dods +doi +dst,libcurl4-gnutls-dev:i386 +dys +eco,libgdiplus +em +etl +ets2 +fctr +fof +gmod,libtinfo5:i386 +hcu +hl2dm +hldm +hldms +hw,lib32z1 +hz +ins +inss +ios +jc2 +jc3 +jk2 +kf +kf2 +l4d +l4d2 +mc,openjdk-22-jre +mcb +mh +mohaa,libstdc++5:i386 +mta,libncursesw5,libxml2-utils +nd +nec +nmrih,libtinfo5:i386 +ns +ns2,speex,libtbb12 +ns2c,speex:i386,libtbb12 +ohd +onset,libmariadb-dev +opfor +pc +pc2 +pmc,openjdk-22-jre +ps,libgconf-2-4 +pvkii +pvr,libc++1 +pw +pz,openjdk-22-jre,rng-tools5 +q2 +q3 +q4 +ql +qw +ricochet +ro +rtcw +rust,lib32z1 +rw,openjdk-22-jre +samp +sb +sbots +scpsl,mono-complete +scpslsm,mono-complete +sdtd,telnet,expect,libxml2-utils +sf +sfc,libtinfo5:i386 +sof2 +sol +squad +st,libxml2-utils +stn +sven,libssl3:i386,zlib1g:i386 +terraria +tf +tf2,libcurl4-gnutls-dev:i386 +tfc +ti +ts +ts3 +tu +tw +unt +ut +ut2k4 +ut3 +ut99 +vh,libc6-dev,libatomic1,libpulse-dev +vints,aspnetcore-runtime-7.0 +vpmc,openjdk-21-jre +vs +wet +wf +wmc,openjdk21-jre +wurm,xvfb +zmr,libtinfo5:i386 +zps,libtinfo5:i386 From 0e7314d26ae9914a8af003cac3a0dbdc85af98fa Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sat, 15 Jun 2024 22:34:12 +0100 Subject: [PATCH 05/20] fix missing serverpassword detail (#4596) --- lgsm/modules/command_dev_parse_game_details.sh | 10 ++++------ lgsm/modules/info_game.sh | 6 +++--- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/lgsm/modules/command_dev_parse_game_details.sh b/lgsm/modules/command_dev_parse_game_details.sh index 4dcf33c2a3..2bb01e436b 100644 --- a/lgsm/modules/command_dev_parse_game_details.sh +++ b/lgsm/modules/command_dev_parse_game_details.sh @@ -70,7 +70,6 @@ declare -A server_details=( ['Max Players']="${maxplayers}" ['Mod Server Port']="${modserverport}" ['OldQueryPortNumber']="${oldqueryportnumber}" - ['Password']="${password}" ['Port 401']="${port401}" ['Port IPv6']="${portipv6}" ['Port']="${port}" @@ -85,7 +84,6 @@ declare -A server_details=( ['Queue Port']="${queueport}" ['Random Map']="${randommap}" ['Raw Port']="${rawport}" - ['RC Password']="${rcpassword}" ['RCON Enabled']="${rconenabled}" ['RCON Password']="${rconpassword}" ['RCON Port']="${rconport}" @@ -133,7 +131,7 @@ missing_details="" # Loop through the server details and store them. for key in "${!server_details[@]}"; do - value=${server_details[$key]} + value=${server_details[$key]} if [ -n "$value" ]; then available_details+="${lightblue}${key}: ${default}${value}\n" else @@ -144,9 +142,9 @@ done # Sort and output the available distro details. if [ -n "$available_details" ]; then echo -e "" - echo -e "${bold}${lightgreen}Available Gameserver Details${default}" - fn_messages_separator - echo -e "${available_details}" | sort + echo -e "${bold}${lightgreen}Available Gameserver Details${default}" + fn_messages_separator + echo -e "${available_details}" | sort fi # Output the missing server details if there are any. diff --git a/lgsm/modules/info_game.sh b/lgsm/modules/info_game.sh index 007187ab85..f4caa5a7fa 100644 --- a/lgsm/modules/info_game.sh +++ b/lgsm/modules/info_game.sh @@ -1160,7 +1160,7 @@ fn_info_game_col() { maxplayers="${maxplayers:-"0"}" port="${port:-"0"}" queryport="${port:-"0"}" - rcpassword="${rconpassword:-"NOT SET"}" + rconpassword="${rconpassword:-"NOT SET"}" servername="${servername:-"NOT SET"}" serverpassword="${serverpassword:-"NOT SET"}" steamport="${steamport:-"0"}" @@ -1174,11 +1174,11 @@ fn_info_game_cs2() { if [ -f "${servercfgfullpath}" ]; then fn_info_game_valve_keyvalues "servername" "hostname" fn_info_game_valve_keyvalues "defaultmap" "map" - fn_info_game_valve_keyvalues "password" "sv_password" + fn_info_game_valve_keyvalues "serverpassword" "sv_password" fi defaultmap="${defaultmap:-"NOT SET"}" maxplayers="${maxplayers:-"0"}" - password="${password:-"NOT SET"}" + serverpassword="${serverpassword:-"NOT SET"}" port="${port:-"0"}" queryport="${port:-"0"}" servername="${servername:-"NOT SET"}" From 493a3a82fa8e5a9cf7796c0fb3a839ca2da49ca3 Mon Sep 17 00:00:00 2001 From: Thomas S Date: Sun, 16 Jun 2024 20:18:00 +0200 Subject: [PATCH 06/20] 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 --- .../config-lgsm/smserver/_default.cfg | 189 ++++++++++++++++++ .../config-lgsm/tfserver/_default.cfg | 2 +- .../config-lgsm/vhserver/_default.cfg | 5 +- lgsm/data/almalinux-8.csv | 1 + lgsm/data/almalinux-9.csv | 1 + lgsm/data/centos-7.csv | 1 + lgsm/data/centos-8.csv | 1 + lgsm/data/centos-9.csv | 1 + lgsm/data/debian-10.csv | 1 + lgsm/data/debian-11.csv | 1 + lgsm/data/debian-12.csv | 1 + lgsm/data/debian-9.csv | 1 + lgsm/data/rhel-7.csv | 1 + lgsm/data/rhel-8.csv | 1 + lgsm/data/rhel-9.csv | 1 + lgsm/data/rocky-8.csv | 1 + lgsm/data/rocky-9.csv | 1 + lgsm/data/serverlist.csv | 1 + lgsm/data/ubuntu-16.04.csv | 1 + lgsm/data/ubuntu-18.04.csv | 1 + lgsm/data/ubuntu-20.04.csv | 1 + lgsm/data/ubuntu-22.04.csv | 1 + lgsm/data/ubuntu-23.04.csv | 1 + lgsm/data/ubuntu-23.10.csv | 1 + lgsm/data/ubuntu-24.04.csv | 1 + lgsm/modules/check_system_requirements.sh | 4 +- .../modules/command_dev_parse_game_details.sh | 1 - lgsm/modules/command_dev_query_raw.sh | 2 +- lgsm/modules/command_stop.sh | 107 +++++++++- lgsm/modules/core_modules.sh | 5 + lgsm/modules/fix.sh | 2 +- lgsm/modules/fix_sm.sh | 10 + lgsm/modules/info_game.sh | 17 +- lgsm/modules/info_messages.sh | 32 ++- lgsm/modules/install_config.sh | 3 + 35 files changed, 381 insertions(+), 20 deletions(-) create mode 100644 lgsm/config-default/config-lgsm/smserver/_default.cfg create mode 100644 lgsm/modules/fix_sm.sh diff --git a/lgsm/config-default/config-lgsm/smserver/_default.cfg b/lgsm/config-default/config-lgsm/smserver/_default.cfg new file mode 100644 index 0000000000..306179b9ce --- /dev/null +++ b/lgsm/config-default/config-lgsm/smserver/_default.cfg @@ -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" diff --git a/lgsm/config-default/config-lgsm/tfserver/_default.cfg b/lgsm/config-default/config-lgsm/tfserver/_default.cfg index c6d9842b38..fbce96a44c 100644 --- a/lgsm/config-default/config-lgsm/tfserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/tfserver/_default.cfg @@ -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="" diff --git a/lgsm/config-default/config-lgsm/vhserver/_default.cfg b/lgsm/config-default/config-lgsm/vhserver/_default.cfg index 8950435e82..b027d0fca2 100644 --- a/lgsm/config-default/config-lgsm/vhserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/vhserver/_default.cfg @@ -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" diff --git a/lgsm/data/almalinux-8.csv b/lgsm/data/almalinux-8.csv index ab8d75b6a2..2042421448 100644 --- a/lgsm/data/almalinux-8.csv +++ b/lgsm/data/almalinux-8.csv @@ -105,6 +105,7 @@ scpslsm sdtd,telnet,expect,libxml2 sf sfc,ncurses-libs.i686 +sm,telnet,expect sof2 sol squad diff --git a/lgsm/data/almalinux-9.csv b/lgsm/data/almalinux-9.csv index e4fb83e3b4..02f21426ca 100644 --- a/lgsm/data/almalinux-9.csv +++ b/lgsm/data/almalinux-9.csv @@ -105,6 +105,7 @@ scpslsm sdtd,telnet,expect,libxml2 sf sfc,ncurses-libs.i686 +sm,telnet,expect sof2 sol squad diff --git a/lgsm/data/centos-7.csv b/lgsm/data/centos-7.csv index 0e04e3c743..a536c9c0f2 100644 --- a/lgsm/data/centos-7.csv +++ b/lgsm/data/centos-7.csv @@ -105,6 +105,7 @@ scpslsm sdtd,telnet,expect,libxml2 sf sfc,ncurses-libs.i686 +sm,telnet,expect sof2 sol squad diff --git a/lgsm/data/centos-8.csv b/lgsm/data/centos-8.csv index c07bf66d0d..d4d008fd46 100644 --- a/lgsm/data/centos-8.csv +++ b/lgsm/data/centos-8.csv @@ -105,6 +105,7 @@ scpslsm sdtd,telnet,expect,libxml2 sf sfc,ncurses-libs.i686 +sm,telnet,expect sof2 sol squad diff --git a/lgsm/data/centos-9.csv b/lgsm/data/centos-9.csv index c919a160be..574401733b 100644 --- a/lgsm/data/centos-9.csv +++ b/lgsm/data/centos-9.csv @@ -105,6 +105,7 @@ scpslsm sdtd,telnet,expect,libxml2 sf sfc,ncurses-libs.i686 +sm,telnet,expect sof2 sol squad diff --git a/lgsm/data/debian-10.csv b/lgsm/data/debian-10.csv index 1892d9f9fe..6b1a843bbe 100644 --- a/lgsm/data/debian-10.csv +++ b/lgsm/data/debian-10.csv @@ -104,6 +104,7 @@ scpslsm,mono-complete sdtd,telnet,expect,libxml2-utils sf sfc,libtinfo5:i386 +sm,telnet,expect sof2 sol squad diff --git a/lgsm/data/debian-11.csv b/lgsm/data/debian-11.csv index 9a37307c02..60a46f55db 100644 --- a/lgsm/data/debian-11.csv +++ b/lgsm/data/debian-11.csv @@ -105,6 +105,7 @@ scpslsm,mono-complete sdtd,telnet,expect,libxml2-utils sf sfc,libtinfo5:i386 +sm,telnet,expect sof2 sol squad diff --git a/lgsm/data/debian-12.csv b/lgsm/data/debian-12.csv index 8835871ee5..0fd50f2d7e 100644 --- a/lgsm/data/debian-12.csv +++ b/lgsm/data/debian-12.csv @@ -105,6 +105,7 @@ scpslsm,mono-complete sdtd,telnet,expect,libxml2-utils sf sfc,libtinfo5:i386 +sm,telnet,expect sof2 sol squad diff --git a/lgsm/data/debian-9.csv b/lgsm/data/debian-9.csv index c202924de2..174bd8e165 100644 --- a/lgsm/data/debian-9.csv +++ b/lgsm/data/debian-9.csv @@ -105,6 +105,7 @@ scpslsm,mono-complete sdtd,telnet,expect,libxml2-utils sf sfc,libtinfo5:i386 +sm,telnet,expect sof2 sol squad diff --git a/lgsm/data/rhel-7.csv b/lgsm/data/rhel-7.csv index 0546d8eb1d..8854649adf 100644 --- a/lgsm/data/rhel-7.csv +++ b/lgsm/data/rhel-7.csv @@ -105,6 +105,7 @@ scpslsm sdtd,telnet,expect,libxml2 sf sfc,ncurses-libs.i686 +sm,telnet,expect sof2 sol squad diff --git a/lgsm/data/rhel-8.csv b/lgsm/data/rhel-8.csv index bbfb982f0b..7dd334f381 100644 --- a/lgsm/data/rhel-8.csv +++ b/lgsm/data/rhel-8.csv @@ -105,6 +105,7 @@ scpslsm sdtd,telnet,expect,libxml2 sf sfc,ncurses-libs.i686 +sm,telnet,expect sof2 sol squad diff --git a/lgsm/data/rhel-9.csv b/lgsm/data/rhel-9.csv index e4fb83e3b4..02f21426ca 100644 --- a/lgsm/data/rhel-9.csv +++ b/lgsm/data/rhel-9.csv @@ -105,6 +105,7 @@ scpslsm sdtd,telnet,expect,libxml2 sf sfc,ncurses-libs.i686 +sm,telnet,expect sof2 sol squad diff --git a/lgsm/data/rocky-8.csv b/lgsm/data/rocky-8.csv index bbfb982f0b..7dd334f381 100644 --- a/lgsm/data/rocky-8.csv +++ b/lgsm/data/rocky-8.csv @@ -105,6 +105,7 @@ scpslsm sdtd,telnet,expect,libxml2 sf sfc,ncurses-libs.i686 +sm,telnet,expect sof2 sol squad diff --git a/lgsm/data/rocky-9.csv b/lgsm/data/rocky-9.csv index e4fb83e3b4..02f21426ca 100644 --- a/lgsm/data/rocky-9.csv +++ b/lgsm/data/rocky-9.csv @@ -105,6 +105,7 @@ scpslsm sdtd,telnet,expect,libxml2 sf sfc,ncurses-libs.i686 +sm,telnet,expect sof2 sol squad diff --git a/lgsm/data/serverlist.csv b/lgsm/data/serverlist.csv index 23e1266270..7d21733211 100644 --- a/lgsm/data/serverlist.csv +++ b/lgsm/data/serverlist.csv @@ -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 diff --git a/lgsm/data/ubuntu-16.04.csv b/lgsm/data/ubuntu-16.04.csv index cf6a202205..1f359ab9d0 100644 --- a/lgsm/data/ubuntu-16.04.csv +++ b/lgsm/data/ubuntu-16.04.csv @@ -105,6 +105,7 @@ scpslsm,mono-complete sdtd,telnet,expect,libxml2-utils sf sfc,libtinfo5:i386 +sm,telnet,expect sof2 sol squad diff --git a/lgsm/data/ubuntu-18.04.csv b/lgsm/data/ubuntu-18.04.csv index 6f7dcbe18d..cccd53dc71 100644 --- a/lgsm/data/ubuntu-18.04.csv +++ b/lgsm/data/ubuntu-18.04.csv @@ -105,6 +105,7 @@ scpslsm,mono-complete sdtd,telnet,expect,libxml2-utils sf sfc,libtinfo5:i386 +sm,telnet,expect sof2 sol squad diff --git a/lgsm/data/ubuntu-20.04.csv b/lgsm/data/ubuntu-20.04.csv index 98ba275f9c..4c0cae0a86 100644 --- a/lgsm/data/ubuntu-20.04.csv +++ b/lgsm/data/ubuntu-20.04.csv @@ -105,6 +105,7 @@ scpslsm,mono-complete sdtd,telnet,expect,libxml2-utils sf sfc,libtinfo5:i386 +sm,telnet,expect sof2 sol squad diff --git a/lgsm/data/ubuntu-22.04.csv b/lgsm/data/ubuntu-22.04.csv index 9bc8f7ad1c..b0f896fae8 100644 --- a/lgsm/data/ubuntu-22.04.csv +++ b/lgsm/data/ubuntu-22.04.csv @@ -105,6 +105,7 @@ scpslsm,mono-complete sdtd,telnet,expect,libxml2-utils sf sfc,libtinfo5:i386 +sm,telnet,expect sof2 sol squad diff --git a/lgsm/data/ubuntu-23.04.csv b/lgsm/data/ubuntu-23.04.csv index e6d0c2962d..7ad90039b1 100644 --- a/lgsm/data/ubuntu-23.04.csv +++ b/lgsm/data/ubuntu-23.04.csv @@ -105,6 +105,7 @@ scpslsm,mono-complete sdtd,telnet,expect,libxml2-utils sf sfc,libtinfo5:i386 +sm,telnet,expect sof2 sol squad diff --git a/lgsm/data/ubuntu-23.10.csv b/lgsm/data/ubuntu-23.10.csv index e6d0c2962d..7ad90039b1 100644 --- a/lgsm/data/ubuntu-23.10.csv +++ b/lgsm/data/ubuntu-23.10.csv @@ -105,6 +105,7 @@ scpslsm,mono-complete sdtd,telnet,expect,libxml2-utils sf sfc,libtinfo5:i386 +sm,telnet,expect sof2 sol squad diff --git a/lgsm/data/ubuntu-24.04.csv b/lgsm/data/ubuntu-24.04.csv index e6d0c2962d..7ad90039b1 100644 --- a/lgsm/data/ubuntu-24.04.csv +++ b/lgsm/data/ubuntu-24.04.csv @@ -105,6 +105,7 @@ scpslsm,mono-complete sdtd,telnet,expect,libxml2-utils sf sfc,libtinfo5:i386 +sm,telnet,expect sof2 sol squad diff --git a/lgsm/modules/check_system_requirements.sh b/lgsm/modules/check_system_requirements.sh index 0214cdc1a9..d25954427d 100644 --- a/lgsm/modules/check_system_requirements.sh +++ b/lgsm/modules/check_system_requirements.sh @@ -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 diff --git a/lgsm/modules/command_dev_parse_game_details.sh b/lgsm/modules/command_dev_parse_game_details.sh index 2bb01e436b..2e22aa7ae0 100644 --- a/lgsm/modules/command_dev_parse_game_details.sh +++ b/lgsm/modules/command_dev_parse_game_details.sh @@ -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}" diff --git a/lgsm/modules/command_dev_query_raw.sh b/lgsm/modules/command_dev_query_raw.sh index ae49a1b85f..39f4787d30 100644 --- a/lgsm/modules/command_dev_query_raw.sh +++ b/lgsm/modules/command_dev_query_raw.sh @@ -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 diff --git a/lgsm/modules/command_stop.sh b/lgsm/modules/command_stop.sh index 3d534317a4..7783cc94f7 100644 --- a/lgsm/modules/command_stop.sh +++ b/lgsm/modules/command_stop.sh @@ -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 } diff --git a/lgsm/modules/core_modules.sh b/lgsm/modules/core_modules.sh index f083a48936..6a5bcc6620 100644 --- a/lgsm/modules/core_modules.sh +++ b/lgsm/modules/core_modules.sh @@ -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 diff --git a/lgsm/modules/fix.sh b/lgsm/modules/fix.sh index dbb8e3545c..e6e00465d8 100644 --- a/lgsm/modules/fix.sh +++ b/lgsm/modules/fix.sh @@ -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 diff --git a/lgsm/modules/fix_sm.sh b/lgsm/modules/fix_sm.sh new file mode 100644 index 0000000000..1d72a48bfe --- /dev/null +++ b/lgsm/modules/fix_sm.sh @@ -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" diff --git a/lgsm/modules/info_game.sh b/lgsm/modules/info_game.sh index f4caa5a7fa..0f38ea2500 100644 --- a/lgsm/modules/info_game.sh +++ b/lgsm/modules/info_game.sh @@ -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 diff --git a/lgsm/modules/info_messages.sh b/lgsm/modules/info_messages.sh index a5f25bc742..9bab0cbb72 100644 --- a/lgsm/modules/info_messages.sh +++ b/lgsm/modules/info_messages.sh @@ -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 diff --git a/lgsm/modules/install_config.sh b/lgsm/modules/install_config.sh index eea590f9e2..22843c7b02 100644 --- a/lgsm/modules/install_config.sh +++ b/lgsm/modules/install_config.sh @@ -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 From d86bec9acf931932721c52cafbedd29d80ea351c Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sun, 11 Aug 2024 19:32:55 +0100 Subject: [PATCH 07/20] fix(mcb): timestamp disabled for MCB as breaks update check --- lgsm/modules/command_start.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lgsm/modules/command_start.sh b/lgsm/modules/command_start.sh index f38125a5e1..cca0445180 100644 --- a/lgsm/modules/command_start.sh +++ b/lgsm/modules/command_start.sh @@ -80,7 +80,8 @@ fn_start_tmux() { # Enable console logging. if [ "${consolelogging}" == "on" ] || [ -z "${consolelogging}" ]; then - if [ "${logtimestamp}" == "on" ]; then + # timestamp will break mcb update check. + if [ "${logtimestamp}" == "on" ] && [ "${shortname}" != "mcb" ]; then tmux -L "${socketname}" pipe-pane -o -t "${sessionname}" "exec bash -c \"cat | $addtimestamp\" >> '${consolelog}'" else tmux -L "${socketname}" pipe-pane -o -t "${sessionname}" "exec cat >> '${consolelog}'" From 182c6730725d2e6a6b3512ff82efe55515ce435c Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Mon, 12 Aug 2024 16:20:38 +0100 Subject: [PATCH 08/20] fix(samp): update samp url --- lgsm/modules/install_server_files.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lgsm/modules/install_server_files.sh b/lgsm/modules/install_server_files.sh index c5fe822add..7ebac259f7 100644 --- a/lgsm/modules/install_server_files.sh +++ b/lgsm/modules/install_server_files.sh @@ -191,7 +191,7 @@ fn_install_server_files() { force="noforce" md5="581a333cc7eacda2f56d5a00fe11eafa" elif [ "${shortname}" == "samp" ]; then - remote_fileurl="https://files.sa-mp.com/samp037svr_R2-1.tar.gz" + remote_fileurl="https://files.samp-sc.com/samp037svr_R2-1.tar.gz" local_filedir="${tmpdir}" local_filename="samp037svr_R2-1.tar.gz" chmodx="nochmodx" run="norun" From e060865aefc510aeb75539302891072bfc0d81c2 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Mon, 12 Aug 2024 22:56:20 +0100 Subject: [PATCH 09/20] feat(dev): add nocache if dev-debug is enabled (#4597) --- lgsm/modules/command_update_linuxgsm.sh | 43 ++++++++++++++----------- 1 file changed, 25 insertions(+), 18 deletions(-) diff --git a/lgsm/modules/command_update_linuxgsm.sh b/lgsm/modules/command_update_linuxgsm.sh index 43827a6723..4358b626c3 100644 --- a/lgsm/modules/command_update_linuxgsm.sh +++ b/lgsm/modules/command_update_linuxgsm.sh @@ -15,14 +15,21 @@ check.sh info_distro.sh info_game.sh +# Prevent github from using a cached version of the file if dev-debug is enabled. +if [ -f "${rootdir}/.dev-debug" ]; then + nocache="-H \"Cache-Control: no-cache\" -H \"Pragma: no-cache\"" +fi + fn_script_log_info "Updating LinuxGSM" fn_print_dots "Selecting repo" fn_script_log_info "Selecting repo" # Select remotereponame -curl --connect-timeout 3 -IsfL "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/linuxgsm.sh" 1> /dev/null + +curl ${nocache} --connect-timeout 3 -IsfL "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/linuxgsm.sh" 1> /dev/null + if [ $? != "0" ]; then - curl --connect-timeout 3 -IsfL "https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/linuxgsm.sh" 1> /dev/null + curl curl ${nocache} --connect-timeout 3 -IsfL "https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/linuxgsm.sh" 1> /dev/null if [ $? != "0" ]; then fn_print_fail_nl "Selecting repo: Unable to to access GitHub or Bitbucket repositories" fn_script_log_fail "Selecting repo: Unable to to access GitHub or Bitbucket repositories" @@ -39,9 +46,9 @@ fi # Check linuxsm.sh echo -en "checking ${remotereponame} linuxgsm.sh...\c" if [ "${remotereponame}" == "GitHub" ]; then - curl --connect-timeout 3 -IsfL "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/linuxgsm.sh" 1> /dev/null + curl ${nocache} --connect-timeout 3 -IsfL "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/linuxgsm.sh" 1> /dev/null else - curl --connect-timeout 3 -IsfL "https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/linuxgsm.sh" 1> /dev/null + curl ${nocache} --connect-timeout 3 -IsfL "https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/linuxgsm.sh" 1> /dev/null fi if [ $? != "0" ]; then fn_print_fail_eol_nl @@ -51,9 +58,9 @@ if [ $? != "0" ]; then fi if [ "${remotereponame}" == "GitHub" ]; then - tmp_script_diff=$(diff "${tmpdir}/linuxgsm.sh" <(curl --connect-timeout 3 -s "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/linuxgsm.sh")) + tmp_script_diff=$(diff "${tmpdir}/linuxgsm.sh" <(curl ${nocache} --connect-timeout 3 -s "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/linuxgsm.sh")) else - tmp_script_diff=$(diff "${tmpdir}/linuxgsm.sh" <(curl --connect-timeout 3 -s "https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/linuxgsm.sh")) + tmp_script_diff=$(diff "${tmpdir}/linuxgsm.sh" <(curl ${nocache} --connect-timeout 3 -s "https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/linuxgsm.sh")) fi if [ "${tmp_script_diff}" != "" ]; then @@ -119,9 +126,9 @@ fi echo -en "checking ${remotereponame} config _default.cfg...\c" fn_script_log_info "Checking ${remotereponame} config _default.cfg" if [ "${remotereponame}" == "GitHub" ]; then - curl --connect-timeout 3 -IsfL "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/lgsm/config-default/config-lgsm/${gameservername}/_default.cfg" 1> /dev/null + curl ${nocache} --connect-timeout 3 -IsfL "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/lgsm/config-default/config-lgsm/${gameservername}/_default.cfg" 1> /dev/null else - curl --connect-timeout 3 -IsfL "https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/lgsm/config-default/config-lgsm/${gameservername}/_default.cfg" 1> /dev/null + curl ${nocache} --connect-timeout 3 -IsfL "https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/lgsm/config-default/config-lgsm/${gameservername}/_default.cfg" 1> /dev/null fi if [ $? != "0" ]; then fn_print_fail_eol_nl @@ -131,9 +138,9 @@ if [ $? != "0" ]; then fi if [ "${remotereponame}" == "GitHub" ]; then - config_file_diff=$(diff "${configdirdefault}/config-lgsm/${gameservername}/_default.cfg" <(curl --connect-timeout 3 -s "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/lgsm/config-default/config-lgsm/${gameservername}/_default.cfg")) + config_file_diff=$(diff "${configdirdefault}/config-lgsm/${gameservername}/_default.cfg" <(curl ${nocache} --connect-timeout 3 -s "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/lgsm/config-default/config-lgsm/${gameservername}/_default.cfg")) else - config_file_diff=$(diff "${configdirdefault}/config-lgsm/${gameservername}/_default.cfg" <(curl --connect-timeout 3 -s "https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/lgsm/config-default/config-lgsm/${gameservername}/_default.cfg")) + config_file_diff=$(diff "${configdirdefault}/config-lgsm/${gameservername}/_default.cfg" <(curl ${nocache} --connect-timeout 3 -s "https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/lgsm/config-default/config-lgsm/${gameservername}/_default.cfg")) fi if [ "${config_file_diff}" != "" ]; then @@ -153,9 +160,9 @@ if [ -f "${datadir}/${distroid}-${distroversioncsv}.csv" ]; then echo -en "checking ${remotereponame} config ${distroid}-${distroversioncsv}.csv...\c" fn_script_log_info "Checking ${remotereponame} ${distroid}-${distroversioncsv}.csv" if [ "${remotereponame}" == "GitHub" ]; then - curl --connect-timeout 3 -IsfL "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/lgsm/data/${distroid}-${distroversioncsv}.csv" 1> /dev/null + curl ${nocache} --connect-timeout 3 -IsfL "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/lgsm/data/${distroid}-${distroversioncsv}.csv" 1> /dev/null else - curl --connect-timeout 3 -IsfL "https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/lgsm/data/${distroid}-${distroversioncsv}.csv" 1> /dev/null + curl ${nocache} --connect-timeout 3 -IsfL "https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/lgsm/data/${distroid}-${distroversioncsv}.csv" 1> /dev/null fi if [ $? != "0" ]; then fn_print_fail_eol_nl @@ -165,9 +172,9 @@ if [ -f "${datadir}/${distroid}-${distroversioncsv}.csv" ]; then fi if [ "${remotereponame}" == "GitHub" ]; then - config_file_diff=$(diff "${datadir}/${distroid}-${distroversioncsv}.csv" <(curl --connect-timeout 3 -s "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/lgsm/data/${distroid}-${distroversioncsv}.csv")) + config_file_diff=$(diff "${datadir}/${distroid}-${distroversioncsv}.csv" <(curl ${nocache} --connect-timeout 3 -s "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/lgsm/data/${distroid}-${distroversioncsv}.csv")) else - config_file_diff=$(diff "${datadir}/${distroid}-${distroversioncsv}.csv" <(curl --connect-timeout 3 -s "https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/lgsm/data/${distroid}-${distroversioncsv}.csv")) + config_file_diff=$(diff "${datadir}/${distroid}-${distroversioncsv}.csv" <(curl ${nocache} --connect-timeout 3 -s "https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/lgsm/data/${distroid}-${distroversioncsv}.csv")) fi if [ "${config_file_diff}" != "" ]; then @@ -191,9 +198,9 @@ if [ -n "${modulesdir}" ]; then echo -en "checking ${remotereponame} module ${modulefile}...\c" github_file_url_dir="lgsm/modules" if [ "${remotereponame}" == "GitHub" ]; then - curl --connect-timeout 3 -IsfL "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${modulefile}" 1> /dev/null + curl ${nocache} --connect-timeout 3 -IsfL "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${modulefile}" 1> /dev/null else - curl --connect-timeout 3 -IsfL "https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/${github_file_url_dir}/${modulefile}" 1> /dev/null + curl ${nocache} --connect-timeout 3 -IsfL "https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/${github_file_url_dir}/${modulefile}" 1> /dev/null fi if [ $? != 0 ]; then fn_print_error_eol_nl @@ -210,9 +217,9 @@ if [ -n "${modulesdir}" ]; then else # compare file if [ "${remotereponame}" == "GitHub" ]; then - module_file_diff=$(diff "${modulesdir}/${modulefile}" <(curl --connect-timeout 3 -s "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${modulefile}")) + module_file_diff=$(diff "${modulesdir}/${modulefile}" <(curl ${nocache} --connect-timeout 3 -s "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/${github_file_url_dir}/${modulefile}")) else - module_file_diff=$(diff "${modulesdir}/${modulefile}" <(curl --connect-timeout 3 -s "https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/${github_file_url_dir}/${modulefile}")) + module_file_diff=$(diff "${modulesdir}/${modulefile}" <(curl ${nocache} --connect-timeout 3 -s "https://bitbucket.org/${githubuser}/${githubrepo}/raw/${githubbranch}/${github_file_url_dir}/${modulefile}")) fi # results From 7ece812c8c7a97f1248148ab59526ab9f377830e Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Mon, 12 Aug 2024 23:04:48 +0100 Subject: [PATCH 10/20] refactor: refactor check_permissions.sh (#4626) Refactored the code in check_permissions.sh to improve readability and maintainability. Made changes to variable names for clarity and removed unnecessary comments. Also, refactored the fn_sys_perm_errors_detect function name for consistency. --- lgsm/modules/check_permissions.sh | 29 +++++++++++++++++++---------- 1 file changed, 19 insertions(+), 10 deletions(-) diff --git a/lgsm/modules/check_permissions.sh b/lgsm/modules/check_permissions.sh index 31c64cd17f..3ee404ba95 100644 --- a/lgsm/modules/check_permissions.sh +++ b/lgsm/modules/check_permissions.sh @@ -13,6 +13,11 @@ fn_check_ownership() { selfownissue=1 fi fi + if [ -d "${lgsmdir}" ]; then + if [ "$(find "${lgsmdir}" -not -user "$(whoami)" | wc -l)" -ne "0" ]; then + lgsmownissue=1 + fi + fi if [ -d "${modulesdir}" ]; then if [ "$(find "${modulesdir}" -not -name '*.swp' -not -user "$(whoami)" | wc -l)" -ne "0" ]; then funcownissue=1 @@ -23,18 +28,18 @@ fn_check_ownership() { filesownissue=1 fi fi - if [ "${selfownissue}" == "1" ] || [ "${funcownissue}" == "1" ] || [ "${filesownissue}" == "1" ]; then + if [ "${selfownissue}" == "1" ] || [ "${lgsmownissue}" == "1" ] || [ "${filesownissue}" == "1" ]; then fn_print_fail_nl "Ownership issues found" fn_script_log_fail "Ownership issues found" fn_print_information_nl "The current user ($(whoami)) does not have ownership of the following files:" fn_script_log_info "The current user ($(whoami)) does not have ownership of the following files:" { - echo -e "User\tGroup\tFile\n" + echo -en "User\tGroup\tFile:" if [ "${selfownissue}" == "1" ]; then find "${rootdir}/${selfname}" -not -user "$(whoami)" -printf "%u\t%g\t%p\n" fi - if [ "${funcownissue}" == "1" ]; then - find "${modulesdir}" -not -user "$(whoami)" -printf "%u\t%g\t%p\n" + if [ "${lgsmownissue}" == "1" ]; then + find "${lgsmdir}" -not -user "$(whoami)" -printf "%u\t%g\t%p\n" fi if [ "${filesownissue}" == "1" ]; then find "${serverfiles}" -not -user "$(whoami)" -printf "%u\t%g\t%p\n" @@ -53,15 +58,18 @@ fn_check_ownership() { } fn_check_permissions() { + # Check modules files are executable. if [ -d "${modulesdir}" ]; then - if [ "$(find "${modulesdir}" -type f -not -executable | wc -l)" -ne "0" ]; then + findnotexecutable="$(find "${modulesdir}" -type f -not -executable)" + findnotexecutablewc="$(echo "${findnotexecutable}" | wc -l)" + if [ "${findnotexecutablewc}" -ne "0" ]; then fn_print_fail_nl "Permissions issues found" fn_script_log_fail "Permissions issues found" fn_print_information_nl "The following files are not executable:" fn_script_log_info "The following files are not executable:" { - echo -e "File\n" - find "${modulesdir}" -type f -not -executable -printf "%p\n" + echo -en "File:" + echo -en "${findnotexecutable}" } | column -s $'\t' -t | tee -a "${lgsmlog}" if [ "${monitorflag}" == 1 ]; then alert="permissions" @@ -72,8 +80,8 @@ fn_check_permissions() { fi # Check rootdir permissions. - if [ "${rootdir}" ]; then - # Get permission numbers on directory under the form 775. + if [ -d "${rootdir}" ]; then + # Get permission numbers on directory should return 775. rootdirperm=$(stat -c %a "${rootdir}") # Grab the first and second digit for user and group permission. userrootdirperm="${rootdirperm:0:1}" @@ -92,6 +100,7 @@ fn_check_permissions() { core_exit.sh fi fi + # Check if executable is executable and attempt to fix it. # First get executable name. execname=$(basename "${executable}") @@ -141,7 +150,7 @@ fn_check_permissions() { fi } -## The following fn_sys_perm_* modules checks for permission errors in /sys directory. +## The following fn_sys_perm_* function checks for permission errors in /sys directory. # Checks for permission errors in /sys directory. fn_sys_perm_errors_detect() { From c8f36ff2afbc357335c309c61ddc473ecb6a6fdd Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Mon, 12 Aug 2024 23:06:35 +0100 Subject: [PATCH 11/20] add missing sm-icon.png --- lgsm/data/gameicons/sm-icon.png | Bin 0 -> 764 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 lgsm/data/gameicons/sm-icon.png diff --git a/lgsm/data/gameicons/sm-icon.png b/lgsm/data/gameicons/sm-icon.png new file mode 100644 index 0000000000000000000000000000000000000000..7948e002d650275f90ef0ef1ea5db87b14bbdb2c GIT binary patch literal 764 zcmex=^lOiET&UP@Y7ModgWM?qOlT~kX_QeM|USHnP6LsJ7}2qQZ?I~NC+Fc+7w zhLo6;2Fc+60R}-11_cHMW=16jCP7AKLB{__7$g`Nm>C%vkO0uF>>NNDEdd55CMHH^ zW)?awse6$&vxPS{hr>B*US)IlIh@af9Iy-Gm`F1KPWF}x^LOO z#b;|>xhy@VoQ;gMeiZj`!usaT3*WArm{eR8aQsOE Date: Tue, 13 Aug 2024 23:02:26 +0100 Subject: [PATCH 12/20] fix permissions bug --- lgsm/modules/check_permissions.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lgsm/modules/check_permissions.sh b/lgsm/modules/check_permissions.sh index 3ee404ba95..d2cd5890c5 100644 --- a/lgsm/modules/check_permissions.sh +++ b/lgsm/modules/check_permissions.sh @@ -61,7 +61,7 @@ fn_check_permissions() { # Check modules files are executable. if [ -d "${modulesdir}" ]; then findnotexecutable="$(find "${modulesdir}" -type f -not -executable)" - findnotexecutablewc="$(echo "${findnotexecutable}" | wc -l)" + findnotexecutablewc="$(find "${modulesdir}" -type f -not -executable | wc -l)" if [ "${findnotexecutablewc}" -ne "0" ]; then fn_print_fail_nl "Permissions issues found" fn_script_log_fail "Permissions issues found" From eef84ba903da3a21b2a029636e3b758b8cd787ec Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Tue, 13 Aug 2024 23:17:34 +0100 Subject: [PATCH 13/20] feat: add ismygameserver.online to discord alerts --- lgsm/modules/alert_discord.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lgsm/modules/alert_discord.sh b/lgsm/modules/alert_discord.sh index 2b2ecf21b3..c98bef765b 100644 --- a/lgsm/modules/alert_discord.sh +++ b/lgsm/modules/alert_discord.sh @@ -51,6 +51,11 @@ jsoninfo=$( "name": "Hostname", "value": "${HOSTNAME}", "inline": true + }, + { + "name": "Is my Game Server Online?", + "value": "https://ismygameserver.online/${querytype}/${alertip}:${queryport}", + "inline": true }, { "name": "More info", From ce27b7301b6701db1b082c120eaab0f93f033d32 Mon Sep 17 00:00:00 2001 From: Stephan Schaffner Date: Wed, 28 Aug 2024 22:32:38 +0200 Subject: [PATCH 14/20] feat(newserver): add Xonotic (#4633) * Adding default_cfg and Distro Requirements * Adding Shellscripts for Xonotic * Fixing serverlist.csv * Fixing again serverlist.csv * Fixed Typo * Changing Shortname to XNT * Fixing missed _default.cfg change * Fixing _default.cfg * Updating Modules and Server installation * Updating paths and install script * Fixing install Scripts Issues * Update info_game.sh * Updating Game Info Curling * fix bug with npm download of gamedig on branches * styling fix * move to fix * typo * bug * add missing details * edit using config * add missing servercfgfullpath * bug * config settings update * update cp command based off warn message * fix dir * update dirs * fix exit code * fix dir install * remove -v * update settings * update info game * update config type * fix dir * update config parsing * change to remove config * add server.cfg * remove serverconfigdefault * add new default * move to use an updater * send key to update function * typo * change extract location * update directory location * filename fix * update dirs * fix extraction * creatre datadir if missing * consoleinteract yes * lint --------- Co-authored-by: Stephan Schaffner Co-authored-by: Daniel Gibbs --- .../config-lgsm/xntserver/_default.cfg | 171 +++++++++++++++++ lgsm/data/almalinux-8.csv | 1 + lgsm/data/almalinux-9.csv | 1 + lgsm/data/centos-7.csv | 1 + lgsm/data/centos-8.csv | 1 + lgsm/data/centos-9.csv | 1 + lgsm/data/debian-10.csv | 1 + lgsm/data/debian-11.csv | 1 + lgsm/data/debian-12.csv | 1 + lgsm/data/debian-13.csv | 1 + lgsm/data/debian-9.csv | 1 + lgsm/data/rhel-7.csv | 1 + lgsm/data/rhel-8.csv | 1 + lgsm/data/rhel-9.csv | 1 + lgsm/data/rocky-8.csv | 1 + lgsm/data/rocky-9.csv | 1 + lgsm/data/serverlist.csv | 1 + lgsm/data/ubuntu-16.04.csv | 1 + lgsm/data/ubuntu-18.04.csv | 1 + lgsm/data/ubuntu-20.04.csv | 1 + lgsm/data/ubuntu-22.04.csv | 1 + lgsm/data/ubuntu-23.04.csv | 1 + lgsm/data/ubuntu-23.10.csv | 1 + lgsm/data/ubuntu-24.04.csv | 1 + lgsm/modules/check_gamedig.sh | 4 +- lgsm/modules/command_update.sh | 2 + lgsm/modules/core_dl.sh | 5 +- lgsm/modules/core_modules.sh | 15 ++ lgsm/modules/fix.sh | 2 +- lgsm/modules/fix_xnt.sh | 13 ++ lgsm/modules/info_game.sh | 19 ++ lgsm/modules/info_messages.sh | 14 +- lgsm/modules/install_config.sh | 30 ++- lgsm/modules/install_server_files.sh | 86 ++++++--- lgsm/modules/update_xnt.sh | 173 ++++++++++++++++++ 35 files changed, 515 insertions(+), 42 deletions(-) create mode 100644 lgsm/config-default/config-lgsm/xntserver/_default.cfg create mode 100644 lgsm/modules/fix_xnt.sh create mode 100644 lgsm/modules/update_xnt.sh diff --git a/lgsm/config-default/config-lgsm/xntserver/_default.cfg b/lgsm/config-default/config-lgsm/xntserver/_default.cfg new file mode 100644 index 0000000000..402e6188f4 --- /dev/null +++ b/lgsm/config-default/config-lgsm/xntserver/_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 #### + +## Predefined Parameters | https://docs.linuxgsm.com/configuration/start-parameters + +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="-userdir ${systemdir}/${selfname}" + +#### 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="" + +## 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="3" +querytype="xonotic" + +## Console type +consoleverbose="yes" +consoleinteract="yes" + +## Game Server Details +# Do not edit +gamename="Xonotic" +engine="unreal3" +glibc="2.29" + +#### Directories #### +# Edit with care + +## Game Server Directories +systemdir="${serverfiles}" +executabledir="${systemdir}" +executable="./xonotic-linux64-dedicated" +servercfgdir="${systemdir}/${selfname}/data" +servercfg="server.cfg" +servercfgdefault="${systemdir}/server.cfg" +servercfgfullpath="${servercfgdir}/${servercfg}" + +## Backup Directory +backupdir="${lgsmdir}/backup" + +## Logging Directories +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" +gamelogdir="${logdir}/server" +lgsmlogdir="${logdir}/script" +consolelogdir="${logdir}/console" +gamelog="${gamelogdir}/${selfname}-game.log" +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" +gamelogdate="${gamelogdir}/${selfname}-game-$(date '+%Y-%m-%d-%H:%M:%S').log" + +## Log Parameters +logtimestamp="off" +logtimestampformat="%Y-%m-%d %H:%M:%S" diff --git a/lgsm/data/almalinux-8.csv b/lgsm/data/almalinux-8.csv index 2042421448..d4d2456bd0 100644 --- a/lgsm/data/almalinux-8.csv +++ b/lgsm/data/almalinux-8.csv @@ -134,5 +134,6 @@ wet wf wmc,java-21-openjdk wurm,xorg-x11-server-Xvfb +xnt zmr,ncurses-libs.i686 zps,ncurses-libs.i686 diff --git a/lgsm/data/almalinux-9.csv b/lgsm/data/almalinux-9.csv index 02f21426ca..7dae6338e5 100644 --- a/lgsm/data/almalinux-9.csv +++ b/lgsm/data/almalinux-9.csv @@ -134,5 +134,6 @@ wet wf wmc,java-21-openjdk wurm,xorg-x11-server-Xvfb +xnt zmr,ncurses-libs.i686 zps,ncurses-libs.i686 diff --git a/lgsm/data/centos-7.csv b/lgsm/data/centos-7.csv index a536c9c0f2..266b358bad 100644 --- a/lgsm/data/centos-7.csv +++ b/lgsm/data/centos-7.csv @@ -134,5 +134,6 @@ wet wf wmc,java-11-openjdk wurm,xorg-x11-server-Xvfb +xnt zmr,ncurses-libs.i686 zps,ncurses-libs.i686 diff --git a/lgsm/data/centos-8.csv b/lgsm/data/centos-8.csv index d4d008fd46..bd5b72c33c 100644 --- a/lgsm/data/centos-8.csv +++ b/lgsm/data/centos-8.csv @@ -134,5 +134,6 @@ wet wf wmc,java-17-openjdk wurm,xorg-x11-server-Xvfb +xnt zmr,ncurses-libs.i686 zps,ncurses-libs.i686 diff --git a/lgsm/data/centos-9.csv b/lgsm/data/centos-9.csv index 574401733b..893f3698c0 100644 --- a/lgsm/data/centos-9.csv +++ b/lgsm/data/centos-9.csv @@ -134,5 +134,6 @@ wet wf wmc,java-17-openjdk wurm,xorg-x11-server-Xvfb +xnt zmr,ncurses-libs.i686 zps,ncurses-libs.i686 diff --git a/lgsm/data/debian-10.csv b/lgsm/data/debian-10.csv index 6b1a843bbe..6bfa1dae48 100644 --- a/lgsm/data/debian-10.csv +++ b/lgsm/data/debian-10.csv @@ -134,5 +134,6 @@ wet wf wmc,openjdk-11-jre wurm,xvfb +xnt zmr,libtinfo5:i386 zps,libtinfo5:i386 diff --git a/lgsm/data/debian-11.csv b/lgsm/data/debian-11.csv index 60a46f55db..5441a69b4b 100644 --- a/lgsm/data/debian-11.csv +++ b/lgsm/data/debian-11.csv @@ -134,5 +134,6 @@ wet wf wmc,openjdk-17-jre wurm,xvfb +xnt zmr,libtinfo5:i386 zps,libtinfo5:i386 diff --git a/lgsm/data/debian-12.csv b/lgsm/data/debian-12.csv index 0fd50f2d7e..1c0a39930d 100644 --- a/lgsm/data/debian-12.csv +++ b/lgsm/data/debian-12.csv @@ -134,5 +134,6 @@ wet wf wmc,openjdk-17-jre wurm,xvfb +xnt zmr,libtinfo5:i386 zps,libtinfo5:i386 diff --git a/lgsm/data/debian-13.csv b/lgsm/data/debian-13.csv index 6d16deb9f8..af262abb69 100644 --- a/lgsm/data/debian-13.csv +++ b/lgsm/data/debian-13.csv @@ -133,5 +133,6 @@ wet wf wmc,openjdk21-jre wurm,xvfb +xnt zmr,libtinfo5:i386 zps,libtinfo5:i386 diff --git a/lgsm/data/debian-9.csv b/lgsm/data/debian-9.csv index 174bd8e165..4e54ac2414 100644 --- a/lgsm/data/debian-9.csv +++ b/lgsm/data/debian-9.csv @@ -134,5 +134,6 @@ wet wf wmc,openjdk-8-jre wurm,xvfb +xnt zmr,libtinfo5:i386 zps,libtinfo5:i386 diff --git a/lgsm/data/rhel-7.csv b/lgsm/data/rhel-7.csv index 8854649adf..7800136bb9 100644 --- a/lgsm/data/rhel-7.csv +++ b/lgsm/data/rhel-7.csv @@ -134,5 +134,6 @@ wet wf wmc,java-11-openjdk wurm,xorg-x11-server-Xvfb +xnt zmr,ncurses-libs.i686 zps,ncurses-libs.i686 diff --git a/lgsm/data/rhel-8.csv b/lgsm/data/rhel-8.csv index 7dd334f381..f8bb1d4921 100644 --- a/lgsm/data/rhel-8.csv +++ b/lgsm/data/rhel-8.csv @@ -134,5 +134,6 @@ wet wf wmc,java-21-openjdk wurm,xorg-x11-server-Xvfb +xnt zmr,ncurses-libs.i686 zps,ncurses-libs.i686 diff --git a/lgsm/data/rhel-9.csv b/lgsm/data/rhel-9.csv index 02f21426ca..7dae6338e5 100644 --- a/lgsm/data/rhel-9.csv +++ b/lgsm/data/rhel-9.csv @@ -134,5 +134,6 @@ wet wf wmc,java-21-openjdk wurm,xorg-x11-server-Xvfb +xnt zmr,ncurses-libs.i686 zps,ncurses-libs.i686 diff --git a/lgsm/data/rocky-8.csv b/lgsm/data/rocky-8.csv index 7dd334f381..f8bb1d4921 100644 --- a/lgsm/data/rocky-8.csv +++ b/lgsm/data/rocky-8.csv @@ -134,5 +134,6 @@ wet wf wmc,java-21-openjdk wurm,xorg-x11-server-Xvfb +xnt zmr,ncurses-libs.i686 zps,ncurses-libs.i686 diff --git a/lgsm/data/rocky-9.csv b/lgsm/data/rocky-9.csv index 02f21426ca..7dae6338e5 100644 --- a/lgsm/data/rocky-9.csv +++ b/lgsm/data/rocky-9.csv @@ -134,5 +134,6 @@ wet wf wmc,java-21-openjdk wurm,xorg-x11-server-Xvfb +xnt zmr,ncurses-libs.i686 zps,ncurses-libs.i686 diff --git a/lgsm/data/serverlist.csv b/lgsm/data/serverlist.csv index 7d21733211..8b408f84f4 100644 --- a/lgsm/data/serverlist.csv +++ b/lgsm/data/serverlist.csv @@ -133,5 +133,6 @@ wet,wetserver,Wolfenstein: Enemy Territory,ubuntu-22.04 wf,wfserver,Warfork,ubuntu-22.04 wmc,wmcserver,WaterfallMC,ubuntu-22.04 wurm,wurmserver,Wurm Unlimited,ubuntu-22.04 +xnt,xntserver,Xonotic,ubuntu-22.04 zmr,zmrserver,Zombie Master: Reborn,ubuntu-22.04 zps,zpsserver,Zombie Panic! Source,ubuntu-22.04 diff --git a/lgsm/data/ubuntu-16.04.csv b/lgsm/data/ubuntu-16.04.csv index 1f359ab9d0..51f769c1af 100644 --- a/lgsm/data/ubuntu-16.04.csv +++ b/lgsm/data/ubuntu-16.04.csv @@ -134,5 +134,6 @@ wet wf wmc,openjdk-8-jre wurm,xvfb +xnt zmr,libtinfo5:i386 zps,libtinfo5:i386 diff --git a/lgsm/data/ubuntu-18.04.csv b/lgsm/data/ubuntu-18.04.csv index cccd53dc71..7ca2d86c6a 100644 --- a/lgsm/data/ubuntu-18.04.csv +++ b/lgsm/data/ubuntu-18.04.csv @@ -134,5 +134,6 @@ wet wf wmc,openjdk-11-jre wurm,xvfb +xnt zmr,libtinfo5:i386 zps,libtinfo5:i386 diff --git a/lgsm/data/ubuntu-20.04.csv b/lgsm/data/ubuntu-20.04.csv index 4c0cae0a86..f16d8b3bec 100644 --- a/lgsm/data/ubuntu-20.04.csv +++ b/lgsm/data/ubuntu-20.04.csv @@ -134,5 +134,6 @@ wet wf wmc,openjdk-21-jre wurm,xvfb +xnt zmr,libtinfo5:i386 zps,libtinfo5:i386 diff --git a/lgsm/data/ubuntu-22.04.csv b/lgsm/data/ubuntu-22.04.csv index b0f896fae8..e84f4ddddc 100644 --- a/lgsm/data/ubuntu-22.04.csv +++ b/lgsm/data/ubuntu-22.04.csv @@ -134,5 +134,6 @@ wet wf wmc,openjdk-21-jre wurm,xvfb +xnt zmr,libtinfo5:i386 zps,libtinfo5:i386 diff --git a/lgsm/data/ubuntu-23.04.csv b/lgsm/data/ubuntu-23.04.csv index 7ad90039b1..c0135abd73 100644 --- a/lgsm/data/ubuntu-23.04.csv +++ b/lgsm/data/ubuntu-23.04.csv @@ -134,5 +134,6 @@ wet wf wmc,openjdk-21-jre wurm,xvfb +xnt zmr,libtinfo5:i386 zps,libtinfo5:i386 diff --git a/lgsm/data/ubuntu-23.10.csv b/lgsm/data/ubuntu-23.10.csv index 7ad90039b1..c0135abd73 100644 --- a/lgsm/data/ubuntu-23.10.csv +++ b/lgsm/data/ubuntu-23.10.csv @@ -134,5 +134,6 @@ wet wf wmc,openjdk-21-jre wurm,xvfb +xnt zmr,libtinfo5:i386 zps,libtinfo5:i386 diff --git a/lgsm/data/ubuntu-24.04.csv b/lgsm/data/ubuntu-24.04.csv index 7ad90039b1..c0135abd73 100644 --- a/lgsm/data/ubuntu-24.04.csv +++ b/lgsm/data/ubuntu-24.04.csv @@ -134,5 +134,6 @@ wet wf wmc,openjdk-21-jre wurm,xvfb +xnt zmr,libtinfo5:i386 zps,libtinfo5:i386 diff --git a/lgsm/modules/check_gamedig.sh b/lgsm/modules/check_gamedig.sh index 8abc0b759d..61149d5671 100644 --- a/lgsm/modules/check_gamedig.sh +++ b/lgsm/modules/check_gamedig.sh @@ -10,10 +10,10 @@ if [ "$(command -v node)" ] && [ "$(node -v | cut -d 'v' -f 2 | cut -d '.' -f 1) echo -e "${bold}${lightyellow}Installing Gamedig${default}" fn_script_log_info "Installing Gamedig" cd "${lgsmdir}" || exit - curl -L -o package.json "https://raw.githubusercontent.com/GameServerManagers/LinuxGSM/${githubbranch}/package.json" + curl -L -o package.json "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/package.json" npm install elif [ "$(command -v node)" ] && [ "$(node -v | cut -d 'v' -f 2 | cut -d '.' -f 1)" -ge 16 ]; then cd "${lgsmdir}" || exit - curl -s -L -o package.json "https://raw.githubusercontent.com/GameServerManagers/LinuxGSM/${githubbranch}/package.json" + curl -s -L -o package.json "https://raw.githubusercontent.com/${githubuser}/${githubrepo}/${githubbranch}/package.json" npm update > /dev/null 2>&1 fi diff --git a/lgsm/modules/command_update.sh b/lgsm/modules/command_update.sh index e1fcec97fe..a579cfe8e3 100644 --- a/lgsm/modules/command_update.sh +++ b/lgsm/modules/command_update.sh @@ -33,6 +33,8 @@ elif [ "${shortname}" == "vints" ]; then update_vints.sh elif [ "${shortname}" == "ut99" ]; then update_ut99.sh +elif [ "${shortname}" == "xnt" ]; then + update_xnt.sh else update_steamcmd.sh fi diff --git a/lgsm/modules/core_dl.sh b/lgsm/modules/core_dl.sh index 89a63eb8b1..908c90f386 100644 --- a/lgsm/modules/core_dl.sh +++ b/lgsm/modules/core_dl.sh @@ -251,7 +251,10 @@ fn_dl_extract() { fi elif [ "${mime}" == "application/zip" ]; then if [ -n "${extractsrc}" ]; then - extractcmd=$(unzip -qoj -d "${extractdest}" "${local_filedir}/${local_filename}" "${extractsrc}"/*) + temp_extractdir="${tmpdir}/Xonotic" + extractcmd=$(unzip -qo "${local_filedir}/${local_filename}" "${extractsrc}/*" -d "${temp_extractdir}") + find "${temp_extractdir}/${extractsrc}" -mindepth 1 -maxdepth 1 -exec mv -t "${extractdest}" {} + + rm -rf "${temp_extractdir}" else extractcmd=$(unzip -qo -d "${extractdest}" "${local_filedir}/${local_filename}") fi diff --git a/lgsm/modules/core_modules.sh b/lgsm/modules/core_modules.sh index 3cf0cd8e66..dad8dddf52 100644 --- a/lgsm/modules/core_modules.sh +++ b/lgsm/modules/core_modules.sh @@ -531,6 +531,11 @@ fix_wurm.sh() { fn_fetch_module } +fix_xnt.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + fix_zmr.sh() { modulefile="${FUNCNAME[0]}" fn_fetch_module @@ -695,6 +700,11 @@ update_ut99.sh() { fn_fetch_module } +update_xnt.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + fn_update_modules.sh() { modulefile="${FUNCNAME[0]}" fn_fetch_module @@ -821,6 +831,11 @@ if [ ! -d "${lockdir}" ]; then mkdir -p "${lockdir}" fi +# Creates data dir if missing +if [ ! -d "${datadir}" ]; then + mkdir -p "${datadir}" +fi + # if $USER id missing set to whoami if [ -z "${USER}" ]; then USER="$(whoami)" diff --git a/lgsm/modules/fix.sh b/lgsm/modules/fix.sh index e6e00465d8..6335659f16 100644 --- a/lgsm/modules/fix.sh +++ b/lgsm/modules/fix.sh @@ -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 sm 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 xnt zmr) apply_post_install_fix=(av kf kf2 ro ut2k4 ut ut3) # validate registered fixes for safe development diff --git a/lgsm/modules/fix_xnt.sh b/lgsm/modules/fix_xnt.sh new file mode 100644 index 0000000000..218b99a660 --- /dev/null +++ b/lgsm/modules/fix_xnt.sh @@ -0,0 +1,13 @@ +#!/bin/bash +# LinuxGSM fix_xnt.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Install Xonotic Default Config + +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +# Create the directory if it doesn't exist +if [ ! -d "${systemdir}/${selfname}/data" ]; then + mkdir -p "${systemdir}/${selfname}/data" +fi diff --git a/lgsm/modules/info_game.sh b/lgsm/modules/info_game.sh index 0f38ea2500..d56d4fbff9 100644 --- a/lgsm/modules/info_game.sh +++ b/lgsm/modules/info_game.sh @@ -2242,6 +2242,23 @@ fn_info_game_wf() { servername="${servername:-"NOT SET"}" } +# Config Type: QuakeC +# Comment: // +# Filetype: cfg +fn_info_game_xnt() { + if [ -f "${servercfgfullpath}" ]; then + fn_info_game_keyvalue_pairs_space "maxplayers" "maxplayers" + fn_info_game_keyvalue_pairs_space "port" "port" + fn_info_game_keyvalue_pairs_space "rconpassword" "rcon_password" + fn_info_game_keyvalue_pairs_space "servername" "hostname" + fi + maxplayers="${maxplayers:-"8"}" + port="${port:-"0"}" + queryport="${port}" + rconpassword="${rconpassword:-"NOT SET"}" + servername="${servername:-"NOT SET"}" +} + fn_info_game_wmc() { if [ ! -f "${servercfgfullpath}" ]; then servername="${unavailable}" @@ -2476,6 +2493,8 @@ elif [ "${engine}" == "source" ] || [ "${engine}" == "goldsrc" ]; then fn_info_game_source elif [ "${engine}" == "unreal2" ]; then fn_info_game_unreal2 +elif [ "${shortname}" == "xnt" ]; then + fn_info_game_xnt fi # Public IP address diff --git a/lgsm/modules/info_messages.sh b/lgsm/modules/info_messages.sh index 9bab0cbb72..0bc444e5e3 100644 --- a/lgsm/modules/info_messages.sh +++ b/lgsm/modules/info_messages.sh @@ -668,7 +668,7 @@ fn_info_messages_ports_edit() { startparameterslocation="${red}UNKNOWN${default}" # engines/games that require editing in the config file. - local ports_edit_array=("ac" "arma3" "armar" "bo" "bt" "ct" "dst" "eco" "idtech2" "idtech3" "idtech3_ql" "jc2" "jc3" "lwjgl2" "mcb" "nec" "pc" "pc2" "prism3d" "pz" "qw" "refractor" "renderware" "rw" "sb" "sdtd" "st" "stn" "ts3" "tw" "terraria" "unreal" "unreal2" "unreal3" "vints" "wurm") + local ports_edit_array=("ac" "arma3" "armar" "bo" "bt" "ct" "dst" "eco" "idtech2" "idtech3" "idtech3_ql" "jc2" "jc3" "lwjgl2" "mcb" "nec" "pc" "pc2" "prism3d" "pz" "qw" "refractor" "renderware" "rw" "sb" "sdtd" "st" "stn" "ts3" "tw" "terraria" "unreal" "unreal2" "unreal3" "vints" "xnt" "wurm") for port_edit in "${ports_edit_array[@]}"; do if [ "${shortname}" == "ut3" ]; then startparameterslocation="${servercfgdir}/UTWeb.ini" @@ -1548,6 +1548,14 @@ fn_info_messages_st() { } | column -s $'\t' -t } +fn_info_messages_stn() { + { + fn_port "header" + fn_port "Game" port udp + fn_port "Query" queryport udp + } | column -s $'\t' -t +} + fn_info_messages_ti() { { fn_port "header" @@ -1728,7 +1736,7 @@ fn_info_messages_wurm() { } | column -s $'\t' -t } -fn_info_messages_stn() { +fn_info_messages_xnt() { { fn_port "header" fn_port "Game" port udp @@ -1914,6 +1922,8 @@ fn_info_messages_select_engine() { fn_info_messages_wf elif [ "${shortname}" == "wurm" ]; then fn_info_messages_wurm + elif [ "${shortname}" == "xnt" ]; then + fn_info_messages_xnt elif [ "${engine}" == "goldsrc" ]; then fn_info_messages_goldsrc elif [ "${engine}" == "prism3d" ]; then diff --git a/lgsm/modules/install_config.sh b/lgsm/modules/install_config.sh index 22843c7b02..96ae706546 100644 --- a/lgsm/modules/install_config.sh +++ b/lgsm/modules/install_config.sh @@ -41,15 +41,15 @@ fn_default_config_remote() { fn_script_log_info "Copying ${servercfg} config file." if [ "${config}" == "${servercfgdefault}" ]; then mkdir -p "${servercfgdir}" - cp -nv "${lgsmdir}/config-default/config-game/${config}" "${servercfgfullpath}" + cp -v --update=none "${lgsmdir}/config-default/config-game/${config}" "${servercfgfullpath}" elif [ "${shortname}" == "arma3" ] && [ "${config}" == "${networkcfgdefault}" ]; then mkdir -p "${servercfgdir}" - cp -nv "${lgsmdir}/config-default/config-game/${config}" "${networkcfgfullpath}" + cp -v --update=none "${lgsmdir}/config-default/config-game/${config}" "${networkcfgfullpath}" elif [ "${shortname}" == "dst" ] && [ "${config}" == "${clustercfgdefault}" ]; then - cp -nv "${lgsmdir}/config-default/config-game/${clustercfgdefault}" "${clustercfgfullpath}" + cp -v --update=none "${lgsmdir}/config-default/config-game/${clustercfgdefault}" "${clustercfgfullpath}" else mkdir -p "${servercfgdir}" - cp -nv "${lgsmdir}/config-default/config-game/${config}" "${servercfgdir}/${config}" + cp -v --update=none "${lgsmdir}/config-default/config-game/${config}" "${servercfgdir}/${config}" fi done fn_sleep_time @@ -62,14 +62,21 @@ fn_default_config_local() { fn_messages_separator echo -e "Copying default configs." fn_check_cfgdir - echo -en "copying config file [ ${italic}${servercfgdefault}${default} ]" - cp -n "${servercfgdir}/${servercfgdefault}" "${servercfgfullpath}" + + # Check if the directory for ${servercfgfullpath} exists, if not, create it + if [ ! -d "$(dirname "${servercfgfullpath}")" ]; then + mkdir -p "$(dirname "${servercfgfullpath}")" + fi + + echo -en "copying config file [ ${italic}${servercfgdefault}${default} ]: " + cp --update=none "${servercfgdir}/${servercfgdefault}" "${servercfgfullpath}" + exitcode=$? if [ "${exitcode}" != 0 ]; then fn_print_fail_eol - fn_script_log_fail "copying config file [ ${servercfgdefault} ]" + fn_script_log_fail "copying config file [ ${servercfgdefault} ]: " else fn_print_ok_eol - fn_script_log_pass "copying config file [ ${servercfgdefault} ]" + fn_script_log_pass "copying config file [ ${servercfgdefault} ]: " fi } @@ -835,6 +842,13 @@ elif [ "${shortname}" == "wmc" ]; then fn_fetch_default_config fn_default_config_remote fn_set_config_vars + fn_list_config_locations +elif [ "${shortname}" == "xnt" ]; then + array_configs+=(server.cfg) + fn_fetch_default_config + fn_default_config_remote + fn_set_config_vars + fn_list_config_locations elif [ "${shortname}" == "wurm" ]; then array_configs+=(server.cfg) fn_fetch_default_config diff --git a/lgsm/modules/install_server_files.sh b/lgsm/modules/install_server_files.sh index 7ebac259f7..57ce58ca79 100644 --- a/lgsm/modules/install_server_files.sh +++ b/lgsm/modules/install_server_files.sh @@ -12,196 +12,224 @@ fn_install_server_files() { remote_fileurl="http://linuxgsm.download/ActionHalfLife/action_halflife-1.0.tar.xz" local_filedir="${tmpdir}" local_filename="action_halflife-1.0.tar.xz" - chmodx="nochmodx" run="norun" + chmodx="nochmodx" + run="norun" force="noforce" md5="61d7b79fd714888b6d65944fdaafa94a" elif [ "${shortname}" == "bf1942" ]; then remote_fileurl="http://linuxgsm.download/BattleField1942/bf1942_lnxded-1.61-hacked-to-1.612.full.tar.xz" local_filedir="${tmpdir}" local_filename="bf1942_lnxded-1.61-hacked-to-1.612.full.tar.xz" - chmodx="nochmodx" run="norun" + chmodx="nochmodx" + run="norun" force="noforce" md5="4223bf4ed85f5162c24b2cba51249b9e" elif [ "${shortname}" == "bfv" ]; then remote_fileurl="http://linuxgsm.download/BattlefieldVietnam/bfv_linded-v1.21-20041207_patch.tar.xz" local_filedir="${tmpdir}" local_filename="bfv_linded-v1.21-20041207_patch.tar.xz" - chmodx="nochmodx" run="norun" + chmodx="nochmodx" + run="norun" force="noforce" md5="e3b4962cdd9d41e23c6fed65101bccde" elif [ "${shortname}" == "bb" ]; then remote_fileurl="http://linuxgsm.download/BrainBread/brainbread-v1.2-linuxserver.tar.xz" local_filedir="${tmpdir}" local_filename="brainbread-v1.2-linuxserver.tar.xz" - chmodx="nochmodx" run="norun" + chmodx="nochmodx" + run="norun" force="noforce" md5="55f227183b736397806d5b6db6143f15" elif [ "${shortname}" == "cod" ]; then remote_fileurl="http://linuxgsm.download/CallOfDuty/cod-lnxded-1.5b-full.tar.xz" local_filedir="${tmpdir}" local_filename="cod-lnxded-1.5-large.tar.xz" - chmodx="nochmodx" run="norun" + chmodx="nochmodx" + run="norun" force="noforce" md5="ee0ad1ccbfa1fd27fde01a4a431a5c2f" elif [ "${shortname}" == "coduo" ]; then remote_fileurl="http://linuxgsm.download/CallOfDutyUnitedOffensive/coduo-lnxded-1.51b-full.tar.xz" local_filedir="${tmpdir}" local_filename="coduo-lnxded-1.51b-full.tar.xz" - chmodx="nochmodx" run="norun" + chmodx="nochmodx" + run="norun" force="noforce" md5="35cabccd67adcda44aaebc59405915b9" elif [ "${shortname}" == "cod2" ]; then remote_fileurl="http://linuxgsm.download/CallOfDuty2/cod2-lnxded-1.3-full.tar.xz" local_filedir="${tmpdir}" local_filename="cod2-lnxded-1.3-full.tar.xz" - chmodx="nochmodx" run="norun" + chmodx="nochmodx" + run="norun" force="noforce" md5="b8c4c611f01627dd43348e78478a3d41" elif [ "${shortname}" == "cod4" ]; then remote_fileurl="http://linuxgsm.download/CallOfDuty4/cod4x18_lnxded.tar.xz" local_filedir="${tmpdir}" local_filename="cod4x18_lnxded.tar.xz" - chmodx="nochmodx" run="norun" + chmodx="nochmodx" + run="norun" force="noforce" md5="d255b59b9756d7dbead67718208512ee" elif [ "${shortname}" == "codwaw" ]; then remote_fileurl="http://linuxgsm.download/CallOfDutyWorldAtWar/codwaw-lnxded-1.7-full.tar.xz" local_filedir="${tmpdir}" local_filename="codwaw-lnxded-1.7-full.tar.xz" - chmodx="nochmodx" run="norun" + chmodx="nochmodx" + run="norun" force="noforce" md5="2c6be1bb66ea631b9b2e7ae6216c6680" elif [ "${shortname}" == "etl" ]; then remote_fileurl="http://linuxgsm.download/WolfensteinEnemyTerritory/etlegacy-v2.78.1-i386-et-260b.tar.xz" local_filedir="${tmpdir}" local_filename="etlegacy-v2.78.1-i386-et-260b.tar.xz" - chmodx="nochmodx" run="norun" + chmodx="nochmodx" + run="norun" force="noforce" md5="7c08b52cb09b30eadb98ea05ef780fc7" elif [ "${shortname}" == "mohaa" ]; then remote_fileurl="http://linuxgsm.download/MedalofHonorAlliedAssault/moh_revival_v1.12_RC3.5.1.tar.xz" local_filedir="${tmpdir}" local_filename="moh_revival_v1.12_RC3.5.1.tar.xz" - chmodx="nochmodx" run="norun" + chmodx="nochmodx" + run="norun" force="noforce" md5="7c664538999252eeaf2b6d9949416480" elif [ "${shortname}" == "ns" ]; then remote_fileurl="http://linuxgsm.download/NaturalSelection/ns_dedicated_server_v32.tar.xz" local_filedir="${tmpdir}" local_filename="ns_dedicated_server_v32.tar.xz" - chmodx="nochmodx" run="norun" + chmodx="nochmodx" + run="norun" force="noforce" md5="23ec3cadd93d8bb1c475bad5b9cce370" elif [ "${shortname}" == "q2" ]; then remote_fileurl="http://linuxgsm.download/Quake2/quake2-3.20-glibc-i386-full-linux2.0.tar.xz" local_filedir="${tmpdir}" local_filename="quake2-3.20-glibc-i386-full-linux2.0.tar.xz" - chmodx="nochmodx" run="norun" + chmodx="nochmodx" + run="norun" force="noforce" md5="2908164a32d4808bb720f2161f6b0c82" elif [ "${shortname}" == "q3" ]; then remote_fileurl="http://linuxgsm.download/Quake3/quake3-1.32c-x86-full-linux.tar.xz" local_filedir="${tmpdir}" local_filename="quake3-1.32c-x86-full-linux.tar.xz" - chmodx="nochmodx" run="norun" + chmodx="nochmodx" + run="norun" force="noforce" md5="b0e26d8919fe9313fb9d8ded2360f3db" elif [ "${shortname}" == "q4" ]; then remote_fileurl="http://linuxgsm.download/Quake4/quake4-1.4.2-x86-linuxded.tar.xz" local_filedir="${tmpdir}" local_filename="quake4-1.4.2-x86-linuxded.tar.xz" - chmodx="nochmodx" run="norun" + chmodx="nochmodx" + run="norun" force="noforce" md5="afe30b44f23c8ae2ce6f0f464473d8ba" elif [ "${shortname}" == "qw" ]; then remote_fileurl="http://linuxgsm.download/QuakeWorld/nquake.server.linux.190506.full.tar.xz" local_filedir="${tmpdir}" local_filename="nquake.server.linux.190506.full.tar.xz" - chmodx="nochmodx" run="norun" + chmodx="nochmodx" + run="norun" force="noforce" md5="82055b7d973206c13a606db8ba288d03" elif [ "${shortname}" == "rtcw" ]; then remote_fileurl="http://linuxgsm.download/ReturnToCastleWolfenstein/iortcw-1.51c-x86_64-server-linux-20190507.tar.xz" local_filedir="${tmpdir}" local_filename="iortcw-1.51c-x86_64-server-linux-20190507.tar.xz" - chmodx="nochmodx" run="norun" + chmodx="nochmodx" + run="norun" force="noforce" md5="df6ff664d37dd0d22787848bdb3cac5f" elif [ "${shortname}" == "sfc" ]; then remote_fileurl="http://linuxgsm.download/SourceFortsClassic/SFClassic-1.0-RC7-fix.tar.xz" local_filedir="${tmpdir}" local_filename="SFClassic-1.0-RC7-fix.tar.xz" - chmodx="nochmodx" run="norun" + chmodx="nochmodx" + run="norun" force="noforce" md5="70077137185700e28fe6bbb6021d12bc" elif [ "${shortname}" == "sof2" ]; then remote_fileurl="http://linuxgsm.download/SoldierOfFortune2/sof2gold-1.03.tar.xz" local_filedir="${tmpdir}" local_filename="sof2gold-1.03.tar.xz" - chmodx="nochmodx" run="norun" + chmodx="nochmodx" + run="norun" force="noforce" md5="201e23bab04207d00ce813d001c483d9" elif [ "${shortname}" == "ts" ]; then remote_fileurl="http://linuxgsm.download/TheSpecialists/ts-3-linux-final.tar.xz" local_filedir="${tmpdir}" local_filename="ts-3-linux-final.tar.xz" - chmodx="nochmodx" run="norun" + chmodx="nochmodx" + run="norun" force="noforce" md5="3c66ecff6e3644f7ac88015732a0fb93" elif [ "${shortname}" == "ut2k4" ]; then remote_fileurl="http://linuxgsm.download/UnrealTournament2004/ut2004-server-3369-3-ultimate-linux.tar.xz" local_filedir="${tmpdir}" local_filename="ut2004-server-3369-3-ultimate-linux.tar.xz" - chmodx="nochmodx" run="norun" + chmodx="nochmodx" + run="norun" force="noforce" md5="9fceaab68554749f4b45be66613b9a15" elif [ "${shortname}" == "ut99" ]; then remote_fileurl="http://linuxgsm.download/UnrealTournament99/ut99-server-469b-ultimate-linux.tar.xz" local_filedir="${tmpdir}" local_filename="ut99-server-469b-ultimate-linux.tar.xz" - chmodx="nochmodx" run="norun" + chmodx="nochmodx" + run="norun" force="noforce" md5="dba3f1122a5e60ee45ece7422fcf78f5" elif [ "${shortname}" == "ut" ]; then remote_fileurl="http://linuxgsm.download/UnrealTournament/UnrealTournament-Server-XAN-3525360-Linux.tar.xz" local_filedir="${tmpdir}" local_filename="UnrealTournament-Server-XAN-3525360-Linux.tar.xz" - chmodx="noexecute" run="norun" + chmodx="noexecute" + run="norun" force="noforce" md5="41dd92015713a78211eaccf503b72393" elif [ "${shortname}" == "ut3" ]; then remote_fileurl="http://linuxgsm.download/UnrealTournament3/UT3-linux-server-2.1.tar.xz" local_filedir="${tmpdir}" local_filename="UT3-linux-server-2.1.tar.xz" - chmodx="nochmodx" run="norun" + chmodx="nochmodx" + run="norun" force="noforce" md5="8876cca61e3f83ea08db25208bde6ac6" elif [ "${shortname}" == "vs" ]; then remote_fileurl="http://linuxgsm.download/VampireSlayer/vs_l-6.0_full.tar.xz" local_filedir="${tmpdir}" local_filename="vs_l-6.0_full.tar.xz" - chmodx="nochmodx" run="norun" + chmodx="nochmodx" + run="norun" force="noforce" md5="b322f79e0abd31847493c52acf802667" elif [ "${shortname}" == "wet" ]; then remote_fileurl="http://linuxgsm.download/WolfensteinEnemyTerritory/enemy-territory.260b.tar.xz" local_filedir="${tmpdir}" local_filename="enemy-territory.260b.tar.xz" - chmodx="nochmodx" run="norun" + chmodx="nochmodx" + run="norun" force="noforce" md5="581a333cc7eacda2f56d5a00fe11eafa" elif [ "${shortname}" == "samp" ]; then remote_fileurl="https://files.samp-sc.com/samp037svr_R2-1.tar.gz" local_filedir="${tmpdir}" local_filename="samp037svr_R2-1.tar.gz" - chmodx="nochmodx" run="norun" + chmodx="nochmodx" + run="norun" force="noforce" md5="93705e165550c97484678236749198a4" elif [ "${shortname}" == "zmr" ]; then remote_fileurl="http://linuxgsm.download/ZombieMasterReborn/zombie_master_reborn_b6_1.tar.xz" local_filedir="${tmpdir}" local_filename="zombie_master_reborn_b6_1.tar.xz" - chmodx="nochmodx" run="norun" + chmodx="nochmodx" + run="norun" force="noforce" md5="0188ae86dbc9376f11ae3032dba2d665" else @@ -247,6 +275,8 @@ elif [ "${shortname}" == "vints" ]; then elif [ "${shortname}" == "ut99" ]; then fn_install_server_files update_ut99.sh +elif [ "${shortname}" == "xnt" ]; then + update_xnt.sh elif [ -z "${appid}" ] || [ "${shortname}" == "ahl" ] || [ "${shortname}" == "bb" ] || [ "${shortname}" == "q4" ] || [ "${shortname}" == "ns" ] || [ "${shortname}" == "sfc" ] || [ "${shortname}" == "ts" ] || [ "${shortname}" == "vs" ] || [ "${shortname}" == "zmr" ]; then if [ "${shortname}" == "ut" ]; then install_eula.sh diff --git a/lgsm/modules/update_xnt.sh b/lgsm/modules/update_xnt.sh new file mode 100644 index 0000000000..d935e39890 --- /dev/null +++ b/lgsm/modules/update_xnt.sh @@ -0,0 +1,173 @@ +#!/bin/bash +# LinuxGSM command_ut99.sh module +# Author: Daniel Gibbs +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Handles updating of Unreal Tournament 99 servers. + +module_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +fn_update_dl() { + # Download and extract files to serverfiles. + fn_fetch_file "${remotebuildurl}" "" "" "" "${tmpdir}" "${remotebuildfilename}" "nochmodx" "norun" "force" "${remotebuildhash}" + fn_dl_extract "${tmpdir}" "${remotebuildfilename}" "${serverfiles}" "Xonotic" + fn_clear_tmp +} + +fn_update_localbuild() { + # Gets local build info. + fn_print_dots "Checking local build: ${remotelocation}" + + # Send version command to Xonotic server. + tmux -L "${socketname}" send-keys -t "${sessionname}" "version\r" > /dev/null 2>&1 + fn_sleep_time_1 + + # Uses log file to get local build. + localbuild=$(grep "SVQC version: xonotic-v" "${consolelogdir}"/* 2> /dev/null | tail -1 | sed 's/.*SVQC version: \(xonotic-v[0-9.]*\).*/\1/' | tr -d '\000-\011\013-\037') + if [ -z "${localbuild}" ]; then + fn_print_error "Checking local build: ${remotelocation}: missing local build info" + fn_script_log_error "Missing local build info" + fn_script_log_error "Set localbuild to 0" + localbuild="0" + else + fn_print_ok "Checking local build: ${remotelocation}" + fn_script_log_pass "Checking local build" + fi +} + +fn_update_remotebuild() { + # Get remote build info. + apiurl="https://api.github.com/repos/xonotic/xonotic/tags" + remotebuildresponse=$(curl -s "${apiurl}") + remotebuildtag=$(echo "${remotebuildresponse}" | jq -r '.[0].name') + remotebuildfilename=$(echo "${remotebuildtag}" | tr -d 'v') + remotebuildfilename="${remotebuildfilename}.zip" + remotebuildurl="https://dl.xonotic.org/${remotebuildfilename}" + + remotebuildversion="${remotebuildtag}" + + if [ "${firstcommandname}" != "INSTALL" ]; then + fn_print_dots "Checking remote build: ${remotelocation}" + # Checks if remotebuildversion variable has been set. + if [ -z "${remotebuildversion}" ] || [ "${remotebuildversion}" == "null" ]; then + fn_print_fail "Checking remote build: ${remotelocation}" + fn_script_log_fail "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 "${remotebuildversion}" ] || [ "${remotebuildversion}" == "null" ]; then + fn_print_failure "Unable to get remote build" + fn_script_log_fail "Unable to get remote build" + core_exit.sh + fi + fi +} + +fn_update_compare() { + fn_print_dots "Checking for update: ${remotelocation}" + # Update has been found or force update. + if [ "${localbuild}" != "${remotebuildversion}" ] || [ "${forceupdate}" == "1" ]; then + # Create update lockfile. + date '+%s' > "${lockdir:?}/update.lock" + 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}${remotebuildversion}${default}" + if [ -n "${branch}" ]; then + echo -e "* Branch: ${branch}" + fi + if [ -f "${rootdir}/.dev-debug" ]; then + echo -e "Remote build info" + echo -e "* apiurl: ${apiurl}" + echo -e "* remotebuildfilename: ${remotebuildfilename}" + echo -e "* remotebuildurl: ${remotebuildurl}" + echo -e "* remotebuildversion: ${remotebuildversion}" + fi + echo -en "\n" + fn_script_log_info "Update available" + fn_script_log_info "Local build: ${localbuild}" + fn_script_log_info "Remote build: ${remotebuildversion}" + if [ -n "${branch}" ]; then + fn_script_log_info "Branch: ${branch}" + fi + fn_script_log_info "${localbuild} > ${remotebuildversion}" + + if [ "${commandname}" == "UPDATE" ]; then + date +%s > "${lockdir}/last-updated.lock" + unset updateonstart + check_status.sh + # If server stopped. + if [ "${status}" == "0" ]; then + fn_update_dl + if [ "${localbuild}" == "0" ]; then + exitbypass=1 + command_start.sh + fn_firstcommand_reset + exitbypass=1 + fn_sleep_time_5 + command_stop.sh + fn_firstcommand_reset + fi + # If server started. + else + fn_print_restart_warning + exitbypass=1 + command_stop.sh + fn_firstcommand_reset + exitbypass=1 + fn_update_dl + exitbypass=1 + command_start.sh + fn_firstcommand_reset + fi + unset exitbypass + alert="update" + elif [ "${commandname}" == "CHECK-UPDATE" ]; then + alert="check-update" + fi + 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}${remotebuildversion}${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: ${remotebuildversion}" + if [ -n "${branch}" ]; then + fn_script_log_info "Branch: ${branch}" + fi + if [ -f "${rootdir}/.dev-debug" ]; then + echo -e "Remote build info" + echo -e "* apiurl: ${apiurl}" + echo -e "* remotebuildfilename: ${remotebuildfilename}" + echo -e "* remotebuildurl: ${remotebuildurl}" + echo -e "* remotebuildversion: ${remotebuildversion}" + fi + fi +} + +# The location where the builds are checked and downloaded. +remotelocation="github.com" + +if [ "${firstcommandname}" == "INSTALL" ]; then + fn_update_remotebuild + fn_update_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_localbuild + fn_update_remotebuild + fn_update_compare +fi From b4299ef1667318d05171a9a66aed2b232ca98d13 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Thu, 29 Aug 2024 14:45:49 +0100 Subject: [PATCH 15/20] feat: delete download of tar files when installed (#4458) this will clear the tmp directory when a server it downloaded --- lgsm/modules/install_server_files.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/lgsm/modules/install_server_files.sh b/lgsm/modules/install_server_files.sh index 57ce58ca79..7d773ce9f6 100644 --- a/lgsm/modules/install_server_files.sh +++ b/lgsm/modules/install_server_files.sh @@ -238,6 +238,7 @@ fn_install_server_files() { fi fn_fetch_file "${remote_fileurl}" "" "" "" "${local_filedir}" "${local_filename}" "${chmodx}" "${run}" "${forcedl}" "${md5}" fn_dl_extract "${local_filedir}" "${local_filename}" "${serverfiles}" + fn_clear_tmp } echo -e "" From 02223a5206da02d69b19f5d27f8a1bde70191810 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Thu, 29 Aug 2024 21:22:25 +0100 Subject: [PATCH 16/20] fix(restart): prevent restart from running if checks fail (4278) --- lgsm/modules/command_restart.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/lgsm/modules/command_restart.sh b/lgsm/modules/command_restart.sh index ed60a55550..457d1d17f9 100644 --- a/lgsm/modules/command_restart.sh +++ b/lgsm/modules/command_restart.sh @@ -10,6 +10,7 @@ commandaction="Restarting" moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_firstcommand_set +check.sh info_game.sh exitbypass=1 command_stop.sh From d9d82a1a1230fb096dff5f1b0609bde397aa1806 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sun, 1 Sep 2024 22:07:58 +0100 Subject: [PATCH 17/20] feat(permissions): Attempt to fix non executable files issue --- lgsm/modules/check_permissions.sh | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/lgsm/modules/check_permissions.sh b/lgsm/modules/check_permissions.sh index d2cd5890c5..44c527bfb5 100644 --- a/lgsm/modules/check_permissions.sh +++ b/lgsm/modules/check_permissions.sh @@ -71,11 +71,27 @@ fn_check_permissions() { echo -en "File:" echo -en "${findnotexecutable}" } | column -s $'\t' -t | tee -a "${lgsmlog}" - if [ "${monitorflag}" == 1 ]; then - alert="permissions" - alert.sh + + # Attempt to make the files executable + fn_print_information_nl "Attempting to fix permissions issues" + fn_script_log_info "Attempting to fix permissions issues" + echo "${findnotexecutable}" | xargs chmod +x + + # Re-check if there are still non-executable files + findnotexecutable="$(find "${modulesdir}" -type f -not -executable)" + findnotexecutablewc="$(find "${modulesdir}" -type f -not -executable | wc -l)" + if [ "${findnotexecutablewc}" -ne "0" ]; then + fn_print_fail_nl "Failed to resolve permissions issues" + fn_script_log_fail "Failed to resolve permissions issues" + if [ "${monitorflag}" == 1 ]; then + alert="permissions" + alert.sh + fi + core_exit.sh + else + fn_print_ok_nl "Permissions issues resolved" + fn_script_log_pass "Permissions issues resolved" fi - core_exit.sh fi fi From 2458def3519c760973f00003c059b177a7134682 Mon Sep 17 00:00:00 2001 From: Armin <50357737+PlayMTL@users.noreply.github.com> Date: Tue, 10 Sep 2024 17:44:45 +0200 Subject: [PATCH 18/20] change: sfserver new executable --- lgsm/config-default/config-lgsm/sfserver/_default.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lgsm/config-default/config-lgsm/sfserver/_default.cfg b/lgsm/config-default/config-lgsm/sfserver/_default.cfg index 65930bfc17..d495a322de 100644 --- a/lgsm/config-default/config-lgsm/sfserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/sfserver/_default.cfg @@ -159,7 +159,7 @@ glibc="2.17" ## Game Server Directories systemdir="${serverfiles}/FactoryGame" executabledir="${serverfiles}/Engine/Binaries/Linux" -executable="./UnrealServer-Linux-Shipping" +executable="./FactoryServer-Linux-Shipping" servercfgdir="${systemdir}/Saved/Config/LinuxServer" servercfg="GameUserSettings.ini" servercfgdefault="GameUserSettings.ini" From 76905cf99c44378326842036bbc6262271c9e439 Mon Sep 17 00:00:00 2001 From: Armin <50357737+PlayMTL@users.noreply.github.com> Date: Tue, 10 Sep 2024 18:05:19 +0200 Subject: [PATCH 19/20] change: remove MultiHome Parameter for sfserver --- lgsm/config-default/config-lgsm/sfserver/_default.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lgsm/config-default/config-lgsm/sfserver/_default.cfg b/lgsm/config-default/config-lgsm/sfserver/_default.cfg index d495a322de..d6ce41d827 100644 --- a/lgsm/config-default/config-lgsm/sfserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/sfserver/_default.cfg @@ -16,7 +16,7 @@ port="7777" ## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters ## Game Server Docs | https://satisfactory.fandom.com/wiki/Dedicated_servers -startparameters="FactoryGame -MultiHome=${ip} -Port=${port} -ServerQueryPort=${queryport} -BeaconPort=${beaconport} -log" +startparameters="FactoryGame -Port=${port} -ServerQueryPort=${queryport} -BeaconPort=${beaconport} -log" #### LinuxGSM Settings #### From 8a0fb935fa74b200877679f5bdc2c84b9f99f445 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Tue, 10 Sep 2024 20:34:27 +0100 Subject: [PATCH 20/20] removed temporary fix with sf 1 release --- lgsm/modules/check_executable.sh | 7 ------- 1 file changed, 7 deletions(-) diff --git a/lgsm/modules/check_executable.sh b/lgsm/modules/check_executable.sh index 91db68f1a3..e7214ac33c 100644 --- a/lgsm/modules/check_executable.sh +++ b/lgsm/modules/check_executable.sh @@ -7,13 +7,6 @@ moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" -# #4241 temporary fix for Satisfactory for upgrade betweern Update 7 & Update 8 - remove this once update 8 is released -if [ "${shortname}" == "sf" ]; then - if [ ! -f "${serverfiles}/Engine/Binaries/Linux/UE4Server-Linux-Shipping" ]; then - ln -s "${serverfiles}/Engine/Binaries/Linux/UnrealServer-Linux-Shipping" "${serverfiles}/Engine/Binaries/Linux/UE4Server-Linux-Shipping" - fi -fi - # Check if executable exists execname=$(basename "${executable}") if [ ! -f "${executabledir}/${execname}" ]; then