From b5e585d0497b7e7cb2606af94cedf516d60c2b12 Mon Sep 17 00:00:00 2001 From: Ceddicedced Date: Mon, 7 Jun 2021 17:56:43 +0200 Subject: [PATCH 1/9] # Moddified existing lgsm scripts to work with fabric mc --- .../config-lgsm/fabmcserver/_default.cfg | 173 ++++++++++++++++++ lgsm/data/serverlist.csv | 1 + lgsm/functions/check_deps.sh | 6 +- lgsm/functions/check_system_requirements.sh | 2 +- lgsm/functions/command_update.sh | 2 + lgsm/functions/core_functions.sh | 5 + lgsm/functions/info_messages.sh | 2 +- lgsm/functions/install_config.sh | 2 +- lgsm/functions/install_eula.sh | 4 +- lgsm/functions/install_server_files.sh | 3 + 10 files changed, 192 insertions(+), 8 deletions(-) create mode 100644 lgsm/config-default/config-lgsm/fabmcserver/_default.cfg diff --git a/lgsm/config-default/config-lgsm/fabmcserver/_default.cfg b/lgsm/config-default/config-lgsm/fabmcserver/_default.cfg new file mode 100644 index 0000000000..bf3227a3d1 --- /dev/null +++ b/lgsm/config-default/config-lgsm/fabmcserver/_default.cfg @@ -0,0 +1,173 @@ +################################## +######## 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 +javaram="1024" # -Xmx$1024M + +## Server Parameters | https://docs.linuxgsm.com/configuration/start-parameters#additional-parameters +startparameters="nogui" + +## Release Settings | https://docs.linuxgsm.com/game-servers/minecraft#release-settings +# Version (latest|1.16.5) +mcversion="latest" + +#### LinuxGSM Settings #### + +## LinuxGSM Stats +# Send useful stats to LinuxGSM developers. +# https://docs.linuxgsm.com/configuration/linuxgsm-stats +# (on|off) +stats="off" + +## Notification Alerts +# (on|off) + +# Display IP | https://docs.linuxgsm.com/alerts#display-ip +displayip="" + +# More info | https://docs.linuxgsm.com/alerts#more-info +postalert="off" + +# Discord Alerts | https://docs.linuxgsm.com/alerts/discord +discordalert="off" +discordwebhook="webhook" + +# Email Alerts | https://docs.linuxgsm.com/alerts/email +emailalert="off" +email="email@example.com" +emailfrom="" + +# IFTTT Alerts | https://docs.linuxgsm.com/alerts/ifttt +iftttalert="off" +ifttttoken="accesstoken" +iftttevent="linuxgsm_alert" + +# Mailgun Email Alerts | https://docs.linuxgsm.com/alerts/mailgun +mailgunalert="off" +mailgunapiregion="us" +mailguntoken="accesstoken" +mailgundomain="example.com" +mailgunemailfrom="alert@example.com" +mailgunemail="email@myemail.com" + +# Pushbullet Alerts | https://docs.linuxgsm.com/alerts/pushbullet +pushbulletalert="off" +pushbullettoken="accesstoken" +channeltag="" + +# Pushover Alerts | https://docs.linuxgsm.com/alerts/pushover +pushoveralert="off" +pushovertoken="accesstoken" +pushoveruserkey="userkey" + +# Rocket.Chat Alerts | https://docs.linuxgsm.com/alerts/rocket.chat +rocketchatalert="off" +rocketchatwebhook="webhook" +rocketchattoken="" + +# Slack Alerts | https://docs.linuxgsm.com/alerts/slack +slackalert="off" +slackwebhook="webhook" + +# Telegram Alerts | https://docs.linuxgsm.com/alerts/telegram +# You can add a custom cURL string eg proxy (useful in Russia) in "curlcustomstring". +# For example "--socks5 ipaddr:port" for socks5 proxy see more in "curl --help". +telegramapi="api.telegram.org" +telegramalert="off" +telegramtoken="accesstoken" +telegramchatid="" +curlcustomstring="" + +## Updating | https://docs.linuxgsm.com/commands/update +updateonstart="off" + +## Backup | https://docs.linuxgsm.com/commands/backup +maxbackups="4" +maxbackupdays="30" +stoponbackup="on" + +## Logging | https://docs.linuxgsm.com/features/logging +consolelogging="on" +logdays="7" + +## Monitor | https://docs.linuxgsm.com/commands/monitor +# Query delay time +querydelay="1" + +## ANSI Colors | https://docs.linuxgsm.com/features/ansi-colors +ansi="on" + +#### Advanced Settings #### + +## Message Display Time | https://docs.linuxgsm.com/features/message-display-time +sleeptime="0.5" + +## Stop Mode | https://docs.linuxgsm.com/features/stop-mode +# 1: tmux kill +# 2: CTRL+c +# 3: quit +# 4: quit 120s +# 5: stop +# 6: q +# 7: exit +# 8: 7 Days to Die +# 9: GoldSrc +# 10: Avorion +# 11: end +stopmode="5" + +## Query mode +# 1: session only +# 2: gamedig (gsquery fallback) +# 3: gamedig +# 4: gsquery +# 5: tcp +querymode="2" +querytype="minecraft" + +## Console type +consoleverbose="yes" +consoleinteract="yes" + +## Game Server Details +# Do not edit +gamename="FabricMC" +engine="lwjgl2" +glibc="null" + +#### Directories #### +# Edit with care + +## Game Server Directories +systemdir="${serverfiles}" +executabledir="${serverfiles}" +preexecutable="java -Xmx${javaram}M -jar" +executable="./fabric-server-launch.jar" +servercfgdir="${systemdir}" +servercfg="server.properties" +servercfgdefault="server.properties" +servercfgfullpath="${servercfgdir}/${servercfg}" + +## Backup Directory +backupdir="${lgsmdir}/backup" + +## Logging Directories +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" \ No newline at end of file diff --git a/lgsm/data/serverlist.csv b/lgsm/data/serverlist.csv index 687a3f63df..6d729187dd 100644 --- a/lgsm/data/serverlist.csv +++ b/lgsm/data/serverlist.csv @@ -69,6 +69,7 @@ onset,onsetserver,Onset opfor,opforserver,Opposing Force pc,pcserver,Project Cars pmc,pmcserver,PaperMC +fabmc,fabmcserver,FabricMC pstbs,pstbsserver,Post Scriptum: The Bloody Seventh pvkii,pvkiiserver,Pirates Vikings & Knights II pvr,pvrserver,Pavlov VR diff --git a/lgsm/functions/check_deps.sh b/lgsm/functions/check_deps.sh index 50109b2f64..32995237ee 100755 --- a/lgsm/functions/check_deps.sh +++ b/lgsm/functions/check_deps.sh @@ -347,7 +347,7 @@ fn_deps_build_debian(){ array_deps_required=( curl wget ca-certificates file bsdmainutils util-linux python3 tar bzip2 gzip unzip binutils bc jq tmux netcat cpio ) # All servers except ts3, mumble, GTA and minecraft servers require lib32stdc++6 and lib32gcc1. - if [ "${shortname}" != "ts3" ]&&[ "${shortname}" != "mumble" ]&&[ "${shortname}" != "mc" ]&&[ "${shortname}" != "pmc" ]&&[ "${shortname}" != "wmc" ]&&[ "${engine}" != "renderware" ]; then + if [ "${shortname}" != "ts3" ]&&[ "${shortname}" != "mumble" ]&&[ "${shortname}" != "mc" ]&&[ "${shortname}" != "fabmc" ]&&[ "${shortname}" != "pmc" ]&&[ "${shortname}" != "wmc" ]&&[ "${engine}" != "renderware" ]; then if [ "${arch}" == "x86_64" ]; then # lib32gcc1 is now called lib32gcc-s1 in debian 11 if { [ "${distroid}" == "debian" ]&&[ "${distroversion}" == "11" ]; }||{ [ "${distroid}" == "ubuntu" ]&&[ "${distroversion}" == "20.10" ]; }||{ [ "${distroid}" == "pop" ]&&[ "${distroversion}" == "20.10" ]; }; then @@ -415,7 +415,7 @@ fn_deps_build_debian(){ elif [ "${shortname}" == "hw" ]||[ "${shortname}" == "rust" ]; then array_deps_required+=( lib32z1 ) # Minecraft, Rising World, Wurm - elif [ "${shortname}" == "mc" ]||[ "${shortname}" == "pmc" ]||[ "${shortname}" == "wmc" ]||[ "${shortname}" == "rw" ]; then + elif [ "${shortname}" == "mc" ]||[ "${shortname}" == "fabmc" ]||[ "${shortname}" == "pmc" ]||[ "${shortname}" == "wmc" ]||[ "${shortname}" == "rw" ]; then javaversion=$(java -version 2>&1 | grep "version") if [ "${javaversion}" ]; then # Added for users using Oracle JRE to bypass the check. @@ -530,7 +530,7 @@ fn_deps_build_redhat(){ elif [ "${shortname}" == "hw" ]||[ "${shortname}" == "rust" ]; then array_deps_required+=( zlib-devel ) # Minecraft, Rising World, Wurm - elif [ "${shortname}" == "mc" ]||[ "${shortname}" == "pmc" ]||[ "${shortname}" == "wmc" ]||[ "${shortname}" == "rw" ]; then + elif [ "${shortname}" == "mc" ]||[ "${shortname}" == "fabmc" ]||[ "${shortname}" == "pmc" ]||[ "${shortname}" == "wmc" ]||[ "${shortname}" == "rw" ]; then javaversion=$(java -version 2>&1 | grep "version") if [ "${javaversion}" ]; then # Added for users using Oracle JRE to bypass the check. diff --git a/lgsm/functions/check_system_requirements.sh b/lgsm/functions/check_system_requirements.sh index cc72288fb0..ce7678ed78 100755 --- a/lgsm/functions/check_system_requirements.sh +++ b/lgsm/functions/check_system_requirements.sh @@ -26,7 +26,7 @@ elif [ "${shortname}" == "arma3" ]; then elif [ "${shortname}" == "rust" ]; then ramrequirementmb="4000" ramrequirementgb="4" -elif [ "${shortname}" == "mc" ]||[ "${shortname}" == "pmc" ]||[ "${shortname}" == "wmc" ]; then +elif [ "${shortname}" == "mc" ]||[ "${shortname}" == "fabmc" ]||[ "${shortname}" == "pmc" ]||[ "${shortname}" == "wmc" ]; then ramrequirementmb="1000" ramrequirementgb="1" elif [ "${shortname}" == "pstbs" ]; then diff --git a/lgsm/functions/command_update.sh b/lgsm/functions/command_update.sh index 828c8c38de..9af210458e 100755 --- a/lgsm/functions/command_update.sh +++ b/lgsm/functions/command_update.sh @@ -23,6 +23,8 @@ elif [ "${shortname}" == "mcb" ]; then update_minecraft_bedrock.sh elif [ "${shortname}" == "pmc" ]||[ "${shortname}" == "wmc" ]; then update_papermc.sh +elif [ "${shortname}" == "fabmc" ]; then + update_fabricmc.sh elif [ "${shortname}" == "mumble" ]; then update_mumble.sh elif [ "${shortname}" == "fctr" ]; then diff --git a/lgsm/functions/core_functions.sh b/lgsm/functions/core_functions.sh index ec1a98531a..c47efa7373 100755 --- a/lgsm/functions/core_functions.sh +++ b/lgsm/functions/core_functions.sh @@ -645,6 +645,11 @@ functionfile="${FUNCNAME[0]}" fn_fetch_function } +update_fabricmc.sh(){ +functionfile="${FUNCNAME[0]}" +fn_fetch_function +} + update_mumble.sh(){ functionfile="${FUNCNAME[0]}" fn_fetch_function diff --git a/lgsm/functions/info_messages.sh b/lgsm/functions/info_messages.sh index 391964c2a6..f15197e717 100755 --- a/lgsm/functions/info_messages.sh +++ b/lgsm/functions/info_messages.sh @@ -1615,7 +1615,7 @@ fn_info_message_select_engine(){ fn_info_message_justcause3 elif [ "${shortname}" == "kf2" ]; then fn_info_message_kf2 - elif [ "${shortname}" == "mc" ]||[ "${shortname}" == "pmc" ]||[ "${shortname}" == "wmc" ]; then + elif [ "${shortname}" == "mc" ]||[ "${shortname}" == "fabmc" ]||[ "${shortname}" == "pmc" ]||[ "${shortname}" == "wmc" ]; then fn_info_message_minecraft elif [ "${shortname}" == "mcb" ]; then fn_info_message_minecraft_bedrock diff --git a/lgsm/functions/install_config.sh b/lgsm/functions/install_config.sh index 9b5ef01cd0..4df182e7eb 100755 --- a/lgsm/functions/install_config.sh +++ b/lgsm/functions/install_config.sh @@ -514,7 +514,7 @@ elif [ "${shortname}" == "l4d2" ]; then fn_default_config_remote fn_set_config_vars fn_list_config_locations -elif [ "${shortname}" == "mc" ]||[ "${shortname}" == "pmc" ]; then +elif [ "${shortname}" == "mc" ]||[ "${shortname}" == "fabmc" ]||[ "${shortname}" == "pmc" ]; then gamedirname="Minecraft" array_configs+=( server.properties ) fn_fetch_default_config diff --git a/lgsm/functions/install_eula.sh b/lgsm/functions/install_eula.sh index d7c0b0b7ae..ca025acf7b 100755 --- a/lgsm/functions/install_eula.sh +++ b/lgsm/functions/install_eula.sh @@ -9,7 +9,7 @@ functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" if [ "${shortname}" == "ts3" ]; then eulaurl="https://www.teamspeak.com/en/privacy-and-terms" -elif [ "${shortname}" == "mc" ]||[ "${shortname}" == "pmc" ]; then +elif [ "${shortname}" == "mc" ]||[ "${shortname}" == "fabmc" ]||[ "${shortname}" == "pmc" ]; then eulaurl="https://account.mojang.com/documents/minecraft_eula" elif [ "${shortname}" == "ut" ]; then eulaurl="https://www.epicgames.com/unrealtournament/unreal-tournament-pre-alpha-test-development-build-eula" @@ -41,7 +41,7 @@ fi if [ "${shortname}" == "ts3" ]; then touch "${executabledir}/.ts3server_license_accepted" -elif [ "${shortname}" == "mc" ]||[ "${shortname}" == "pmc" ]; then +elif [ "${shortname}" == "mc" ]||[ "${shortname}" == "fabmc" ]||[ "${shortname}" == "pmc" ]; then touch "${serverfiles}/eula.txt" echo -e "eula=true" > "${serverfiles}/eula.txt" elif [ "${shortname}" == "ut" ]; then diff --git a/lgsm/functions/install_server_files.sh b/lgsm/functions/install_server_files.sh index b6b9f5240f..f9c13a01bb 100755 --- a/lgsm/functions/install_server_files.sh +++ b/lgsm/functions/install_server_files.sh @@ -86,6 +86,9 @@ elif [ "${shortname}" == "mcb" ]; then elif [ "${shortname}" == "pmc" ]; then install_eula.sh update_papermc.sh +elif [ "${shortname}" == "fabmc" ]; then + install_eula.sh + update_fabricmc.sh elif [ "${shortname}" == "wmc" ]; then update_papermc.sh elif [ "${shortname}" == "mumble" ]; then From c0d772805b1667cc87b0190b58bbf53e260e3402 Mon Sep 17 00:00:00 2001 From: Ceddicedced Date: Mon, 7 Jun 2021 17:57:52 +0200 Subject: [PATCH 2/9] # Created update_fabricmc.sh to download installer files. And also to generate server jars --- lgsm/functions/update_fabricmc.sh | 147 ++++++++++++++++++++++++++++++ 1 file changed, 147 insertions(+) create mode 100644 lgsm/functions/update_fabricmc.sh diff --git a/lgsm/functions/update_fabricmc.sh b/lgsm/functions/update_fabricmc.sh new file mode 100644 index 0000000000..44c3985911 --- /dev/null +++ b/lgsm/functions/update_fabricmc.sh @@ -0,0 +1,147 @@ +#!/bin/bash +# LinuxGSM update_fabricmc.sh function +# Author: Ceddicedced +# Contributors: http://linuxgsm.com/contrib +# Website: https://linuxgsm.com +# Description: Handles updating of FabricMC servers. + +local commandname="UPDATE" +local commandaction="Update" +local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" + +fn_install_fabric(){ + # get build info + installername=$(echo -e "fabric-installer-${latestfabricinstaller}.jar") + installersha256=$(curl "https://${remotelocation}/net/fabricmc/fabric-installer/${latestfabricinstaller}/${installername}.sha256") + fn_fetch_file "https://${remotelocation}/net/fabricmc/fabric-installer/${latestfabricinstaller}/${installername}" "" "" "" "${tmpdir}" "fabric-installer.jar" "nochmodx" "norun" "force" "${installersha256}" + echo -e "Generating Fabric jars...\c" + java -jar ${tmpdir}/fabric-installer.jar server -dir ${serverfiles} -mcversion ${mcversion} -downloadMinecraft &> ${logdir}/script/fabric-installer.log + local exitcode=$? + if [ "${exitcode}" == "0" ]; then + fn_print_ok_eol_nl + fn_script_log_pass "Generating Fabric jars" + chmod u+x "${serverfiles}/${executable#./}" + echo "${latestfabricloader}" > "${localversionfile}" + fn_clear_tmp + else + fn_print_fail_eol_nl + fn_script_log_fatal "Generating Fabric jars with loader ${installername} and version ${mcversion}" + core_exit.sh + fi +} + +fn_update_fabricmc_localbuild(){ + # Gets local build info. + fn_print_dots "Checking for update: ${remotelocation}: checking local build" + sleep 0.5 + + if [ ! -f "${localversionfile}" ]; then + fn_print_error_nl "Checking for update: ${remotelocation}: checking local build: no local build files" + fn_script_log_error "No local build file found" + else + localbuild=$(head -n 1 "${localversionfile}") + fi + + if [ -z "${localbuild}" ]; then + localbuild="0" + fn_print_error "Checking for update: ${remotelocation}: waiting for local build: missing local build info" + fn_script_log_error "Missing local build info, Set localbuild to 0" + else + fn_print_ok "Checking for update: ${remotelocation}: checking local build" + fn_script_log_pass "Checking local build" + fi + sleep 0.5 +} + +fn_update_fabricmc_remotebuild(){ + # Gets remote build info. + latestfabricinstaller=$(curl -s https://${remotelocation}/net/fabricmc/fabric-installer/maven-metadata.xml | grep -oPm1 "(?<=)[^<]+") + latestfabricloader=$(curl -s https://${remotelocation}/net/fabricmc/fabric-loader/maven-metadata.xml | grep -oPm1 "(?<=)[^<]+") + # Checks if latestfabricloader variable has been set. + if [ -z "${latestfabricinstaller}" ]||[ -z "${latestfabricloader}" ]; then + fn_print_failure "Unable to get remote build" + fn_script_log_fatal "Unable to get remote build" + core_exit.sh + else + fn_print_ok "Latest Fabric loader version ${latestfabricloader}" + fn_script_log "Latest Fabric loader version ${latestfabricloader}" + fi +} + +fn_update_fabricmc_compare(){ + fn_print_dots "Checking for update: ${remotelocation}" + sleep 0.5 + if [ "${localbuild}" != "${latestfabricloader}" ]||[ "${forceupdate}" == "1" ]; then + fn_print_ok_nl "Checking for update: ${remotelocation}" + echo -en "\n" + echo -e "Update available for version ${latestfabricinstaller}" + echo -e "* Local build: ${red}${localbuild}${default}" + echo -e "* Remote build: ${green}${latestfabricloader}${default}" + fn_script_log_info "Update available for version ${mcversion}" + fn_script_log_info "Local build: ${localbuild}" + fn_script_log_info "Remote build: ${latestfabricloader}" + fn_script_log_info "${localbuild} > ${latestfabricloader}" + echo -en "\n" + echo -en "applying update.\r" + echo -en "\n" + + unset updateonstart + + check_status.sh + # If server stopped. + if [ "${status}" == "0" ]; then + fn_install_fabric + # If server started. + else + exitbypass=1 + command_stop.sh + exitbypass=1 + fn_install_fabric + exitbypass=1 + command_start.sh + fi + alert="update" + alert.sh + else + fn_print_ok_nl "Checking for update: ${remotelocation}" + echo -en "\n" + echo -e "No update available for version ${mcversion}" + echo -e "* Local build: ${green}${localbuild}${default}" + echo -e "* Remote build: ${green}${latestfabricloader}${default}" + fn_script_log_info "No update available" + fn_script_log_info "Local build: ${localbuild}" + fn_script_log_info "Remote build: ${latestfabricloader}" + fi +} + + +# The location where the builds are checked and downloaded. +remotelocation="maven.fabricmc.net" + + +localversionfile="${datadir}/fabricmc-version" + +# check if datadir was created, if not create it +if [ ! -d "${datadir}" ]; then + mkdir -p "${datadir}" +fi + + +if [ "${mcversion}" == "latest" ]; then + mcversion=$(curl -s "https://launchermeta.mojang.com/mc/game/version_manifest.json" | jq -r '.latest.release') +fi + + + + +if [ "${firstcommandname}" == "INSTALL" ]; then + fn_update_fabricmc_remotebuild + fn_install_fabric +else + fn_print_dots "Checking for update: ${remotelocation}" + fn_script_log_info "Checking for update: ${remotelocation}" + sleep 0.5 + fn_update_fabricmc_localbuild + fn_update_fabricmc_remotebuild + fn_update_fabricmc_compare +fi From 215c86ef8bfc8cd008e4a8a0b8d452ddb0d25109 Mon Sep 17 00:00:00 2001 From: C Date: Wed, 15 Dec 2021 13:18:35 +0100 Subject: [PATCH 3/9] # Updated _default.cfg to match the one of paper --- lgsm/config-default/config-lgsm/fabmcserver/_default.cfg | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lgsm/config-default/config-lgsm/fabmcserver/_default.cfg b/lgsm/config-default/config-lgsm/fabmcserver/_default.cfg index bf3227a3d1..1f8ba5b0d9 100644 --- a/lgsm/config-default/config-lgsm/fabmcserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/fabmcserver/_default.cfg @@ -44,6 +44,11 @@ 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" @@ -170,4 +175,4 @@ 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" \ No newline at end of file +consolelogdate="${consolelogdir}/${selfname}-console-$(date '+%Y-%m-%d-%H:%M:%S').log" From a06fcddf55bc1080ced77a4cb40bf67d8db347fe Mon Sep 17 00:00:00 2001 From: C Date: Wed, 15 Dec 2021 13:50:17 +0100 Subject: [PATCH 4/9] # Moved fabmc in serverlist to right place --- lgsm/data/serverlist.csv | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lgsm/data/serverlist.csv b/lgsm/data/serverlist.csv index 5f6a633bbe..6b87c09a46 100644 --- a/lgsm/data/serverlist.csv +++ b/lgsm/data/serverlist.csv @@ -37,6 +37,7 @@ dys,dysserver,Dystopia eco,ecoserver,Eco em,emserver,Empires Mod etl,etlserver,ET: Legacy +fabmc,fabmcserver,FabricMC fctr,fctrserver,Factorio fof,fofserver,Fistful of Frags gmod,gmodserver,Garrys Mod @@ -71,7 +72,6 @@ onset,onsetserver,Onset opfor,opforserver,Opposing Force pc,pcserver,Project Cars pmc,pmcserver,PaperMC -fabmc,fabmcserver,FabricMC pstbs,pstbsserver,Post Scriptum: The Bloody Seventh pvkii,pvkiiserver,Pirates Vikings & Knights II pvr,pvrserver,Pavlov VR From e3485e03ec6e5d06364474b82641fb650cbe2d77 Mon Sep 17 00:00:00 2001 From: C Date: Wed, 15 Dec 2021 14:11:13 +0100 Subject: [PATCH 5/9] # Updated to new dependency checks --- lgsm/data/almalinux-8.csv | 1 + lgsm/data/centos-7.csv | 1 + lgsm/data/centos-8.csv | 1 + lgsm/data/debian-10.csv | 1 + lgsm/data/debian-11.csv | 1 + lgsm/data/debian-9.csv | 1 + lgsm/data/rhel-7.csv | 1 + lgsm/data/rhel-8.csv | 1 + lgsm/data/rocky-8.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-21.04.csv | 1 + lgsm/data/ubuntu-22.04.csv | 1 + 14 files changed, 14 insertions(+) diff --git a/lgsm/data/almalinux-8.csv b/lgsm/data/almalinux-8.csv index 08ae83a106..d64eb210f9 100644 --- a/lgsm/data/almalinux-8.csv +++ b/lgsm/data/almalinux-8.csv @@ -39,6 +39,7 @@ dys eco,libgdiplus em etl +fabmc,java-11-openjdk fctr fof gmod,ncurses-libs.i686 diff --git a/lgsm/data/centos-7.csv b/lgsm/data/centos-7.csv index eb64cfb863..a66176b231 100644 --- a/lgsm/data/centos-7.csv +++ b/lgsm/data/centos-7.csv @@ -39,6 +39,7 @@ dys eco,libgdiplus em etl +fabmc,java-11-openjdk fctr fof gmod,ncurses-libs.i686 diff --git a/lgsm/data/centos-8.csv b/lgsm/data/centos-8.csv index d33fbe00af..aa16ac370e 100644 --- a/lgsm/data/centos-8.csv +++ b/lgsm/data/centos-8.csv @@ -39,6 +39,7 @@ dys eco,libgdiplus em etl +fabmc,java-11-openjdk fctr fof gmod,ncurses-libs.i686 diff --git a/lgsm/data/debian-10.csv b/lgsm/data/debian-10.csv index 2024e85fa7..b5197afa5f 100644 --- a/lgsm/data/debian-10.csv +++ b/lgsm/data/debian-10.csv @@ -39,6 +39,7 @@ dys eco,libgdiplus em etl +fabmc,openjdk-11-jre fctr fof gmod,libtinfo5:i386 diff --git a/lgsm/data/debian-11.csv b/lgsm/data/debian-11.csv index 27dc5cb745..c71c7f0ed1 100644 --- a/lgsm/data/debian-11.csv +++ b/lgsm/data/debian-11.csv @@ -39,6 +39,7 @@ dys eco,libgdiplus em etl +fabmc,openjdk-17-jre fctr fof gmod,libtinfo5:i386 diff --git a/lgsm/data/debian-9.csv b/lgsm/data/debian-9.csv index 139d5fd80b..d338c020d1 100644 --- a/lgsm/data/debian-9.csv +++ b/lgsm/data/debian-9.csv @@ -39,6 +39,7 @@ dys eco,libgdiplus em etl +fabmc,openjdk-8-jre fctr fof gmod,libtinfo5:i386 diff --git a/lgsm/data/rhel-7.csv b/lgsm/data/rhel-7.csv index 1334a5f6cf..3a1444fde8 100644 --- a/lgsm/data/rhel-7.csv +++ b/lgsm/data/rhel-7.csv @@ -39,6 +39,7 @@ dys eco,libgdiplus em etl +fabmc,java-11-openjdk fctr fof gmod,ncurses-libs.i686 diff --git a/lgsm/data/rhel-8.csv b/lgsm/data/rhel-8.csv index 1334a5f6cf..3a1444fde8 100644 --- a/lgsm/data/rhel-8.csv +++ b/lgsm/data/rhel-8.csv @@ -39,6 +39,7 @@ dys eco,libgdiplus em etl +fabmc,java-11-openjdk fctr fof gmod,ncurses-libs.i686 diff --git a/lgsm/data/rocky-8.csv b/lgsm/data/rocky-8.csv index 08ae83a106..d64eb210f9 100644 --- a/lgsm/data/rocky-8.csv +++ b/lgsm/data/rocky-8.csv @@ -39,6 +39,7 @@ dys eco,libgdiplus em etl +fabmc,java-11-openjdk fctr fof gmod,ncurses-libs.i686 diff --git a/lgsm/data/ubuntu-16.04.csv b/lgsm/data/ubuntu-16.04.csv index 415d9abbf5..ee82741290 100644 --- a/lgsm/data/ubuntu-16.04.csv +++ b/lgsm/data/ubuntu-16.04.csv @@ -39,6 +39,7 @@ dys eco,libgdiplus em etl +fabmc,openjdk-8-jre fctr fof gmod,libtinfo5:i386 diff --git a/lgsm/data/ubuntu-18.04.csv b/lgsm/data/ubuntu-18.04.csv index 2024e85fa7..b5197afa5f 100644 --- a/lgsm/data/ubuntu-18.04.csv +++ b/lgsm/data/ubuntu-18.04.csv @@ -39,6 +39,7 @@ dys eco,libgdiplus em etl +fabmc,openjdk-11-jre fctr fof gmod,libtinfo5:i386 diff --git a/lgsm/data/ubuntu-20.04.csv b/lgsm/data/ubuntu-20.04.csv index c9fa981f09..5169015b54 100644 --- a/lgsm/data/ubuntu-20.04.csv +++ b/lgsm/data/ubuntu-20.04.csv @@ -39,6 +39,7 @@ dys eco,libgdiplus em etl +fabmc,openjdk-17-jre fctr fof gmod,libtinfo5:i386 diff --git a/lgsm/data/ubuntu-21.04.csv b/lgsm/data/ubuntu-21.04.csv index a3ca2d84ef..ff044552f8 100644 --- a/lgsm/data/ubuntu-21.04.csv +++ b/lgsm/data/ubuntu-21.04.csv @@ -39,6 +39,7 @@ dys eco,libgdiplus em etl +fabmc,openjdk-17-jre fctr fof gmod,libtinfo5:i386 diff --git a/lgsm/data/ubuntu-22.04.csv b/lgsm/data/ubuntu-22.04.csv index a3ca2d84ef..ff044552f8 100644 --- a/lgsm/data/ubuntu-22.04.csv +++ b/lgsm/data/ubuntu-22.04.csv @@ -39,6 +39,7 @@ dys eco,libgdiplus em etl +fabmc,openjdk-17-jre fctr fof gmod,libtinfo5:i386 From 2612aeff2a93b5f12783f1fb998f738417af27ad Mon Sep 17 00:00:00 2001 From: C Date: Wed, 15 Dec 2021 14:15:00 +0100 Subject: [PATCH 6/9] # Updated info messages for fabricmc --- lgsm/functions/info_game.sh | 2 +- lgsm/functions/info_messages.sh | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lgsm/functions/info_game.sh b/lgsm/functions/info_game.sh index ad29b5a2cd..9ca0fad7da 100644 --- a/lgsm/functions/info_game.sh +++ b/lgsm/functions/info_game.sh @@ -2249,7 +2249,7 @@ elif [ "${shortname}" == "kf2" ]; then fn_info_game_kf2 elif [ "${shortname}" == "lo" ]; then fn_info_game_lo -elif [ "${shortname}" == "mc" ]||[ "${shortname}" == "pmc" ]; then +elif [ "${shortname}" == "mc" ]||[ "${shortname}" == "pmc" ]||[ "${shortname}" == "fabmc" ]; then fn_info_game_mc elif [ "${shortname}" == "mcb" ]; then fn_info_game_mcb diff --git a/lgsm/functions/info_messages.sh b/lgsm/functions/info_messages.sh index 0337f2d92e..a75803dab4 100755 --- a/lgsm/functions/info_messages.sh +++ b/lgsm/functions/info_messages.sh @@ -685,7 +685,7 @@ fn_info_message_ports(){ echo -e "ss -tuplwn | grep AvorionServer" elif [ "${shortname}" == "bf1942" ]; then echo -e "ss -tuplwn | grep bf1942_lnxded" - elif [ "${shortname}" == "mc" ]||[ "${shortname}" == "pmc" ]||[ "${shortname}" == "rw" ]||[ "${shortname}" == "wmc" ]; then + elif [ "${shortname}" == "mc" ]||[ "${shortname}" == "pmc" ]||[ "${shortname}" == "rw" ]||[ "${shortname}" == "wmc" ]||[ "${shortname}" == "fabmc" ]||; then echo -e "ss -tuplwn | grep java" elif [ "${shortname}" == "terraria" ]; then echo -e "ss -tuplwn | grep Main" @@ -1659,7 +1659,7 @@ fn_info_message_select_engine(){ fn_info_message_kf2 elif [ "${shortname}" == "lo" ]; then fn_info_message_lo - elif [ "${shortname}" == "mc" ]||[ "${shortname}" == "pmc" ]||[ "${shortname}" == "wmc" ]; then + elif [ "${shortname}" == "mc" ]||[ "${shortname}" == "pmc" ]||[ "${shortname}" == "wmc" ]||[ "${shortname}" == "fabmc" ]; then fn_info_message_mc elif [ "${shortname}" == "mcb" ]; then fn_info_message_mcb From cf62c2bdcacf39f0312d5d60dd53700dd148a088 Mon Sep 17 00:00:00 2001 From: C Date: Wed, 15 Dec 2021 14:58:44 +0100 Subject: [PATCH 7/9] # Removed empty lines --- lgsm/functions/update_fabricmc.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/lgsm/functions/update_fabricmc.sh b/lgsm/functions/update_fabricmc.sh index 44c3985911..a399f1e132 100644 --- a/lgsm/functions/update_fabricmc.sh +++ b/lgsm/functions/update_fabricmc.sh @@ -114,7 +114,6 @@ fn_update_fabricmc_compare(){ fi } - # The location where the builds are checked and downloaded. remotelocation="maven.fabricmc.net" From 4175a5382af16846885a749953e906e375984c43 Mon Sep 17 00:00:00 2001 From: C Date: Wed, 15 Dec 2021 15:01:21 +0100 Subject: [PATCH 8/9] # fixed formatting --- lgsm/functions/update_fabricmc.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lgsm/functions/update_fabricmc.sh b/lgsm/functions/update_fabricmc.sh index a399f1e132..2e4350db75 100644 --- a/lgsm/functions/update_fabricmc.sh +++ b/lgsm/functions/update_fabricmc.sh @@ -10,7 +10,7 @@ local commandaction="Update" local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_install_fabric(){ - # get build info + # get build info installername=$(echo -e "fabric-installer-${latestfabricinstaller}.jar") installersha256=$(curl "https://${remotelocation}/net/fabricmc/fabric-installer/${latestfabricinstaller}/${installername}.sha256") fn_fetch_file "https://${remotelocation}/net/fabricmc/fabric-installer/${latestfabricinstaller}/${installername}" "" "" "" "${tmpdir}" "fabric-installer.jar" "nochmodx" "norun" "force" "${installersha256}" From 7de6005a02ce1dc8f3aafbab298940acd2960535 Mon Sep 17 00:00:00 2001 From: C Date: Wed, 15 Dec 2021 21:11:02 +0100 Subject: [PATCH 9/9] # Fixing intends with tabs and deleting empty lines --- lgsm/functions/update_fabricmc.sh | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/lgsm/functions/update_fabricmc.sh b/lgsm/functions/update_fabricmc.sh index 2e4350db75..a113e9a7cb 100644 --- a/lgsm/functions/update_fabricmc.sh +++ b/lgsm/functions/update_fabricmc.sh @@ -10,9 +10,8 @@ local commandaction="Update" local function_selfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_install_fabric(){ - # get build info - installername=$(echo -e "fabric-installer-${latestfabricinstaller}.jar") - installersha256=$(curl "https://${remotelocation}/net/fabricmc/fabric-installer/${latestfabricinstaller}/${installername}.sha256") + installername=$(echo -e "fabric-installer-${latestfabricinstaller}.jar") + installersha256=$(curl "https://${remotelocation}/net/fabricmc/fabric-installer/${latestfabricinstaller}/${installername}.sha256") fn_fetch_file "https://${remotelocation}/net/fabricmc/fabric-installer/${latestfabricinstaller}/${installername}" "" "" "" "${tmpdir}" "fabric-installer.jar" "nochmodx" "norun" "force" "${installersha256}" echo -e "Generating Fabric jars...\c" java -jar ${tmpdir}/fabric-installer.jar server -dir ${serverfiles} -mcversion ${mcversion} -downloadMinecraft &> ${logdir}/script/fabric-installer.log @@ -117,7 +116,6 @@ fn_update_fabricmc_compare(){ # The location where the builds are checked and downloaded. remotelocation="maven.fabricmc.net" - localversionfile="${datadir}/fabricmc-version" # check if datadir was created, if not create it @@ -125,14 +123,10 @@ if [ ! -d "${datadir}" ]; then mkdir -p "${datadir}" fi - if [ "${mcversion}" == "latest" ]; then mcversion=$(curl -s "https://launchermeta.mojang.com/mc/game/version_manifest.json" | jq -r '.latest.release') fi - - - if [ "${firstcommandname}" == "INSTALL" ]; then fn_update_fabricmc_remotebuild fn_install_fabric