Network Start and Stop Scripts

Discussion in 'Server & Community Management' started by xSinclare, Aug 9, 2016.

Thread Status:
Not open for further replies.
  1. Hey guys! I have spent the past half hour or so looking around Google and trying to work out the best way to make a script to start and stop my network. I think I have worked out a pretty good script and I want to hear from you all on how my scripts look on my bungee and per server. You are free to use if you wish :p

    Code (Text):
    #!/bin/sh

    java -Xms1024M -Xmx1024M -jar BungeeCord.jar
    I found a really cool
    Code (Text):
    #!/bin/sh

    java -Xmx1024M -Xms1024M -XX:+AlwaysPreTouch -XX:+DisableExplicitGC -XX:+UseG1GC -XX:+UnlockExperimentalVMOptions -XX:MaxGCPauseMillis=45 -XX:TargetSurvivorRatio=90 -XX:G1NewSizePercent=50$

    And here are my network start and stop scripts:
    Code (Text):
    #!/bin/bash
    echo -e "\e[95;1mBungee Starting\e[0m"
    sleep 5
    cd ~/bungeecord
    screen -d -m -S bungee ./start.sh
    sleep 5
    echo -e "\e[95;1mBungee Started\e[0m"
    sleep 5
    echo -e "\e[34;1mLobby Starting\e[0m"
    sleep 5
    cd ~/lobby
    screen -d -m -S lobby ./start.sh
    sleep 5
    echo -e "\e[34;1mLobby Started\e[0m"
    sleep 5
    echo -e "\e[33;1mFallback Starting\e[0m"
    sleep 5
    cd ~/Fallback
    screen -d -m -S fallback ./start.sh
    sleep 5
    echo -e "\e[33;1mFallback Started\e[0m"
    sleep 5
    echo -e "\e[32;1mCreative Starting\e[0m"
    sleep 5
    cd ~/creative
    screen -d -m -S creative ./start.sh
    sleep 5
    echo -e "\e[32;1mCreative Started\e[0m"
    sleep 5
    echo -e "\e[32;1mHCF Starting\e[0m"
    sleep 5
    cd ~/hcf
    screen -d -m -S hcf ./start.sh
    sleep 5
    echo -e "\e[32;1mHCF Started\e[0m"
    sleep 5
    echo -e "\e[31;1mBuild Server Starting\e[0m"
    sleep 5
    cd ~/buildserver
    screen -d -m -S build ./start.sh
    sleep 5
    echo -e "\e[31;1mBuild Server Started\e[0m"
    sleep 5
    echo -e "\e[30;1mDev Server Starting\e[0m"
    sleep 5
    cd ~/dev_server
    sleep 5
    screen -d -m -S dev ./start.sh
    echo -e "\e[31;1mDev Server Started\e[0m"
    sleep 5
    echo -e "\e[31;1mAll Servers Started. Task completed.\e[0m"
    sleep 4
    Code (Text):
    #!/bin/sh
    echo -e "\e[95;1mBungee Closing\e[0m"
    echo 5
    screen -p 0 -S bungee -X eval "stuff \"alert The network will be shutting down in 10 seconds!\"\015"
    echo 10
    screen -p 0 -S bungee -X eval "stuff \"end\"\015"
    echo -e "\e[95;1mBungee Closed\e[0m"
    screen -X -S bungee quit
    sleep 5
    echo -e "\e[34;1mClosing Lobby\e[0m"
    screen -p 0 -S lobby -X eval "stuff \"broadcast Server will be shutting down in 10 seconds.\"\015"
    sleep 10
    screen -p 0 -S lobby -X eval "stuff \"stop\"\015"
    echo -e "\e[34;1mLobby Closed\e[0m"
    screen -X -S lobby quit
    sleep 5
    echo -e "\e[33;1mFallback Closing\e[0m"
    screen -p 0 -S fallback -X eval "stuff \"broadcast Server will be shutting down in 10 seconds.\"\015"
    sleep 10
    screen -p 0 -S fallback -X eval "stuff \"stop\"\015"
    echo -e "\e[33;1mFallback Closed\e[0m"
    screen -X -S fallback quit
    sleep 5
    echo -e "\e[32;1mCreative Closing\e[0m"
    screen -p 0 -S creative -X eval "stuff \"broadcast Server will be shutting down in 10 seconds.\"\015"
    sleep 10
    screen -p 0 -S creative -X eval "stuff \"stop\"\015"
    echo -e "\e[32;1mCreative Closed\e[0m"
    screen -X -S creative quit
    sleep 5
    echo -e "\e[32;1mHCF Closing\e[0m"
    screen -p 0 -S hcf -X eval "stuff \"broadcast Server will be shutting down in 10 seconds.\"\015"
    sleep 10
    screen -p 0 -S hcf -X eval "stuff \"stop\"\015"
    echo -e "\e[32;1mHCF Closed\e[0m"
    screen -X -S hcf quit
    sleep 5
    echo -e "\e[31;1mBuild Server Closing\e[0m"
    screen -p 0 -S build -X eval "stuff \"broadcast Server will be shutting down in 10 seconds.\"\015"
    sleep 10
    screen -p 0 -S build -X eval "stuff \"stop\"\015"
    echo -e "\e[31;1mBuild Server Closed\e[0m"
    screen -X -S build quit
    sleep 5
    echo -e "\e[30;1mDev Server Closing\e[0m"
    screen -p 0 -S dev -X eval "stuff \"broadcast Server will be shutting down in 10 seconds.\"\015"
    sleep 10
    screen -p 0 -S dev -X eval "stuff \"stop\"\015"
    echo -e "\e[31;1mDev Server Closed\e[0m"
    screen -X -S dev quit
    sleep 5
    sleep 10
    echo -e "\e[31;1mAll Servers Closed. Task completed.\e[0m"
    echo 4

    I have also created screens specifically for these two so while the network is starting or stopping I can edit other stuff. If you think there is anything I can do to improve this script for my network or anyone else wanting to use this script for their network please comment below. Any and all is appreciated!
     
    #1 xSinclare, Aug 9, 2016
    Last edited: Sep 11, 2016
    • Friendly Friendly x 1
Thread Status:
Not open for further replies.