From c155bc694e49c1bd00a35217b7221e0f71bc162c Mon Sep 17 00:00:00 2001 From: Michael Parker Date: Fri, 26 Jun 2020 12:06:50 -0400 Subject: [PATCH] fix factorio experimental version grab --- factorio/factorio/egg-factorio.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/factorio/factorio/egg-factorio.json b/factorio/factorio/egg-factorio.json index 3f67ed10..61855db4 100644 --- a/factorio/factorio/egg-factorio.json +++ b/factorio/factorio/egg-factorio.json @@ -3,11 +3,11 @@ "meta": { "version": "PTDL_v1" }, - "exported_at": "2020-06-26T11:01:44-04:00", + "exported_at": "2020-06-26T12:06:19-04:00", "name": "Factorio", "author": "parker@parkervcp.com", "description": "The vanilla Factorio server.\r\n\r\nhttps:\/\/www.factorio.com\/", - "image": "quay.io\/parkervcp\/pterodactyl-images:base_debian", + "image": "~debian:base", "startup": ".\/bin\/x64\/factorio --port {{SERVER_PORT}} --server-settings data\/server-settings.json --start-server {{SAVE_NAME}}.zip", "config": { "files": "{\r\n \"data\/server-settings.json\": {\r\n \"parser\": \"json\",\r\n \"find\": {\r\n \"name\": \"{{server.build.env.SERVER_NAME}}\",\r\n \"description\": \"{{server.build.env.SERVER_DESC}}\",\r\n \"max_players\": \"{{server.build.env.MAX_SLOTS}}\",\r\n \"username\": \"{{server.build.env.SERVER_USERNAME}}\",\r\n \"token\": \"{{server.build.env.SERVER_TOKEN}}\",\r\n \"autosave_interval\": \"{{server.build.env.SAVE_INTERVAL}}\",\r\n \"autosave_slots\": \"{{server.build.env.SAVE_SLOTS}}\",\r\n \"afk_autokick_interval\": \"{{server.build.env.AFK_KICK}}\"\r\n }\r\n }\r\n}", @@ -17,7 +17,7 @@ }, "scripts": { "installation": { - "script": "#!\/bin\/bash\r\n# Factorio Installation Script\r\n#\r\n# Server Files: \/mnt\/server\r\napt update \r\napt install -y curl tar xz-utils jq\r\n\r\nlatest_stable=`curl -sL https:\/\/updater.factorio.com\/get-available-versions | jq -r '.[\"core-linux_headless64\"] | .[] | .[\"stable\"] | select(. != null)'`\r\nlatest_experimental=`curl -sL https:\/\/www.factorio.com\/download-headless\/experimental | grep -m 1 -o -E '([0-9]\\.[0-9]*\\.[0-9]*)'`\r\n\r\nif [ -z \"${FACTORIO_VERSION}\" ] || [ \"${FACTORIO_VERSION}\" == \"latest\" ]; then\r\n DL_VERSION=$latest_stable\r\nelif [ \"${FACTORIO_VERSION}\" == \"experimental\" ]; then\r\n DL_VERSION=$latest_experimental\r\nelse\r\n DL_VERSION=${FACTORIO_VERSION}\r\nfi\r\n\r\nmkdir -p \/mnt\/server\r\ncd \/mnt\/server\r\n\r\necho -e \"\\n running 'curl -sL https:\/\/www.factorio.com\/get-download\/${DL_VERSION}\/headless\/linux64 -o factorio-${DL_VERSION}' \\n\"\r\n\r\ncurl -sL https:\/\/www.factorio.com\/get-download\/${DL_VERSION}\/headless\/linux64 -o factorio-${DL_VERSION}\r\n\r\ntar -xf factorio-${DL_VERSION} --strip-components=1 -C \/mnt\/server\r\n\r\nrm factorio-${DL_VERSION}\r\n\r\nif [ -e data\/map-gen-settings.json ]; then\r\n echo \"map-gen exists\"\r\nelse\r\n echo \"copying map-gen default settings\"\r\n mv data\/map-gen-settings.example.json data\/map-gen-settings.json\r\nfi\r\n\r\nif [ -e data\/server-settings.json ]; then\r\n echo \"server settings exists\"\r\nelse\r\n echo \"copying server default settings\"\r\n mv data\/server-settings.example.json data\/server-settings.json\r\nfi\r\n\r\nif [ -e map-settings.json ]; then\r\n echo \"map settings exists\"\r\nelse\r\n echo \"copying map default settings\"\r\n mv data\/map-settings.example.json data\/map-settings.json\r\nfi\r\n\r\nif [ -e ${SAVE_NAME}.zip ]; then\r\n echo \"save file exists\"\r\nelse\r\n .\/bin\/x64\/factorio --create ${SAVE_NAME}\r\n chmod o+w ${SAVE_NAME}.zip\r\nfi", + "script": "#!\/bin\/bash\r\n# Factorio Installation Script\r\n#\r\n# Server Files: \/mnt\/server\r\napt update \r\napt install -y curl tar xz-utils jq\r\n\r\nlatest_stable=`curl -sL https:\/\/updater.factorio.com\/get-available-versions | jq -r '.[\"core-linux_headless64\"] | .[] | .[\"stable\"] | select(. != null)'`\r\nlatest_experimental=`curl -sL https:\/\/updater.factorio.com\/get-available-versions | jq -rS '.[\"core-linux_headless64\"] | .[].to' | sed 's\/null\/\/g' | sort -V | tail -1`\r\n\r\nif [ -z \"${FACTORIO_VERSION}\" ] || [ \"${FACTORIO_VERSION}\" == \"latest\" ]; then\r\n DL_VERSION=$latest_stable\r\nelif [ \"${FACTORIO_VERSION}\" == \"experimental\" ]; then\r\n DL_VERSION=$latest_experimental\r\nelse\r\n DL_VERSION=${FACTORIO_VERSION}\r\nfi\r\n\r\nmkdir -p \/mnt\/server\r\ncd \/mnt\/server\r\n\r\necho -e \"\\n running 'curl -sL https:\/\/www.factorio.com\/get-download\/${DL_VERSION}\/headless\/linux64 -o factorio-${DL_VERSION}' \\n\"\r\n\r\ncurl -sL https:\/\/www.factorio.com\/get-download\/${DL_VERSION}\/headless\/linux64 -o factorio-${DL_VERSION}\r\n\r\ntar -xf factorio-${DL_VERSION} --strip-components=1 -C \/mnt\/server\r\n\r\nrm factorio-${DL_VERSION}\r\n\r\nif [ -e data\/map-gen-settings.json ]; then\r\n echo \"map-gen exists\"\r\nelse\r\n echo \"copying map-gen default settings\"\r\n mv data\/map-gen-settings.example.json data\/map-gen-settings.json\r\nfi\r\n\r\nif [ -e data\/server-settings.json ]; then\r\n echo \"server settings exists\"\r\nelse\r\n echo \"copying server default settings\"\r\n mv data\/server-settings.example.json data\/server-settings.json\r\nfi\r\n\r\nif [ -e map-settings.json ]; then\r\n echo \"map settings exists\"\r\nelse\r\n echo \"copying map default settings\"\r\n mv data\/map-settings.example.json data\/map-settings.json\r\nfi\r\n\r\nif [ -e ${SAVE_NAME}.zip ]; then\r\n echo \"save file exists\"\r\nelse\r\n .\/bin\/x64\/factorio --create ${SAVE_NAME}\r\n chmod o+w ${SAVE_NAME}.zip\r\nfi", "container": "debian:buster-slim", "entrypoint": "bash" }