Creating a Restart Script

Discussion in 'Spigot Help' started by coolbob721, Jun 1, 2016.

  1. Hello,
    I am wondering how to set up a startup script for my server. I know a bit of bash but obviously not enough. Currently, I run my server in a screen for easy access from SSH.
    Here is the script to start the screen and the server, called "run-screen-spigot":
    Code (Text):
    #!/bin/bash
    screen -m -d -S minecraft ./run-spigot
    And here is "run-spigot", my startup script:
    Code (Text):
    #!/bin/bash
    java -Xmx1024M -Xms1024M -jar spigot.jar
    Neither are ".sh" files (unneeded) but both scripts have execute permissions.

    I tried pointing Spigot to "run-screen-spigot" but nothing happened. A screen wasn't generated and the server did not start.

    My question is: How would I set up a restart script to use Spigot's /restart command with my current setup? (Shutting down the server and then starting it inside of a screen again). I'm not really a fan of those scripts that never allow you to shutdown the server without doing Ctrl-C and I would like to be able to choose between /stop and /restart if possible.

    Thanks.
     
  2. Does the "run-screen-spigot.sh" work?
     
  3. Maybe you have to change the startup script in your spigot.yml