1
0
mirror of https://github.com/parkervcp/eggs.git synced 2024-10-07 08:07:09 +02:00

updated generic FTB

Fixed the variable matching to no cause issues on the panel.

Also changed the install script to work for all FTB linked packs.

It is known that curseforge links do not work.
This commit is contained in:
Michael (Parker) Parker 2018-03-23 11:16:37 -04:00
parent f2de112ec7
commit f889e70aac

View File

@ -3,7 +3,7 @@
"meta": { "meta": {
"version": "PTDL_v1" "version": "PTDL_v1"
}, },
"exported_at": "2018-02-27T11:41:14-05:00", "exported_at": "2018-03-23T11:15:04-04:00",
"name": "Feed the Beast", "name": "Feed the Beast",
"author": "aevum@decess.us", "author": "aevum@decess.us",
"description": "Egg to handle all official FTB Modpacks", "description": "Egg to handle all official FTB Modpacks",
@ -17,7 +17,7 @@
}, },
"scripts": { "scripts": {
"installation": { "installation": {
"script": "#!\/bin\/ash\r\n# Generic FTB Server Installation Script\r\n#\r\n# Server Files: \/mnt\/server\r\n# MODPACK_VERSION = version of the modpack, set in variables\r\n# i.e MODPACK_VERSION=1.5.0\r\n# MODPACK_URL = url base of the pack, set in variables, hardcoded\r\n# i.e https:\/\/www.feed-the-beast.com\/projects\/ftb-revelation\/files\r\n# MODPACK_URL=ftb-revelation\r\n\r\napk update\r\napk add curl --no-cache\r\n\r\nBASEURL=https:\/\/www.feed-the-beast.com\/projects\/${MODPACK_URL}\/files\r\nPATTERN=\"projects\\\/${MODPACK_URL}\\\/files\\\/\\d{7,}\"\r\nID_PATTERN=\"\\d{7,}\"\r\nID=`curl -sl ${BASEURL}| grep -A2 ${MODPACK_VERSION} | grep -oE \"${PATTERN}\" | grep -oE \"${ID_PATTERN}\"`\r\necho \"ID: ${ID}\"\r\nSECONDURL=${BASEURL}\/${ID}\r\necho \"SECONDURL: ${SECONDURL}\"\r\nGOOD_ID=`curl -sl ${SECONDURL} | grep -B2 Server_${MODPACK_VERSION}.zip | grep -oE \"${PATTERN}\" | grep -oE \"${ID_PATTERN}\"`\r\necho \"GOOD_ID: ${GOOD_ID}\"\r\nDL_URL=${BASEURL}\/${GOOD_ID}\/download\r\necho \"Download_URL: ${DL_URL}\"\r\ncd \/mnt\/server\r\n\r\necho \"Executing curl -L ${DL_URL} -o ${MODPACK_URL}.zip\"\r\ncurl -L ${DL_URL} -o ${MODPACK_URL}.zip\r\n\r\nunzip ${MODPACK_URL}.zip\r\n\r\nrm -rf ${MODPACK_URL}.zip\r\n\r\nsh .\/FTBInstall.sh", "script": "#!\/bin\/ash\r\n# Generic FTB Server Installation Script\r\n#\r\n# Server Files: \/mnt\/server\r\n# MODPACK_VERSION = version of the modpack, set in variables\r\n# i.e MODPACK_VERSION=1.5.0\r\n# MODPACK_URL = url base of the pack, set in variables, hardcoded\r\n# i.e https:\/\/www.feed-the-beast.com\/projects\/ftb-revelation\/files\r\n# MODPACK_URL=ftb-revelation\r\n\r\napk add curl --no-cache\r\n\r\n## Correcting for bad variables\r\nGETPACK=$(echo ${MODPACK_URL} | cut -d \"\/\" -f 5 )\r\necho -e \"\\n The pack being downloaded is $GETPACK \\n\"\r\n\r\n## Getting the Base URL\r\nBASEURL=https:\/\/www.feed-the-beast.com\/projects\/${GETPACK}\/files\r\necho \"The base URL is ${BASEURL}\"\r\n\r\n## This is meant to get the pack ID that is unique and not exactly clear \r\n\r\n\r\nif [ -z \"${MODPACK_VERSION}\" ] || [ \"${MODPACK_VERSION}\" == \"latest\" ]; then\r\n ID=`curl -sl ${BASEURL} | grep -i -A9 'title=\"release\"' | grep -i -o 'href=\".*\"' | cut -d \"\/\" -f5 | sed s\/\\\"\/\/g`\r\n echo \"ID: ${ID}\"\r\nelse \r\n ID=`curl -sl ${BASEURL} | grep -i -A9 \"${MODPACK_VERSION}\" | grep -m1 -oE 'href=\"[^\\\"]+\"' | cut -d \"\/\" -f5 | grep -oE [0-9]+`\r\n echo \"ID: ${ID}\"\r\nfi\r\n\r\nSECONDURL=${BASEURL}\/${ID}\r\necho \"SECONDURL: ${SECONDURL}\"\r\n\r\nGOOD_ID=`curl -sl ${SECONDURL} | grep -i server | grep -Eo 'href=\"[^\\\"]+\"' | grep -o -E \"[0-9]+\" | tail -1`\r\necho \"GOOD_ID: ${GOOD_ID}\"\r\n\r\nDL_URL=${BASEURL}\/${GOOD_ID}\/download\r\necho \"Download_URL: ${DL_URL}\"\r\n\r\ncd \/mnt\/server\r\n\r\necho \"Executing curl -L ${DL_URL} -o $GETPACK.zip\"\r\ncurl -L ${DL_URL} -o $GETPACK.zip\r\n\r\nunzip ${GETPACK}.zip\r\n\r\nrm -rf ${GETPACK}.zip\r\n\r\nsh .\/FTBInstall.sh",
"container": "alpine:3.7", "container": "alpine:3.7",
"entrypoint": "ash" "entrypoint": "ash"
} }
@ -30,16 +30,16 @@
"default_value": "", "default_value": "",
"user_viewable": 1, "user_viewable": 1,
"user_editable": 1, "user_editable": 1,
"rules": "required|regex:[a-z-0-9]+|max:30" "rules": "required|regex:([a-z-0-9]+$)"
}, },
{ {
"name": "Modpack Version", "name": "Modpack Version",
"description": "Version of the modpack to use", "description": "Version of the modpack to use.",
"env_variable": "MODPACK_VERSION", "env_variable": "MODPACK_VERSION",
"default_value": "", "default_value": "latest",
"user_viewable": 1, "user_viewable": 1,
"user_editable": 1, "user_editable": 1,
"rules": "required|regex:\\d+.\\d+.\\d+" "rules": "required|string|max:20"
}, },
{ {
"name": "Level Seed", "name": "Level Seed",
@ -48,7 +48,7 @@
"default_value": "", "default_value": "",
"user_viewable": 1, "user_viewable": 1,
"user_editable": 1, "user_editable": 1,
"rules": "string|max:40" "rules": "nullable|string|max:40"
}, },
{ {
"name": "Max Players", "name": "Max Players",