1
1
#! /bin/bash
2
2
3
3
: " ${FTB_FORCE_REINSTALL:= false} "
4
+ : " ${FTB_BASE_URL:= https:// api.feed-the-beast.com/ v1/ modpacks} "
5
+ # Legacy base URL was https://api.modpacks.ch
4
6
5
7
ftbInstallMarker=" .ftb-installed"
6
8
@@ -29,7 +31,7 @@ if ! [[ ${FTB_MODPACK_ID} =~ [0-9]+ ]]; then
29
31
fi
30
32
31
33
if [[ ! $FTB_MODPACK_VERSION_ID ]]; then
32
- if ! FTB_MODPACK_VERSION_ID=$( curl -fsSL https://api.modpacks.ch/ public/modpack/${FTB_MODPACK_ID} | jq -r ' .versions | sort_by(.updated)[-1].id' ) ; then
34
+ if ! FTB_MODPACK_VERSION_ID=$( curl -fsSL " ${FTB_BASE_URL} / public/modpack/${FTB_MODPACK_ID} " | jq -r ' .versions | sort_by(.updated)[-1].id' ) ; then
33
35
logError " Unable to resolve latest modpack version ID for modpack ${FTB_MODPACK_ID} "
34
36
exit 1
35
37
fi
@@ -42,14 +44,19 @@ if isTrue "$FTB_FORCE_REINSTALL" || ! [ -f "${ftbInstallMarker}" ] || [ "$(cat "
42
44
ftbInstaller=/data/ftb-installer
43
45
arm=
44
46
if ! [[ -f " ${ftbInstaller} " ]]; then
45
- log " Downloading FTB installer"
46
47
if [ " $( uname -m) " == " aarch64" ]; then
47
- log " Downloading ARM installer"
48
+ log " Downloading FTB installer for ARM "
48
49
arm=" /arm"
49
50
else
50
- log " Downloading x86 installer"
51
+ log " Downloading FTB installer for x86"
52
+ fi
53
+ # Example: https://api.feed-the-beast.com/v1/modpacks/public/modpack/119/12252/server/linux
54
+ # https://api.feed-the-beast.com/v1/modpacks/public/modpack/119/12252/server/arm/linux
55
+ # 1-1 is a placeholder modpack for just grabbing the installer
56
+ if ! get -o " ${ftbInstaller} " " ${FTB_BASE_URL} /public/modpack/1/1/server${arm} /linux" ; then
57
+ logError " Failed to download FTB installer"
58
+ exit 1
51
59
fi
52
- curl -fsSL https://api.modpacks.ch/public/modpack/1/1/server${arm} /linux -o " ${ftbInstaller} "
53
60
chmod +x " ${ftbInstaller} "
54
61
fi
55
62
0 commit comments