Start(.sh) script

Discussion in 'BungeeCord Discussion' started by ARGENT, Sep 1, 2013.

  1. Hello! I have BungeeCord with 6 servers. But i don't know what is the best script to start server. Can you give your script? Thank you!
     
  2. joehot200

    Supporter

    while true
    do
    java -Xingc -Xmx10G -jar craftbukkit.jar
    sleep 5
    done
     
    • Like Like x 2
    • Agree Agree x 1
    • Useful Useful x 1
  3. Mine is simple -
    Code (Text):
    cd ~/minecraft/bungee/
    java  -Xmx256M -jar BungeeCord.jar
     
    • Like Like x 1
  4. For me md_5 is GOD, and i want to listen him opinion)
     
    • Funny Funny x 1
  5. joehot200

    Supporter

    Why not add that code for auto-restarting?
    md_5 is not god, he is simply a great guy who does great things. I am not in awe of him, i simply see him as another person who is hard-working, dedicated, kind, and friendly.
     
    • Like Like x 1
  6. Say what you want, but for me md_5 god or king)
     
    • Like Like x 3
    • Winner Winner x 2
    • Agree Agree x 1
    • Funny Funny x 1
  7. i9hdkill

    i9hdkill Retired Moderator
    Retired Supporter

    Bungee or spigot startup script?
    i guess you mean BungeeCord
    Not a script but i dont have to start it often:D

    Code (Text):
    screen -S bungee java -jar BungeeCord.jar
     
  8. joehot200

    Supporter

    It works on both.
     
  9. i9hdkill

    i9hdkill Retired Moderator
    Retired Supporter

    Yes of course but i dont like starting spigot without any xms or xmx variables:)
     
  10. This is mine:
    cd C:\Users\Administrator\Desktop\Hub\
    :loop
    @ECHO ON
    "C:\Program Files (x86)\Java\jre7\bin\java.exe -jar spigot.jar
    @ECHO OFF
    echo ==================================
    echo | Starting Main AppleTreeMC Server |
    echo ==================================

    echo =================
    echo | Starting in 3 |
    echo =================
    ping 192.0.2.2 -n 1 -w 1000 > nul
    echo =================
    echo | Starting in 2 |
    echo =================
    ping 192.0.2.2 -n 1 -w 1000 > nul
    echo =================
    echo | Starting in 1 |
    echo =================
    ping 192.0.2.2 -n 1 -w 1000 > nul
    goto loop

    thankyouuuu libraryaddict. http://www.spigotmc.org/threads/restarting-script.4416/
     
  11. Dmck2b

    Services Staff

    Stop necroing literally every thread in here...
     
  12. I have this one.

    Code (Text):

    #! /bin/bash

    ### BEGIN INIT INFO
    # Provides:   minecraft
    # Required-Start: $local_fs $remote_fs
    # Required-Stop:  $local_fs $remote_fs
    # Should-Start:   $network
    # Should-Stop:    $network
    # Default-Start:  2 3 4 5
    # Default-Stop:   0 1 6
    # Short-Description:    BunGeecord
    # Description:    Starts the BunGeecord server
    ### END INIT INFO

    SERVER='BungeeCord.jar'
    SCREENAME="BungeeCord"
    USER='minecraft'
    HEAP_MAX=512
    HEAP_MIN=512
    HISTORY=32
    HOME="/home/minecraft/${SCREENAME}"
    INVOCATION="java -Xmx${HEAP_MAX}M -Xms${HEAP_MIN}M -jar ${SERVER}"
    ME=`whoami`

    as_user() {
      if [ ${ME} == ${USER} ] ; then
        bash -c "$1"
      else
        su - ${USER} -c "$1"
      fi
    }

    cmd() {
      command="$1";
      logfile="${HOME}/proxy.log.0"
      if server_running
      then
        pre_log_len=`wc -l "${HOME}/proxy.log.0" | awk '{print $1}'`
        as_user "screen -p 0 -S ${SCREENAME} -X eval 'stuff \"${command}\"\015'"
        sleep .2
        V=`wc -l ${logfile} | awk '{print $1}'`-${pre_log_len}
        tail -n $[V] ${logfile}
      else
        echo "${SERVER} was not running. Not able to run command."
      fi
    }

    server_running() {
      if ps ax | grep SCREEN | grep ${SCREENAME} | grep ${SERVER} > /dev/null
      then
        return 0
      else
        return 1
      fi
    }

    start() {
      if server_running
      then
        echo "${SCREENAME} is already running!"
      else
        as_user "cd ${HOME} && screen -h ${HISTORY} -dmS ${SCREENAME} ${INVOCATION}"
        if server_running
        then
          echo "${SCREENAME} is now running."
        else
          echo "Error! Could not start ${SCREENAME}!"
        fi
      fi
    }

    stop() {
      if server_running
      then
        echo "Stopping ${SCREENAME}"
        cmd end
      else
        echo "${SCREENAME} was not running."
      fi
    }

    case "$1" in
      start)
        start
        ;;
      stop)
        stop
        ;;
      restart)
        stop
        sleep 5
        start
        ;;
      status)
        if server_running
        then
          echo "${SCREENAME} is running."
        else
          echo "${SCREENAME} is not running."
        fi
        ;;

      *)
      echo "Usage: $0 {start|stop|status|restart}"
      exit 1
      ;;
    esac

    exit 0
     
     
    • Funny Funny x 3
    • Like Like x 1
    • Useful Useful x 1

  13. md_5 is a god/king, no doubt about that.
     
  14. md_5 = md_5

    That's it
     
    • Agree Agree x 2
    • Like Like x 1
  15.  
  16. What is bad post answer on question in old thread? Why you think write offtopic message like "stop....." is better? If you don't wanna someone write messages in old threads, just limit it by time.
    Many people come from google and other search engine and they don't know nothing about thread time, just search answer.
     
    • Agree Agree x 3
  17. But you didn't ask a question, you have an example, when the OP most likely recieved his answer months ago. It's fine to bump old threads, but they need to have thought and reason behind them. Anyways, if you look at the bottom it tells you the date the message was posted.
     
  18. I'm not even going to bother.

    Maybe go learn how forums work and while your there, work on your english skills too..

    Besides, the answer was posted over 8 months ago.
     
  19. What file would that be.