mirror of
https://github.com/parkervcp/eggs.git
synced 2025-01-23 16:42:52 +08:00
72 lines
19 KiB
JSON
72 lines
19 KiB
JSON
{
|
|
"_comment": "DO NOT EDIT: FILE GENERATED AUTOMATICALLY BY PTERODACTYL PANEL - PTERODACTYL.IO",
|
|
"meta": {
|
|
"version": "PTDL_v2",
|
|
"update_url": null
|
|
},
|
|
"exported_at": "2023-09-03T21:29:07-07:00",
|
|
"name": "CurseForge Generic",
|
|
"author": "contact@chromozone.dev",
|
|
"description": "A generic egg for a CurseForge modpack.",
|
|
"features": [
|
|
"eula",
|
|
"java_version",
|
|
"pid_limit"
|
|
],
|
|
"docker_images": {
|
|
"Java 8": "ghcr.io\/pterodactyl\/yolks:java_8",
|
|
"Java 11": "ghcr.io\/pterodactyl\/yolks:java_11",
|
|
"Java 16": "ghcr.io\/pterodactyl\/yolks:java_16",
|
|
"Java 17": "ghcr.io\/pterodactyl\/yolks:java_17",
|
|
"Java 18": "ghcr.io\/pterodactyl\/yolks:java_18",
|
|
"Java 19": "ghcr.io\/pterodactyl\/yolks:java_19"
|
|
},
|
|
"file_denylist": [],
|
|
"startup": "java $([[ -f user_jvm_args.txt ]] && printf %s \"@user_jvm_args.txt\") -Xms128M -Xmx{{SERVER_MEMORY}}M -Dterminal.jline=false -Dterminal.ansi=true $([[ ! -f unix_args.txt ]] && printf %s \"-jar `cat .serverjar`\" || printf %s \"@unix_args.txt\")",
|
|
"config": {
|
|
"files": "{\r\n \"server.properties\": {\r\n \"parser\": \"properties\",\r\n \"find\": {\r\n \"server-ip\": \"0.0.0.0\",\r\n \"server-port\": \"{{server.build.default.port}}\",\r\n \"query.port\": \"{{server.build.default.port}}\"\r\n }\r\n }\r\n}",
|
|
"startup": "{\r\n \"done\": \")! For help, type \"\r\n}",
|
|
"logs": "{}",
|
|
"stop": "stop"
|
|
},
|
|
"scripts": {
|
|
"installation": {
|
|
"script": "#!\/bin\/bash\r\n# shellcheck disable=SC2155\r\n#\r\n# CurseForge Installation Script\r\n#\r\n# Server Files: \/mnt\/server\r\n: \"${SERVER_DIR:=\/mnt\/server}\"\r\n: \"${PROJECT_ID:=}\"\r\n: \"${VERSION_ID:=}\"\r\n: \"${API_KEY:=}\"\r\nif [[ ! -d $SERVER_DIR ]]; then\r\nmkdir -p \"$SERVER_DIR\"\r\nfi\r\nif ! cd \"$SERVER_DIR\"; then\r\necho -e \"Failed to change directory to ${SERVER_DIR}\"\r\nexit 1\r\nfi\r\nfunction install_required {\r\necho -e \"Installing required packages...\"\r\necho -e \"\\tRunning apt update\"\r\napt update > \/dev\/null 2>&1 || { echo \"apt update failed!\"; exit 1; }\r\necho -e \"\\tRunning apt install\"\r\napt install -y wget jq unzip > \/dev\/null 2>&1 || { echo \"apt install failed!\"; exit 1; }\r\n}\r\nCURSEFORGE_API_URL=\"https:\/\/api.curseforge.com\/v1\/mods\/\"\r\nCURSEFORGE_API_HEADERS=(\"--header=Accept: application\/json\" \"--header=x-api-key: ${API_KEY}\")\r\nfunction get_download {\r\necho -e \"Retrieving CurseForge project information...\"\r\nlocal PROJECT_DATA=$(wget -q \"${CURSEFORGE_API_HEADERS[@]}\" \"${CURSEFORGE_API_URL}${PROJECT_ID}\" -O -)\r\nlocal PROJECT_TITLE=$(echo \"$PROJECT_DATA\" | jq -r '.data.name \/\/ empty')\r\nif [[ -z \"${PROJECT_DATA}\" ]]; then\r\necho -e \"\\tERROR: Failed to retrieve project data for project id '${PROJECT_ID}'\"\r\nexit 1\r\nfi\r\nlocal IS_SERVER_PACK=false\r\nif [[ -z \"${VERSION_ID}\" || \"${VERSION_ID}\" == \"latest\" ]]; then\r\necho -e \"\\tNo file ID specified, using latest file\"\r\nVERSION_ID=$(echo \"$PROJECT_DATA\" | jq -r '.data.mainFileId \/\/ empty')\r\nlocal VERSION_SERVER_PACK=\"$(echo -e \"${PROJECT_DATA}\" | jq -r --arg VERSION_ID \"$VERSION_ID\" '.data.latestFiles[] | select(.id|tostring==$VERSION_ID) | .isServerPack')\"\r\nlocal VERSION_SERVER_ID=\"$(echo -e \"${PROJECT_DATA}\" | jq -r --arg VERSION_ID \"$VERSION_ID\" '.data.latestFiles[] | select(.id|tostring==$VERSION_ID) | .serverPackFileId')\"\r\nif [[ \"${VERSION_SERVER_PACK}\" == \"false\" && -n \"${VERSION_SERVER_ID}\" ]]; then\r\necho -e \"\\tFound server pack file id '${VERSION_SERVER_ID}'\"\r\nVERSION_ID=$VERSION_SERVER_ID\r\nIS_SERVER_PACK=true\r\nelif [[ \"${VERSION_SERVER_PACK}\" == \"true\" ]]; then\r\nIS_SERVER_PACK=true\r\nfi\r\nelse\r\necho -e \"\\tChecking if provided file id '${VERSION_ID}' exists\"\r\nlocal FILE_DATA=$(wget -q \"${CURSEFORGE_API_HEADERS[@]}\" \"${CURSEFORGE_API_URL}${PROJECT_ID}\/files\/${VERSION_ID}\" -O -)\r\nif [[ -z \"${FILE_DATA}\" ]]; then\r\necho -e \"\\tERROR: File id '${VERSION_ID}' not found for project '${PROJECT_TITLE}'\"\r\nexit 1\r\nfi\r\nIS_SERVER_PACK=$(echo -e \"${FILE_DATA}\" | jq -r '.data.isServerPack \/\/ \"false\"')\r\nif [[ \"${IS_SERVER_PACK}\" == \"false\" ]]; then\r\nlocal VERSION_SERVER_PACK=\"$(echo -e \"${FILE_DATA}\" | jq -r '.data.serverPackFileId \/\/ empty')\"\r\nif [[ -n \"${VERSION_SERVER_PACK}\" ]]; then\r\necho -e \"\\tFound server pack file id '${VERSION_SERVER_PACK}'\"\r\nVERSION_ID=$VERSION_SERVER_PACK\r\nIS_SERVER_PACK=true\r\nfi\r\nelse\r\nIS_SERVER_PACK=true\r\nfi\r\nfi\r\n# Check if version id is unset or empty string\r\nif [[ -z \"${VERSION_ID}\" ]]; then\r\necho -e \"\\tERROR: No file id found for project '${PROJECT_TITLE}'\"\r\nexit 1\r\nfi\r\nif [[ \"${IS_SERVER_PACK}\" == \"false\" ]]; then\r\necho -e \"\\tWARNING: File id '${VERSION_ID}' is not a server pack, attempting to use client files\"\r\nfi\r\n# get json data to work with\r\necho -e \"\\tRetrieving version information for '${VERSION_ID}'\"\r\nlocal JSON_DATA=$(wget -q \"${CURSEFORGE_API_HEADERS[@]}\" \"${CURSEFORGE_API_URL}${PROJECT_ID}\/files\/${VERSION_ID}\/download-url\" -O -)\r\nif [[ -z \"${JSON_DATA}\" ]]; then\r\necho -e \"\\tERROR: Failed to retrieve file data for file id '${VERSION_ID}'\"\r\nexit 1\r\nfi\r\necho -e \"\\tParsing CurseForge pack download url\"\r\nlocal DOWNLOAD_URL=$(echo -e \"$JSON_DATA\" | jq -r '.data \/\/ empty')\r\nif [[ -z \"${DOWNLOAD_URL}\" ]]; then\r\necho -e \"\\tERROR: No download url found for file ${VERSION_ID}\"\r\nexit 1\r\nfi\r\n# download modpack files\r\necho -e \"\\tDownloading ${DOWNLOAD_URL}\"\r\nif ! wget -q \"${DOWNLOAD_URL}\" -O server.zip; then\r\necho -e \"Download failed!\"\r\nexit 1\r\nfi\r\n}\r\nfunction get_loader {\r\necho -e \"Retrieving loader information...\"\r\nlocal PROJECT_DATA=$(wget -q \"${CURSEFORGE_API_HEADERS[@]}\" \"${CURSEFORGE_API_URL}${PROJECT_ID}\" -O -)\r\nlocal PROJECT_TITLE=$(echo -E \"$PROJECT_DATA\" | jq -r '.data.name \/\/ empty')\r\nif [[ -z \"${PROJECT_DATA}\" ]]; then\r\necho -e \"\\tERROR: Failed to retrieve project data for project id '${PROJECT_ID}'\"\r\nexit 1\r\nfi\r\nlocal FILE_DATA=$(wget -q \"${CURSEFORGE_API_HEADERS[@]}\" \"${CURSEFORGE_API_URL}${PROJECT_ID}\/files\/${VERSION_ID}\" -O -)\r\nif [[ -z \"${FILE_DATA}\" ]]; then\r\necho -e \"\\tERROR: File id '${VERSION_ID}' not found for project '${PROJECT_TITLE}'\"\r\nexit 1\r\nfi\r\nlocal IS_SERVER_PACK=$(echo -E \"${FILE_DATA}\" | jq -r '.data.isServerPack \/\/ \"false\"')\r\nlocal CLIENT_VERSION_ID;\r\nif [[ \"${IS_SERVER_PACK}\" == \"true\" ]]; then\r\nCLIENT_VERSION_ID=\"$(echo -E \"${FILE_DATA}\" | jq -r '.data.parentProjectFileId \/\/ empty')\"\r\nelse\r\nCLIENT_VERSION_ID=$VERSION_ID\r\nfi\r\nif [[ -z \"${CLIENT_VERSION_ID}\" ]]; then\r\necho -e \"\\tERROR: File id '${VERSION_ID}' not found for project '${PROJECT_TITLE}'\"\r\nexit 1\r\nfi\r\necho -e \"\\tRetrieving file information for '${CLIENT_VERSION_ID}'\"\r\nlocal JSON_DATA=$(wget -q \"${CURSEFORGE_API_HEADERS[@]}\" \"${CURSEFORGE_API_URL}${PROJECT_ID}\/files\/${CLIENT_VERSION_ID}\/download-url\" -O -)\r\necho -e \"\\tParsing CurseForge pack download url\"\r\nlocal DOWNLOAD_URL=$(echo -E \"$JSON_DATA\" | jq -r '.data \/\/ empty')\r\nif [[ -z \"${DOWNLOAD_URL}\" ]]; then\r\necho -e \"\\tERROR: No download url found for file id ${CLIENT_VERSION_ID}\"\r\nexit 1\r\nfi\r\n# download modpack files\r\necho -e \"\\tDownloading ${DOWNLOAD_URL}\"\r\nwget -q \"${DOWNLOAD_URL}\" -O client.zip\r\necho -e \"\\tUnpacking client manifest\"\r\nunzip -jqo client.zip manifest.json -d \"${SERVER_DIR}\"\r\nif [[ ! -f \"${SERVER_DIR}\/manifest.json\" ]]; then\r\necho -e \"\\tERROR: Failed to unpack client manifest from client.zip\"\r\nexit 1\r\nfi\r\nmv \"${SERVER_DIR}\/manifest.json\" \"${SERVER_DIR}\/client.manifest.json\" # rename to avoid conflicts with main manifest\r\nrm -rf client.zip\r\necho -e \"\\tParsing client manifest\"\r\nlocal MANIFEST=\"${SERVER_DIR}\/client.manifest.json\"\r\nLOADER_ID=$(jq -r '.minecraft.modLoaders[]? | select(.primary == true) | .id' \"${MANIFEST}\")\r\nLOADER_NAME=$(echo \"${LOADER_ID}\" | cut -d'-' -f1)\r\nLOADER_VERSION=$(echo \"${LOADER_ID}\" | cut -d'-' -f2)\r\nif [[ -z \"${LOADER_NAME}\" || -z \"${LOADER_VERSION}\" ]]; then\r\necho -e \"\\tERROR: No loader found in client manifest!\"\r\nexit 1\r\nfi\r\nMINECRAFT_VERSION=$(jq -r '.minecraft.version \/\/ empty' \"${MANIFEST}\")\r\nif [[ -z \"${MINECRAFT_VERSION}\" ]]; then\r\necho -e \"\\tERROR: No minecraft version found in client manifest!\"\r\nexit 1\r\nfi\r\necho -e \"\\tFound loader ${LOADER_NAME} ${LOADER_VERSION} for Minecraft ${MINECRAFT_VERSION}\"\r\n}\r\nfunction unzip-strip() (\r\nset -u\r\nlocal archive=$1\r\nlocal destdir=${2:-}\r\nshift; shift || :\r\necho -e \"\\tUnpacking ${archive} to ${destdir}\"\r\necho -e \"\\tCreating temporary directory\"\r\nlocal tmpdir=\/mnt\/server\/tmp\r\nif ! mkdir -p \"${tmpdir}\"; then\r\necho -e \"\\tERROR: mkdir failed to create temporary directory\"\r\nreturn 1\r\nfi\r\ntrap 'rm -rf -- \"$tmpdir\"' EXIT\r\necho -e \"\\tUnpacking archive\"\r\nif ! unzip -q \"$archive\" -d \"$tmpdir\"; then\r\necho -e \"\\tERROR: unzip failed to unpack archive\"\r\nreturn 1\r\nfi\r\necho -e \"\\tSetting glob settings\"\r\nshopt -s dotglob\r\necho -e \"\\tCleaning up directory structure\"\r\nlocal files=(\"$tmpdir\"\/*) name i=1\r\nif (( ${#files[@]} == 1 )) && [[ -d \"${files[0]}\" ]]; then\r\nname=$(basename \"${files[0]}\")\r\nfiles=(\"$tmpdir\"\/*\/*)\r\nelse\r\nname=$(basename \"$archive\"); name=${archive%.*}\r\nfiles=(\"$tmpdir\"\/*)\r\nfi\r\nif [[ -z \"$destdir\" ]]; then\r\ndestdir=.\/\"$name\"\r\nfi\r\nwhile [[ -f \"$destdir\" ]]; do\r\ndestdir=${destdir}-$((i++));\r\ndone\r\necho -e \"\\tCopying files to ${destdir}\"\r\nmkdir -p \"$destdir\"\r\ncp -ar \"$@\" -t \"$destdir\" -- \"${files[@]}\"\r\nrm -rf \"$tmpdir\"\r\n)\r\nfunction unpack_zip {\r\necho -e \"Unpacking server files...\"\r\nunzip-strip server.zip \"${SERVER_DIR}\"\r\nrm -rf server.zip\r\n}\r\nfunction download_mods {\r\necho \"Downloading mods...\"\r\nlocal MANIFEST=\"${SERVER_DIR}\/manifest.json\"\r\njq -c '.files[]? | select(.required == true) | {project: .projectID, file: .fileID}' \"${MANIFEST}\" | while read -r mod; do\r\nlocal MOD_PROJECT_ID=$(echo \"${mod}\" | jq -r '.project \/\/ empty')\r\nlocal MOD_FILE_ID=$(echo \"${mod}\" | jq -r '.file \/\/ empty')\r\nif [[ -z \"${MOD_PROJECT_ID}\" || -z \"${MOD_FILE_ID}\" ]]; then\r\necho -e \"\\tERROR: Failed to parse project id or file id for mod '${mod}'\"\r\nexit 1\r\nfi\r\nlocal FILE_URL=$(wget -q \"${CURSEFORGE_API_HEADERS[@]}\" \"${CURSEFORGE_API_URL}${MOD_PROJECT_ID}\/files\/${MOD_FILE_ID}\/download-url\" -O - | jq -r '.data \/\/ empty')\r\nif [[ -z \"${FILE_URL}\" ]]; then\r\necho -e \"\\tERROR: No download url found for mod ${MOD_PROJECT_ID} ${MOD_FILE_ID}\"\r\nexit 1\r\nfi\r\necho -e \"\\tDownloading ${FILE_URL}\"\r\nif ! wget -q \"${FILE_URL}\" -P \"${SERVER_DIR}\/mods\"; then\r\necho -e \"\\tERROR: Failed to download mod ${MOD_PROJECT_ID} ${MOD_FILE_ID}\"\r\nexit 1\r\nfi\r\ndone\r\n}\r\nfunction download_overrides {\r\necho \"Copying overrides...\"\r\nif [[ -d \"${SERVER_DIR}\/overrides\" ]]; then\r\ncp -r \"${SERVER_DIR}\/overrides\/\"* \"${SERVER_DIR}\"\r\nrm -r \"${SERVER_DIR}\/overrides\"\r\nfi\r\n}\r\nFORGE_INSTALLER_URL=\"https:\/\/maven.minecraftforge.net\/net\/minecraftforge\/forge\/\"\r\nfunction download_forge {\r\necho \"Downloading Forge...\"\r\nlocal MC_VERSION=$MINECRAFT_VERSION\r\nlocal FORGE_VERSION=$LOADER_VERSION\r\nFORGE_VERSION=\"${MC_VERSION}-${FORGE_VERSION}\"\r\nif [[ \"${MC_VERSION}\" == \"1.7.10\" || \"${MC_VERSION}\" == \"1.8.9\" ]]; then\r\nFORGE_VERSION=\"${FORGE_VERSION}-${MC_VERSION}\"\r\nfi\r\nlocal FORGE_JAR=\"forge-${FORGE_VERSION}.jar\"\r\nif [[ \"${MC_VERSION}\" == \"1.7.10\" ]]; then\r\nFORGE_JAR=\"forge-${FORGE_VERSION}-universal.jar\"\r\nfi\r\nlocal FORGE_URL=\"${FORGE_INSTALLER_URL}${FORGE_VERSION}\/forge-${FORGE_VERSION}\"\r\necho -e \"\\tUsing Forge ${FORGE_VERSION} from ${FORGE_URL}\"\r\nlocal FORGE_INSTALLER=\"${FORGE_URL}-installer.jar\"\r\necho -e \"\\tDownloading Forge Installer ${FORGE_VERSION} from ${FORGE_INSTALLER}\"\r\nif ! wget -q -O forge-installer.jar \"${FORGE_INSTALLER}\"; then\r\necho -e \"\\tERROR: Failed to download Forge Installer ${FORGE_VERSION}\"\r\nexit 1\r\nfi\r\n# Remove old Forge files so we can safely update\r\nrm -rf libraries\/net\/minecraftforge\/forge\/\r\nrm -f unix_args.txt\r\necho -e \"\\tInstalling Forge Server ${FORGE_VERSION}\"\r\nif ! java -jar forge-installer.jar --installServer > \/dev\/null 2>&1; then\r\necho -e \"\\tERROR: Failed to install Forge Server ${FORGE_VERSION}\"\r\nexit 1\r\nfi\r\nrm -f forge*installer.jar\r\nif [[ $MC_VERSION =~ ^1\\.(17|18|19|20|21|22|23) || $FORGE_VERSION =~ ^1\\.(17|18|19|20|21|22|23) ]]; then\r\necho -e \"\\tDetected Forge 1.17 or newer version. Setting up Forge Unix arguments\"\r\nln -sf libraries\/net\/minecraftforge\/forge\/*\/unix_args.txt unix_args.txt\r\nelse\r\nmv forge-*.jar forge-server-launch.jar\r\necho \"forge-server-launch.jar\" > \".serverjar\"\r\nfi\r\n}\r\nFABRIC_INSTALLER_URL=\"https:\/\/meta.fabricmc.net\/v2\/versions\/installer\"\r\nfunction download_fabric {\r\necho \"Downloading Fabric...\"\r\nlocal MC_VERSION=$MINECRAFT_VERSION\r\nlocal FABRIC_VERSION=$LOADER_VERSION\r\nlocal INSTALLER_JSON=$(wget -q -O - ${FABRIC_INSTALLER_URL} )\r\nlocal INSTALLER_VERSION=$(echo \"$INSTALLER_JSON\" | jq -r '.[0].version \/\/ empty')\r\nlocal INSTALLER_URL=$(echo \"$INSTALLER_JSON\" | jq -r '.[0].url \/\/ empty')\r\nif [[ -z \"${INSTALLER_VERSION}\" ]]; then\r\necho -e \"\\tERROR: No Fabric installer version found\"\r\nexit 1\r\nfi\r\nif [[ -z \"${INSTALLER_URL}\" ]]; then\r\necho -e \"\\tERROR: No Fabric installer url found\"\r\nexit 1\r\nfi\r\necho -e \"\\tDownloading Fabric Installer ${MC_VERSION}-${FABRIC_VERSION} (${INSTALLER_VERSION}) from ${INSTALLER_URL}\"\r\nif ! wget -q -O fabric-installer.jar \"${INSTALLER_URL}\"; then\r\necho -e \"\\tERROR: Failed to download Fabric Installer ${MC_VERSION}-${FABRIC_VERSION} (${INSTALLER_VERSION})\"\r\nexit 1\r\nfi\r\necho -e \"\\tInstalling Fabric Server ${MC_VERSION}-${FABRIC_VERSION} (${INSTALLER_VERSION})\"\r\nif ! java -jar fabric-installer.jar server -mcversion \"${MC_VERSION}\" -loader \"${FABRIC_VERSION}\" -downloadMinecraft; then\r\necho -e \"\\tERROR: Failed to install Fabric Server ${MC_VERSION}-${FABRIC_VERSION} (${INSTALLER_VERSION})\"\r\nexit 1\r\nfi\r\necho \"fabric-server-launch.jar\" > \".serverjar\"\r\nrm -f fabric-installer.jar\r\n}\r\nQUILT_INSTALLER_URL=\"https:\/\/meta.quiltmc.org\/v3\/versions\/installer\"\r\nfunction download_quilt {\r\necho \"Downloading Quilt...\"\r\nlocal MC_VERSION=$MINECRAFT_VERSION\r\nlocal QUILT_VERSION=$LOADER_VERSION\r\nlocal INSTALLER_JSON=$(wget -q -O - ${QUILT_INSTALLER_URL} )\r\nlocal INSTALLER_VERSION=$(echo \"$INSTALLER_JSON\" | jq -r '.[0].version \/\/ empty')\r\nlocal INSTALLER_URL=$(echo \"$INSTALLER_JSON\" | jq -r '.[0].url \/\/ empty')\r\nif [[ -z \"${INSTALLER_VERSION}\" ]]; then\r\necho -e \"\\tERROR: No Quilt installer version found\"\r\nexit 1\r\nfi\r\nif [[ -z \"${INSTALLER_URL}\" ]]; then\r\necho -e \"\\tERROR: No Quilt installer URL found\"\r\nexit 1\r\nfi\r\necho -e \"\\tDownloading Quilt Installer ${MC_VERSION}-${QUILT_VERSION} (${INSTALLER_VERSION}) from ${INSTALLER_URL}\"\r\nif ! wget -q -O quilt-installer.jar \"${INSTALLER_URL}\"; then\r\necho -e \"\\tERROR: Failed to download Quilt Installer ${MC_VERSION}-${QUILT_VERSION} (${INSTALLER_VERSION})\"\r\nexit 1\r\nfi\r\necho -e \"\\tInstalling Quilt Server ${MC_VERSION}-${QUILT_VERSION} (${INSTALLER_VERSION})\"\r\nif ! java -jar quilt-installer.jar install server \"${MC_VERSION}\" \"${QUILT_VERSION}\" --download-server --install-dir=.\/; then\r\necho -e \"\\tERROR: Failed to install Quilt Server ${MC_VERSION}-${QUILT_VERSION} (${INSTALLER_VERSION})\"\r\nexit 1\r\nfi\r\necho \"quilt-server-launch.jar\" > \".serverjar\"\r\nrm quilt-installer.jar\r\n}\r\nSERVERSTARTER_INSTALLER_URL=\"https:\/\/api.github.com\/repos\/TeamAOF\/ServerStarter\/releases\/latest\"\r\nfunction download_serverstarter {\r\necho \"Downloading ServerStarter...\"\r\nlocal SERVERSTARTER_JSON=$(wget -q -O - ${SERVERSTARTER_INSTALLER_URL} )\r\nlocal SERVERSTARTER_URL=$(echo \"$SERVERSTARTER_JSON\" | jq -r '.assets[].browser_download_url | select(contains(\".jar\")) \/\/ empty')\r\nlocal SERVERSTARTER_VERSION=$(echo \"$SERVERSTARTER_JSON\" | jq -r '.tag_name \/\/ empty')\r\nif [[ -z \"${SERVERSTARTER_VERSION}\" ]]; then\r\necho -e \"\\tERROR: No ServerStarter version found\"\r\nexit 1\r\nfi\r\nif [[ -z \"${SERVERSTARTER_URL}\" ]]; then\r\necho -e \"\\tERROR: No ServerStarter URL found\"\r\nexit 1\r\nfi\r\necho -e \"\\tDownloading ServerStarter ${SERVERSTARTER_VERSION} from ${SERVERSTARTER_URL}\"\r\nif ! wget -q -O serverstarter.jar \"${SERVERSTARTER_URL}\"; then\r\necho -e \"\\tERROR: Failed to download ServerStarter\"\r\nexit 1\r\nfi\r\necho \"serverstarter.jar\" > \".serverjar\"\r\n}\r\nfunction main() {\r\ninstall_required\r\nif [[ -z \"${PROJECT_ID}\" ]]; then\r\necho \"ERROR: You must specify a PROJECT_ID environment variable!\"\r\nexit 1\r\nfi\r\nif [[ ! \"${PROJECT_ID}\" = \"zip\" ]]; then\r\nget_download\r\nfi\r\nget_loader\r\nunpack_zip\r\nif [[ -f \"${SERVER_DIR}\/manifest.json\" ]]; then\r\necho \"Found manifest.json, installing mods\"\r\ndownload_mods\r\nfi\r\ndownload_overrides\r\nif [[ -f \"${SERVER_DIR}\/server-setup-config.yaml\" ]]; then\r\ndownload_serverstarter\r\nelif [[ -f \"${SERVER_DIR}\/client.manifest.json\" ]]; then\r\nif [[ $LOADER_NAME == \"forge\" ]]; then\r\ndownload_forge\r\nfi\r\nif [[ $LOADER_NAME == \"fabric\" ]]; then\r\ndownload_fabric\r\nfi\r\nif [[ $LOADER_NAME == \"quilt\" ]]; then\r\ndownload_quilt\r\nfi\r\nfi\r\necho -e \"\\nInstall completed succesfully, enjoy!\"\r\n}\r\nmain",
|
|
"container": "openjdk:17-jdk-slim",
|
|
"entrypoint": "bash"
|
|
}
|
|
},
|
|
"variables": [
|
|
{
|
|
"name": "Modpack Project ID",
|
|
"description": "The modpack project ID from the CurseForge site on the pack page, or 'zip' if installing from an uploaded server.zip file.\r\n\r\nFor example, the project Id of https:\/\/www.curseforge.com\/minecraft\/modpacks\/bofa-mods ID is 375152",
|
|
"env_variable": "PROJECT_ID",
|
|
"default_value": "",
|
|
"user_viewable": true,
|
|
"user_editable": true,
|
|
"rules": "required|string",
|
|
"field_type": "text"
|
|
},
|
|
{
|
|
"name": "Modpack File ID",
|
|
"description": "The file ID belonging to a specific version of a modpack. Can either be the main file or the file ID associated with the server pack.\r\n\r\nIf not provided the script will attempt to retrieve the latest server pack or client pack available.",
|
|
"env_variable": "VERSION_ID",
|
|
"default_value": "latest",
|
|
"user_viewable": true,
|
|
"user_editable": true,
|
|
"rules": "string",
|
|
"field_type": "text"
|
|
},
|
|
{
|
|
"name": "CurseForge API Key",
|
|
"description": "A CurseForge API key is required to use this egg. You can learn how to get an API key here: https:\/\/support.curseforge.com\/en\/support\/solutions\/articles\/9000208346-about-the-curseforge-api-and-how-to-apply-for-a-key",
|
|
"env_variable": "API_KEY",
|
|
"default_value": "",
|
|
"user_viewable": true,
|
|
"user_editable": true,
|
|
"rules": "required|string|max:60",
|
|
"field_type": "text"
|
|
}
|
|
]
|
|
}
|