From 11c14fcd36295d2540778fa02baf7b15dffe4839 Mon Sep 17 00:00:00 2001 From: Andrew dos Santos Date: Sat, 23 May 2026 00:16:15 -0300 Subject: [PATCH 1/2] feat(hytserver): add Hytale server support --- .../config-lgsm/hytserver/_default.cfg | 188 +++++++++++++ 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/gameicons/hyt-icon.png | Bin 0 -> 146 bytes 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/data/ubuntu-26.04.csv | 1 + lgsm/modules/check_deps.sh | 11 +- lgsm/modules/check_system_requirements.sh | 2 + lgsm/modules/command_check_update.sh | 2 + lgsm/modules/command_update.sh | 2 + lgsm/modules/core_getopt.sh | 4 +- lgsm/modules/core_modules.sh | 5 + lgsm/modules/info_game.sh | 15 + lgsm/modules/info_messages.sh | 13 +- lgsm/modules/install_config.sh | 3 + lgsm/modules/install_server_files.sh | 2 + lgsm/modules/update_hyt.sh | 264 ++++++++++++++++++ 37 files changed, 528 insertions(+), 7 deletions(-) create mode 100644 lgsm/config-default/config-lgsm/hytserver/_default.cfg create mode 100644 lgsm/data/gameicons/hyt-icon.png create mode 100755 lgsm/modules/update_hyt.sh diff --git a/lgsm/config-default/config-lgsm/hytserver/_default.cfg b/lgsm/config-default/config-lgsm/hytserver/_default.cfg new file mode 100644 index 0000000000..8c3f106666 --- /dev/null +++ b/lgsm/config-default/config-lgsm/hytserver/_default.cfg @@ -0,0 +1,188 @@ +################################## +######## 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 +ip="0.0.0.0" +port="5520" + +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="--bind ${ip}:${port}" + +## Release Settings +# Patchline (release|pre-release) +hytalepatchline="release" + +#### 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" + +# ntfy Alerts | https://docs.linuxgsm.com/alerts/ntfy +ntfyalert="off" +ntfytopic="LinuxGSM" +ntfyserver="https://ntfy.sh" +ntfytoken="" +ntfyusername="" +ntfypassword="" +ntfypriority="" +ntfytags="" + +# 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="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="5" + +## Query mode +# 1: session only +# 2: gamedig (gsquery fallback) +# 3: gamedig +# 4: gsquery +# 5: tcp +querymode="1" +querytype="" + +## Console type +consoleverbose="yes" +consoleinteract="yes" + +## Game Server Details +# Do not edit +gamename="Hytale" +engine="hytale" +glibc="null" + +#### Directories #### +# Edit with care + +## Game Server Directories +systemdir="${serverfiles}/Server" +executabledir="${serverfiles}" +executable="./start.sh" +servercfgdir="${systemdir}" +servercfg="config.json" +servercfgdefault="config.json" +servercfgfullpath="${servercfgdir}/${servercfg}" + +## Backup Directory +backupdir="${lgsmdir}/backup" + +## Logging Directories +[ -n "${LGSM_LOGDIR}" ] && logdir="${LGSM_LOGDIR}" || logdir="${rootdir}/log" +gamelogdir="${systemdir}/logs" +lgsmlogdir="${logdir}/script" +consolelogdir="${logdir}/console" +lgsmlog="${lgsmlogdir}/${selfname}-script.log" +consolelog="${consolelogdir}/${selfname}-console.log" +alertlog="${lgsmlogdir}/${selfname}-alert.log" +postdetailslog="${lgsmlogdir}/${selfname}-postdetails.log" + +## Logs Naming +lgsmlogdate="${lgsmlogdir}/${selfname}-script-$(date '+%Y-%m-%d-%H:%M:%S').log" +consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" + +## 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 e02ca7858f..a43e99ffe7 100644 --- a/lgsm/data/almalinux-8.csv +++ b/lgsm/data/almalinux-8.csv @@ -54,6 +54,7 @@ hl2dm hldm hldms hw,zlib-devel +hyt,java-25-openjdk hz ins inss diff --git a/lgsm/data/almalinux-9.csv b/lgsm/data/almalinux-9.csv index 5a6d996e76..6c0f585100 100644 --- a/lgsm/data/almalinux-9.csv +++ b/lgsm/data/almalinux-9.csv @@ -54,6 +54,7 @@ hl2dm hldm hldms hw,zlib-devel +hyt,java-25-openjdk hz ins inss diff --git a/lgsm/data/centos-7.csv b/lgsm/data/centos-7.csv index c5632722e1..5028eb779a 100644 --- a/lgsm/data/centos-7.csv +++ b/lgsm/data/centos-7.csv @@ -54,6 +54,7 @@ hl2dm hldm hldms hw,zlib-devel +hyt,java-25-openjdk hz ins inss diff --git a/lgsm/data/centos-8.csv b/lgsm/data/centos-8.csv index 0b0b766d04..b4c0373695 100644 --- a/lgsm/data/centos-8.csv +++ b/lgsm/data/centos-8.csv @@ -54,6 +54,7 @@ hl2dm hldm hldms hw,zlib-devel +hyt,java-25-openjdk hz ins inss diff --git a/lgsm/data/centos-9.csv b/lgsm/data/centos-9.csv index fd9c0fa39e..dca1266945 100644 --- a/lgsm/data/centos-9.csv +++ b/lgsm/data/centos-9.csv @@ -54,6 +54,7 @@ hl2dm hldm hldms hw,zlib-devel +hyt,java-25-openjdk hz ins inss diff --git a/lgsm/data/debian-10.csv b/lgsm/data/debian-10.csv index 5b8d73a06a..02cef154a0 100644 --- a/lgsm/data/debian-10.csv +++ b/lgsm/data/debian-10.csv @@ -53,6 +53,7 @@ hl2dm hldm hldms hw,lib32z1 +hyt,openjdk-25-jre hz ins inss diff --git a/lgsm/data/debian-11.csv b/lgsm/data/debian-11.csv index adba97d278..818339edb0 100644 --- a/lgsm/data/debian-11.csv +++ b/lgsm/data/debian-11.csv @@ -54,6 +54,7 @@ hl2dm hldm hldms hw,lib32z1 +hyt,openjdk-25-jre hz ins inss diff --git a/lgsm/data/debian-12.csv b/lgsm/data/debian-12.csv index 40e325b6c3..351f0d699f 100644 --- a/lgsm/data/debian-12.csv +++ b/lgsm/data/debian-12.csv @@ -54,6 +54,7 @@ hl2dm hldm hldms hw,lib32z1 +hyt,openjdk-25-jre hz ins inss diff --git a/lgsm/data/debian-13.csv b/lgsm/data/debian-13.csv index 94c6cf1ae8..b7feab35f2 100644 --- a/lgsm/data/debian-13.csv +++ b/lgsm/data/debian-13.csv @@ -54,6 +54,7 @@ hl2dm hldm hldms hw,lib32z1 +hyt,openjdk-25-jre hz ins inss diff --git a/lgsm/data/debian-9.csv b/lgsm/data/debian-9.csv index c0e990961f..57cb1b90c9 100644 --- a/lgsm/data/debian-9.csv +++ b/lgsm/data/debian-9.csv @@ -54,6 +54,7 @@ hl2dm hldm hldms hw,lib32z1 +hyt,openjdk-25-jre hz ins inss diff --git a/lgsm/data/gameicons/hyt-icon.png b/lgsm/data/gameicons/hyt-icon.png new file mode 100644 index 0000000000000000000000000000000000000000..3942ea6161ec27dd29057a738fa6d5268cb357ed GIT binary patch literal 146 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=ffJNKY5Xkcv6U6E<=D(9akAP`@Cf zt#ONti*Zlefea3wUjjcWTI5-SqiqigIG9hk^~&8j!GxtPj$=aCN;#$_k1h&GoMm0C tXduPpY|oP6%m2^pVFpJ}8^hX6hQ-z)LRDKcvw)T`c)I$ztaD0e0suyVE~fwh literal 0 HcmV?d00001 diff --git a/lgsm/data/rhel-7.csv b/lgsm/data/rhel-7.csv index d7801771c0..c1bc26832f 100644 --- a/lgsm/data/rhel-7.csv +++ b/lgsm/data/rhel-7.csv @@ -55,6 +55,7 @@ hl2dm hldm hldms hw,zlib-devel +hyt,java-25-openjdk hz ins inss diff --git a/lgsm/data/rhel-8.csv b/lgsm/data/rhel-8.csv index d654242652..b9823ed85f 100644 --- a/lgsm/data/rhel-8.csv +++ b/lgsm/data/rhel-8.csv @@ -54,6 +54,7 @@ hl2dm hldm hldms hw,zlib-devel +hyt,java-25-openjdk hz ins inss diff --git a/lgsm/data/rhel-9.csv b/lgsm/data/rhel-9.csv index 5a6d996e76..6c0f585100 100644 --- a/lgsm/data/rhel-9.csv +++ b/lgsm/data/rhel-9.csv @@ -54,6 +54,7 @@ hl2dm hldm hldms hw,zlib-devel +hyt,java-25-openjdk hz ins inss diff --git a/lgsm/data/rocky-8.csv b/lgsm/data/rocky-8.csv index d654242652..b9823ed85f 100644 --- a/lgsm/data/rocky-8.csv +++ b/lgsm/data/rocky-8.csv @@ -54,6 +54,7 @@ hl2dm hldm hldms hw,zlib-devel +hyt,java-25-openjdk hz ins inss diff --git a/lgsm/data/rocky-9.csv b/lgsm/data/rocky-9.csv index 5a6d996e76..6c0f585100 100644 --- a/lgsm/data/rocky-9.csv +++ b/lgsm/data/rocky-9.csv @@ -54,6 +54,7 @@ hl2dm hldm hldms hw,zlib-devel +hyt,java-25-openjdk hz ins inss diff --git a/lgsm/data/serverlist.csv b/lgsm/data/serverlist.csv index 3ddc013c31..9ba1afcf62 100644 --- a/lgsm/data/serverlist.csv +++ b/lgsm/data/serverlist.csv @@ -53,6 +53,7 @@ hl2dm,hl2dmserver,Half-Life 2: Deathmatch,ubuntu-24.04 hldm,hldmserver,Half-Life: Deathmatch,ubuntu-24.04 hldms,hldmsserver,Half-Life Deathmatch: Source,ubuntu-24.04 hw,hwserver,Hurtworld,ubuntu-24.04 +hyt,hytserver,Hytale,ubuntu-24.04 hz,hzserver,Humanitz,ubuntu-24.04 ins,insserver,Insurgency,ubuntu-24.04 inss,inssserver,Insurgency: Sandstorm,ubuntu-24.04 diff --git a/lgsm/data/ubuntu-16.04.csv b/lgsm/data/ubuntu-16.04.csv index 24fcf33e23..4d783ae069 100644 --- a/lgsm/data/ubuntu-16.04.csv +++ b/lgsm/data/ubuntu-16.04.csv @@ -55,6 +55,7 @@ hl2dm hldm hldms hw,lib32z1 +hyt,openjdk-25-jre hz ins inss diff --git a/lgsm/data/ubuntu-18.04.csv b/lgsm/data/ubuntu-18.04.csv index b283b629a6..65b8a269e9 100644 --- a/lgsm/data/ubuntu-18.04.csv +++ b/lgsm/data/ubuntu-18.04.csv @@ -55,6 +55,7 @@ hl2dm hldm hldms hw,lib32z1 +hyt,openjdk-25-jre hz ins inss diff --git a/lgsm/data/ubuntu-20.04.csv b/lgsm/data/ubuntu-20.04.csv index b086d0095b..1aeb64040d 100644 --- a/lgsm/data/ubuntu-20.04.csv +++ b/lgsm/data/ubuntu-20.04.csv @@ -54,6 +54,7 @@ hl2dm hldm hldms hw,lib32z1 +hyt,openjdk-25-jre hz ins inss diff --git a/lgsm/data/ubuntu-22.04.csv b/lgsm/data/ubuntu-22.04.csv index 93bfbd4cf5..3f8f045708 100644 --- a/lgsm/data/ubuntu-22.04.csv +++ b/lgsm/data/ubuntu-22.04.csv @@ -54,6 +54,7 @@ hl2dm hldm hldms hw,lib32z1 +hyt,openjdk-25-jre hz ins inss diff --git a/lgsm/data/ubuntu-23.04.csv b/lgsm/data/ubuntu-23.04.csv index cb871bde04..dae2bad68f 100644 --- a/lgsm/data/ubuntu-23.04.csv +++ b/lgsm/data/ubuntu-23.04.csv @@ -54,6 +54,7 @@ hl2dm hldm hldms hw,lib32z1 +hyt,openjdk-25-jre hz ins inss diff --git a/lgsm/data/ubuntu-23.10.csv b/lgsm/data/ubuntu-23.10.csv index cb871bde04..dae2bad68f 100644 --- a/lgsm/data/ubuntu-23.10.csv +++ b/lgsm/data/ubuntu-23.10.csv @@ -54,6 +54,7 @@ hl2dm hldm hldms hw,lib32z1 +hyt,openjdk-25-jre hz ins inss diff --git a/lgsm/data/ubuntu-24.04.csv b/lgsm/data/ubuntu-24.04.csv index 0e010abd69..737774851a 100644 --- a/lgsm/data/ubuntu-24.04.csv +++ b/lgsm/data/ubuntu-24.04.csv @@ -54,6 +54,7 @@ hl2dm hldm hldms hw,lib32z1 +hyt,openjdk-25-jre hz ins inss diff --git a/lgsm/data/ubuntu-26.04.csv b/lgsm/data/ubuntu-26.04.csv index 0e010abd69..737774851a 100644 --- a/lgsm/data/ubuntu-26.04.csv +++ b/lgsm/data/ubuntu-26.04.csv @@ -54,6 +54,7 @@ hl2dm hldm hldms hw,lib32z1 +hyt,openjdk-25-jre hz ins inss diff --git a/lgsm/modules/check_deps.sh b/lgsm/modules/check_deps.sh index e4bcad4bee..81605e6520 100755 --- a/lgsm/modules/check_deps.sh +++ b/lgsm/modules/check_deps.sh @@ -277,9 +277,14 @@ fn_deps_detector() { elif [[ ${deptocheck} == "openjdk"* ]] || [[ ${deptocheck} == "java"* ]]; then # Is java already installed? if [ -n "${javaversion}" ]; then - # Added for users using Oracle JRE to bypass check. - depstatus=0 - deptocheck="${javaversion}" + javamajorversion="$(echo "${javaversion}" | grep -Eo 'version "[0-9]+' | grep -Eo '[0-9]+' | head -1)" + if [ "${shortname}" == "hyt" ] && { [ -z "${javamajorversion}" ] || [ "${javamajorversion}" -lt "25" ]; }; then + depstatus=1 + else + # Added for users using Oracle JRE to bypass check. + depstatus=0 + deptocheck="${javaversion}" + fi else depstatus=1 fi diff --git a/lgsm/modules/check_system_requirements.sh b/lgsm/modules/check_system_requirements.sh index f34190fecf..a9b448c34e 100755 --- a/lgsm/modules/check_system_requirements.sh +++ b/lgsm/modules/check_system_requirements.sh @@ -31,6 +31,8 @@ elif [ "${shortname}" == "dodr" ]; then ramrequirementgb="2" elif [ "${shortname}" == "hw" ]; then ramrequirementgb="3" +elif [ "${shortname}" == "hyt" ]; then + ramrequirementgb="4" elif [ "${shortname}" == "mc" ]; then ramrequirementgb="1" elif [ "${shortname}" == "pmc" ]; then diff --git a/lgsm/modules/command_check_update.sh b/lgsm/modules/command_check_update.sh index 93a770e794..3bdd25bcdd 100755 --- a/lgsm/modules/command_check_update.sh +++ b/lgsm/modules/command_check_update.sh @@ -24,6 +24,8 @@ elif [ "${shortname}" == "pmc" ] || [ "${shortname}" == "vpmc" ] || [ "${shortna update_pmc.sh elif [ "${shortname}" == "fctr" ]; then update_fctr.sh +elif [ "${shortname}" == "hyt" ]; then + update_hyt.sh elif [ "${shortname}" == "mta" ]; then update_mta.sh elif [ "${shortname}" == "jk2" ]; then diff --git a/lgsm/modules/command_update.sh b/lgsm/modules/command_update.sh index a7cfc1b127..097664be35 100755 --- a/lgsm/modules/command_update.sh +++ b/lgsm/modules/command_update.sh @@ -25,6 +25,8 @@ elif [ "${shortname}" == "pmc" ] || [ "${shortname}" == "vpmc" ] || [ "${shortna update_pmc.sh elif [ "${shortname}" == "fctr" ]; then update_fctr.sh +elif [ "${shortname}" == "hyt" ]; then + update_hyt.sh elif [ "${shortname}" == "mta" ]; then update_mta.sh elif [ "${shortname}" == "jk2" ]; then diff --git a/lgsm/modules/core_getopt.sh b/lgsm/modules/core_getopt.sh index ad09bf1df5..d120a9eb14 100755 --- a/lgsm/modules/core_getopt.sh +++ b/lgsm/modules/core_getopt.sh @@ -69,8 +69,8 @@ currentopt+=("${cmd_update_linuxgsm[@]}") if [ "${shortname}" == "jk2" ] || [ "${shortname}" == "etl" ] || [ "${engine}" != "idtech3" ]; then if [ "${shortname}" != "bf1942" ] && [ "${shortname}" != "bfv" ] && [ "${engine}" != "idtech2" ] && [ "${engine}" != "iw2.0" ] && [ "${engine}" != "iw3.0" ] && [ "${engine}" != "quake" ] && [ "${shortname}" != "samp" ] && [ "${shortname}" != "ut2k4" ]; then currentopt+=("${cmd_update[@]}" "${cmd_check_update[@]}") - # force update for SteamCMD or Multi Theft Auto only. - if [ "${appid}" ] || [ "${shortname}" == "mta" ]; then + # force update for SteamCMD, Multi Theft Auto or Hytale only. + if [ "${appid}" ] || [ "${shortname}" == "mta" ] || [ "${shortname}" == "hyt" ]; then currentopt+=("${cmd_force_update[@]}") fi fi diff --git a/lgsm/modules/core_modules.sh b/lgsm/modules/core_modules.sh index ce1a6f6d4a..e343a5ffee 100755 --- a/lgsm/modules/core_modules.sh +++ b/lgsm/modules/core_modules.sh @@ -670,6 +670,11 @@ update_fctr.sh() { fn_fetch_module } +update_hyt.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + update_jk2.sh() { modulefile="${FUNCNAME[0]}" fn_fetch_module diff --git a/lgsm/modules/info_game.sh b/lgsm/modules/info_game.sh index d39e2d143d..4d75be5d18 100755 --- a/lgsm/modules/info_game.sh +++ b/lgsm/modules/info_game.sh @@ -1350,6 +1350,19 @@ fn_info_game_hz() { servername="${servername:-"NOT SET"}" } +# Config Type: json +# Parameters: true +# Comment: +# Example: "ServerName": "SERVERNAME" +# Filetype: json +fn_info_game_hyt() { + configtype="json" + configip="${ip:-"0.0.0.0"}" + port="${port:-"5520"}" + queryport="${port}" + servername="${servername:-"NOT SET"}" +} + # Config Type: parameters # Parameters: true # Comment: @@ -2375,6 +2388,8 @@ elif [ "${shortname}" == "hw" ]; then fn_info_game_hw elif [ "${shortname}" == "hz" ]; then fn_info_game_hz +elif [ "${shortname}" == "hyt" ]; then + fn_info_game_hyt elif [ "${shortname}" == "inss" ]; then fn_info_game_inss elif [ "${shortname}" == "jc2" ]; then diff --git a/lgsm/modules/info_messages.sh b/lgsm/modules/info_messages.sh index 1ef9508303..5b9488ae09 100755 --- a/lgsm/modules/info_messages.sh +++ b/lgsm/modules/info_messages.sh @@ -730,7 +730,7 @@ fn_info_messages_ports_edit() { fi done # engines/games that require editing the start parameters. - local ports_edit_array=("av" "ck" "col" "cs2" "fctr" "goldsrc" "hcu" "hw" "iw3.0" "ioquake3" "pw" "qfusion" "rust" "scpsl" "scpslsm" "sf" "sol" "spark" "source" "unreal4" "arma3" "dayz" "unt" "vh") + local ports_edit_array=("av" "ck" "col" "cs2" "fctr" "goldsrc" "hcu" "hw" "hyt" "iw3.0" "ioquake3" "pw" "qfusion" "rust" "scpsl" "scpslsm" "sf" "sol" "spark" "source" "unreal4" "arma3" "dayz" "unt" "vh") for port_edit in "${ports_edit_array[@]}"; do if [ "${engine}" == "${port_edit}" ] || [ "${gamename}" == "${port_edit}" ] || [ "${shortname}" == "${port_edit}" ]; then startparameterslocation="${configdirserver}" @@ -754,7 +754,7 @@ fn_info_messages_ports() { portcommand="ss -tuplwn | grep enfMain" elif [ "${shortname}" == "q4" ]; then portcommand="ss -tuplwn | grep q4ded.x86" - elif [ "${shortname}" == "mc" ] || [ "${shortname}" == "nec" ] || [ "${shortname}" == "pmc" ] || [ "${shortname}" == "vpmc" ] || [ "${shortname}" == "wmc" ]; then + elif [ "${shortname}" == "hyt" ] || [ "${shortname}" == "mc" ] || [ "${shortname}" == "nec" ] || [ "${shortname}" == "pmc" ] || [ "${shortname}" == "vpmc" ] || [ "${shortname}" == "wmc" ]; then portcommand="ss -tuplwn | grep java" elif [ "${shortname}" == "terraria" ]; then portcommand="ss -tuplwn | grep Main" @@ -1131,6 +1131,13 @@ fn_info_messages_hz() { } | column -s $'\t' -t } +fn_info_messages_hyt() { + { + fn_port "header" + fn_port "Game" port udp + } | column -s $'\t' -t +} + fn_info_messages_ins() { { fn_port "header" @@ -1860,6 +1867,8 @@ fn_info_messages_select_engine() { fn_info_messages_hw elif [ "${shortname}" == "hz" ]; then fn_info_messages_hz + elif [ "${shortname}" == "hyt" ]; then + fn_info_messages_hyt elif [ "${shortname}" == "ins" ]; then fn_info_messages_ins elif [ "${shortname}" == "inss" ]; then diff --git a/lgsm/modules/install_config.sh b/lgsm/modules/install_config.sh index e25b8de5c7..d3141e0135 100755 --- a/lgsm/modules/install_config.sh +++ b/lgsm/modules/install_config.sh @@ -520,6 +520,9 @@ elif [ "${shortname}" == "hl2dm" ]; then elif [ "${shortname}" == "hz" ]; then # Config is generated on first run : +elif [ "${shortname}" == "hyt" ]; then + # Config is generated on first run + : elif [ "${shortname}" == "ins" ]; then array_configs+=(server.cfg) fn_default_config_remote diff --git a/lgsm/modules/install_server_files.sh b/lgsm/modules/install_server_files.sh index e5f10739d2..abf2293f6b 100755 --- a/lgsm/modules/install_server_files.sh +++ b/lgsm/modules/install_server_files.sh @@ -256,6 +256,8 @@ elif [ "${shortname}" == "mta" ]; then elif [ "${shortname}" == "fctr" ]; then update_fctr.sh install_factorio_save.sh +elif [ "${shortname}" == "hyt" ]; then + update_hyt.sh elif [ "${shortname}" == "jk2" ]; then update_jk2.sh elif [ "${shortname}" == "vints" ]; then diff --git a/lgsm/modules/update_hyt.sh b/lgsm/modules/update_hyt.sh new file mode 100755 index 0000000000..e77d38fa55 --- /dev/null +++ b/lgsm/modules/update_hyt.sh @@ -0,0 +1,264 @@ +#!/bin/bash +# LinuxGSM update_hyt.sh module +# Author: Andrew dos Santos +# Contributors: https://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Handles updating of Hytale servers. + +moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +fn_update_hyt_downloader_arch() { + case "${arch}" in + x86_64 | amd64) + hytaledownloaderfile="hytale-downloader-linux-amd64" + ;; + aarch64 | arm64) + fn_print_failure "Hytale supports arm64 servers, but the official downloader archive currently used by LinuxGSM does not include a Linux arm64 downloader." + fn_script_log_fail "Unsupported Hytale downloader architecture: ${arch}" + core_exit.sh + ;; + *) + fn_print_failure "Unknown or unsupported hytale-downloader architecture: ${arch}" + fn_script_log_fail "Unknown or unsupported hytale-downloader architecture: ${arch}" + core_exit.sh + ;; + esac + hytaledownloader="${serverfiles}/${hytaledownloaderfile}" +} + +fn_update_downloader() { + fn_update_hyt_downloader_arch + if [ ! -f "${hytaledownloader}" ] || [ "${forceupdate}" == "1" ]; then + fn_fetch_file "https://downloader.hytale.com/hytale-downloader.zip" "" "" "" "${tmpdir}" "hytale-downloader.zip" "nochmodx" "norun" "forcedl" "nohash" + echo -en "extracting hytale-downloader..." + unzip -oq "${tmpdir}/hytale-downloader.zip" "${hytaledownloaderfile}" "QUICKSTART.md" -d "${serverfiles}" + exitcode=$? + if [ "${exitcode}" -ne 0 ]; then + fn_print_fail_eol_nl + fn_script_log_fail "Extracting hytale-downloader" + core_exit.sh + else + chmod +x "${hytaledownloader}" + fn_print_ok_eol_nl + fn_script_log_pass "Extracting hytale-downloader" + fi + fi +} + +fn_update_hyt_patchline_args() { + hytalepatchline="${hytalepatchline:-release}" + hytalepatchlineargs=() + if [ "${hytalepatchline}" != "release" ]; then + hytalepatchlineargs=(-patchline "${hytalepatchline}") + fi +} + +fn_update_extract() { + extractdir="${tmpdir}/hytale-game" + rm -rf "${extractdir:?}" + mkdir -p "${extractdir}" + echo -en "extracting ${remotebuildfilename}..." + unzip -oq "${tmpdir}/${remotebuildfilename}" -d "${extractdir}" + exitcode=$? + if [ "${exitcode}" -ne 0 ]; then + fn_print_fail_eol_nl + fn_script_log_fail "Extracting ${remotebuildfilename}" + core_exit.sh + fi + + if [ -d "${extractdir}/game/Server" ]; then + extractedroot="${extractdir}/game" + else + extractedroot="${extractdir}" + fi + + mkdir -p "${serverfiles}" + if [ "${firstcommandname}" == "INSTALL" ]; then + cp -a "${extractedroot}/." "${serverfiles}/" + else + for item in "${extractedroot}"/*; do + [ -e "${item}" ] || continue + itemname="$(basename "${item}")" + case "${itemname}" in + Server | .hytale-downloader-credentials.json) + continue + ;; + jvm.options) + if [ -f "${serverfiles}/jvm.options" ]; then + continue + fi + ;; + esac + cp -a "${item}" "${serverfiles}/" + done + mkdir -p "${serverfiles}/Server" + for item in "${extractedroot}/Server"/*; do + [ -e "${item}" ] || continue + itemname="$(basename "${item}")" + case "${itemname}" in + backups | bans.json | config.json | logs | mods | permissions.json | universe | whitelist.json) + continue + ;; + esac + cp -a "${item}" "${serverfiles}/Server/" + done + fi + [ -f "${serverfiles}/start.sh" ] && chmod +x "${serverfiles}/start.sh" + fn_print_ok_eol_nl + fn_script_log_pass "Extracting ${remotebuildfilename}" + rm -rf "${extractdir:?}" +} + +fn_update_dl() { + fn_update_downloader + fn_update_hyt_patchline_args + remotebuildfilename="hytale-server-${remotebuild:-latest}.zip" + echo -e "downloading file [ ${italic}${remotebuildfilename}${default} ]" + fn_sleep_time + cd "${serverfiles}" || exit + "${hytaledownloader}" -download-path "${tmpdir}/${remotebuildfilename}" "${hytalepatchlineargs[@]}" -skip-update-check + exitcode=$? + if [ "${exitcode}" -ne 0 ]; then + fn_print_failure_nl "Downloading ${remotebuildfilename}" + fn_script_log_fail "Downloading ${remotebuildfilename}" + core_exit.sh + fi + fn_update_extract + if [ -n "${remotebuild}" ]; then + echo "${remotebuild}" > "${localbuildfile}" + fi + fn_clear_tmp +} + +fn_update_hyt_check_localbuild_tracking() { + if [ -f "${localbuildfile}" ] && [ -f "${serverfiles}/Server/HytaleServer.jar" ] && [ "${serverfiles}/Server/HytaleServer.jar" -nt "${localbuildfile}" ]; then + fn_print_warn_nl "Hytale server files are newer than LinuxGSM build tracking" + echo -e "* Hytale may have updated itself outside LinuxGSM." + echo -e "* Run ./${selfname} update to refresh LinuxGSM version tracking." + fn_script_log_warn "Hytale server files are newer than LinuxGSM build tracking" + fi +} + +fn_update_localbuild() { + fn_print_dots "Checking local build: ${remotelocation}" + if [ -f "${localbuildfile}" ]; then + localbuild="$(cat "${localbuildfile}")" + fi + 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" + fn_update_hyt_check_localbuild_tracking + fi +} + +fn_update_remotebuild() { + fn_update_downloader + fn_update_hyt_patchline_args + cd "${serverfiles}" || exit + remotebuildresponsefile="${tmpdir}/hytale-print-version-response.txt" + rm -f "${remotebuildresponsefile}" + "${hytaledownloader}" -print-version "${hytalepatchlineargs[@]}" -skip-update-check 2>&1 | tee "${remotebuildresponsefile}" + exitcode=${PIPESTATUS[0]} + remotebuildresponse="$(cat "${remotebuildresponsefile}")" + if [ -f "${lgsmlog}" ]; then + cat "${remotebuildresponsefile}" >> "${lgsmlog}" + fi + remotebuild=$(echo "${remotebuildresponse}" | grep -Eo "[0-9]{4}\.[0-9]{2}\.[0-9]{2}-[A-Za-z0-9]+" | tail -1) + if [ -z "${remotebuild}" ]; then + remotebuild=$(echo "${remotebuildresponse}" | tail -1) + fi + + if [ "${firstcommandname}" != "INSTALL" ]; then + fn_print_dots "Checking remote build: ${remotelocation}" + if [ "${exitcode}" -ne 0 ] || [ -z "${remotebuild}" ] || [ "${remotebuild}" == "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 + if [ "${exitcode}" -ne 0 ] || [ -z "${remotebuild}" ] || [ "${remotebuild}" == "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}" + if [ "${localbuild}" != "${remotebuild}" ] || [ "${forceupdate}" == "1" ]; then + date '+%s' > "${lockdir:?}/update.lock" + fn_print_ok_nl "Checking for update: ${remotelocation}" + fn_print "\n" + fn_print_nl "${bold}${underline}Update${default} available" + fn_print_nl "* Local build: ${red}${localbuild}${default}" + fn_print_nl "* Remote build: ${green}${remotebuild}${default}" + fn_print_nl "* Patchline: ${hytalepatchline}" + fn_print "\n" + fn_script_log_info "Update available" + fn_script_log_info "Local build: ${localbuild}" + fn_script_log_info "Remote build: ${remotebuild}" + fn_script_log_info "Patchline: ${hytalepatchline}" + + if [ "${commandname}" == "UPDATE" ]; then + date +%s > "${lockdir:?}/last-updated.lock" + unset updateonstart + check_status.sh + if [ "${status}" == "0" ]; then + fn_update_dl + 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}" + fn_print "\n" + fn_print_nl "${bold}${underline}No update${default} available" + fn_print_nl "* Local build: ${green}${localbuild}${default}" + fn_print_nl "* Remote build: ${green}${remotebuild}${default}" + fn_print_nl "* Patchline: ${hytalepatchline}" + fn_print "\n" + fn_script_log_info "No update available" + fn_script_log_info "Local build: ${localbuild}" + fn_script_log_info "Remote build: ${remotebuild}" + fn_script_log_info "Patchline: ${hytalepatchline}" + fi +} + +info_distro.sh + +localbuildfile="${datadir}/${selfname}-hytale-version" +remotelocation="hytale.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 d5196b5e9359a6289b2c6d0619707fd627075022 Mon Sep 17 00:00:00 2001 From: Andrew dos Santos Date: Sat, 23 May 2026 01:48:25 -0300 Subject: [PATCH 2/2] fix(monitor): include update-restart in update lock check --- lgsm/modules/command_monitor.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lgsm/modules/command_monitor.sh b/lgsm/modules/command_monitor.sh index 7c813aed77..d6a05b08de 100755 --- a/lgsm/modules/command_monitor.sh +++ b/lgsm/modules/command_monitor.sh @@ -145,7 +145,7 @@ fn_monitor_check_update() { fi fi - if [ -f "${lockdir}/update.lock" ] && [[ "$(pgrep -fcx -u "${USER}" "/bin/bash ./${selfname} update")" != "0" || "$(pgrep -fcx -u "${USER}" "/bin/bash ./${selfname} validate")" != "0" || "$(pgrep -fcx -u "${USER}" "/bin/bash ./${selfname} v")" != "0" || "$(pgrep -fc force-update "${USER}" "/bin/bash ./${selfname} fu")" != "0" ]]; then + if [ -f "${lockdir}/update.lock" ] && [[ "$(pgrep -fcx -u "${USER}" "/bin/bash ./${selfname} update")" != "0" || "$(pgrep -fcx -u "${USER}" "/bin/bash ./${selfname} validate")" != "0" || "$(pgrep -fcx -u "${USER}" "/bin/bash ./${selfname} v")" != "0" || "$(pgrep -fcx -u "${USER}" "/bin/bash ./${selfname} force-update")" != "0" || "$(pgrep -fcx -u "${USER}" "/bin/bash ./${selfname} fu")" != "0" || "$(pgrep -fcx -u "${USER}" "/bin/bash ./${selfname} update-restart")" != "0" || "$(pgrep -fcx -u "${USER}" "/bin/bash ./${selfname} ur")" != "0" ]]; then fn_print_dots "Checking update" fn_print_checking_eol fn_print_info "Checking update: LinuxGSM is updating the game server"