2020-04-21 23:30:48 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
2022-01-29 20:53:34 +00:00
|
|
|
# shellcheck source=start-utils
|
|
|
|
. "${SCRIPTS:-/}start-utils"
|
2021-07-27 00:32:26 +00:00
|
|
|
isDebugging && set -x
|
|
|
|
|
2023-06-23 17:47:23 +00:00
|
|
|
: "${MAGMA_VERSION:=}"
|
|
|
|
|
2023-06-17 18:00:22 +00:00
|
|
|
resolveVersion
|
2021-07-31 14:24:38 +00:00
|
|
|
|
2023-06-23 17:47:23 +00:00
|
|
|
if ! downloadUrl=$(get --json-path '$.link' "https://api.magmafoundation.org/api/v2/${VERSION}/latest/${MAGMA_VERSION}"); then
|
2023-06-17 18:00:22 +00:00
|
|
|
log "ERROR failed to locate latest Magma download for ${VERSION}. Is that version supported?"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [[ $downloadUrl == null ]]; then
|
|
|
|
log "ERROR Magma does not seem to be available for $VERSION"
|
2020-04-21 23:30:48 +00:00
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2022-07-21 02:14:38 +00:00
|
|
|
if ! SERVER=$(get --output-filename --skip-up-to-date --output /data "$downloadUrl"); then
|
|
|
|
log "ERROR: failed to download Magma server jar from $downloadUrl"
|
|
|
|
exit 1
|
2021-07-31 14:24:38 +00:00
|
|
|
fi
|
2020-04-21 23:30:48 +00:00
|
|
|
|
2022-07-21 02:14:38 +00:00
|
|
|
export SERVER
|
2021-12-11 02:50:40 +00:00
|
|
|
export FAMILY=HYBRID
|
2022-01-29 20:53:34 +00:00
|
|
|
|
|
|
|
exec "${SCRIPTS:-/}start-setupWorld" "$@"
|