remove parts of the install script that aren't needed

This commit is contained in:
parkervcp 2020-06-25 09:47:11 -04:00
parent 28da8b1273
commit 15b947230d
No known key found for this signature in database
GPG Key ID: 7C5E91D0CB9B1738

View File

@ -3,7 +3,7 @@
"meta": {
"version": "PTDL_v1"
},
"exported_at": "2020-06-25T09:29:23-04:00",
"exported_at": "2020-06-25T09:46:46-04:00",
"name": "tModloader",
"author": "parker@parkervcp.com",
"description": "tModLoader is essentially a mod that provides a way to load your own mods without having to work directly with Terraria's source code itself. This means you can easily make mods that are compatible with other people's mods, save yourself the trouble of having to decompile and recompile Terraria.exe, and escape from having to understand all of the obscure \"intricacies\" of Terraria's source code. It is made to work for Terraria 1.3+.",
@ -17,7 +17,7 @@
},
"scripts": {
"installation": {
"script": "#!\/bin\/bash\r\n# Vanilla tModloader 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 jq file unzip\r\n\r\nGITHUB_PACKAGE=tModLoader\/tModLoader\r\n\r\nif [ -z \"$GITHUB_USER\" ] && [ -z \"$GITHUB_OAUTH_TOKEN\" ] ; then\r\n echo -e \"using anon api call\"\r\nelse\r\n echo -e \"user and oauth token set\"\r\n alias curl='curl -u $GITHUB_USER:$GITHUB_OAUTH_TOKEN '\r\nfi\r\n\r\n## get release info and download links\r\nLATEST_JSON=$(curl --silent \"https:\/\/api.github.com\/repos\/$GITHUB_PACKAGE\/releases\/latest\")\r\nRELEASES=$(curl --silent \"https:\/\/api.github.com\/repos\/$GITHUB_PACKAGE\/releases\")\r\n\r\nif [ -z \"$VERSION\" ] || [ \"$VERSION\" == \"latest\" ]; then\r\n echo -e \"defaulting to latest release\"\r\n DOWNLOAD_LINK=$(echo $LATEST_JSON | jq .assets | jq -r .[].browser_download_url | grep -i linux | grep -i zip)\r\nelse\r\n VERSION_CHECK=$(echo $RELEASES | jq -r --arg VERSION \"$VERSION\" '.[] | select(.tag_name==$VERSION) | .tag_name')\r\n if [ \"$VERSION\" == \"$VERSION_CHECK\" ]; then\r\n DOWNLOAD_LINK=$(echo $RELEASES | jq -r --arg VERSION \"$VERSION\" '.[] | select(.tag_name==$VERSION) | .assets[].browser_download_url' | grep -i linux)\r\n else\r\n echo -e \"defaulting to latest release\"\r\n DOWNLOAD_LINK=$(echo $LATEST_JSON | jq .assets | jq -r .[].browser_download_url | grep -i linux | grep -i zip)\r\n fi\r\nfi\r\n\r\n## clean terraria version\r\nCLEAN_VERSION=$(echo ${TERRARIA_VERSION} | sed 's\/\\.\/\/g')\r\n\r\n## mkdir and cd to \/mnt\/server\/\r\nmkdir -p \/mnt\/server\r\n\r\ncd \/mnt\/server\r\n\r\n## download release\r\necho -e \"running: curl -sSL ${DOWNLOAD_LINK} -o ${DOWNLOAD_LINK##*\/}\"\r\ncurl -sSL ${DOWNLOAD_LINK} -o ${DOWNLOAD_LINK##*\/}\r\n\r\nFILETYPE=$(file -F ',' ${DOWNLOAD_LINK##*\/} | cut -d',' -f2 | cut -d' ' -f2)\r\nif [ \"$FILETYPE\" == \"gzip\" ]; then\r\n tar xzvf ${DOWNLOAD_LINK##*\/}\r\nelif [ \"$FILETYPE\" == \"Zip\" ]; then\r\n unzip -o ${DOWNLOAD_LINK##*\/}\r\nelse\r\n echo -e \"unknown filetype. Exiting\"\r\n exit 2 \r\nfi\r\n\r\necho -e \"Downloading terraria server files\"\r\ncurl -sSL http:\/\/terraria.org\/server\/terraria-server-${CLEAN_VERSION}.zip -o terraria-server-${CLEAN_VERSION}.zip\r\n\r\necho -e \"Unpacking server files\"\r\nunzip terraria-server-$(echo ${CLEAN_VERSION} | sed 's\/\\.\/\/g').zip\r\ncp -R ${CLEAN_VERSION}\/Linux\/* .\/\r\n\r\nchmod +x TerrariaServer.bin.x86_64\r\nchmod +x tModLoaderServer.bin.x86_64\r\nchmod +x tModLoaderServer\r\n\r\necho -e \"Cleaning up extra files.\"\r\nrm -rf ${CLEAN_VERSION} terraria-server-${CLEAN_VERSION}.zip rm ${DOWNLOAD_LINK##*\/}",
"script": "#!\/bin\/bash\r\n# Vanilla tModloader 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 jq file unzip\r\n\r\nGITHUB_PACKAGE=tModLoader\/tModLoader\r\n\r\nif [ -z \"$GITHUB_USER\" ] && [ -z \"$GITHUB_OAUTH_TOKEN\" ] ; then\r\n echo -e \"using anon api call\"\r\nelse\r\n echo -e \"user and oauth token set\"\r\n alias curl='curl -u $GITHUB_USER:$GITHUB_OAUTH_TOKEN '\r\nfi\r\n\r\n## get release info and download links\r\nLATEST_JSON=$(curl --silent \"https:\/\/api.github.com\/repos\/$GITHUB_PACKAGE\/releases\/latest\")\r\nRELEASES=$(curl --silent \"https:\/\/api.github.com\/repos\/$GITHUB_PACKAGE\/releases\")\r\n\r\nif [ -z \"$VERSION\" ] || [ \"$VERSION\" == \"latest\" ]; then\r\n echo -e \"defaulting to latest release\"\r\n DOWNLOAD_LINK=$(echo $LATEST_JSON | jq .assets | jq -r .[].browser_download_url | grep -i linux | grep -i zip)\r\nelse\r\n VERSION_CHECK=$(echo $RELEASES | jq -r --arg VERSION \"$VERSION\" '.[] | select(.tag_name==$VERSION) | .tag_name')\r\n if [ \"$VERSION\" == \"$VERSION_CHECK\" ]; then\r\n DOWNLOAD_LINK=$(echo $RELEASES | jq -r --arg VERSION \"$VERSION\" '.[] | select(.tag_name==$VERSION) | .assets[].browser_download_url' | grep -i linux)\r\n else\r\n echo -e \"defaulting to latest release\"\r\n DOWNLOAD_LINK=$(echo $LATEST_JSON | jq .assets | jq -r .[].browser_download_url | grep -i linux | grep -i zip)\r\n fi\r\nfi\r\n\r\n## mkdir and cd to \/mnt\/server\/\r\nmkdir -p \/mnt\/server\r\n\r\ncd \/mnt\/server\r\n\r\n## download release\r\necho -e \"running: curl -sSL ${DOWNLOAD_LINK} -o ${DOWNLOAD_LINK##*\/}\"\r\ncurl -sSL ${DOWNLOAD_LINK} -o ${DOWNLOAD_LINK##*\/}\r\n\r\nFILETYPE=$(file -F ',' ${DOWNLOAD_LINK##*\/} | cut -d',' -f2 | cut -d' ' -f2)\r\nif [ \"$FILETYPE\" == \"gzip\" ]; then\r\n tar xzvf ${DOWNLOAD_LINK##*\/}\r\nelif [ \"$FILETYPE\" == \"Zip\" ]; then\r\n unzip -o ${DOWNLOAD_LINK##*\/}\r\nelse\r\n echo -e \"unknown filetype. Exiting\"\r\n exit 2 \r\nfi\r\n\r\nchmod +x tModLoaderServer.bin.x86_64\r\nchmod +x tModLoaderServer\r\n\r\necho -e \"Cleaning up extra files.\"\r\nrm -rf terraria-server-${CLEAN_VERSION}.zip rm ${DOWNLOAD_LINK##*\/}",
"container": "debian:buster-slim",
"entrypoint": "bash"
}