From 396d202d9fbf5a954978af97fb1dda994eeecdd3 Mon Sep 17 00:00:00 2001 From: Geoff Bourne Date: Sat, 29 Jul 2023 20:09:54 -0500 Subject: [PATCH] ftb: added FTB_FORCE_REINSTALL (#2305) --- docs/types-and-platforms/mod-platforms/ftb.md | 2 ++ scripts/start-deployFTBA | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/docs/types-and-platforms/mod-platforms/ftb.md b/docs/types-and-platforms/mod-platforms/ftb.md index 15cdbe40..31368df6 100644 --- a/docs/types-and-platforms/mod-platforms/ftb.md +++ b/docs/types-and-platforms/mod-platforms/ftb.md @@ -19,6 +19,8 @@ This mod platform type will automatically take care of downloading and installin ``` - `FTB_MODPACK_VERSION_ID`: optional, the numerical ID of the version to install. If not specified, the latest version will be installed. The "Version ID" can be obtained by hovering over a server file entry and grabbing [this ID in the URL](../../img/ftba-version-id-popup.png). +- `FTB_FORCE_REINSTALL`: if the files become inconsistent, such as when accidentally removing them, the FTB can be forced to re-run by setting this to "true" + ### Upgrading If a specific `FTB_MODPACK_VERSION_ID` was not specified, simply restart the container to pick up the newest modpack version. If using a specific version ID, recreate the container with the new version ID. diff --git a/scripts/start-deployFTBA b/scripts/start-deployFTBA index 8275cb88..57309b4d 100755 --- a/scripts/start-deployFTBA +++ b/scripts/start-deployFTBA @@ -1,5 +1,7 @@ #!/bin/bash +: "${FTB_FORCE_REINSTALL:=false}" + ftbInstallMarker=".ftb-installed" # shellcheck source=start-utils @@ -32,7 +34,7 @@ elif ! [[ ${FTB_MODPACK_VERSION_ID} =~ [0-9]+ ]]; then exit 1 fi -if ! [ -f "${ftbInstallMarker}" ] || [ "$(cat "${ftbInstallMarker}")" != "${FTB_MODPACK_ID}=${FTB_MODPACK_VERSION_ID}" ]; then +if isTrue "$FTB_FORCE_REINSTALL" || ! [ -f "${ftbInstallMarker}" ] || [ "$(cat "${ftbInstallMarker}")" != "${FTB_MODPACK_ID}=${FTB_MODPACK_VERSION_ID}" ]; then ftbInstaller=/data/ftb-installer if ! [[ -f "${ftbInstaller}" ]]; then log "Downloading FTB installer"