mirror of
https://github.com/parkervcp/eggs.git
synced 2024-11-11 11:37:29 +08:00
remove old pre api that no longer exists and add error response if version does not exist
This commit is contained in:
parent
ef353cc7ad
commit
23ca60299c
@ -4,7 +4,7 @@
|
||||
"version": "PTDL_v2",
|
||||
"update_url": null
|
||||
},
|
||||
"exported_at": "2024-01-19T09:12:16-05:00",
|
||||
"exported_at": "2024-01-19T10:09:42-05:00",
|
||||
"name": "Vintage Story",
|
||||
"author": "mail@wuffy.eu",
|
||||
"description": "Vintage Story is an uncompromising wilderness survival sandbox game inspired by lovecraftian horror themes. Find yourself in a ruined world reclaimed by nature and permeated by unnerving temporal disturbances. Relive the advent of human civilization, or take your own path.",
|
||||
@ -22,7 +22,7 @@
|
||||
},
|
||||
"scripts": {
|
||||
"installation": {
|
||||
"script": "#!\/bin\/bash\r\n# Vintage Story Installation Script\r\n#\r\n# Server Files: \/mnt\/server\r\napt update\r\napt -y install curl jq\r\n\r\ndeclare -A API_URLS=(\r\n [\"stable\"]=\"http:\/\/api.vintagestory.at\/stable.json\"\r\n [\"unstable\"]=\"http:\/\/api.vintagestory.at\/unstable.json\"\r\n [\"pre\"]=\"http:\/\/api.vintagestory.at\/pre.json\"\r\n)\r\n\r\ndeclare -A DOWNLOAD_URLS=(\r\n [\"stable\"]=\"https:\/\/cdn.vintagestory.at\/gamefiles\/stable\/vs_server_linux-x64_${RELEASE_VERSION}.tar.gz\"\r\n [\"unstable\"]=\"https:\/\/cdn.vintagestory.at\/gamefiles\/unstable\/vs_server_linux-x64_${RELEASE_VERSION}.tar.gz\"\r\n [\"pre\"]=\"https:\/\/cdn.vintagestory.at\/gamefiles\/pre\/vs_server_linux-x64_${RELEASE_VERSION}.tar.gz\"\r\n)\r\n\r\nBRANCH=\"${FILES_BRANCH}\"\r\n\r\nif [ -z \"${RELEASE_VERSION}\" ] || [ \"${RELEASE_VERSION}\" == \"latest\" ]; then\r\n API_URL=\"${API_URLS[$BRANCH]}\"\r\n DOWNLOAD_URL=$(curl -SsL \"$API_URL\" | jq -r 'if ([.[]] | .[0].linuxserver.urls.cdn) != null then [.[]] | .[0].linuxserver.urls.cdn else [.[]] | .[0].linuxserver.urls.local end')\r\nelse\r\n API_URL=\"${API_URLS[$BRANCH]}\"\r\n DOWNLOAD_URL=\"${DOWNLOAD_URLS[$BRANCH]}\"\r\nfi\r\n\r\necho \"API URL: $API_URL\"\r\necho \"Download URL: $DOWNLOAD_URL\"\r\n\r\ncd \/mnt\/server\/ || exit\r\n\r\n# make sure to cleanup the prior installation else this might cause issue with old asset files that do not exist in the new version\r\nif [ -d \"assets\" ]; then\r\n echo \"Removing old installation files\"\r\n rm -rf assets*\r\n rm -rf Lib*\r\nfi\r\ncurl -o vs_server.tar.gz \"${DOWNLOAD_URL}\"\r\ntar -xzf vs_server.tar.gz\r\n\r\nrm vs_server.tar.gz\r\nrm server.sh\r\n\r\necho \"-----------------------------------------\"\r\necho \"Installation completed...\"\r\necho \"-----------------------------------------\"",
|
||||
"script": "#!\/bin\/bash\r\n# Vintage Story Installation Script\r\n#\r\n# Server Files: \/mnt\/server\r\napt update\r\napt -y install curl jq\r\n\r\ndeclare -A API_URLS=(\r\n [\"stable\"]=\"http:\/\/api.vintagestory.at\/stable.json\"\r\n [\"unstable\"]=\"http:\/\/api.vintagestory.at\/unstable.json\"\r\n)\r\n\r\ndeclare -A DOWNLOAD_URLS=(\r\n [\"stable\"]=\"https:\/\/cdn.vintagestory.at\/gamefiles\/stable\/vs_server_linux-x64_${RELEASE_VERSION}.tar.gz\"\r\n [\"unstable\"]=\"https:\/\/cdn.vintagestory.at\/gamefiles\/unstable\/vs_server_linux-x64_${RELEASE_VERSION}.tar.gz\"\r\n [\"pre\"]=\"https:\/\/cdn.vintagestory.at\/gamefiles\/pre\/vs_server_linux-x64_${RELEASE_VERSION}.tar.gz\"\r\n)\r\n\r\nBRANCH=\"${FILES_BRANCH}\"\r\n\r\nif [ -z \"${RELEASE_VERSION}\" ] || [ \"${RELEASE_VERSION}\" == \"latest\" ] && [ \"${BRANCH}\" == \"pre\" ]; then\r\n echo \"-----------------------------------------\"\r\n echo \"Installation failed...\"\r\n echo \"Please specify the version when using RELEASE BRANCH: pre\"\r\n echo \"-----------------------------------------\" \r\n exit\r\nfi\r\n\r\nif [ -z \"${RELEASE_VERSION}\" ] || [ \"${RELEASE_VERSION}\" == \"latest\" ]; then\r\n API_URL=\"${API_URLS[$BRANCH]}\"\r\n echo \"API URL: $API_URL\"\r\n DOWNLOAD_URL=$(curl -SsL \"$API_URL\" | jq -r 'if ([.[]] | .[0].linuxserver.urls.cdn) != null then [.[]] | .[0].linuxserver.urls.cdn else [.[]] | .[0].linuxserver.urls.local end')\r\nelse\r\n DOWNLOAD_URL=\"${DOWNLOAD_URLS[$BRANCH]}\"\r\nfi\r\n\r\necho \"Download URL: $DOWNLOAD_URL\"\r\n\r\ncd \/mnt\/server\/ || exit\r\n\r\n# make sure to cleanup the prior installation else this might cause issue with old asset files that do not exist in the new version\r\nif [ -d \"assets\" ]; then\r\n echo \"Removing old installation files\"\r\n rm -rf assets\/\r\n rm -rf Lib\/\r\nfi\r\ncurl -o vs_server.tar.gz \"${DOWNLOAD_URL}\"\r\ntar -xzf vs_server.tar.gz\r\n\r\nif [ $? -ne 0 ]; then\r\n echo \"-----------------------------------------\"\r\n echo \"Installation failed...\"\r\n echo \"Please make sure the specified version exists: $RELEASE_VERSION\"\r\n echo \"-----------------------------------------\"\r\n rm vs_server.tar.gz\r\n exit\r\nfi\r\n\r\nrm vs_server.tar.gz\r\nrm server.sh\r\n\r\necho \"-----------------------------------------\"\r\necho \"Installation completed...\"\r\necho \"-----------------------------------------\"",
|
||||
"container": "debian:bullseye-slim",
|
||||
"entrypoint": "bash"
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user