From 1ede54845fd999b8c9f0648c6f53c7689327a89f Mon Sep 17 00:00:00 2001 From: Quinten <67589015+QuintenQVD0@users.noreply.github.com> Date: Tue, 25 Oct 2022 17:14:01 +0200 Subject: [PATCH 1/2] update terraria vanilla to allways pull latest --- game_eggs/terraria/vanilla/egg-terraria-vanilla.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/game_eggs/terraria/vanilla/egg-terraria-vanilla.json b/game_eggs/terraria/vanilla/egg-terraria-vanilla.json index fa3ad39a..933d8835 100644 --- a/game_eggs/terraria/vanilla/egg-terraria-vanilla.json +++ b/game_eggs/terraria/vanilla/egg-terraria-vanilla.json @@ -4,13 +4,13 @@ "version": "PTDL_v2", "update_url": null }, - "exported_at": "2022-10-05T12:17:20+02:00", + "exported_at": "2022-10-23T19:12:56+02:00", "name": "Terraria Vanilla", "author": "iamkubi@gmail.com", "description": "Dig, fight, explore, build! Nothing is impossible in this action-packed adventure game.", "features": null, "docker_images": { - "ghcr.io\/parkervcp\/yolks:debian": "ghcr.io\/parkervcp\/yolks:debian" + "Debian": "ghcr.io\/parkervcp\/yolks:debian" }, "file_denylist": [], "startup": ".\/TerrariaServer.bin.x86_64 -config serverconfig.txt", @@ -22,7 +22,7 @@ }, "scripts": { "installation": { - "script": "#!\/bin\/bash\r\n# Vanilla Installation Script\r\n#\r\n# Server Files: \/mnt\/server\r\n## install packages to get version and download links\r\napt update\r\napt install -y curl wget file unzip\r\n\r\nDOWNLOAD_LINK=invalid\r\n\r\nmkdir -p \/mnt\/server\/\r\ncd \/mnt\/server\/\r\n\r\nif [ \"${TERRARIA_VERSION}\" == \"latest\" ] || [ \"${TERRARIA_VERSION}\" == \"\" ] ; then\r\n DOWNLOAD_LINK=$(curl -sSL https:\/\/terraria.wiki.gg\/wiki\/Server#Downloads | grep '>Terraria Server ' | grep -Eoi ']+>' | grep -Eo 'href=\\\"[^\\\\\\\"]+\\\"' | grep -Eo '(http|https):\\\/\\\/[^\\\"]+' | tail -1 | cut -d'?' -f1)\r\nelse\r\n CLEAN_VERSION=$(echo ${TERRARIA_VERSION} | sed 's\/\\.\/\/g')\r\n echo -e \"Downloading terraria server files\"\r\n DOWNLOAD_LINK=$(curl -sSL https:\/\/terraria.wiki.gg\/wiki\/Server#Downloads | grep '>Terraria Server ' | grep -Eoi ']+>' | grep -Eo 'href=\\\"[^\\\\\\\"]+\\\"' | grep -Eo '(http|https):\\\/\\\/[^\\\"]+' | grep \"${CLEAN_VERSION}\" | cut -d'?' -f1)\r\nfi \r\n\r\n## this is a simple script to validate a download url actaully exists\r\nif [ ! -z \"${DOWNLOAD_LINK}\" ]; then \r\n if curl --output \/dev\/null --silent --head --fail ${DOWNLOAD_LINK}; then\r\n echo -e \"link is valid.\"\r\n else \r\n echo -e \"link is invalid closing out\"\r\n exit 2\r\n fi\r\nfi\r\n\r\nCLEAN_VERSION=$(echo ${DOWNLOAD_LINK##*\/} | cut -d'-' -f3 | cut -d'.' -f1)\r\n\r\necho -e \"running 'curl -sSL ${DOWNLOAD_LINK} -o ${DOWNLOAD_LINK##*\/}'\" \r\ncurl -sSL ${DOWNLOAD_LINK} -o ${DOWNLOAD_LINK##*\/}\r\n\r\necho -e \"Unpacking server files\"\r\nunzip ${DOWNLOAD_LINK##*\/}\r\n\r\necho -e \"\"\r\ncp -R ${CLEAN_VERSION}\/Linux\/* .\/\r\nchmod +x TerrariaServer.bin.x86_64\r\n\r\necho -e \"Cleaning up extra files.\"\r\nrm -rf ${CLEAN_VERSION}\r\n\r\necho -e \"Generating config file\"\r\ncat < serverconfig.txt\r\nworldpath=\/home\/container\/saves\/Worlds\r\nworldname=default\r\nworld=\/home\/container\/saves\/Worlds\/default.wld\r\ndifficulty=3\r\nautocreate=1\r\nport=7777\r\nmaxplayers=8\r\nEOF\r\n\r\nmkdir -p \/mnt\/server\/saves\/Worlds\r\n\r\necho -e \"Install complete\"", + "script": "#!\/bin\/bash\r\n# Vanilla Installation Script\r\n#\r\n# Server Files: \/mnt\/server\r\n## install packages to get version and download links\r\napt update\r\napt install -y curl wget file unzip jq\r\n\r\nDOWNLOAD_LINK=invalid\r\n\r\nmkdir -p \/mnt\/server\/\r\ncd \/mnt\/server\/\r\n\r\nif [ \"${TERRARIA_VERSION}\" == \"latest\" ] || [ \"${TERRARIA_VERSION}\" == \"\" ] ; then\r\n V=$(curl -s https:\/\/terraria.org\/api\/get\/dedicated-servers-names | jq -r .[] | head -1)\r\n DOWNLOAD_LINK=\"https:\/\/terraria.org\/api\/download\/pc-dedicated-server\/${V}\"\r\nelse\r\n CLEAN_VERSION=$(echo ${TERRARIA_VERSION} | sed 's\/\\.\/\/g')\r\n echo -e \"Downloading terraria server files\"\r\n DOWNLOAD_LINK=$(curl -sSL https:\/\/terraria.wiki.gg\/wiki\/Server#Downloads | grep '>Terraria Server ' | grep -Eoi ']+>' | grep -Eo 'href=\\\"[^\\\\\\\"]+\\\"' | grep -Eo '(http|https):\\\/\\\/[^\\\"]+' | grep \"${CLEAN_VERSION}\" | cut -d'?' -f1)\r\nfi \r\n\r\n## this is a simple script to validate a download url actaully exists\r\necho ${DOWNLOAD_LINK}\r\n\r\nif [ ! -z \"${DOWNLOAD_LINK}\" ]; then \r\n if curl --output \/dev\/null --silent --head --fail ${DOWNLOAD_LINK}; then\r\n echo -e \"link is valid.\"\r\n else \r\n echo -e \"link is invalid closing out\"\r\n exit 2\r\n fi\r\nfi\r\n\r\nCLEAN_VERSION=$(echo ${DOWNLOAD_LINK##*\/} | cut -d'-' -f3 | cut -d'.' -f1)\r\n\r\n\r\necho -e \"running 'curl -sSL ${DOWNLOAD_LINK} -o ${DOWNLOAD_LINK##*\/}'\" \r\ncurl -sSL ${DOWNLOAD_LINK} -o ${DOWNLOAD_LINK##*\/}\r\n\r\necho -e \"Unpacking server files\"\r\nunzip ${DOWNLOAD_LINK##*\/}\r\n\r\necho -e \"\"\r\ncp -R ${CLEAN_VERSION}\/Linux\/* .\/\r\nchmod +x TerrariaServer.bin.x86_64\r\n\r\necho -e \"Cleaning up extra files.\"\r\nrm -rf ${CLEAN_VERSION}\r\n\r\necho -e \"Generating config file\"\r\ncat < serverconfig.txt\r\nworldpath=\/home\/container\/saves\/Worlds\r\nworldname=default\r\nworld=\/home\/container\/saves\/Worlds\/default.wld\r\ndifficulty=3\r\nautocreate=1\r\nport=7777\r\nmaxplayers=8\r\nEOF\r\n\r\nmkdir -p \/mnt\/server\/saves\/Worlds\r\n\r\necho -e \"Install complete\"", "container": "debian:buster-slim", "entrypoint": "bash" } From 778f87f7a19fcc3e5c775763ab6d39ff18ee8554 Mon Sep 17 00:00:00 2001 From: Quinten <67589015+QuintenQVD0@users.noreply.github.com> Date: Tue, 25 Oct 2022 18:12:46 +0200 Subject: [PATCH 2/2] use the -sSL flag curl --- game_eggs/terraria/vanilla/egg-terraria-vanilla.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/game_eggs/terraria/vanilla/egg-terraria-vanilla.json b/game_eggs/terraria/vanilla/egg-terraria-vanilla.json index 933d8835..5f4ff357 100644 --- a/game_eggs/terraria/vanilla/egg-terraria-vanilla.json +++ b/game_eggs/terraria/vanilla/egg-terraria-vanilla.json @@ -4,7 +4,7 @@ "version": "PTDL_v2", "update_url": null }, - "exported_at": "2022-10-23T19:12:56+02:00", + "exported_at": "2022-10-25T18:12:06+02:00", "name": "Terraria Vanilla", "author": "iamkubi@gmail.com", "description": "Dig, fight, explore, build! Nothing is impossible in this action-packed adventure game.", @@ -22,7 +22,7 @@ }, "scripts": { "installation": { - "script": "#!\/bin\/bash\r\n# Vanilla Installation Script\r\n#\r\n# Server Files: \/mnt\/server\r\n## install packages to get version and download links\r\napt update\r\napt install -y curl wget file unzip jq\r\n\r\nDOWNLOAD_LINK=invalid\r\n\r\nmkdir -p \/mnt\/server\/\r\ncd \/mnt\/server\/\r\n\r\nif [ \"${TERRARIA_VERSION}\" == \"latest\" ] || [ \"${TERRARIA_VERSION}\" == \"\" ] ; then\r\n V=$(curl -s https:\/\/terraria.org\/api\/get\/dedicated-servers-names | jq -r .[] | head -1)\r\n DOWNLOAD_LINK=\"https:\/\/terraria.org\/api\/download\/pc-dedicated-server\/${V}\"\r\nelse\r\n CLEAN_VERSION=$(echo ${TERRARIA_VERSION} | sed 's\/\\.\/\/g')\r\n echo -e \"Downloading terraria server files\"\r\n DOWNLOAD_LINK=$(curl -sSL https:\/\/terraria.wiki.gg\/wiki\/Server#Downloads | grep '>Terraria Server ' | grep -Eoi ']+>' | grep -Eo 'href=\\\"[^\\\\\\\"]+\\\"' | grep -Eo '(http|https):\\\/\\\/[^\\\"]+' | grep \"${CLEAN_VERSION}\" | cut -d'?' -f1)\r\nfi \r\n\r\n## this is a simple script to validate a download url actaully exists\r\necho ${DOWNLOAD_LINK}\r\n\r\nif [ ! -z \"${DOWNLOAD_LINK}\" ]; then \r\n if curl --output \/dev\/null --silent --head --fail ${DOWNLOAD_LINK}; then\r\n echo -e \"link is valid.\"\r\n else \r\n echo -e \"link is invalid closing out\"\r\n exit 2\r\n fi\r\nfi\r\n\r\nCLEAN_VERSION=$(echo ${DOWNLOAD_LINK##*\/} | cut -d'-' -f3 | cut -d'.' -f1)\r\n\r\n\r\necho -e \"running 'curl -sSL ${DOWNLOAD_LINK} -o ${DOWNLOAD_LINK##*\/}'\" \r\ncurl -sSL ${DOWNLOAD_LINK} -o ${DOWNLOAD_LINK##*\/}\r\n\r\necho -e \"Unpacking server files\"\r\nunzip ${DOWNLOAD_LINK##*\/}\r\n\r\necho -e \"\"\r\ncp -R ${CLEAN_VERSION}\/Linux\/* .\/\r\nchmod +x TerrariaServer.bin.x86_64\r\n\r\necho -e \"Cleaning up extra files.\"\r\nrm -rf ${CLEAN_VERSION}\r\n\r\necho -e \"Generating config file\"\r\ncat < serverconfig.txt\r\nworldpath=\/home\/container\/saves\/Worlds\r\nworldname=default\r\nworld=\/home\/container\/saves\/Worlds\/default.wld\r\ndifficulty=3\r\nautocreate=1\r\nport=7777\r\nmaxplayers=8\r\nEOF\r\n\r\nmkdir -p \/mnt\/server\/saves\/Worlds\r\n\r\necho -e \"Install complete\"", + "script": "#!\/bin\/bash\r\n# Vanilla Installation Script\r\n#\r\n# Server Files: \/mnt\/server\r\n## install packages to get version and download links\r\napt update\r\napt install -y curl wget file unzip jq\r\n\r\nDOWNLOAD_LINK=invalid\r\n\r\nmkdir -p \/mnt\/server\/\r\ncd \/mnt\/server\/\r\n\r\nif [ \"${TERRARIA_VERSION}\" == \"latest\" ] || [ \"${TERRARIA_VERSION}\" == \"\" ] ; then\r\n V=$(curl -sSL https:\/\/terraria.org\/api\/get\/dedicated-servers-names | jq -r .[] | head -1)\r\n DOWNLOAD_LINK=\"https:\/\/terraria.org\/api\/download\/pc-dedicated-server\/${V}\"\r\nelse\r\n CLEAN_VERSION=$(echo ${TERRARIA_VERSION} | sed 's\/\\.\/\/g')\r\n echo -e \"Downloading terraria server files\"\r\n DOWNLOAD_LINK=$(curl -sSL https:\/\/terraria.wiki.gg\/wiki\/Server#Downloads | grep '>Terraria Server ' | grep -Eoi ']+>' | grep -Eo 'href=\\\"[^\\\\\\\"]+\\\"' | grep -Eo '(http|https):\\\/\\\/[^\\\"]+' | grep \"${CLEAN_VERSION}\" | cut -d'?' -f1)\r\nfi \r\n\r\n## this is a simple script to validate a download url actaully exists\r\necho ${DOWNLOAD_LINK}\r\n\r\nif [ ! -z \"${DOWNLOAD_LINK}\" ]; then \r\n if curl --output \/dev\/null --silent --head --fail ${DOWNLOAD_LINK}; then\r\n echo -e \"link is valid.\"\r\n else \r\n echo -e \"link is invalid closing out\"\r\n exit 2\r\n fi\r\nfi\r\n\r\nCLEAN_VERSION=$(echo ${DOWNLOAD_LINK##*\/} | cut -d'-' -f3 | cut -d'.' -f1)\r\n\r\n\r\necho -e \"running 'curl -sSL ${DOWNLOAD_LINK} -o ${DOWNLOAD_LINK##*\/}'\" \r\ncurl -sSL ${DOWNLOAD_LINK} -o ${DOWNLOAD_LINK##*\/}\r\n\r\necho -e \"Unpacking server files\"\r\nunzip ${DOWNLOAD_LINK##*\/}\r\n\r\necho -e \"\"\r\ncp -R ${CLEAN_VERSION}\/Linux\/* .\/\r\nchmod +x TerrariaServer.bin.x86_64\r\n\r\necho -e \"Cleaning up extra files.\"\r\nrm -rf ${CLEAN_VERSION}\r\n\r\necho -e \"Generating config file\"\r\ncat < serverconfig.txt\r\nworldpath=\/home\/container\/saves\/Worlds\r\nworldname=default\r\nworld=\/home\/container\/saves\/Worlds\/default.wld\r\ndifficulty=3\r\nautocreate=1\r\nport=7777\r\nmaxplayers=8\r\nEOF\r\n\r\nmkdir -p \/mnt\/server\/saves\/Worlds\r\n\r\necho -e \"Install complete\"", "container": "debian:buster-slim", "entrypoint": "bash" }