NPCKiller

Start

Aug 13th, 2016
181
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.58 KB | None | 0 0
  1. #!/bin/sh
  2.  
  3. cd "$(dirname "$0")"
  4. . ./settings.sh
  5.  
  6. # makes things easier if script needs debugging
  7. if [ x$FTB_VERBOSE = xyes ]; then
  8. set -x
  9. fi
  10.  
  11. # cleaner code
  12. eula_false() {
  13. grep -q 'eula=false' eula.txt
  14. return $?
  15. }
  16.  
  17. start_server() {
  18. "$JAVACMD" -server -Xms1024M -Xmx8192M -XX:PermSize=1024M -XX:+UseParNewGC -XX:+CMSIncrementalPacing -XX:+CMSClassUnloadingEnabled -XX:ParallelGCThreads=2 -XX:MinHeapFreeRatio=5 -XX:MaxHeapFreeRatio=10 -jar FTBServer-1.7.10-1614.jar nogui
  19. }
  20.  
  21. # run install script if MC server or launchwrapper s missing
  22. if [ ! -f $JARFILE -o ! -f libraries/$LAUNCHWRAPPER ]; then
  23. echo "Missing required jars. Running install script!"
  24. sh ./FTBInstall.sh
  25. fi
  26.  
  27. # check if there is eula.txt and if it has correct content
  28. if [ -f eula.txt ] && eula_false ; then
  29. echo "Make sure to read eula.txt before playing!"
  30. echo "To exit press <enter>"
  31. read ignored
  32. exit
  33. fi
  34.  
  35. # inform user if eula.txt not found
  36. if [ ! -f eula.txt ]; then
  37. echo "Missing eula.txt. Startup will fail and eula.txt will be created"
  38. echo "Make sure to read eula.txt before playing!"
  39. echo "To continue press <enter>"
  40. read ignored
  41. fi
  42.  
  43. echo "Starting server"
  44. rm -f autostart.stamp
  45. start_server
  46.  
  47. while [ -e autostart.stamp ] ; do
  48. rm -f autostart.stamp
  49. echo "If you want to completely stop the server process now, press Ctrl+C before the time is up!"
  50. for i in 5 4 3 2 1; do
  51. echo "Restarting server in $i"
  52. sleep 1
  53. done
  54. echo "Rebooting now!"
  55. start_server
  56. echo "Server process finished"
  57. done
Advertisement
Add Comment
Please, Sign In to add comment