Creating a start.sh file will allow Paper and Spigot to restart your server with the /restart command and allow your server to restart automatically after crashes if this setting is enabled in the spigot.yml file. 

Before creating a start.sh file, you'll first need to locate your Prisma API key. Your API key was emailed to you when you first purchased a server in an email entitled "Your new CubedHost account".

Once you have located your API key, create a new text file on your computer named start.txt. Open the start.txt file, then copy and paste the block of code into the text document.

#!/bin/sh
API_KEY="yourAPIKeyHere"
API_EMAIL="yourPrismaEmailAddressHere"
SERVER_ID="yourServerIDHere"

curl -X POST \
-H 'Content-Type: application/json' \
-H 'X-Api-Key: '$API_KEY \
-H 'X-Api-User: '$API_EMAIL \
https://prisma.cubedhost.com/api/server/$SERVER_ID/restart

After copy and pasting the block of code above into the start.txt file, follow these steps:

  1. Replace yourAPIKeyHere with the API key that you found in the email mentioned above.
  2. Replace yourPrismaEmailAddressHere with the email address you use to login to Prisma.
  3. Replace yourServerIDHere with your server's ID. If you're unsure what your server ID is, click the "Manage Server" button for your server and look at the link in the address bar. The number towards the end of the link is your server's ID.
  4. Save the changes and close the file.
  5. Navigate to "Customize" -> "File Manager" in Prisma.
  6. Use the “Upload” feature located towards the top-right of the panel to upload the start.txt file to your server.
  7. Once the upload has completed, rename the start.txt file to start.sh by clicking the name of the file in Prisma's file manager, renaming it, then pressing enter on your keyboard twice save the changes.

You should now be able to restart your server in-game with the /restart command if you're running Paper or Spigot.

Please note: Misuse of start.sh to circumvent our limitations will result in termination of services as per the Abuse section in the Terms of Service. If you're unsure of any modifications you're making to the start.sh  file are allowed, please reach out to our support team using the blue button at the bottom right of the page.

Did this answer your question?