Guest User

Untitled

a guest
Mar 3rd, 2014
155
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.28 KB | None | 0 0
  1. #!/usr/bin/screen -d -m -S MinecraftServer /bin/bash
  2. #/bin/sh
  3. # Current path
  4. echo "0"
  5. MC_PATH=$(dirname "$(readlink -fn "$0")")
  6. echo "$MC_PATH"
  7. # Minecraft version
  8. MC_VERSION='1.6.4'
  9. # Minecraft port
  10. echo "1"
  11. MC_PORT=$(grep server-port server.properties | cut -d '=' -f 2)
  12. echo "$MC_PORT"
  13. #MC_PORT=$(grep server-port $MC_PATH/server.properties | cut -d '=' -f 2)
  14. # CPU cores
  15. CPU_COUNT=8
  16. # Memory
  17. MEMORY_OPTS='-Xmx3G -Xms1G'
  18. # PermSize
  19. PERMSIZE='128'
  20. PERMSIZE_OPTS="-XX:MaxPermSize=${PERMSIZE}m -XX:PermSize=${PERMSIZE}m"
  21. # Java garbage collection
  22. JAVA_OPTS="-XX:+UseConcMarkSweepGC -XX:+CMSIncrementalPacing -XX:+AggressiveOpts -XX:+UseFastAccessorMethods -XX:ParallelGCThreads=${CPU_COUNT}"
  23. # MCPC+
  24. VERSION='R2.1-forge965-B243'
  25. SERVICE="mcpc-plus-${MC_VERSION}-${VERSION}.jar"
  26. # Forge
  27. #VERSION='9.11.1.965'
  28. #SERVICE="minecraftforge-universal-${MC_VERSION}-${VERSION}.jar"
  29. # Launch server
  30. #Remove the 2 following # for auto restarts
  31. echo "3"
  32. while true
  33. do
  34.     cd "$MC_PATH"
  35.     java -d64 $PERMSIZE_OPTS $MEMORY_OPTS $JAVA_OPTS -Djava.awt.headless=true -jar $SERVICE nogui
  36.     echo "Server shutting down in 3 seconds!"
  37.     sleep 1
  38.     echo "Server shutting down in 2 seconds!"
  39.     sleep 1
  40.     echo "Server shutting down in 1 second!"
  41.     sleep 1
  42.     echo "Shutdown.."
  43. done
Advertisement
Add Comment
Please, Sign In to add comment