From a572c21fed50299e5b5842a73559caf19b2be56f Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Tue, 27 Aug 2024 23:02:49 +0100 Subject: [PATCH] move to fix --- lgsm/modules/command_install.sh | 2 -- lgsm/modules/core_modules.sh | 5 +++++ lgsm/modules/fix.sh | 2 +- lgsm/modules/fix_xnt.sh | 18 ++++++++++++++++++ lgsm/modules/install_xnt.sh | 14 -------------- 5 files changed, 24 insertions(+), 17 deletions(-) create mode 100644 lgsm/modules/fix_xnt.sh delete mode 100644 lgsm/modules/install_xnt.sh diff --git a/lgsm/modules/command_install.sh b/lgsm/modules/command_install.sh index a5082110f..c3bf27c61 100644 --- a/lgsm/modules/command_install.sh +++ b/lgsm/modules/command_install.sh @@ -46,8 +46,6 @@ else elif [ "${shortname}" == "mta" ]; then command_install_resources_mta.sh fn_firstcommand_reset - elif [ "${shortname}" == "xnt" ]; then - install_xnt.sh fi fix.sh diff --git a/lgsm/modules/core_modules.sh b/lgsm/modules/core_modules.sh index 3cf0cd8e6..322fa8247 100644 --- a/lgsm/modules/core_modules.sh +++ b/lgsm/modules/core_modules.sh @@ -531,6 +531,11 @@ fix_wurm.sh() { fn_fetch_module } +fix_xmt.sh() { + modulefile="${FUNCNAME[0]}" + fn_fetch_module +} + fix_zmr.sh() { modulefile="${FUNCNAME[0]}" fn_fetch_module diff --git a/lgsm/modules/fix.sh b/lgsm/modules/fix.sh index e6e00465d..6335659f1 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 000000000..f8388b0de --- /dev/null +++ b/lgsm/modules/fix_xnt.sh @@ -0,0 +1,18 @@ +#!/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 "${serverfiles}/Xonotic/${selfname}/data" ]; then + mkdir -p "${serverfiles}/Xonotic/${selfname}/data" +fi + +# Copy the server.cfg file if it exists +if [ -f "${serverfiles}/Xonotic/server/server.cfg" ]; then + cp "${serverfiles}/Xonotic/server/server.cfg" "${serverfiles}/Xonotic/${selfname}/data/server.cfg" +fi diff --git a/lgsm/modules/install_xnt.sh b/lgsm/modules/install_xnt.sh deleted file mode 100644 index bc7ce219d..000000000 --- a/lgsm/modules/install_xnt.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/bash -# LinuxGSM install_xnt 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]}")")" - -echo -e "" -echo -e "${bold}${lightyellow}Installing Xonotic${default}" -fn_messages_separator -mkdir -p "${serverfiles}/Xonotic/${selfname}/data" -cp "${serverfiles}/Xonotic/server/server.cfg ${serverfiles}/Xonotic/${selfname}/data/server.cfg"