From 9b00dd468b50380735d04cfd1d16f9461a94fbfb Mon Sep 17 00:00:00 2001 From: bredo Date: Mon, 15 Jul 2024 12:48:53 +1200 Subject: [PATCH] fix if statements, clean up mod directory handling --- scripts/launch-resonite.sh | 9 +++++---- scripts/update-resonite.sh | 22 +++++++++++++++------- 2 files changed, 20 insertions(+), 11 deletions(-) diff --git a/scripts/launch-resonite.sh b/scripts/launch-resonite.sh index 2ff1236..baedf0c 100644 --- a/scripts/launch-resonite.sh +++ b/scripts/launch-resonite.sh @@ -5,8 +5,9 @@ rm -r /home/container/Headless/Cache find /Logs -type f -name *.log -atime +${LOG_RETENTION:-30} -delete cd /home/container/Headless/net8.0 -if [${ENABLE_MODS} = true]; then -dotnet Resonite.dll -HeadlessConfig /Config/${CONFIG_FILE} -Logs /Logs/ -LoadAssembly Libraries/ResoniteModLoader.dll ${ADDITIONAL_ARGUMENTS} + +if [ "${ENABLE_MODS}" = "true" ]; then + dotnet Resonite.dll -HeadlessConfig /Config/${CONFIG_FILE} -Logs /Logs/ -LoadAssembly Libraries/ResoniteModLoader.dll ${ADDITIONAL_ARGUMENTS} else -dotnet Resonite.dll -HeadlessConfig /Config/${CONFIG_FILE} -Logs /Logs/ ${ADDITIONAL_ARGUMENTS} -fi \ No newline at end of file + dotnet Resonite.dll -HeadlessConfig /Config/${CONFIG_FILE} -Logs /Logs/ ${ADDITIONAL_ARGUMENTS} +fi diff --git a/scripts/update-resonite.sh b/scripts/update-resonite.sh index 2918848..0390f7d 100644 --- a/scripts/update-resonite.sh +++ b/scripts/update-resonite.sh @@ -1,18 +1,26 @@ #!/bin/sh +HEADLESS_DIRECTORY="/home/container/Headless/net8.0" + /home/container/steamcmd/steamcmd.sh +login ${STEAM_USER} ${STEAM_PASS} +force_install_dir /home/container +app_update 2519830 -beta ${STEAM_BRANCH} -betapassword ${BETA_CODE} +quit # Fix for issue with NVR.json migrations exploding ln -sf /home/container/Migrations /home/container/Headless/Migrations #Mod installation if ENABLE_MODS is true. Heavily inspired and pulled from work by Spex. Thank you -if [${ENABLE_MODS} = true]; then - cd /home/container/Headless/net8.0 - mkdir rml_libs rml_mods rml_config Libraries - #Copy Mods and associated files from RML volume - cp -a /RML/rml_mods/. rml_mods/ - cp -a /RML/rml_libs/. rml_libs/ - cp -a /RML/rml_config/. rml/config/ +if [ "${ENABLE_MODS}" = "true" ]; then + + # Create Libraries directory for RML to live in + mkdir -p ${HEADLESS_DIRECTORY}/Libraries + + # Create RML directories on RML volume, mods and config will be stored in here. + mkdir -p /RML/rml_mods /RML/rml_libs /RML/rml_config + + # Symlink rml_mods, rml_libs and rml_config to where Resonite will read them. + ln -sf /RML/rml_mods ${HEADLESS_DIRECTORY}/rml_mods + ln -sf /RML/rml_libs ${HEADLESS_DIRECTORY}/rml_libs + ln -sf /RML/rml_config ${HEADLESS_DIRECTORY}/rml_config + # From: https://gist.github.com/steinwaywhw/a4cd19cda655b8249d908261a62687f8?permalink_comment_id=5097031#gistcomment-5097031 # Fetch the latest release version number for ResoniteModLoader latest_version=$(curl -s https://api.github.com/repos/resonite-modding-group/ResoniteModLoader/releases/latest | grep -oP '"tag_name": "\K(.*)(?=")')