init commit

This commit is contained in:
root
2022-05-14 23:44:31 -05:00
parent f44fff42da
commit 78a175ddf2
5 changed files with 110 additions and 0 deletions

21
downloadpack.sh Normal file
View File

@@ -0,0 +1,21 @@
#!/bin/bash
set -e # Error out immediately on failed line
set +x # Don't print commands as they are run
if [[ -z "${MODPACKID}" ]] || [[ -z "${VERSION}" ]];
then
echo "Invalid MODPACKID or VERSION"
exit 1
fi
# If we're using the latest version (it's not manually specified)
if [ "$VERSION" == "LATEST" ]
# Lookup the latest version available from the API and save it to the version variable
then VERSION=$(curl https://api.modpacks.ch/public/modpack/$MODPACKID/ | jq '.versions[-1].id'); fi;
echo "Downloading installer..."
wget https://api.modpacks.ch/public/modpack/$MODPACKID/$VERSION/server/linux --content-disposition
#echo "Renaming..."
#mv ./serverinstall_"$MODPACKID"_"$VERSION" ./serverinstall
echo "Making it executable..."
chmod +x ./serverinstall_"$MODPACKID"_"$VERSION"