mirror of
https://github.com/itzg/docker-minecraft-server
synced 2024-12-13 22:02:28 +00:00
Added support for upgrading with USE_MODPACK_START_SCRIPT=false
This commit is contained in:
parent
06cffd9e15
commit
8b6ee91ec1
1 changed files with 29 additions and 10 deletions
|
@ -19,6 +19,22 @@ if ! isTrue ${USE_MODPACK_START_SCRIPT:-true}; then
|
|||
exit 2
|
||||
fi
|
||||
|
||||
needsInstall=true
|
||||
installMarker=/data/.curseforge-installed
|
||||
if [ -f $installMarker ]; then
|
||||
if [ "$(cat $installMarker)" != "${FTB_SERVER_MOD}" ]; then
|
||||
log "Upgrading modpack"
|
||||
|
||||
serverJar=$(find ${FTB_BASE_DIR} -not -name "forge*installer.jar" -name "forge*.jar")
|
||||
if [[ "${serverJar}" ]]; then
|
||||
rm -rf $(dirname "${serverJar}")/{mods,*.jar,libraries,resources,scripts}
|
||||
fi
|
||||
else
|
||||
needsInstall=false
|
||||
fi
|
||||
fi
|
||||
|
||||
if $needsInstall; then
|
||||
log "Unpacking FTB server modpack ${FTB_SERVER_MOD} ..."
|
||||
mkdir -p ${FTB_BASE_DIR}
|
||||
unzip -o ${FTB_SERVER_MOD} -d ${FTB_BASE_DIR} | awk '{printf "."} END {print ""}'
|
||||
|
@ -33,6 +49,9 @@ if ! isTrue ${USE_MODPACK_START_SCRIPT:-true}; then
|
|||
log "Installing forge server"
|
||||
(cd $(dirname "${forgeInstallerJar}"); java -jar $(basename ${forgeInstallerJar}) --installServer) | awk '{printf "."} END {print ""}'
|
||||
|
||||
echo "${FTB_SERVER_MOD}" > $installMarker
|
||||
fi
|
||||
|
||||
export SERVER=$(find ${FTB_BASE_DIR} -not -name "forge*installer.jar" -name "forge*.jar")
|
||||
if [[ -z "${SERVER}" || ! -f "${SERVER}" ]]; then
|
||||
log "ERROR unable to locate installed forge server jar"
|
||||
|
|
Loading…
Reference in a new issue