From e417bacfed00f7005db61fb08a0c9878b158fdab Mon Sep 17 00:00:00 2001 From: NgLoader Date: Fri, 8 Feb 2019 01:58:27 +0100 Subject: [PATCH 1/3] Added build number support --- .../forge/forge-enhanced/egg-forge--enhanced.json | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/minecraft_java/forge/forge-enhanced/egg-forge--enhanced.json b/minecraft_java/forge/forge-enhanced/egg-forge--enhanced.json index 05e9a8cf..fc85e270 100644 --- a/minecraft_java/forge/forge-enhanced/egg-forge--enhanced.json +++ b/minecraft_java/forge/forge-enhanced/egg-forge--enhanced.json @@ -3,8 +3,8 @@ "meta": { "version": "PTDL_v1" }, - "exported_at": "2018-08-02T16:56:12-04:00", - "name": "Forge-Enhanced", + "exported_at": "2019-02-04T20:22:22+01:00", + "name": "Forge Enhanced", "author": "parker@parkervcp.com", "description": "Minecraft Forge Server. Minecraft Forge is a modding API (Application Programming Interface), which makes it easier to create mods, and also make sure mods are compatible with each other.", "image": "quay.io\/pterodactyl\/core:java", @@ -17,7 +17,7 @@ }, "scripts": { "installation": { - "script": "#!\/bin\/ash\r\n# Forge Installation Script\r\n#\r\n# Server Files: \/mnt\/server\r\napk update\r\napk add curl\r\n\r\nif [ -z \"$MC_VERSION\" ] || [ \"$MC_VERSION\" == \"latest\" ]; then\r\n INSTALLER_JAR=$(curl -sl http:\/\/files.minecraftforge.net\/maven\/net\/minecraftforge\/forge\/ | grep -A50 Recommended | grep installer.jar | grep -Eo \"(http|https):\/\/[a-zA-Z0-9.\/?=_-]*\" | tail -1)\r\n UNIVERSAL_JAR=$(curl -sl http:\/\/files.minecraftforge.net\/maven\/net\/minecraftforge\/forge\/ | grep -A50 Recommended | grep universal.jar | grep -Eo \"(http|https):\/\/[a-zA-Z0-9.\/?=_-]*\" | tail -1)\r\nelse\r\n INSTALLER_JAR=$(curl -sl http:\/\/files.minecraftforge.net\/maven\/net\/minecraftforge\/forge\/index_$MC_VERSION.html | grep -A50 Recommended | grep installer.jar | grep -Eo \"(http|https):\/\/[a-zA-Z0-9.\/?=_-]*\" | tail -1)\r\n UNIVERSAL_JAR=$(curl -sl http:\/\/files.minecraftforge.net\/maven\/net\/minecraftforge\/forge\/index_$MC_VERSION.html | grep -A50 Recommended | grep universal.jar | grep -Eo \"(http|https):\/\/[a-zA-Z0-9.\/?=_-]*\" | tail -1)\r\nfi\r\n\r\ncd \/mnt\/server\r\n\r\necho -e \"getting installer from $INSTALLER_JAR\"\r\ncurl -Sl $INSTALLER_JAR -o installer.jar\r\n\r\necho -e \"getting universal jar from $UNIVERSAL_JAR\"\r\ncurl -Sl $UNIVERSAL_JAR -o server.jar\r\n\r\njava -jar installer.jar --installServer\r\nrm -rf installer.jar\r\n\r\necho \"Install complete\"", + "script": "#!\/bin\/ash\r\n# Forge Installation Script\r\n#\r\n# Server Files: \/mnt\/server\r\napk update\r\napk add curl\r\n\r\nif [ -z \"$MC_VERSION\" ] || [ \"$MC_VERSION\" == \"latest\" ]; then\r\n FORGE_VERSION=$(curl -sl https:\/\/files.minecraftforge.net\/maven\/net\/minecraftforge\/forge\/ | grep -A1 Latest | grep -o -e '[1]\\.[0-9][0-9]\\?\\.\\?[0-9]\\?[0-9] - [0-9][0-9]\\.[0-9][0-9]\\.[0-9]\\?[0-9]\\.[0-9][0-9][0-9][0-9]' | sed 's\/ \/\/g')\r\nelse if [[ ! $FORGE_VERSION = *\"-\"* ]]; then\r\n FORGE_VERSION=$(curl -sl https:\/\/files.minecraftforge.net\/maven\/net\/minecraftforge\/forge\/index_$MC_VERSION.html | grep -A1 Latest | grep -o -e '[1]\\.[0-9][0-9]\\?\\.\\?[0-9]\\?[0-9] - [0-9][0-9]\\.[0-9][0-9]\\.[0-9]\\?[0-9]\\.[0-9][0-9][0-9][0-9]' | sed 's\/ \/\/g')\r\nfi\r\n\r\ncd \/mnt\/server\r\n\r\necho -e \"Downloading forge version \\\"$FORGE_VERSION\\\"\\n\"\r\ncurl -sS https:\/\/files.minecraftforge.net\/maven\/net\/minecraftforge\/forge\/$FORGE_VERSION\/forge-$FORGE_VERSION-installer.jar -o installer.jar\r\ncurl -sS https:\/\/files.minecraftforge.net\/maven\/net\/minecraftforge\/forge\/$FORGE_VERSION\/forge-$FORGE_VERSION-universal.jar -o $SERVER_JARFILE\r\n\r\nif [ ! -f .\/installer.jar ]; then\r\n echo \"!!! Invalide forge version \\\"$FORGE_VERSION\\\" !!!\\n\"\r\nfi\r\n\r\necho -e \"Installing forge server.\\n\"\r\njava -jar installer.jar --installServer\r\n\r\necho -e \"Deleting installer.jar file.\\n\"\r\nrm -rf installer.jar", "container": "openjdk:8-alpine", "entrypoint": "ash" } @@ -33,8 +33,8 @@ "rules": "required|regex:\/^([\\w\\d._-]+)(\\.jar)$\/" }, { - "name": "Forge Version", - "description": "The version of minecraft you want to download forge for.\r\n\r\nExample 1.7.10", + "name": "Forge version", + "description": "The version of forge that you want to run.\r\nExamples:\r\n- 1.12.2\r\n- 1.12.2-14.23.5.2810", "env_variable": "MC_VERSION", "default_value": "latest", "user_viewable": 1, @@ -42,4 +42,4 @@ "rules": "required|string|max:20" } ] -} +} \ No newline at end of file From dfb2e17e42cac57ec85cd03f1892c273c027e5ed Mon Sep 17 00:00:00 2001 From: NgLoader Date: Sun, 10 Feb 2019 23:01:59 +0100 Subject: [PATCH 2/3] Fixed installing script --- .../forge/forge-enhanced/egg-forge--enhanced.json | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/minecraft_java/forge/forge-enhanced/egg-forge--enhanced.json b/minecraft_java/forge/forge-enhanced/egg-forge--enhanced.json index fc85e270..5dc61c0a 100644 --- a/minecraft_java/forge/forge-enhanced/egg-forge--enhanced.json +++ b/minecraft_java/forge/forge-enhanced/egg-forge--enhanced.json @@ -3,7 +3,7 @@ "meta": { "version": "PTDL_v1" }, - "exported_at": "2019-02-04T20:22:22+01:00", + "exported_at": "2019-02-10T22:57:27+01:00", "name": "Forge Enhanced", "author": "parker@parkervcp.com", "description": "Minecraft Forge Server. Minecraft Forge is a modding API (Application Programming Interface), which makes it easier to create mods, and also make sure mods are compatible with each other.", @@ -17,9 +17,9 @@ }, "scripts": { "installation": { - "script": "#!\/bin\/ash\r\n# Forge Installation Script\r\n#\r\n# Server Files: \/mnt\/server\r\napk update\r\napk add curl\r\n\r\nif [ -z \"$MC_VERSION\" ] || [ \"$MC_VERSION\" == \"latest\" ]; then\r\n FORGE_VERSION=$(curl -sl https:\/\/files.minecraftforge.net\/maven\/net\/minecraftforge\/forge\/ | grep -A1 Latest | grep -o -e '[1]\\.[0-9][0-9]\\?\\.\\?[0-9]\\?[0-9] - [0-9][0-9]\\.[0-9][0-9]\\.[0-9]\\?[0-9]\\.[0-9][0-9][0-9][0-9]' | sed 's\/ \/\/g')\r\nelse if [[ ! $FORGE_VERSION = *\"-\"* ]]; then\r\n FORGE_VERSION=$(curl -sl https:\/\/files.minecraftforge.net\/maven\/net\/minecraftforge\/forge\/index_$MC_VERSION.html | grep -A1 Latest | grep -o -e '[1]\\.[0-9][0-9]\\?\\.\\?[0-9]\\?[0-9] - [0-9][0-9]\\.[0-9][0-9]\\.[0-9]\\?[0-9]\\.[0-9][0-9][0-9][0-9]' | sed 's\/ \/\/g')\r\nfi\r\n\r\ncd \/mnt\/server\r\n\r\necho -e \"Downloading forge version \\\"$FORGE_VERSION\\\"\\n\"\r\ncurl -sS https:\/\/files.minecraftforge.net\/maven\/net\/minecraftforge\/forge\/$FORGE_VERSION\/forge-$FORGE_VERSION-installer.jar -o installer.jar\r\ncurl -sS https:\/\/files.minecraftforge.net\/maven\/net\/minecraftforge\/forge\/$FORGE_VERSION\/forge-$FORGE_VERSION-universal.jar -o $SERVER_JARFILE\r\n\r\nif [ ! -f .\/installer.jar ]; then\r\n echo \"!!! Invalide forge version \\\"$FORGE_VERSION\\\" !!!\\n\"\r\nfi\r\n\r\necho -e \"Installing forge server.\\n\"\r\njava -jar installer.jar --installServer\r\n\r\necho -e \"Deleting installer.jar file.\\n\"\r\nrm -rf installer.jar", - "container": "openjdk:8-alpine", - "entrypoint": "ash" + "script": "#!\/bin\/bash\r\n# Forge Installation Script\r\n#\r\n# Server Files: \/mnt\/server\r\napt update\r\napt install -y curl\r\n\r\n#Fetching version\r\nif [ -z \"$MC_VERSION\" ] || [ \"$MC_VERSION\" == \"latest\" ]; then\r\n echo \"Fetching latest\"\r\n MC_VERSION=$(curl -sl https:\/\/files.minecraftforge.net\/maven\/net\/minecraftforge\/forge\/index.html | grep -A 2 \"Latest\" | awk NF=NF RS= OFS=\" \" | grep -o -e '[1]\\.[0-9][0-9]\\?\\.\\?[0-9]\\?[0-9] - [0-9][0-9]\\.[0-9][0-9]\\.[0-9]\\?[0-9]\\.[0-9][0-9][0-9][0-9]' | sed 's\/ \/\/g')\r\nelif [[ ! \"$MC_VERSION\" =~ - ]]; then\r\n echo \"Fetching latest from version $MC_VERSION\"\r\n MC_VERSION=$(curl -sl https:\/\/files.minecraftforge.net\/maven\/net\/minecraftforge\/forge\/index_$MC_VERSION.html | grep -A 2 \"Latest\" | awk NF=NF RS= OFS=\" \" | grep -o -e '[1]\\.[0-9][0-9]\\?\\.\\?[0-9]\\?[0-9] - [0-9][0-9]\\.[0-9][0-9]\\.[0-9]\\?[0-9]\\.[0-9][0-9][0-9][0-9]' | sed 's\/ \/\/g')\r\nfi\r\n\r\n#Checking if forge version valid\r\nif [[ ! \"$MC_VERSION\" =~ [0-9]?[0-9]?\\.[0-9]?[0-9]?\\.?[0-9]?[0-9]-[0-9]?[0-9]\\.[0-9]?[0-9]\\.[0-9]?[0-9]\\.[0-9]?[0-9]?[0-9]?[0-9] ]]; then\r\n echo \"!!! Invalid forge version \\\"$MC_VERSION\\\" !!!\"\r\n exit\r\nfi\r\n\r\n#Go into main direction\r\ncd \/mnt\/server\r\n\r\n#Adding .jar when not eding by SERVER_JARFILE\r\nif [[ ! $SERVER_JARFILE = *\\.jar ]]; then\r\n SERVER_JARFILE=\"$SERVER_JARFILE.jar\"\r\nfi\r\n\r\n#Downloading jars\r\necho -e \"Downloading forge version \\\"$MC_VERSION\\\"\"\r\ncurl -o installer.jar -sS https:\/\/files.minecraftforge.net\/maven\/net\/minecraftforge\/forge\/$MC_VERSION\/forge-$MC_VERSION-installer.jar\r\ncurl -o $SERVER_JARFILE -sS https:\/\/files.minecraftforge.net\/maven\/net\/minecraftforge\/forge\/$MC_VERSION\/forge-$MC_VERSION-universal.jar\r\n\r\n#Checking if downloaded jars exist\r\nif [ ! -f .\/installer.jar ] || [ ! -f .\/$SERVER_JARFILE ]; then\r\n echo \"!!! Error by downloading forge version \\\"$MC_VERSION\\\" !!!\"\r\n exit\r\nfi\r\n\r\n#Installing server\r\necho -e \"Installing forge server.\\n\"\r\njava -jar installer.jar --installServer\r\n\r\n#Deleting installer.jar\r\necho -e \"Deleting installer.jar file.\\n\"\r\nrm -rf installer.jar", + "container": "openjdk:8", + "entrypoint": "bash" } }, "variables": [ @@ -39,7 +39,7 @@ "default_value": "latest", "user_viewable": 1, "user_editable": 1, - "rules": "required|string|max:20" + "rules": "required|string|max:22" } ] } \ No newline at end of file From 601527cd15510f3d544ce5b6440eb7d84a68146e Mon Sep 17 00:00:00 2001 From: NgLoader Date: Tue, 12 Feb 2019 20:08:01 +0100 Subject: [PATCH 3/3] Changed regex Thanks to @parkervcp --- minecraft_java/forge/forge-enhanced/egg-forge--enhanced.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/minecraft_java/forge/forge-enhanced/egg-forge--enhanced.json b/minecraft_java/forge/forge-enhanced/egg-forge--enhanced.json index 5dc61c0a..5391775a 100644 --- a/minecraft_java/forge/forge-enhanced/egg-forge--enhanced.json +++ b/minecraft_java/forge/forge-enhanced/egg-forge--enhanced.json @@ -17,7 +17,7 @@ }, "scripts": { "installation": { - "script": "#!\/bin\/bash\r\n# Forge Installation Script\r\n#\r\n# Server Files: \/mnt\/server\r\napt update\r\napt install -y curl\r\n\r\n#Fetching version\r\nif [ -z \"$MC_VERSION\" ] || [ \"$MC_VERSION\" == \"latest\" ]; then\r\n echo \"Fetching latest\"\r\n MC_VERSION=$(curl -sl https:\/\/files.minecraftforge.net\/maven\/net\/minecraftforge\/forge\/index.html | grep -A 2 \"Latest\" | awk NF=NF RS= OFS=\" \" | grep -o -e '[1]\\.[0-9][0-9]\\?\\.\\?[0-9]\\?[0-9] - [0-9][0-9]\\.[0-9][0-9]\\.[0-9]\\?[0-9]\\.[0-9][0-9][0-9][0-9]' | sed 's\/ \/\/g')\r\nelif [[ ! \"$MC_VERSION\" =~ - ]]; then\r\n echo \"Fetching latest from version $MC_VERSION\"\r\n MC_VERSION=$(curl -sl https:\/\/files.minecraftforge.net\/maven\/net\/minecraftforge\/forge\/index_$MC_VERSION.html | grep -A 2 \"Latest\" | awk NF=NF RS= OFS=\" \" | grep -o -e '[1]\\.[0-9][0-9]\\?\\.\\?[0-9]\\?[0-9] - [0-9][0-9]\\.[0-9][0-9]\\.[0-9]\\?[0-9]\\.[0-9][0-9][0-9][0-9]' | sed 's\/ \/\/g')\r\nfi\r\n\r\n#Checking if forge version valid\r\nif [[ ! \"$MC_VERSION\" =~ [0-9]?[0-9]?\\.[0-9]?[0-9]?\\.?[0-9]?[0-9]-[0-9]?[0-9]\\.[0-9]?[0-9]\\.[0-9]?[0-9]\\.[0-9]?[0-9]?[0-9]?[0-9] ]]; then\r\n echo \"!!! Invalid forge version \\\"$MC_VERSION\\\" !!!\"\r\n exit\r\nfi\r\n\r\n#Go into main direction\r\ncd \/mnt\/server\r\n\r\n#Adding .jar when not eding by SERVER_JARFILE\r\nif [[ ! $SERVER_JARFILE = *\\.jar ]]; then\r\n SERVER_JARFILE=\"$SERVER_JARFILE.jar\"\r\nfi\r\n\r\n#Downloading jars\r\necho -e \"Downloading forge version \\\"$MC_VERSION\\\"\"\r\ncurl -o installer.jar -sS https:\/\/files.minecraftforge.net\/maven\/net\/minecraftforge\/forge\/$MC_VERSION\/forge-$MC_VERSION-installer.jar\r\ncurl -o $SERVER_JARFILE -sS https:\/\/files.minecraftforge.net\/maven\/net\/minecraftforge\/forge\/$MC_VERSION\/forge-$MC_VERSION-universal.jar\r\n\r\n#Checking if downloaded jars exist\r\nif [ ! -f .\/installer.jar ] || [ ! -f .\/$SERVER_JARFILE ]; then\r\n echo \"!!! Error by downloading forge version \\\"$MC_VERSION\\\" !!!\"\r\n exit\r\nfi\r\n\r\n#Installing server\r\necho -e \"Installing forge server.\\n\"\r\njava -jar installer.jar --installServer\r\n\r\n#Deleting installer.jar\r\necho -e \"Deleting installer.jar file.\\n\"\r\nrm -rf installer.jar", + "script": "#!\/bin\/bash\r\n# Forge Installation Script\r\n#\r\n# Server Files: \/mnt\/server\r\napt update\r\napt install -y curl\r\n\r\n#Fetching version\r\nif [ -z \"$MC_VERSION\" ] || [ \"$MC_VERSION\" == \"latest\" ]; then\r\n echo \"Fetching latest\"\r\n MC_VERSION=$(curl -sl https:\/\/files.minecraftforge.net\/maven\/net\/minecraftforge\/forge\/index.html | grep -A 2 \"Latest\" | awk NF=NF RS= OFS=\" \" | grep -o -e '[1].[0-9]*.[0-9]* - [0-9]*.[0-9]*.[0-9]*.[0-9]*' | sed 's\/ \/\/g')\r\nelif [[ ! \"$MC_VERSION\" =~ - ]]; then\r\n echo \"Fetching latest from version $MC_VERSION\"\r\n MC_VERSION=$(curl -sl https:\/\/files.minecraftforge.net\/maven\/net\/minecraftforge\/forge\/index_$MC_VERSION.html | grep -A 2 \"Latest\" | awk NF=NF RS= OFS=\" \" | grep -o -e '[1].[0-9]*.[0-9]* - [0-9]*.[0-9]*.[0-9]*.[0-9]*' | sed 's\/ \/\/g')\r\nfi\r\n\r\n#Checking if forge version valid\r\nif [[ ! \"$MC_VERSION\" =~ [1].[0-9]*.[0-9]*-[0-9]*.[0-9]*.[0-9]*.[0-9]* ]]; then\r\n echo \"!!! Invalid forge version \\\"$MC_VERSION\\\" !!!\"\r\n exit\r\nfi\r\n\r\n#Go into main direction\r\ncd \/mnt\/server\r\n\r\n#Adding .jar when not eding by SERVER_JARFILE\r\nif [[ ! $SERVER_JARFILE = *\\.jar ]]; then\r\n SERVER_JARFILE=\"$SERVER_JARFILE.jar\"\r\nfi\r\n\r\n#Downloading jars\r\necho -e \"Downloading forge version \\\"$MC_VERSION\\\"\"\r\ncurl -o installer.jar -sS https:\/\/files.minecraftforge.net\/maven\/net\/minecraftforge\/forge\/$MC_VERSION\/forge-$MC_VERSION-installer.jar\r\ncurl -o $SERVER_JARFILE -sS https:\/\/files.minecraftforge.net\/maven\/net\/minecraftforge\/forge\/$MC_VERSION\/forge-$MC_VERSION-universal.jar\r\n\r\n#Checking if downloaded jars exist\r\nif [ ! -f .\/installer.jar ] || [ ! -f .\/$SERVER_JARFILE ]; then\r\n echo \"!!! Error by downloading forge version \\\"$MC_VERSION\\\" !!!\"\r\n exit\r\nfi\r\n\r\n#Installing server\r\necho -e \"Installing forge server.\\n\"\r\njava -jar installer.jar --installServer\r\n\r\n#Deleting installer.jar\r\necho -e \"Deleting installer.jar file.\\n\"\r\nrm -rf installer.jar", "container": "openjdk:8", "entrypoint": "bash" }