CreeperHost Server Restart Script (For /restart Command)

Discussion in 'Server & Community Management' started by TechieCrow, Feb 19, 2016.

  1. (Quick note: I don't know how to get this to work with multiple Minecraft instances yet as I don't know how to select the diffrent instances in order to control them using the API but I'm working on figuring it out, I am also making a plugin that will basically do the same thing as this if it's easier for you.)

    This is a very simple script that uses CreeperHost's API to restart your Minecraft server when using the /restart command, as you may know using the /restart command to restart your server won't work, this is because 1. there is no start.sh int he minecraft directory and 2. If it did the console won't show on the control panel.

    KEEP YOUR API DETAILS SECRET, DO NOT TELL ANYONE!

    How to Use:
    1: Make a new API key:
    [​IMG]

    2: Give the API key permissions:
    [​IMG]


    3: Upload the script to the main directory:
    [​IMG]

    4: Edit the script:
    [​IMG]

    45 Now for the hard part - We need to change the script permissions so it can be ran, if you do not already know how to connect to Creeperhost VPS's using sFTP clients please refer to one of these guides, I will be using WinSCP but CyberDuck is fine too.

    http://wiki.creeperlabs.com/index.php/WinSCP_sFTP
    Or
    http://wiki.creeperlabs.com/index.php/CyberDuck_sFTP

    When you are connected:

    [​IMG]
    [​IMG]

    56 run /restart on your server to see if you have done everything correctly then if the server restarts *High fives* you're all done, if not please post here and let me know the detail of your problem WITHOUT posting your API details. :)

    Feel free to edit this if you want to it's nothing fancy, it just makes a HTTPS POST request to CreeperHost's API to restart the server... Simple.

    (Save as start.sh)
    Code (Text):

    #!/bin/bash

    Key=""

    Secret=""

    Service="minecraft"

    Command="restartserver"

    curl --data "key=$Key&secret=$Secret&service=$Service&command=$Command" https://api.creeper.host/
     
    I have also made this into a standalone resource but since the resource staff are taking FOREVER to approve it I decided to post it here for you.
     
    #1 TechieCrow, Feb 19, 2016
    Last edited: Feb 19, 2016
  2. #!/bin/bash
    while true; do
    java -server -Xmx2G -XX:MaxPermSize=2G -jar spigot.jar
    done;
     
  3. You didn't read my post at all did you?