2023-01-09 01:15:24 +00:00
|
|
|
#!/bin/bash
|
|
|
|
set -eu
|
|
|
|
|
|
|
|
# shellcheck source=start-utils
|
|
|
|
. "${SCRIPTS:-/}start-utils"
|
|
|
|
|
|
|
|
: "${CF_PAGE_URL:=}"
|
|
|
|
: "${CF_SLUG:=}"
|
|
|
|
: "${CF_FILE_ID:=}"
|
|
|
|
: "${CF_FILENAME_MATCHER:=}"
|
2023-01-13 00:59:12 +00:00
|
|
|
: "${CF_PARALLEL_DOWNLOADS:=4}"
|
|
|
|
: "${CF_FORCE_SYNCHRONIZE:=false}"
|
2023-03-20 01:00:01 +00:00
|
|
|
: "${CF_EXCLUDE_INCLUDE_FILE=https://raw.githubusercontent.com/itzg/docker-minecraft-server/master/files/cf-exclude-include.json}"
|
2023-01-14 18:52:35 +00:00
|
|
|
: "${CF_EXCLUDE_MODS:=}"
|
|
|
|
: "${CF_FORCE_INCLUDE_MODS:=}"
|
2023-01-26 19:46:48 +00:00
|
|
|
: "${CF_SET_LEVEL_FROM:=}" # --set-level-from
|
|
|
|
: "${CF_OVERRIDES_SKIP_EXISTING:=false}" # --overrides-skip-existing
|
2023-04-30 01:30:59 +00:00
|
|
|
: "${CF_DOWNLOADS_REPO=$([ -d /downloads ] && echo '/downloads' || echo '')}"
|
2023-05-01 02:25:07 +00:00
|
|
|
: "${CF_MODPACK_MANIFEST:=}"
|
2023-01-09 01:15:24 +00:00
|
|
|
|
|
|
|
resultsFile=/data/.install-curseforge.env
|
|
|
|
|
|
|
|
isDebugging && set -x
|
|
|
|
|
|
|
|
args=(
|
|
|
|
--results-file="$resultsFile"
|
|
|
|
)
|
|
|
|
if [[ $CF_PAGE_URL ]]; then
|
|
|
|
args+=(--modpack-page-url="$CF_PAGE_URL")
|
|
|
|
fi
|
|
|
|
if [[ $CF_FILE_ID ]]; then
|
|
|
|
args+=(--file-id="$CF_FILE_ID")
|
|
|
|
fi
|
|
|
|
if [[ $CF_SLUG ]]; then
|
|
|
|
args+=(--slug="$CF_SLUG")
|
|
|
|
fi
|
2023-05-01 02:25:07 +00:00
|
|
|
if [[ $CF_MODPACK_MANIFEST ]]; then
|
|
|
|
args+=(--modpack-manifest="$CF_MODPACK_MANIFEST")
|
|
|
|
fi
|
2023-01-09 01:15:24 +00:00
|
|
|
if [[ $CF_FILENAME_MATCHER ]]; then
|
|
|
|
args+=(--filename-matcher="$CF_FILENAME_MATCHER")
|
|
|
|
fi
|
2023-01-26 19:46:48 +00:00
|
|
|
if [[ ${CF_SET_LEVEL_FROM} ]]; then
|
|
|
|
args+=(--set-level-from="$CF_SET_LEVEL_FROM")
|
|
|
|
fi
|
2023-01-13 00:59:12 +00:00
|
|
|
args+=(
|
|
|
|
--force-synchronize="$CF_FORCE_SYNCHRONIZE"
|
2023-01-26 19:46:48 +00:00
|
|
|
--overrides-skip-existing="$CF_OVERRIDES_SKIP_EXISTING"
|
2023-01-13 00:59:12 +00:00
|
|
|
)
|
2023-01-09 01:15:24 +00:00
|
|
|
|
2023-03-20 01:00:01 +00:00
|
|
|
if [[ $CF_EXCLUDE_MODS ]]; then
|
|
|
|
args+=( --exclude-mods="$CF_EXCLUDE_MODS" )
|
|
|
|
fi
|
|
|
|
if [[ $CF_FORCE_INCLUDE_MODS ]]; then
|
|
|
|
args+=( --force-include-mods="$CF_FORCE_INCLUDE_MODS" )
|
|
|
|
fi
|
|
|
|
if [[ $CF_EXCLUDE_INCLUDE_FILE ]]; then
|
|
|
|
args+=( --exclude-include-file="$CF_EXCLUDE_INCLUDE_FILE" )
|
2023-01-14 18:52:35 +00:00
|
|
|
fi
|
2023-04-30 01:30:59 +00:00
|
|
|
if [[ $CF_DOWNLOADS_REPO ]]; then
|
|
|
|
args+=( --downloads-repo="$CF_DOWNLOADS_REPO" )
|
|
|
|
fi
|
2023-01-13 02:37:20 +00:00
|
|
|
|
2023-01-09 01:15:24 +00:00
|
|
|
if ! mc-image-helper install-curseforge "${args[@]}"; then
|
|
|
|
log "ERROR failed to auto-install CurseForge modpack"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2023-06-17 18:00:22 +00:00
|
|
|
# grab SERVER, TYPE, VERSION and export it
|
2023-01-09 01:15:24 +00:00
|
|
|
set -a
|
|
|
|
# shellcheck disable=SC1090
|
|
|
|
source "${resultsFile}"
|
|
|
|
set +a
|
2023-06-17 18:00:22 +00:00
|
|
|
resolveFamily
|
2023-01-09 01:15:24 +00:00
|
|
|
|
|
|
|
exec "${SCRIPTS:-/}start-setupWorld" "$@"
|