A generic service to pull FTB modpacks from api.feed-the-beast.com. There are 2 ways to install a server through this service. The first method only requires you to know the modpacks name and (optionally) version. The second method requires you to know the id for the modpack and (optionally) version in the api.
https://api.feed-the-beast.com/v1/modpacks/public/modpack/5
https://api.feed-the-beast.com/v1/modpacks/public/modpack/5/86
NOTE Not all FTB packs come with a server.properties file, due to this the server.properties file may not get updated with the correct ip address and port at first launch. Please restart the server after first launch to fix this.
If you have trouble using an neoforge pack, make sure to select the latest java.
The minecraft server requires a single port for access (default 25565) but plugins may require extra ports to enabled for the server.
Port | default |
---|---|
Game | 25565 |
Name | Tag |
---|---|
ghcr.io/ptero-eggs/yolks:java_8 | ghcr.io/ptero-eggs/yolks:java_8 |
Name | Description | Environment Variable | Default Value | User Viewable | User Editable |
---|---|---|---|---|---|
Modpack URL Name | Name of the modpack as referenced in URL's on feed-the-beast.com i.e https://www.feed-the-beast.com/projects/<MODPACK_URL> | MODPACK_URL | Yes | Yes | |
Modpack Version | Version of the modpack to use. | MODPACK_VERSION | latest | Yes | Yes |
Level Seed | Optional specified level seed for map generation | LEVEL_SEED | Yes | Yes | |
Max Players | Max # of players on the server | MAX_PLAYERS | 20 | Yes | Yes |
Level Name | Name of the world save | LEVEL_NAME | world | Yes | Yes |
MOTD | Message to appear when viewing the server in browser and on login | MOTD | A Minecraft Server | Yes | Yes |
#!/bin/ash
# Generic FTB Server Installation Script
#
# Server Files: /mnt/server
# MODPACK_VERSION = version of the modpack, set in variables
# i.e MODPACK_VERSION=1.5.0
# MODPACK_URL = url base of the pack, set in variables, hardcoded
# i.e https://www.feed-the-beast.com/projects/ftb-revelation/files
# MODPACK_URL=ftb-revelation
## Correcting for bad variables
GETPACK=$(echo ${MODPACK_URL} | cut -d "/" -f 5 )
echo -e "\n The pack being downloaded is $GETPACK \n"
## Getting the Base URL
BASEURL=https://www.feed-the-beast.com/projects/${GETPACK}/files
echo "The base URL is ${BASEURL}"
## This is meant to get the pack ID that is unique and not exactly clear
if [ -z "${MODPACK_VERSION}" ] || [ "${MODPACK_VERSION}" == "latest" ]; then
ID=`curl -sl ${BASEURL} | grep -i -A9 'title="release"' | grep -i -o 'href=".*"' | cut -d "/" -f5 | sed s/\"//g`
echo "ID: ${ID}"
else
ID=`curl -sl ${BASEURL} | grep -i -A9 "${MODPACK_VERSION}" | grep -m1 -oE 'href="[^\"]+"' | cut -d "/" -f5 | grep -oE [0-9]+`
echo "ID: ${ID}"
fi
SECONDURL=${BASEURL}/${ID}
echo "SECONDURL: ${SECONDURL}"
GOOD_ID=`curl -sl ${SECONDURL} | grep -i server | grep -Eo 'href="[^\"]+"' | grep -o -E "[0-9]+" | tail -1`
echo "GOOD_ID: ${GOOD_ID}"
DL_URL=${BASEURL}/${GOOD_ID}/download
echo "Download_URL: ${DL_URL}"
cd /mnt/server
echo "Executing curl -L ${DL_URL} -o $GETPACK.zip"
curl -L ${DL_URL} -o $GETPACK.zip
unzip ${GETPACK}.zip
rm -rf ${GETPACK}.zip
echo "Running FTBInstall.sh"
if [ -f ./FTBInstall.sh ]; then
sh ./FTBInstall.sh
else
echo -e "No FTBInstall script found. Assumeing it's not needed."
fi
## install end
echo "-----------------------------------------"
echo "Installation completed..."
echo "-----------------------------------------"