Script to run proxy and servers in separate screens?

Discussion in 'Server & Community Management' started by LeeTheENTP, Jan 27, 2015.

  1. I'm in the process of breaking my large server into several smaller servers connected by BungeeCord, and on the Minecraft side everything's working out great. However, I'm trying to create a bash script that runs the BungeeCord proxy and each server in their own screens.

    I have it working to the point at which a screen is created for each server instance (proxy included) and the servers are run, but I'm having trouble ending a server's start script loop.

    Before I made the script below, I manually created each screen and started each server with a start script (the run.sh files being called in the script below). After a server instance was stopped, the run.sh scripts give you 3 seconds to terminate the script with CTRL + C. This functionality still works; however, using CTRL + C now not only stops the run.sh script, but it also terminates that server's screen. I don't want this to be the case. I want CTRL + C to just terminate the server's run.sh script.

    Here is my start script:
    Code (Text):
    #!/bin/bash
    screen -S bungee -d -m sh run.sh;
    cd /home/lee/Servers/Hub;
    screen -S hub -d -m sh run.sh;
    cd /home/lee/Servers/MuricaGaming;
    screen -S murica -d -m sh run.sh;
    cd /home/lee/Servers/Creative;
    screen -S creative -d -m sh run.sh;
    cd /home/lee/Servers/Factions;
    screen -S factions -d -m sh run.sh;
    cd /home/lee/Servers/EHM;
    screen -S ehm -d -m sh run.sh;
     
    #1 LeeTheENTP, Jan 27, 2015
    Last edited: Jan 27, 2015
  2. Looks like latest.log doesn't have permission to write.
     
  3. Yeah, I just realized that only the hub server is having that issue, and fixed it with a simple chown. The other problem is still bugging me though. Let me update the OP.